query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
8193bd2599503be2567b49ddee05206c
Description: Function used to monitor the ipfs swarm Input: ipfs: reference to the ipfs client db: referenct to a sql database connectionused to save the monitoring results
[ { "docid": "95284dec72fe55bb35abfe51b42c0c1d", "score": "0.6396516", "text": "async function monitorSwarm(ipfs,db){\n\n var SQLtime = DB.sqlDate();\n try{\n const peersInfos = await ipfs.swarm.peers({verbose:true,latency:true,direction:true}) //call the IPFS SWARM PEERS command\n peersInfos.forEach(peer => {\n\n var peer_id = peer.peer\n var multiadd, peer_ip, peer_ip_fam, peer_ip_port,direction = \"\"\n try{\n //get the IP informations from the multiaddress\n multiadd = multiaddr(peer.addr)\n peer_ip = multiadd.nodeAddress().address\n peer_ip_fam = multiadd.nodeAddress().family\n peer_ip_port = multiadd.nodeAddress().port\n direction = peer.direction\n }catch(error){console.log(`Multiaddress error -> ${peer.addr}`)}\n \n var peer_loc = \"\"\n try{peer_loc = geoip.lookup(peer_ip).country}catch(error){} //locate the ip location with the geoip-lite library\n \n\n DB.saveSWARMcheck(db,peer_id,peer.addr,peer_ip_fam,peer_ip,peer_ip_port,peer_loc,peer.latency,direction,SQLtime,lastCheck); //save the result on the DB\n\n })\n lastCheck = SQLtime\n console.log(`SWARM SIZE -> ${peersInfos.length}`)\n }catch(error){Console.log(\"Monitor swarm error\")}\n\n}", "title": "" } ]
[ { "docid": "46bfa2a00ea5e0c38985e34f19318cd1", "score": "0.6198734", "text": "async function main (IPFSdaemon,DBhost,DBport,DBuser,DBpsw,DBname,interval) {\n interval = interval * 60000 //intervals in millisec between monitoring sessions\n var db = DB.connectDB(DBhost,DBport,DBuser,DBpsw,DBname) //connect to the db\n\n const ipfs = ipfsClient(IPFSdaemon)\n var node_cid = await ipfs.id();// client cid\n\n while(1) {\n console.log(\"New check: \"+getTime())\n await Promise.all([monitorSwarm(ipfs,db), monitorDHTtable(ipfs,db,node_cid.id)]);\n\n console.log(\"-------------------------------------------\")\n await sleep.sleep(interval);\n };\n \n }", "title": "" }, { "docid": "33bbd056469447f93151d3b13bd9cb05", "score": "0.5884249", "text": "function monitorInputProcess(args)\n{\t\n\t//<METRIC_STATE> \n\tvar metricState = args[0].replace(\"\\\"\", \"\");\n\t\n\tvar tokens = metricState.split(\",\");\n\n\tvar metricsExecution = new Array(metricsLength);\n\n\tfor(var i in tokens)\n\t{\n\t\tmetricsExecution[i] = (tokens[i] === \"1\")\n\t}\n\n\t//<HOST> \n\tvar hostname = args[1];\n\t\n\t//<PORT>\n\tvar port = args[2];\n\t\n\t\n\t//<USER_NAME> \n\tvar username = args[3];\n\t\n\tusername = username.length === 0 ? \"\" : username;\n\tusername = username === \"\\\"\\\"\" ? \"\" : username;\n\tif(username.length === 1 && username === \"\\\"\")\n\t\tusername = \"\";\n\t\n\t//<PASS_WORD>\n\tvar passwd = args[4];\n\t\n\tpasswd = passwd.length === 0 ? \"\" : passwd;\n\tpasswd = passwd === \"\\\"\\\"\" ? \"\" : passwd;\n\tif(passwd.length === 1 && passwd === \"\\\"\")\n\t\tpasswd = \"\";\n\t\n\t\n\t//create connection URI\n\tvar connectionURI = \"\";\n\n\tif (username.length === 0)\n\t{\n\t\tif (port.length === 0)\n\t\t{\n\t\t\tconnectionURI = \"mongodb://\" + hostname;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconnectionURI = \"mongodb://\" + hostname + \":\" + port;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (port.length === 0)\n\t\t{\n\t\t\tconnectionURI = \"mongodb://\" + username + \":\" + passwd + \"@\" + hostname;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconnectionURI = \"mongodb://\" + username + \":\" + passwd + \"@\" + hostname + \":\" + port;\n\t\t}\n\t}\n\t\n\t\n\t//create request object to be executed\n\tvar requests = []\n\t\n\tvar request = new Object();\n\trequest.connectionURI = connectionURI + \"/\" + mongodb;\n\trequest.metricsExecution = metricsExecution;\n\trequest.hostname = hostname;\n\trequest.port = port\n\t\n\trequests.push(request)\n\n\t//call monitor\n\tmonitorDatabasePerformance(requests);\n\t\n}", "title": "" }, { "docid": "021ad2821aa2d6bfe93ee62b9f7a63b1", "score": "0.54632217", "text": "function mainMonitor() {\n // queueDisk.addEvent() listen.... todo\n onNewDevEvent(() => {\n console.warn(\"newDevEvent\");\n\n // //step1 get new dev info and update view\n // sendGlobalUpdate();//global view update(from store)\n //\n // //setp check2 ntfs and update\n // if (action === NTFS_Mount) {\n // workerDisk.autoMount(function () {\n // sendGlobalUpdate();//global view update again\n // });\n // }\n })\n\n}", "title": "" }, { "docid": "163b65d5facd59711bead755fb681c47", "score": "0.5177085", "text": "function main()\r\n{\r\n\t// Get the collector object (see mon_utils)\r\n\tcollector = getCollector();\r\n\tif(collector == null) { \r\n\t\tresult.status = result.STATUS_FAILED;\r\n\t\tresult.msg = \"Collector process is not running\";\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Form our command (WMI_QUERY query)\r\n\t// Note. Filter instances to only the named service we want\r\n\tcmd = collector.makeCommand([\"wmi_query\", \"hostname=\"+hostname, \"username=\"+username, \"password=\"+password, \"query=Select LastAccessed, LastModified, FileSize from CIM_DataFile where Name=\\\"\"+filename+\"\\\"\"]);\r\n\t// Send the command to the collector and get the output response\r\n\tresponse = collector.sendCommand(cmd);\r\n\r\n\tif(response.indexOf(\"ERROR\") >= 0) {\r\n\t\t// If response string starts with error, something went wrong\r\n\t\tif(response.indexOf(\"No results\") >= 0) {\r\n\t\t\tif(typeof(ignore_missing) !== 'undefined' && ignore_missing.toLowerCase() == 'true') {\r\n\t\t\t\tresult.status = result.STATUS_GOOD\r\n\t\t\t\tresult.msg = \"File not found, but ignored\"\t\r\n\t\t\t\tresult.value = 0;\r\n\t\t\t\treturn;\r\n\t\t\t} else { \r\n\t\t\t\t// Zero results means file doesn't exist\r\n\t\t\t\tresult.status = result.STATUS_ERROR\r\n\t\t\t\tresult.msg = \"File not found\"\t\r\n\t\t\t}\t\t\t\r\n\t\t} else {\r\n\t\t\t// Some other error\r\n\t\t\tresult.status = result.STATUS_FAILED;\r\n\t\t\tresult.msg = response;\r\n\t\t}\r\n\t} else {\r\n\t\tparts = response.split(\",\");\r\n\t\tresult.value = parts[0].split('=')[1] / 1024;\r\n\t\tresult.msg = \"Last modified: \"+wmiDateToReadable(parts[2].split('=')[1]);\r\n\t}\r\n}", "title": "" }, { "docid": "02e47e9b54e0038fa7923f731b1c6913", "score": "0.5170179", "text": "function checkIPinDB(ip,queryforAutoD,logFile){\n\tvar url = getURL(\"ConfigEditor2\",\"JSON\");\n\tvar action = \"checkdeviceindb\";\n\tvar queryObj = {'QUERY':[{'managementip':ip,\n\t\t'consoleip':'','hostname':''}]};\n\tvar queryStr = JSON.stringify(queryObj);\n\t$.ajax ({\n\t\turl: url,\n\t\tdata: { action: action, query: queryStr },\n\t\tdataType: 'html',\n\t\tsuccess: function (data) {\n\t\t\tdat2 = data.replace(/'/g,'\"');\n\t\t\tvar dat = $.parseJSON(dat2);\n\t\t\tvar res = dat.RESULT[0].Result;\n\t\t\tif(res=='1'){\n\t\t\t\tsendQueryForAddPDU(queryforAutoD,logFile,ip);\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\talertUser(res);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "db6833f24bc22cfdeaaf88eaa80882d8", "score": "0.51220423", "text": "function Analyze()\n{\n // Assume failure\n var RC = false;\n var Txt = \"\";\n\n Txt = \"Loading ISF file:\\n\" + ISFAbsolutePath;\n WScript.StdOut.WriteLine( Txt );\n\n // Load the item store file\n var Handle = IISF.LoadItemStore( ISFAbsolutePath );\n if (Handle == 0xFFFFFFFF)\n {\n Txt = \"Unable to load ISF:\\n\" + ISFAbsolutePath;\n WScript.StdOut.WriteLine( Txt );\n\n return RC;\n }\n\n var IClient = IISF.GetClientInterface( Handle );\n if (IClient == null)\n {\n Txt = \"Unable to obtain ISF client interface\";\n WScript.StdOut.WriteLine( Txt );\n\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n var ClientHandle = IClient.RegisterClient( true );\n if (ClientHandle == 0xFFFFFFFF)\n {\n Txt = \"Unable to register ISF client\";\n WScript.StdOut.WriteLine( Txt );\n\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n var IConfig = IClient.ConfigureClient( ClientHandle );\n if (IConfig == null)\n {\n Txt = \"Unable to configure ISF client\";\n WScript.StdOut.WriteLine( Txt );\n\n IClient.UnregisterClient( ClientHandle );\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n Txt = \"Processing ISF file...\";\n WScript.StdOut.Write( Txt );\n\n // Configure the client for supported log keys\n IConfig.AddLog( 0x4017 );\n IConfig.AddLog( 0x413F );\n IConfig.CommitConfig();\n\n // Populate the client with all instances of supported logs\n IClient.PopulateClients();\n\n // Success/any items found?\n var ItemCount = IClient.GetClientItemCount( ClientHandle );\n if (ItemCount == 0)\n {\n Txt = \"Unable to find required data for processing\";\n WScript.StdOut.WriteLine( Txt );\n\n IClient.UnregisterClient( ClientHandle );\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n // Initialize array\n for (var c = MIN_ENERGY; c <= MAX_ENERGY; c++)\n {\n gAllEnergy[c] = 0;\n gCampedEnergy[c] = 0;\n }\n\n // Process all items in the client\n for (var ItemIndex = 0; ItemIndex < ItemCount; ItemIndex++)\n {\n var Item = IClient.GetClientItem( ClientHandle, ItemIndex );\n if (Item == null)\n {\n continue;\n }\n\n var Fields = Item.GetConfiguredItemFields( \"\", false, false );\n if (Fields == null)\n {\n continue;\n }\n\n var FieldCount = Fields.GetFieldCount();\n if (FieldCount < 2)\n {\n continue;\n }\n\n // Number of specified tasks\n var TasksCount = Fields.GetFieldValue( 1 );\n if (TasksCount <= 0)\n {\n continue;\n }\n\n var FieldCount = Fields.GetFieldCount();\n if (FieldCount < 2 + (TasksCount * 19))\n {\n continue;\n }\n\n var BestAll = -1000.0;\n var BestCamped = -1000.0;\n\n // Process each task computing combined energy\n var FI = 2;\n var FO = TasksCount * 10;\n for (var t = 0; t < TasksCount; t++, FI += 10, FO += 9)\n {\n var CellSet = Fields.GetFieldValue( FI + 5 );\n\n var N = Fields.GetFieldValue( FI );\n var M = Fields.GetFieldValue( FI + 1 );\n if (N == 0 || M == 0)\n {\n continue;\n }\n\n var Sum = Fields.GetFieldValue( FO + 6 );\n Sum += Fields.GetFieldValue( FO + 7 );\n Sum += Fields.GetFieldValue( FO + 8 );\n Sum += Fields.GetFieldValue( FO + 9 );\n\n var Num = Sum - (0.1406 * M * N);\n var Den = 0.1406 * M * N * N;\n\n var Tmp = Num / Den;\n if (Tmp <= 0)\n {\n continue;\n }\n\n var Energy = 10.0 * Math.LOG10E * Math.log( Tmp );\n\n // Camped?\n if (CellSet == 0)\n {\n if (Energy > BestCamped)\n {\n BestCamped = Energy;\n }\n }\n\n if (Energy > BestAll)\n {\n BestAll = Energy;\n }\n }\n\n BestAll = Math.round( BestAll );\n BestCamped = Math.round( BestCamped );\n\n if (BestAll >= MIN_ENERGY && BestAll <= MAX_ENERGY)\n {\n gAllSamples++;\n gAllEnergy[BestAll] += 1;\n }\n\n if (BestCamped >= MIN_ENERGY && BestCamped <= MAX_ENERGY)\n {\n gCampedSamples++;\n gCampedEnergy[BestCamped] += 1;\n }\n }\n\n Txt = \"Done\";\n WScript.StdOut.WriteLine( Txt );\n\n if (gAllSamples == 0 || gCampedSamples == 0)\n {\n Txt = \"Unable to find required data for processing\";\n WScript.StdOut.WriteLine( Txt );\n\n return RC;\n }\n\n IClient.UnregisterClient( ClientHandle );\n IISF.CloseItemStore( Handle );\n\n RC = true;\n return RC;\n}", "title": "" }, { "docid": "d3e464321ce5f993090edcbc95abfe7e", "score": "0.500456", "text": "function monitorInputProcess(args)\n{\n\t//<METRIC_STATE>\n\tvar metricState = args[0].replace('\"', '');\n\tvar tokens = metricState.split(',');\n\tvar metricsExecution = new Array(7);\n\tfor (var i in tokens)\n\t\tmetricsExecution[i] = (tokens[i] === '1');\n\t\n\t//<HOST> \n\tvar hostname = args[1];\n\t\n\t//<PORT> \n\tvar port = args[2];\n\tif (port.length === 0)\n\t\tport = '6379';\n\t\t\n\t// <USER_NAME> \n\tvar username = args[3];\n\tusername = username.length === 0 ? '' : username;\n\tusername = username === '\"\"' ? '' : username;\n\tif (username.length === 1 && username === '\"')\n\t\tusername = '';\n\t\n\t// <PASS_WORD>\n\tvar passwd = args[3];\n\tpasswd = passwd.length === 0 ? '' : passwd;\n\tpasswd = passwd === '\"\"' ? '' : passwd;\n\tif (passwd.length === 1 && passwd === '\"')\n\t\tpasswd = '';\n\n\t// Create request object to be executed.\t\n\tvar request = new Object();\n\trequest.checkMetrics = metricsExecution;\n\trequest.hostname = hostname;\n\trequest.port = port;\n\trequest.passwd = passwd;\n\t\n\t// Call monitor.\n\tmonitorRedis(request);\n}", "title": "" }, { "docid": "2397534cfbd29b9924e5db60e52eb04f", "score": "0.4991413", "text": "function Analyze()\n{\n // Assume failure\n var RC = false;\n var Txt = \"\";\n\n Txt = \"Loading ISF file:\\n\" + ISFAbsolutePath;\n WScript.StdOut.WriteLine( Txt );\n\n // Load the item store file\n var Handle = IISF.LoadItemStore( ISFAbsolutePath );\n if (Handle == 0xFFFFFFFF)\n {\n Txt = \"Unable to load ISF:\\n\" + ISFAbsolutePath;\n WScript.StdOut.WriteLine( Txt );\n\n return RC;\n }\n\n var IClient = IISF.GetClientInterface( Handle );\n if (IClient == null)\n {\n Txt = \"Unable to obtain ISF client interface\";\n WScript.StdOut.WriteLine( Txt );\n\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n var ClientHandle = IClient.RegisterClient( true );\n if (ClientHandle == 0xFFFFFFFF)\n {\n Txt = \"Unable to register ISF client\";\n WScript.StdOut.WriteLine( Txt );\n\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n var IConfig = IClient.ConfigureClient( ClientHandle );\n if (IConfig == null)\n {\n Txt = \"Unable to configure ISF client\";\n WScript.StdOut.WriteLine( Txt );\n\n IClient.UnregisterClient( ClientHandle );\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n Txt = \"Processing ISF file...\";\n WScript.StdOut.Write( Txt );\n\n // Configure the client for log 0x108A\n IConfig.AddLog( 0x108A );\n IConfig.CommitConfig();\n\n // Populate the client with all instances of log 0x108A\n IClient.PopulateClients();\n\n // Success/any items found?\n var ItemCount = IClient.GetClientItemCount( ClientHandle );\n if (ItemCount == 0)\n {\n Txt = \"Unable to find required data for processing\";\n WScript.StdOut.WriteLine( Txt );\n\n IClient.UnregisterClient( ClientHandle );\n IISF.CloseItemStore( Handle );\n return RC;\n }\n\n // Initialize arrays\n for (var Finger = 0; Finger <= MAX_FINGERS; Finger++)\n {\n gLockedGood[Finger] = 0;\n gLockedStrong[Finger] = 0;\n gLockedVeryStrong[Finger] = 0;\n gLockedFingerArray[Finger] = 0;\n }\n\n // Process all items in the client\n for (var ItemIndex = 0; ItemIndex < ItemCount; ItemIndex++)\n {\n var Item = IClient.GetClientItem( ClientHandle, ItemIndex );\n if (Item == null)\n {\n continue;\n }\n\n var Fields = Item.GetConfiguredItemFields( \"\", false, false );\n if (Fields == null)\n {\n continue;\n }\n\n var FieldCount = Fields.GetFieldCount();\n if (FieldCount < 6)\n {\n continue;\n }\n\n gSamples++;\n\n var Good = 0;\n var Strong = 0;\n var LockedFing = 0;\n var VeryStrong = 0;\n\n // Start of finger record\n var FieldIndex = 5;\n\n // Number of fingers\n var FingCount = Fields.GetFieldValue( 4 );\n if (FingCount > MAX_FINGERS)\n {\n FingCount = MAX_FINGERS;\n }\n\n for (var Finger = 0; Finger < FingCount; Finger++, FieldIndex += 11)\n {\n var PN = Fields.GetFieldValue( FieldIndex );\n if (PN == 0xFFFF)\n {\n continue;\n }\n\n var Locked = Fields.GetFieldValue( FieldIndex + 3 );\n if (Locked != 1)\n {\n continue;\n }\n\n LockedFing++;\n\n var RSSI = Fields.GetFieldValue( FieldIndex + 2 );\n if (RSSI == 0)\n {\n continue;\n }\n\n // Convert RSSI value to dB\n RSSI = 10.0 * Math.LOG10E * Math.log( RSSI / 512.0 );\n\n // Good signal strength\n if (RSSI >= -13.0)\n {\n Good++;\n }\n\n // Strong signal strength\n if (RSSI >= -10.0)\n {\n Strong++;\n }\n\n // Very strong signal strength\n if (RSSI >= -7.0)\n {\n VeryStrong++;\n }\n }\n\n gLockedGood[Good] += 1;\n gLockedStrong[Strong] += 1;\n gLockedVeryStrong[VeryStrong] += 1;\n gLockedFingerArray[LockedFing] += 1;\n }\n\n Txt = \"Done\";\n WScript.StdOut.WriteLine( Txt );\n\n if (gSamples == 0)\n {\n Txt = \"Unable to find required data for processing\";\n WScript.StdOut.WriteLine( Txt );\n\n return RC;\n }\n\n RC = true;\n return RC;\n}", "title": "" }, { "docid": "a80a19f5c1cb6d41ca1b690fe3bb045d", "score": "0.49898496", "text": "function monitorDatabasePerformance(requests) \n{\n\tvar mongodb = require('mongodb');\n\t\n\t//Create mongoDB client\n\tvar MongoClient = mongodb.MongoClient\n\t\n\tfor(var i in requests)\n\t{\n\t\tvar request = requests[i];\n\t\t\n\t\t//try connection\n\t\tMongoClient.connect(request.connectionURI, function(err, db) {\n\n\t\t\tif (err && err.message === \"auth failed\") \n\t\t\t{\n\t\t\t\terrorHandler(new InvalidAuthenticationError());\n\t\t\t}\n\t\t\telse if(err)\n\t\t\t{\n\t\t\t\tvar e = new DatabaseConnectionError();\n\t\t\t\te.message = err.message;\n\t\t\t\terrorHandler(e);\n\t\t\t}\n\t\t\t\n\t\t\t//get data\n\t\t\tdb.command({ serverStatus: 1 }, function(err, result) {\n\t\t\t\t\n\t\t\t\tif(err)\n\t\t\t\t{\n\t\t\t\t\tvar e = new DatabaseConnectionError();\n\t\t\t\t\te.message = err.message;\n\t\t\t\t\terrorHandler(e);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tvar metricsName = Object.keys(metrics);\n\t\t\t\t\n\t\t\t\tvar jsonString = \"[\";\n\t\t\t\t\n\t\t\t\tvar dateTime = new Date().toISOString();\n\t\t\t\t\n\t\t\t\tfor(var i in metricsName)\n\t\t\t\t{\n\t\t\t\t\tif(request.metricsExecution[i])\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//split to find metric in result\n\t\t\t\t\t\tvar path = metricsName[i].split(\"\\.\")\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (path.length > 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (typeof result[path[0]][path[1]][path[2]] != 'undefined')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tjsonString += \"{\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjsonString += \"\\\"variableName\\\":\\\"\"+metricsName[i]+\"\\\",\";\n\t\t\t\t\t\t\t\tjsonString += \"\\\"metricUUID\\\":\\\"\"+metrics[metricsName[i]].id+\"\\\",\";\n\t\t\t\t\t\t\t\tjsonString += \"\\\"timestamp\\\":\\\"\"+ dateTime +\"\\\",\";\n\t\t\t\t\t\t\t\tjsonString += \"\\\"value\\\":\\\"\"+ result[path[0]][path[1]][path[2]] +\"\\\"\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjsonString += \"},\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar newError = new MetricNotFoundError();\n\t\t\t\t\t\t\t\tnewError.message = \"Unable to collect metric \" + metrics[metricsName[i]].id;\n\t\t\t\t\t\t\t\terrorHandler(newError);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(path.length > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (result[path[0]] !== undefined)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (typeof result[path[0]][path[1]] != 'undefined')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tjsonString += \"{\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tjsonString += \"\\\"variableName\\\":\\\"\"+metricsName[i]+\"\\\",\";\n\t\t\t\t\t\t\t\t\tjsonString += \"\\\"metricUUID\\\":\\\"\"+metrics[metricsName[i]].id+\"\\\",\";\n\t\t\t\t\t\t\t\t\tjsonString += \"\\\"timestamp\\\":\\\"\"+ dateTime +\"\\\",\";\n\t\t\t\t\t\t\t\t\tjsonString += \"\\\"value\\\":\\\"\"+ result[path[0]][path[1]] +\"\\\"\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tjsonString += \"},\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar newError = new MetricNotFoundError()\n\t\t\t\t\t\t\t\t\tnewError.message = \"Unable to collect metric \" + metrics[metricsName[i]].id;\n\t\t\t\t\t\t\t\t\terrorHandler(newError);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar value = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(metricsName[i] === \"GLOBAL_LOCK_RATIO_UUID\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar locktime = result.globalLock.lockTime;\n\t\t\t\t\t\t\t\tvar totaltime = result.globalLock.totalTime;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (locktime === undefined)\n\t\t\t\t\t\t\t\t\tlocktime = 0;\n\n\t\t\t\t\t\t\t\tif(typeof locktime != 'undefined' && typeof totaltime != 'undefined')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(totaltime != 0)\n\t\t\t\t\t\t\t\t\t\tvalue = (locktime / totaltime).toFixed(2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar newError = new MetricNotFoundError()\n\t\t\t\t\t\t\t\t\tnewError.message = \"Unable to collect metric \" + metrics[metricsName[i]].id;\n\t\t\t\t\t\t\t\t\terrorHandler(newError);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(metricsName[i] === \"BTREE_MISS_PAGE_RATIO_UUID\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (result.indexCounters !== undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar missRatio = result.indexCounters.missRatio;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(typeof missRatio != 'undefined')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue = missRatio.toFixed(2);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar newError = new MetricNotFoundError()\n\t\t\t\t\t\t\t\t\t\tnewError.message = \"Unable to collect metric \" + metrics[metricsName[i]].id;\n\t\t\t\t\t\t\t\t\t\terrorHandler(newError);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjsonString += \"{\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjsonString += \"\\\"variableName\\\":\\\"\"+metricsName[i]+\"\\\",\";\n\t\t\t\t\t\t\tjsonString += \"\\\"metricUUID\\\":\\\"\"+metrics[metricsName[i]].id+\"\\\",\";\n\t\t\t\t\t\t\tjsonString += \"\\\"timestamp\\\":\\\"\"+ dateTime +\"\\\",\";\n\t\t\t\t\t\t\tjsonString += \"\\\"value\\\":\\\"\"+ value +\"\\\"\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjsonString += \"},\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(jsonString.length > 1)\n\t\t\t\t\tjsonString = jsonString.slice(0, jsonString.length-1);\n\t\t\t\t\n\t\t\t\tjsonString += \"]\";\n\t\t\t\t\n\t\t\t\t//send to process ratio values and save result in file\n\t\t\t\tprocessDeltas(request, jsonString);\n\t\t\t\t\n\t\t\t\tdb.close();\n\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "8ec96edd1edaf5b1b3a4d2c91e9ac26d", "score": "0.49268302", "text": "function startApp() {\n Owners.init();\n TXID.blocknumber = 0\n if(config.ipfshost == 'ipfs')ipfs.id(function (err, res) {\n if(err){}\n if(res)plasma.id = res.id\n })\n processor = hiveState(client, startingBlock, config.prefix, config.username);\n processor.on('send', HR.send);\n processor.on('claim', HR.claim);\n processor.on('node_add', HR.node_add);\n //processor.on('node_delete', HR.node_delete);\n processor.on('report', HR.report);\n processor.on('gov_down', HR.gov_down);\n processor.on('gov_up', HR.gov_up);\n processor.onOperation('account_update', HR.account_update);\n processor.onOperation('comment', HR.comment);\n processor.on('queueForDaily', HR.q4d)\n processor.on('nomention', HR.nomention)\n if(config.features.pob){\n processor.on('power_up', HR.power_up); // power up tokens for vote power in layer 2 token proof of brain\n processor.on('power_down', HR.power_down);\n processor.on('power_grant', HR.power_grant);\n processor.on('vote_content', HR.vote_content);\n processor.onOperation('vote', HR.vote) //layer 2 voting\n processor.onOperation('delegate_vesting_shares', HR.delegate_vesting_shares);\n processor.onOperation('comment_options', HR.comment_options);\n processor.on('cjv', HR.cjv);\n processor.on('cert', HR.cert); // json.cert is an open ended hope to interact with executable posts... unexplored\n }\n if(config.features.dex){\n processor.on('dex_sell', HR.dex_sell);\n processor.on('dex_clear', HR.dex_clear);\n processor.on('sig_submit', HR.sig_submit); //dlux is for putting executable programs into IPFS... this is for additional accounts to sign the code as non-malicious\n processor.on('osig_submit', HR.osig_submit);\n }\n if(config.features.dex || config.features.nft || config.features.ico){\n processor.onOperation('transfer', HR.transfer);\n }\n if(config.features.nft){\n processor.on('ft_bid', HR.ft_bid)\n processor.on('ft_auction', HR.ft_auction)\n processor.on('ft_sell_cancel', HR.ft_sell_cancel)\n processor.on('ft_buy', HR.ft_buy)\n processor.on('ft_sell', HR.ft_sell)\n processor.on('ft_escrow_cancel', HR.ft_escrow_cancel)\n processor.on('ft_escrow_complete', HR.ft_escrow_complete)\n processor.on('ft_escrow', HR.ft_escrow)\n processor.on('fts_sell_h', HR.fts_sell_h)\n processor.on('fts_sell_hcancel', HR.fts_sell_hcancel)\n processor.on('nft_buy', HR.nft_buy)\n processor.on('nft_sell', HR.nft_sell)\n processor.on('nft_sell_cancel', HR.nft_sell_cancel)\n processor.on('ft_transfer', HR.ft_transfer)\n processor.on('ft_airdrop', HR.ft_airdrop)\n processor.on('nft_transfer', HR.nft_transfer)\n processor.on('nft_auction', HR.nft_auction)\n processor.on('nft_hauction', HR.nft_hauction)\n processor.on('nft_bid', HR.nft_bid)\n processor.on('nft_transfer_cancel', HR.nft_transfer_cancel)\n processor.on('nft_reserve_transfer', HR.nft_reserve_transfer)\n processor.on('nft_reserve_complete', HR.nft_reserve_complete)\n processor.on('nft_define', HR.nft_define)\n processor.on('nft_add_roy', HR.nft_add_roy)\n processor.on('nft_div', HR.nft_div)\n processor.on('nft_define_delete', HR.nft_define_delete)\n processor.on('nft_melt', HR.nft_delete)\n processor.on('nft_mint', HR.nft_mint)\n processor.on('nft_pfp', HR.nft_pfp)\n }\n //do things in cycles based on block time\n processor.onBlock(\n function (num, pc, prand, bh) {\n Log.block(num);\n if(num < TXID.blocknumber){\n require('process').exit(2)\n } else {TXID.clean(num)}\n return new Promise((resolve, reject) => {\n let Pchron = getPathSome(['chrono'],{\n gte: \"\" + num - 1,\n lte: \"\" + (num + 1)\n })\n let Pmss = getPathSome(['mss'],{\n gte: \"\" + (num - 1000000),\n lte: \"\" + (num - 100)\n }) //resign mss\n let Pmsso = getPathSome(['msso'],{\n gte: \"\" + (num - 1000000),\n lte: \"\" + (num - 100)\n })\n let Pmsa = getPathObj(['msa'])\n let Pmso = getPathObj(['mso'])\n Promise.all([Pchron, Pmss, Pmsa, Pmso, Pmsso]).then(mem => {\n var a = mem[0],\n mss = mem[1], //resign mss\n msa = mem[2], //if length > 80... sign these\n mso = mem[3],\n msso = mem[4],\t\n mso_keys = Object.keys(mso)\n let chrops = {},\n msa_keys = Object.keys(msa)\n mso_keys = Object.keys(mso)\n for (var i in a) {\n chrops[a[i]] = a[i]\n }\n var ints = 0\n let j = Object.keys(chrops)\n loop(0,ints,j)\n function loop (i,ints, j){\n ints++\n let delKey = chrops[j[i]]\n if(i<j.length)ChonOp(delKey, ints, prand, num).then(x=>{\n i++\n if(i<j.length)loop(i,ints,j)\n else every()\n })\n else every()\n function ChonOp (delKey, ints, prand, num){\n return new Promise((res,rej)=>{\n store.getWith(['chrono', chrops[j[i]]], {delKey, ints}, function(e, b, passed) {\n switch (b.op) {\n case 'mint':\n //{op:\"mint\", set:json.set, for: from}\n let setp = getPathObj(['sets', b.set]);\n NFT.mintOp([setp], passed.delKey, num, b, `${passed.ints}${prand}`)\n .then(x=>res(x))\n break;\n case 'ahe':\n let ahp = getPathObj(['ah', b.item]),\n setahp = ''\n if (b.item.split(':')[0] != 'Qm') setahp = getPathObj(['sets', b.item.split(':')[0]])\n else setahp = getPathObj(['sets', `Qm${b.item.split(':')[1]}`])\n NFT.AHEOp([ahp, setahp], passed.delKey, num, b)\n .then(x=>res(x))\n break;\n case 'ahhe':\n let ahhp = getPathObj(['ahh', b.item]),\n setahhp = ''\n if (b.item.split(':')[0] != 'Qm') setahhp = getPathObj(['sets', b.item.split(':')[0]])\n else setahhp = getPathObj(['sets', `Qm${b.item.split(':')[1]}`])\n NFT.AHHEOp([ahhp, setahhp], passed.delKey, num, b, bh.timestamp)\n .then(x=>res(x))\n break;\n case 'ame':\n let amp = getPathObj(['am', b.item]),\n setamp = ''\n if (b.item.split(':')[0] != 'Qm') setamp = getPathObj(['sets', b.item.split(':')[0]])\n else setamp = getPathObj(['sets', `Qm${b.item.split(':')[1]}`])\n NFT.AMEOp([amp, setamp], passed.delKey, num, b)\n .then(x=>res(x))\n break;\n case 'div':\n let contract = getPathObj(['div', b.set]),\n set = getPathObj(['sets', b.set]),\n sales = getPathObj(['ls']),\n auctions = getPathObj(['ah'])\n NFT.DividendOp([contract, set, sales, auctions], passed.delKey, num, b)\n .then(x=>res(x))\n break;\n case 'del_pend':\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }, { type: 'del', path: ['pend', `${b.author}/${b.permlink}`]}], [res, rej,'info'])\n break;\n case 'ms_send':\n recast(b.attempts, b.txid, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'expire':\n release(b.from, b.txid, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'check':\n enforce(b.agent, b.txid, { id: b.id, acc: b.acc }, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'denyA':\n enforce(b.agent, b.txid, { id: b.id, acc: b.acc }, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'denyT':\n enforce(b.agent, b.txid, { id: b.id, acc: b.acc }, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'gov_down': //needs work and testing\n let plb = getPathNum(['balances', b.by]),\n tgovp = getPathNum(['gov', 't']),\n govp = getPathNum(['gov', b.by])\n Chron.govDownOp([plb, tgovp, govp], b.by, passed.delKey, num, passed.delKey.split(':')[1], b)\n .then(x=>res(x))\n break;\n case 'power_down': //needs work and testing\n let lbp = getPathNum(['balances', b.by]),\n tpowp = getPathNum(['pow', 't']),\n powp = getPathNum(['pow', b.by])\n Chron.powerDownOp([lbp, tpowp, powp], b.by, passed.delKey, num, passed.delKey.split(':')[1], b)\n .then(x=>res(x))\n break;\n case 'post_reward':\n Chron.postRewardOP(b, num, passed.delKey.split(':')[1], passed.delKey)\n .then(x=>res(x))\n break;\n case 'post_vote':\n Chron.postVoteOP(b, passed.delKey)\n .then(x=>res(x))\n break;\n default:\n\n }\n })\n })\n }\n }\n function every(){\n return new Promise((res, rej)=>{\n let promises = [HR.margins()]\n if(num % 100 !== 50){\t\n if(mso_keys.length){\t\n promises.push(new Promise((res,rej)=>{\t\n osig_submit(osign(num, 'mso', mso_keys, bh))\t\n .then(nodeOp => {\t\n res('SAT')\t\n try{\t\n if(plasma.rep && JSON.parse(nodeOp[1][1].json).sig)NodeOps.unshift(nodeOp)\t\n }catch(e){}\t\n })\t\n .catch(e => { rej(e) })\t\n }))\t\n } else if(msso.length){\t\n promises.push(new Promise((res,rej)=>{\t\n osig_submit(osign(num, 'msso', msso, bh))\t\n .then(nodeOp => {\t\n res('SAT')\t\n try {\t\n if(plasma.rep && JSON.parse(nodeOp[1][1].json).sig)NodeOps.unshift(nodeOp) //check to see if sig\t\n }catch(e){}\t\n })\t\n .catch(e => { rej(e) })\t\n }))\t\n } else if(msa_keys.length > 80){\n promises.push(new Promise((res,rej)=>{\n sig_submit(consolidate(num, plasma, bh))\n .then(nodeOp => {\n res('SAT')\n if(plasma.rep)NodeOps.unshift(nodeOp)\n })\n .catch(e => { rej(e) })\n }))\n }\n for(var missed = 0; missed < mss.length; missed++){\n if(mss[missed].split(':').length == 1){\n missed_num = mss[missed]\n promises.push(new Promise((res,rej)=>{\n sig_submit(sign(num, plasma, missed_num, bh))\n .then(nodeOp => {\n res('SAT')\n if(JSON.parse(nodeOp[1][1].json).sig){\n NodeOps.unshift(nodeOp)\n }\n })\n .catch(e => { rej(e) })\n })) \n break;\n }\n }\n }\n if (num % 100 === 0 && processor.isStreaming()) {\n client.database.getDynamicGlobalProperties()\n .then(function(result) {\n console.log('At block', num, 'with', result.head_block_number - num, `left until real-time. DAO in ${30240 - ((num - 20000) % 30240)} blocks`)\n });\n }\n if (num % 100 === 50) {\n promises.push(new Promise((res,rej)=>{\n report(plasma, consolidate(num, plasma, bh))\n .then(nodeOp => {\n res('SAT')\n if(processor.isStreaming())NodeOps.unshift(nodeOp)\n })\n .catch(e => { rej(e) })\n }))\n }\n if ((num - 18505) % 28800 === 0) { //time for daily magic\n promises.push(dao(num))\n block.prev_root = block.root\n block.root = ''\n }\n if (num % 100 === 0) {\n promises.push(tally(num, plasma, processor.isStreaming()));\n }\n if (num % 100 === 99) {\n if(config.features.liquidity)promises.push(Liquidity());\n }\n if ((num - 2) % 3000 === 0) {\n promises.push(voter());\n }\n Promise.all(promises).then(()=>resolve(pc))\n })\n }\n if (num % 100 === 1 && !block.root) {\n block.root = 'pending'\n block.chain = []\n block.ops = []\n store.get([], function(err, obj) {\n const blockState = Buffer.from(stringify([num + 1, obj]))\n\n ipfsSaveState(num, blockState, ipfs)\n .then(pla => {\n TXID.saveNumber = pla.hashBlock\n block.root = pla.hashLastIBlock\n plasma.hashSecIBlock = plasma.hashLastIBlock\n plasma.hashLastIBlock = pla.hashLastIBlock\n plasma.hashBlock = pla.hashBlock\n })\n .catch(e => { console.log(e) })\n\n })\n } else if (num % 100 === 1) {\n const blockState = Buffer.from(stringify([num + 1, block]))\n block.ops = []\n issc(num, blockState, null, 0, 0)\n }\n if (config.active && processor.isStreaming() ) {\n store.get(['escrow', config.username], function(e, a) {\n if (!e) {\n for (b in a) {\n if (!plasma.pending[b]) {\n NodeOps.push([\n [0, 0],\n typeof a[b] == 'string' ? JSON.parse(a[b]) : a[b]\n ]);\n plasma.pending[b] = true\n }\n }\n var ops = [],\n cjbool = false,\n votebool = false\n signerloop: for (i = 0; i < NodeOps.length; i++) {\n if (NodeOps[i][0][1] == 0 && NodeOps[i][0][0] <= 100) {\n if (NodeOps[i][1][0] == 'custom_json' && JSON.parse(NodeOps[i][1][1].json).sig_block && num - 100 > JSON.parse(NodeOps[i][1][1].json).sig_block){\n NodeOps.splice(i, 1)\n continue signerloop\n }\n if (NodeOps[i][1][0] == 'custom_json' && !cjbool ) {\n ops.push(NodeOps[i][1])\n NodeOps[i][0][1] = 1\n cjbool = true\n } else if (NodeOps[i][1][0] == 'custom_json'){\n // don't send two jsons at once\n } else if (NodeOps[i][1][0] == 'vote' && !votebool){\n ops.push(NodeOps[i][1])\n NodeOps[i][0][1] = 1\n votebool = true\n } else if (NodeOps[i][1][0] == 'vote'){\n // don't send two votes at once\n } else { //need transaction limits here... how many votes or transfers can be done at once?\n ops.push(NodeOps[i][1])\n NodeOps[i][0][1] = 1\n }\n } else if (NodeOps[i][0][0] < 100) {\n NodeOps[i][0][0]++\n } else if (NodeOps[i][0][0] == 100) {\n NodeOps[i][0][0] = 0\n }\n }\n for (i = 0; i < NodeOps.length; i++) {\n if (NodeOps[i][0][2] == true) {\n NodeOps.splice(i, 1)\n }\n }\n if (ops.length) {\n console.log('attempting broadcast', ops)\n broadcastClient.broadcast.send({\n extensions: [],\n operations: ops\n }, [config.active], (err, result) => {\n if (err) {\n console.log(err) //push ops back in.\n for (q = 0; q < ops.length; q++) {\n if (NodeOps[q][0][1] == 1) {\n NodeOps[q][0][1] = 3\n }\n }\n } else {\n console.log('Success! txid: ' + result.id)\n for (q = ops.length - 1; q > -1; q--) {\n if (NodeOps[q][0][0] = 1) {\n NodeOps.splice(q, 1)\n }\n }\n }\n });\n }\n } else {\n console.log(e)\n }\n })\n }\n })\n })\n });\n processor.onStreamingStart(HR.onStreamingStart);\n processor.start();\n setTimeout(function(){\n API.start();\n }, 3000);\n}", "title": "" }, { "docid": "aeca7400a71657c09317cea1dad37b55", "score": "0.4819569", "text": "_worker () {\n if (!this._ipm2.rpc || !this._ipm2.rpc.getMonitorData) return debug('Cant access to getMonitorData RPC PM2 method')\n this._ipm2.rpc.getMonitorData({}, (err, processes) => {\n if (err) {\n return debug(err || 'Cant access to getMonitorData RPC PM2 method')\n }\n // set broadcast logs\n processes.forEach((process) => {\n this.processes.set(process.name, process.pm2_env)\n this.broadcast_logs.set(process.pm_id, process.pm2_env.broadcast_logs == 1 || process.pm2_env.broadcast_logs == 'true') // eslint-disable-line\n })\n processes = processes.filter(process => process.pm2_env._km_monitored !== false)\n // send data\n this.transport.send('status', {\n data: DataRetriever.status(processes, this.opts),\n server_name: this.opts.MACHINE_NAME,\n internal_ip: this.opts.internal_ip,\n rev_con: true\n })\n })\n }", "title": "" }, { "docid": "080d4d98a5d2fd0d973381aef14b431a", "score": "0.48147836", "text": "onDiffieIPFS({gB, ipfsRef}) {\n // console.log('onDiffieIPFS');\n this.setOtherGX(gB)\n\n this.peer = new Peer({initiator: false});\n this.handlePeerEvent()\n this.handleInfo(ipfsRef)\n }", "title": "" }, { "docid": "e82c760965ee1e97a705485d24650277", "score": "0.48055914", "text": "function dataRequest() {\r\n return function(conn) {\r\n console.log(\"Data channel connected\");\r\n conn.on('close', function() {\r\n console.log(\"Data channel close\");\r\n });\r\n\r\n conn.on('data', function(data) {\r\n var clientUpdate = setInterval(function() {\r\n conn.write(JSON.stringify({update:\".\"}));\r\n }, 2000);\r\n var lightData = [];\r\n var batteryData = [];\r\n var accelData = [];\r\n var temperatureData = [];\r\n var pressureData = [];\r\n var humidityData = [];\r\n var UVData = [];\r\n var soundData = [];\r\n var CO2Data = [];\r\n var SO2Data = [];\r\n var COData = [];\r\n var O3Data = [];\r\n var NO2Data = [];\r\n var PMData = [];\r\n var rssiData = [];\r\n var dbList = [];\r\n var requestObj = JSON.parse(data);\r\n var uuid = requestObj.uuid;\r\n var deviceIndex = 0;\r\n var totalDevices = uuid.length;\r\n var sent = {};\r\n for(var a = 0 ; a < totalDevices ; a++) {\r\n sent[uuid[a]] = false;\r\n }\r\n var uuidIndex = {};\r\n for(var a = 0 ; a < totalDevices ; a++) {\r\n uuidIndex[uuid[a]] = a;\r\n }\r\n \tvar startDate = requestObj.startDate;\r\n\t var endDate = requestObj.endDate;\r\n var counter = 0;\r\n\t var doneCounter = 0;\r\n cloudant.db.list(function(err, allDbs){ //this gets a list of all the databases \r\n if (err) {\r\n throw err;\r\n }\r\n for(var i = 0 ; i < allDbs.length ; i++ ) {\r\n var tempDate = allDbs[i].split('_')[3];\r\n if ( compareDate(startDate, tempDate) > 0 && compareDate(tempDate, endDate) > 0 ) { //for each database, we check if it is in the correct timeframe.\r\n counter++;\r\n var tempInstance = cloudant.db.use(allDbs[i]);\r\n console.log(tempDate);\r\n dbList.push(tempInstance);\r\n \r\n\r\n }// end of if statement\r\n }//end of for loop\r\n console.log(\"Accessing Databases...\");\r\n querryAll(uuid[deviceIndex]);\r\n\r\n });//end of list\r\n\r\n function querryAll(thisUuid) {\r\n for(var j = 0 ; j < 5 && j < dbList.length ; j++) { // here we only itterate 5 times because Cloudant only allows 5 querries pers second\r\n tempInstance = dbList[j];\r\n querry(tempInstance, dbList.length, j+1, thisUuid);\r\n }\r\n }\r\n\r\n function querry(tempInstance, dblength, index, thisUuid) { //this function querries a specific database\r\n console.log('querry for ' + thisUuid +\" device \"+(deviceIndex+1)+ \"/\"+ totalDevices + \" database \" + index + \"/\" + dblength);\r\n conn.write(JSON.stringify({message:\"Querying data base for \" + dbList[index-1].config.db.split('_')[3] + \" for device \" + thisUuid + \". (\" + index + \"/\" + dblength + \" databases)\"}));\r\n //console.log(\"Querying data base for \" + dbList[index-1].config.db.split('_')[3] + \" for device \" + thisUuid + \". (\" + index + \"/\" + dblength + \" database(s))\")\r\n tempInstance.find({ //this will get all the data in a specific instance of a database with a given device id\r\n \"selector\": {\r\n \"deviceId\" : thisUuid\r\n\r\n },\r\n \"fields\": [\r\n \"timestamp\",\r\n \"data.d\",\r\n \"eventType\"\r\n\r\n ],\r\n \"sort\": [\r\n \r\n ]\r\n }, function(err, result) { //results represents the data comming back from the database.\r\n if (err) {\r\n throw err;\r\n }\r\n for (var i = 0; i < result.docs.length; i++) {//here we push all the point into the appropriate data array\r\n var tempDataSet = [];\r\n switch(result.docs[i].eventType) {\r\n case 'health':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.light);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n lightData.push(tempDataSet);\r\n break;\r\n case 'CO2':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.CO2);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n CO2Data.push(tempDataSet);\r\n break;\r\n case 'sound':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.soundLevel);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n soundData.push(tempDataSet);\r\n break;\r\n case 'gases':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.SO2);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n SO2Data.push(tempDataSet);\r\n\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.CO);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n COData.push(tempDataSet);\r\n\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.O3);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n O3Data.push(tempDataSet);\r\n\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.NO2);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n NO2Data.push(tempDataSet);\r\n\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.PM);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n\r\n PMData.push(tempDataSet);\r\n break;\r\n case 'battery':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.batteryLevel);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n batteryData.push(tempDataSet);\r\n break;\r\n case 'location':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.rssi);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n rssiData.push(tempDataSet);\r\n break;\r\n case 'accel':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 3);\r\n tempDataSet.push(result.docs[i].data.d.x);\r\n tempDataSet.push(result.docs[i].data.d.y);\r\n tempDataSet.push(result.docs[i].data.d.z);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 3);\r\n \r\n accelData.push(tempDataSet);\r\n break;\r\n case 'air':\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.pressure);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n pressureData.push(tempDataSet);\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.temperature);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n temperatureData.push(tempDataSet);\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.humidity);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n humidityData.push(tempDataSet);\r\n\r\n if(result.docs[i].data.d.UV != null) {\r\n tempDataSet = [];\r\n\r\n tempDataSet.push(result.docs[i].timestamp);\r\n extraPointsBefore(tempDataSet, uuidIndex[thisUuid], 1);\r\n tempDataSet.push(result.docs[i].data.d.UV);\r\n extraPointsAfter(tempDataSet, uuidIndex[thisUuid], 1);\r\n \r\n UVData.push(tempDataSet);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n } // end of for loop\r\n doneCounter++;\r\n if(doneCounter == counter && sent[thisUuid] == false) { //this is executed when all databases have been processed and the data has been pushed\r\n sent[thisUuid] = true;\r\n if(deviceIndex == totalDevices - 1) {\r\n var chartData = {};\r\n chartData.lightData = lightData;\r\n chartData.batteryData = batteryData;\r\n chartData.temperatureData = temperatureData;\r\n chartData.pressureData = pressureData;\r\n chartData.humidityData = humidityData;\r\n chartData.UVData = UVData;\r\n chartData.soundData = soundData;\r\n chartData.CO2Data = CO2Data;\r\n chartData.SO2Data = SO2Data;\r\n chartData.COData = COData;\r\n chartData.O3Data = O3Data;\r\n chartData.NO2Data = NO2Data;\r\n chartData.PMData = PMData;\r\n chartData.accelData = accelData;\r\n chartData.rssiData = rssiData;\r\n clearInterval(clientUpdate);\r\n conn.write(JSON.stringify({update:\"done\"}));\r\n sendDataBack(conn, chartData); // this is where the data for the graphs is sent back\r\n if (lightData.length != 0 || batteryData.length != 0 || temperatureData.length != 0 || pressureData.length != 0 || humidityData.length != 0 || CO2Data.length != 0 || SO2Data.length != 0 || COData.length != 0 || O3Data.length != 0 || NO2Data.length != 0 || rssiData.length != 0 || accelData.length != 0 ) {\r\n conn.write(JSON.stringify({message:\"Data recieved. Now formatting CSV data.\"}));\r\n }\r\n sendCSVBack(conn, chartData); // this is where the csv data is formatted then sent back.\r\n }\r\n else {\r\n doneCounter = 0;\r\n deviceIndex++;\r\n console.log('next device');\r\n setTimeout(function() {\r\n querryAll(uuid[deviceIndex]);\r\n },2000);\r\n }\r\n }\r\n else if(index+4 < dblength && sent[thisUuid] == false) {\r\n setTimeout(function() {\r\n console.log('timeout');\r\n querry(dbList[index+4], dblength, index+5, thisUuid);\r\n }, 1500);\r\n }\r\n });// end of find\r\n\r\n }//end of querry\r\n\r\n //this function adds null to arrays to place the data pont at the correct entry\r\n function extraPointsBefore(arr, position, points) {\r\n for(var i = 0 ; i < position ; i+=points) {\r\n for(var j = 0 ; j < points ; j++) {\r\n arr.push(null);\r\n }\r\n }\r\n }\r\n\r\n //this function adds null to the array after the data has been set to complete the length\r\n function extraPointsAfter(arr, position, points) {\r\n for(var i = (position*points)+points+1 ; i < totalDevices*points + 1; i++) {\r\n arr.push(null);\r\n }\r\n }\r\n\r\n\r\n\r\n });//end of .on('data')\r\n }; //end of returning function\r\n}", "title": "" }, { "docid": "4295512c11e871ff4662528499da822d", "score": "0.4777378", "text": "static initialize(app, changeLogService, deviceService, deviceFileService, deviceFileUploadService, file, httpService, localDBManagementService, localDbService, networkService, securityService) {\n if (this.initialized) {\n return;\n }\n deviceService.addStartUpService({\n serviceName: 'OfflineStartupService',\n start: () => {\n if (window['SQLitePlugin']) {\n localDBManagementService.setLogSQl((sessionStorage.getItem('wm.logSql') === 'true') || (sessionStorage.getItem('debugMode') === 'true'));\n window.logSql = (flag = true) => {\n localDBManagementService.setLogSQl(flag);\n sessionStorage.setItem('wm.logSql', flag ? 'true' : 'false');\n };\n window.executeLocalSql = (dbName, query, params) => {\n localDBManagementService.executeSQLQuery(dbName, query, params, true);\n };\n return localDBManagementService.loadDatabases().then(() => {\n changeLogService.addWorker(new IdResolver(localDBManagementService));\n changeLogService.addWorker(new ErrorBlocker(localDBManagementService));\n changeLogService.addWorker(new FileHandler());\n changeLogService.addWorker(new MultiPartParamTransformer(deviceFileService, localDBManagementService));\n new LiveVariableOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService, localDbService).add();\n new FileUploadOfflineBehaviour(changeLogService, deviceFileService, deviceFileUploadService, file, networkService, deviceFileService.getUploadDirectory()).add();\n new NamedQueryExecutionOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService).add();\n localDBManagementService.registerCallback(new UploadedFilesImportAndExportService(changeLogService, deviceFileService, localDBManagementService, file));\n changeLogService.addWorker({\n onAddCall: () => {\n if (!networkService.isConnected()) {\n networkService.disableAutoConnect();\n }\n },\n postFlush: stats => {\n if (stats.totalTaskCount > 0) {\n localDBManagementService.close()\n .catch(noop)\n .then(() => {\n location.assign(window.location.origin + window.location.pathname);\n });\n }\n }\n });\n });\n }\n return Promise.resolve();\n }\n });\n new SecurityOfflineBehaviour(app, file, deviceService, networkService, securityService).add();\n }", "title": "" }, { "docid": "60cf3330439d430f0b565fdf60602f85", "score": "0.4755343", "text": "async init() {\n //Event used to track the js-ipfs spawn start\n var ipfsEvent = new events.EventEmitter()\n var ipAddress = '172.20.9.131'\n\n if (isNode) {\n //Construct the swarm addresses\n var swarm = []\n var os = require('os')\n var ifaces = os.networkInterfaces()\n\n Object.keys(ifaces).forEach(ifname => {\n var alias = 0\n\n ifaces[ifname].forEach(iface => {\n if ('IPv4' !== iface.family) {\n // skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses\n return\n }\n\n if (alias >= 1) {\n // this single interface has multiple ipv4 addresses\n swarm.push('/ip4/' + iface.address + '/tcp/4001')\n swarm.push('/ip4/' + iface.address + '/tcp/4002/ws')\n swarm.push(\n '/ip4/' + iface.address + '/tcp/9091/ws/p2p-websocket-star'\n )\n } else {\n swarm.push('/ip4/' + iface.address + '/tcp/4001')\n swarm.push('/ip4/' + iface.address + '/tcp/4002/ws')\n swarm.push(\n '/ip4/' + iface.address + '/tcp/9091/ws/p2p-websocket-star'\n )\n }\n ++alias\n })\n })\n\n console.log(swarm)\n\n\n var options = {\n repo: 'data/ipfs',\n /*relay: {\n enabled: true, // enable relay dialer/listener (STOP)\n hop: {\n enabled: true // make this node a relay (HOP)\n }\n },*/\n EXPERIMENTAL: {\n pubsub: true\n },\n modules: {\n transport: [TCP, WS, wstar],\n peerDiscovery: [MulticastDNS, wstar.discovery]\n },\n config: {\n /*Addresses: {\n Swarm: [\n '/dns4/' + os.hostname() + '/tcp/4001',\n '/dns4/' + os.hostname() + '/tcp/4002/ws',\n '/dns4/' + os.hostname() + '/tcp/9091/ws/p2p-websocket-star',\n // '/ip4/127.0.0.1/tcp/9091/ws/p2p-websocket-star'\n '/dns4/localhost/tcp/9091/ws/p2p-websocket-star'\n ]\n },*/\n /*Announce: [],\n NoAnnounce: [],*/\n /*API: '/ip4/127.0.0.1/tcp/5001',\n Gateway: '/ip4/127.0.0.1/tcp/8080',*/\n Addresses: {\n Swarm: swarm\n },\n Bootstrap: [],\n peerDiscovery: {\n mdns: {\n Enabled: true,\n Interval: 10\n }\n }\n },\n preload: {\n enabled: false,\n addresses: []\n }\n }\n this.ipfs = new JSIPFS(options)\n } else {\n //Client side js-ipfs node\n var options = {\n repo: String('node'),\n EXPERIMENTAL: {\n pubsub: true\n },\n modules: {\n //connProtector: new Protector(this.privateKey)\n },\n config: {\n Addresses: {\n Swarm: [\n //'/ip4/' + ipAddress + '/tcp/9091/ws/p2p-websocket-star',\n '/dns4/' +\n window.location.hostname +\n '/tcp/9091/ws/p2p-websocket-star'\n //'/dns4/localhost/tcp/9091/ws/p2p-websocket-star'\n ]\n },\n Bootstrap: []\n },\n preload: {\n enabled: false,\n addresses: []\n }\n }\n this.ipfs = new JSIPFS(options)\n }\n\n this.ipfs.on('ready', async () => {\n //Init the ipfs node\n this.id = await this.ipfs.id()\n super.init()\n ipfsEvent.emit('ipfsReady')\n })\n\n return new Promise(function(resolve) {\n ipfsEvent.on('ipfsReady', resolve)\n })\n }", "title": "" }, { "docid": "8e64bd0f42a928cf15a752a5283ea132", "score": "0.47534367", "text": "function main() {\n let app = express(); // TODO: To be used later.\n\n app.use(bodyParser.json());\n app.use(bodyParser.urlencoded({ // to support URL-encoded bodies\n extended: true\n }));\n\n let graphiteURL = config.get('graphiteURL');\n let mongodPort = config.get('mongodPort');\n let nodejsPort = config.get('nodejsPort');\n\n let graphiteAdapter = new GraphiteAdapter(graphiteURL);\n let pointsOfInterest = new POI(mongodPort, 'app');\n\n pointsOfInterest.open();\n\n app.post('/pattern/threshold', (req, res, next) => {\n let rawThreshold = req.body.threshold;\n rawThreshold = rawThreshold.map(threshold => {\n switch (threshold.thresholdRule) {\n case '<':\n threshold.thresholdRule = THRESHOLDRULE.LESSTHAN;\n break;\n case '<=':\n threshold.thresholdRule = THRESHOLDRULE.LESSTHANEQUAL;\n break;\n case '=':\n threshold.thresholdRule = THRESHOLDRULE.EQUAL;\n break;\n case '>=':\n threshold.thresholdRule = THRESHOLDRULE.GREATERTHANEQUAL;\n break;\n case '>':\n threshold.thresholdRule = THRESHOLDRULE.GREATERTHAN;\n break;\n default:\n var err = new Error('Unknown threshold rule.');\n err.status = 500;\n next(err);\n }\n\n return threshold;\n });\n\n let threshold = new Threshold(rawThreshold);\n pointsOfInterest.insertAsync([threshold]).then(() => res.send('Success'));\n });\n\n app.get('/pattern/threshold', (req, res) => {\n pointsOfInterest.findAllThresholdAsync().then(thresholds => res.json(thresholds));\n });\n\n app.get('/pattern', (req, res) => {\n res.json([]);\n });\n\n app.get('/call/:mdate1/:mdate2/:m1/:m2/:func',function(req, res) \n {\n /*var mdate1 = req.parms.mdate1;\n var mdate2 = req.parms.mdate2;\n var m1 = req.parms.m1;\n var m2 = req.parms.m2;\n var func = req.params.func; */\n res.json(req);\n });\n\n app.get('/call',function(req, res) \n {\n var func = req.query.func; \n var mdate1 = req.query.mdate1;\n var mdate2 = req.query.mdate2;\n var m1 = req.query.m1;\n var m2 = req.query.m2;\n \n //parse the dates\n var start = moment.unix(mdate1).utc().format('HH:mm_YYYYMMDD');\n var end = moment.unix(mdate2).utc().format('HH:mm_YYYYMMDD');\n\n //resolve the metrics into their respective datapoints\n var render = new RenderAPIAdapter(graphiteURL);\n var renderRes1 = render.render({\n target: m1,\n format: 'json',\n from: start,\n until: end,\n });\n var renderRes2 = render.render({\n target: m2,\n format: 'json',\n from: start,\n until: end,\n });\n\n //apply the requested function and return the result\n var cov = new Covariance(renderRes1);\n\n\n\n\n if (func == '0'){\n var result1 = cov.covariance(renderRes2);\n var jsonstring = JSON.stringify({ \n r1:result1\n });\n res.json(jsonstring);\n\n }\n else if (func == '1'){\n\n var result2 = cov.correlation(renderRes2);\n var jsonstring = JSON.stringify({ \n r2:result2\n });\n res.json(jsonstring);\n\n }\n else if (func == '2'){\n var result3 = cov.metricDeviation(renderRes1);\n var jsonstring = JSON.stringify({ \n r3:result3\n });\n res.json(jsonstring);\n }\n else if (func =='3'){\n var result4 = renderRes1;\n var jsonstring = JSON.stringify({renderRes1});\n res.json(jsonstring);\n }\n\n else res.send(\"invalid request: function should be correlation, covariance or metricDeviation\");\n\n \n });\n\n app.listen(nodejsPort, function () {\n console.log('Example app listening on port: ',nodejsPort);\n });\n\n \n}", "title": "" }, { "docid": "0d9ab189d01ba68f6c25ca799d2c417f", "score": "0.4736902", "text": "function AppMonitor() {\n}", "title": "" }, { "docid": "bed9bbf1c9bd264b4c488fd31d41d2ec", "score": "0.47327346", "text": "async function monitorDHTtable(ipfs,db,my_cid){\n \n const cid = new CID(my_cid)\n //var hash = sha256.create();\n //var multiH = multihash.decode(cid.multihash,'hex')\n //var cid_sha = hash.update(multiH.digest.toString('hex')).hex()\n var cid_bin = hexToBinary(cid.multihash.toString('hex')) //calculate the binary of the cid \n //use hexToBinary(peer_sha) if you want to try the sha256(id) XOR method\n var peers_list = []; //list of distinct peer retreived\n var peers_found = {} //dictionary of peer retreived, used to avoid duplicates\n var count = 0;\n var queried_peer = 0\n var notEmpty_peer = 0\n try{\n for await (const info of ipfs.dht.query(my_cid)) { //call the \"IPFS DHT QUERY my_cid\" command\n queried_peer++;\n if(info.responses.length > 0)\n notEmpty_peer++;\n for(var k=0; k<info.responses.length; k++){\n var peer_cid = new CID(info.responses[k].id);\n //var hash2 = sha256.create();\n //var multiH2 = multihash.decode(peer_cid.multihash, 'hex')\n //var peer_sha = hash2.update(multiH2.digest.toString('hex')).hex()\n var peer_bin = hexToBinary(peer_cid.multihash.toString('hex')) //calculate the binary of the returned peer's cid \n //use hexToBinary(peer_sha) if you want to try the sha256(id) XOR method\n \n if(!peers_found.hasOwnProperty(peer_cid.toString())){ //since the command return many duplicates, we keep only distinct peer \n peers_found[peer_cid.toString()] = \"true\";\n peers_list.push([peer_bin,peer_cid.toString()])\n }\n count++;\n }\n }\n \n \n console.log(`QUERY DHT PEERS -> ${count} (DISTINCT ${peers_list.length})`)\n var buckets = commonPrefixLength(cid_bin,peers_list)\n\n }catch(error){console.log(\"Monitor dht error\")}\n\n DB.saveDHTcheck(db,buckets,count,peers_list.length,queried_peer,notEmpty_peer)// save the result on the DB\n}", "title": "" }, { "docid": "008f0fd30d477d964f4bbff1dedfc782", "score": "0.47207993", "text": "function Captivate_DoExternalInterface() {\n\n trace(\"\\nRecd EI call:\" + Array.prototype.slice.call(arguments).join(\":\"));\n\n //Interaction data related vars\n var interactionID_str, \n\t\tcorrectResponse_str, \n\t\tweight_int, \n\t\tstudentResponse_str, \n\t\tresult_str, \n\t\tlatency_int, \n\t\tobjectiveID_str, \n\t\tdescriptionTexts,\n\t\tquestion_text = \"\";\n \n \n\n\n if (arguments.length < 1) {\n trace(\"Insufficient arguments to EI call\");\n return;\n }\n\n\n var CmdToExecute = new String(arguments[0]),\n \tSetVal = arguments[1],\n \tstrErr = \"true\",\n \tretValForSWF = \"\",\n \tlastArg = arguments[arguments.length - 1];\n \t\n\n if (lastArg && lastArg != \"\") retValForSWF = lastArg;\n\n \n \t// do nothing, if SCORM API is not available\n if (!makeCallsToDriver) {\n trace(\"Running instance of API not detected in EI handler. Ignoring call.\");\n return;\n }\n\n\n //check if this is an interaction related function - if so, get the individual data strings - this\n //is a temp. soln. till arity in Queue.as is officially increased\n if (CmdToExecute.indexOf(\"Interaction\") > -1 && CmdToExecute.indexOf(\"Record\") > -1) {\n\n trace(\"Found a record interaction call:\" + CmdToExecute);\n\n var interaction_arr = SetVal;\n if (interaction_arr.length != 8) \n\t\t\ttrace(\"ERROR! Wrong number of interaction elements received!\");\n\n interactionID_str = interaction_arr[0];\n correctResponse_str = interaction_arr[1];\n weight_int = parseInt(interaction_arr[2]);\n studentResponse_str = interaction_arr[3];\n result_str = ConvertToInteractionResultConstant(interaction_arr[4]);\n latency_int = parseInt(interaction_arr[5]);\n objectiveID_str = interaction_arr[6];\n descriptionTexts = interaction_arr[7];\n\t\tquestion_text = descriptionTexts.questionText;\n\t\t\n trace(\"Interaction Elements:\");\n trace(interactionID_str);\n trace(correctResponse_str);\n trace(weight_int);\n trace(studentResponse_str);\n trace(result_str);\n trace(latency_int);\n trace(objectiveID_str);\n trace(descriptionTexts);\n\t\t\n }\n\n\n\n //the API has already been initialized - so shouldn't be initialized again\n //check whether its initialized and revert back\n if (CmdToExecute == \"Start\") {\n\n trace(\"Fwd:\" + \"Do nothing!\");\n\n strErr = makeCallsToDriver;\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n\n } else if (CmdToExecute == \"SetExitSuspendAfterCompleted\") {\n\n trace(\"Fwd:\" + \"SetExitSuspendAfterCompleted!\");\n var lExitSuspendIfCompleted = (SetVal == \"true\" ? true : false);\n EXIT_SUSPEND_IF_COMPLETED = lExitSuspendIfCompleted;\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n\n } else if (CmdToExecute == \"SetExitNormalIfPassed\") {\n\n trace(\"Fwd:\" + \"SetExitNormalIfPassed!\");\n var lExitNormalIfPassed = (SetVal == \"true\" ? true : false);\n EXIT_NORMAL_IF_PASSED = lExitNormalIfPassed;\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n\n } else if (CmdToExecute == \"CommitData\") {\n trace(\"Fwd:\" + \"CommitData\");\n\n strErr = CommitData();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n } else if (CmdToExecute == \"SetReachedEnd\") {\n trace(\"Fwd:\" + \"SetReachedEnd:\" + SetVal);\n\n strErr = SetReachedEnd();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetDataChunk\") {\n trace(\"Fwd:\" + \"SetDataChunk:\" + SetVal);\n\n strErr = SetDataChunk(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetPassed\") {\n trace(\"Fwd:\" + \"SetPassed\");\n\n strErr = SetPassed();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetProgressMeasure\") {\n trace(\"Fwd:\" + \"SetProgressMeasure\" + SetVal);\n\n strErr = SetProgressMeasure(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetFailed\") {\n trace(\"Fwd:\" + \"SetFailed\");\n\n strErr = SetFailed();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetEntryMode\") {\n trace(\"Fwd:\" + \"GetEntryMode:\");\n\n strErr = GetEntryMode(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetBookmark\") {\n trace(\"Fwd:\" + \"SetBookmark:\" + SetVal);\n\n strErr = SetBookmark(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetSessionTime\") {\n trace(\"Fwd:\" + \"SetSessionTime():\" + SetVal);\n\n strErr = SetSessionTime(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetLastError\") {\n trace(\"Fwd:\" + \"GetLastLMSErrorCode:\");\n\n strErr = GetLastLMSErrorCode();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetLastErrorDesc\") {\n trace(\"Fwd:\" + \"GetLastErrorDesc:\");\n\n strErr = GetLastErrorDesc();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetScore\") {\n trace(\"Fwd:\" + \"SetScore:\" + SetVal);\n\n\n //var scores = String(SetVal).split(\"|\");\n var scores = SetVal;\n trace(String(scores));\n strErr = SetScore(scores[0], scores[1], scores[2]);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetPointBasedScore\") {\n trace(\"Fwd:\" + \"SetPointBasedScore:\" + SetVal);\n\n\n //var scores = String(SetVal).split(\"|\");\n var scores = SetVal;\n trace(String(scores));\n strErr = SetPointBasedScore(scores[0], scores[1], scores[2]);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"Suspend\") {\n trace(\"Fwd:\" + \"Suspend:\");\n\n strErr = Suspend();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetDataChunk\") {\n trace(\"Fwd:\" + \"GetDataChunk:\");\n\n strErr = GetDataChunk();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"ConcedeControl\") {\n trace(\"Fwd:\" + \"ConcedeControl\");\n\n strErr = ConcedeControl();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n } else if (CmdToExecute == \"GetBookMark\") {\n trace(\"Fwd:\" + \"GetBookMark():\");\n\n strErr = GetBookmark();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetLaunchData\") {\n trace(\"Fwd:\" + \"GetLaunchData():\");\n\n strErr = GetLaunchData();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else\n\n\n\n\n\n //Interaction set value handlers\n if (CmdToExecute == \"RecordMultipleChoiceInteraction\") {\n trace(\"Fwd:\" + \"RecordMultipleChoiceInteraction():\");\n\n\n\n var correctResponse_arr = []\n var studentResponse_arr = []\n\n //get the answer text arrays\n var MCQ_answer_texts = descriptionTexts.answerTexts;\n\n var split_char_correctResponse = \"\";\n var split_char_studentResponse = \"\";\n\n if (correctResponse_str.indexOf(\".\") > -1) split_char_correctResponse = \".\";\n if (correctResponse_str.indexOf(\",\") > -1) split_char_correctResponse = \",\";\n\n if (studentResponse_str.indexOf(\".\") > -1) split_char_studentResponse = \".\";\n if (studentResponse_str.indexOf(\",\") > -1) split_char_studentResponse = \",\";\n\n\n trace(\"Split char correct:\" + split_char_correctResponse);\n trace(\"Split char student:\" + split_char_studentResponse);\n\n\n if (correctResponse_str != \"\") {\n if (split_char_correctResponse != \"\") {\n correctResponse_arr = correctResponse_str.split(split_char_correctResponse);\n } else {\n correctResponse_arr.push(correctResponse_str);\n }\n } else {\n correctResponse_arr.push(\"1\"); // send in a dummy value here\n }\n\n if (studentResponse_str != \"\") {\n if (split_char_studentResponse != \"\") {\n studentResponse_arr = studentResponse_str.split(split_char_studentResponse);\n } else {\n studentResponse_arr.push(studentResponse_str);\n }\n } else {\n studentResponse_arr.push(\"1\"); // send in a dummy value here\n }\n\n\n //create corresponding response identifier objects\n correctResponse_ResponIdent_arr = [];\n studentResponse_ResponIdent_arr = [];\n\n var idx = 0;\n\n if (MCQ_answer_texts)\n \t{\n\t\t\tfor (idx = 0; idx < correctResponse_arr.length; idx++) \n\t\t\t{\n\t\t\t\tvar lLongText = MCQ_answer_texts[correctResponse_arr[idx]];\n\t\t\t\tif((undefined == lLongText) || (\"\" == lLongText))\n\t\t\t\t\tlLongText = correctResponse_arr[idx];\t\t\n\t\t\t\tcorrectResponse_ResponIdent_arr.push(CreateResponseIdentifier(correctResponse_arr[idx], lLongText));\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tfor (idx = 0; idx < studentResponse_arr.length; idx++) \n\t\t\t{\n\t\t\t\tvar lLongText = MCQ_answer_texts[studentResponse_arr[idx]];\n\t\t\t\tif ((undefined == lLongText) || (\"\" == lLongText))\n\t\t\t\t\tlLongText = studentResponse_arr[idx];\t\n\t\t\t\tstudentResponse_ResponIdent_arr.push(CreateResponseIdentifier(studentResponse_arr[idx], lLongText));\n\t\t\t}\t\n } \n\t\telse \n\t\t{\n for (idx = 0; idx < correctResponse_arr.length; idx++) \n\t\t\t\tcorrectResponse_ResponIdent_arr.push(\n\t\t\t\t\t\t\t\t\t\t\t\tCreateResponseIdentifier(correctResponse_arr[idx], \n\t\t\t\t\t\t\t\t\t\t\t\t\tcorrectResponse_arr[idx])\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\n for (idx = 0; idx < studentResponse_arr.length; idx++) \n\t\t\t\tstudentResponse_ResponIdent_arr.push(\n\t\t\t\t\t\t\t\t\t\t\t\tCreateResponseIdentifier(studentResponse_arr[idx], \n\t\t\t\t\t\t\t\t\t\t\t\t\tstudentResponse_arr[idx])\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n }\n\n\n strErr = RecordMultipleChoiceInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\t\t\tstudentResponse_ResponIdent_arr, \n\t\t\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\t\t\tcorrectResponse_ResponIdent_arr, \n\t\t\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordTrueFalseInteraction\") {\n trace(\"Fwd:\" + \"RecordTrueFalseInteraction():\");\n\t\tvar TF_answer_texts = descriptionTexts.answerTexts;\n var bStudent_response = TF_answer_texts[studentResponse_str];\n\t\tvar bCorrect_response = TF_answer_texts[correctResponse_str];\n\n strErr = RecordTrueFalseInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\t\tbStudent_response, \n\t\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\t\tbCorrect_response, \n\t\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordFillInInteraction\") {\n trace(\"Fwd:\" + \"RecordFillInInteraction():\");\n\n\n strErr = RecordFillInInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\tstudentResponse_str, \n\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\tcorrectResponse_str, \n\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordMatchingInteraction\") {\n trace(\"Fwd:\" + \"RecordMatchingInteraction():\");\n\n\n var leftColumnTexts = descriptionTexts.answerTexts.left;\n var rightColumnTexts = descriptionTexts.answerTexts.right;\n\n var correctResponse_MatchingResponses_arr = [];\n var studentResponse_MatchingResponses_arr = [];\n\n var temp_responses_arr = correctResponse_str.split(\",\");\n var resp_idx = 0;\n var curr_resp, src_target;\n\n for (resp_idx = 0; resp_idx < temp_responses_arr.length; ++resp_idx) {\n curr_resp = temp_responses_arr[resp_idx];\n src_target = curr_resp.split(\".\");\n\n var match_temp1 = src_target[0];\n var match_temp2 = src_target[1];\n\t\n\t\t\tvar lLongLeftColText = leftColumnTexts[match_temp1];\n\t\t\tvar lLongRightColText = rightColumnTexts[match_temp2];\n\t\t\tif ((undefined == lLongLeftColText) || (\"\" == lLongLeftColText))\n\t\t\t lLongLeftColText = match_temp1;\n\t\t\tif ((undefined == lLongRightColText) || (\"\" == lLongRightColText))\n\t\t\t lLongRightColText = match_temp2;\n\t\t\n var resp_src = CreateResponseIdentifier(match_temp1, lLongLeftColText);\n var resp_target = CreateResponseIdentifier(match_temp2, lLongRightColText);\n\n \n correctResponse_MatchingResponses_arr.push(new MatchingResponse(resp_src, resp_target));\n }\n\n temp_responses_arr = studentResponse_str.split(\",\");\n for (resp_idx = 0; resp_idx < temp_responses_arr.length; ++resp_idx) {\n curr_resp = temp_responses_arr[resp_idx];\n src_target = curr_resp.split(\".\");\n\n var match_temp1 = src_target[0];\n var match_temp2 = src_target[1];\n\n \tvar lLongLeftColText = leftColumnTexts[match_temp1];\n\t\t\tvar lLongRightColText = rightColumnTexts[match_temp2];\n\t\t\tif((undefined == lLongLeftColText ) || (\"\" == lLongLeftColText ))\n\t\t\t\tlLongLeftColText = match_temp1;\n\t\t\tif((undefined == lLongRightColText) || (\"\" == lLongRightColText))\n\t\t\t\tlLongRightColText = match_temp2;\n\t\t\n var resp_src = CreateResponseIdentifier(match_temp1, lLongLeftColText);\n var resp_target = CreateResponseIdentifier(match_temp2, lLongRightColText);\n \n studentResponse_MatchingResponses_arr.push(new MatchingResponse(resp_src, resp_target));\n }\n\n\n strErr = RecordMatchingInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\tstudentResponse_MatchingResponses_arr, \n\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\tcorrectResponse_MatchingResponses_arr, \n\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordSequencingInteraction\") {\n trace(\"Fwd:\" + \"RecordSequencingInteraction():\");\n\t\n\t\tvar lLongLearnerResponse = descriptionTexts.answerTexts.learner_response;\n\t\tvar lLongCorrectResponse = descriptionTexts.answerTexts.correct_response;\n\t\tif((undefined == lLongLearnerResponse) || (\"\" == lLongLearnerResponse))\n\t\t\tlLongLearnerResponse = studentResponse_str.substring(0, 1);\n\t\tif((undefined == lLongCorrectResponse) || (\"\" == lLongCorrectResponse))\n\t\t\tlLongCorrectResponse = correctResponse_str.substring(0, 1);\n\t\t\n strErr = RecordSequencingInteraction(interactionID_str, \n\t\t\t\t\t\tCreateResponseIdentifier(studentResponse_str.substring(0, 1),\n\t\t\t\t\t\t\tlLongLearnerResponse), \n\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\tCreateResponseIdentifier(correctResponse_str.substring(0, 1),\n\t\t\t\t\t\t\tlLongCorrectResponse), \n\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordLikertInteraction\") {\n trace(\"Fwd:\" + \"RecordLikertInteraction():\");\n\n strErr = RecordLikertInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\tCreateResponseIdentifier(studentResponse_str.substring(0, 1), \n\t\t\t\t\t\t\t\t\t\t\tstudentResponse_str), \n\t\t\t\t\t\t\t\t\t\ttrue, \n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else trace(\"This call has not been ported or is not handled yet.\");\n return strErr;\n}", "title": "" }, { "docid": "71d4be89a0552f989d6536e2b200b3d5", "score": "0.46759534", "text": "function queryServiceNow()\n{\n RMPApplication.debug(\"begin queryServiceNow: sn_query = \", sn_query);\n c_debug(dbug.query, \"=> queryServiceNow: sn_query = \", sn_query);\n $(\"#id_spinner_search_top\").show();\n $(\"#id_spinner_search_bottom\").show();\n clearOrderDataTable();\n clearTaskDataTable();\n \n var input = {};\n var option = {};\n input.query = sn_query;\n c_debug(dbug.query, \"=> queryServiceNow: input = \", input);\n id_get_work_order_list_api.trigger(input, option, order_ok, order_ko);\n\n RMPApplication.debug(\"end queryServiceNow\");\n}", "title": "" }, { "docid": "92631f7c5ee51399dcf66e02010a5e71", "score": "0.46648064", "text": "function queryServer(nodes_params) {\n //consoleLog(\"XXX nodes_params = \", nodes_params);\n if (! nodes_params) {\n nodes_params = \"\";\n }\n if (! nodes_owner) {\n\tconsoleAddMessage(\"#console1\", CONSOLE_ERROR,\n \"Missing operator name, cannot query server\");\n return;\n }\n //consoleLog('AJAX init for nodes: ', nodes_monitored); // DEBUG\n //consoleLog('nodes = ', nodes); // DEBUG\n // Subscribe to the global events\n if (nodes[GLOBAL_EVENT].events && nodes[GLOBAL_EVENT].events.length > 0) {\n nodes_params += \"&ns=\" + GLOBAL_EVENT + \",\"\n + nodes[GLOBAL_EVENT].events.slice(-1)[0][0] + \",-,-\";\n } else {\n nodes_params += \"&ns=*,0,-,-\";\n }\n // Subscribe to changes to specific nodes\n for (var i = 0; i < nodes_monitored.length; i++) {\n var vm_info = nodes_monitored[i].split(\",\");\n var node_id = vm_info[0];\n var temp_monitoring = false;\n if (node_id == '&') {\n vm_info.splice(0, 1);\n node_id = vm_info[0];\n temp_monitoring = true;\n }\n if (! (node_id in nodes)) {\n consoleWarn('Cannot monitor unknown node:', node_id);\n nodes_monitored.splice(i, 1);\n i--;\n continue;\n }\n consoleLog('nodes[' + node_id + '] = ', nodes[node_id]); // DEBUG\n var event_time = 0;\n if (temp_monitoring) {\n event_time = '-';\n } else if (nodes[node_id].events && nodes[node_id].events.length > 0) {\n event_time = nodes[node_id].events.slice(-1)[0][0];\n }\n var load_time = 0;\n if (temp_monitoring) {\n load_time = '-';\n } else if (nodes[node_id].load && nodes[node_id].load.length > 0) {\n load_time = nodes[node_id].load.slice(-1)[0][0];\n }\n var state_time = 0;\n if (nodes[node_id].state && nodes[node_id].state.updated > 0) {\n state_time = nodes[node_id].state.updated;\n }\n // Parameters: node_id, event_time, load_time, state_time\n nodes_params += \"&ns=\" + encodeURIComponent(node_id) + \",\"\n + event_time + \",\" + load_time + \",\" + state_time;\n // Now check if we have to monitor any VMs for that node\n var vm_list_changed = false;\n for (var j = 1; j < vm_info.length; j++) {\n var vm_name = vm_info[j];\n if (vm_name == '&') {\n vm_name = vm_info[j + 1];\n vm_info.splice(j, 2);\n j--;\n vm_list_changed = true;\n } else if (! (vm_name in nodes[node_id].vms)) {\n consoleWarn('Cannot monitor unknown VM:', vm_name,\n 'for node:', node_id);\n continue;\n }\n consoleLog('nodes[' + node_id + '].vms[' + vm_name + '] = ',\n nodes[node_id].vms[vm_name]); // DEBUG\n if (nodes[node_id].vms[vm_name]) {\n var event_time = 0;\n if (nodes[node_id].vms[vm_name].events\n && nodes[node_id].vms[vm_name].events.length > 0) {\n event_time\n = nodes[node_id].vms[vm_name].events.slice(-1)[0][0];\n }\n var load_time = 0;\n if (nodes[node_id].vms[vm_name].load\n && nodes[node_id].vms[vm_name].load.length > 0) {\n load_time\n = nodes[node_id].vms[vm_name].load.slice(-1)[0][0];\n }\n // (node info) + vm_name, event_time, load_time\n nodes_params += \",\" + encodeURIComponent(vm_name)\n + \",\" + event_time\n + \",\" + load_time;\n }\n }\n // Check if the monitoring of this node was only temporary\n if (temp_monitoring) {\n nodes_monitored.splice(i, 1);\n i--;\n } else if (vm_list_changed) {\n consoleLog(\"@@@@@@@@@@@\", nodes_monitored[i]); // DEBUG\n consoleLog(\"@@@@@@@@@@@\", vm_info); // DEBUG\n nodes_monitored[i] = vm_info.join(\",\");\n consoleLog(\"@@@@@@@@@@@\", nodes_monitored[i]); // DEBUG\n }\n }\n //consoleLog('AJAX nodes_params: ', nodes_params); // DEBUG\n // Send the request to the server\n $.getJSON('ajax?id=' + server_id + \"&on=\" + nodes_owner + \"&nt=\"\n + nodes_updated + nodes_params)\n .done(serverResponse)\n .fail(serverError);\n /*\n if (timer_test > 0) {\n timer_test--;\n consoleLog(\"----- Next automatic update in 5 seconds (\" + timer_test\n + \" left).\");\n\tconsoleAddMessage(\"#console1\", CONSOLE_DEBUG,\n \"TEST: Next update in 5 seconds.\");\n setTimeout(queryServer, 5000, \"\");\n } else {\n consoleLog(\"----- End of automatic updates.\");\n\tconsoleAddMessage(\"#console1\", CONSOLE_DEBUG,\n \"TEST: Stopping automatic updates.\");\n }\n */\n}", "title": "" }, { "docid": "3d450980b6e8d3a55e54d45dd611172c", "score": "0.4655412", "text": "function localDBcall(operation, params, successCallback, failureCallback) {\n self[operation.name](params, function (response) {\n if (operation.type === 'READ') {\n Utils.triggerFn(successCallback, response);\n } else {\n // add to change log\n params.onlyOnline = true;\n ChangeLogService.add('DatabaseService', operation.name, params).then(function () {\n Utils.triggerFn(successCallback, response);\n }, failureCallback);\n }\n }, failureCallback);\n }", "title": "" }, { "docid": "fcdf6d53bb1aa1b1b4728c88b46257ec", "score": "0.46464652", "text": "function db_taskMeterReadings(id, task)\n{\n\tvar db = openDatabase('monedb', '1.0', 'Water Meter DB', 2 * 1024 * 1024);\n\tvar msg;\n\tvar table;\n\tdb.transaction(function (tx) {\n\t\tsqlCmd = 'SELECT * FROM READINGS WHERE meter_id=' + id;\n//\t\ttx.executeSql(sqlCmd, [], function (tx, results) {\n//\t \t\ttask(tx,results);\n//\t\t});\n\t\ttx.executeSql(sqlCmd, [], task);\n\t},db_ERR1, db_OK);\t\n}", "title": "" }, { "docid": "3eab92ffdbf4edaba7a71b35d312a376", "score": "0.46456182", "text": "function rt_connect()\r\n{\r\n console.log('** connecting rtmonitor **');\r\n rt_mon.connect();\r\n}", "title": "" }, { "docid": "831155a301c56ce499a9b27a2c86f326", "score": "0.464161", "text": "function CheckSwitchMeter(connection,data,callback) {\n\n var records;\n var sql = 'select count(*) from db_LtdOccurMeters where unitId = @unitid and eventId = @eventid ' +\n 'and unitPropid = @propid';\n\n var request = new Request(sql,function(err,rowCount) {\n if (err) {\n errMsg = 'CheckSwitchMeter error: ' + err;\n sql = null;\n request = null;\n return callback(errMsg,null);\n } else {\n sql = null; \n request = null; \n return callback(null,records);\n }\n\n }); \n\n request.addParameter('unitid', TYPES.Int,data.unit);\n request.addParameter('eventid', TYPES.Int,data.eventid);\n request.addParameter('propid', TYPES.Int,data.propid);\n\n request.on('row', function(columns) {\n columns.forEach(function(column) {\n if (column.value === null) {\n console.log('NULL');\n } else {\n console.log(column.value);\n records = column.value;\n\n }\n });\n });\n \n\n\n connection.execSql(request);\n\n}", "title": "" }, { "docid": "62410a0ea9f19c31162281c60ac0f5ba", "score": "0.46379092", "text": "function main() {\n getIpLocation();\n setHandlers();\n }", "title": "" }, { "docid": "8d0c6b18ab25dfe01579392c6b646252", "score": "0.4624955", "text": "function listen (router){\n\n var fillSourceObj = function(callback){\n if (callback && callback.rows && callback.rows[0]){\n callback.source = callback.rows[0];\n if (callback.list){\n var _next = callback.list.pop();\n\n if (_next) {\n _next(callback);\n }\n }\n }\n }\n\n var fillLogObj = function(callback){\n if (callback && callback.rows && callback.rows[0]){\n callback.log = callback.rows[0];\n if (callback.list){\n var _next = callback.list.pop();\n\n if (_next) {\n _next(callback);\n }\n }\n }\n }\n\n router.get('/import/:id', function(request, response) {\n var sourceId = request.params.id;;\n var callback = {\n\n list : [execute, sourceDAO.updateLastLogId, fillSourceObj, sourceDAO.getSourceById, fillLogObj],\n source : {sourceId : sourceId},\n parameter: response\n };\n\n logDAO.createLog(callback);\n });\n\n router.get('/log/:id', function(request, response) {\n var logId = request.params.id;\n\n var callback = {\n log : {logId : logId},\n list : [responseUtil.outputLog],\n parameter: response\n };\n\n logDAO.getLogDetails(callback);\n });\n}", "title": "" }, { "docid": "ce2a446d6aacf12a070640012d4a4b53", "score": "0.46242988", "text": "function connect2Informix() {\n\n try\n {\n global.conn = global.dbobj.openSync(global.ConStr);\n }\n catch(e)\n {\n console.log(e);\n return;\n }\n}", "title": "" }, { "docid": "2505e8d7714831267ed8392ecb98cc3f", "score": "0.4618777", "text": "function readFromDbHandler() {\n var request = indexedDB.open('workerDB');\n var db;\n\n request.onerror = function(err) {\n alert(\"Why didn't you allow my web app to use IndexedDB?!\", err);\n };\n\n request.onsuccess = function(event) {\n db = event.target.result;\n\n db.transaction('devices').objectStore('devices').get(1).onsuccess = function(event) {\n dataHeader.textContent = event.target.result.type;\n };\n };\n }", "title": "" }, { "docid": "432a137a5f9dedd44d0094539d9bbeb9", "score": "0.45986378", "text": "watch() {\n this._watchCount++;\n Log('watch:', this._id, this._watchCount);\n if (!this._watchRunning) {\n this._watchRunning = true;\n this._watchFail = 0;\n const TopologyManager = require('./TopologyManager');\n const CaptureManager = require('./CaptureManager');\n const task = async () => {\n if (this._watchCount === 0) {\n this._watchRunning = false;\n return;\n }\n const start = Date.now();\n if (!TopologyManager.running && !CaptureManager.running) {\n try {\n if (await this.update()) {\n this._watchFail = 0;\n await DB.updateDeviceState(this._id, this.state.toDB());\n }\n else {\n throw new Error('watch update failed');\n }\n }\n catch (e) {\n Log('watch:error:', e);\n this._watchFail++;\n this.emit('watch.error');\n }\n }\n setTimeout(task, Math.max(0, Date.now() - start + REFRESH_TIMING));\n }\n task();\n }\n return this._watchCount;\n }", "title": "" }, { "docid": "cbcd5e1712cf1e4dbf9b3526d6d824e8", "score": "0.4579306", "text": "function main(hostAndPort) {\n\n if (hostAndPort == #N/A)\n hostAndPort = \"*\";\n\n var result={};\n result[\"status\"] = {};\n result[\"status\"][\"global\"]={};\n\n var hosts = cluster::mySqlNodes();\n for (idx = 0; idx < hosts.size(); ++idx) {\n host = hosts[idx];\n if(hostAndPort != \"*\" && !hostMatchesFilter(host,hostAndPort))\n continue;\n\n map = host.toMap();\n connected = map[\"connected\"];\n if (connected) {\n ret = getValueMap(host, \"SHOW GLOBAL STATUS\");\n \n if (ret != false && ret.size() > 0)\n {\n result[\"status\"][\"global\"][idx]={};\n result[\"status\"][\"global\"][idx][\"reported_by\"]=host.toString();\n for (i=0; i<ret.size(); ++i)\n {\n result[\"status\"][\"global\"][idx][i]={};\n result[\"status\"][\"global\"][idx][i][\"variable_name\"]=linkify(ret[i][0]);\n result[\"status\"][\"global\"][idx][i][\"value\"]=ret[i][1];\n\n }\n }\n }\n }\n exit(result);\n}", "title": "" }, { "docid": "103e650a07296bc71f1c4105667906e8", "score": "0.45703536", "text": "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to update the status from HCI\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Get all the Entries that are applicable for update\n\t\t\t\tvar oDBRecords = getAllDBEntries();\n\t\t\t\t//Read the Status from Cloud Integration\n\t\t\t\tvar oHCIRecords = retrieveRecordsFromHCI(oDBRecords.valueSet);\n\t\t\t\t//Execute the updates\n\t\t\t\tvar oUpdateResults = mapUpdates(oHCIRecords.retrievedValues, oDBRecords.valueMap);\n\t\t\t\t//Write to the trace\n\t\t\t\t$.trace.info(JSON.stringify({\n\t\t\t\t\ttotalDBRecords: oDBRecords.valueSet.length,\n\t\t\t\t\ttotalHCIRecordsRetrieved: oHCIRecords.retrievedValues.length,\n\t\t\t\t\ttotalHCIFailedRetrievals: oHCIRecords.failedRetrievals.length,\n\t\t\t\t\tHCIFailedRetrievalDetails: oHCIRecords.failedRetrievals,\n\t\t\t\t\tupdatesRequested: oUpdateResults.iUpdatesRequested,\n\t\t\t\t\tupdatesProcessed: oUpdateResults.iUpdatesProcessed\n\t\t\t\t}));\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tTableUpdateStatus: gvTableUpdate\n\t\t\t}));\n\t\t}\n\t}", "title": "" }, { "docid": "f9402cf0ed3360834ddd5a80a0c592d5", "score": "0.45699903", "text": "function writeToDB() {\n\tvar pos = markerPos(); //return pos of marker in the markers array\n\tvar spawn = require(\"child_process\").spawn; //spawns a childs proc.\n\tvar child = spawn('python',[\"userInterface/py/updateDB.py\", new_lat, new_lng, pos]); //calls a python script with parameters\n}", "title": "" }, { "docid": "449e17ef372814e073f3f75698b8e8df", "score": "0.4551487", "text": "async startIpfs() {\n try {\n console.log(\"Setting up instance of IPFS...\");\n this.handleLog(\"Setting up instance of IPFS...\");\n\n this.ipfs = await IPFS.create();\n this.handleLog(\"IPFS node created.\");\n\n // Generate a new wallet.\n this.wallet = new BchWallet();\n // console.log(\"this.wallet: \", this.wallet);\n\n // Wait for the wallet to initialize.\n await this.wallet.walletInfoPromise;\n\n // Instantiate the IPFS Coordination library.\n this.ipfsCoord = new IpfsCoord({\n ipfs: this.ipfs,\n type: \"browser\",\n logHandler: this.handleLog,\n bchjs: this.wallet.bchjs,\n mnemonic: this.wallet.walletInfo.mnemonic\n });\n this.handleLog(\"ipfs-coord library instantiated.\");\n\n // Wait for the coordination stuff to be setup.\n await this.ipfsCoord.isReady();\n\n // subscribe to the 'chat' chatroom.\n await this.ipfsCoord.ipfs.pubsub.subscribeToPubsubChannel(\n CHAT_ROOM_NAME,\n this.handleChatLog\n );\n\n // Pass the IPFS instance to the window object. Makes it easy to debug IPFS\n // issues in the browser console.\n if (typeof window !== \"undefined\") window.ipfs = this.ipfs;\n\n // Get this nodes IPFS ID\n const id = await this.ipfs.id();\n this.ipfsId = id.id;\n this.handleLog(`This IPFS node ID: ${this.ipfsId}`);\n\n console.log(\"IPFS node setup complete.\");\n this.handleLog(\"IPFS node setup complete.\");\n _this.handleLog(\" \");\n\n } catch (err) {\n console.error(\"Error in startIpfs(): \", err);\n this.handleLog(\"Error trying to initialize IPFS node!\");\n }\n }", "title": "" }, { "docid": "d22f21ec5656754b4c19cc0c0b6696d2", "score": "0.4546919", "text": "monitor(options) {\n options = options || {};\n if (this.s.state !== STATE_CONNECTED || this.s.monitoring) return;\n if (this.s.monitorId) clearTimeout(this.s.monitorId);\n this.s.monitorFunction(this, options);\n }", "title": "" }, { "docid": "1a3099c7aaba15cfa80de4aab4248b40", "score": "0.45324492", "text": "function monitorInput(args)\n{\n\targs = args.slice(2);\n\tif(args.length != InputLength)\n\t\tthrow new InvalidParametersNumberError();\n\t\n\t//<TOKEN>\n\tvar token = args[0];\n\t\n\t//<DROPLET_LIST>\n\tvar arg = args[1].replace(/\\\"/g, '');\n\tvar dropletList = arg.length === 0 ? [] : arg.split(';');\n\n\t// Create request object to be executed.\n\tvar request = new Object()\n\trequest.token = token;\n\trequest.dropletList = dropletList;\n\t\n\t// Get metrics.\n\tprocessRequest(request);\n}", "title": "" }, { "docid": "4ea4bb55d2771e67501088eb499d0df3", "score": "0.45285577", "text": "function WriteOnlineMeterSnapshot(data,callback) {\n\n var sql = '';\n var connection;\n var updated = new Date();\n\n dbConnect.GetDbConnection(data.operatorid,function(err,results) {\n\n if (err) {\n errMsg = 'GetDbConnection error: ' + err;\n return callback(errMsg,null);\n } else {\n connection = results;\n sql = 'insert into db_unitTransMeters(operatorID,unitId, unitPropId,transNumber,vc1,vc2,vt1,vt2,cc1,cc2,cc3,cc4,cc5,' +\n 'ch1,ch2,ch3,ccr,updated,atm,hpt,mtr,tcd,tdt,tft)values(@oper,@unitid,@propid,@trans,@vc1,@vc2,@vt1,@vt2,@cc1,@cc2,@cc3,@cc4,@cc5,' +\n '@ch1,@ch2,@ch3,@ccr,@date,@atm,@hpt,@mtr,@tcd,@tdt,@tft)';\n\n var request = new Request(sql,function(err,rowCount) {\n if(err) {\n errMsg = 'WriteOnlineMeterSnapshot error: ' + err;\n connection.close();\n conenction = null;\n sql = null;\n request = null;\n delete updated;\n return callback(errMsg,null) ;\n } else {\n connection.close();\n connection = null;\n sql = null;\n request = null;\n delete updated;\n rowCount = null;\n return callback(null,'ok');\n }\n }); \n\n request.addParameter('oper', TYPES.Int,data.operatorid);\n request.addParameter('unitid', TYPES.Int,data.unitid);\n request.addParameter('propid', TYPES.Int,data.propid);\n request.addParameter('trans', TYPES.Int,data.trans);\n request.addParameter('vc1', TYPES.Int,data.vc1);\n request.addParameter('vc2', TYPES.Int, data.vc2);\n request.addParameter('vt1', TYPES.Int,data.vt1);\n request.addParameter('vt2', TYPES.Int,data.vt2);\n request.addParameter('cc1', TYPES.Int,data.cc1);\n request.addParameter('cc2', TYPES.Int,data.cc2);\n request.addParameter('cc3', TYPES.Int,data.cc3);\n request.addParameter('cc4', TYPES.Int,data.cc4);\n request.addParameter('cc5', TYPES.Int,data.cc5);\n request.addParameter('ch1', TYPES.Int,data.ch1);\n request.addParameter('ch2', TYPES.Int,data.ch2);\n request.addParameter('ch3', TYPES.Int,data.ch3);\n request.addParameter('ccr', TYPES.Int,data.ccr);\n request.addParameter('date', TYPES.DateTime,updated);\n request.addParameter('atm', TYPES.Int,data.atm);\n request.addParameter('hpt', TYPES.Int,data.hpt);\n request.addParameter('mtr', TYPES.Int,data.mtr);\n request.addParameter('tcd', TYPES.Int,data.tcd);\n request.addParameter('tdt', TYPES.Int,data.tdt);\n request.addParameter('tft', TYPES.Int,data.tft);\n\n\n connection.execSql(request);\n\n }\n\n });\n\n}", "title": "" }, { "docid": "b55170b8940956011ae6dfeb780192bc", "score": "0.45248902", "text": "function inspectServerBehavior(ssRec) {\n\n\n CALLABLE_TEXT.value = ssRec.callableText;\n CALLABLE_NAME_BOX.value = ssRec.callableName;\n\n CONN_LIST.pickValue(ssRec.connectionName);\n\n TREE.setConnection(ssRec.connectionName)\n\n if (ssRec.recordset)\n {\n RR_CHECKBOX.checked = true;\n RR_NAME.value = ssRec.recordset;\n }\n\n var list = PARAM_LIST;\n\n if (ssRec.ParamArray)\n {\n var gridArray = new Array()\n for (i = 0;i < ssRec.ParamArray.length; i++)\n {\n var thisParam = ssRec.ParamArray[i];\n var thisRow = new Array()\n\n thisRow[0] = thisParam.name;\n if (parseInt(thisParam.type) == thisParam.type)\n {\n thisRow[1] = thisParam.type;\n }\n else\n {\n thisRow[1] = thisParam.type;\n }\n thisRow[2] = GetDirString(thisParam.direction);\n thisRow[3] = thisParam.value;\n thisRow[4] = thisParam.runTime;\n\n gridArray.push(thisRow);\n }\n PARAM_LIST.setContents(gridArray)\n }\n\n checkBoxClicked() //updates the test button\n \n if (ssRec.outOfDate) {\n alert(MM.MSG_SBOutOfDate);\n }\n if (ssRec && ssRec.errorMsg) {\n alert(ssRec.errorMsg);\n }\n}", "title": "" }, { "docid": "727435656b0c61894ad2228bdf466a3c", "score": "0.4515349", "text": "function onBulkDataConnection() {\r\n return function(conn) {\r\n console.log(\"Data channel connected\");\r\n conn.on('close', function() {\r\n console.log(\"Data channel close\");\r\n });\r\n\r\n conn.on('data', function(data) { //This event is trigered when a request for data arrives from a browser.\r\n var requestObj = JSON.parse(data);\r\n var targetName = null;\r\n var out = {};\r\n\r\n cloudant.db.list(function(err, allDbs){ //this gets a list of all the databases \r\n if (err) {\r\n throw err;\r\n }\r\n for(var i = 0 ; i < allDbs.length ; i++ ) {\r\n if(allDbs[i].indexOf(\"iotp_4rxa4d_default_\") == -1 && requestObj.databaseName == allDbs[i]) {\r\n targetName = allDbs[i];\r\n break;\r\n }\r\n }//end of for loop\r\n if(targetName != null) {\r\n querryBulk(targetName); //make this function.\r\n }\r\n else {\r\n console.log(requestObj.databaseName + \" database not found.\");\r\n conn.write(JSON.stringify({update:\"done\"}));\r\n conn.write(JSON.stringify({message:requestObj.databaseName + \" database not found, try again.\"}));\r\n }\r\n });//end of list\r\n\r\n function querryBulk(targetName) {\r\n var clientUpdate = setInterval(function() {\r\n conn.write(JSON.stringify({update:\".\"}));\r\n }, 2000);\r\n console.log(\"Searching database \" + targetName);\r\n conn.write(JSON.stringify({message:targetName + \" database found, starting querry...\"}));\r\n var targetDatabase = cloudant.db.use(targetName);\r\n targetDatabase.find({ //this will get all the documents from the specified database.\r\n \"selector\": {\r\n },\r\n \"fields\": [\r\n \"timestamp\",\r\n \"data.d\",\r\n \"eventType\",\r\n \"localName\",\r\n \"deviceId\"\r\n\r\n ],\r\n \"sort\": [\r\n \r\n ]\r\n }, function(err, result) {\r\n if (err) {\r\n throw err;\r\n }\r\n else {\r\n data = result.docs;\r\n for(i in data) {\r\n //console.log(JSON.stringify(result[i]));\r\n thisResult = data[i];\r\n if(out[thisResult.localName]) {\r\n out[thisResult.localName].setReading(thisResult);\r\n }\r\n else {\r\n out[thisResult.localName] = new DeviceDataSet();\r\n out[thisResult.localName].setReading(thisResult);\r\n }\r\n }\r\n \r\n for(i in out) {// we go through each deviceData\r\n var thisDeviceData = out[i];\r\n for(j in thisDeviceData) { // we go through each characteristic\r\n var thisChar = thisDeviceData[j];\r\n for(k in thisChar) {\r\n var entry = thisChar[k];\r\n if (entry[0] != undefined && entry[0] != null && entry[0].length > 0) {\r\n entry[0] = parseTime(entry[0]);\r\n entry.splice(1, 0, entry[0].toString().split('-')[0]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n for(i in out) {// we go throughh each deviceData\r\n var thisDeviceData = out[i];\r\n for(j in thisDeviceData) { // we go through each characteristic\r\n var thisChar = thisDeviceData[j];\r\n for(k in thisChar) {\r\n thisChar.sort(compareFunction);\r\n }\r\n }\r\n }\r\n \r\n for(i in out) {\r\n var thisDevice = out[i];\r\n removeAllFirstEntries(thisDevice);\r\n allCharToCSV(thisDevice);\r\n }\r\n \r\n clearInterval(clientUpdate);\r\n conn.write(JSON.stringify({update:\"done\"}));\r\n console.log(\"Sending bulk data back...\");\r\n conn.write(JSON.stringify(out));\r\n }\r\n });\r\n }\r\n });\r\n };\r\n}", "title": "" }, { "docid": "fa57ea109b0600ff4fd340627eae9bf2", "score": "0.4510264", "text": "function main()\r\n{\r\n\tvar snmp;\r\n\tvar snmp_port = 161;\r\n\tif(typeof(port) !== 'undefined')\r\n\t\tsnmp_port = parseInt(port);\r\n\tvar snmp_v = 1;\r\n\tif(typeof(version) !== 'undefined') {\r\n\t\tsnmp_v = parseInt(version);\r\n\t}\r\n\t\r\n\ttry {\r\n\t\tsnmp = SNMP(hostname, password, snmp_port, snmp_v);\r\n\t\tproc_names = snmp.getColumnOIDExtra(\".1.3.6.1.2.1.25.4.2.1.2\");\r\n\t\tproc_count = proc_names.length;\r\n\t\t\r\n\t\tproc_found = 0;\r\n\t\tmem = 0;\r\n\t\tfor(p = 0; p < proc_count; p++) {\r\n\t\t\tproc_name = proc_names[p][0];\r\n\r\n\t\t\tif(proc_name.toLowerCase().indexOf(process.toLowerCase()) >= 0) {\r\n\t\t\t\tproc_oid = proc_names[p][1];\r\n\t\t\t\tproc_oid = proc_oid.substr(proc_oid.lastIndexOf(\".\"));\r\n\t\t\t\tproc_found++;\r\n\t\t\t\tmem += parseInt(snmp.getSingleOID(\".1.3.6.1.2.1.25.5.1.1.2\"+proc_oid));\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(proc_found > 0) {\r\n\t\t\tresult.value = mem / 1024;\r\n\t\t\tresult.msg = proc_found+\" processes '\"+process+\"' found running\"\r\n\t\t\tresult.status = result.STATUS_GOOD;\r\n\t\t} else {\r\n\t\t\tresult.value = Number.NaN;\r\n\t\t\tresult.msg = \"Process \"+process+\" was not running\";\r\n\t\t\tresult.status = result.STATUS_ERROR;\t\r\n\t\t}\r\n\t\tsnmp.close();\r\n\r\n\t} catch(err) {\r\n\t\t// Catch all exceptions and fail the result\r\n\t\tresult.msg = \"\"+err;\r\n\t\tresult.status = result.STATUS_FAILED;\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "a795efe708e6e26a58246bae0f9a300a", "score": "0.44998914", "text": "function pythonScript(req, res) { \n\tvar spawn = require(\"child_process\").spawn; \n\tvar process = spawn('python',[\"./VolumeMeter.py\"] ); \n\tprocess.stdout.on('data', function(data) { \n\t\tsocket.write(JSON.stringify({ dataFromNetClient: data.toString(), clientid: id}));\n\t} ) \n}", "title": "" }, { "docid": "ce64c95342edf8343068b93ecc4e9abb", "score": "0.44965413", "text": "function SystemSocketOpen()\n{\n ws.onmessage = SystemSocketMessageHandler;\n document.getElementById(\"Command_Reply\").innerHTML = \"Server Connection Initiated\"\n\n // Get a list from the server of all linuxcnc status items\n ws.send( JSON.stringify({ \"id\":\"STATUS_CHECK\", \"command\":\"watch\", \"name\":\"estop\" }) ) ;\n ws.send( JSON.stringify({ \"id\":\"INI_MONITOR\", \"command\":\"watch\", \"name\":\"ini_file_name\" }) ) ;\n}", "title": "" }, { "docid": "95e37c5cb79ebb6a316dbac6720a8dbd", "score": "0.44884834", "text": "async function init() {\r\n\r\n await fs.connect();\r\n //===========================Init Data ==============================\r\n var idnInformation = await idn.getIdentity();\r\n var idnRegis = {\r\n ip: idnInformation.ip,\r\n name: idnInformation.hostname,\r\n status: 'online',\r\n actionResult: []\r\n }\r\n idnRegis.actionResult.push({ tag: 'indentity-information', isDone: true, payload: idnInformation, message: null });\r\n console.log(idnRegis);\r\n //===========================Init Data ==============================\r\n fs.add(idnRegis).then((val) => {\r\n connectionID = val.id;\r\n console.log('connect success id : ' + val.id);\r\n var ipText = document.getElementById('connectionIP');\r\n ipText.innerHTML = 'Connection ID : ' + connectionID;\r\n listenning(connectionID);\r\n });\r\n}", "title": "" }, { "docid": "5700d0db6fe70ad9653fb7f60b5b9960", "score": "0.44856447", "text": "function GetServerData(arg, context) {\n var splitArgs = arg.split(\"|\");\n var actionFlag = splitArgs[0];\n\n if (splitArgs.length > 2) {\n alert(splitArgs[2]);\n return;\n }\n\n switch (actionFlag) {\n case \"update-at-bat\":\n console.log(\"UPDATED!\");\n break;\n default:\n console.log(\"Default!\");\n };\n}", "title": "" }, { "docid": "ccafac5a0369084689f855849619d42c", "score": "0.44777945", "text": "function LoadFilesystemInfo()\n{\n path = document.getElementById('@@PATH_INPUT_CLIENTID@@').value;\n\n MatrixPACS.ImageServer.Web.Application.Services.FilesystemInfoService.GetFilesystemInfo(path, OnLoadFilesystemInfoSuccess, OnLoadFilesystemInfoError); \n}", "title": "" }, { "docid": "d56e1c2151257cf8beec2d47d9aa30fe", "score": "0.44763586", "text": "issueQueries(datasource) {\n this.updateTimeRange();\n\n //console.log('block issueQueries', datasource);\n }", "title": "" }, { "docid": "d83664b78d97faff1c389f09a8860d84", "score": "0.44748163", "text": "function requestServerStat() {\n\t\t\t\tvar infoContainers = $('.serverInfoContainer');\n\t\t\t\tfor(var index = 0; index< infoContainers.length; index++){\n\t\t\t\t\tvar request = new InfoRequest(infoContainers[index]);\n\t\t\t\t\trequest.request();\n\t\t\t\t\trequest.startInterval();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "5b32cbd77b423172d4ce11b07c0b7949", "score": "0.44724774", "text": "function refresh(){\n getStatus(function(err, data){\n // Get time since last save in minutes\n var savediff = Math.ceil(getDateDiff(new Date(data.storage.db_last_save), new Date()) / timeCalc[1] );\n\n // Get number of changes to DB\n var changes = data.storage.db_changes;\n\n if(DEBUG){ \n smc.getMessage(4,null,`Database Refresh`);\n smc.getMessage(4,null,`DateDiff Time Between: ${ savediff } minutes`);\n smc.getMessage(4,null,`DB Changes: ${changes}`);\n }\n\n // Backup Database if more than 15 minues has passed or 5 or more changes have been made to the db\n if(savediff > (15) || changes > 5 ){\n smc.getMessage(1,6,\"Database Backup Started\")\n client.BGSAVE(function(err, res){\n if(err){ smc.getMessage(1,5,`Error Backing Up Redis: ${err}`); }\n else { smc.getMessage(1,null,\"Backup Complete\"); }\n });\n }\n });\n\n // Function calculates the difference between 2 date objects by comparing the objects milliseciond conversion of valueOf()\n function getDateDiff( date1, date2 ){\n if(date1 instanceof Date && date2 instanceof Date){\n var d1 = date1.valueOf(), d2 = date2.valueOf();\n \n return d2 - d1;\n }\n else { return 0; }\n }\n}", "title": "" }, { "docid": "dc42b4cfca803a4f6424d07e26b4f102", "score": "0.44708246", "text": "function readDbMaster(item) {\n if (item.window) {\n for (var id = 1; id <= 3; id++) {\n let port_id = \"port\" + id;\n\n if (item[port_id].state === \"running\") {\n readLastLine\n .read(item[port_id].simulator_db, 10)\n .then(function (lines) {\n let db = [];\n let data = lines.split(/\\r?\\n/);\n for (let i = 0; i < 5; i++) {\n let p =\n /Point:([0-9]+); Value:([0-9]+); Quality:([A-Za-z, ]+)/.exec(\n data[i]\n );\n if (p)\n db[\"p\" + (i + 1)] = { point: p[1], value: p[2], quality: p[3] };\n }\n\n item.window.webContents.send(\"master-message\", {\n msg: \"db\",\n port_id: port_id,\n db: db,\n });\n });\n }\n }\n }\n}", "title": "" }, { "docid": "b823fa505f056d35677893945b5ae904", "score": "0.4469874", "text": "function StartStopAction() {\n var ck = 0;\n var on_switch = document.getElementById(\"start_stop\");\n // capture whether on or off was checked and be sure the right checkbox background image is displayed\n if (on_switch.checked) {\n ck = 1;\n on_switch.style.setProperty(\"background-image\", \"url(/images/checked-shift.png)\");\n sfbSetStatus = true;\n } else {\n ck = 0;\n on_switch.style.setProperty(\"background-image\", \"url(/images/unchecked-shift.png)\");\n sfbSetStatus = false;\n };\n updatesSinceChange = 0; // starting a new cycle of 3 status updates for dis/connect to happen\n\n // Endpoint: http://ip_adr:port/start/1 for on and http://ip_adr:port/start/0 for off\n fetch(\"http://\" + location.hostname + \":\" + location.port + \"/start/\" + ck.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then(\n function (response) {\n HandleResponse(response)\n }\n )\n .catch(function (err) {\n console.log('Fetch Error :-S', err);\n });\n}", "title": "" }, { "docid": "9a560d4c1921c91c955d678d75814698", "score": "0.44686556", "text": "requestCheck() {\n this[kMonitor].requestCheck();\n }", "title": "" }, { "docid": "9a560d4c1921c91c955d678d75814698", "score": "0.44686556", "text": "requestCheck() {\n this[kMonitor].requestCheck();\n }", "title": "" }, { "docid": "2b9ee27ae4d11272872237cd92199b7f", "score": "0.44581082", "text": "getMonitorInfo(params, cb) {\n util.getMyWindowIdentifier((myWindowIdentifier) => {\n if (!params.windowIdentifier) {\n params.windowIdentifier = myWindowIdentifier;\n }\n this.routerClient.query(\"Launcher.getMonitorInfo\", params, function (err, response) {\n if (cb) {\n cb(err, response.data);\n }\n });\n });\n }", "title": "" }, { "docid": "7453045911f9e2b02c2be4197a3cb937", "score": "0.4452968", "text": "function runOnline(dims)\n{\n $(\"#funcSelector\").change(function () {\n query(\"cfg\",\n $(\"#funcSelector option:selected\").text(),\n function (json) {\n if (!isEmpty(json)) {\n $(\"#uiFuncName\").text(function (_, _) {\n return $(\"#funcSelector option:selected\").text();\n });\n drawCFG(dims, json);\n registerRefreshEvents(dims, json);\n }\n });\n });\n query(\"functions\", \"\", drawFunctions);\n query(\"bininfo\", \"\", drawBinInfo);\n}", "title": "" }, { "docid": "79fe01b498d0ebe632054dbdb9c50e5d", "score": "0.44443348", "text": "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error during mapping IN to OUT:\" + errorObj.message;\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\t\tresult: gvErrorMessage,\n\t\t\t\t\t\tstatus: gvStatus,\n\t\t\t\t\t\ttableUpdates: gvTableUpdate\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// \t\t} else if ($.request.method === $.net.http.GET) {\n\t\t// \t\t\t//Read Entries from the Table\n\t\t// \t\t\ttry {\n\t\t// \t\t\t\t_getEntries();\n\t\t// \t\t\t} catch (errorObj) {\n\t\t// \t\t\t\t$.response.status = 200;\n\t\t// \t\t\t\t$.response.setBody(JSON.stringify({\n\t\t// \t\t\t\t\tmessage: \"API Called\",\n\t\t// \t\t\t\t\tresult: gvErrorMessage\n\t\t// \t\t\t\t}));\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t}", "title": "" }, { "docid": "31c7426e6ea7ba42ed976930ae4c5095", "score": "0.44412035", "text": "function getInfo(container){\n clearstatusBar(container);\n $.mobile.showPageLoadingMsg();\n $.ajax({ \n url: ip + \"/proc/servd\",\n type: \"POST\",\n dataType:'json',\n success: function(data){ \n $.each(data, function(page, register) {\n manageFields(register, page);\n }); \n $.mobile.hidePageLoadingMsg(); \n },\n error:function(data){\n getErrorFooter(container); \n }\n });\n}", "title": "" }, { "docid": "da2dd2f730d9c5929834c52e14120567", "score": "0.44373792", "text": "function startDatabaseQueries() {\n \n}", "title": "" }, { "docid": "264db01c95ca7b3b4f3a2aaa392fbead", "score": "0.44316977", "text": "function captureInput() {\n query = inputField.val();\n requestAPI();\n }", "title": "" }, { "docid": "70066f737bb53edc036a9113d2560c62", "score": "0.44238436", "text": "function InsertCallRecord(coninfo,customerWebValueCode) {\n var Call_Record_Table = \"callrecordlist\";\n var dbobj = dbinterface.initialize();\n var conn = dbinterface.connectDB(dbobj, customerWebValueCode);\n var starttime = convertTimeZone(coninfo['callstarttime']);\n var endtime = convertTimeZone(coninfo['callendtime']);\n var columns = \"(AgentName,CustomerName,CallStartTime,CallEndTime,CallDuration,TerminationReason)\";\n var values = \"('\" + coninfo['agentname'] + \"','\" +\n coninfo['custname'] + \"','\" +\n starttime + \"','\" +\n endtime + \"','\" +\n coninfo['callduration'] + \"','\" +\n coninfo['terminationreason'] + \"')\";\n//console.log(filter);\n dbinterface.insertColumnDatatoTable(dbobj, conn, Call_Record_Table, columns, values, function (err, data) {\n if (err) {\n // error handling code goes here\n console.log(\"ERROR : \", err);\n } else {\n // code to execute on data retrieval\n console.log(\"Inserted new record properly\");\n }\n dbinterface.endConnection(dbobj, conn);\n });\n\n}", "title": "" }, { "docid": "3ac0768628c25a36e06cfa72840b3f09", "score": "0.44195294", "text": "function main() {\n // console.log(typeof $.ajax);\n setInterval(function () {\n var fundList = loadMonitorItem();\n console.log(\"当前监控基金数:\" + fundList.length);\n for (var i = 0; i < fundList.length; i++) {\n var d = showAlert(fundList[i]);\n loadNetValue(fundList[i], d);\n }\n }, MONITOR_INTERVAL);\n\n\n}", "title": "" }, { "docid": "ab9d5c92fa6ddc8d24dee16cf92d7c41", "score": "0.44169435", "text": "function startProcess () {\n\n\tvar currentdate = new Date();\n\n\tvar datetime = currentdate.getDate() + \"/\"\n\t\t+ (currentdate.getMonth()+1) + \"/\"\n\t\t+ currentdate.getFullYear() + \" @ \"\n\t\t+ currentdate.getHours() + \":\"\n\n\tconsole.log('Topdesk Maintenance Process for date: ', + currentdate.getDate() + \"/\" + currentdate.getMonth()+1 + \"/\" + currentdate.getFullYear() + \": \"+ currentdate.getHours());\n\n try {\n\n\t\tfs.appendFile(\"topdesk_process.log\", \"Topdesk Maintenance Process for date: \" + currentdate.getDate() + \"/\" + currentdate.getMonth() + \"/\" + currentdate.getFullYear() + \": \"+ currentdate.getHours() + \"\\n\", (err) => {});\n\n\t\t//data.getDataClosed();\n\t\tdata.routeNewTickets();\n\n\t\t//For getting TD objects and testing\n\t\t//data.getTicketsToInspect();\n\n\t} catch (e) {\n\t\tconsole.log(\"App crashed while managing connection \" + e.message);\n\t}\n}", "title": "" }, { "docid": "8c1efee9567b60592c8603bd17766a0a", "score": "0.4416262", "text": "function EditInformation(id,table,action,queryStr,div1){ \n//\tclearInterval(refreshIntervalId);\n\tvar deviceArray = new Array();\n\tvar myId = \"\";\n\tvar x=powerPageIP;\n\tif(x != undefined && x != \"\"){\n\t\t\n\t\tvar c=x.split(\"*\");\n\t\t\n\t}\n\tif(id.toLowerCase() == \"powermanagementoff22\"){\n//\tvar devId1 = $('#controllerId').text();\n\t\tmyId=devId1;\n\t}\n\n\t\tPMDeviceId = myId;\n\t\t\t\t$('.trPDU').each(function(){\n\t\t\t\t\tif ($(this).is(':checked')){\n\t\t\t\t\t\tPMDeviceId = $(this).attr('pduid');\n//\t\t\tip = ip+',';\n\t\t\t\t\t}\n\t\t\t\t});\n\tmyId = PMDeviceId;\n\tif(queryStr != undefined || queryStr ==\"\" ){ \n\t\tif( powerPageIP == \"\"){\n\t\tvar qstrUser = \"{'QUERY':[{'DeviceId':'\"+myId+\"', 'IP':'\"+powerPageIP+\"','flag':'true',}]}\";\n\t\t}else{\n\t\tvar qstrUser = \"{'QUERY':[{'DeviceId':'\"+myId+\"','IP':'\"+powerPageIP+\"'}]}\";\n\t\t}\n\t}else{\n\t\tvar qstrUser = \"{'QUERY':[{'DeviceId':'\"+myId+\"','IP':'\"+powerPageIP+\"'}]}\";\n\t\tif(action == \"getdeviceinformation\" && myId != ''){\n\t\t\tqstrUser = \"{'QUERY': [{'DeviceId':'\"+myId+\"'}]}\";\n \tdevId=myId;\n\t\t}\n\t}\n//\t\tvar url = \"https://\"+CURRENT_IP+\"/cgi-bin/Final/M2_CGI/FastQueryCgi.py?\"+qstrUser;\n\t\tvar url= getURL(\"Power\",\"JSON\"); \t\t\n\n\t$.ajax({\n\t\turl: url,\n\t\tdata: {\n\t\t\t\"action\": action,\n\t\t\t\"query\": qstrUser,\n\t\t},\n\t\tdataType: 'html',\n\t\tsuccess: function (data) {\n\t//\t\tdata = $.trim(data);\n\t\t\tdat = data.replace(/'/g,'\"');\n\t\t\tvar jsonData = $.parseJSON(dat);\n\t\t\tshowEditInformation(jsonData);\n\t\t}\n\t}); \n\t$.ajax({\n\t\turl: url,\n\t\tdata: {\n\t\t\t\"action\": \"getoutleteditinformation\",\n\t\t\t\"query\": qstrUser,\n\t\t},\n\t\tdataType: 'html',\n\t\tsuccess: function (data) {\n\t\t\tdata = $.trim(data);\n\t\t\tdat = data.replace(/'/g,'\"');\n\t\t\tvar jsonData = $.parseJSON(dat);\n\t\t\tshowEditInformation2(jsonData);\n\t\t}\n\t}); \n}", "title": "" }, { "docid": "f3209307eb1d0a65484ebf55fe16a6a1", "score": "0.44082156", "text": "function macWatch() {\n var terminal = require('child_process').spawn('fswatch', [dirMonitored2]);\n\n terminal.stdout.on('data', function (data) {\n data = data.toString().split(\"\\n\");\n console.log('stdout: ' + data);\n sh.each ( data, function (i, file) {\n if ( sh.isFileType(file, 'js') ) {\n helper.trigger(file)\n }\n if ( sh.isFileType(file, 'html') ) {\n helper.trigger(file)\n }\n //var split = file.split(\"\");\n })\n\n });\n\n terminal.on('exit', function (code) {\n console.log('child process exited with code ' + code);\n });\n\n }", "title": "" }, { "docid": "be82895841f24f8bd5632e5fa207d9ba", "score": "0.44067973", "text": "function startDatabaseQueries() {\n var myUserId = firebase.auth().currentUser.uid;\n var statusRef = firebase.database().ref('/kettle/status');\n var curWaterRef = firebase.database().ref('/kettle/cur_water');\n var reservationCountRef = firebase.database().ref('/reservations/');\n // Fetching and displaying all posts of each sections.\n updateValueByRef(statusRef, statusContainer);\n updateValueByRef(curWaterRef, currWaterContainer);\n refreshData(reservationCountRef, addReservationEntry);\n // Keep track of all Firebase refs we are listening to.\n listeningFirebaseRefs.push(statusRef);\n listeningFirebaseRefs.push(curWaterRef);\n listeningFirebaseRefs.push(reservationCountRef);\n}", "title": "" }, { "docid": "6baed91cf48b04477f56579afafad873", "score": "0.44047567", "text": "function UploadProcess(serverIP, fileName, dbObj) {\r\n\r\n\t// Delete the doc before insert\r\n\tDBOperationRemoveDocByNode(serverIP, fileName, dbObj);\r\n\r\n\t// Parse the doc to MongoD\r\n\tDBOperationParseETLToMongoD(serverIP, fileName, dbObj);\r\n\r\n\t//Query count\r\n\t//DBOperationFindDoc(serverIP, fileName, dbObj);\r\n}", "title": "" }, { "docid": "dc031aa848be0af6d097ec4b1a3dfa5d", "score": "0.43954706", "text": "async function monitorListingsUsingStreamAPI(client, timeInMs = 60000, pipeline = []) {\n const collection = client.db(\"sample_airbnb\").collection(\"listingsAndReviews\");\n const changeStream = collection.watch(pipeline);\n\n changeStream.stream().pipe(\n new stream.Writable({\n objectMode: true,\n write: function (doc, _, cb) {\n console.log(doc);\n cb();\n }\n })\n );\n\n await closeChangeStream(timeInMs,changeStream)\n}", "title": "" }, { "docid": "41661c113dfd8fe7f17b39697c49863a", "score": "0.43920755", "text": "function smvio(x){\n switch(x){\n case 1:\n {\n smv.open();\n online.emit('getOnline');\n break;\n }\n case 0:\n {\n smv.close();\n online.emit('getOnline');\n break;\n }\n }\n}", "title": "" }, { "docid": "4e908bedc73a5c2c4ae0c9e50853af3a", "score": "0.43911693", "text": "function main()\n{\n var hosts = cluster::mySqlNodes();\n var advisorMap = {};\n\n for (idx = 0; idx < hosts.size(); ++idx)\n {\n host = hosts[idx];\n map = host.toMap();\n connected = map[\"connected\"];\n var advice = new CmonAdvice();\n print(\" \");\n print(host);\n print(\"==========================\");\n\n if (!connected)\n {\n print(\"Not connected\");\n continue;\n }\n var logbin = \n readVariable(host, \"log_bin\").toString();\n \n severity = Ok; \n if (logbin == \"ON\")\n {\n\n var expire_logs_days = \n readVariable(host, \"expire_logs_days\").toInt(); \n if ( expire_logs_days == 0 ) \n {\n msg = \"Set expire_logs_days in my,cnf.\"\n \" Go to Manage -> Configuration -> Change Parameter,\"\n \" and set expire_logs_days=7 in group mysqld.\";\n justification = \"expire_logs_days is not set.\" \n \" Set it to e.g expire_logs_days=7 to purge logs older than 7\"\n \" days. Otherwise binary logs will grow forever.\";\n severity = Warning;\n }\n else\n {\n msg = \"No advice, no action needed. expire_logs_days is set.\";\n justification = \"expire_logs_days=\" + expire_logs_days + \". Setting is ok.\";\n }\n }\n else\n {\n msg = \"No advice, no action needed.\";\n justification = \"log_bin is not enabled on this server,\"\n \" so advisor does not apply.\";\n }\n advice.setSeverity(severity);\n advice.setHost(host);\n advice.setTitle(TITLE);\n advice.setJustification(justification);\n advice.setAdvice(msg);\n advisorMap[idx]= advice;\n print(advice.toString(\"%E\"));\n }\n return advisorMap;\n}", "title": "" }, { "docid": "85c5df859065f97a22ca5cf5067cd0ba", "score": "0.4379929", "text": "function input(){\n\n serviceKeyPath = readline.question(\"Input Service key's absolute path : \");\n // db_list = readline.question(\"Input database list path : (bluelens-browser/db_list) \");\n // if(db_list.length == 0 ){db_list = \"bluelens-browser/db_list\";}\n var info = {'serviceKeyPath': serviceKeyPath, 'topPath' : process.cwd()};\n if(fs.existsSync(infoPath)===false){fs.mkdirSync(infoPath)};\n fs.writeFile(infoPath+\"blu-info.json\", JSON.stringify(info), function(err) {\n if(err) {\n return console.log(err);\n }\n console.log(\"save blu-info.json finish in ~/.blu directory\");\n process.exit(0);\n });\n}", "title": "" }, { "docid": "377ac1d95d6ec44cd822a0dade6c5168", "score": "0.43791103", "text": "function powerSpecificOutlet(ip,mngip,outletnum){\n\tpowerOutletTableObj = {};\n\tpowerDevices = [];\n\tpowerDevices2 = [];\n\tvar ion=0;\n\tvar ioff=0;\n\tvar zz=0;\n\tvar url = getURL(\"Power\",\"JSON\");\n\tvar actionx = 'getoutletip';\n\tvar dObj = {};\n\tvar aaObj = [];\n\tvar qObj = {'QUERY':aaObj};\n\tdObj['Limit']='20';\n\tdObj['Page']='1';\n\tdObj['IP']=ip;\n\tdObj['MngIP']=mngip;\n\tdObj['OutletNumber']=outletnum;\n\taaObj.push(dObj);\n\t$.ajax ({\n\t\turl: url,\n\t\tdata: { action: actionx, query: JSON.stringify(qObj) },\n\t\tdataType: 'html',\n\t\tsuccess: function (data) { \n\t\t\tdata = data.replace(/'/g,'\"');\n\t\t\tvar jsonData = jQuery.parseJSON(data);\n\t\t\tvar nrow = jsonData.data[0].row[0];\n\t\t\tvar dstatus = jsonData.data[0].row[0].OutletState;\n\t\t\tvar dstate = jsonData.data[0].row[0].OutletStatus;\n\t\t\tvar oipname = jsonData.data[0].row[0].OutletIpName;\n\t\t\tvar atid= [];\n\t\t\tpowerOutletTableObj[nrow.DeviceId]=atid;\n\t\t\tatid['ActivePower']=nrow.ActivePowerValue;\n atid['ApparentPower']=nrow.ApparentPowerValue;\n atid['ControllerName']=jsonData.data[0].host[0].HostName;\n atid['CyclingPowerOffPeriod']='';\n atid['DomainName']=nrow.DomainName;\n atid['GroupName']=nrow.GroupName;\n atid['HostName']=nrow.HostName;\n atid['Lines']='';\n atid['NonCritical']='';\n atid['Outlet']=nrow.OutletIpLabel;\n atid['OutletName']=nrow.OutletIpName;\n atid['OverCurrentProtector']=nrow.OCP;\n atid['PowerControllerIp']=nrow.ControllerIp;\n atid['PowerFactor']=nrow.PowerFactorValue;\n atid['PowerPolicy']=nrow.PowerPolicy;\n atid['PowerSupply']='';\n atid['RMSCurrent']=nrow.RMSCurrentValue;\n atid['RMSVoltage']=nrow.RMSVoltageValue;\n atid['State']=nrow.OutletState;\n atid['StateOnDeviceStartUp']=nrow.StateOnStartUp;\n atid['Status']=nrow.OutletStatus;\n atid['ZoneName']=nrow.ZoneName;\n\t\t\tatid['Model']=nrow.Model;\n\n\t\t\tpowerOutletTableObj[nrow.OutletIpName]=nrow.DeviceId;\n\t\t\tpowerDevices.push(ip+\"^\"+outletnum);\n\t\t\tpowerDevices2.push(oipname);\n\t\t\tpowerDevicesState.push(dstatus);\n\t\t\tif(dstatus==\"On\" && dstate==\"Completed\"){\n\t\t\t\tion++;\n\t\t\t}else if(dstatus==\"Off\" && dstate==\"Completed\"){\n\t\t\t\tioff++;\n\t\t\t}else{\n\t\t\t\tzz++;\n\t\t\t}\n\t\tEnablePowerButtons(ion,ioff,zz,'2');\n\t\t}\t\t\t\t\n\t});\n}", "title": "" }, { "docid": "56f26cbc968e8ea312a1ade07d004215", "score": "0.43612674", "text": "function main() {\n console.log('Ready!\\n');\n _hcsr04.fn.startMonitoring();\n}", "title": "" }, { "docid": "1106e17c8bd8294398217d3b294cefbb", "score": "0.4359076", "text": "function localDataSPcall(swimidin, callback) { \n\t\t\t\t\t\tlivepouch.mapQuerySplits(swimidin, callback);\n\n\t\t\t\t\t}", "title": "" }, { "docid": "e65b749ba21db67c94e168b6c41b876e", "score": "0.4357849", "text": "function executeQuery() \n {\n var inputs = document.getElementById('Tinput')\n var input = inputs.value;\n //alert(input);\n\n query.where = \"FacilityID = '\" + input + \"'\";\n //execute query\n queryTask.execute(query, showResults);\n \n }", "title": "" }, { "docid": "9d59cd539e714e7d13ed0f9c3c9f3569", "score": "0.43563104", "text": "databaseProcessing(cnv) {\n //Images processing classes\n let h12color = new ColorHistogram(this.redColor, this.greenColor, this.blueColor);\n \n let colmoments = new ColorMoments();\n\n let img = new Picture(0, 0, 100, 100, \"Images/daniel1.jpg\", \"test\");\n\n //Creating an event that will be used to understand when image is already processed\n let eventname = \"processed_picture_\" + img.impath;\n let eventP = new Event(eventname);\n let self = this;\n document.addEventListener(eventname, function() {\n //self.imageProcessed(img, eventname);\n }, false);\n\n //img.computation(cnv, h12color, colmoments, eventP);\n }", "title": "" }, { "docid": "b586c08318cefbb846d269c6a6e12744", "score": "0.43561125", "text": "function queryAutoPMLogs(logFile,ip){\n\tvar url = getURL(\"ConfigEditor\",\"JSON\");\n\tvar action = \"getdiscoverylogs\";\n\tvar queryObj = {'QUERY':[{'filename':logFile,\n\t\t'user':globalUserName,'ip':ip}]};\n\tvar queryStr = JSON.stringify(queryObj);\n\t$.ajax ({\n\t\turl: url,\n\t\tdata: { action: action, query: queryStr },\n\t\tdataType: 'html',\n\t\tsuccess: function (data) {\n\t\t\tdat2 = data.replace(/'/g,'\"');\n\t\t\tvar dat = $.parseJSON(dat2);\n\t\t\tvar res = dat.DEVICE[0].Logs;\n\t\t\tif(res){\n\t\t\t\tres = res.split('\\n').join('<br/>');\n\t\t\t\t$(\"#addPDUContent\").css({'display':'none'});\n\t\t\t\t$(\"#addPDULogs\").css({'display':'block'});\n\t\t\t\t$(\"#addPDULogsContent\").html(res);\n\t\t\t\t$(\"#saveAddPDUPM\").attr(\"onclick\",\"saveAddPDUAutoD('\"+logFile+\"')\");\n\t\t\t\tif(/completed/i.test(res)){\n\t\t\t\t\tclearTimeout(autoRefreshLogs);\n\t\t\t\t}else{\n\t\t\t\t\tqueryAutoPMLogs(logFile,ip);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\talertUser(\"Process failed.\");\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "76272cdf1433122c309ae4004bfd3a7d", "score": "0.43534538", "text": "function logUserHostMaintainDetails() {\n if (createMaintenanceScheduleReq.readyState == 4) {\n\n var createMaintenanceScheduleReqdbData = JSON.parse(showErrorCreate(createMaintenanceScheduleReq.responseText, \"Error Found\"));\n\n if (Object.entries(createMaintenanceScheduleReqdbData).length != 0) {\n\n\n\n var scheduleId = document.getElementById(\"selectSchedule\").value;\n var selectedSite = document.getElementById(\"selectSite\").value;\n var selectedHost = document.getElementById(\"selectAgent\").value;\n\n // var selectedAgent = document.getElementById(\"selectAgent\").value;\n var selectedService = document.getElementById(\"selectService\").value;\n var selectedSource = document.getElementById(\"selectSource\").value;\n\n\n var currentUser;\n var userProfileID = \"\";\n var dateNow;\n\n // var remoteVodaEXT = \"?remotehost=https://41.0.203.210:8443/InovoCentralMonitorClient/MonitorData&action=runopenquery&query=\";\n\n\n var newUserId;\n\n var dbData = JSON.parse(showErrorMain(userManagementProfileReq.responseText, \"Error Found\"));\n\n\n var userProfileData = JSON.parse(showErrorMain(userProfilereq.responseText, \"Error Found\"));\n if ((Object.entries(dbData).length != 0) && (Object.entries(userProfileData).length != 0)) {\n var userDetails = dbData['queryresult'];\n var userProfile = userProfileData['UserInfo'];\n currentUser = userProfile['userLogin']\n for (var iAlarm = 0; iAlarm < userDetails.length; iAlarm++) {\n\n var rowData = userDetails[iAlarm];\n if (currentUser == rowData['userlogin']) {\n userProfileID = rowData['id'];\n }\n }\n\n // // --------------------------------------------------------------------------------------------------------------------------------------------------\n // // UPDATE USER LOG\n // // -------------------------------------------------------------------------------------------------------------------------------------------------- \n var updateReason = createUserLogReasonForHostMaintenance(scheduleId, selectedSite, selectedHost, selectedService, selectedSource);\n // var query = \"SELECT * FROM InovoMonitor.tblAlarms;\"\n\n dateNow = new Date();\n dateNow = dateNow.getFullYear() + '-' +\n ('00' + (dateNow.getMonth() + 1)).slice(-2) + '-' +\n ('00' + dateNow.getDate()).slice(-2) + ' ' +\n ('00' + dateNow.getHours()).slice(-2) + ':' +\n ('00' + dateNow.getMinutes()).slice(-2) + ':' +\n ('00' + dateNow.getSeconds()).slice(-2);\n\n var insertLogquery = \"INSERT INTO InovoMonitor.tblUserLog (userid, reason, datecreated, createdby) VALUES ('\" + userProfileID + \"','\" + String(updateReason) + \"', '\" + dateNow + \"','\" + currentUser + \"');\";\n\n\n\n createHMUserlogReq.open(\"POST\", serverURL + \"/MonitorData\", true);\n createHMUserlogReq.onreadystatechange = completeHostMaintain;\n createHMUserlogReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n createHMUserlogReq.send(\"action=runopenquery&query=\" + insertLogquery);\n }\n\n\n }\n }\n // else {\n // //set variables \n // var newScheduleName = document.getElementById(\"selectSchedule\").value;\n // var selectedSite = document.getElementById(\"selectSite\").value;\n // var selectedHost = document.getElementById(\"selectAgent\").value;\n\n // //set time \n // var toastDelayTime = 10000;\n // // set title\n // var toastTitle = \"ERROR!HOST MAINTENANCE SCHEDULE CREATION COMPLETE!\";\n // //Set Message\n // var toastMessage = \"FAILED to set the Schedule: \" + newScheduleName + \", for the Site: \" + selectedSite + \", Host: \" + selectedHost + \". Please Contact Inovo for assistance. \";\n\n // //set objects\n // var toastPopup = document.getElementById(\"mainPageToastAlert\");\n // var toastTITLEObj = document.getElementById(\"toastTitle\");\n // var toastMSGObj = document.getElementById(\"toastMessage\");\n\n\n // // run toast \n // toastPopup.setAttribute(\"data-delay\", toastDelayTime);\n // toastTITLEObj.innerHTML = toastTitle;\n // toastMSGObj.innerHTML = toastMessage;\n // $(function () { $('#mainPageToastAlert').toast('show'); });\n // }\n\n\n}", "title": "" }, { "docid": "8fb5498418ee3f214588cb8a7eac816e", "score": "0.4347348", "text": "function sync_server_to_local(func)\n{\n\t//console.log('row135');\n\tif(typeof static_local_db=='undefined')\n\t{\n\t\topen_local_db(function()\n\t\t{\n\t\t\tsync_server_to_local(func);\n\t\t});\n\t}\n\telse\n\t{\n\t\tstart_table=\"\";\n\t\tstart_offset=0;\n\t\tvar domain=get_domain();\n\n\t\tvar new_version=parseInt(static_local_db.version)+1;\n\t\tstatic_local_db.close();\n\t\tdelete(static_local_db);//=\"undefined\";\n\n\t\t//console.log('db_closed');\n\n\t\tupdate_local_db(domain,function()\n\t\t{\n\t\t\t//console.log('row156');\n\t\t\tget_last_sync_time(function(last_sync_time)\n\t\t\t{\n\t\t\t\t//console.log('row158');\n\t\t\t\tsync_server_to_local_ajax(start_table,start_offset,last_sync_time);\n\t\t\t});\n\t\t},new_version);\n\n\t\tvar max_localdb_open_requests=0;\n\t\tvar progress_dummy=progress_value+1;\n\t\tvar online_counter=100;\n\t\tvar sync_download_complete=setInterval(function()\n\t\t{\n\t\t\tconsole.log(\"aj\"+number_active_ajax);\n\t\t\tconsole.log(\"l\"+localdb_open_requests);\n\n\t\t\tif(online_counter>0)\n\t\t\t{\n\t\t\t\tonline_counter-=1;\n\t\t\t}\n\t \t if(number_active_ajax===0)\n\t \t {\n\t \t \t\tvar progress_dummy1=progress_dummy+20;\n\t \t\t if(max_localdb_open_requests===0)\n\t \t\t {\n\t \t\t\t max_localdb_open_requests=localdb_open_requests;\n\t \t\t }\n\t \t\t else\n\t \t\t {\n\t \t\t\t progress_value=progress_dummy1+(1-(localdb_open_requests/max_localdb_open_requests))*20;\n\t \t\t }\n\t \t\t if(localdb_open_requests===0)\n\t \t\t {\n\t \t\t\t clearInterval(sync_download_complete);\n\t\t \t\t update_last_sync_time(function()\n\t\t \t\t {\n\t\t \t\t \t\t//console.log('update last sync time');\n\t\t\t\t\t\tfunc();\n\t\t\t\t });\n\t \t\t }\n\t \t }\n\t \t else\n\t \t {\n\t \t \t\tprogress_value=progress_dummy+(1-(online_counter/100))*20;\n\t \t }\n\t },1000);\n\t }\n}", "title": "" }, { "docid": "951675edfb46f6af3cef3861cc8678e8", "score": "0.4346169", "text": "localDBcall(operation, params, successCallback, failureCallback, clonedParamsUrl) {\n return new Promise((resolve, reject) => {\n this.offlineDBService[operation.name](params, response => {\n if (operation.type === 'READ') {\n resolve(response);\n }\n else {\n // add to change log\n params.onlyOnline = true;\n params.url = clonedParamsUrl;\n return this.changeLogService.add('DatabaseService', operation.name, params)\n .then(() => resolve(response));\n }\n });\n }).then((response) => {\n response = { body: response, type: WM_LOCAL_OFFLINE_CALL };\n triggerFn(successCallback, response);\n return response;\n }, failureCallback);\n }", "title": "" }, { "docid": "c9fd6b34167f046e828cfc5437ef0bd5", "score": "0.43454638", "text": "function main(user, hostname, hostAndPort)\n{\n\n var result = {};\n if (user.toString() == \"\" || user.toString() == \"#N/A\" ||\n user.empty())\n {\n result[\"error_msg\"] = \"Argument 'user' not specified\"; \n print(result[\"error_msg\"]);\n exit(result);\n }\n \n if (hostname.toString() == \"\" || hostname.toString() == \"#N/A\" ||\n hostname.empty())\n {\n result[\"error_msg\"] = \"Argument 'hostname' not specified\"; \n print(result[\"error_msg\"]);\n exit(result);\n }\n var hosts = cluster::mySqlNodes();\n \n for (idx = 0; idx < hosts.size(); ++idx)\n {\n host = hosts[idx];\n \n map = host.toMap();\n connected = map[\"connected\"];\n if (!connected)\n continue;\n \n isGalera = map[\"isgalera\"];\n \n if (isGalera) {\n localState = map[\"galera\"][\"localstatusstr\"];\n if (localState != \"Synced\")\n continue;\n query = \"SET WSREP_ON=ON;SET SQL_LOG_BIN=ON;\";\n retval2 = executeSqlCommand2(host, query);\n }\n else\n {\n isReadOnly = map[\"readonly\"].toBoolean();\n if (isReadOnly)\n {\n // print(host, \": is not a master\");\n continue;\n }\n query = \"SET SQL_LOG_BIN=ON;\";\n retval2 = executeSqlCommand2(host, query);\n }\n \n executeSqlCommand2(host, query);\n if (user == \"*\")\n user = \"\";\n query = \"DROP USER '\" + user + \"'@'\" + hostname + \"'\";\n //print(query);\n var retval = executeSqlCommand2(host, query);\n print(retval);\n if (!retval[\"success\"])\n result[\"error_msg\"] = retval[\"errorMessage\"];\n else\n result[\"error_msg\"] = \"Dropped user \" + user + \"'@'\" + hostname + \"'\";\n print(host, \":\");\n print(result[\"error_msg\"]);\n if (isGalera)\n {\n query = \"SET WSREP_ON=OFF;SET SQL_LOG_BIN=OFF;\";\n }\n else\n {\n query = \"SET SQL_LOG_BIN=OFF;\";\n }\n executeSqlCommand2(host, query);\n break;\n }\n exit(result);\n}", "title": "" }, { "docid": "7ecb2eb5afa8d28245f5d69aed895a82", "score": "0.4345158", "text": "async function digifi() {\r\n try {\r\n const MLModel = periodic.datas.get('standard_mlmodel');\r\n const MLDataset = periodic.datas.get('standard_mldataset');\r\n const BatchPrediction = periodic.datas.get('standard_batchprediction');\r\n const io = periodic.servers.get('socket.io').server;\r\n const { bucket, db } = periodic.gridfs; \r\n let running = false;\r\n setInterval(async (options) => {\r\n if (!running) {\r\n running = true;\r\n let mlmodel = await MLModel.model.find({ digifi_model_status: 'pending' }).sort('updatedat').limit(1).lean();\r\n if (!Array.isArray(mlmodel) || !mlmodel.length) {\r\n running = false;\r\n return;\r\n }\r\n mlmodel = mlmodel[ 0 ];\r\n let digifi_models = mlmodel.digifi_models || [];\r\n if (!digifi_models.length) {\r\n await MLModel.update({ updatedoc: { digifi_model_status: 'complete' }, isPatch: true, id: mlmodel._id.toString() });\r\n running = false;\r\n } else {\r\n let dataset = await MLDataset.model.findOne({ mlmodel: mlmodel._id.toString() }).lean();\r\n // download row and historical result data through grid fs\r\n const [trainingFeatureRows, trainingHistoricalRows, testingFeatureRows, testingHistoricalRows] = await Promise.all([openDownloadStreamAsync(bucket, dataset.training.rows), openDownloadStreamAsync(bucket, dataset.training.historical_result), openDownloadStreamAsync(bucket, dataset.testing.rows), openDownloadStreamAsync(bucket, dataset.testing.historical_result)]);\r\n dataset.training.rows = trainingFeatureRows.map((row) => row.map(el => Number(el)));\r\n dataset.training.historical_result = trainingHistoricalRows.map((row) => row.map(el => Number(el)))[0];\r\n dataset.testing.rows = testingFeatureRows.map((row) => row.map(el => Number(el)));\r\n dataset.testing.historical_result = testingHistoricalRows.map((row) => row.map(el => Number(el)))[0];\r\n // dataset shaped\r\n let model_directory = path.resolve(process.cwd(), `./content/files/digifi_model_scripts/${mlmodel.type}`);\r\n let finished_training = new Set(digifi_models);\r\n for (let i = 0; i < digifi_models.length; i++) {\r\n let model_type = digifi_models[ i ];\r\n if (mlmodel[ model_type ] && mlmodel[ model_type ].model) {\r\n finished_training.delete(model_type);\r\n if (!finished_training.size) {\r\n await MLModel.update({\r\n id: mlmodel._id.toString(),\r\n isPatch: true,\r\n updatedoc: {\r\n digifi_model_status: (mlmodel.industry)? 'input_analysis' : 'batch_analysis',\r\n // digifi_model_status: 'batch_analysis',\r\n },\r\n });\r\n running = false;\r\n }\r\n continue;\r\n }\r\n let filepath = path.join(model_directory, `/${model_type}.js`);\r\n let cb = async (err, result) => {\r\n if (err) { \r\n await MLModel.update({\r\n id: mlmodel._id.toString(),\r\n isPatch: true,\r\n updatedoc: {\r\n [ `${model_type}.progress` ]: 100,\r\n [ `${model_type}.status` ]: 'failed',\r\n [ `${model_type}.error_message` ]: String(err.message), updatedat: new Date(),\r\n },\r\n });\r\n io.sockets.emit('provider_ml', { provider: model_type, progress: 100, _id: mlmodel._id.toString(), organization: mlmodel.organization._id || mlmodel.organization, status: 'Error' });\r\n } else {\r\n if (result.isInProgress) {\r\n logger.info('Running worker');\r\n } else {\r\n let current_date = new Date();\r\n const { exportedModel, trainingBatchPredictions, testingBatchPredictions, model, columnMinMax } = result.val;\r\n let trainingBatchOptions = {\r\n name: `${mlmodel.name}_training_batch_prediction`,\r\n type: 'training',\r\n mlmodel: mlmodel._id.toString(),\r\n predictions: trainingBatchPredictions,\r\n display_name: `${mlmodel.display_name} Training Batch Prediction`,\r\n provider: model_type,\r\n organization: mlmodel.organization.toString(),\r\n status: 'not_initialized',\r\n createdat: current_date,\r\n };\r\n let testingBatchOptions = {\r\n name: `${mlmodel.name}_testing_batch_prediction`,\r\n type: 'testing',\r\n provider: model_type,\r\n mlmodel: mlmodel._id.toString(),\r\n display_name: `${mlmodel.display_name} Testing Batch Prediction`,\r\n predictions: testingBatchPredictions,\r\n organization: mlmodel.organization.toString(),\r\n status: 'not_initialized',\r\n createdat: current_date,\r\n };\r\n let [createdTrainingBatch, createdTestingBatch] = await Promise.all([ BatchPrediction.create(trainingBatchOptions), BatchPrediction.create(testingBatchOptions), ]);\r\n await MLModel.update({\r\n id: mlmodel._id.toString(),\r\n isPatch: true,\r\n updatedoc: {\r\n [ `${model_type}.progress` ]: 70,\r\n [ `${model_type}.model` ]: exportedModel,\r\n [ `${model_type}.column_scale` ]: columnMinMax || {},\r\n [ `${model_type}.batch_training_id` ]: createdTrainingBatch._id.toString(),\r\n [ `${model_type}.batch_testing_id` ]: createdTestingBatch._id.toString(),\r\n },\r\n });\r\n const aws_models = mlmodel.aws_models || [];\r\n const digifi_models = mlmodel.digifi_models || [];\r\n const all_training_models = [...aws_models, ...digifi_models].length ? [...aws_models, ...digifi_models] : ['aws', 'sagemaker_ll', 'sagemaker_xgb'];\r\n const progressBarMap = all_training_models.reduce((aggregate, model, i) => {\r\n aggregate[model] = i;\r\n return aggregate;\r\n }, {});\r\n io.sockets.emit('provider_ml', { progressBarMap, provider: model_type, progress: 70, _id: mlmodel._id.toString(), organization: mlmodel.organization._id || mlmodel.organization, });\r\n finished_training.delete(model_type);\r\n if (!finished_training.size) {\r\n await MLModel.update({\r\n id: mlmodel._id.toString(),\r\n isPatch: true,\r\n updatedoc: {\r\n digifi_model_status: (mlmodel.industry)? 'input_analysis' : 'batch_analysis',\r\n },\r\n });\r\n running = false;\r\n }\r\n }\r\n }\r\n }\r\n let options = { filepath, workerData: { dataset, model_id: mlmodel._id.toString(),}, customData: {} };\r\n workerUtil.initiateWorker(options, cb);\r\n }\r\n }\r\n }\r\n }, 30000);\r\n\r\n let input_running = false;\r\n setInterval(async (options) => {\r\n if (!input_running) {\r\n let inputMlModels = await MLModel.model.find({ digifi_model_status: 'input_analysis' }).lean();\r\n if (inputMlModels) {\r\n input_running = true;\r\n await Promise.all(inputMlModels.map(async mlmodel => {\r\n await mlResource.input_analysis(mlmodel);\r\n await MLModel.update({ isPatch: true, id: mlmodel._id.toString(), updatedoc: { digifi_model_status: 'score_analysis' } });\r\n }));\r\n }\r\n input_running = false;\r\n }\r\n }, 30000)\r\n\r\n let score_running = false;\r\n setInterval(async (options) => {\r\n if (!score_running) {\r\n let scoreMlModels = await MLModel.model.find({ digifi_model_status: 'score_analysis' }).lean();\r\n if (scoreMlModels) {\r\n score_running = true;\r\n await Promise.all(scoreMlModels.map(async mlmodel => {\r\n await mlResource.score_analysis(mlmodel);\r\n await MLModel.update({ isPatch: true, id: mlmodel._id.toString(), updatedoc: { digifi_model_status: 'batch_analysis' } });\r\n }));\r\n }\r\n score_running = false;\r\n }\r\n }, 30000)\r\n \r\n // batch prediction creation interval cron\r\n let batch_running = false;\r\n setInterval(async (options) => {\r\n if (!batch_running) {\r\n let batchMlModels = await MLModel.model.find({ digifi_model_status: 'batch_analysis' }).lean();\r\n if (batchMlModels) {\r\n batch_running = true;\r\n await Promise.all(batchMlModels.map(async mlmodel => {\r\n await mlResource.batch.digifi(mlmodel);\r\n await MLModel.update({ isPatch: true, id: mlmodel._id.toString(), updatedoc: { digifi_model_status: 'completed' }});\r\n }))\r\n }\r\n batch_running = false;\r\n }\r\n }, 30000)\r\n } catch (e) {\r\n console.log({ e });\r\n }\r\n}", "title": "" }, { "docid": "1303cf587cd94169677a03f14daa902d", "score": "0.4344694", "text": "function pollWork () {\n \n return new Promise(function (resolve, reject) {\n \n // check for visibility.. if not visible, then don't bother polling\n if (pack_ && watch_.pollVisibleOnly && !ifvisible.now() ) {\n status_.idle++;\n finallyActions();\n resolve(pack_);\n }\n else {\n\n Provoke.run (\"ServerWatcher\", \"poll\", watch_)\n .then (\n function (pack) {\n // save this for interest\n\n pack_ = pack;\n current_.dataSource = pack_.dataSource;\n \n \n // if there's been some changes to data then store it\n if (pack.data) {\n\n var columnOffset = pack_.dataSource.columnOffset;\n current_.filterMap = pack_.filterMap;\n \n if (watch_.domain.fiddler && watch_.domain.property === \"Values\") {\n // it may fail because data is in midde of being updated\n // but that's - it'll get it next time.\n try {\n current_.fiddler = new Fiddler()\n .setBlankOffset(columnOffset)\n .setRenameDups(true)\n .setRenameBlanks(true)\n .setValues(pack.data);\n }\n catch (err) {\n // dont want to count this as a valid piece of data yet\n // so we'll pass on this poll result and treat it as a reject\n console.log('error in client watcher',err);\n \n return rejectActions(reject,err);\n }\n }\n watch_.checksum.data = pack.checksum.data;\n current_.data = pack.data;\n current_.aux = pack.aux;\n }\n \n \n \n // if there's been some changes to active positions\n if(pack.active) {\n current_.active = pack.active;\n watch_.checksum.active = pack.checksum.active;\n }\n \n // if there's been some changes to sheets then store it\n if (pack.sheets) {\n current_.sheets = pack.sheets;\n watch_.checksum.sheets = pack.checksum.sheets;\n }\n \n if (pack.data || pack.active || pack.sheets) {\n status_.hits++;\n }\n finallyActions();\n resolve (pack);\n })\n ['catch'](function (err) {\n // sometimes there will be network errors which can generally be ignored..\n rejectActions (reject, err);\n });\n }\n });\n \n }", "title": "" }, { "docid": "3fdeb9d6c1ee4f3c92b241f71e4f647c", "score": "0.4341268", "text": "function onConnectedHandler (addr, port) {\n // Подключаемся к базе.\n //connectSQL();\n\n //getInfo();\n\n console.log(`* Connected to ${addr}:${port}`);\n\n}", "title": "" }, { "docid": "67a3d913bbda97cc9c24fe58601ea102", "score": "0.43363482", "text": "function monitorInput(args)\n{\n\targs = args.slice(2);\n\tif(args.length != 4)\n\t\tthrow new InvalidParametersNumberError();\n\t\n\tmonitorInputProcess(args);\n}", "title": "" }, { "docid": "116d87b8a0f2b09c0c3c6f411081747f", "score": "0.43314576", "text": "function mark_as_in_progress(req, res, next) {\n 'use strict';\n\tvar __FUNCTION__ = \"mark_as_in_prog\";\n\tvar rows = [], mx, rv;\n\tvar so_id = req.params.so_id;\n\tdebug_2(\".1.soedit-views.m4.js\",__FUNCTION__,20,\"req:\"+JSON.stringify ( req.params ));\n\tvar stmt;\n\n\t/*\n\ncreate table \"soso_data_add\" (\n\t \"Id\"\t\t\t\t\tbigint not null\n\t, \"unusable\"\t\t\tchar varying (1) default 'n' not null\n\t, \"tbd\"\t\t\t\t\tchar varying (1) default 'n' not null\n\t, \"humor\"\t\t\t\tchar varying (1) default 'n' not null\n\t, \"autotest_ok\"\t\t\tchar varying (1) default 'n' not null\n\t, \"when_file_upd\"\t\ttimestamp\n);\n \t*/\n\n// xyzzy - if defined in the model for columns and spec - shold we even bother with quering the database?\n// \t\n//\tvar goober = { \"so_id\":so_id };\n//\tstmt = ts0( 'update /*v06*/ soso_data_add set tbd = \\'y\\' where \"Id\" = %{so_id%} ', goober );\n\n\tdn.runQuery ( stmt = ts0( 'update /*v07*/ soso_data_add set tbd = \\'y\\' where \"Id\" = %{so_id%} ', { \"so_id\":so_id } ), function ( err, result ) {\n\t\tif ( err ) {\n\t\t\tsend_result ( res, next, null, { \"status\":\"error\", \"msg\":\"Unable to update SO item to TBD\", \"raw\": JSON.stringify(err), \"stmt\":stmt } );\n\t\t\treturn null;\n\t\t} else {\n\t\t\trv = { \"status\":\"success\" };\n\t\t\tsend_result ( res, next, null, rv );\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "c4a22c4483ad8bd0cdb80dba8af70575", "score": "0.43245512", "text": "function queryInterviewDatabase() { \n console.log('Reading rows from the Table...');\n\n // Read all rows from table\n request = new Request(\"select * from interviewData;\", (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n\n request.on('row', function(columns) {\n columns.forEach(function(column) {\n console.log(\"%s\\t%s\", column.metadata.colName, column.value);\n });\n });\n\n connection.execSql(request);\n}", "title": "" }, { "docid": "7dc706090f175836a8490a65be123124", "score": "0.43237227", "text": "init(cnv) {\n //this.databaseProcessing(cnv);\n this.createXMLIExampledatabaseLS()\n }", "title": "" }, { "docid": "7f97f195e077e244fd95ee9e1720486a", "score": "0.43186527", "text": "function workload_status_req(client, data) {\n}", "title": "" }, { "docid": "88923683420e9b1a9edad179be35e2b1", "score": "0.4316403", "text": "function main () {\n console.log(\"Registering Events...\");\n gm.events.register();\n\n console.log(\"Server started!\");\n Query(8080); //You can change your port\n\n // ---- This is for check database connection ----- //\n\n /*let testdb = gm.utility.dbConnect();\n\n testdb.connect(function(err) {\n if(err) {\n console.log(\"Error connecting to the database ... \");\n throw err;\n } else {\n console.log('Database connected!')\n }\n });\n\n testdb.end();*/\n}", "title": "" }, { "docid": "78103e244a1010ced61dc24dc7c9fb86", "score": "0.4313827", "text": "function setWatch(params) {\n web3APIs.getLogsAndInsertInSQLite(params)\n}", "title": "" }, { "docid": "eb0a7cf9a581b4a2da1d4156b26c2fe6", "score": "0.43136445", "text": "function requestDataForSymbolic(connID, processID, callBack){\n if(connections[connID]){\n connections[connID].symbolicOwners[processID] = true;\n if(typeof callBack === \"function\") callBack(null, connections[connID].connectionData);\n }\n else{\n if(typeof callBack === \"function\") callBack(new Error(\"Connection:\" + connID + \" Does not exist on process:\"+core.uuid), null);\n }\n}", "title": "" }, { "docid": "1eedc8f5a993ec892a152b3a5ab028c2", "score": "0.43114004", "text": "function generateFKQueries(input, reference_input){\r\n\tvar fk_queries = {},\t\t// Object ot store the queries to populate primary tables where foreign keys are located. \r\n\t\tsql_query = [],\t\t\t// initialized to store generated query. \r\n\t\tfk_rf_table = [],\t\t// to store tables that need to be filled before the primary queue can be implemented. \r\n\t\tfk_column_value = [], \t// stores column value of each key. \r\n\t\tfk_ref_table_2 = [], \t// possible reference tables from fk table\r\n\t\tfk_column_value_2 = [],\t// possible reference column from fk column\r\n\t\tcount = 0;\t\t\t\t// a count used to keep track of a value\r\n\t/*Getting the relationship of the input and tables.*/\r\n\tfor(var i in reference_input.length){ \r\n\t\tif(input.table == reference_input.TABLE_NAME){\r\n\t\t\tfk_rf_table[i] = reference_input[i].REFERENCED_TABLE_NAME;\t\r\n\t\t\tfk_column_value[i] = reference_input[i].REFERENCED_COLUMN_NAME;\r\n\t\t}\r\n\t\tif(fk_rf_table[i] == reference_input[i].TABLE_NAME){\r\n\t\t\tfk_ref_table_2[i] = reference_input[i].REFERENCED_TABLE_NAME;\t\r\n\t\t\tfk_column_value_2[i] = reference_input[i].REFERENCED_COLUMN_NAME;\r\n\t\t}\r\n\t}\r\n\r\n\tconnnect.query('SELECT * FROM user WHERE userIp = ?', input.userIp, function(err, results){\r\n\t\tif(results[0].userIp != input[0].userIp){\r\n\t\t\tconnect.query('INSERT INTO userIP SET userIp=?',input.Ip);\r\n\t\t\tconnect.query('INSERT INTO search(searchId,panelId,time_stamp,criteria,category,userIp) VALUES (?,?,?,?,?,?)',[input.searchId,input.panelId,input.time_stamp,input.criteria,input.category,input.userIp]);\r\n\t\t\tconnect.query()\r\n\t\t}else{\r\n\t\t\tconnect.query('INSERT INTO search(searchId,panelId,time_stamp,criteria,category,userIp) VALUES (?,?,?,?,?,?)',[input.searchId,input.panelId,input.time_stamp,input.criteria,input.category,input.userIp]);\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn 0;\r\n}", "title": "" }, { "docid": "b5c373fcfb136ca74a0a9b75e42f47e6", "score": "0.43099913", "text": "function SQLSharingServer() {\n var p = SQLSharingServer.prototype;\n p = this;\n var self = this;\n\n p.init = function init(config) {\n self.settings = {}; //store settings and values\n self.data = {};\n if (config) {\n self.settings = config;\n } else\n {\n var cluster_settings = rh.loadRServerConfig(true);\n }\n //self.settings.port = 3001;\n\n self.settings.cluster_config.urlTimeout =\n sh.dv(self.settings.cluster_config.urlTimeout, 2000);\n self.settings.updateLimit = sh.dv(self.settings.updateLimit, 99+901);\n self.server_config = rh.loadRServerConfig(true); //load server config\n self.settings.enableAutoSync = sh.dv(self.settings.enableAutoSync,true);\n\n self.debug = {};\n //self.debug.tableCascades = true; //show table info this stop\n self.debug.jsonBugs = false;\n self.handleTables();\n\n\n if ( self.debug.tableCascades )\n return;\n // return;\n self.app = express(); //create express server\n\n //self.setupSecurity()\n self.createBlockingRoutes()\n\n self.createRoutes(); //decorate express server\n self.createSharingRoutes();\n\n self.createDashboardRoutes();\n self.createDashboardResources();\n\n self.identify();\n\n self.startServer()\n\n self.connectToDb();\n self.setupAutoSync();\n }\n\n p.handleTables = function handleTables() {\n //return;\n if ( self.settings.cluster_config.table ) {\n self.settings.cluster_config.tables = self.settings.cluster_config.table;\n }\n if ( self.settings.cluster_config.tables == null )\n return;\n\n if ( self.settings.subServer) {\n //asdf.g\n return;\n }\n\n self.data.tableServers = [];\n //return\n var tables = sh.clone(self.settings.cluster_config.tables);\n var mainTable = tables.pop();\n self.settings.tableName = mainTable;\n self.settings.topServer = true;\n\n\n\n //in non-test mode, all are the same\n var bconfig = self.utils.cloneSettings();\n //sh.clone(self.settings);\n\n /*\n tables are tricky\n in test mode, we are running app ports on same machine, so we\n offset the port numbers by the number of tables\n tables, people, cars\n a1,b3,c5\n\n a1 a_car_2,\n b3 b_car_4,\n c5 c_car_6,\n\n in prod mode, we offset each table by 1, so car is on port 1, people is on port 2\n tables, people, cars\n a1,b1,c1\n\n a1 a_car_2,\n b1 b_car_2,\n c1 b_car_2,\n\n have to update sub configuration\n */\n var tablePortOffset = 0;\n sh.each(tables, function addServerForTable(k,tableName) {\n //return\n\n //var config = sh.clone(bconfig);\n var config = self.utils.cloneSettings();\n // var config = self.utils.detectCircularProblemsWith(self.settings)\n var cloneablePeers = []; //clone peers so port increments do not conflict\n sh.each(config.peerConfig.peers, function copyPeer(k,v) {\n var p = {};\n sh.mergeObjects2(v, p)\n delete p.peers //remove recurse peers property\n cloneablePeers.push(p)\n })\n config.peerConfig.peers = sh.clone(cloneablePeers)\n if ( config.peerConfig == null ) {\n var breakpoint = {};\n }\n delete config.topServer;\n var peerCount = config.peerConfig.peers.length; //why: offset in test mode by this many ports\n var originalIp = config.ip\n tablePortOffset += 1\n\n config.port = null;\n config.ip = self.utils.incrementPort(config.ip, tablePortOffset);\n config.peerConfig.ip = self.utils.incrementPort(config.peerConfig.ip, tablePortOffset);\n self.proc(\"\\t\\t\", 'peer', config.name,tableName, config.ip)\n var additionalOffset = 0;\n //setup matching ip/port for peers\n sh.each(config.peerConfig.peers, function setupMatchingPortForPeers(k,peer) {\n if (tables.length==1) {\n //tablePortOffset -= 1\n // additionalOffset = -1\n //why: do not offset by 1 ... not sure why\n }\n peer.ip = self.utils.incrementPort(peer.ip, tablePortOffset+additionalOffset);\n self.proc(\"\\t\\t\\t\", 'peer',tableName, peer.name, peer.ip)\n });\n\n if ( self.debug.tableCascades ) {\n return;\n }\n config.subServer = true;\n config.topServerIp = self.settings.ip;\n config.tables = null;\n config.table = null;\n config.tableName = tableName;\n\n // config.peers = sh.clone(config.peers)\n var service = new SQLSharingServer();\n if ( self.runOnce )\n return\n /* setTimeout(function makeServerLaterToTestInitError(_config) {\n\n console.error('run later', _config.ip)\n\n service.init(_config);\n }, 2000, config)*/\n\n setTimeout(function makeServerLaterToTestInitError(_config) {\n\n console.error('run later', _config.ip)\n\n //self.data.tableServers\n service.init(_config);\n service.data.tableServers = self.data.tableServers;\n }, 500, config)\n\n // self.runOnce = true\n //service.init(config);\n // var peerObj = service;\n //c\n self.data.tableServers.push(service);\n });\n\n\n // process.exit();\n return;\n }\n\n p.setupSecurity = function setupSecuirty() {\n if ( self.settings.password == null ) {\n return;\n }\n //TODO: finish ... but will break everything\n self.app.use(function block(req, res, next) {\n var password = ''\n if ( req.params)\n password = sh.dv(req.params.password, password)\n if ( req.query)\n password = sh.dv(req.query.password, password)\n if ( req.body)\n password = sh.dv(req.body.password, password)\n\n if ( password != self.settings.password ) {\n console.error('blocked attemptX')\n res.status(410)\n res.send({\"status\":\"high bandwidth\"})\n return;\n }\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n res.header(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\");\n\n next();\n });\n }\n\n DalDashboardHelpers(self)\n\n p.createRoutes = function createRoutes() {\n self.app.post('/upload', function (req, res) {});\n }\n\n p.createBlockingRoutes = function createBlockingRoutes() {\n //return;\n self.app.use(function block(req, res, next) {\n if ( self.settings.block ) {\n self.proc('what is this', self.settings.name, 'what is this...?')\n //asdf.g\n self.proc(self.settings.name, 'block')\n return ;\n }\n next();\n });\n }\n p.startServer = function startServer() {\n self.proc('startServer', self.settings.name, self.settings.port, self.settings.tableName )\n if ( self.settings.port == null){\n throw new Error('no port this will not launch ' + self.settings.name)\n }\n self.app.listen(self.settings.port);\n self.proc('started server on', self.settings.name, self.settings.port);\n console.log()\n\n\n }\n\n DalSyncRoutesHelpers(self)\n DalBasicRoutesHelpers(self)\n\n\n /**\n * why: identify current machine in config file to find peers\n */\n p.identify = function identify() {\n var peers = self.settings.cluster_config.peers;\n if ( self.settings.cluster_config == null )\n throw new Error ( ' need cluster config ')\n\n\n if ( self.settings.port != null &&\n sh.includes(self.settings.ip, self.settings.port) == false ) {\n self.settings.ip = null; //clear ip address if does not include port\n };\n\n if ( self.settings.port == null && self.settings.ip ) {\n //why: get port from ip address\n var portIpAndPort = self.settings.ip;\n if ( portIpAndPort.indexOf(':') != -1 ) {\n var ip = portIpAndPort.split(':')[0];\n var port = portIpAndPort.split(':')[1];\n if ( sh.isNumber(port) == false ){\n throw new Error(['bad port ', ip, port].join(' '))\n }\n self.settings.ip = ip;\n if ( ip.split('.').length !=4 && ip != 'localhost'){\n throw new Error(['invalid ip ', ip, port].join(' '))\n }\n self.settings.port = port;\n };\n };\n\n var initIp = self.settings.ip;\n self.settings.ip = sh.dv(self.settings.ip, '127.0.0.1:'+self.settings.port); //if no ip address defined\n if ( self.settings.ip.indexOf(':')== -1 ) {\n self.settings.ip = self.settings.ip+':'+self.settings.port;\n }\n\n if ( initIp == null ) {\n var myIp = self.server_config.ip;\n //find who i am from peer\n self.proc('searching for ip', myIp)\n sh.each(peers, function findMatchingPeer(i, ipSection){\n var peerName = null;\n var peerIp = null;\n\n peerName = i;\n peerIp = ipSection;\n\n if ( sh.isObject(ipSection)) {\n sh.each(ipSection, function getIpAddressAndName(name, ip) {\n peerName = name;\n peerIp = ip;\n })\n }\n\n if ( self.settings.peerName != null ) {\n if (self.settings.peerName == peerName) {\n foundPeerEntryForSelf = true;\n self.settings.name = peerName;\n return;\n }\n } else {\n if (self.settings.ip == peerIp) {\n foundPeerEntryForSelf = true;\n self.settings.name = peerName;\n return;\n }\n }\n var peerIpOnly = peerIp;\n if ( peerIp.indexOf(':') != -1 ) {\n peerIpOnly = peerIp.split(':')[0];\n };\n if ( peerIpOnly == myIp ) {\n self.proc('found your thing...')\n self.settings.ip = peerIpOnly\n if ( peerIp.indexOf(':') != -1 ) {\n var port = peerIp.split(':')[1];\n self.settings.port = port;\n }\n self.settings.name = peerName;\n self.settings.cluster_config.tables\n var y = [];\n return;\n } else {\n // self.proc('otherwise',peerIpOnly);\n }\n });\n self.server_config\n }\n\n self.proc('ip address', self.settings.ip);\n\n self.settings.dictPeersToIp = {};\n self.settings.dictIptoPeers = {};\n self.settings.peers = [];\n\n var foundPeerEntryForSelf = false;\n\n console.log(self.settings.name, 'self peers', peers);\n sh.each(peers, function findMatchingPeer(i, ipSection){\n var peerName = null;\n var peerIp = null;\n sh.each(ipSection, function getIpAddressAndName(name, ip) {\n peerName = name;\n peerIp = ip;\n })\n if ( sh.isString(ipSection) && sh.isString(i) ) { //peer and ip address method\n if ( ipSection.indexOf(':') ) {\n peerName = i;\n peerIp = ipSection;\n if ( peerIp.indexOf(':') != -1 ) {\n peerIp = peerIp.split(':')[0];\n };\n }\n }\n if ( self.settings.peerName != null ) {\n if (self.settings.peerName == peerName) {\n foundPeerEntryForSelf = true;\n self.settings.name = peerName;\n return;\n }\n /*\n var peerConfig = ipSection;\n if (self.settings.peerName == peerConfig.name ) {\n foundPeerEntryForSelf = true;\n self.settings.name = peerName;\n return;\n }\n */\n }\n else {\n if (self.settings.ip == peerIp) {\n foundPeerEntryForSelf = true;\n self.settings.name = peerName;\n return;\n }\n }\n if ( ipSection.name ){\n var peerConfig = ipSection;\n var peerName = peerConfig.name;\n var peerIp = peerConfig.ip;\n }\n if ( self.settings.peers.includes(peerIp)){\n return; //self.settings.peers.push(peerIp);\n }\n self.proc('adding peer (no matched config)',peerName, peerIp, self.settings.ip); //.error('....', );\n self.settings.peers.push(peerIp);\n self.settings.dictPeersToIp[peerName]=peerIp;\n self.settings.dictIptoPeers[peerIp]=peerName;\n });\n\n if ( self.settings.peerConfig ) { //why: let cluster loader set config and send no peers\n //bypass searchc\n foundPeerEntryForSelf = true;\n self.settings.name = self.settings.peerConfig.name;\n }\n\n\n self.proc(self.settings.peerName, 'foundPeerEntryForSelf', foundPeerEntryForSelf, self.settings.peers.length, self.settings.peers);\n\n if ( foundPeerEntryForSelf == false ) {\n throw new Error('did not find self in config')\n }\n\n if ( self.settings.peers.length == 0 ) {\n if ( self.settings.ignore0Peers == true ) {\n self.proc('warning:'+'init: not enough peers ' + self.settings.name)\n } else {\n throw new Error('init: not enough peers ' + self.settings.name, peers)\n }\n\n }\n }\n\n function definePeerUtils() {\n p.peers = {};\n p.peers.addPeer = function addPeer(peerName, peerIp) {\n if ( peerName ) {\n var peerObj = peerName;\n peerName = peerObj.name;\n peerIp = peerObj.ip;\n }\n sh.throwIfNull(peerName, 'need a peer name')\n sh.throwIfNull(peerIp, 'need a peer ip')\n if ( self.settings.peers.includes(peerIp)) {\n return;\n }\n self.settings.peers.push(peerIp);\n self.settings.dictPeersToIp[peerName]=peerIp;\n self.settings.dictIptoPeers[peerIp]=peerName;\n }\n\n p.peers.removePeer = function addPeer(peerName, peerIp) {\n if ( self.settings.peers.includes(peerIp) == false) {\n return;\n }\n sh.removeFromArray(self.settings.peers, peerIp)\n delete self.settings.dictPeersToIp[peerName];\n delete self.settings.dictIptoPeers[peerIp];\n }\n\n\n p.getMyPeerInfo = function getMyPeerInfo(peerName, peerIp) {\n var yyy = {};\n yyy.name = self.settings.peerName;\n yyy.ip = self.settings.ip;\n yyy[self.settings.peerName] = self.settings.ip;\n return yyy;\n }\n\n }\n\n definePeerUtils();\n\n function defineDatabase() {\n\n p.connectToDb = function connectToDb() {\n if ( self.settings.dbConfigOverride) {\n var Sequelize = require('sequelize')//.sequelize\n if ( self.settings.tableName == null || self.settings.tableName == '' ) {\n asdf.g\n }\n var sequelize = new Sequelize('database', 'username', '', {\n dialect: 'sqlite',\n storage: 'db/'+[self.settings.name,self.settings.tableName].join('_')+'.db',\n logging:self.settings.dbLogging\n })\n self.sequelize = sequelize;\n self.createTableDefinition();\n } else {\n var sequelize = rh.getSequelize(null, null, true);\n self.sequelize = sequelize;\n self.createTableDefinition();\n }\n\n\n }\n\n /**\n * Creates table object\n */\n p.createTableDefinition = function createTableDefinition() {\n var tableSettings = {};\n if (self.settings.force == true) {\n tableSettings.force = true\n tableSettings.sync = true;\n }\n tableSettings.name = self.settings.tableName\n if ( self.settings.tableName == null ) {\n throw new Error('need a table name')\n }\n //tableSettings.name = sh.dv(sttgs.name, tableSettings.name);\n tableSettings.createFields = {\n name: \"\", desc: \"\", user_id: 0,\n imdb_id: \"\", content_id: 0,\n progress: 0\n };\n\n\n self.settings.fields = tableSettings.createFields;\n\n var requiredFields = {\n source_node: \"\", id_timestamp: \"\",\n updated_by_source:\"\",\n global_updated_at: new Date(), //make another field that must be changed\n version: 0, deleted: true\n }\n sh.mergeObjects(requiredFields, tableSettings.createFields);\n tableSettings.sequelize = self.sequelize;\n SequelizeHelper.defineTable(tableSettings, tableCreated);\n\n function tableCreated(table) {\n self.proc(self.settings.name, 'table ready')\n //if ( sttgs.storeTable != false ) {\n self.Table = table;\n\n\n self.dbHelper2.getDBVersion()\n\n setTimeout(function onInitReadyAndTable() {\n sh.callIfDefined(self.settings.fxDone);\n sh.cid(self.settings.fxPeerStarted, self)\n }, 100)\n\n }\n }\n\n DalDbHelpers(self)\n }\n defineDatabase();\n\n function defineUtils() {\n if ( self.utils == null ) self.utils = {};\n\n self.utils.cloneSettings = function cloneSettings() {\n var y = self.settings;\n var clonedSettings = {};\n sh.each(y, function dupeX(k,v) {\n //what\n try {\n var c = sh.clone(v);\n clonedSettings[k] = c;\n } catch ( e ) {\n if ( self.debug.jsonBugs )\n console.error('problem json copy with', k)\n\n\n clonedSettings[k] = v; //ugh ...\n }\n\n })\n\n\n // function recursivee\n return clonedSettings;\n }\n\n self.utils.detectCircularProblemsWith =\n function detectCircularProblemsWith(obj, dictPrev, path) {\n if ( dictPrev == null ) {\n dictPrev = {};\n dictPrev.arr = [];\n path = ''\n }\n //why will detect circular references in json object (stringify)\n var clonedSettings = {};\n sh.each(obj, function dupeX(k,v) {\n try {\n dictPrev[v] = k;\n dictPrev.arr.push(v)\n var c = sh.clone(v);\n clonedSettings[k] = c;\n\n } catch ( e ) {\n path += '.'+k\n if ( self.debug.jsonBugs )\n console.error('problem json copy with', k, v, path)\n dictPrev[v] = k;\n dictPrev.arr.push(v)\n if ( sh.isObject( v )) {\n var prev = dictPrev[v];\n var hasItem = dictPrev.arr.indexOf(v)\n\n if ( prev != null || hasItem != -1 ) {\n if ( dictPrev.culprintFound ) {\n console.log('---> is culprit ', path, k, prev)\n return;\n }\n console.log('this is culprit ', path, k, prev)\n // return;\n dictPrev.culprintFound = true;\n }\n\n sh.each(v, function dupeX(k1,innerV) {\n console.log(' ... |> ', k1)\n var pathRecursive = path +'.'+k1;\n dictPrev[innerV] = k1;\n dictPrev.arr.push(innerV)\n self.utils.detectCircularProblemsWith(innerV, dictPrev,pathRecursive)\n\n })\n\n }\n\n //clonedSettings[k] = v; //ugh ...\n }\n })\n // function recursivee\n return clonedSettings;\n }\n\n\n\n self.utils.latestDate = function compareTwoDates_returnMostRecent(a,b) {\n if ( a == null )\n return b;\n if (a.getTime() > b.getTime() ) {\n return a;\n }\n return b;\n }\n\n self.utils.incrementPort = function incrementPort(ip, offset) {\n var obj = self.utils.getPortAndIp(ip);\n\n\n var newIp = obj.ip + ':' + (obj.port+offset);\n return newIp;\n }\n\n self.utils.getPortAndIp = function getPortAndIp (ip) {\n var obj = {}\n var portIpAndPort = ip;\n if ( portIpAndPort.indexOf(':') != -1 ) {\n var ip = portIpAndPort.split(':')[0];\n var port = portIpAndPort.split(':')[1];\n if ( sh.isNumber(port) == false ){\n throw new Error(['bad port ', ip, port].join(' '))\n }\n\n if ( ip.split('.').length !=4 && ip != 'localhost'){\n throw new Error(['invalid ip ', ip, port].join(' '))\n }\n\n obj.port = parseInt(port)\n obj.ip = ip; //parseInt(ip)\n };\n return obj;\n }\n\n self.utils.forEachPeer = function fEP(fxPeer, fxDone) {\n\n sh.async(self.settings.peers,\n fxPeer, function allDone() {\n sh.callIfDefined(fxDone);\n })\n return;\n }\n\n self.utils.getPeerForRequest = function getPeerForRequest(req) {\n var fromPeer = req.query.fromPeer;\n if ( fromPeer == null ) {\n throw new Error('need peer')\n };\n return fromPeer;\n }\n\n\n self.utils.peerHelper = {};\n self.utils.peerHelper.getPeerNameFromIp = function getPeerNameFromIp(ip) {\n var peerName = self.settings.dictIptoPeers[ip];\n if ( peerName == null ) {\n throw new Error('what no peer for ' + ip);\n }\n return peerName;\n }\n\n /**\n *\n * Return true if peer matches\n * @param ip\n * @returns {boolean}\n */\n self.utils.peerHelper.skipPeer = function skipPeer(ipOrNameOrDict, ip) {\n if ( ipOrNameOrDict == '?') {\n return false;\n }\n var peerName = null\n var peerIp = null;\n var peerName = self.settings.dictIptoPeers[ipOrNameOrDict];\n if ( peerName == null ) {\n peerName = ipOrNameOrDict;\n peerIp = self.settings.dictPeersToIp[peerName];\n if ( peerName == null ) {\n throw new Error('bad ip....' + ipOrNameOrDict)\n }\n } else {\n peerIp = ipOrNameOrDict;\n }\n\n if ( peerIp == ip ) {\n return true; //skip this one it matches\n }\n\n return false;\n }\n\n /**\n * Update config to limit debugging information\n * @param config\n * @returns {*}\n */\n self.utils.updateTestConfig = function updateTestConfig(config) {\n config = sh.dv(config, {});\n config.silent = true;\n self.settings.cluster_config.urlTimeout =\n sh.dv(self.settings.cluster_config.urlTimeout, 10000);\n config.urlTimeout = self.settings.cluster_config.urlTimeout;\n return config;\n }\n\n }\n defineUtils();\n\n function defineLog() {\n self.dalLogX = function log() {\n if ( self.listLog == null ) {\n self.listLog = []\n }\n var args = sh.convertArgumentsToArray(arguments)\n var str = args.join(' ')\n str = self.listLog.length + '. ' + str;\n self.listLog.push(str)\n }\n\n self.dalLog = function log() {\n if ( self.listLog == null ) {\n self.listLog = []\n }\n var args = sh.convertArgumentsToArray(arguments)\n var str = args.join(' ')\n str = self.listLog.length + '. ' + str;\n var file = sh.sLog('');\n var split = file.split('\\\\')\n file = split[0] + split.slice(-1)[0] //limit display length\n console.error(sh.t, str)\n str += ' '+file\n self.listLog.push(str)\n if ( self.logGlobal ) {\n self.logGlobal.push(str)\n }\n }\n\n self.dalLogReset = function dalLogReset() {\n self.listLog= [];\n console.log(\"\\n\\n\\n\\n\\n\\n\\n-reset-\\n\\n\\n\\n\\n\\n\")\n if ( self.logGlobal ) {\n self.logGlobal.length = 0 ;\n }\n\n }\n\n self.dalLogDump = function dalLogDump() {\n // console.log('>>>', self.listLog)\n console.log('>>>>>' )//, self.logGlobal)\n sh.each(self.listLog, function (k,v) {\n console.log(v)\n })\n // console.log(self.logGlobal)\n if ( self.logGlobal ) {\n console.log('>>>>>' )//, self.logGlobal)\n sh.each(self.logGlobal, function (k,v) {\n console.log(v)\n })\n // console.log(self.logGlobal)\n }\n }\n }\n defineLog();\n\n function defineUrl() {\n // var actorsStr = self.settings.name+'__'+peerName\n function getUrlDebugTag(t) {\n var urlTag = '?a'+'='+actorsStr+'&'+\n 'of='+t.offset\n return urlTag\n }\n\n self.utils.url = {};\n self.utils.url.appendUrl = function appendUrl() { //take array of objects adn add to url\n var url = '?';\n var queryObject = {};\n var args = sh.convertArgumentsToArray(arguments)\n sh.each(args, function processB(i, hsh){\n sh.each(hsh, function processBx(k, v){\n queryObject[k] = v;\n })\n })\n url += querystring.stringify(queryObject)\n return url;\n }\n self.utils.url.from = function appendUrl(ip) { //take array of objects adn add to url\n return self.utils.peerHelper.getPeerNameFromIp(ip)\n\n }\n }\n defineUrl();\n\n DalServerTestHelpers(self)\n\n p.proc = function debugLogger() {\n if ( self.silent == true) {\n return;\n }\n var args = sh.convertArgumentsToArray(arguments)\n args.unshift(self.settings.name)\n sh.sLog(args);\n }\n}", "title": "" }, { "docid": "490b7f9f9152dbe9d51f31a9c9665866", "score": "0.430574", "text": "function getPathStatus() {\n // Call a 'local' CGI script that outputs data in JSON format\n var query = \"wmap.cgi\";\n log( \"getPathStatus: Calling cgi script \\\"\" + query + \"\\\"\" );\n var doreq = MochiKit.Async.doSimpleXMLHttpRequest( query );\n doreq.addCallback( handleUpdate );\n MochiKit.Async.callLater( refresh, getPathStatus );\n}", "title": "" }, { "docid": "3d3ef345b3f2f2a867b8012c3e4a824a", "score": "0.42964727", "text": "function _executeTrackConnection() {\n execTrackConnection(function(err, stdout, stderr) {\n if (err) {\n wifi.error(\"Error getting wireless devices information\");\n } else if (stderr) {\n wifi.error(stderr);\n } else if (stdout) {\n var content = stdout.toString();\n var lines = content.split(/\\r\\n|\\r|\\n/);\n var foundOutWereConnected = false;\n var networkAddress = null;\n\n _.each(lines, function(line) {\n if (line.indexOf('Access Point') !== -1) {\n networkAddress = line.match(/Access Point: ([a-fA-F0-9:]*)/)[1] || null;\n\n if (networkAddress) {\n foundOutWereConnected = true;\n }\n }\n });\n\n // guess we're not connected after all\n if (!foundOutWereConnected && connected) {\n connected = false;\n connectedNetwork = null;\n wifi.onLeave();\n } else if (foundOutWereConnected && !connected) {\n connected = true;\n connectedNetwork = networkAddress;\n var network = networks[networkAddress];\n\n if (network) {\n wifi.onJoin(network);\n } else {\n wifi.onFormer(networkAddress);\n }\n } else if (foundOutWereConnected && connected) {\n connectedNetwork = networkAddress;\n }\n }\n });\n }", "title": "" }, { "docid": "d386cfae97f93c8ffc020043cf6e9ad3", "score": "0.42961037", "text": "function _executeScan() {\n execScan(function(err, stdout, stderr) {\n if (err) {\n if (killing) {\n // Of course we got an error the main app is being killed, taking iwlist down with it\n return;\n }\n\n wifi.error(\"Got some major errors from our scan command:\" + err);\n } else if (stderr) {\n if (stderr.match(/Device or resource busy/)) {\n wifi.error(\"Scans are overlapping; slow down update frequency\");\n } else if (stderr.match(/Allocation failed/)) {\n wifi.error(\"Too many networks for iwlist to handle\");\n } else {\n wifi.error(\"Got some errors from our scan command: \", stderr);\n }\n } else if (stdout) {\n var content = stdout.toString();\n var newNetworks = _parseScan(content);\n\n _.each(newNetworks, function(network) {\n if (networks[network.address]) {\n var oldNetwork = networks[network.address];\n\n if (oldNetwork.essid != network.essid || oldNetwork.encryption_any != network.encryption_any) {\n wifi.onChange(network);\n } else if (oldNetwork.strength != network.strength || oldNetwork.quality != network.quality) {\n wifi.onSignal(network);\n }\n\n networks[network.address] = network;\n } else {\n networks[network.address] = network;\n wifi.onAppear(network);\n }\n });\n\n // For each network, increment last_tick, if it equals the threshold, send an event\n for (var address in networks) {\n if (!networks.hasOwnProperty(address)) {\n break;\n }\n\n var this_network = networks[address];\n this_network.last_tick++;\n\n if (this_network.last_tick == options.vanishThreshold+1) {\n wifi.onVanish(this_network);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "1e7935929798a5b2514331fc8783c1ec", "score": "0.42921504", "text": "function syncRequest(ip) {\n ipRecord[ip] = (ipRecord[ip] || 0) + 1;\n hub.emitRemote(\"SYNC_REQUEST\", ip);\n}", "title": "" }, { "docid": "8f0f6720921a1523e5f2efb7b94ca6ba", "score": "0.42880163", "text": "sniffNeighbor(packetCount, ifaddrToSniff) {\n const config = {\n fname: \"sniffNeighbor\",\n args: {\n count: packetCount,\n ifaddr: ifaddrToSniff\n }\n };\n if (this.sniffSocket.readyState === 1) {\n this.validateIpAddress(ifaddrToSniff);\n this.sniffSocket.send(JSON.stringify(config));\n }\n return new Promise((resolve, reject) => {\n this.sniffSocket.onmessage = event => {\n resolve(console.log(`${config.fname}: ${event.data}`));\n };\n });\n }", "title": "" }, { "docid": "cf0a34628669544245e511fb972cb489", "score": "0.42877364", "text": "function startThingMonitoring(documentID){\n\tvar db = conn.database('things');\n\tdb.merge(documentID, {monitored: true}, function (err, res) {\n\n\t});\n}", "title": "" }, { "docid": "0b597025f006c03f3238bfcd737650a0", "score": "0.42788088", "text": "function handlequery(data) {\n // send message that data load it started...\n io.sockets.emit(\"info\", \"<center>Loading...</center>\");\n // get time interval to query\n var fromTimestamp = data.fromTimestamp;\n var toTimestamp = data.toTimestamp;\n // log the query request\n console.log(\"Handling query from \" + fromTimestamp + \" to \" + toTimestamp);\n // check delivered interval\n if (toTimestamp < fromTimestamp) {\n var temp = fromTimestamp;\n fromTimestamp = toTimestamp;\n toTimestamp = temp;\n }\n var timeLen = toTimestamp - fromTimestamp;\n // check if interval is small enough to query\n if (timeLen > 12 * 60 * 60) {\n io.sockets.emit(\"info\", \"<center><strong>Time interval too large to query...</strong></center>\");\n return;\n }\n // fetch flm data from database\n var queryStr = \"SELECT * FROM flmdata WHERE timestamp >= '\" + fromTimestamp + \"' AND timestamp <= '\" + toTimestamp + \"';\";\n var query = db.all(queryStr, function(err, rows) {\n if (err) {\n db.close();\n throw err;\n }\n var series = {};\n for (var i in rows) {\n var sensorId = rows[i].sensor;\n if (sensors[sensorId] !== undefined) sensorId = sensors[sensorId].name;\n if (series[sensorId] === undefined) series[sensorId] = new Array();\n series[sensorId].push([ rows[i].timestamp * 1e3, rows[i].value ]);\n }\n // reduce the time series length through averages\n if (timeLen > 2 * 60 * 60) {\n for (var s in series) {\n var n = 0, avg = 0;\n var ser = new Array();\n for (var v in series[s]) {\n // series[s][v] delivers the single series [timestamp,value]\n n++;\n avg += parseInt(series[s][v][1]);\n tim = new Date(series[s][v][0]);\n if (tim.getSeconds() == 0) {\n avg = Math.round(avg / n);\n ser.push([ series[s][v][0], avg ]);\n avg = 0;\n n = 0;\n }\n }\n series[s] = ser;\n }\n }\n // send data to requester\n io.sockets.emit(\"series\", series);\n console.log(\"Queried series transmitted...\");\n });\n}", "title": "" }, { "docid": "e3a7f06de9f3245fbcd817614908810f", "score": "0.42787817", "text": "function start() {\n // MongoDB connection, settings and callback\n simpledb.init({\n // MongoDB connection String.\n connectionString: 'mongodb://localhost/company',\n\n // Location of the Schemas.\n modelsDir : `${__dirname}/schemas`\n\n // Callback (errorObject, Database Object \"dbo\")\n }, (err, db) => {\n\n // Checking for errors\n if(err)\n return writeErr(err);\n\n // Adding asynchronous forEach to the dbo.\n // This allows one initialization and easy access.\n db.forEachAsync = forEachAsync;\n\n // Ruuning Service and passing the dbo,\n // Error Object and Results\n run(db, (err, results) => {\n\n // Checking for errors.\n if(err)\n return writeErr(err);\n\n // Adding the results to the response.\n response.results = results;\n\n // Response is prepared, now I am seing it.\n // Callback (str that is ready to output.\n sendRes((str) => {\n\n // Output String\n console.log(str);\n\n // Stopping.\n process.exit();\n });\n });\n // TODO: Break the callbacks up for better and easier code.\n });\n}", "title": "" } ]
ae4b7332cbb646fd1d84bfac60be92a6
Enables Metamask to make a conncetion with web3
[ { "docid": "e9e0597a1296f59524b4b3997feda5ea", "score": "0.54924", "text": "async function EnableEthereum() {\n web3.eth.getAccounts(async function (err, accounts) {\n if (accounts.length > 0) {\n SetConnectionStatus(accounts[0]);\n console.log(await Get3boxAccountFromAdress(accounts[0]));\n } else {\n window.ethereum.enable().then(async function () {\n console.log(\"Dapp Allowed\");\n let accounts = await web3.eth.getAccounts();\n SetConnectionStatus(accounts[0]);\n }).catch(function (e) {\n console.log(\"Dapp Disallowed\");\n SetConnectionStatus();\n });\n }\n });\n}", "title": "" } ]
[ { "docid": "508b70872237d079612196eef8202f4c", "score": "0.730068", "text": "async loadWeb3(){\n if(window.ethereum){\n window.web3 = new Web3(window.ethereum)\n //console.log(window.web3)\n await window.ethereum.enable()\n } else if(window.web3){\n window.web3 = new Web3(window.web3.currentProvider)\n await window.ethereum.enable()\n }else{\n window.alert('Please use metamask!!!')\n }\n\n }", "title": "" }, { "docid": "b8db460e43c9154f87f0e89a549e8143", "score": "0.69053507", "text": "async initWeb3(silent) {\n if (hasMetamask()) {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum)\n try {\n if (!silent) {\n if (!window.ethereum.selectedAddress) {\n this.runProviderUpdate(this, {\n status: WALLET_STATUS.USER_ACTION_REQUIRED,\n })\n } else {\n setTimeout(() => {\n if (!this.web3) {\n this.runProviderUpdate(this, {\n status: WALLET_STATUS.USER_ACTION_REQUIRED,\n })\n }\n }, 5000)\n }\n }\n await window.ethereum.enable()\n this.web3 = window.web3\n return true\n } catch (error) {\n console.error(error)\n return false\n }\n } else if (window.web3) {\n this.web3 = new Web3(window.web3.currentProvider)\n window.web3 = this.web3\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "2191dabb32bc59846a55aa8e29033b2b", "score": "0.6844603", "text": "async function loadWeb3() {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum);\n window.ethereum.enable();\n }\n}", "title": "" }, { "docid": "bd535e36218eaa04ee49f085ef164796", "score": "0.68317294", "text": "async loadWeb3() {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum)\n await window.ethereum.enable()\n }\n else if (window.web3) {\n window.web3 = new Web3(window.web3.currentProvider)\n }\n else {\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!')\n }\n }", "title": "" }, { "docid": "bd535e36218eaa04ee49f085ef164796", "score": "0.68317294", "text": "async loadWeb3() {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum)\n await window.ethereum.enable()\n }\n else if (window.web3) {\n window.web3 = new Web3(window.web3.currentProvider)\n }\n else {\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!')\n }\n }", "title": "" }, { "docid": "bd535e36218eaa04ee49f085ef164796", "score": "0.68317294", "text": "async loadWeb3() {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum)\n await window.ethereum.enable()\n }\n else if (window.web3) {\n window.web3 = new Web3(window.web3.currentProvider)\n }\n else {\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!')\n }\n }", "title": "" }, { "docid": "606a26e738396baf543509fb0d403107", "score": "0.67426556", "text": "function initW3 () {\n if (typeof window.ethereum !== 'undefined' || (typeof window.web3 !== 'undefined')) {\n // Web3 browser user detected. You can now use the provider.\n window.ethereum.enable()\n const provider = window['ethereum'] || window.web3.currentProvider\n web3 = new Web3(provider)\n if (isLocked()) {\n return { status: false, msg: 'Metamask needs to be unlocked!' }\n }\n return {\n status: true,\n msg: '',\n address: window.ethereum.selectedAddress,\n network: networks[window.ethereum.networkVersion]\n }\n } else {\n web3 = new Web3('https://rinkeby.infura.io/v3/73b1a4e591154a63a7537c086a31f23d:8545')\n return {\n status: true,\n msg: '',\n address: 'Install MetaMask',\n network: 'None'\n }\n }\n}", "title": "" }, { "docid": "04a74b8c79e16e819c5fae625acb71ad", "score": "0.67418563", "text": "async loadWeb3() {\n\t\tif (window.ethereum) {\n\t\t\twindow.web3 = new Web3(window.ethereum);\n\t\t\tawait window.ethereum.enable();\n\t\t} else if (window.web3) {\n\t\t\twindow.web3 = new Web3(window.web3.currentProvider);\n\t\t} else {\n\t\t\twindow.alert('Non-Ethereum browser detected. You should consider trying MetaMask!');\n\t\t}\n\t}", "title": "" }, { "docid": "8840a41e9ccc6d99d2a9b09d6d4b039f", "score": "0.6737316", "text": "async loadWeb3(){\n if (window.ethereum) { // Modern dapp browsers...\n window.web3 = new web3(window.ethereum)\n await window.ethereum.enable();\n }\n else if (window.web3) { // Legacy dapp browsers...\n window.web3 = new web3(window.web3.currentProvider)\n }\n else { // If no injected web3 instance is detected, fall back to Ganache\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!')\n }\n }", "title": "" }, { "docid": "c682b7dc32458c1861f1475901f1b00d", "score": "0.6728016", "text": "async function enableMetamask() {\r\n\t// mainnet = 0x63564c40\r\n\t// testnet = 0x6357d2e0 \r\n\tlet shardNum = 0;\r\n\tlet chainId = config.CHAINID==1?4689:4689;\r\n\tlet chainName = config.CHAINID==1?'IoTeX Mainnet':'IoTeX Testnet';\r\n\tlet chainURL = config.NETURL;\r\n\tlet chainExp = config.EXPLORER;\r\n\r\n\ttry {\r\n\t\tlet web3 = new Web3(window.ethereum);\r\n\t\tlet list = await web3.eth.getAccounts();\r\n\t\tif(!list || list.length<1){ alert('Wallet not connected'); return; }\r\n\t\tlet address = list[0];\r\n\t let params = [\r\n\t\t {\r\n\t\t chainId: '0x' + Number(chainId + shardNum).toString(16),\r\n\t\t chainName: chainName,\r\n\t\t nativeCurrency: { name: 'IOTX', symbol: 'IOTX', decimals: 18 },\r\n\t\t rpcUrls: [chainURL],\r\n\t\t blockExplorerUrls: [chainExp],\r\n\t\t },\r\n\t\t address,\r\n\t\t];\r\n\t let result = await window.ethereum.request({ method: 'wallet_addEthereumChain', params: params });\r\n\t console.log('Metamask result', result);\r\n\t} catch(ex) {\r\n\t console.log('Metamask error', ex);\r\n\t alert('Error enabling Harmony Network on Metamask: '+ex.message);\r\n\t}\r\n}", "title": "" }, { "docid": "a7ca92c1cf80a6b5b1028b4a803a93e0", "score": "0.67225486", "text": "async loadWeb3() {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum)\n await window.ethereum.enable()\n }\n else if (window.web3) {\n window.web3 = new Web3(window.web3.currentProvider)\n }\n\n //check metamask extension is installed on chrome browser\n else {\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!')\n }\n }", "title": "" }, { "docid": "c27eaa247b0c17bd85f420483125b96e", "score": "0.6691852", "text": "function doconnect() {\n var providerUrl=document.getElementById('provider_url').value;\n window.web3 =new Web3(new Web3.providers.HttpProvider(providerUrl));\n updateConnectionStatus();\n}", "title": "" }, { "docid": "f7e5f2a7827815f23002b36a2a6fea03", "score": "0.66033375", "text": "async function initializeWeb3(){\n if(window.ethereum){\n window.web3 = new Web3(window.ethereum)\n await window.ethereum.enable()\n }\n else if (window.web3){\n window.web3 = new Web3(window.web3.currentProvider)\n }\n else{\n window.alert('No Ethereum Provider detected!')\n }\n}", "title": "" }, { "docid": "df5a3f47159da7829364495def85e19c", "score": "0.64858323", "text": "async loadWeb3(withVerification) {\n // If withVerification, Incubed Client (IN3) will be used as a provider for Web3.\n if (withVerification) {\n const in3Config = {\n proof: 'standard', //‘none’ for no verification, ‘standard’ for verifying all important fields, ‘full’ veryfying all fields even if this means a high payload \n signatureCount: 2,\n requestCount: 3,\n chainId: 'mainnet',\n timeout: 30000,\n replaceLatestBlock: 6\n };\n \n try {\n let client;\n if (!window.web3WithIn3) {\n if (useWasm) {\n WasmIN3Client.setTransport(new InterceptAndLog().in3WasmTransportFunction)\n \n client = new WasmIN3Client(in3Config)\n }\n else {\n client = new IN3Client(in3Config);\n }\n \n // use the IN3Client as Http-Provider\n const web3 = new Web3(client);\n window.web3WithIn3 = web3;\n }\n \n console.log(\"Using Web3 with IN3 (Incubed Client will be used as a provider for Web3)\");\n return(window.web3WithIn3);\n } catch (error) {\n return(error);\n }\n }\n else {\n console.log(\"Web3 without Incubed Client (IN3) will be used. There will be no way to verify the respose of the remote Node (Ethereum Client). Be sure to connect to a trusted Node\");\n // Wait for loading completion to avoid race conditions with web3 injection timing.\n this.useMetamask();\n }\n }", "title": "" }, { "docid": "fddc9511531dcc571f72cd5399acb4a7", "score": "0.6365948", "text": "connect() {\n if (this.web3) return this.web3;\n\n console.log('Blockchain Connecting ...');\n // const provider = new Web3.providers.HttpProvider(\n // `${config.web3.host}:${config.web3.port}`\n // // null,\n // // config.web3.options,\n // );\n\n // // provider.on('error', console.error);\n // // provider.on('connect', () => console.log('Blockchain Connected ...'));\n // // provider.on('end', console.error);\n\n const provider = this._getProvider();\n\n this.web3 = new Web3(provider);\n accounts.forEach(e => {\n const account = this.web3.eth.accounts.privateKeyToAccount(e);\n this.web3.eth.accounts.wallet.add(account);\n mapping[account.address.toUpperCase()] = e;\n });\n\n // attempt to keep connection alive\n setInterval(async e=>{\n await this.web3.eth.getBlock(\"latest\");\n }, 30000);\n \n this.web3.eth.defaultAccount = this.web3.eth.accounts.privateKeyToAccount(\"0xbc696d9be5af89ff3389f2517b419dea6928054997ddf231791c38783a8e86f0\").address;\n // this.web3 = new Web3(provider);\n \n return this.web3;\n }", "title": "" }, { "docid": "b0d4a77da2944d28d2e926ee98d6df62", "score": "0.6354199", "text": "function setProvider(web3, gethHost, gethPort) {\n var url = 'http://'+gethHost+':'+gethPort;\n console.log('web3 connect to:',url);\n web3.setProvider(new web3.providers.HttpProvider(url));\n}", "title": "" }, { "docid": "d8bf591e7b63b8c71b5ec2c115205a45", "score": "0.6351826", "text": "function MetaMaskWeb3(options) {\n this.isInstalled = 'web3' in window;\n this.isLoggedIn = false;\n this.web3Infura = null;\n this.web3Metamask = null;\n this.contractInfura = null;\n this.contractMetamask = null;\n this.contractToken = null;\n this.ethAddress;\n this.options = options;\n this.checkWeb3Callbacks = [];\n this.checkWeb3Started = false;\n }", "title": "" }, { "docid": "9dc88484284398921bbbd22e7ec12478", "score": "0.62652344", "text": "function checkWeb3(){\n // Set the connect status on the app\n if (web3 && web3.isConnected()) {\n console.info('Connected');\n $('#no_status').text(\"Conectado\");\n // Set version\n setWeb3Version();\n checkNodeStatus();\n } else {\n console.info('Not Connected');\n \n }\n}", "title": "" }, { "docid": "2db9df618d65b70ecb8d7220cb898a4a", "score": "0.61992997", "text": "async init() {\n App.web3 = new Web3(web3.givenProvider)\n App.networkId = await web3.eth.net.getId()\n App.contract = await ProjectSubmission.deployed();\n\n }", "title": "" }, { "docid": "98eb19741d1845a9bb3c4e55a89ef92e", "score": "0.6163511", "text": "async function connectContract() {\n window.web3 = await Moralis.Web3.enable();\n const web3Provided = new Web3('HTTP://127.0.0.1:7545');\n window.contractInstance = new web3Provided.eth.Contract(tokenABI, contractAddress);\n }", "title": "" }, { "docid": "0c98f512f958466fc9e61223acd6b356", "score": "0.61627686", "text": "function Start()\n {\n PhotonNetwork.ConnectUsingSettings(\"0.1\");\n \n }", "title": "" }, { "docid": "a4faa71066d8cac8f67cf11efa41d13c", "score": "0.6149458", "text": "async function init() {\n \n // let kovanProvider = new Web3.providers.HttpProvider(\"https://kovan.infura.io/v3/d126f392798444609246423b06116c77\");\n // setLoadingMessage(\"Initializing Biconomy ...\");\n let matictestProvider = new Web3.providers.HttpProvider(maticProvider);\n const biconomy = new Biconomy(matictestProvider, { apiKey: 'Mg4po8zbw.b0e298c7-8f86-4543-b9c5-64ae297ebc16', debug: true });\n\n // This web3 instance is used to read normally and write to contract via meta transactions.\n web3 = new Web3(biconomy); \n // This web3 instance is used to get user signature from connected wallet\n // walletWeb3 = new Web3(window.ethereum);\n\n biconomy.onEvent(biconomy.READY, () => {\n // Initialize your dapp here like getting user accounts etc\n contract = new web3.eth.Contract(\n abi, contractAddress \n );\n \n \n // Instantiate a new truffle contract from the artifact\n contracts.FanTestToken = TruffleContract(JSON.parse(JSON.stringify(jsonData)));\n // Connect provider to interact with contract\n contracts.FanTestToken.setProvider(matictestProvider);\n contracts.FanTestToken.deployed().then(function(instance) {\n console.log(\"Fan Test Token Address: \", instance.address);\n });\n \n console.log(contract);\n //console.log(contract.currentProvider.selectedAddress);\n //setSelectedAddress(provider.selectedAddress);\n //getQuoteFromNetwork();\n // provider.on(\"accountsChanged\", function (accounts) {\n // setSelectedAddress(accounts[0]);\n \n // });\n }).onEvent(biconomy.ERROR, (error, message) => {\n // Handle error while initializing mexa\n });\n// } else {\n// console.log(\"Metamask not installed\");\n// }\n}", "title": "" }, { "docid": "7bc68cf05de1c4d341c2095cfdd50aa3", "score": "0.605565", "text": "async function init() {\n const providerOptions = {\n walletconnect: {\n package: WalletConnectProvider,\n options: {\n infuraId: \"a1d2d05b386a403296580b00c8032130\",\n }\n },\n\n fortmatic: {\n package: Fortmatic,\n options: {\n // key: \"pk_test_C99A517CE7B79A76\"\n key: \"pk_live_A4C2D41D64B917E8\"\n }\n }\n };\n\n web3Modal = new Web3Modal({\n cacheProvider: true, // optional\n providerOptions, // required\n disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera.\n // theme: \"dark\"\n });\n\n // if (web3Modal.cachedProvider) {\n // onConnect();\n // }\n // if (localStorage.getItem(\"walletProvider\") !== null) {\n // provider = JSON.parse(localStorage.getItem(\"walletProvider\"));\n // }\n\n // document.getElementById(\"connect\").style.display = \"inline\";\n console.log(\"Web3Modal instance is\", web3Modal);\n}", "title": "" }, { "docid": "0cada607883ff34f0aa6e1bb4b9236f4", "score": "0.60238606", "text": "async connect() {\n await window.ethereum.enable();\n this.setState({ loading: false, connected: true });\n this.setupWeb3();\n // you would potentially call connectWallet here!\n // connectWallet();\n }", "title": "" }, { "docid": "cf40e80ab5809434fecfcf4694eeec21", "score": "0.6013792", "text": "async function onConnect() {\r\n\r\n window.web3 = new Web3(ethereum);\r\n\r\n \r\n // Subscribe to accounts change\r\n ethereum.on(\"accountsChanged\", (accounts) => {\r\n if (selectedAccount != null) { //this is so even after wallet is disconnected, metamask can still reload the site because\r\n fetchAccountData(); //the ethereum.on event listener is still active and cannot be deactivated...so we just check\r\n } else { //and if the account is null we reload the page instead of letting metamask call the accountData function\r\n window.location.reload();\r\n }\r\n });\r\n\r\n // Subscribe to chainId change\r\n ethereum.on(\"chainChanged\", (chainId) => {\r\n if (selectedAccount != null) {\r\n fetchAccountData();\r\n } else {\r\n window.location.reload();\r\n }\r\n }); \r\n\r\n // Subscribe to networkId change\r\n ethereum.on(\"networkChanged\", (networkId) => {\r\n if (selectedAccount != null) {\r\n fetchAccountData();\r\n } else {\r\n window.location.reload();\r\n }\r\n });\r\n\r\n await refreshAccountData();\r\n}", "title": "" }, { "docid": "bf09cc4d84822677e7ed70064d72344e", "score": "0.5988644", "text": "function useWeb3Provider() {\n const [account, setAccount] = useState(null);\n const [network, setNetwork] = useState(null);\n const [mintedTokenLink, setMintedTokenLink] = useState(null);\n\n const checkIfWalletIsConnected = async () => {\n const { ethereum } = window;\n if (!ethereum) {\n return {\n data: null,\n error: {\n message: \"Make sure you have metamask!\",\n },\n };\n } else {\n /*\n * Check if we're authorized to access the user's wallet\n */\n const accounts = await ethereum.request({ method: \"eth_accounts\" });\n /*\n * User can have multiple authorized accounts, we grab the first one if its there!\n */\n if (accounts.length !== 0) {\n const account = accounts[0];\n console.log(\"Found an authorized account:\", account);\n // Setup listener! This is for the case where a user comes to our site\n // and ALREADY had their wallet connected + authorized.\n setupEventListener();\n setAccount(account);\n return {\n error: null,\n data: {\n account,\n },\n };\n } else {\n console.log(\"No authorized account found\");\n setAccount(null);\n return {\n data: null,\n error: null,\n };\n }\n }\n };\n\n const switchAccount = async () => {\n await window.ethereum.request({\n method: \"wallet_requestPermissions\",\n params: [\n {\n eth_accounts: {},\n },\n ],\n });\n await checkIfWalletIsConnected();\n };\n\n /*\n * Implement your connectWallet method here\n */\n const connectWallet = async () => {\n const { ethereum } = window;\n try {\n if (!ethereum) {\n return {\n error: {\n message: \"You need a crypto wallet to interact with this website.\",\n },\n data: null,\n };\n }\n\n /*\n * Fancy method to request access to account.\n */\n const accounts = await ethereum.request({\n method: \"eth_requestAccounts\",\n });\n\n /*\n * Boom! This should print out public address once we authorize Metamask.\n */\n const account = accounts[0];\n\n // Setup listener! This is for the case where a user comes to our site\n // and connected their wallet for the first time.\n setupEventListener();\n setAccount(account);\n return {\n error: null,\n data: {\n account,\n },\n };\n } catch (error) {\n setAccount(null);\n console.log(error);\n return {\n error,\n data: null,\n };\n }\n };\n\n const setupEventListener = async () => {\n const { ethereum } = window;\n try {\n if (ethereum) {\n const connectedContract = getConnectedContract();\n // This will essentially \"capture\" our event when our contract throws it.\n // If you're familiar with webhooks, it's very similar to that!\n connectedContract.on(\"NewSupacoinNFTMinted\", async (from, tokenId) => {\n const [account] = await ethereum.request({ method: \"eth_accounts\" });\n console.log({ account });\n console.log({ from });\n setMintedTokenLink(\n `${OPEN_SEA_URL}/assets/${CONTRACT_ADDRESS}/${tokenId.toNumber()}`\n );\n });\n\n console.log(\"Setup event listener!\");\n } else {\n console.log(\"Ethereum object doesn't exist!\");\n }\n } catch (error) {\n console.log(error);\n }\n };\n\n const mintNFT = () => {\n const supacoinContract = getConnectedContract();\n return supacoinContract.mint();\n };\n\n useEffect(() => {\n if (window.ethereum) {\n const ethereum = window.ethereum;\n // The \"any\" network will allow spontaneous network changes\n const provider = new ethers.providers.Web3Provider(ethereum, \"any\");\n provider.on(\"network\", (newNetwork) => {\n let detectedNetwork = networksMap[newNetwork.chainId];\n detectedNetwork = detectedNetwork ? detectedNetwork : newNetwork;\n if (newNetwork?.chainId !== network?.chainId) {\n setNetwork(detectedNetwork);\n }\n });\n\n ethereum.on(\"accountsChanged\", (accounts) => {\n const [account] = accounts;\n setAccount(account);\n });\n }\n }, []);\n\n return {\n account,\n network,\n setAccount,\n switchAccount,\n mintedTokenLink,\n connectWallet,\n checkIfWalletIsConnected,\n mintNFT,\n };\n}", "title": "" }, { "docid": "9bf1de634cf6609629fc600492a9084e", "score": "0.59419066", "text": "loadProvider() {\n const ethereumProvider = metamask.createDefaultProvider()\n this.provider = 'mascara'\n this.web3 = new Web3(ethereumProvider)\n }", "title": "" }, { "docid": "ae9e7647f31019649f7a4a6fb0a28bd7", "score": "0.5940743", "text": "async function loadWeb3() {\n // Connect to the network\n // Modern dapp browsers...\n if (window.ethereum) {\n try {\n // Request account access if needed\n await ethereum.enable();//If this doesn't work an error is thrown\n console.log(\"User has a MODERN dapp browser!\");\n showAlert(\"You are ready to play!\", \"success\");\n provider = new ethers.providers.Web3Provider(ethereum);\n // console.log(provider);\n\n // Acccounts now exposed. Load the contract!\n // loadBlockchainData();\n } catch (error) {\n console.log(\"There was and error: \", error.message);//In case user denied access\n showAlert(\"App needs access your account in order to play\", \"fail\");\n //Load blockchain and contract data (jackpot, last games) via ethers default provider (Infura, Etherscan)\n provider = ethers.getDefaultProvider('goerli');\n }\n }\n // Legacy dapp browsers (acccounts always exposed)...\n else if (window.web3) {\n provider = new ethers.providers.Web3Provider(web3.currentProvider);\n console.log(\"User has a LEGACY dapp browser!\");\n showAlert(\"You are ready to play!\", \"success\");\n // loadBlockchainData();\n }\n // Non-dapp browsers...\n else {\n //Load blockchain and contract data (jackpot, last games) via ethers default provider (Infura, Etherscan)\n console.log('Non-Ethereum browser detected. You should consider trying MetaMask!');\n showAlert(\"Non-Ethereum browser detected. You should consider trying MetaMask in order to play\", \"fail\");\n provider = ethers.getDefaultProvider('goerli');\n // console.log(provider);\n // loadBlockchainData();\n }\n loadBlockchainData();\n}", "title": "" }, { "docid": "13491a42560e19d94cf2f2133b869e88", "score": "0.59319913", "text": "async function loadWeb3() {\n // Connect to the network\n // Modern dapp browsers...\n if (window.ethereum) {\n try {\n // Request account access if needed\n await ethereum.enable();//If this doesn't work an error is thrown\n console.log(\"User has a MODERN dapp browser!\");\n provider = new ethers.providers.Web3Provider(ethereum);\n // console.log(provider);\n\n // Acccounts now exposed. Load the contract!\n loadBlockchainData();\n } catch (error) {\n console.log(\"There was and error: \", error.message);//In case user denied access\n }\n }\n // Legacy dapp browsers (acccounts always exposed)...\n else if (window.web3) {\n provider = new ethers.providers.Web3Provider(web3.currentProvider);\n console.log(\"User has a LEGACY dapp browser!\");\n loadBlockchainData();\n }\n // Non-dapp browsers...\n else {\n //Load blockchain and contract data (jackpot, last games) via ethers default provider (Infura, Etherscan)\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!');\n provider = ethers.getDefaultProvider('ropsten');\n // console.log(provider);\n loadBlockchainData();\n }\n}", "title": "" }, { "docid": "7890c8d19342929ffde43c70a50110ed", "score": "0.5928525", "text": "function setupNodeSession(node_type, host='localhost', port=8545, api_token='') {\n let push_trace = 0;\n if(node_type == 'Parity'){\n node = new Web3(new Web3.providers.HttpPgrovider(`http://${host}:${port}`));\n }\n else if(node_type == 'Geth'){\n node = new Web3(new Web3.providers.HttpProvider(`http://${host}:${port}`));\n }\n else if(node_type == 'Infura'){\n node = new Web3( new Web3.providers.HttpProvider(`https://${host}/${api_token}`));\n }\n else{\n console.log('Node not supported');\n }\n if(node.isConnected()){\n console.log('Connected to node');\n }\n else{\n console.log('Unable to connect')\n }\n return [node,push_trace];\n}", "title": "" }, { "docid": "d8b87336968bb5228dd795d8728d4658", "score": "0.5920151", "text": "function checkWeb3() {\n // Set the connect status on the app\n if (web3 && web3.isConnected()) {\n console.info('Connected');\n $('#statusConnection').text(\"Conectado\");\n } else {\n $('#statusConnection').text(\"Desconectado\");\n }\n}", "title": "" }, { "docid": "931be86a986a5f85c116bb22de560dfe", "score": "0.58593684", "text": "async function getWeb3(callback) {\n if (typeof window.web3 === 'undefined') {\n // no web3, use fallback\n console.error(\"Please use a web3 browser\");\n var msgNotEthereum = \"You aren't connected to Oracles Network. Please, switch on Oracles plugin and refresh the page. Check Oracles network <a href='https://github.com/oraclesorg/oracles-wiki' target='blank'>wiki</a> for more info.\";\n swal(\"Warning\", msgNotEthereum, \"warning\");\n callback(myWeb3, false);\n } else {\n var myWeb3 = new Web3(window.web3.currentProvider); \n\n myWeb3.eth.defaultAccount = window.web3.eth.defaultAccount;\n if (!myWeb3) {\n let accounts = await myWeb3.eth.getAccounts()\n myWeb3.eth.defaultAccount = accounts[0].toLowerCase()\n }\n console.log(myWeb3.eth.defaultAccount)\n\n let isOraclesNetwork = checkNetworkVersion(myWeb3)\n callback(myWeb3, isOraclesNetwork);\n }\n}", "title": "" }, { "docid": "26767c34f6c150805ac01ca3d59cc5e7", "score": "0.57544476", "text": "async _initialization() {\n \n // first initialization of web3js\n // we need to detect if browser is 'injected' with web3js, so we can reed adress of user\n if (window.ethereum) {\n\n this._web3 = new Web3(window.ethereum);\n try {\n await window.ethereum.enable();\n } catch (e) {\n return { success: false, errorMessage: e.message };\n // return Promise().reject(e.message);\n // User denied account access...\n // TODO: you must test that and throw some errors that app needs this premissions\n }\n }\n // Legacy dapp browsers, they can always read everything they need\n else if (window.web3) {\n this._web3 = new Web3(web3.currentProvider);\n }\n // Non-dapp browsers (they do not have any wallet injected in them)...\n else {\n // We are either on the server or the user isn't running metamask\n // this must throw error in production\n // currently you can fall back to localhost but then you will use first account as default\n const provider = new Web3.providers.HttpProvider(\"http://localhost:8545\");\n this._web3 = new Web3(provider);\n //TODO: MUST THROW ERROR;\n return { success: false, errorMessage: \"You must have Metamask in your browser to access Ethereum blockchain\"}\n }\n\n\n // saving user address\n this._userAddress = this._web3.givenProvider.selectedAddress;\n\n this._userBalance = await this._getCurrentUserBalance();\n\n //initialization of conncection to smart contract\n try {\n // also need to automate somehow path finding\n this._testContractAbi = require(\"../../build/contracts/CryptoRoulette.json\");\n } catch (e) {\n return { success: false, errorMessage: \"There is no smart contract ABI provided\" }\n //TODO: return and handle error needed\n }\n\n if(appSettings._contractAddress === null) {\n return { success: false, errorMessage: \"No Address for smart contract provided\" };\n }\n\n // need better handle and read on what address smart contract is located\n this._contract = this._web3.eth.Contract(this._testContractAbi.abi, appSettings._contractAddress);\n\n // now we have in this._contractInstance instance of our smart contract and now we can call functions on it\n // TEMPLATE FOR CALLING FUNCTIONS, wrapper must be async func: \n // const res = await this._contract.methods.MethodName(params).call() for functions that read smart contract state\n // for altering smart contract state you must send a transaction \n // also check the docs https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#methods for more\n // OTHER USEFUL STUFF: web3.utils.hexToNumberString\n // also TODO: check if actually connected and check if account changed?\n // idea for connection, write some random function on smart contract which you will ping for connection right here\n return { success: true };\n }", "title": "" }, { "docid": "014bcc85fc172a3466f923c72334807f", "score": "0.5720639", "text": "async componentWillMount() {\n await this.loadWeb3()\n // console.log(window.web3)\n await this.loadBlockchainData()\n }", "title": "" }, { "docid": "a1d7b6b5a5cd10aee33fe93de96e350e", "score": "0.5700347", "text": "async getEther(amountWei) {\n const { usingMetamask, channelManagerAddress, connext } = this.props\n let web3 = window.web3;\n console.log('window.web3', web3);\n if (!web3) {\n alert(\"You need to install & unlock metamask to do that [1]\");\n return;\n }\n const metamaskProvider = new eth.providers.Web3Provider(\n web3.currentProvider\n );\n const mmAddr = (await metamaskProvider.listAccounts())[0];\n const browserAddr = store.getState()[0].getAddressString()\n if (!mmAddr) {\n alert(\"You need to install & unlock metamask to do that [2]\");\n return;\n }\n\n // if the autosigner is being used, send to that address\n // otherwise, send from metamask to contract\n try {\n if (usingMetamask) {\n console.log(`Sending ${amountWei} wei from ${mmAddr} to channel`)\n const sentTx = await connext.deposit({ amountWei: amountWei , amountToken: \"0\", recipient: \"user\" })\n console.log(\n `Eth sent to: ${channelManagerAddress}. Tx: `,\n sentTx\n );\n } else {\n // make sure that this brings browser wallet balance up to\n // 40fin for gas costs\n let weiDeposit\n const browserWei = Web3.utils.toBN(\n await metamaskProvider.getBalance(browserAddr)\n )\n const amountWeiBN = Web3.utils.toBN(amountWei)\n // deposit + existing bal should be above threshold\n if (browserWei.add(amountWeiBN).lt(BALANCE_THRESHOLD_WEI)) {\n console.log(`Browser wallet balance + requested deposit below minimum, adding enough to bring total to 40fin.`)\n weiDeposit = BALANCE_THRESHOLD_WEI.sub(browserWei).add(1)\n }\n\n console.log(`Sending ${weiDeposit ? weiDeposit.toString() : amountWei} wei from ${mmAddr} to ${browserAddr}`)\n\n const metamask = metamaskProvider.getSigner();\n const sentTx = await metamask.sendTransaction({\n to: browserAddr,\n value: weiDeposit \n ? eth.utils.bigNumberify(weiDeposit.toString()) \n : eth.utils.bigNumberify(amountWei),\n gasLimit: eth.utils.bigNumberify(\"21000\"),\n })\n\n console.log(\n `Eth sent to: ${store.getState()[0].getAddressString()}. Tx: `,\n sentTx\n );\n }\n } catch (e) {\n console.warn(`Error sending transaction: ${e.message}`)\n }\n }", "title": "" }, { "docid": "e3576e55948f18c75a656c8cd0b44690", "score": "0.56932735", "text": "function getWeb3() {\n // console.log('only once');\n return new Promise(resolve => {\n window.addEventListener('load', () => {\n let { web3 } = window;\n\n // Checking if Web3 has been injected by the browser (Mist/MetaMask)\n if (typeof web3 !== 'undefined') {\n // Use Mist/MetaMask's provider\n web3 = new Web3(web3.currentProvider);\n } else {\n // fallback - use your fallback strategy (local node / hosted node + in-dapp id mgmt / fail)\n web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));\n }\n\n if (!web3.isConnected()) {\n // TODO: setup giveth node and use that\n web3 = new Web3(new Web3.providers.HttpProvider('https://giveth.psdev.io:8545'));\n }\n\n web3.eth.getTransactionReceiptMined = getTransactionReceiptMined;\n\n resolve(web3);\n });\n });\n}", "title": "" }, { "docid": "4465327fb0b223f4a3d846389d8d25e1", "score": "0.56925845", "text": "constructor(container, web3) {\n if (container === undefined || web3 === undefined)\n throw new Error(\"Can't instantiate Geth without container & web3 parameters. Probably, this should achieve what you're trying to do:`geth = await Geth.init();`\")\n\n this._container = container\n this._web3 = web3\n }", "title": "" }, { "docid": "998fb36e6a119bd100801f81a2cb84e6", "score": "0.5685894", "text": "function init() {\r\n \r\n // Tell Web3modal what providers we have available.\r\n // Built-in web browser provider (only one can exist as a time)\r\n // like MetaMask, Brave or Opera is added automatically by Web3modal\r\n const providerOptions = {\r\n walletconnect: {\r\n package: WalletConnectProvider,\r\n options: {\r\n // Nodezy's test key - don't copy as your mileage may vary\r\n infuraId: \"21d7ff87ab3941cf8cfa4c0cb379a384\",\r\n }\r\n },\r\n\r\n };\r\n\r\n web3Modal = new Web3Modal({\r\n cacheProvider: false, // optional\r\n providerOptions, // required\r\n disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera.\r\n });\r\n\r\n //console.log(\"Web3Modal instance is\", web3Modal);\r\n}", "title": "" }, { "docid": "d055dfadf7223c0ba8ae4385400e1d1c", "score": "0.56684375", "text": "async function initMam() {\n console.log(\"In ascolto...\");\n await Mam.init('https://nodes.devnet.iota.org:443');\n}", "title": "" }, { "docid": "7a099d1a44611f148c0334c549190bef", "score": "0.5660857", "text": "async function init() {\n const allInjected = await web3Enable(\"$name_snake_case$\");\n allAccounts = await web3Accounts();\n}", "title": "" }, { "docid": "8ad93677e3f5c2a4e7bb76a8f59b7075", "score": "0.5604676", "text": "async enableNetwork() {\n this.networkEnabled = !0, this.xc() && (this.Gc.lastStreamToken = await this.Fc.bo(), \n this.Jc() ? this.Yc() : this.Uc.set(\"Unknown\" /* Unknown */), \n // This will start the write stream if necessary.\n await this.Xc());\n }", "title": "" }, { "docid": "4c5068eff0f7336163f7533869e81ced", "score": "0.5597914", "text": "getWeb3Object() {\n getWeb3.then(result => {\n this.setState({web3: result.web3});\n result.web3.eth.getAccounts((err, accounts) => {\n if (err || accounts.length === 0) {\n window.dialog.showAlert(UNLOCK_METAMASK);\n this.resetState();\n } else {\n this.setNetwork();\n }\n });\n this.state.web3.currentProvider.on('networkChanged', netId => {\n this.setState({ selectedNetwork: netId });\n });\n }).catch(e => {\n window.dialog.showAlert(METAMASK_NOTFOUND);\n });\n }", "title": "" }, { "docid": "8bac1e7b36a127a2ad0f99ba982a1604", "score": "0.55873495", "text": "init(privateKey, address, chainId){\n web3.setProvider(new uniprovider(rpcUrl));\n web3.thk.defaultPrivateKey = privateKey;\n web3.thk.defaultAddress = address.toLowerCase();\n web3.thk.defaultChainId = chainId.toString();\n }", "title": "" }, { "docid": "a9ae3c036c68b148976eb9dca57fa3e8", "score": "0.5565184", "text": "async function initBlockchain(web3) {\n // Use web3 to get the user's accounts.\n const accounts = await web3.eth.getAccounts();\n const userAddress = accounts[0];\n\n // Get contract instance\n const networkId = await web3.eth.net.getId();\n const deployedNetwork = StoreContract.networks[networkId];\n const instance = new web3.eth.Contract(\n StoreContract.abi,\n deployedNetwork && deployedNetwork.address\n );\n\n // put state data into the REDUX store for easy access from other pages and components\n\n let data = {\n CZ: instance,\n userAddress // shorthand\n };\n\n store.dispatch(blockchainInitialized(data));\n\n return data;\n}", "title": "" }, { "docid": "45b736ee14092602773003fb88eab341", "score": "0.55297065", "text": "CreateAccountBlock (pass) {\n var AES = require(\"crypto-js/aes\");\n var SHA256 = require(\"crypto-js/sha256\");\n var CryptoJS = require(\"crypto-js\");\n \n var decryptedpass = CryptoJS.AES.decrypt(pass,this.rhexa); \n var passwordblockchain=decryptedpass.toString(CryptoJS.enc.Utf8);\n\n if (typeof web3 !== 'undefined') {\n var web3 = new Web3(web3.currentProvider);\n} else {\n // set the provider you want from Web3.providers\n web3 = new Web3(new Web3.providers.HttpProvider(\"http://localhost:8545\"));\n}\nvar newaccount=web3.personal.newAccount(passwordblockchain);\n\nweb3.personal.unlockAccount(newaccount,passwordblockchain , 10);\nvar testrpcaccount=web3.eth.accounts[0];\n\nweb3.eth.sendTransaction({to:newaccount, from:testrpcaccount, value:web3.toWei(\"0.5\", \"ether\")})\nweb3.eth.defaultAccount =newaccount ;\nreturn newaccount ;\n\n}", "title": "" }, { "docid": "11c446adc768c87b2aec8868eb9a672a", "score": "0.5525486", "text": "setupNetChannel() {\n }", "title": "" }, { "docid": "5379e8e537309713165479ace541bace", "score": "0.55172545", "text": "static onconnect() {}", "title": "" }, { "docid": "e41142d66d5cf19dd3448c82a432f093", "score": "0.5504569", "text": "async function init() {\n console.log(\"listener is running\")\n\n // Config\n\n const web3 = new Web3('ws://127.0.0.1:9650/ext/bc/C/ws') // needs to be Arbitrum\n const networkId = await web3.eth.net.getId() //12345\n const addresses = await web3.eth.getAccounts()\n console.log([\"con data: \", networkId, addresses])\n\n /* Hedging Contract */\n\n const HCdeployedNetwork = HedgingContract.networks[networkId]\n const hedgingcontract = new web3.eth.Contract(\n HedgingContract.abi,\n HCdeployedNetwork.address\n )\n\n /* Events Listener */\n\n const ECdeployedNetwork = EventsContract.networks[networkId]\n const eventscontract = new web3.eth.Contract(\n EventsContract.abi,\n ECdeployedNetwork.address\n )\n\n // console.log(eventscontract.events.SwapEvent())\n\n // response logic\n eventscontract.events.SwapEvent().on('data', async (e) => {\n let dat = e.returnValues\n console.log([dat])\n\n // let fulfillrequest = await hedgincontract.methods\n // .fulfill(...)\n \n let gasAmount = await fulfillprice.estimateGas()\n await fulfillrequest.send({ from: addresses[0], gas: gasAmount })\n \n })\n}", "title": "" }, { "docid": "acf134ee13720d5267d3dca167e218ef", "score": "0.5498261", "text": "connect() {\n // Set needed nodes into the Wallet service\n this._Nodes.setDefault();\n this._Nodes.setUtil();\n // Change endpoint port to websocket port\n let endpoint = nem.model.objects.create(\"endpoint\")(this._Wallet.node.host, nem.model.nodes.websocketPort);\n // Create a connector\n let connector = nem.com.websockets.connector.create(endpoint, this._Wallet.currentAccount.address);\n // Try to open the connection \n this.openConnection(connector);\n return;\n }", "title": "" }, { "docid": "545cbd355e416547f7a2a270f9c021d7", "score": "0.547673", "text": "function getWeb3(callback) {\n if (typeof window.web3 === 'undefined') {\n // no web3, use fallback\n console.error(\"Please use a web3 browser\");\n var msgNotEthereum = \"You aren't connected to Oracles Network. Please, switch on Oracles plugin and refresh the page. Check Oracles network <a href='https://github.com/oraclesorg/oracles-wiki' target='blank'>wiki</a> for more info.\";\n showAlert(null, msgNotEthereum, \"warning\");\n callback(myWeb3, false);\n } else {\n // window.web3 == web3 most of the time. Don't override the provided,\n // web3, just wrap it in your Web3.\n var myWeb3 = new Web3(window.web3.currentProvider); \n\n // the default account doesn't seem to be persisted, copy it to our\n // new instance\n myWeb3.eth.defaultAccount = window.web3.eth.defaultAccount;\n\n checkNetworkVersion(myWeb3, function(isOraclesNetwork) {\n callback(myWeb3, isOraclesNetwork);\n });\n }\n}", "title": "" }, { "docid": "fe2df8bebaebda3d49e2c1310b10ae74", "score": "0.5444373", "text": "connect() {\n // Enable the network\n execSync( WPA_USER_PREFIX + '\"wpa_cli enable_network ' + this.id + '\"' );\n // Select the network\n execSync( WPA_USER_PREFIX + '\"wpa_cli select_network ' + this.id + '\"' );\n }", "title": "" }, { "docid": "eb2964375cd9c3643a6073ef4a123a50", "score": "0.54301983", "text": "checkWeb3Status() {\n let web3 = getInjectedWeb3();\n return web3.eth.net.isListening().then(listening => {\n if (!listening) {\n return this.props.dispatch({ type: \"SET_DISCONNECTED\" });\n }\n\n return web3.eth.net.getNetworkType().then(id => {\n this.props.dispatch({ type: \"SET_NETWORK_ID\", networkId: id });\n\n return web3.eth.getAccounts().then(accounts => {\n if (accounts.length != this.props.accounts.length || accounts[0] != this.props.accounts[0]) {\n this.props.dispatch({ type: \"SET\", accounts });\n }\n this.props.dispatch({ type: \"SET_CONNECTED\" });\n });\n });\n });\n }", "title": "" }, { "docid": "647eafacb91f4e9eb6bbcbac09cd29ab", "score": "0.54296505", "text": "function onConnect () {\n\n}", "title": "" }, { "docid": "cf9220182a1bd72ef6be996974eca7ad", "score": "0.5413258", "text": "async function setupAccount (web3) {\n // let accounts = await web3.eth.getAccounts()\n let user = await web3.eth.personal.newAccount('password')\n await web3.eth.personal.unlockAccount(config.etc.address, config.etc.password)\n await web3.eth.sendTransaction({\n to: user,\n from: config.etc.address,\n value: 2e18\n })\n return user\n}", "title": "" }, { "docid": "e1c9a64a2c115e9b075b5b1159506e55", "score": "0.53954554", "text": "async function checkNetworkVersion(web3, cb) {\n var msgNotOracles = \"You aren't connected to Oracles network. Please, switch on Oracles plugin and choose Oracles network. Check Oracles network <a href='https://github.com/oraclesorg/oracles-wiki' target='blank'>wiki</a> for more info.\";\n let config = await getConfig()\n web3.eth.net.getId().then(function(connectedNetworkID) {\n console.log(\"connectedNetworkID: \" + connectedNetworkID);\n connectedNetworkID = parseInt(connectedNetworkID);\n switch (connectedNetworkID) {\n case 1: {\n console.log('This is mainnet');\n swal(\"Warning\", msgNotOracles, \"warning\"); \n return false;\n } break;\n case 2: {\n console.log('This is the deprecated Morden test network.');\n swal(\"Warning\", msgNotOracles, \"warning\");\n return false;\n } break;\n case 3: {\n console.log('This is the ropsten test network.');\n swal(\"Warning\", msgNotOracles, \"warning\");\n return false;\n } break;\n case config.networkID: {\n console.log('This is Oracles from Metamask');\n return true;\n } break;\n default: {\n console.log('This is an unknown network.');\n swal(\"Warning\", msgNotOracles, \"warning\");\n return false;\n } break;\n }\n })\n}", "title": "" }, { "docid": "06f80983b1a91783e81e97b5a2487241", "score": "0.5373542", "text": "setWeb3Instance(web3, address) {\n this.setState({\n web3: web3,\n address: web3.utils.toChecksumAddress(address)\n });\n\n this.goToMainMenu();\n }", "title": "" }, { "docid": "8e0d0db5e85b2361444d0614b81cf8fd", "score": "0.53548133", "text": "async enableNetwork() {\n this.networkEnabled = !0, this.Zc() && (this.ol.lastStreamToken = await this.Gc.jo(), \n this.cl() ? this.ll() : this.el.set(\"Unknown\" /* Unknown */), \n // This will start the write stream if necessary.\n await this._l());\n }", "title": "" }, { "docid": "dde3e84fc13fc46a7da2d74481b8ef5d", "score": "0.5333921", "text": "function initializeMobileFabric() {\n if (kony.net.isNetworkAvailable(constants.NETWORK_TYPE_ANY)) {\n kony.application.showLoadingScreen(\"loadskin\", \"Initializing...\", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, {\n enableMenuKey: true,\n enableBackKey: true,\n progressIndicatorColor: \"ffffff77\"\n });\n mobileFabricConfiguration.konysdkObject = new kony.sdk();\n mobileFabricConfiguration.konysdkObject.init(mobileFabricConfiguration.appKey, mobileFabricConfiguration.appSecret, mobileFabricConfiguration.serviceURL, SuccessResponse, FailureResponse);\n } else alert(\"Network not available. Please check your network settings or try agiain after some time\");\n}", "title": "" }, { "docid": "79ccb9f771df8aedadecdb4b640624d3", "score": "0.53281295", "text": "constructor(web3, contract, prover) {\n this.web3 = web3;\n this.contract = contract;\n this.prover = prover;\n }", "title": "" }, { "docid": "de2f95a04c9988de2adfbf68389afc3c", "score": "0.53228664", "text": "start(){debug('start()');if(this._status===C.STATUS_INIT){this._transport.connect();}else if(this._status===C.STATUS_USER_CLOSED){debug('restarting UA');// Disconnect.\nif(this._closeTimer!==null){clearTimeout(this._closeTimer);this._closeTimer=null;this._transport.disconnect();}// Reconnect.\nthis._status=C.STATUS_INIT;this._transport.connect();}else if(this._status===C.STATUS_READY){debug('UA is in READY status, not restarted');}else{debug('ERROR: connection is down, Auto-Recovery system is trying to reconnect');}// Set dynamic configuration.\nthis._dynConfiguration.register=this._configuration.register;}", "title": "" }, { "docid": "0fab872b209b9e1fbd080238e8d5a5e9", "score": "0.53228474", "text": "componentDidMount() {\n getWeb3\n .then(results => {\n this.setState({web3: results.web3}, this.instantiateContract);\n this.state.web3.currentProvider.publicConfigStore.on('update', this.instantiateContract);\n })\n .catch(() => console.log('Error finding web3'));\n }", "title": "" }, { "docid": "f9543b9ab509959bab96c320bc632834", "score": "0.5321394", "text": "connect() {\n new WorldManager(this);\n //this.worldManager.debug = true; // multi-user debug info\n //this.worldManager.VRSPACE.debug = true; // network debug info\n //this.worldManager.remoteLogging = true;\n this.worldManager.enter({mesh:'//www.vrspace.org/babylon/dolphin.glb'}).then(() => {\n // we don't really need to do anything here\n });\n }", "title": "" }, { "docid": "51929806bf92ed1346deebd498a69f70", "score": "0.5318127", "text": "teleopInit() {}", "title": "" }, { "docid": "b88797d0638b531b856b620c47d94954", "score": "0.53098863", "text": "set provider(provider) {\n this.web3 = new Web3(provider);\n }", "title": "" }, { "docid": "9567e5519e67b8436106113b4c35a55c", "score": "0.53065985", "text": "connect() {}", "title": "" }, { "docid": "9567e5519e67b8436106113b4c35a55c", "score": "0.53065985", "text": "connect() {}", "title": "" }, { "docid": "9567e5519e67b8436106113b4c35a55c", "score": "0.53065985", "text": "connect() {}", "title": "" }, { "docid": "9567e5519e67b8436106113b4c35a55c", "score": "0.53065985", "text": "connect() {}", "title": "" }, { "docid": "12e6d6009d8134e249ecb24c4dc0878b", "score": "0.53065777", "text": "function start() {\n if (!node) {\n const options = {\n libp2p: {\n modules: {\n connProtector: new Protector(swarmKeyBuffer)\n },\n\t\tconfig: {\n\t\t dht: {\n\t\t enabled: false\n\t\t }\n\t\t}\n\t },\n config: {\n\t Bootstrap: [\n '/dns4/wss1.ethofs.com/tcp/443/wss/ipfs/QmTcwcKqKcnt84wCecShm1zdz1KagfVtqopg1xKLiwVJst',\n '/dns4/wss.ethofs.com/tcp/443/wss/ipfs/QmPW8zExrEeno85Us3H1bk68rBo7N7WEhdpU9pC9wjQxgu',\n '/dns4/wss2.ethofs.com/tcp/443/wss/ipfs/QmUEy4ScCYCgP6GRfVgrLDqXfLXnUUh4eKaS1fDgaCoGQJ',\n '/dns4/wss5.ethofs.com/tcp/443/wss/ipfs/QmRwQ49Zknc2dQbywrhT8ArMDS9JdmnEyGGy4mZ1wDkgaX',\n '/dns4/wss6.ethofs.com/tcp/443/wss/ipfs/QmaGGSUqoFpv6wuqvNKNBsxDParVuGgV3n3iPs2eVWeSN4',\n '/dns4/wss7.ethofs.com/tcp/443/wss/ipfs/QmRYw68MzD4jPvner913mLWBdFfpPfNUx8SRFjiUCJNA4f',\n '/dns4/wss8.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ'\n ],\n\t\tAddresses: {\n Swarm: [\n '/dns4/wss1.ethofs.com/tcp/443/wss/ipfs/QmTcwcKqKcnt84wCecShm1zdz1KagfVtqopg1xKLiwVJst',\n '/dns4/wss.ethofs.com/tcp/443/wss/ipfs/QmPW8zExrEeno85Us3H1bk68rBo7N7WEhdpU9pC9wjQxgu',\n '/dns4/wss2.ethofs.com/tcp/443/wss/ipfs/QmUEy4ScCYCgP6GRfVgrLDqXfLXnUUh4eKaS1fDgaCoGQJ',\n '/dns4/wss5.ethofs.com/tcp/443/wss/ipfs/QmRwQ49Zknc2dQbywrhT8ArMDS9JdmnEyGGy4mZ1wDkgaX',\n '/dns4/wss6.ethofs.com/tcp/443/wss/ipfs/QmaGGSUqoFpv6wuqvNKNBsxDParVuGgV3n3iPs2eVWeSN4',\n '/dns4/wss7.ethofs.com/tcp/443/wss/ipfs/QmRYw68MzD4jPvner913mLWBdFfpPfNUx8SRFjiUCJNA4f',\n '/dns4/wss8.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ'\n ]\n }\n }\n }\n node = new IPFS(options)\n node.once('start', () => {\n node.id()\n .then((id) => {\n info = id\n subscribeToHealthChannel()\n updateView('ready', node)\n onSuccess('Node is ready.')\n setInterval(refreshPeerList, 10000)\n setInterval(sendFileList, 10000)\n })\n .catch((error) => onError(error))\n })\n }\n}", "title": "" }, { "docid": "fde2f1b3e4da8ed3eb4d4c0685fcd9a4", "score": "0.5301316", "text": "onConnect() {\n }", "title": "" }, { "docid": "164a71e9bb8627fed361c6adbab2f19c", "score": "0.5300316", "text": "async function mainFunction() {\n\t\n const bridge = \"https://bridge.walletconnect.org/\";\n\n const providerOptions = {\n walletconnect: {\n package: WalletConnectProvider,\n options: {\n //Old, free AW Infura key; leaked many times - you will want to replace this with your own, but it might just work\n infuraId: \"c7df4c29472d4d54a39f7aa78f146853\",\n\t\trpc: {\n\t\t\t4: \"https://rinkeby-light.eth.linkpool.io\",\n\t\t }\n }\n }\n };\n\n web3Modal = new Web3Modal({\n network: \"rinkeby\", // optional\n cacheProvider: false, // optional\n disableInjectedProvider: false,\n providerOptions:providerOptions // required\n });\n\n console.log(\"Web3Modal instance is\", web3Modal);\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n \n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n \n const msg = \"0x48656c6c6f20416c7068612057616c6c6574\";\n const hashedPersonalMessage = \"0x582630440bdcc1fc11820b947b7f3dd8e798b739150e1995eaaf230e86bb1009\"; //hash of the signPersonalMessage\n\n //pull sig out of args\n var sigHex = getUrlVars()[\"signature\"];\n\n const recovered = web3.eth.accounts.recover(hashedPersonalMessage, sigHex, true);\n \n console.log('recovering...')\n const msgParams = { data: msg }\n msgParams.sig = sigHex\n console.dir({ msgParams })\n \n if (recovered == selectedAccount)\n {\n\t document.querySelector(\"#signature-result\").textContent = \"Pass! \" + recovered;\n }\n else\n {\n\t document.querySelector(\"#signature-result\").textContent = \"Fail: \" + recovered;\n }\n \n}", "title": "" }, { "docid": "5778e1bf06b493c5ac8a44cb53dc1b3b", "score": "0.52984333", "text": "connect() {\n this._tmiClient.connect();\n }", "title": "" }, { "docid": "f3ace9f02d728a46c446454cbed84e59", "score": "0.52980137", "text": "async function ethNodeConnect(web3Obj, providerUrl, isRetry) {\n if (isRetry) {\n retryStatus = true;\n logger.info('Re-Connection start..');\n await sleep(60 * 1000);\n }\n \n const provider = new Web3.providers.WebsocketProvider(providerUrl);\n\n provider.on('end', () => fetchEvent(web3Obj, providerUrl, true));\n provider.on('error', () => fetchEvent(web3Obj, providerUrl, true));\n\n web3Obj.setProvider(provider);\n logger.info('New Web3 Provider Initiated');\n\n return Promise.resolve(web3Obj);\n}", "title": "" }, { "docid": "6f24005075e4aa00091e8f28d633aaea", "score": "0.5293303", "text": "fetchWeb3Instance() {\n return new Promise(function (resolve, reject) {\n var provider = web3.currentProvider\n if (typeof provider === 'undefined') {\n // Use local provider\n provider = new Web3(new Web3.providers.HttpProvider('https://localhost:8545'))\n } else {\n // Use Mist/MetaMask's provider\n provider = new Web3(provider)\n }\n resolve(provider)\n })\n }", "title": "" }, { "docid": "c1349472732a4666b2300b3931ed0fb5", "score": "0.52919483", "text": "connect() {\n let connector = this._Connector.create({\n 'uri': this._Wallet.node\n }, this._Wallet.currentAccount.address);\n this._DataBridge.openConnection(connector);\n }", "title": "" }, { "docid": "e0229a0840f1ac7398e0b25cc773efc7", "score": "0.52771014", "text": "async start() {\n var _a, _b;\n await this.lbApp.start();\n const port = (_a = this.lbApp.restServer.config.port) !== null && _a !== void 0 ? _a : 3000;\n const host = (_b = this.lbApp.restServer.config.host) !== null && _b !== void 0 ? _b : 'localhost';\n this.server = this.webApp.listen(port, host);\n await events_1.once(this.server, 'listening');\n const add = this.server.address();\n this.url = `http://${add.address}:${add.port}`;\n }", "title": "" }, { "docid": "776a5643f7ef4706244fd9b7ed1f2d86", "score": "0.5263373", "text": "get allowMultiConnect() {\n return false;\n }", "title": "" }, { "docid": "a855ac221e1a64110669588d1b693e8b", "score": "0.5258715", "text": "async function useAccount(address){\n return await web3FromAddress(address); \n}", "title": "" }, { "docid": "8496faba6bac9775ebd49c7edc686cac", "score": "0.52569294", "text": "startClient () { }", "title": "" }, { "docid": "0eedbb6b2a22031764661e5fc6cb661a", "score": "0.52491057", "text": "async initPolkadotRPC() {\n this.api = new ApiPromise({\n provider: new WsProvider(\n this.network.rpc_url || this.network.public_rpc_url\n )\n })\n this.store.polkadotRPC = this.api\n this.store.polkadotRPCOpened = Date.now()\n await this.api.isReady\n console.log('Polkadot initialized')\n }", "title": "" }, { "docid": "c13138d0b0327e929b1f2a6d189b5500", "score": "0.52455634", "text": "static setupNetworkConnection () {\n Network.genericRemoveAllListeners (Network.eventTypes.CONNECTION_CHANGE);\n Network.genericAddListenerNetInfo (Network.eventTypes.CONNECTION_CHANGE, Network.changeNetworkStatus);\n }", "title": "" }, { "docid": "0cbba2b279e145f56fa34320f2d21b1e", "score": "0.52410066", "text": "function switchToHooked3(_keystore) {\n\n\tconsole.log(\"switchToHooked3\");\n\n\tvar web3Provider = new HookedWeb3Provider({\n\t host: \"http://localhost:8545\", // check what using in truffle.js\n\t transaction_signer: _keystore\n\t});\n\n\tweb3.setProvider(web3Provider);\n}", "title": "" }, { "docid": "4ab62129a5582b755d42efb30c919cb9", "score": "0.5237275", "text": "function doAllConnections() {\n // called only after reverb and cabinet sim could load and\n // decode impulses\n\n // Build web audio graph, set default preset\n buildGraph();\n initPresets();\n // setDefaultPreset();\n console.log(\"running\");\n }", "title": "" }, { "docid": "ed4888ea25cab7c6d94b1cf5747b312c", "score": "0.5221132", "text": "connect() { }", "title": "" }, { "docid": "68e4cabf8bb371cdb5d65c903adab0c8", "score": "0.52129555", "text": "async function loadBlockchainData() {\n loadWeb3();\n const web3 = window.web3;\n // Load cuurent account\n // const accounts = await web3.eth.getAccounts();\n // setAccount(accounts[0]);\n const networkId = await web3.eth.net.getId();\n // console.log(\"networkId\", networkId);\n //Infrachain.json : get networks after truffle migration\n const networkData = Infrachain.networks[networkId];\n if (networkData) {\n const contract = web3.eth.Contract(Infrachain.abi, networkData.address);\n //add Contract to State\n setContract(contract);\n } else {\n window.alert(\"Smart contract not deployed to detected network.\");\n }\n }", "title": "" }, { "docid": "719460288789946d4e983416097cd49a", "score": "0.5208713", "text": "function main() {\n init();\n enable();\n}", "title": "" }, { "docid": "22d9b3fc3e9115de6fa57c435e3eb7b9", "score": "0.5201049", "text": "function remoteManageDevices() {\n\n console.log(\"* remoteManageDevices() \"+tools.humanDateER(\"\"));\n // Activation\n if (type == \"pilote-typeA\") {\n local_ButtonDevices.disabled = false;\n }\n local_AudioSelect.disabled = false;\n local_VideoSelect.disabled = false;\n\n // Invite de formulaire...\n document.getElementById(\"piloteDevices\").className = \"insideFlex oneQuarterbox pilote devices shadowGreen devicesInvite\";\n}", "title": "" }, { "docid": "27e4f5b53de8776f4d0bb51efa5dadd4", "score": "0.5196228", "text": "async start () { }", "title": "" }, { "docid": "7e42870a201213281befa64651d4dfba", "score": "0.519333", "text": "async loadBlockchainData() {\n console.log(\"init web3\");\n let web3;\n if (window.ethereum) {\n web3 = new Web3(window.ethereum);\n window.ethereum.enable();\n }\n else web3 = new Web3(Web3.givenProvider);\n this.contractISUSD = new web3.eth.Contract(abiLoanToken, loanTokenSUSD);\n this.contractIRBTC = new web3.eth.Contract(abiLoanToken, loanTokenRBTC);\n this.contractTokenSUSD = new web3.eth.Contract(abiTestToken, testTokenSUSD);\n this.contractTokenRBTC = new web3.eth.Contract(abiTestToken, testTokenRBTC);\n const accounts = await web3.eth.getAccounts();\n this.web3 = web3;\n this._isMounted && this.setState({ account: accounts[0] });\n }", "title": "" }, { "docid": "d8489259b5df8c04f6c7357564978693", "score": "0.5181055", "text": "componentDidMount()\n {\n\n const payload = {\n url: '127.0.0.1:7545',\n network: 'homestead',\n }\n\n this.props.ethersNewProviderJsonRpcRequest({\n payload\n })\n\n }", "title": "" }, { "docid": "997d49b048fcd37c1a237ff45a35d705", "score": "0.51744473", "text": "async function loadBlockchainData(){\n try {\n const web3 = new Web3(Web3.givenProvider || \"http://localhost:8545\");\n await Web3.givenProvider.enable();\n //call setups for web3 and contract\n web3Setup(web3);\n console.log(\"Web3 successfully injected in browser\");\n const contract = new web3.eth.Contract(TRACKER_ABI, TRACKER_ADDRESS);\n contractSetup(contract);\n console.log(\"Contract Initialized = \", contract);\n let getTransactionCount = await contract.methods.getTransactionCount().call();\n console.log(\"Transactions available = \", getTransactionCount);\n // loop through available transactions to instantiate object and add it in the array\n for(var i = 0 ; i < getTransactionCount; i++){\n const{amount, transactionDetails, owner} = await contract.methods.transaction(i).call();\n let transactionObject = {\n amount: parseInt(amount),\n transactionDetails,\n owner\n }\n console.log(\"Checking Transaciton Obj\", transactionObject);\n // add obj in transaction array\n addTransaction(transactionObject);\n }\n \n } catch(e){\n alert(\"Please Install MetaMask to continue.\")\n console.log(\"Web3 injection unsuccessful\", e);\n }\n }", "title": "" }, { "docid": "8afe61099fe71ad7f5642e227b3845a8", "score": "0.516862", "text": "function App() {\n const [eth, setEth] = useState({});\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n const init = async () => {\n try {\n const web3 = await getWeb3();\n const accounts = await web3.eth.getAccounts();\n const networkId = await web3.eth.net.getId();\n\n const tokenNetwork = CustomToken.networks[networkId];\n const tokenInstance = new web3.eth.Contract(CustomToken.abi, tokenNetwork && tokenNetwork.address);\n\n const tokenSaleNetwork = CustomTokenSale.networks[networkId];\n const tokenSaleInstance = new web3.eth.Contract(CustomTokenSale.abi, tokenSaleNetwork && tokenSaleNetwork.address);\n\n const kycNetwork = KycContract.networks[networkId];\n const kycInstance = new web3.eth.Contract(KycContract.abi, kycNetwork && kycNetwork.address);\n\n const projectFNetwork = ProjectFactory.networks[networkId];\n const projectFInstance = new web3.eth.Contract(ProjectFactory.abi, projectFNetwork && projectFNetwork.address);\n\n setEth({\n web3: web3,\n accounts: accounts,\n tokenInstance: tokenInstance,\n tokenSaleInstance: tokenSaleInstance,\n kycInstance: kycInstance,\n projectFInstance: projectFInstance,\n projectFAddress: projectFNetwork.address,\n });\n } catch (error) {\n alert(`Failed to load web3, accounts, or contract. Check console for details.`);\n console.error(error);\n }\n };\n init();\n }, []);\n\n useEffect(() => {\n // This is optional\n // Making sure everything is ready before loading the page\n // 1. The object must exists\n // 2. The object must have at least one element\n // 3. The contract instance object must have an address set | instance['_address'] (otherwise it means that the user is using a diff. network)\n const { web3, accounts, tokenInstance, tokenSaleInstance, kycInstance, projectFInstance } = eth;\n const isWeb3Valid = typeof web3 !== \"undefined\" && Object.keys(web3).length !== 0;\n const isAccountValid = typeof accounts !== \"undefined\" && Object.keys(accounts).length !== 0;\n const isTokenInstanceValid = typeof tokenInstance !== \"undefined\" && Object.keys(tokenInstance).length !== 0;\n const isTokenSaleInstanceValid = typeof tokenSaleInstance !== \"undefined\" && Object.keys(tokenSaleInstance).length !== 0;\n const isKycInstanceValid = typeof kycInstance !== \"undefined\" && Object.keys(kycInstance).length !== 0;\n const isProjectFInstanceValid = typeof projectFInstance !== \"undefined\" && Object.keys(projectFInstance).length !== 0;\n if (\n isWeb3Valid &&\n isAccountValid &&\n isTokenInstanceValid &&\n isTokenSaleInstanceValid &&\n isKycInstanceValid &&\n isProjectFInstanceValid\n ) {\n setIsLoading(false);\n }\n }, [eth]);\n\n if (isLoading) {\n return <Loading />;\n }\n\n return (\n <EthContext.Provider value={eth}>\n <Router>\n <Switch>\n <Route path=\"/buy\" exact>\n <Tokens />\n </Route>\n <Route path=\"/admin\" exact>\n <Admin />\n </Route>\n <Route path=\"/\">\n <Home />\n </Route>\n </Switch>\n </Router>\n </EthContext.Provider>\n );\n}", "title": "" }, { "docid": "35cfb1fd7905abd4ade85d2865c3faa3", "score": "0.5168149", "text": "onNetworkChange() {\n window.addEventListener(\"load\", function () {\n if (window.ethereum) {\n // Reload browser on Web3 Network change\n window.ethereum.on('chainChanged', (_chainId) => window.location.reload());\n }\n });\n }", "title": "" }, { "docid": "0848a5a08cdc0a443c5013b9c0961cda", "score": "0.51410705", "text": "function addGenerator (Blockly) {\n //网络微数据库初始化\n Blockly.Arduino.QDP_network_microdatabase_initialization = function() {\n var ssid= Blockly.Arduino.valueToCode(this, 'ssid', Blockly.Arduino.ORDER_ATOMIC);\n var pass= Blockly.Arduino.valueToCode(this, 'pass', Blockly.Arduino.ORDER_ATOMIC);\n Blockly.Arduino.definitions_[\"include_HTTPClient\"] = '#if defined(ESP32)\\n#include <HTTPClient.h>\\n#elif defined(ESP8266)\\n#include <ESP8266HTTPClient.h>\\n#endif\\n';\n Blockly.Arduino.definitions_[\"include_ESPHTTPClient\"] = 'String Nutzername = '+ ssid +';\\nString Passwort = '+ pass +';\\n';\n var code='';\n return code;\n };\n\n Blockly.Arduino.QDP_web_microdatabase_update_tags = function() {\n var tag= Blockly.Arduino.valueToCode(this, 'tag', Blockly.Arduino.ORDER_ATOMIC);\n var value= Blockly.Arduino.valueToCode(this, 'value', Blockly.Arduino.ORDER_ATOMIC);\n var code='if (WiFi.status() == WL_CONNECTED) {\\n'\n +' HTTPClient http;\\n'\n +' http.begin(\"http://tinywebdb.appinventor.space/api?user=\"+Nutzername+\"&secret=\"+Passwort+\"&action=update&tag=\"+String('+ tag +')+\"&value=\"+String('+ value +'));\\n'\n +' http.addHeader(\"Content-Type\", \"application/json\");\\n'\n +' int httpCode = http.POST(\"Message from ESP8266\");\\n'\n +' String payload = http.getString();\\n'\n +' Serial.println(payload);\\n'\n +' http.end();\\n'\n +'} else {\\n'\n +' Serial.println(\"Invalid response!\");\\n'\n +'}\\n';\n return code;\n };\n\n Blockly.Arduino.QDP_web_microdatabase_delete_tags = function() {\n var tag= Blockly.Arduino.valueToCode(this, 'tag', Blockly.Arduino.ORDER_ATOMIC);\n var code='if (WiFi.status() == WL_CONNECTED) {\\n'\n +' HTTPClient http;\\n'\n +' http.begin(\"http://tinywebdb.appinventor.space/api?user=\"+Nutzername+\"&secret=\"+Passwort+\"&action=delete&tag=\"+String('+ tag +'));\\n'\n +' http.addHeader(\"Content-Type\", \"application/json\");\\n'\n +' int httpCode = http.POST(\"Message from ESP8266\");\\n'\n +' String payload = http.getString();\\n'\n +' Serial.println(payload);\\n'\n +' http.end();\\n'\n +'} else {\\n'\n +' Serial.println(\"Invalid response!\");\\n'\n +'}\\n';\n return code;\n };\n\n Blockly.Arduino.QDP_web_microdatabase_get_tags = function() {\n var tag= Blockly.Arduino.valueToCode(this, 'tag', Blockly.Arduino.ORDER_ATOMIC);\n Blockly.Arduino.definitions_[\"include_web_microdatabase_get_tags\"] = 'String web_microdatabase_get_tags(String Tag) {\\n'\n +' String payload;\\n' \n +' if (WiFi.status() == WL_CONNECTED) {\\n'\n +' HTTPClient http;\\n'\n +' http.begin(\"http://tinywebdb.appinventor.space/api?user=\"+Nutzername+\"&secret=\"+Passwort+\"&action=get&tag=\" + String(Tag));\\n'\n +' http.addHeader(\"Content-Type\", \"application/json\");\\n'\n +' int httpCode = http.POST(\"Message from ESP8266\");\\n'\n +' payload = http.getString();\\n'\n +' Serial.println(payload);\\n'\n +' http.end();\\n'\n +' } else {\\n'\n +' Serial.println(\"Invalid response!\");\\n'\n +' return \"\";\\n'\n +' }\\n' \n +' payload.replace(String(\"{\\\\\"\") + String(Tag) + String(\"\\\\\": \\\\\"\"), \"\");\\n'\n +' payload.replace(\"\\\\\"}\", \"\");\\n' \n +' return payload;\\n'\n +'}\\n';\n var code='web_microdatabase_get_tags('+ tag +')';\n return [code, Blockly.Arduino.ORDER_ATOMIC];\n};\n\nBlockly.Arduino.QDP_web_microdatabase_count_tags = function() {\n Blockly.Arduino.definitions_[\"include_web_microdatabase_count_tags\"] = 'String web_microdatabase_count_tags() {\\n'\n +' String payload;\\n' \n +' if (WiFi.status() == WL_CONNECTED) {\\n'\n +' HTTPClient http;\\n'\n +' http.begin(\"http://tinywebdb.appinventor.space/api?user=\"+Nutzername+\"&secret=\"+Passwort+\"&action=count\");\\n'\n +' http.addHeader(\"Content-Type\", \"application/json\");\\n'\n +' int httpCode = http.POST(\"Message from ESP8266\");\\n'\n +' payload = http.getString();\\n'\n +' Serial.println(payload);\\n'\n +' http.end();\\n'\n +' } else {\\n'\n +' Serial.println(\"Invalid response!\");\\n'\n +' return \"\";\\n'\n +' }\\n' \n +' payload.replace(String(\"{\\\\\"count\\\\\": \\\\\"\"), \"\");\\n'\n +' payload.replace(\"\\\\\"}\", \"\");\\n' \n +' return payload;\\n'\n +'}\\n';\n var code='web_microdatabase_count_tags()';\n return [code, Blockly.Arduino.ORDER_ATOMIC];\n};\n\n return Blockly;\n}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.5140579", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.5140579", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.5140579", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.5140579", "text": "function Network() {}", "title": "" }, { "docid": "a4caa9bd06046ce21bed54d81f9660e2", "score": "0.51369756", "text": "async function setup () {\n try {\n // Get config parameters\n cfg = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'conf/config.json')))\n console.log('Read the JSON config file')\n\n // Get the connection profile\n profile = JSON.parse(fs.readFileSync(path.resolve(__dirname, cfg.connection_profile)))\n\n // Create a new file system wallet for managing identities\n const walletPath = path.resolve(__dirname, cfg.wallet_location)\n wallet = await Wallets.newFileSystemWallet(walletPath)\n console.log(`Wallet path: ${walletPath}`)\n\n // Enroll an admin, if configured (recommended for dev/test only)\n if (cfg.enroll_admin === 'true') {\n console.log(`Enrolling admin user: ${cfg.admin_name}`)\n await enrollAdmin()\n }\n\n // Register a user, if configured (recommended for dev/test only)\n if (cfg.register_user === 'true') {\n console.log(`Registering user: ${cfg.user_name}`)\n await registerUser()\n }\n\n // Add NATS subscribers, if configured\n if (cfg.use_nats === 'true') {\n console.log(`Configuring NATS subscribers`)\n await subscribe()\n }\n\n // Make sure we have a registered user\n const identity = await wallet.get(cfg.user_name)\n if (!identity) {\n console.log(`An identity for the user ${cfg.user_name} does not exist in the wallet`)\n process.exit(1)\n }\n\n // Create a new gateway for connecting to our peer node\n const use_disc = process.env.INITIALIZE_WITH_DISCOVERY || cfg.use_discovery\n const as_local = process.env.DISCOVERY_AS_LOCALHOST || cfg.as_local_host\n const enabled = true ? use_disc === 'true' : false\n const asLocalhost = true ? as_local === 'true' : false\n console.log(`Discovery enabled = ${enabled} asLocalhost = ${asLocalhost}`)\n const gateway = new Gateway()\n await gateway.connect(profile, { wallet, identity: cfg.user_name, discovery: { enabled, asLocalhost } })\n\n // Get the network (channel) our contract is deployed to\n const network = await gateway.getNetwork(cfg.channel)\n\n // Get the contract from the network\n contract = network.getContract(cfg.contract)\n console.log('Connected to the blockchain')\n } catch (error) {\n console.error(`Failed to set up the fabric client: ${error}`)\n process.exit(1)\n }\n}", "title": "" }, { "docid": "daa70329af9e98cfffb77caf75550961", "score": "0.5127092", "text": "function Web (data) {\n Atomic.call(this, data)\n}", "title": "" } ]
5c7c8cba45f7ba886d460fed4050018b
a function that gathers tile data within a box formation (5 points; 1st = user >> calculate the starting point based on fixed set of tiles in distance from user >> mark the scan position i.e a=topLeft/ScanStartPoint and gather tile data from x amount of tiles on the X axis and y amount of tiles on the Y axis. Both should have the same value in the case of a box formation create a list of Players,Monsters,Objects, and tile types with their x,y, and z cords to be added to a global array to be accessed
[ { "docid": "d690b897a797506452cfe199a2a001ed", "score": "0.0", "text": "function Warp(){}", "title": "" } ]
[ { "docid": "a04e4d90273dc0484ede196e65ebe2fe", "score": "0.6538742", "text": "boundingBox() {\n let boxes = [];\n\n this.iterateOverTiles((tile, currX, currY) => {\n // empty tiles should not be included\n if (tile !== \"0\") {\n let bb;\n\n if (tile === \"1\") {\n bb = new BoundingBox(\n currX,\n currY,\n 0.6875 * this.tileWidth,\n 0.6875 * this.tileHeight\n );\n } else if (tile === \"2\") {\n bb = new BoundingBox(currX, currY, this.tileWidth, 0.5 * this.tileHeight);\n } else if (tile === \"3\") {\n bb = new BoundingBox(\n currX + 0.3125 * this.tileWidth,\n currY,\n 0.6875 * this.tileWidth,\n 0.6875 * this.tileHeight\n );\n } else if (tile === \"4\") {\n bb = new BoundingBox(currX, currY, 0.5 * this.tileWidth, this.tileHeight);\n } else if (tile === \"5\") {\n bb = new BoundingBox(\n currX + 0.5 * this.tileWidth,\n currY,\n 0.5 * this.tileWidth,\n this.tileHeight\n );\n } else if (tile === \"6\") {\n bb = new BoundingBox(\n currX + 0.5 * this.tileWidth,\n currY + 0.5 * this.tileHeight,\n 0.5 * this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else if (tile === \"7\") {\n bb = new BoundingBox(\n currX,\n currY + 0.5 * this.tileHeight,\n 0.5 * this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else if (tile === \"8\") {\n bb = new BoundingBox(\n currX,\n currY + 0.5 * this.tileHeight,\n this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else if (tile === \"9\") {\n bb = new BoundingBox(\n currX,\n currY,\n 0.5 * this.tileWidth,\n this.tileHeight\n );\n } else if (tile === \"10\") {\n bb = new BoundingBox(\n currX + 0.5 * this.tileWidth,\n currY,\n 0.5 * this.tileWidth,\n this.tileHeight\n );\n } else if (tile === \"11\") {\n bb = new BoundingBox(\n currX + 0.5 * this.tileWidth,\n currY,\n 0.5 * this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else if (tile === \"12\") {\n bb = new BoundingBox(\n currX,\n currY,\n this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else if (tile === \"13\") {\n bb = new BoundingBox(\n currX,\n currY,\n 0.5 * this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else if (tile === \"14\") {\n bb = new BoundingBox(\n currX,\n currY + 0.3125 * this.tileHeight,\n 0.6875 * this.tileWidth,\n 0.6875 * this.tileHeight\n );\n } else if (tile === \"15\") {\n bb = new BoundingBox(\n currX + 0.3125 * this.tileHeight,\n currY + 0.3125 * this.tileHeight,\n 0.6875 * this.tileWidth,\n 0.6875 * this.tileHeight\n );\n } else if (tile === \"16\") {\n bb = new BoundingBox(\n currX,\n currY + 0.5 * this.tileHeight,\n this.tileWidth,\n 0.5 * this.tileHeight\n );\n } else {\n bb = new BoundingBox(currX, currY, this.tileWidth, this.tileHeight);\n }\n\n boxes.push(bb);\n }\n });\n\n return boxes;\n }", "title": "" }, { "docid": "7be12b713b325fb8ba11cf33bd19a483", "score": "0.6245033", "text": "function findAccessibleTiles(room, x1, y1, x2, y2){\n var tiles = { available: 0.0, total:0 };\n for (var x = x1, xl = x2+1; x < xl; x++){\n for (var y = y1, yl = y2+1; y < yl; y++){\n //console.log(JSON.stringify(room.lookAt(x, y)));\n var tile = room.lookAt(x, y);\n for (var propertyid in tile) {\n if(tile[propertyid].type == \"source\"){\n break;\n } else if (tile[propertyid].type == \"creep\"){\n tiles.available--; tiles.total++;\n } else if (tile[propertyid].terrain == 'plain') {\n tiles.available++; tiles.total++;\n } else if (tile[propertyid].terrain == 'swamp') {\n tiles.available += 0.5; tiles.total++;\n }\n }\n\n }\n }\n return tiles;\n}", "title": "" }, { "docid": "a779f632d0ad0ea204e836ddf0ffc199", "score": "0.608014", "text": "function scanbox(x, y) {\n\n var values = [];\n var count = 0;\n\n //Gets which 3x3 box its in\n x = Math.floor(x / 3);\n y = Math.floor(y / 3);\n\n for (var j = (y * 3); j <= (y * 3 + 2); j++) {\n\n for (var i = (x * 3); i <= (x * 3 + 2); i++) {\n values[count] = puzzle[j][i];\n count++;\n }\n }\n return values;\n}", "title": "" }, { "docid": "397e217f12993fa947fc63e2927275b8", "score": "0.58304244", "text": "getTouchingSolidTiles () {\n\t\tlet boundaries = this.getBoundaries();\n\n\t\tlet touchingSolidTiles = [];\n\n\t\tif (this.map.isSolidTileAtXY(boundaries.left, boundaries.top)) {\n\t\t\t// tile at top left\n\t\t\ttouchingSolidTiles.push({\n\t\t\t\t// find col/row, multiply by 60, then subtract sideLength/2\n\t\t\t\tx: (Math.floor(boundaries.left/60))*60+30,\n\t\t\t\ty: (Math.floor(boundaries.top/60))*60+30,\n\t\t\t\twidth: 60,\n\t\t\t\theight: 60\n\t\t\t});\n\t\t}\n\t\tif (this.map.isSolidTileAtXY(boundaries.right, boundaries.top)) {\n\t\t\t// tile at top right\n\t\t\ttouchingSolidTiles.push({\n\t\t\t\tx: (Math.floor(boundaries.right/60))*60+30,\n\t\t\t\ty: (Math.floor(boundaries.top/60))*60+30,\n\t\t\t\twidth: 60,\n\t\t\t\theight: 60\n\t\t\t});\n\t\t}\n\t\tif (this.map.isSolidTileAtXY(boundaries.left, boundaries.bottom)) {\n\t\t\t// tile at bottom left\n\t\t\ttouchingSolidTiles.push({\n\t\t\t\tx: (Math.floor(boundaries.left/60))*60+30,\n\t\t\t\ty: (Math.floor(boundaries.bottom/60))*60+30,\n\t\t\t\twidth: 60,\n\t\t\t\theight: 60\n\t\t\t});\n\t\t}\n\t\tif (this.map.isSolidTileAtXY(boundaries.right, boundaries.bottom)) {\n\t\t\t// tile at bottom right\n\t\t\ttouchingSolidTiles.push({\n\t\t\t\tx: (Math.floor(boundaries.right/60))*60+30,\n\t\t\t\ty: (Math.floor(boundaries.bottom/60))*60+30,\n\t\t\t\twidth: 60,\n\t\t\t\theight: 60\n\t\t\t});\n\t\t}\n\n\t\treturn touchingSolidTiles;\n\t}", "title": "" }, { "docid": "83ca8855e8c1583bd8b26ad0bb79ba32", "score": "0.5829253", "text": "function makeTiled(pen, makeTileFnc, array, boxBox, xNum, yNum, percentBuffer) {\n var width = boxBox.w / (xNum);\n var height = boxBox.h / (yNum);\n\n var xPos = boxBox.x + width * percentBuffer;\n var yPos = boxBox.y + height * percentBuffer;\n\n var drawnWidth = width * (1 - 2 * percentBuffer);\n var drawnHeight = height * (1 - 2 * percentBuffer);\n\n for (var key in array) {\n var value = array[key];\n if (xPos > boxBox.x + boxBox.w) {\n xPos = boxBox.x + width * percentBuffer;\n yPos += height;\n }\n\n if (makeTileFnc(value, pen, new Rect(xPos, yPos, drawnWidth, drawnHeight)))\n xPos += width;\n }\n}", "title": "" }, { "docid": "1b235191560570438be1201c41f8ccd0", "score": "0.5818683", "text": "function Bucket()\n {\n var\n container = [],\n tileNumbers = new Vec2D( 10, 10 ),\n tileSize = new Vec2D( 100, 100 ); // dummy values - will be updated later\n \n /**\n * Look up Bucket ID by position.\n * @param {Vec2D} position\n */\n function getBucketID2D( position ){\n //console.log( 'Bucket - getBucketID2D', position );\n return position.copy().cdiv( tileSize ).floor();\n }\n \n /**\n * Calculate one dimensional ID out of ID2D.\n */\n function getBucketID( ID2D )\n {\n //console.log( 'Bucket - getBucketID', ID2D, container );\n if( ID2D.x < tileNumbers.x && ID2D.y < tileNumbers.y )\n return ID2D.x + ID2D.y * tileNumbers.x;\n \n return container.length - 1;\n }\n \n /**\n * Empty the Bucket.\n */\n this.clear = function() {\n //console.log( 'Bucket - clear' );\n container.length = tileNumbers.x * tileNumbers.y + 1;\n \n for( var i = 0, len = container.length; i < len; i++ )\n {\n if( Array.isArray( container[i] ) )\n container[i].length = 0;\n else\n container[i] = [];\n };\n };\n \n /**\n * Debug function: draw tiles\n */\n this.draw = function( ctx, scale ) {\n var \n context = ctx[0],\n transform = ctx[1];\n \n context.beginPath();\n for( var x = 0; x < tileNumbers.x; x++ )\n {\n context.moveTo( scale * x * tileSize.x, 0 );\n context.lineTo( scale * x * tileSize.x, scale * tileNumbers.y * tileSize.y );\n }\n for( var y = 0; y < tileNumbers.y; y++ )\n {\n context.moveTo( 0 , scale * y * tileSize.y );\n context.lineTo( scale * tileNumbers.x * tileSize.x, scale * y * tileSize.y );\n }\n context.stroke();\n for( var x = 0; x < tileNumbers.x; x++ )\n {\n for( var y = 0; y < tileNumbers.y; y++ )\n {\n context.fillText( container[x+y*tileNumbers.x].length, scale * (x+0.5)*tileSize.x, scale * (y+0.5)*tileSize.y );\n }\n }\n };\n \n /**\n * Fill the Bucket based on a list of elements.\n * @param list {Array}\n * @param maxSize {Vec2D} the maximum size to care for\n */\n this.fill = function( list, maxSize ) {\n this.clear();\n tileSize.replace( maxSize ).cdiv( tileNumbers );\n \n list.forEach( this.insert );\n };\n \n /**\n * Look up elements in Bucket tile by position.\n * @param {Vec2D} position\n * @return {Array} List of elements\n */\n this.getElements = function( position ){\n return container[ getBucketID( getBucketID2D( position ) ) ];\n };\n \n /**\n * Look up all elements within an area.\n * @param {Vec2D} topLeft\n * @param {Vec2D} bottomRight\n * @return {Array} List of elements\n */\n this.getElementsInArea = function( topLeft, bottomRight ) {\n var\n tl = getBucketID2D( topLeft ),\n br = getBucketID2D( bottomRight ),\n ret_array = [];\n \n for( var x = tl.x; x <= br.x; x++ )\n {\n for( var y = tl.y; y <= br.y; y++ )\n {\n container[ x + y * tileNumbers.x ].forEach( function( element ){\n if( -1 === ret_array.indexOf( element ) )\n ret_array.push( element );\n });\n }\n }\n \n return ret_array;\n };\n \n /**\n * Insert a single element in the Bucket\n */\n this.insert = function( element ){\n var\n tl = getBucketID2D( element.getTopLeft() ),\n br = getBucketID2D( element.getBottomRight() );\n \n for( var pos = tl.copy(); pos.x <= br.x; pos.x++ )\n for( pos.y = tl.y; pos.y <= br.y; pos.y++ )\n container[ getBucketID( pos ) ].push( element );\n };\n \n // Constructor:\n this.clear();\n }", "title": "" }, { "docid": "1b6d5df3203ca7ad0846987c4a05c913", "score": "0.5806198", "text": "generateCells(ifield, time) {\n\n if (ifield > this.fieldArray.lenght - 1)\n return;\n\n if (time > this.timeSteps[ifield])\n return;\n\n this.cellArray = [];\n switch (this.gridType) {\n\n\n\n\n case 3: //\"UNSTRUCTURED_GRID\"\n\n return 0;\n\n case 1: //STRUCTURED_POINTS //return 0;\n case 2: //\"STRUCTURED_GRID\"\n case 5: //\"RECTILINEAR_GRID\"\n\n var xyDim = this.dimensionX*this.dimensionY;\n var xyzDim = this.dimensionX*this.dimensionY*this.dimensionZ;\n var xyCellDim = (this.dimensionX-1)*(this.dimensionY-1);\n var xyzCellDim = (this.dimensionX-1)*(this.dimensionY-1)*(this.dimensionZ-1);\n var xCellDim = this.dimensionX-1;\n\n var tmp3D = this.is3D;\n\n if(tmp3D && this.dimensionZ==1){\n tmp3D=false;\n }\n if (tmp3D) {\n\n /////////////////////////////////////////////\n //////////// 3D\n /////////////////////////////////////////////\n\n ////////////////////////////////////////////////////////////////\n // front and back plane\n\n for (var y = 0; y < this.dimensionY - 1; y++) {\n for (var x = 0; x < this.dimensionX - 1; x++) {\n\n /////////////////////////////////////////////\n // back -> first z\n var indexArray = [x + y * this.dimensionX,\n (x + 1) + y * this.dimensionX,\n (x + 1) + (y + 1) * this.dimensionX,\n x + (y + 1) * this.dimensionX\n ];\n\n var averageValue;\n\n if (this.fieldType[ifield]) {\n // cell values\n averageValue = this.fieldArray[ifield][x + y * xCellDim + time * xyzCellDim];\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][x + y * this.dimensionX + time * xyzDim]+\n this.fieldArray[ifield][(x + 1) + y * this.dimensionX+ time * xyzDim]+\n this.fieldArray[ifield][(x + 1) + (y + 1) * this.dimensionX+ time * xyzDim]+\n this.fieldArray[ifield][x + (y + 1) * this.dimensionX+ time * xyzDim])/4;\n\n\n }\n\n var tmpCell = new class_Cell(indexArray, averageValue, 1, this.fieldType[ifield]);\n this.cellArray.push(tmpCell);\n\n /////////////////////////////////////////////\n // front -> last z\n\n var lastZIndex = this.dimensionZ- 1;\n indexArray = [x + y * this.dimensionX + lastZIndex*xyDim,\n (x + 1) + y * this.dimensionX+ lastZIndex*xyDim,\n (x + 1) + (y + 1) * this.dimensionX+ lastZIndex*xyDim,\n x + (y + 1) * this.dimensionX+ lastZIndex*xyDim\n ];\n\n\n\n if (this.fieldType[ifield]) {\n // cell values\n averageValue = this.fieldArray[ifield][x + y * xCellDim + (lastZIndex-1)* xyCellDim + time * xyzCellDim];\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][x + y * this.dimensionX + lastZIndex*xyDim + time * xyzDim]+\n this.fieldArray[ifield][(x + 1) + y * this.dimensionX+ lastZIndex*xyDim + time * xyzDim]+\n this.fieldArray[ifield][(x + 1) + (y + 1) * this.dimensionX+ lastZIndex*xyDim + time * xyzDim]+\n this.fieldArray[ifield][x + (y + 1) * this.dimensionX+ lastZIndex*xyDim + time * xyzDim])/4;\n\n //averageValue=500;\n }\n\n var tmpCell2 = new class_Cell(indexArray, averageValue, 1, this.fieldType[ifield]);\n this.cellArray.push(tmpCell2);\n\n }\n }\n\n\n ////////////////////////////////////////////////////////////\n // left and right side plane\n for (var y = 0; y < this.dimensionY - 1; y++) {\n for (var z = 0; z < this.dimensionZ - 1; z++) {\n\n // left -> first x\n var indexArray = [y * this.dimensionX + z*xyDim,\n y * this.dimensionX+ (z+1)*xyDim,\n (y + 1) * this.dimensionX+ (z+1)*xyDim,\n (y + 1) * this.dimensionX+ z*xyDim\n ];\n\n var averageValue;\n if (this.fieldType[ifield]) {\n // cell values\n\n averageValue = this.fieldArray[ifield][y * xCellDim + z*xyDim + time * xyzCellDim];\n\n\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][y * this.dimensionX + time * xyzDim]+\n this.fieldArray[ifield][y * this.dimensionX+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][(y + 1) * this.dimensionX+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][(y + 1) * this.dimensionX+ z*xyDim+ time * xyzDim])/4;\n }\n\n var tmpCell = new class_Cell(indexArray, averageValue, 1, this.fieldType[ifield]);\n this.cellArray.push(tmpCell);\n\n /////////////////////////////////////////////\n // right -> last x\n var lastXIndex = this.dimensionX- 1;\n indexArray = [lastXIndex+y * this.dimensionX + z*xyDim,\n lastXIndex+y * this.dimensionX+ (z+1)*xyDim,\n lastXIndex+(y + 1) * this.dimensionX+ (z+1)*xyDim,\n lastXIndex+(y + 1) * this.dimensionX+ z*xyDim\n ];\n\n\n if (this.fieldType[ifield]) {\n // cell values\n averageValue = this.fieldArray[ifield][(lastXIndex-1) + y * xCellDim + z* xyCellDim + time * xyzCellDim];\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][lastXIndex + y * this.dimensionX + time * xyzDim]+\n this.fieldArray[ifield][lastXIndex+y * this.dimensionX+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][lastXIndex+(y + 1) * this.dimensionX+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][lastXIndex+(y + 1) * this.dimensionX+ z*xyDim+ time * xyzDim])/4;\n }\n\n var tmpCell2 = new class_Cell(indexArray, averageValue, 1, this.fieldType[ifield]);\n this.cellArray.push(tmpCell2);\n\n }}\n\n ////////////////////////////////////////////////////////////\n // top and bottom plane\n\n for (var x = 0; x < this.dimensionX - 1; x++) {\n for (var z = 0; z < this.dimensionZ - 1; z++) {\n\n // bottom -> first y\n var indexArray = [x + z*xyDim,\n x+ (z+1)*xyDim,\n (x + 1) + (z+1)*xyDim,\n (x + 1) + z*xyDim\n ];\n\n var averageValue;\n if (this.fieldType[ifield]) {\n // cell values\n averageValue = this.fieldArray[ifield][x + z*xyDim + time * xyzCellDim];\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][x + time * xyzDim]+\n this.fieldArray[ifield][x+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][(x + 1) + (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][(x + 1) + z*xyDim+ time * xyzDim])/4;\n }\n\n var tmpCell = new class_Cell(indexArray, averageValue, 1, this.fieldType[ifield]);\n this.cellArray.push(tmpCell);\n\n /////////////////////////////////////////////\n // top -> last y\n var lastYIndex = this.dimensionY- 1;\n\n var indexArray = [x +lastYIndex * this.dimensionX+ z*xyDim,\n x +lastYIndex * this.dimensionX+ (z+1)*xyDim,\n (x + 1) +lastYIndex * this.dimensionX+ (z+1)*xyDim,\n (x + 1) +lastYIndex * this.dimensionX+ z*xyDim\n ];\n\n\n if (this.fieldType[ifield]) {\n // cell values\n averageValue = this.fieldArray[ifield][x + (lastYIndex-1) * xCellDim + z* xyCellDim + time * xyzCellDim];\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][x + lastYIndex * this.dimensionX + time * xyzDim]+\n this.fieldArray[ifield][x+lastYIndex * this.dimensionX+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][(x + 1)+lastYIndex * this.dimensionX+ (z+1)*xyDim+ time * xyzDim]+\n this.fieldArray[ifield][(x + 1)+lastYIndex * this.dimensionX+ z*xyDim+ time * xyzDim])/4;\n }\n\n var tmpCell2 = new class_Cell(indexArray, averageValue, 3, this.fieldType[ifield]);\n this.cellArray.push(tmpCell2);\n\n }}//*/\n\n\n } else {\n\n /////////////////////////////////////////////\n //////////// 2D\n /////////////////////////////////////////////\n\n for (var y = 0; y < this.dimensionY - 1; y++) {\n for (var x = 0; x < this.dimensionX - 1; x++) {\n\n // cell points\n var indexArray = [x + y * this.dimensionX,\n (x + 1) + y * this.dimensionX,\n (x + 1) + (y + 1) * this.dimensionX,\n x + (y + 1) * this.dimensionX\n ];\n\n var averageValue;\n if (this.fieldType[ifield]) {\n // cell values\n averageValue = this.fieldArray[ifield][x + (y * xCellDim) + time * xyCellDim];\n\n } else {\n // cell points\n averageValue = (this.fieldArray[ifield][x + y * this.dimensionX + time * xyDim]+\n this.fieldArray[ifield][(x + 1) + y * this.dimensionX + time * xyDim]+\n this.fieldArray[ifield][(x + 1) + (y + 1) * this.dimensionX + time * xyDim]+\n this.fieldArray[ifield][x + (y + 1) * this.dimensionX + time * xyDim])/4;\n }\n\n var tmpCell = new class_Cell(indexArray, averageValue, 1, this.fieldType[ifield]);\n\n\n\n this.cellArray.push(tmpCell);\n }\n\n }\n }\n\n return this.cellArray.length;\n case 4: // \"POLYDATA\"\n\n return 0;\n case 6: // \"FIELD\"\n\n return 0;\n default:\n return 0;\n }\n\n }", "title": "" }, { "docid": "fbd5537a5f3704e8f5e7592e98c0009e", "score": "0.5805669", "text": "function getCoordinatesFromSlot(slot)\n{\n var retArr = [];\n var ret1 = {x1: -1, y1: -1, x2: -1, y2: -1};\n retArr.push(ret1);\n\n if (slot < 12) { // top side\n if (slot < 6) { // left side\n ret1.x1 = leftHalfMinXCoord + triangleBase * slot;\n ret1.x2 = leftHalfMinXCoord + triangleBase * (slot + 1);\n } else { // right side\n ret1.x1 = rightHalfMinXCoord + triangleBase * (slot - 6);\n ret1.x2 = rightHalfMinXCoord + triangleBase * (slot - 6 + 1);\n }\n\n ret1.y1 = 0;\n ret1.y2 = boardHeight / 2;\n } else if (slot < 24) { // bottom side\n if (slot > 17) { // left side\n ret1.x1 = leftHalfMinXCoord + triangleBase * (23 - slot);\n ret1.x2 = leftHalfMinXCoord + triangleBase * (23 - slot + 1);\n } else { // right side\n ret1.x1 = rightHalfMinXCoord + triangleBase * (17 - slot);\n ret1.x2 = rightHalfMinXCoord + triangleBase * (17 - slot + 1);\n }\n\n ret1.y1 = boardHeight / 2;\n ret1.y2 = boardHeight;\n } else if (slot == pieceState.HIT_0) {\n // bouding box of the middle/top section\n ret1.x1 = leftHalfMaxXCoord;\n ret1.x2 = rightHalfMinXCoord;\n ret1.y1 = 0;\n ret1.y2 = boardHeight / 2;\n } else if (slot == pieceState.HIT_1) {\n // bouding box of the middle/bottom section\n ret1.x1 = leftHalfMaxXCoord;\n ret1.x2 = rightHalfMinXCoord;\n ret1.y1 = boardHeight / 2;\n ret1.y2 = boardHeight;\n } else if (slot == pieceState.PICKED_UP_0) {\n // bounding box of the left collection area\n ret1.x1 = 0;\n ret1.x2 = leftHalfMinXCoord;\n ret1.y1 = 0;\n ret1.y2 = boardHeight;\n } else if (slot == pieceState.PICKED_UP_1) {\n // bounding box of the right collection area\n ret1.x1 = rightHalfMaxXCoord;\n ret1.x2 = rightHalfMaxXCoord + piece;\n ret1.y1 = 0;\n ret1.y2 = boardHeight;\n }\n\n return retArr;\n}", "title": "" }, { "docid": "4a1a3d8065071838eb2511c643419049", "score": "0.57413566", "text": "function getTileArea(x,y){\n tArea = [];\n for(var i = 0; i < 10; i++){\n for(var j = 0; j < 7; j++){\n tArea.push(getTile(x+i, y+j));\n }\n }\n return tArea;\n}", "title": "" }, { "docid": "7c7949c3f4990b520a450cac9bf1e9e7", "score": "0.57328105", "text": "function initializeTileObjects(tileIDArray) {\r\nlet tileObjects = [];\r\nlet tileX = 0;\r\nlet tileY = 0;\r\n\r\n//go through array of ids and put the correct objects in the new array\r\nfor (let i = 0; i < tileIDArray.length; i++) {\r\n tileObjects.push(Object.assign({}, tileSelector(tileIDArray[i])));\r\n}\r\n\r\n//assigning the correct cordinates to the tiles\r\nfor (let i = 0; i < tileObjects.length; i++) {\r\n tileObjects[i].x = tileX;\r\n tileObjects[i].y = tileY;\r\n tileX += tileSize;\r\n\r\n//if it's a new line go down and over\r\n if (tileObjects[i].ID == \"nL\") {\r\n tileX = 0;\r\n tileY += tileSize;\r\n }\r\n\r\n}\r\n\r\nreturn tileObjects;\r\n}", "title": "" }, { "docid": "39ec7188808e932aaeaf68520ec64de6", "score": "0.57315254", "text": "createMainStage(width,height){\n let tiles = [];\n let placeholder = [];\n\n for (let count = 0; count < height; count++ ){\n placeholder.push(0);\n }\n for (let count2 = 0; count2< width; count2++){\n tiles.push(placeholder);\n }\n //Creates the walls for area that train will have to abide or die on the sides\n for (let count = 0; count<width; count++){\n tiles[count][0] = -1;\n tiles[count][height-1] = -1;\n }\n //Creates the walls for the top and bottom of the area that the train has to follow.\n for (let count = 0; count<height; count++){\n tiles[0][count] = -1;\n tiles[width-1][count] = -1;\n }\n return tiles;\n }", "title": "" }, { "docid": "21d579a15af5a0b7e411750f49761560", "score": "0.5725424", "text": "makeAllPeriodicBoxes() {\n const tableWidth = periodicTableInfo.length;\n let startingX = 0;\n const startingZ = 0;\n for (let i = 0; i < tableWidth; i++) {\n const tableColumn = periodicTableInfo[i];\n //console.log(tableColumn);\n let startingY = 0;\n for (let j = 0; j < tableColumn.length; j++) {\n const elementName = tableColumn[j];\n if (this.cubesWantedMap.get(elementName)) {\n this.makePeriodicBox({\n x: startingX,\n y: startingY,\n z: startingZ,\n }, elementName, i);\n }\n else {\n this.makeFinishedPeriodicBox({\n x: startingX,\n y: startingY,\n z: startingZ,\n }, elementName, i);\n }\n /*if (i > 1 && i < 12) {\n this.makeFinishedPeriodicBox({\n x: startingX,\n y: startingY,\n z: startingZ,\n }, elementName, i);\n } else {\n this.makePeriodicBox({\n x: startingX,\n y: startingY,\n z: startingZ,\n }, elementName, i);\n }*/\n startingY += periodBigBoxSize + margin;\n }\n startingX += periodBigBoxSize + margin;\n }\n }", "title": "" }, { "docid": "20223aee6026e83d299ac9f56b4cc9ad", "score": "0.5717343", "text": "function look_for_points(){\n console.log(\"look for points\");\n little_boxes = [];\n $(\".little_box\").each(function (i, box) {\n var i = $(this).index();\n var p = $(this).parent().index();\n if (!little_boxes[p]) {\n little_boxes[p] = [];\n }\n little_boxes[p][i] = $(this).attr(\"data-color\");\n $(this).attr(\"data-x\", p).attr(\"data-y\", i);\n });\n var xl = little_boxes.length;\n var found = false;\n for (var x = 0; x < xl; x++) {\n if(little_boxes[x]) {\n var lbl = little_boxes[x].length;\n for (var y = 0; y < lbl; y++) {\n if (\n little_boxes[x] && little_boxes[x][y] && little_boxes[x - 1] && little_boxes[x - 1][y] &&\n little_boxes[x + 1] && little_boxes[x + 1][y]\n ) {\n if (look_h_middle(x, y)) {\n found = 1;\n }\n }\n if (\n little_boxes[x] && little_boxes[x][y] && little_boxes[x][y + 1] && little_boxes[x][y - 1]\n ) {\n if (look_v_middle(x, y)) {\n found = 2;\n }\n }\n if (\n little_boxes[x] && little_boxes[x][y] && little_boxes[x - 1] && little_boxes[x - 1][y] &&\n little_boxes[x - 1][y - 1] && little_boxes[x][y - 1]\n ) {\n if (look_box_middle(x, y)) {\n found = 3;\n }\n }\n }\n }\n }\n $(\"#points\").html(\"Score: \" + points);\n switch(found){\n case 1:\n case 2:\n metal_clank.load();\n metal_clank.play();\n break;\n case 3:\n robot.load();\n robot.play();\n }\n }", "title": "" }, { "docid": "db5ec6c705dc9d40fde4007015544e51", "score": "0.56566167", "text": "function placeIt() {\n var start = [0,0];\n \n do {\n start[0] = rand(0, COLTILECOUNT-1, 1);\n start[1] = rand(0, ROWTILECOUNT-1, 1); \n } \n while(ground[start[1]][start[0]] === 130);\n \n return start;\n}", "title": "" }, { "docid": "cc253b44f4dc4a0a43eab35392409f26", "score": "0.5639858", "text": "function initTiles(){\n\t\tgetOffset(div);\n\t\tvar r, c, tile;\n\t\tmaskRect = {x:-border, y:-border, width:border * 2 + COLS * scale, height:trayDepth + border * 2 + ROWS * scale}\n\t\tfor(r = 0; r < ROWS; r++){\n\t\t\tslots[r] = [];\n\t\t\tfor(c = 0; c < COLS; c++){\n\t\t\t\tslots[r][c] = undefined;\n\t\t\t\ttile = new Tile(r, c, SPRITE_SHEET, maskRect);\n\t\t\t\ttile.update();\n\t\t\t\tdiv.appendChild(tile.div);\n\t\t\t\ttiles.push(tile);\n\t\t\t}\n\t\t}\n\t\trandomiseTiles();\n\t}", "title": "" }, { "docid": "a4145f9e1ecedd8ccdcc279a4e7b2781", "score": "0.5638066", "text": "function initiate() {\n // Create boxes and push to array \"arrObjects\"\n for (var i = 0; i < 9; i++) {\n var id = document.getElementById(i+1).id;\n var newBox = new boxObject(id, \"empty\", getX(i), getY(i));\n arrObjects.push(newBox);\n }\n console.log(arrObjects);\n \n inputSideBoxID = randomLocation();\n input = temp;\n input.highlight = true;\n while (input == temp) {\n outputSideBoxID = randomLocation();\n }\n output = temp;\n console.log(\"Input Box ID: \" + input.id + \n \"\\nOutput Box ID: \" + output.id +\n \"\\nInput Side Box ID: \" + inputSideBoxID + \n \"\\nOutput Side Box ID: \" + outputSideBoxID);\n \n highlightBoxes();\n \n randomProcessCond();\n\n // Highlight and display input and output process conditions\n var inputSideBox = document.getElementById(inputSideBoxID);\n inputSideBox.classList.add(\"sideHighlighted\");\n inputSideBox.innerHTML = \"<h3>Input<br>P: \" + inputPressure + \"<br>T: \" + inputTemperature + \"</h3>\";\n \n var outputSideBox = document.getElementById(outputSideBoxID);\n outputSideBox.classList.add(\"sideHighlighted\");\n outputSideBox.innerHTML = \"<h3>Output<br>P: \" + outputPressure + \"<br>T: \" + outputTemperature + \"</h3>\";\n \n}", "title": "" }, { "docid": "6b609cbefe542f8b999fac89fe6c92b2", "score": "0.5591275", "text": "getMinBox() {\n //get coordinates \n var coorX = this.coords.map(function (p) {\n return p.x\n });\n var coorY = this.coords.map(function (p) {\n return p.y\n });\n //find top left and bottom right corners \n var min_coords = {\n x: Math.min.apply(null, coorX),\n y: Math.min.apply(null, coorY)\n }\n var max_coords = {\n x: Math.max.apply(null, coorX),\n y: Math.max.apply(null, coorY)\n }\n\n //get the longest side of box\n var length = Math.max((max_coords.x - min_coords.x), (max_coords.y - min_coords.y))\n\n //get the center\n var min_coords_square = {\n x: min_coords.x + ((max_coords.x - min_coords.x) / 2.0) - (length / 2.0) - 5,\n y: min_coords.y + ((max_coords.y - min_coords.y) / 2.0) - (length / 2.0) - 5\n }\n\n var max_coords_square = {\n x: min_coords.x + ((max_coords.x - min_coords.x) / 2.0) + (length / 2.0) + 5,\n y: min_coords.y + ((max_coords.y - min_coords.y) / 2.0) + (length / 2.0) + 5\n }\n\n //return as struct \n return {\n min: min_coords_square,\n max: max_coords_square\n }\n }", "title": "" }, { "docid": "b6a834062a8d4194da4296229d9ea467", "score": "0.5587544", "text": "getHitbox() {\n\t\tlet hitbox = this.points.map(e => {\n\t\t\tlet {x,y} = rotateVector2d(e,this.r);\n\t\t\treturn {x: x+this.pos.x, y: y + this.pos.y};\n\t\t});\n\n\n\t\treturn hitbox;\n\t\t\n\t}", "title": "" }, { "docid": "224cd35e5abd5513aab1cb8b89db80c7", "score": "0.5546805", "text": "function populatePointZones(spacing) {\n for (var i = 0; i < columns; i++){\n var h = 70;\n var w = 5;\n var x = i * spacing - w / 2;\n var y = height - h / 2;\n var wall = new Boundary(x, y, w, h);\n boundaries.push(wall);\n }\n}", "title": "" }, { "docid": "b75a26e07d93498b264efe9d5eea02b9", "score": "0.5545775", "text": "getGrid() {\n const horTileNumber = TILE_PER_LINE;\n const verTileNumber = TILE_PER_LINE;\n\n const grid = [];\n\n const gridMap = this.getGridMap();\n\n for (let ver = 0; ver < verTileNumber; ver++) {\n grid[ver] = [];\n for (let hor = 0; hor < horTileNumber; hor++) {\n const tyleId = `${hor}-${ver}`;\n const type = gridMap[tyleId] || 'base';\n // console.log(\"tyleId\", tyleId);\n // console.log(\"type\", type);\n grid[ver][hor] = {\n size: TILE_SIZE,\n type,\n x: hor,\n y: ver\n };\n // center\n if (hor === 7 && ver === 7) {\n grid[ver][hor].type = 'wd';\n }\n // wt\n if (\n (hor === 0 && ver === 0) ||\n (hor === 7 && ver === 0) ||\n (hor === 14 && ver === 0) ||\n (hor === 0 && ver === 7) ||\n (hor === 14 && ver === 7) ||\n (hor === 0 && ver === 14) ||\n (hor === 7 && ver === 14) ||\n (hor === 14 && ver === 14)\n ) {\n grid[ver][hor].type = 'wt';\n }\n }\n }\n\n return grid;\n }", "title": "" }, { "docid": "4dfb9eed1f8f66bf645b42fe7ce81445", "score": "0.55385494", "text": "function rideNow()\n{\n var start = document.getElementById(\"fromArea\").value;\n var end = document.getElementById(\"toArea\").value; \n\n if(start == end)\n {\n alert(\"Starting and Ending point should not be same\");\n return ;\n }\n var type = document.getElementById(\"type\").value; \n var typenm = type.substr(0, 1);\n typenm = typenm.toUpperCase() + type.substr(1);\n\n var xpoint = areaNames[start][0];\n var ypoint = areaNames[start][1];\n\n var x1point = areaNames[end][0];\n var y1point = areaNames[end][1];\n\n //rounding the nearest x value and y value. For example, let consider box width is 270 and the x position of the areaname is 190, 190 now rounded by 270\n var mxVal = Math.ceil(parseFloat(areaNames[start][0])/xBoxValToRoundUp)*xBoxValToRoundUp; \n var myVal = Math.ceil(parseFloat(areaNames[start][1])/yBoxValToRoundUp)*yBoxValToRoundUp;\n\n var actX = mxVal, actY = myVal;\n var topLeftX = actX - xBoxValToRoundUp, topLeftY = actY - yBoxValToRoundUp;\n var startingX = 3; \n var bottomY = (yBoxValToRoundUp*(startingX-1))+topLeftY;\n var rightX = (xBoxValToRoundUp*(startingX-1))+topLeftX;\n \n var leftX = topLeftX;\n var addY = (actY == 0)?yBoxValToRoundUp:topLeftY;\n var myY = addY+yBoxValToRoundUp;\n\n var posibleAreas = [];\n \n posibleAreas.push(mxVal+\"\"+myVal);\n\n for(var i =1; i <= startingX; i++)\n {\n var m = topLeftX+\"\"+topLeftY;\n if(carsPositions.hasOwnProperty(m) && carsPositions[m].length > 0) posibleAreas.push(m)\n m = topLeftX+\"\"+bottomY;\n if(carsPositions.hasOwnProperty(m) && carsPositions[m].length > 0)posibleAreas.push(m);\n\n topLeftX+=xBoxValToRoundUp; \n\n if( i > 0 && i < startingX-1)\n {\n m = leftX+\"\"+myY;\n if(carsPositions.hasOwnProperty(m) && carsPositions[m].length > 0)posibleAreas.push(m);\n\n m = rightX+\"\"+myY;\n if(carsPositions.hasOwnProperty(m) && carsPositions[m].length > 0)posibleAreas.push(m);\n\n myY+=yBoxValToRoundUp;\n }\n }\n \n var preDistance = 10000000000;\n var selectedCar;\n var exactArea;\n var exactIndex;\n var flag = 0;\n for (var i in posibleAreas)\n {\n var carSelected = carsPositions[posibleAreas[i]];\n for(var j in carSelected)\n {\n if(myCars[carSelected[j]].status == \"rest\" && myCars[carSelected[j]].type == type)\n {\n var distance = checkDistance(xpoint,ypoint,myCars[carSelected[j]].position[0],myCars[carSelected[j]].position[1]);\n if(distance < preDistance )\n {\n exactArea = posibleAreas[i];\n selectedCar = carSelected[j];\n preDistance = distance;\n flag = 1;\n }\n }\n }\n }\n\n if(flag == 0)\n {\n for (var m in myCars)\n {\n if(myCars[m].status == \"rest\" && myCars[m].type == type )\n {\n var distance = checkDistance(xpoint,ypoint,myCars[m].position[0],myCars[m].position[1]);\n\n if(preDistance > distance)\n {\n preDistance = distance;\n selectedCar = m;\n flag = 2;\n }\n }\n }\n }\n \n if(flag == 2)\n {\n var m = Math.ceil(myCars[selectedCar].position[0]/xAxis)*xAxis;\n var n = Math.ceil(myCars[selectedCar].position[1]/yAxis)*yAxis;\n m = m+\"\"+n;\n exactArea = m;\n }\n var fromToDistance = checkDistance(xpoint,ypoint,x1point,y1point);\n\n if(flag == 0)\n {\n var customerName = gE(\"customer\").innerHTML;\n var forId = customerName.replace(/\\s+/,\"\");\n var myDiv = '<div class=\"customers\" id=\"'+forId+'\"><h4 class=\"error\">All cars are Busy</h4></div>'\n gE(\"statusOfCar\").insertAdjacentHTML(\"afterend\",myDiv)\n return;\n }\n\n var customerName = gE(\"customer\").innerHTML;\n var forId = customerName.replace(/\\s+/,\"\");\n var myDiv = '<div class=\"customers\" id=\"'+forId+'\"><h2>'+customerName+'</h2><h4>'+selectedCar+' started</h4><p>From: '+start+'</p><p>To: '+end+'</p><p>Type: '+typenm+'</p><p id=\"pri'+forId+'\"></p></div>'\n\n customerName = customerName.replace(/(\\d+)/,function(x){return ++x});\n gE(\"customer\").innerHTML = customerName;\n\n\n gE(\"statusOfCar\").insertAdjacentHTML(\"afterend\",myDiv)\n\n var Indx = carsPositions[exactArea].indexOf(selectedCar);\n if (Indx > -1) carsPositions[exactArea].splice(Indx, 1);\n \n myCars[selectedCar].status = \"driving\";\n\n drawPathAndStart(myCars[selectedCar].position[0],myCars[selectedCar].position[1],xpoint,ypoint,{x1:xpoint,y1:ypoint,x2:x1point,y2:y1point},\"n\");\n\n\n //checking the distance between two coordinate\n function checkDistance(x1,y1,x2,y2)\n { \n \n var \txs = x2 - x1,\n ys = y2 - y1;\t\t\n\n xs *= xs;\n ys *= ys;\n\n return Math.sqrt( xs + ys );\n // var ma = Math.sqrt((parseFloat(x1)-parseFloat(x2))^2+(parseFloat(y1)-parseFloat(y2))^2);\n // return ma;\n }\n\n //it will draw the path to go and it will trigger the driving\n function drawPathAndStart(x1,y1,x2,y2,nxtVal,vai)\n {\n createElement({tag:\"line\",placingTag:'mapArea',x1:x1,y1:y1,\"x2\":x2,\"y2\":y2,\"stroke-width\":\"0.4\",stroke:\"#3a3a3a\",\"stroke-dasharray\":\"5,5\",\"class\":\"showline\",\"id\":selectedCar+\"line\"});\n startDrive({x1:x1,y1:y1,x2:x2,y2:y2},vai,nxtVal);\n }\n\n //startDrive to move the position of cars for each car it will call twice. First time to go to the path second time to go the dropping area\n function startDrive(position,nY,goHere)\n {\n start = 0.1;\n var m = (position.y2-position.y1)/(position.x2-position.x1);\n var n = m * -position.x1;\n n = n + position.y1;\n var startPoint = position.x1;\n var posOrNeg = (position.x1 >= position.x2)?0:1;\n var carGp = document.getElementById(selectedCar+\"Grp\");\n var startDriving = new Promise(function(resolve,reject)\n {\n loop(startPoint);\n function loop(i)\n {\n if(posOrNeg == 0)\n {\n if(i > position.x2)\n {\n var y = m*i;\n y = n + y;\n carGp.setAttribute(\"transform\",'translate('+i+','+y+')');\n setTimeout(function(){\n loop(--i);\n },50)\n }\n else\n {\n resolve(\"success\");\n }\n \n }\n else if(posOrNeg == 1)\n {\n if(i < position.x2)\n {\n var y = m*i;\n y = n + y;\n carGp.setAttribute(\"transform\",'translate('+i+','+y+')');\n setTimeout(function(){\n loop(++i);\n },20)\n }\n else\n {\n resolve(\"success\");\n }\n }\n }\n });\n\n startDriving.then(function(drivingStatus)\n {\n if(nY == \"y\")\n {\n if(drivingStatus == \"success\")\n {\n var cost = Math.round(fromToDistance * 1);\n cost = (type == \"normal\")?cost:cost+5;\n\n myCars[selectedCar].status = \"rest\";\n\n myCars[selectedCar].totalRide += 1;\n myCars[selectedCar].totalEarned += cost;\n\n gE(\"pri\"+forId).innerHTML = \"Total Fare <b>\"+cost+\"</b>\";\n var m = Math.ceil(position.x2/xAxis)*xAxis;\n var n = Math.ceil(position.y2/yAxis)*yAxis;\n m = m+\"\"+n;\n myCars[selectedCar].position = [position.x2,position.y2];\n removeElement(selectedCar+\"line\");\n removeElement(selectedCar+\"line\");\n carsPositions[m].push(selectedCar);\n }\n }\n else\n {\n drawPathAndStart(goHere.x1,goHere.y1,goHere.x2,goHere.y2,\"\",\"y\")\n }\n });\n\n }\n}", "title": "" }, { "docid": "e44d9ac13bc24f2dc9b3bbf98bc0b79f", "score": "0.55220443", "text": "function getlookblock(){\n let searchpos = {};\n searchpos.x = gfx.camera.position.x;\n searchpos.y = gfx.camera.position.y;\n searchpos.z = gfx.camera.position.z;\n console.log(Math.floor(searchpos.x));\n console.log(Math.floor(searchpos.y));\n console.log(Math.floor(searchpos.z));\n\n \n for(let i = 0; i < 30; i++){\n searchpos.x += lookvector.x * i * 1; //using 0.2 increment for testing, this should be tested and heightened later\n searchpos.y += lookvector.y * i * 1;\n searchpos.z += lookvector.z * i * 1;\n\n console.log(Math.floor(searchpos.x));\n console.log(Math.floor(searchpos.y));\n console.log(Math.floor(searchpos.z));\n\n\n if(blocks[Math.floor(searchpos.x + 0.5)] != undefined){\n if(blocks[Math.floor(searchpos.x + 0.5)][Math.floor(searchpos.y + 0.5)] != undefined){\n if(blocks[Math.floor(searchpos.x + 0.5)][Math.floor(searchpos.y + 0.5)][Math.floor(searchpos.z + 0.5)] != undefined){\n console.log(\"block found\");\n addblock(Math.floor(searchpos.x + 0.5), Math.floor(searchpos.y + 0.5), Math.floor(searchpos.z + 0.5), \"select\");\n break;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "f8bfd37744ede12fe035859eda80c589", "score": "0.55145085", "text": "function getBox(o){return{xMin:o.position.x,xMax:o.position.x+o.width,yMin:o.position.y,yMax:o.position.y+o.height};}", "title": "" }, { "docid": "a15cd85c4decf1d593c593d2c82b6a48", "score": "0.5513758", "text": "loadSquares() {\n // Offset makes (27,28) the TL corner of the game board \n let x_pos = 27, y_pos = 28, count = 0;\n // The board is 15x15 tiles\n for(let i = 0; i < 15; i++) {\n for(let j = 0; j < 15; j++) {\n let square = this.add.image(x_pos, y_pos, 'empty-square').setInteractive();\n // Add listener for selecting a square on the board\n square.on('pointerup', ()=>{\n if(this.my_turn)\n this.placeTile(square);\n })\n this.board.push(square);\n // Each tile is 43x43 px with a 3px white border separating them\n x_pos += OFFSET;\n count++;\n }\n // Move to the next row of the board\n y_pos += OFFSET;\n x_pos = 27;\n }\n }", "title": "" }, { "docid": "aab535970afd0e74b010301b0d86c929", "score": "0.5513083", "text": "function findTouchingSquares(){\r\n\tvar theSquares = []\r\n\tif(rowCount > 1){\r\n\t\tif(squareCount > 1){\r\n\t\t\tsquare1 = \"container\" + (rowCount - 1) + \"square\" + (squareCount - 1);\r\n\t\t\ttheSquares.push(square1);\t\r\n\t\t}\r\n\t\tsquare2 = \"container\" + (rowCount - 1) + \"square\" + squareCount;\r\n\t\ttheSquares.push(square2);\r\n\t\tif(squareCount < 30){\r\n\t\t\tsquare3 = \"container\" + (rowCount - 1) + \"square\" + (squareCount + 1);\r\n\t\t\ttheSquares.push(square3);\t\r\n\t\t}\t\r\n\t}\r\n\tif(squareCount < 30){\r\n\t\tsquare4 = \"container\" + rowCount + \"square\" + (squareCount + 1);\r\n\t\ttheSquares.push(square4);\t\r\n\t}\r\n\tif(rowCount < 16){ \r\n\t\tif(squareCount < 30){\r\n\t\t\tsquare5 = \"container\" + (rowCount + 1) + \"square\" + (squareCount + 1);\r\n\t\t\ttheSquares.push(square5);\t\r\n\t\t}\r\n\t\tsquare6 = \"container\" + (rowCount + 1) + \"square\" + squareCount;\r\n\t\ttheSquares.push(square6);\r\n\t\tif(squareCount > 1){\r\n\t\t\tsquare7 = \"container\" + (rowCount + 1) + \"square\" + (squareCount - 1);\r\n\t\t\ttheSquares.push(square7);\t\r\n\t\t}\t\r\n\t}\r\n\tif(squareCount > 1){\r\n\t\tsquare8 = \"container\" + rowCount + \"square\" + (squareCount - 1);\r\n\t\ttheSquares.push(square8);\t\r\n\t}\r\n\t//Pushes all of the squares around the bomb square into two arrays. \r\n\tfor(var i = 0; i < theSquares.length; i++){\r\n\t\tif(bombSquares.includes(theSquares[i]) === false){\r\n\t\t\t//This pushes the touching square into the array once. \r\n\t\t\tif(squareListOnce.includes(theSquares[i]) === false){\r\n\t\t\t\tsquareListOnce.push(theSquares[i]);\r\n\t\t\t}\r\n\t\t\t//This pushes the touching square into the array as many times as it occoures. \r\n\t\t\tsquareListMultiple.push(theSquares[i])\t\t\t\t\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "18c8a38810709fcdb38aed3212f531af", "score": "0.55083454", "text": "_getTilePositions(tilePoints) {\n const [xDelta, yDelta] = this._getProbableDeltas(tilePoints)\n let origin\n let position\n return tilePoints.map(tilePoint => {\n [position, origin] = this._getTilePosition(\n tilePoint.point,\n origin,\n xDelta * 2.0,\n yDelta\n )\n return {\n id: tilePoint.id,\n position,\n tilegramValue: tilePoint.tilegramValue,\n }\n })\n }", "title": "" }, { "docid": "9871a2d23a1cdec576dfaca3ee88e9da", "score": "0.54996616", "text": "function Run()\r\n{\r\n alert(\"Hello! I am working!!!!!!!\");\r\n\r\n var point1 = theJSON.data[0];\r\n var point2 = theJSON.data[1];\r\n var point3 = theJSON.data[2];\r\n var point4 = theJSON.data[3];\r\n var point5 = theJSON.data[4];\r\n\r\n\r\n var data = [point1, point2, point3, point4, point5];\r\n\r\n console.log(data);\r\n\r\n\r\n\r\n var topLeftPoint = findTopLeft(data);\r\n var topRightPoint = findTopRight(data);\r\n var bottomLeftPoint = findBottomLeft(data);\r\n var bottomRightPoint = findBottomRight(data);\r\n\r\n // make an output object containing the corner points\r\n var boundingBox =\r\n {\r\n topLeft: topLeftPoint,\r\n topRight: topRightPoint,\r\n bottomLeft: bottomLeftPoint,\r\n bottomRight: bottomRightPoint\r\n }\r\n\r\n console.log(\"Bounding box computed for Alex.wave.king@tamu.edu: \");\r\n console.log(boundingBox);\r\n\r\n}", "title": "" }, { "docid": "fb32f2b09eff0594f8bd1ff9e14251e8", "score": "0.5475228", "text": "function tilePosition(x, y) {\n if (!y && typeof x === 'object') [x, y] = x;\n return {\n left: (x - 1) * 32 * scale + tf.pos[0],\n top: -(y - 300) * 32 * scale + tf.pos[1],\n };\n }", "title": "" }, { "docid": "bbfb860b4dd37a01f0ee34b355e7e0a5", "score": "0.5470369", "text": "function oneBlockPlacement() {\n for (var a = 0; a < 1; a++) {\n // random placement for row\n var rowVal = Math.floor(Math.random() * boardRows);\n // random placement for column/cell\n var colVal = Math.floor(Math.random() * boardCols);\n // while loop to ensure that a ship is not placed in duplicate positions\n while (shipCheck(rowVal, colVal) == true) {\n rowVal = Math.floor(Math.random() * boardRows);\n colVal = Math.floor(Math.random() * boardCols);\n };\n // placement of ship on board\n board[rowVal][colVal] = ship;\n // Adds a class to the ship location\n $(\"#cell\" + rowVal + colVal).addClass(\"ship\");\n // logs the ship location on the console for our reference. WILL REMOVE AT END.\n console.log(\"Ship #\" + (a + 1) + \" - row: \" + rowVal + \" col: \" + colVal);\n };\n // $(\"#submarine\").text(\"Submarine hits: \" + var + \" / 1\") // TODO need var to pull in hits function\n}", "title": "" }, { "docid": "c4cf951fb1a2be289c1a67761b7cf3ee", "score": "0.5467545", "text": "function CreateList(maxl, minl, NegHemi, PosHemi) {\n\tvar CoordList = new Array();\n\tif (Math.abs(maxl.valueOf() - minl.valueOf()) < 5) {//If user inputs are very close, only one tile needed\n\t\tCoordList.push(minl.valueOf());\n\t} else {//Otherwise, create list of needed tiles\n\t\tif (maxl.valueOf() < 0) {//If maximum coordinate is in positive hemisphere\n\t\t\tfor (var i = maxl.valueOf(), l = minl.valueOf() + 5; i < l; i += 5) {\n\t\t\t\tCoordList.push(i);\n\t\t\t}\n\t\t} else {//If maximum coordinate is in negative hemisphere\n\t\t\tfor (var i = minl.valueOf(), l = maxl.valueOf() + 5; i < l; i += 5) {\n\t\t\t\tCoordList.push(i);\n\t\t\t}\n\t\t}\n\t}\n\tfor (var i = 0; i < CoordList.length; i++) {//List coords as in EarthEnv_DEM90 filenames\n\t\tif (CoordList[i] < 0) {\n\t\t\tCoordList[i] = NegHemi + (Math.abs(CoordList[i])).toString();\n\t\t} else {\n\t\t\tCoordList[i] = PosHemi + (CoordList[i]).toString();\n\t\t}\n\t}\n\tglobalArray = CoordList;\n\t//Replace global array with output to return output array\n}", "title": "" }, { "docid": "b76b33848ad03d58e587eb4e8e548a0e", "score": "0.54646075", "text": "parsePlat(data) {\n var sceneWidth = this.sceneWidth;\n var sceneHeight = this.sceneHeight;\n\n for (var key in data) {\n var value = data[key];\n\n // Centering\n if (value == 'center') {\n // Horizontal\n if (key == 'x') {\n data[key] = sceneWidth / 2 - (data.width * this.tileWidth) / 2;\n }\n\n // Vertical\n if (key == 'y') {\n data[key] = sceneHeight / 2 - (data.height * this.tileHeight) / 2;\n }\n }\n\n // Positioning by percentage\n if (typeof value == 'string') {\n if (value.includes('%')) {\n var percentage = parseInt(value) / 100;\n\n // Horizontal\n if (key == 'x') {\n data[key] =\n sceneWidth * percentage - (data.width * this.tileWidth) / 2;\n }\n\n // Vertical\n if (key == 'y') {\n data[key] =\n sceneHeight * percentage - (data.height * this.tileHeight) / 2;\n }\n }\n }\n }\n return data;\n }", "title": "" }, { "docid": "7788b73da2765017386947463077143f", "score": "0.5462863", "text": "getSurroundingTiles(tileArray, initIndex) {\n //get the column (x) and row (y) from initIndex\n let x = initIndex%20;\n let y = Math.floor(initIndex/20);\n let hasBridge = false;\n let bridgeIndexes = [];\n\n let surroundingTiles = [];\n // //check north west\n // if (x - 1 >= 0 && y - 1 >= 0) {\n // if (tileArray[initIndex - 21].getName() != \"bridge\" && tileArray[initIndex - 21].infectable() && tileArray[initIndex - 21].getDead() === 0 && tileArray[initIndex - 21].getInfected() === 0) {\n // surroundingTiles.push(initIndex - 21);\n // }\n // }\n\n //check north\n if (y - 1 >= 0) {\n if(tileArray[initIndex - 20].getName() === \"bridge\" && tileArray[initIndex - 20].infectable()){\n hasBridge = true;\n bridgeIndexes.push(initIndex - 20);\n }\n else if (tileArray[initIndex - 20].infectable() && tileArray[initIndex - 20].getDead() === 0 &&\n tileArray[initIndex - 20].getInfected() === 0 && !tileArray[initIndex - 20].isQuarantined()) {\n surroundingTiles.push(initIndex - 20);\n }\n }\n // //check north east\n // if (x + 1 <= 19 && y - 1 >= 0) {\n // if (tileArray[initIndex - 19].getName() != \"bridge\" && tileArray[initIndex - 19].infectable() && tileArray[initIndex - 19].getDead() === 0 && tileArray[initIndex - 19].getInfected() === 0) {\n // surroundingTiles.push(initIndex - 19);\n // }\n // }\n\n //check west\n if (x - 1 >= 0) {\n if(tileArray[initIndex - 1].getName() === \"bridge\" && tileArray[initIndex - 1].infectable()){\n hasBridge = true;\n bridgeIndexes.push(initIndex - 1);\n }\n else if (tileArray[initIndex - 1].infectable() && tileArray[initIndex - 1].getDead() === 0 &&\n tileArray[initIndex - 1].getInfected() === 0 && !tileArray[initIndex - 1].isQuarantined()) {\n surroundingTiles.push(initIndex - 1);\n }\n }\n //check east\n if (x + 1 <= 19) {\n if(tileArray[initIndex + 1].getName() === \"bridge\" && tileArray[initIndex + 1].infectable()){\n hasBridge = true;\n bridgeIndexes.push(initIndex + 1);\n }\n else if (tileArray[initIndex + 1].infectable() && tileArray[initIndex + 1].getDead() === 0 &&\n tileArray[initIndex + 1].getInfected() === 0 && !tileArray[initIndex + 1].isQuarantined()) {\n surroundingTiles.push(initIndex + 1);\n }\n }\n // //check south west\n // if (x - 1 >= 0 && y + 1 <= 19) {\n // if (tileArray[initIndex + 19].getName() != \"bridge\" && tileArray[initIndex + 19].infectable() && tileArray[initIndex + 19].getDead() === 0 && tileArray[initIndex + 10].getInfected() === 0) {\n // surroundingTiles.push(initIndex + 19);\n // }\n // }\n //check south\n if (y + 1 <= 19) {\n if(tileArray[initIndex + 20].getName() === \"bridge\" && tileArray[initIndex + 20].infectable()){\n hasBridge = true;\n bridgeIndexes.push(initIndex + 20);\n }\n else if (tileArray[initIndex + 20].infectable() && tileArray[initIndex + 20].getDead() === 0 &&\n tileArray[initIndex + 20].getInfected() === 0 && !tileArray[initIndex + 20].isQuarantined()) {\n surroundingTiles.push(initIndex + 20);\n }\n }\n // //check south east\n // if (y + 1 <= 19 && x + 1 <= 19) {\n // if (tileArray[initIndex + 21].getName() != \"bridge\" && tileArray[initIndex + 21].infectable() && tileArray[initIndex + 21].getDead() === 0 && tileArray[initIndex + 21].getInfected() === 0) {\n // surroundingTiles.push(initIndex + 21);\n // }\n // }\n\n // check to see if hasBridge == true. if so, follow the bridge until we end up on land\n // we add the land we find to surrounding tiles if its not infected yet\n // (we only need to check north/south/east/west! convenient.)\n // for this check, we assume that:\n // 1) the bridge connects to land (aka doesnt go to the edge of the screen)\n // 2) the bridge selected is, in fact, infectable and not blocked off by an action\n // 3) the bridge is a straight line--it only goes north to south or west to east. no diagonal bridges allowed!\n\n if(hasBridge){\n //loop through how many bridge indexes we have\n for(let i = 0; i < bridgeIndexes.length; i++){\n //save the x and y pos of the bridges, just in case?\n let bridgeX = initIndex%20;\n let bridgeY = Math.floor(initIndex/20);\n let currentBridgeIndex = bridgeIndexes[i];\n\n let direction = 0; //saves the # we add to the index to find the next bridge/land tile\n //check north\n if(tileArray[currentBridgeIndex - 20].getName() === \"bridge\"){\n direction = -20;\n }\n //check west\n else if(tileArray[currentBridgeIndex - 1].getName() === \"bridge\"){\n direction = -1;\n }\n //check east\n else if(tileArray[currentBridgeIndex + 1].getName() === \"bridge\"){\n direction = 1;\n }\n //check south\n else if(tileArray[currentBridgeIndex + 20].getName() === \"bridge\"){\n direction = 20;\n }\n\n let nextTile = tileArray[currentBridgeIndex + direction];\n currentBridgeIndex = currentBridgeIndex + direction;\n\n //continue in the direction the bridge is heading until we find a tile is not a bridge tile\n while(nextTile.getName() === \"bridge\"){\n if(nextTile.isInfectable){\n nextTile = tileArray[currentBridgeIndex + direction];\n currentBridgeIndex = currentBridgeIndex + direction;\n }\n else{\n return surroundingTiles;\n }\n }\n\n //push the tile we've found to \"suroundingTiles\" array if no ones been infected yet\n if(nextTile.getDead() === 0 && nextTile.getInfected() === 0){\n surroundingTiles.push(currentBridgeIndex);\n }\n }\n }\n\n return surroundingTiles;\n }", "title": "" }, { "docid": "20ebf425dce44cd831e6655313dc27e8", "score": "0.54611963", "text": "function placeTile(x, y, tile, type, tier = 1) {\n if (checkPos(x, y) && canPlace(x, y, tile)) {\n let found = false;\n elements.forEach(e => { if (e.x == x && e.y == y) found = true });\n if (found) removeTile(x, y);\n switch (tile) {\n case SEED:\n switch (type) {\n case WILD: elements.push(Seed(x, y, size, WILD, tier)); break;\n case VIVID: elements.push(Seed(x, y, size, VIVID, tier)); break;\n case PRIMAL: elements.push(Seed(x, y, size, PRIMAL, tier)); break;\n }\n break;\n case COLLECTOR:\n switch (type) {\n case WILD: elements.push(Collector(x, y, size, WILD)); break;\n case VIVID: elements.push(Collector(x, y, size, VIVID)); break;\n case PRIMAL: elements.push(Collector(x, y, size, PRIMAL)); break;\n }\n break;\n case TANK:\n switch (type) {\n case WILD: elements.push(Tank(x, y, size, WILD)); break;\n case VIVID: elements.push(Tank(x, y, size, VIVID)); break;\n case PRIMAL: elements.push(Tank(x, y, size, PRIMAL)); break;\n }\n break;\n case DISPERSER:\n switch (type) {\n case WILD: elements.push(Disperser(x, y, size, WILD)); break;\n case VIVID: elements.push(Disperser(x, y, size, VIVID)); break;\n case PRIMAL: elements.push(Disperser(x, y, size, PRIMAL)); break;\n }\n break;\n case PYLON:\n switch (type) {\n case WILD: elements.push(Pylon(x, y, size, WILD)); break;\n case VIVID: elements.push(Pylon(x, y, size, VIVID)); break;\n case PRIMAL: elements.push(Pylon(x, y, size, PRIMAL)); break;\n }\n break;\n case WIRE:\n switch (type) {\n case WILD: elements.push(Wire(x, y, size, WILD)); break;\n case VIVID: elements.push(Wire(x, y, size, VIVID)); break;\n case PRIMAL: elements.push(Wire(x, y, size, PRIMAL)); break;\n }\n }\n updateURL();\n }\n}", "title": "" }, { "docid": "004e5ca6268d08390bb959429dd0e2cd", "score": "0.5453432", "text": "function createTilesN1() {\n\n let x = 230\n let y = 260\n let paddingX = 85\n\n carta4N1 = new Tile(1 * x + paddingX, 1 * y, carta4N1img, 2, 4)\n carta1N1 = new Tile(2 * x + paddingX, 1 * y, carta1N1img, 1, 1)\n carta3N1 = new Tile(3 * x + paddingX, 1 * y, carta3N1img, 2, 3)\n carta2N1 = new Tile(1 * x + paddingX, 2 * y, carta2N1img, 1, 2)\n carta6N1 = new Tile(2 * x + paddingX, 2 * y, carta6N1img, 9, 6)\n carta5N1 = new Tile(3 * x + paddingX, 2 * y, carta5N1img, 6, 5)\n\n tilesN1.push(carta1N1, carta2N1, carta3N1, carta4N1, carta5N1, carta6N1)\n\n}", "title": "" }, { "docid": "11006ca048f7625910c331ae78a95971", "score": "0.5448929", "text": "function computeTileInfo() {\n\tfor ( var i in grid ) {\n\t\tgrid[ i ].hiddenNear = 0;\n\t\tgrid[ i ].flaggedNear = 0;\n\t\tgrid[ i ].allHiddenNeighbours = [];\n\n\t\tvar centerX = grid[ i ].x;\n\t\tvar centerY = grid[ i ].y;\n\t\tvar cDiff = difficulties[ gameState.difficulty ];\n\n\t\tfor ( var py = centerY - 1; py <= centerY + 1; py++ )\n\t\t//if a neighboring tile was flagged or hidden, it will increase the respective counter for that tile and also add that hidden\n\t\t//tile to the 'allHiddenNeighbours' array for that tile\n\t\t{\n\t\t\tfor ( var px = centerX - 1; px <= centerX + 1; px++ ) {\n\t\t\t\tif ( px == centerX && py == centerY ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( px < 0 || py < 0 || px >= cDiff.width || py >= cDiff.height ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar idx = ( ( py * cDiff.width ) + px );\n\t\t\t\tif ( grid[ idx ].currentState === 'hidden' ) {\n\t\t\t\t\tgrid[ i ].hiddenNear += 1;\n\t\t\t\t\tgrid[ i ].allHiddenNeighbours.push( grid[ idx ] );\n\t\t\t\t}\n\t\t\t\tif ( grid[ idx ].currentState === 'flagged' ) {\n\t\t\t\t\tgrid[ i ].flaggedNear += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//code for adding a list of tiles that satisfy the condition of linkedTiles to that array and also taking care\n\t//of isLinked attribute for that tile\n\tfor ( var i in grid ) {\n\t\tvar centerX = grid[ i ].x;\n\t\tvar centerY = grid[ i ].y;\n\t\tvar cDiff = difficulties[ gameState.difficulty ];\n\n\t\tif ( grid[ i ].danger - grid[ i ].flaggedNear === 1 && grid[ i ].hiddenNear !== 1 ) {\n\t\t\tvar temp = [];\n\t\t\tfor ( py = centerY - 1; py <= centerY + 1; py++ ) {\n\t\t\t\tfor ( px = centerX - 1; px <= centerX + 1; px++ ) {\n\t\t\t\t\tif ( px == centerX && py == centerY ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( px < 0 || py < 0 || px >= cDiff.width || py >= cDiff.height )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar idx = ( ( py * cDiff.width ) + px );\n\t\t\t\t\tif ( grid[ idx ].currentState === 'hidden' ) {\n\t\t\t\t\t\ttemp.push( grid[ idx ] );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor ( py = centerY - 1; py <= centerY + 1; py++ ) {\n\t\t\t\tfor ( px = centerX - 1; px <= centerX + 1; px++ ) {\n\t\t\t\t\tif ( px == centerX && py == centerY ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( px < 0 || py < 0 || px >= cDiff.width || py >= cDiff.height )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar idx = ( ( py * cDiff.width ) + px );\n\t\t\t\t\tif ( grid[ idx ].currentState === 'hidden' ) {\n\t\t\t\t\t\tgrid[ idx ].linkedWith = [];\n\t\t\t\t\t\tfor ( var linkedIdx in temp ) {\n\t\t\t\t\t\t\tgrid[ idx ].linkedWith.push( temp[ linkedIdx ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgrid[ idx ].isLinked = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c4a2f82e46d4ff8460ab0c9486658eeb", "score": "0.5434001", "text": "setTile(x,y, data){\n if (0<x && x<this.width && 0<y && y<height){\n this.tiles[x][y] = data;\n }\n }", "title": "" }, { "docid": "6a0f45285304c0519301cd9bb9a65f00", "score": "0.543301", "text": "addOuterWalls(map) {\n \n for (var i = 0; i < this.width; i++){\n if (map[\"\"+0+i] === undefined) {\n map[\"\"+0+i] = { tile: 1, x: 0, y: i};\n } else {\n if ((map[\"\"+0+i].tile) % 2 != 1) {\n map[\"\"+0+i].tile += 1;//1\n }\n }\n }\n for (var i = 0; i < this.width; i++){\n var key = \"\"+ (this.width - 1) + i;\n if (map[key] === undefined) {\n map[key] = { tile: 4, x: 0, y: i};\n } else {\n if ((map[key].tile >> 2) % 2 != 1) {\n map[key].tile += 4; //4\n }\n }\n }\n for (var i = 0; i < this.height; i++){\n if (map[\"\"+i+0] === undefined) {\n map[\"\"+i+0] = { tile: 2, x: 0, y: i};\n } else {\n if ((map[\"\"+i+0].tile >> 1) % 2 != 1) {\n map[\"\"+i+0].tile += 2; //2\n }\n }\n }\n for (var i = 0; i < this.height; i++){\n var key = \"\" + i + (this.width - 1);\n if (map[key] === undefined) {\n map[key] = { tile: 8, x: 0, y: i};\n } else {\n if ((map[key].tile >> 3) % 2 != 1) {\n map[key].tile += 8; //8\n }\n }\n }\n \n return;\n \n }", "title": "" }, { "docid": "d0ffe0691b5ebcdea4ec5b25e0dc8a6d", "score": "0.5432558", "text": "function populateSquare() {\n $(\"td.square\").each(function(i){\n var a = getCoordFromSquare(i);\n if($(this).hasClass('victim') || $(this).children('.start').length == 1 || $(this).hasClass('black-tile')){ \n if($(this).hasClass('victim')) {\n var loc = $(this).children('img').attr('src');\n maze[a[0]][a[1]][a[2]].man = parseInt(loc.substr(loc.length - 5, 1));\n }\n if($(this).children('.start').length == 1)\n maze[a[0]][a[1]][a[2]].start = 1;\n if($(this).hasClass('black-tile'))\n maze[a[0]][a[1]][a[2]].black = 1;\n }\n });\n}", "title": "" }, { "docid": "799909a01c405160916558fd470a3395", "score": "0.5431876", "text": "function buildMap(levelMap)\n{\n console.log(\"buildMap Function\");\n for(var row = 0; row < ROWS; row++)\n {\n for(var column = 0; column < COLUMNS; column++)\n {\n var currentTile = levelMap[row][column];\n\n if(currentTile !== EMPTY)\n {\n //Find the tile's x and y position on the tile sheet\n var tilesheetX = Math.floor((currentTile - 1) % tilesheetColumns) * SIZE;\n var tilesheetY = Math.floor((currentTile - 1) / tilesheetColumns) * SIZE;\n\n // Add property to GRID for all objects to determine if Tile is EMPTY\n switch (currentTile)\n {\n case FLOOR:\n var floor = Object.create(spriteObject);\n floor.sourceX = tilesheetX;\n floor.sourceY = tilesheetY;\n floor.x = column * SIZE;\n floor.y = row * SIZE;\n sprites.push(floor);\n gameVar.grid[row][column].occupied = false;\n break;\n\n case BOX:\n var box = Object.create(spriteObject);\n box.sourceX = tilesheetX;\n box.sourceY = tilesheetY;\n box.x = column * SIZE;\n box.y = row * SIZE;\n sprites.push(box);\n boxes.push(box);\n gameVar.grid[row][column].occupied= true;\n break;\n\n case WALL:\n var wall = Object.create(spriteObject);\n wall.sourceX = tilesheetX;\n wall.sourceY = tilesheetY;\n wall.x = column * SIZE;\n wall.y = row * SIZE;\n sprites.push(wall);\n walls.push(wall);\n gameVar.grid[row][column].occupied = true;\n break;\n\n // Special Wall Object to restrict placement of exit block\n case WALL_BLOCK:\n var wall_block = Object.create(spriteObject);\n wall_block.sourceX = 128;\n wall_block.sourceY = 0;\n wall_block.x = column * SIZE;\n wall_block.y = row * SIZE;\n sprites.push(wall_block);\n walls.push(wall_block);\n gameVar.grid[row][column].occupied = true;\n break;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "8928df018907b64ba571531ec1fd834d", "score": "0.54201937", "text": "function placedBlockParams(pos_x, pos_y){\r\n\r\n\tif(placedPieces.length==0){\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t//console.log(\"mouse pos : \"+pos_x+\":\"+pos_y);\r\n\r\n\tvar posx;\r\n\tvar posy;\r\n\r\n\tfor(var i=0;i<placedPieces.length;i++){\r\n\tpiece=placedPieces[i];\r\n\tvar divw = (layout.width/canvas.width);\r\n\tvar divh = (layout.height/canvas.height);\r\n\tposx = Math.trunc(piece.posx*divw);\r\n\tposy = Math.trunc(piece.posy*divh);\r\n\tif(posx>pos_x*divw+3 || posx<pos_x*divw-3 || posy>pos_y*divh+3 || posy<pos_y*divh-3 || piece.posz != current_layer){\r\n\t continue;\r\n\t}\r\n\tvar position = piecePosition(piece.orientation, posx, posy, piece.sizex, piece.sizey);\r\n\r\n\tposx=position.posx;\r\n\tposy=position.posy;\r\n\tvar sizex=position.sizex;\r\n\tvar sizey=position.sizey;\r\n\r\n\t//console.log(\"pos : \"+posx+\":\"+posy+\"size : \"+sizex+\":\"+sizey);\r\n\r\n\tposx=posx*(canvas.width/layout.width);\r\n\tposy=posy*(canvas.height/layout.height);\r\n\r\n\tif(posx<=pos_x && posx+(sizex*(canvas.width/layout.width))>=pos_x && posy<=pos_y && posy+(sizey*(canvas.height/layout.height))>=pos_y){\r\n\t\treturn({index : i, posx: posx, posy: posy, sizex: sizex, sizey: sizey, posz: piece.posz});\r\n\t}\r\n}\r\n\r\n\treturn 0;\r\n}", "title": "" }, { "docid": "89327b6af706bde0ef2ea40d8a70b977", "score": "0.54109854", "text": "function displayGrid(type) {\n grid = $('#' + type + '-grid');\n // Creating all the rows in the grid\n for (var i=-1; i<12; i++) {\n // Getting the letter for the grid\n var char = getLetterFromIndex(i);\n\n // Creating all the tiles in the rows\n for (var j=-1; j<12; j++) {\n\n // Setting the droppable tiles\n if (type == \"ship\") {\n if ( (j<=0 || i<=0) || (j>10 || i>10) ) {\n var tile = $('<div class=\"tile\"></div>');\n } else {\n var tile = $('<div class=\"tile\"></div>')\n .droppable({\n accept: '.ship',\n hoverClass: 'hovered',\n tolerance: 'pointer',\n drop: dropShip\n });\n }\n } else {\n if ( (j<=0 || i<=0) || (j>10 || i>10) ) {\n var tile = $('<div class=\"tile\"></div>');\n } else {\n var tile = $('<div class=\"tile salvo\"></div>');\n }\n }\n\n // Setting id's for each tile\n if (type == \"ship\") {\n var tileId = char + j;\n } else if (type == \"salvo\") {\n var tileId = 's' + char + j;\n }\n tile.attr(\"id\", tileId);\n\n // Appending each tile into the grid\n grid.append(tile);\n\n // Setting correct tiles for every cell\n var imagePath = getImagePath(getImageForCoord(i, j));\n $('#' + tileId).css(\"background-image\", \"url(\" + imagePath + \")\");\n\n // Displaying grid coordenates (1..10) and (A..J)\n if (i == -1 && j > 0 && j < 11) {\n // Writing numbers\n displayGridCoords(tileId, j);\n } else if (j == -1 && i > 0 && i < 11) {\n // Writing letters\n displayGridCoords(tileId, char);\n }\n }\n\n }\n}", "title": "" }, { "docid": "782c6a01be69b389394aa03709299f4d", "score": "0.5410856", "text": "function showPossMovements() {\n\n //POSSIBLE MOVEMENTS PLAYER 1\n if (player1Active) {\n\n gameBox.ready( function () {\n\n let playerP = boxPosition('.player1');\n let coordPlayer = getCoordinates(playerP);\n //console.log(coordPlayer);\n\n \n //check the possible move vertically SOUTH P1\n for (let i = (playerP + 10); i <= (playerP + 30); i = i + 10) {\n \n let tile = $('.box[data-index=\"' + i + '\"]');\n \n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n }\n\n\n //check the possible move vertically NORTH P1\n for (let i = (playerP - 10); i >= (playerP - 30); i = i - 10) {\n \n let tile = $('.box[data-index=\"' + i + '\"]');\n \n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n }\n \n \n //check the possible move hosrizontally EAST P1\n for (let i = (playerP + 1); i <= (playerP + 3); i++) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n let boxTile = boxPosition(tile);\n //console.log(boxTile);\n let coordTile = getCoordinates(boxTile);\n //console.log(coordTile);\n\n if (coordPlayer.x === 9) {\n break;\n\n } else if (coordPlayer.x === 8) {\n for (let i = (playerP + 1); i <= (playerP + 1); i++) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n }\n\n } else if (coordPlayer.x === 7) {\n for (let i = (playerP + 1); i <= (playerP + 2); i++) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n }\n\n\n } else if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n\n }\n \n \n //check the possible move hotizontally WEST P1\n for (let i = (playerP - 1); i >= (playerP - 3); i--) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n let boxTile = boxPosition(tile);\n //console.log(boxTile);\n let coordTile = getCoordinates(boxTile);\n //console.log(coordTile);\n\n if (coordPlayer.x === 0) {\n break;\n\n } else if (coordPlayer.x === 1) {\n for (let i = (playerP - 1); i >= (playerP - 1); i--) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n }\n\n } else if (coordPlayer.x === 2) {\n for (let i = (playerP - 1); i >= (playerP - 2); i--) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n }\n\n\n } else if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n\n tile.css('backgroundImage', 'url(' + player1.activePath + ')');\n\n }\n\n }\n\n \n });\n\n\n\n\n //POSSIBLE MOVIMENTS PLAYER 2\n } else {\n\n gameBox.ready( function () {\n\n let playerP2 = boxPosition('.player2');\n let coordPlayer2 = getCoordinates(playerP2);\n \n //check the possible move vertically SOUTH P2\n for (let i = (playerP2 + 10); i <= (playerP2 + 30); i = i + 10) {\n \n let tile = $('.box[data-index=\"' + i + '\"]');\n \n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player1')) {\n break;\n \n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n }\n\n\n //check the possible move vertically NORTH P2\n for (let i = playerP2 - 10; i >= (playerP2 - 30); i = i - 10) {\n \n let tile = $('.box[data-index=\"' + i + '\"]');\n \n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player1')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n }\n\n\n\n //check the possible move horizontally WEST P2\n for (let i = (playerP2 - 1); i >= (playerP2 - 3); i--) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n let boxTile = boxPosition(tile);\n coordTile = getCoordinates(boxTile);\n\n if (coordPlayer2.x === 0) {\n break;\n\n } else if (coordPlayer2.x === 1) {\n for (let i = (playerP2 - 1); i >= (playerP2 - 1); i--) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n }\n\n } else if (coordPlayer2.x === 2) {\n for (let i = (playerP2 - 1); i >= (playerP2 - 2); i--) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n }\n\n\n } else if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n\n }\n \n\n\n //check the possible move horizontally EAST P2\n for (let i = (playerP2 + 1); i <= (playerP2 + 3); i++) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n let boxTile = boxPosition(tile);\n let coordTile = getCoordinates(boxTile);\n\n //verify if the player is not at the aedge of the board in order not to show the path on the other side of the board\n if (coordPlayer2.x === 9) {\n break;\n\n } else if (coordPlayer2.x === 8) {\n for (let i = (playerP2 + 1); i <= (playerP2 + 1); i++) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n }\n\n } else if (coordPlayer2.x === 7) {\n for (let i = (playerP2 + 1); i <= (playerP2 + 2); i++) {\n\n let tile = $('.box[data-index=\"' + i + '\"]');\n\n if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n }\n\n\n } else if (tile.hasClass('obstacle')) {\n break;\n\n } else if (tile.hasClass('player2')) {\n break;\n\n } else if (tile.hasClass('wp-1') || tile.hasClass('wp-2') ||\n tile.hasClass('wp-3') || tile.hasClass('wp-4') ||\n tile.hasClass('wp-5')) {\n continue;\n\n } else {\n tile.css('backgroundImage', 'url(' + player2.activePath + ')');\n\n }\n\n }\n\n });\n\n } \n\n return;\n\n }", "title": "" }, { "docid": "c9a9875f581134838ee386ae50047bd5", "score": "0.5408448", "text": "function placeNums (size,boxes) {\n boxes.forEach (box => {\n let relativeRow = parseInt(box.dataset.row)\n let boxIndex = parseInt(box.dataset.box)\n if (box.dataset.mines === '1') {\n for (let i = relativeRow-1; i<=relativeRow+1; i++) {\n for (let j = boxIndex-1; j<=boxIndex+1; j++) {\n if (j<0 || i<0 || j>=size || i>=size) continue\n if (i == relativeRow && j == boxIndex) continue\n\n let neighborBox = document.getElementById(`[${i}][${j}]`)\n neighborBox.dataset.neighbors++\n }\n }\n }\n })\n}", "title": "" }, { "docid": "ff4ad2148e65a4530cb587b7f35669b2", "score": "0.54022413", "text": "function initTiles(){\n\t\tmaskRect = {x:0, y:0, width:COLS * scale, height:ROWS * scale};\n\t\tgetOffset(div);\n\t\tvar r, c;\n\t\tfor(r = 0; r < ROWS; r++){\n\t\t\ttiles[r] = [];\n\t\t\tfor(c = 0; c < COLS; c++){\n\t\t\t\ttiles[r][c] = new Tile(r, c, SPRITE_SHEET, maskRect);\n\t\t\t\ttiles[r][c].update();\n\t\t\t\tdiv.appendChild(tiles[r][c].div);\n\t\t\t}\n\t\t}\n\t\trandomiseTiles();\n\t}", "title": "" }, { "docid": "57f2bed292b5655df5b41f2c17842ff4", "score": "0.5399863", "text": "function identifySpaceType(x, y) \r\n{\r\n \r\n let returnObject = \r\n {\r\n spaceType: \"\",\r\n tilesetX: 0,\r\n tilesetY: 0,\r\n tilesizeX: 16,\r\n tilesizeY: 16\r\n };\r\n\r\n let canMoveUp = false;\r\n let canMoveLeft = false;\r\n let canMoveRight = false;\r\n let canMoveDown = false;\r\n\r\n // check for out of bounds (i.e. this move would move the player off the edge,\r\n // which also saves us from checking out of bounds of the array) and, if not\r\n // out of bounds, check if the space can be moved to (i.e. contains a corridor/room)\r\n if (x - 1 >= 0 && dungeon.maze[y][x - 1] > 0) \r\n {\r\n canMoveLeft = true;\r\n }\r\n if (x + 1 < dungeon.w && dungeon.maze[y][x + 1] > 0) \r\n {\r\n canMoveRight = true;\r\n }\r\n if (y - 1 >= 0 && dungeon.maze[y - 1][x] > 0) \r\n {\r\n canMoveUp = true;\r\n }\r\n if (y + 1 < dungeon.h && dungeon.maze[y + 1][x] > 0) \r\n {\r\n canMoveDown = true;\r\n }\r\n\r\n if (canMoveUp && canMoveRight && canMoveDown && canMoveLeft) \r\n {\r\n returnObject.spaceType = \"all_exits\";\r\n returnObject.tilesetX = 16;\r\n returnObject.tilesetY = 16;\r\n }\r\n else if (canMoveUp && canMoveRight && canMoveDown) \r\n {\r\n returnObject.spaceType = \"left_wall\";\r\n returnObject.tilesetX = 0;\r\n returnObject.tilesetY = 16;\r\n }\r\n else if (canMoveRight && canMoveDown && canMoveLeft) \r\n {\r\n returnObject.spaceType = \"up_wall\";\r\n returnObject.tilesetX = 16;\r\n returnObject.tilesetY = 0;\r\n }\r\n else if (canMoveDown && canMoveLeft && canMoveUp) \r\n {\r\n returnObject.spaceType = \"right_wall\";\r\n returnObject.tilesetX = 32;\r\n returnObject.tilesetY = 16;\r\n }\r\n else if (canMoveLeft && canMoveUp && canMoveRight) \r\n {\r\n returnObject.spaceType = \"down_wall\";\r\n returnObject.tilesetX = 16;\r\n returnObject.tilesetY = 32;\r\n }\r\n else if (canMoveUp && canMoveDown) \r\n {\r\n returnObject.spaceType = \"vertical_corridor\";\r\n returnObject.tilesetX = 144;\r\n returnObject.tilesetY = 16;\r\n }\r\n else if (canMoveLeft && canMoveRight) \r\n {\r\n returnObject.spaceType = \"horizontal_corridor\";\r\n returnObject.tilesetX = 112;\r\n returnObject.tilesetY = 32;\r\n }\r\n else if (canMoveUp && canMoveLeft) \r\n {\r\n returnObject.spaceType = \"bottom_right\";\r\n returnObject.tilesetX = 32;\r\n returnObject.tilesetY = 32;\r\n }\r\n else if (canMoveUp && canMoveRight) \r\n {\r\n returnObject.spaceType = \"bottom_left\";\r\n returnObject.tilesetX = 0;\r\n returnObject.tilesetY = 32;\r\n }\r\n else if (canMoveDown && canMoveLeft) \r\n {\r\n returnObject.spaceType = \"top_right\";\r\n returnObject.tilesetX = 32;\r\n returnObject.tilesetY = 0;\r\n }\r\n else if (canMoveDown && canMoveRight) \r\n {\r\n returnObject.spaceType = \"top_left\";\r\n returnObject.tilesetX = 0;\r\n returnObject.tilesetY = 0;\r\n }\r\n return returnObject;\r\n}", "title": "" }, { "docid": "7074bdcecf2578768b13f944c2295e01", "score": "0.5395998", "text": "function generateTiles(){\n for(let i = 0; i < dataObjs.length; i++){\n //Identify the human object\n if (dataObjs[i].hasOwnProperty('heightInInches')){\n makeHumanTile(i);\n }else{\n makeDinoTile(i);\n }\n }\n }", "title": "" }, { "docid": "c6a53a5f553c0875c3676cedd3c38fd1", "score": "0.53950757", "text": "function MapHandler(initX, initY, tiledMap) {\n var self = this;\n\n var visibleLayers = tiledMap.layers.filter(function (layer) {\n return layer.visible && layer.type === 'tilelayer';\n }).map(function (layer) {\n return {data: layer.data, z: layer.z};\n });\n\n var boxStore = {}; // tiles within a map segment\n var tileStore = {}; // cache of re-usable tiles\n var tileSizeInPx = {width: tiledMap.tilewidth, height: tiledMap.tileheight};\n\n var screenWidth = Math.ceil(Config.viewportWidth / tileSizeInPx.width);\n var screenHeight = Math.ceil(Config.viewportHeight / tileSizeInPx.height);\n\n var boxWidth = Math.ceil(screenWidth / 3);\n var boxHeight = Math.ceil(screenHeight / 3);\n var boxesPerRow = Math.ceil(Config.width() / boxWidth);\n\n this.currentBoxLinearPosition = -1;\n\n self.changeLoc = function (newX, newY) {\n var boxSizeInPx = {\n x: (tileSizeInPx.width * boxWidth),\n y: (tileSizeInPx.height * boxHeight)\n };\n\n // Box changed?\n var boxColumn = Math.floor(newX / boxSizeInPx.x);\n var boxRow = Math.floor(newY / boxSizeInPx.y);\n var newBoxLinearPosition = boxColumn + boxRow * boxesPerRow;\n if (newBoxLinearPosition !== this.currentBoxLinearPosition) {\n this.currentBoxLinearPosition = newBoxLinearPosition;\n changeBox(newBoxLinearPosition);\n }\n };\n\n var changeBox = function (boxLinearPosition) {\n var column, row;\n\n // clear surrounding out-of-frame boxes\n row = -4;\n for (column = -4; column <= 4; column++) {\n clearBox(boxLinearPosition + row * boxesPerRow + column);\n }\n\n column = -4;\n for (row = -3; row <= 3; row++) {\n clearBox(boxLinearPosition + row * boxesPerRow + column);\n }\n\n column = 4;\n for (row = -3; row <= 3; row++) {\n clearBox(boxLinearPosition + row * boxesPerRow + column);\n }\n\n row = 4;\n for (column = -4; column <= 4; column++) {\n clearBox(boxLinearPosition + row * boxesPerRow + column);\n }\n\n // fill in surrounding boxes\n for (row = -3; row <= 3; row++) {\n for (column = -3; column <= 3; column++) {\n loadBox(boxLinearPosition + row * boxesPerRow + column);\n }\n }\n };\n\n var clearBox = function (boxId) {\n if (!boxStore[boxId] || boxStore[boxId].loaded === false)\n return; // not loaded\n\n // don't block\n setTimeout(function () {\n // clear old box tiles\n while (boxStore[boxId] && boxStore[boxId].tiles.length) {\n var tile = boxStore[boxId].tiles.pop();\n tile.visible = false;\n tile.attr({ x: -10000, y: -10000 });\n tileStore[tile.gid].push(tile);\n }\n\n if (boxStore[boxId]) {\n boxStore[boxId].loaded = false;\n }\n }, 1000);\n };\n\n var loadBox = function (curBox) {\n // init box\n if (!boxStore[curBox]) {\n boxStore[curBox] = { loaded: false, tiles: [] };\n }\n\n if (boxStore[curBox].loaded) return; // already loaded\n\n var tileColumn = (curBox % boxesPerRow) * boxWidth;\n var tileRow = Math.floor(curBox / boxesPerRow) * boxHeight;\n\n var getTilesGid = function (pos) {\n return visibleLayers.map(function (l) {\n return {gid: l.data[pos], z: l.z};\n });\n };\n\n var tiles, tile, tileGid;\n for (var row = tileRow; row < tileRow + boxHeight && row < tiledMap.height && row >= 0; row++) {\n for (var column = tileColumn; column < tileColumn + boxWidth && column < tiledMap.width && column >= 0; column++) {\n tiles = getTilesGid(column + row * tiledMap.width);\n\n for (var i = 0; i < tiles.length; i++) {\n tile = undefined;\n tileGid = tiles[i].gid;\n\n if (tileGid) {\n if (!tileStore[tileGid])\n tileStore[tileGid] = [];\n\n if (tileStore[tileGid].length) {\n tile = tileStore[tileGid].pop();\n tile.visible = true;\n } else {\n tile = Crafty.e('Tile, Tile' + tileGid).setGid(tileGid);\n tile.z = tiles[i].z;\n }\n\n tile.attr({\n x: column * tileSizeInPx.width,\n y: row * tileSizeInPx.height\n });\n\n boxStore[curBox].tiles.push(tile);\n }\n }\n }\n }\n boxStore[curBox].loaded = true;\n };\n\n self.changeLoc(initX, initY);\n\n return this;\n }", "title": "" }, { "docid": "df64a23b4c54a21451dc9917d27420ad", "score": "0.5395004", "text": "function getPLS(evt) {\n // We need to initialize multiple variables here\n // counterPLS holds the current pls of the type e.g. -> row or column\n let counterPLS = 0;\n // maxPLS is the maximum pls of all possible combinations\n let maxPLS = 0;\n // blockLeft and blockRight indicate whether the current pls is blocke by \n // opposing tiles\n let blockLeft = false, blockRight = false;\n // A temporary array to hold the indices of the pls\n let tempArr = [];\n // The pls object that will be returned which contains all data on \n // pls length, the indices that make it up, and the type of pls it is.\n let objPLS = {\n plsLength: 0,\n plsIdx: [],\n plsType: '0'\n };\n\n // Begin by cleaning our div id and returning a two element array [row, col]\n let idxArr = cleanIdx(evt.target.id);\n \n // Start at our row right\n for(let i = idxArr[1]; i < board.length; i++) {\n // If the tile right if i is 'W' add one to our counter and add its indices\n // to tempArr\n if(board[idxArr[0]][i] == 'W') {\n counterPLS++;\n tempArr.push([idxArr[0], i]);\n }\n // If it is interrupted by a null break\n else if(board[idxArr[0]][i] != 'W') {\n // If it is interrupted by a black tile, set blocked right to true and break\n if(board[idxArr[0]][i] == 'B')\n blockRight = true;\n break; \n }\n }\n\n //Start at tile left of initial tile\n for(let i = idxArr[1] - 1; i >= 0; i--) {\n // If tiles left of i - 1 are 'W' add one to our counter and add its indices\n if(board[idxArr[0]][i] == 'W') {\n counterPLS++;\n tempArr.push([idxArr[0], i]);\n }\n // Refer to above\n else if(board[idxArr[0]][i] != 'W') {\n // If it is interrupted by a black tile, set blocked left to true and break\n if(board[idxArr[0]][i] == 'B')\n blockLeft = true;\n break;\n }\n }\n\n // If both blockLeft and blockRight are blocked it is not a valid pls\n // reset our counterPLS and remove our indices since it is not a row-threat\n if(blockLeft && blockRight) {\n counterPLS = 0;\n tempArr = [];\n }\n\n // If it is not blocked\n // Reset our flags for the next check\n blockLeft = false, blockRight = false;\n // Store the current max pls\n maxPLS = counterPLS;\n // In case our array has duplicates, filter it\n objPLS.plsIdx = filterArray(tempArr);\n // Preemptively set the type to Row\n objPLS.plsType = 'R'\n\n // Before checking columns reset our counters, now that we have saved them\n counterPLS = 0;\n tempArr = [];\n // Check tiles beneath i\n for(let i = idxArr[0]; i < board.length; i++) {\n if(board[i][idxArr[1]] == 'W') {\n counterPLS++;\n tempArr.push([i, idxArr[1]]);\n }\n else if(board[i][idxArr[1]] != 'W') {\n if(board[i][idxArr[1]] == 'B')\n blockLeft = true;\n break;\n }\n }\n // Check tiles above i + 1\n for(let i = idxArr[0] - 1; i >= 0; i--) {\n if(board[i][idxArr[1]] == 'W') {\n counterPLS++;\n tempArr.push([i, idxArr[1]]);\n }\n else if(board[i][idxArr[1]] != 'W') {\n if(board[i][idxArr[1]] == 'B')\n blockRight = true;\n break;\n }\n }\n // Refer above\n if(blockLeft && blockRight) {\n counterPLS = 0;\n tempArr = [];\n }\n // If the maxPLS is less than the pls of the current type\n if(maxPLS < counterPLS) {\n // Set maxPLS to counterPLS\n maxPLS = counterPLS;\n // Our array of indices must also be replaced\n objPLS.plsIdx = filterArray(tempArr);\n // Then replace the type of pls to 'C'\n objPLS.plsType = 'C'\n }\n \n // Again reset our counters and block checkers\n blockLeft = false, blockRight = false;\n tempArr = [];\n counterPLS = 0;\n\n // Check our diag now\n // Check for all tiles going bottom left to top right to i \n for(let i = idxArr[0], j = idxArr[1]; i < board.length; i++, j--) {\n if(board[i][j] == 'W') {\n counterPLS++;\n tempArr.push([i, j]);\n }\n else if(board[i][j] != 'W') {\n if(board[i][j] == 'B')\n blockLeft = true;\n break;\n }\n }\n // Check all tiles going from i to bottom left and top right to end of board\n for(let i = idxArr[0] - 1, j = idxArr[1] + 1; i >= 0; i--, j++) {\n if(board[i][j] == 'W') {\n counterPLS++;\n tempArr.push([i, j]);\n }\n else if(board[i][j] != 'W') {\n if(board[i][j] == 'B')\n blockRight = true;\n break;\n }\n }\n if(blockLeft && blockRight) {\n counterPLS = 0;\n tempArr = [];\n }\n if(maxPLS < counterPLS) {\n maxPLS = counterPLS;\n objPLS.plsIdx = filterArray(tempArr);\n objPLS.plsType = 'D'\n }\n // Reset counters and block checks\n blockLeft = false, blockRight = false;\n tempArr = [];\n counterPLS = 0;\n\n // Check anti diag now\n // Check for all tiles above left of i.\n for(let i = idxArr[0], j = idxArr[1]; i >= 0; i--, j--) {\n if(board[i][j] == 'W') {\n counterPLS++;\n tempArr.push([i, j]);\n }\n else if(board[i][j] != 'W') {\n if(board[i][j] == 'B')\n blockLeft = true;\n break;\n }\n }\n // Check for all tiles going bottom right of i\n for(let i = idxArr[0] + 1, j = idxArr[1] + 1; i < board.length; i++, j++) {\n if(board[i][j] == 'W') {\n counterPLS++;\n tempArr.push([i, j]);\n }\n else if(board[i][j] != 'W') {\n if(board[i][j] == 'B')\n blockRight = true;\n break;\n }\n }\n if(blockLeft && blockRight) {\n counterPLS = 0;\n tempArr = [];\n }\n if(maxPLS < counterPLS) {\n maxPLS = counterPLS;\n objPLS.plsIdx = filterArray(tempArr);\n objPLS.plsType = 'AD'\n }\n // Set the pls length equal to the max pls of all combinations\n objPLS.plsLength = maxPLS;\n // Return the object\n return objPLS;\n}", "title": "" }, { "docid": "079f8ca77a2503fd804473afbc574d78", "score": "0.53906596", "text": "function checkHitbox(index) {\n\tvar missile = document.getElementsByClassName(gMissile)[index];\n\tif (!missile)\n\t\treturn (null);\n\tvar sizeArray = [missile.getBoundingClientRect(),\n\t\t\t\t\t document.getElementById(ennemis).getBoundingClientRect(),\n\t\t\t\t\t document.getElementsByClassName(vaisseau)];\n\tvar missileY = sizeArray[0].top;\n\tvar missileX = sizeArray[0].left;\n\n\tif (missileY < sizeArray[1].top + sizeArray[1].height &&\n\t\tmissileY > sizeArray[1].top &&\n\t\tmissileX < sizeArray[1].left + sizeArray[1].width &&\n\t\tmissileX > sizeArray[1].left) {\n\t\treturn (sizeArray);\n\t} else if (missileY + sizeArray[0].height < sizeArray[1].top + sizeArray[1].height &&\n\t\tmissileY + sizeArray[0].height > sizeArray[1].top &&\n\t\tmissileX + sizeArray[0].width < sizeArray[1].left + sizeArray[1].width &&\n\t\tmissileX + sizeArray[0].width > sizeArray[1].left) {\n\t\treturn (sizeArray);\n\t}\n\treturn (null);\n}", "title": "" }, { "docid": "c848a7121d305491637e76cdb3421c2e", "score": "0.53896636", "text": "function findTileX(x) {\n for (var i = 8; i >= 0; i--) {\n if (x >= xTileStarts[i]) {\n if (x < xTileStarts[i] + 18) {\n return [\"ABCDEFGHI\"[i], xTileStarts[i], i];\n } else {\n return [\"buf\", xTileStarts[i] + 18, -1];\n }\n }\n }\n return [\"io\", 0, -2];\n }", "title": "" }, { "docid": "ca241d520857c794308d731477763b52", "score": "0.53833973", "text": "function tilePos(m,x,y) {\n return { left: m.x_off + x * 2 * m.hexWidth - y * m.centerToSide\n , top: m.y_off - x * 3 * m.hexSide - y * 4.5 * m.hexSide\n }\n}", "title": "" }, { "docid": "d4e63e7f00b8d0dd28640cb4efc42f47", "score": "0.5372477", "text": "function calculateMemoryZonePoints() {\n var leftMostCrossing = getLeftBottomRoofCrossing();\n var leftTopMemoryRoofPoint = getMemoryZoneLeftTopPoint(Data.getRoofs());\n\n if (!leftMostCrossing || !leftTopMemoryRoofPoint) return;\n\n var frame = getRooflineFrame();\n\n var leftCrossPoint = [leftMostCrossing.x, leftMostCrossing.y];\n var minRooflinePoint = [frame.minIntens, frame.minPerf];\n var leftMemPoint = [frame.minIntens, leftTopMemoryRoofPoint];\n\n if (currentPerspectiveType === PerspectiveTypes.vector) {\n var vectorRoofHighestMemoryCrossing = getLeftBottomVectorRoofCrossing();\n if (!vectorRoofHighestMemoryCrossing) return;\n leftCrossPoint = [vectorRoofHighestMemoryCrossing.x, vectorRoofHighestMemoryCrossing.y];\n }\n\n var memTopRoofPoint = [minRooflinePoint[0], leftMemPoint[1]];\n var zeroPoint = [minRooflinePoint[0], minRooflinePoint[1]];\n var crossPoint = [leftCrossPoint[0], leftCrossPoint[1]];\n var endPoint = [leftCrossPoint[0], minRooflinePoint[1]];\n\n return [zeroPoint, memTopRoofPoint, crossPoint, endPoint];\n }", "title": "" }, { "docid": "257dd5d8533e6b7831628c13543db94f", "score": "0.53711396", "text": "function gotData(data) {\n // console.log(data);\n subData_ = data;\n timeline.unshift(new sR(subData_));\n island = [];\n //remap values for subredditSubscribers to 2, 1000\n //it will draw a minimum of 2 voronoi cells and a max of 1000 v. cells\n subMapped = map(timeline[0].subredditSubscribers, 1, maxSub, 30, 1000, true);\n //remap subredditSubscribers values to determinate the distance of the v. cell\n //more subredditSubscribers less distance, less subredditSubscribers more distance\n subMappedDist = map(timeline[0].subredditSubscribers, 1, maxSub, 30, 10, true);\n for (var i = 0; i < cellColors.length; i++){\n if (cellColors[i][3] == 'land'){\n island.push(cells[sites[i].voronoiId]);\n }\n }\n //if (timeline.length == 1 || timeline[0].subredditSubscribers != timeline[1].subredditSubscribers){\n if (timeline.length == 1){\n //b = true;\n capitalCity();\n nameGenerator();\n }\n if (timeline.length > 1){\n //b = false;\n }\n if (timeline.length > 2) {\n timeline.pop();\n }\n}", "title": "" }, { "docid": "4decc05bb64557bcc2cab6f98b5dd213", "score": "0.5366983", "text": "function drawboxes(){\n\t\tvar puzzlearea = document.getElementById(\"puzzlearea\");\n\t\tfor(var row = 0; row < PUZZLE_ROW_COL_COUNT; row++){\n\t\t\tfor(var col = 0; col < PUZZLE_ROW_COL_COUNT; col++){\n\t\t\t\tvar boxNumber = PUZZLE_ROW_COL_COUNT * row + (col + 1);\n\t\t\t\tif(boxNumber < Math.pow(PUZZLE_ROW_COL_COUNT, 2)) {\n\t\t\t\t\t// creates one puzzle piece div\n\t\t\t\t\tvar box = document.createElement(\"div\");\n\t\t\t\t\tbox.id = \"box_\" + row + \"_\" + col;\n\t\t\t\t\tbox.style.backgroundPosition = (col * -(BOX_HEIGHT)) + \"px \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t(row * -(BOX_HEIGHT)) + \"px\";\n\t\t\t\t\tbox.style.top = (row *\tBOX_HEIGHT) + \"px\";\n\t\t\t\t\tbox.style.left = (col *\tBOX_HEIGHT) + \"px\";\n\t\t\t\t\tbox.innerHTML = boxNumber;\n\t\t\t\t\tbox.onclick = clickBox;\n\t\t\t\t\tpuzzlearea.appendChild(box);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tchangeNeighborClass();\n\t}", "title": "" }, { "docid": "e599576b4629da5208f4e6c4ce8d54ca", "score": "0.5355253", "text": "calculateFaceLocation(data) {\n\t\t// get image width/height before calculating the boxes.\n\t\tconst image = document.getElementById('img-detected');\n\t\tconst width = Number(image.width);\n\t\tconst height = Number(image.height);\n\t\t// map returned box data to a new array.\n\t\tconst boxes = data.outputs[0].data.regions.map(data => {\n\t\t\tconst clarafaiBox = data.region_info.bounding_box;\n\t\t\t//console.log(data.region_info.bounding_box);\n\t\t\treturn {\n\t\t\t\tleft: clarafaiBox.left_col * width,\n\t\t\t\tright: width - (clarafaiBox.right_col * width),\n\t\t\t\ttop: clarafaiBox.top_row * height,\n\t\t\t\tbottom: height - (clarafaiBox.bottom_row * height),\n\t\t\t}\n\t\t})\n\t\t//console.log(width, height);\n\t\t//console.log('boxes:', boxes);\n\t\t// return the new boxes array.\n\t\treturn boxes;\n\t}", "title": "" }, { "docid": "c25b4ef4f8175e5d02c344d391ff5807", "score": "0.5345682", "text": "findCollisionBounds() \r\n\t{\r\n\t\tlet xMin = 0;\r\n\t\tlet xMax = 0;\r\n\t\tlet yMin = 0;\r\n\t\tlet yMax = 0;\r\n\t\tlet zMin = 0;\r\n\t\tlet zMax = 0;\r\n\r\n\t\tlet xCache = [];\r\n\t\tlet yCache = [];\r\n\t\tlet zCache = [];\r\n\r\n\t\tfor (let p = 0; p < this.polydefs.length; p++)\r\n\t\t{\r\n\t\t\tlet poly = this.polydefs[p][0]\r\n\t\t\tlet p1 = this.cloud.get(poly.p1);\r\n\t\t\tlet p2 = this.cloud.get(poly.p2);\r\n\t\t\tlet p3 = this.cloud.get(poly.p3);\r\n\t\t\tlet p4 = this.cloud.get(poly.p4);\r\n\r\n\t\t\t//This should probably be really fast, so I'll write it all out manually for now.\r\n\t\t\tif (p1.pub.x < xMin)\r\n\t\t\t{\r\n\t\t\t\txMin = p1.pub.x; \r\n\t\t\t}\r\n\r\n\t\t\tif (p1.pub.x > xMax)\r\n\t\t\t{\r\n\t\t\t\txMax = p1.pub.x;\r\n\t\t\t}\r\n\r\n\t\t\tif (p2.pub.x < xMin)\r\n\t\t\t{\r\n\t\t\t\txMin = p1.pub.x; \r\n\t\t\t}\r\n\r\n\t\t\tif (p2.pub.x > xMax)\r\n\t\t\t{\r\n\t\t\t\txMax = p1.pub.x;\r\n\t\t\t}\r\n\r\n\t\t\tif (p3.pub.x < xMin)\r\n\t\t\t{\r\n\t\t\t\txMin = p1.pub.x; \r\n\t\t\t}\r\n\r\n\t\t\tif (p3.pub.x > xMax)\r\n\t\t\t{\r\n\t\t\t\txMax = p1.pub.x;\r\n\t\t\t}\r\n\r\n\t\t\tif (p4.pub.x < xMin)\r\n\t\t\t{\r\n\t\t\t\txMin = p1.pub.x; \r\n\t\t\t}\r\n\r\n\t\t\tif (p4.pub.x > xMax)\r\n\t\t\t{\r\n\t\t\t\txMax = p1.pub.x;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tif (p1.pub.y < yMin)\r\n\t\t\t{\r\n\t\t\t\tyMin = p1.pub.y; \r\n\t\t\t}\r\n\r\n\t\t\tif (p1.pub.y > yMax)\r\n\t\t\t{\r\n\t\t\t\tyMax = p1.pub.y;\r\n\t\t\t}\r\n\r\n\t\t\tif (p2.pub.y < yMin)\r\n\t\t\t{\r\n\t\t\t\tyMin = p1.pub.y; \r\n\t\t\t}\r\n\r\n\t\t\tif (p2.pub.y > yMax)\r\n\t\t\t{\r\n\t\t\t\tyMax = p1.pub.y;\r\n\t\t\t}\r\n\r\n\t\t\tif (p3.pub.y < yMin)\r\n\t\t\t{\r\n\t\t\t\tyMin = p1.pub.y; \r\n\t\t\t}\r\n\r\n\t\t\tif (p3.pub.y > yMax)\r\n\t\t\t{\r\n\t\t\t\tyMax = p1.pub.y;\r\n\t\t\t}\r\n\r\n\t\t\tif (p4.pub.y < yMin)\r\n\t\t\t{\r\n\t\t\t\tyMin = p1.pub.y; \r\n\t\t\t}\r\n\r\n\t\t\tif (p4.pub.y > yMax)\r\n\t\t\t{\r\n\t\t\t\tyMax = p1.pub.y;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tif (p1.pub.z < zMin)\r\n\t\t\t{\r\n\t\t\t\tzMin = p1.pub.z; \r\n\t\t\t}\r\n\r\n\t\t\tif (p1.pub.z > zMax)\r\n\t\t\t{\r\n\t\t\t\tzMax = p1.pub.z;\r\n\t\t\t}\r\n\r\n\t\t\tif (p2.pub.z < zMin)\r\n\t\t\t{\r\n\t\t\t\tzMin = p1.pub.z; \r\n\t\t\t}\r\n\r\n\t\t\tif (p2.pub.z > zMax)\r\n\t\t\t{\r\n\t\t\t\tzMax = p1.pub.z;\r\n\t\t\t}\r\n\r\n\t\t\tif (p3.pub.z < zMin)\r\n\t\t\t{\r\n\t\t\t\tzMin = p1.pub.z; \r\n\t\t\t}\r\n\r\n\t\t\tif (p3.pub.z > zMax)\r\n\t\t\t{\r\n\t\t\t\tzMax = p1.pub.z;\r\n\t\t\t}\r\n\r\n\t\t\tif (p4.pub.z < zMin)\r\n\t\t\t{\r\n\t\t\t\tzMin = p1.pub.z; \r\n\t\t\t}\r\n\r\n\t\t\tif (p4.pub.z > zMax)\r\n\t\t\t{\r\n\t\t\t\tzMax = p1.pub.z;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.collider = {\r\n\t\t\t\"xMin\" : xMin,\r\n\t\t\t\"xMax\" : xMax,\r\n\t\t\t\"yMin\" : yMin,\r\n\t\t\t\"yMax\" : yMax,\r\n\t\t\t\"zMin\" : zMin,\r\n\t\t\t\"zMax\" : zMax\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "10ae6c09ced058a14b2da285583ea7b4", "score": "0.5342143", "text": "function pushInitialData() {\r\n\r\n startScreenTime = new customTimer(3000);\r\n\r\n player = new playerShip();\r\n ghost = new pacmanGhost();\r\n invaderBoss = null;\r\n shots = [];\r\n globalDir = 1;\r\n\r\n spaceInvaders = [];\r\n for (var i = 0; i < 7; i++) {\r\n spaceInvaders.push(new spaceInvader((4 + i) * 12));\r\n }\r\n\r\n logoPixels = [];\r\n // Stored pixel positions of the logo\r\n logoPixelPosition = [[0, 8], [0, 12], [0, 16], [0, 20], [0, 24], [0, 28], [0, 32], [0, 36], [0, 40], [0, 44], [4, 8], [4, 12], [4, 16], [4, 20], [4, 24], [4, 28], [4, 32], [4, 36], [4, 40], [4, 44], [8, 8], [8, 12], [8, 16], [8, 20], [8, 24], [8, 28], [8, 32], [8, 36], [8, 40], [8, 44], [12, 8], [12, 12], [12, 16], [12, 20], [12, 24], [12, 28], [12, 32], [12, 36], [12, 40], [12, 44], [16, 8], [16, 12], [20, 8], [20, 12], [24, 8], [24, 12], [24, 16], [24, 20], [24, 24], [24, 28], [24, 32], [24, 36], [24, 40], [24, 44], [28, 8], [28, 12], [28, 16], [28, 20], [28, 24], [28, 28], [28, 32], [28, 36], [28, 40], [28, 44], [32, 8], [32, 12], [32, 16], [32, 20], [32, 24], [32, 28], [32, 32], [32, 36], [32, 40], [32, 44], [36, 12], [36, 16], [36, 20], [36, 24], [36, 28], [36, 32], [36, 36], [36, 40], [36, 44], [48, 8], [48, 12], [48, 16], [48, 20], [48, 24], [48, 28], [48, 32], [48, 36], [48, 40], [48, 44], [52, 8], [52, 12], [52, 16], [52, 20], [52, 24], [52, 28], [52, 32], [52, 36], [52, 40], [52, 44], [56, 8], [56, 12], [56, 16], [56, 20], [56, 24], [56, 28], [56, 32], [56, 36], [56, 40], [56, 44], [60, 8], [60, 12], [60, 16], [60, 20], [60, 24], [60, 28], [60, 32], [60, 36], [60, 40], [60, 44], [64, 8], [64, 12], [64, 24], [64, 28], [68, 8], [68, 12], [68, 24], [68, 28], [72, 8], [72, 12], [72, 16], [72, 20], [72, 24], [72, 28], [72, 32], [72, 36], [72, 40], [72, 44], [76, 8], [76, 12], [76, 16], [76, 20], [76, 24], [76, 28], [76, 32], [76, 36], [76, 40], [76, 44], [80, 8], [80, 12], [80, 16], [80, 20], [80, 24], [80, 28], [80, 32], [80, 36], [80, 40], [80, 44], [84, 20], [84, 32], [84, 36], [84, 40], [84, 44], [96, 8], [96, 12], [96, 16], [96, 20], [96, 24], [96, 28], [96, 32], [96, 36], [96, 40], [96, 44], [100, 8], [100, 12], [100, 16], [100, 20], [100, 24], [100, 28], [100, 32], [100, 36], [100, 40], [100, 44], [104, 8], [104, 12], [104, 16], [104, 20], [104, 24], [104, 28], [104, 32], [104, 36], [104, 40], [104, 44], [108, 8], [108, 12], [108, 16], [108, 20], [108, 24], [108, 28], [108, 32], [108, 36], [108, 40], [108, 44], [112, 8], [112, 12], [112, 40], [112, 44], [116, 8], [116, 12], [116, 40], [116, 44], [120, 8], [120, 12], [120, 16], [120, 20], [120, 24], [120, 28], [120, 32], [120, 36], [120, 40], [120, 44], [124, 8], [124, 12], [124, 16], [124, 20], [124, 24], [124, 28], [124, 32], [124, 36], [124, 40], [124, 44], [128, 8], [128, 12], [128, 16], [128, 20], [128, 24], [128, 28], [128, 32], [128, 36], [128, 40], [128, 44], [132, 12], [132, 16], [132, 20], [132, 24], [132, 28], [132, 32], [132, 36], [132, 40]];\r\n\r\n for (var i = 0; i < 252; i++) {\r\n logoPixels.push(new logoPixel(logoPixelPosition[i][0], logoPixelPosition[i][1]));\r\n }\r\n\r\n // Extra ones (red parts, special 1 and special 2)\r\n logoPixels.push(new logoPixel(84, 12, 1));\r\n logoPixels.push(new logoPixel(84, 16, 2));\r\n}", "title": "" }, { "docid": "3e9bee81ddb403bd01166bb0514d1679", "score": "0.53414315", "text": "function get_xy(){\n let side = get_random_number(1,5); \n let x;\n let y;\n if(side===1){ // each number correspond to a side of the membrane\n x = get_random_number((x_mb+30),(x_mb+w_mb-55));\n y = y_mb-20;\n }\n if(side===2){\n x = x_mb + w_mb - 20;\n y = get_random_number((y_mb+30),(y_mb+h_mb-55));\n }\n if(side===3){\n x = get_random_number((x_mb+30),(x_mb+w_mb-55));\n y = y_mb + h_mb -20;\n }\n if(side===4){\n x = x_mb - 20;\n y = get_random_number((y_mb+30),(y_mb+h_mb-55));\n }\n return [x,y];\n}", "title": "" }, { "docid": "c0adfb9389db72c146c52c15498bfd49", "score": "0.5341306", "text": "_boxToBounds(box) {\n const coords = box.match(/[0-9\\.\\-]+/g);\n return [[coords[1], coords[0]], [coords[3], coords[2]]];\n }", "title": "" }, { "docid": "902c7fb751eed89b53fe358dbc773e52", "score": "0.53311706", "text": "function initializeTiles(){\n\t\tfor(var i = 0; i < PUZZLE_LENGTH; i++){\n\t\t\tfor(var j = 0; j < PUZZLE_LENGTH; j++){\n\t\t\t\t// no 16th puzzle div\n\t\t\t\tif(j+i*PUZZLE_LENGTH+1 != PUZZLE_LENGTH*PUZZLE_LENGTH){\n\t\t\t\t\tvar tile = document.createElement(\"div\");\n\t\t\t\t\ttile.innerHTML = \"\" + (j+i*PUZZLE_LENGTH+1);\n\t\t\t\t\ttile.className = \"tile\";\n\t\t\t\t\tdocument.getElementById(\"puzzlearea\").appendChild(tile);\n\t\t\t\t\t\n\t\t\t\t\ttile.onclick = move;\n\t\t\t\t\ttile.onmouseover = highlight;\n\t\t\t\t\t\n\t\t\t\t\ttile.style.left = \"\" + j*TILE_SIZE + \"px\";\n\t\t\t\t\ttile.style.top = \"\" + i*TILE_SIZE + \"px\";\n\t\t\t\t\ttile.style.backgroundPosition = \"\" + (j*-TILE_SIZE) + \"px\" + \" \" + (i*-TILE_SIZE) + \"px\";\n\t\t\t\t\tpuzzleTiles.push(tile);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "811ffe1409e8a9cb8224ae0e81dd65e6", "score": "0.53304493", "text": "function lineOfSight(bandMember, distance) {\n\n// Approximation of center of character sprite used for line of site playfield searches\n\nif ( (bandMember.posX<0) || (bandMember.posX>=1024) ) return [];\nif ( (bandMember.posY<0) || (bandMember.posY>=1024) ) return [];\n\nlet hitDistance=0;\n\nconst currentPosX = bandMember.posX+16+(32/2);\nconst currentPosY = bandMember.posY+12+(47/2);\nconst currentGridRow = Math.floor(currentPosY/32);\nconst currentGridCol = Math.floor(currentPosX/32);\n\nconst player1GridCol=Math.floor((player1.posX+16+(32/2))/32);\nconst player1GridRow=Math.floor((player1.posY+12+(47/2))/32);\n\nconst bandMember1GridCol=Math.floor((bandMember1.posX+16+(32/2))/32);\nconst bandMember1GridRow=Math.floor((bandMember1.posY+12+(47/2))/32);\n\nconst bandMember2GridCol=Math.floor((bandMember2.posX+16+(32/2))/32);\nconst bandMember2GridRow=Math.floor((bandMember2.posY+12+(47/2))/32);\n\nconst bandMember3GridCol=Math.floor((bandMember3.posX+16+(32/2))/32);\nconst bandMember3GridRow=Math.floor((bandMember3.posY+12+(47/2))/32);\n\nconst bandMember4GridCol=Math.floor((bandMember4.posX+16+(32/2))/32);\nconst bandMember4GridRow=Math.floor((bandMember4.posY+12+(47/2))/32);\n\nlet lineOfSightHitResults=[];\nlet hitFlag=false;\nlet hitType=\"\";\n\n// Check North\nhitFlag=false;\nhitType=\"\";\nhitDistance=0;\nfor (let row=currentGridRow; row>=0; row--) {\n let squareHas = currentGameLevel[row][currentGridCol];\n hitDistance=currentGridRow-row;\n\n if (squareHas==='P') squareHas=' ';\n if (squareHas==='d') squareHas=' ';\n if (squareHas==='e') squareHas=' ';\n if (squareHas==='f') squareHas=' ';\n if (squareHas==='g') squareHas=' ';\n if (squareHas==='i') squareHas=' ';\n if (squareHas==='j') squareHas=' ';\n if (squareHas==='q') squareHas=' ';\n if (squareHas==='r') squareHas=' ';\n\n if ( (bandMember.hasBomb>0) && (squareHas==='c') ) squareHas=' ';\n if ( (bandMember.hasGun>0) && ( (squareHas==='l') || (squareHas==='m') ) ) squareHas=' ';\n if ( (bandMember.hasLighter>0) && (squareHas==='n') ) squareHas=' ';\n \n if (squareHas==='W') { hitFlag=false; hitType=\"Wall\"; break; }\n if (squareHas!==' ') { hitFlag=true; hitType=squareHas; break; }\n \n if ( (player1GridCol===currentGridCol) && (player1GridRow===row) ) {\n hitFlag=true; hitType=\"player1\"; break; }\n\n if ( (bandMember.party>BANDMEMBER_FIGHT_FACTOR) && (bandMember.cooldown===0) ) { \n if ( (bandMember.id!==\"bandMember1\") && (bandMember1GridCol===currentGridCol) && (bandMember1GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember1\"; break; }\n if ( (bandMember.id!==\"bandMember2\") && (bandMember2GridCol===currentGridCol) && (bandMember2GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember2\"; break; }\n if ( (bandMember.id!==\"bandMember3\") && (bandMember3GridCol===currentGridCol) && (bandMember3GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember3\"; break; }\n if ( (bandMember.id!==\"bandMember4\") && (bandMember4GridCol===currentGridCol) && (bandMember4GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember4\"; break; }\n }\n}\n\n\nif ( ( (hitFlag) && (!distance) ) || ( (hitFlag) && (distance) && (hitDistance<=distance) ) ) {\n if (hitDistance>0) lineOfSightHitResults.push({ \"direction\": \"N\", \"type\": hitType, \"distance\": hitDistance});\n}\n\n// Check South\nhitFlag=false;\nhitType=\"\";\nfor (let row=currentGridRow; row<=maxPlayfieldRow; row++) {\n let squareHas = currentGameLevel[row][currentGridCol];\n hitDistance=row-currentGridRow;\n\n if (squareHas==='P') squareHas=' ';\n if (squareHas==='d') squareHas=' ';\n if (squareHas==='e') squareHas=' ';\n if (squareHas==='f') squareHas=' ';\n if (squareHas==='g') squareHas=' ';\n if (squareHas==='i') squareHas=' ';\n if (squareHas==='j') squareHas=' ';\n if (squareHas==='q') squareHas=' ';\n if (squareHas==='r') squareHas=' ';\n\n if ( (bandMember.hasBomb>0) && (squareHas==='c') ) squareHas=' ';\n if ( (bandMember.hasGun>0) && ( (squareHas==='l') || (squareHas==='m') ) ) squareHas=' ';\n if ( (bandMember.hasLighter>0) && (squareHas==='n') ) squareHas=' ';\n\n if (squareHas==='W') { hitFlag=false; hitType=\"Wall\"; break; }\n if ( (squareHas!=='P') && (squareHas!==' ') ) { hitFlag=true; hitType=squareHas; break; }\n \n if ( (player1GridCol===currentGridCol) && (player1GridRow===row) ) {\n hitFlag=true; hitType=\"player1\"; break; }\n\n if (bandMember.party>BANDMEMBER_FIGHT_FACTOR) { \n if ( (bandMember.id!==\"bandMember1\") && (bandMember1GridCol===currentGridCol) && (bandMember1GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember1\"; break; }\n if ( (bandMember.id!==\"bandMember2\") && (bandMember2GridCol===currentGridCol) && (bandMember2GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember2\"; break; }\n if ( (bandMember.id!==\"bandMember3\") && (bandMember3GridCol===currentGridCol) && (bandMember3GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember3\"; break; }\n if ( (bandMember.id!==\"bandMember4\") && (bandMember4GridCol===currentGridCol) && (bandMember4GridRow===row) ) {\n hitFlag=true; hitType=\"bandMember4\"; break; }\n }\n}\n\nif ( ( (hitFlag) && (!distance) ) || ( (hitFlag) && (distance) && (hitDistance<=distance) ) ) {\n if (hitDistance>0) lineOfSightHitResults.push({ \"direction\": \"S\", \"type\": hitType, \"distance\": hitDistance});\n}\n\n// Check West\nhitFlag=false;\nhitType=\"\";\nfor (let col=currentGridCol; col>=0; col--) {\n let squareHas = currentGameLevel[currentGridRow][col];\n hitDistance=currentGridCol-col;\n\n if (squareHas==='P') squareHas=' ';\n if (squareHas==='d') squareHas=' ';\n if (squareHas==='e') squareHas=' ';\n if (squareHas==='f') squareHas=' ';\n if (squareHas==='g') squareHas=' ';\n if (squareHas==='i') squareHas=' ';\n if (squareHas==='j') squareHas=' ';\n if (squareHas==='q') squareHas=' ';\n if (squareHas==='r') squareHas=' ';\n\n if ( (bandMember.hasBomb>0) && (squareHas==='c') ) squareHas=' ';\n if ( (bandMember.hasGun>0) && ( (squareHas==='l') || (squareHas==='m') ) ) squareHas=' ';\n if ( (bandMember.hasLighter>0) && (squareHas==='n') ) squareHas=' ';\n\n if (squareHas==='W') { hitFlag=false; hitType=\"Wall\"; break; }\n if ( (squareHas!=='P') && (squareHas!==' ') ) { hitFlag=true; hitType=squareHas; break; }\n \n if ( (player1GridCol===col) && (player1GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"player1\"; break; }\n\n if (bandMember.party>BANDMEMBER_FIGHT_FACTOR) { \n if ( (bandMember.id!==\"bandMember1\") && (bandMember1GridCol===col) && (bandMember1GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember1\"; break; }\n if ( (bandMember.id!==\"bandMember2\") && (bandMember2GridCol===col) && (bandMember2GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember2\"; break; }\n if ( (bandMember.id!==\"bandMember3\") && (bandMember3GridCol===col) && (bandMember3GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember3\"; break; }\n if ( (bandMember.id!==\"bandMember4\") && (bandMember4GridCol===col) && (bandMember4GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember4\"; break; }\n }\n}\n\nif ( ( (hitFlag) && (!distance) ) || ( (hitFlag) && (distance) && (hitDistance<=distance) ) ) { \n if (hitDistance>0) lineOfSightHitResults.push({ \"direction\": \"W\", \"type\": hitType, \"distance\": hitDistance});\n}\n\n// Check East\nhitFlag=false;\nhitType=\"\";\nfor (let col=currentGridCol; col<=maxPlayfieldCol; col++) {\n let squareHas = currentGameLevel[currentGridRow][col];\n hitDistance=col-currentGridCol;\n\n if (squareHas==='P') squareHas=' ';\n if (squareHas==='d') squareHas=' ';\n if (squareHas==='e') squareHas=' ';\n if (squareHas==='f') squareHas=' ';\n if (squareHas==='g') squareHas=' ';\n if (squareHas==='i') squareHas=' ';\n if (squareHas==='j') squareHas=' ';\n if (squareHas==='q') squareHas=' ';\n if (squareHas==='r') squareHas=' ';\n\n if ( (bandMember.hasBomb>0) && (squareHas==='c') ) squareHas=' ';\n if ( (bandMember.hasGun>0) && ( (squareHas==='l') || (squareHas==='m') ) ) squareHas=' ';\n if ( (bandMember.hasLighter>0) && (squareHas==='n') ) squareHas=' ';\n\n if (squareHas==='W') { hitFlag=false; hitType=\"Wall\"; break; }\n if ( (squareHas!=='P') && (squareHas!==' ') ) { hitFlag=true; hitType=squareHas; break; }\n \n if ( (player1GridCol===col) && (player1GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"player1\"; break; }\n\n if (bandMember.party>BANDMEMBER_FIGHT_FACTOR) { \n if ( (bandMember.id!==\"bandMember1\") && (bandMember1GridCol===col) && (bandMember1GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember1\"; break; }\n if ( (bandMember.id!==\"bandMember2\") && (bandMember2GridCol===col) && (bandMember2GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember2\"; break; }\n if ( (bandMember.id!==\"bandMember3\") && (bandMember3GridCol===col) && (bandMember3GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember3\"; break; }\n if ( (bandMember.id!==\"bandMember4\") && (bandMember4GridCol===col) && (bandMember4GridRow===currentGridRow) ) {\n hitFlag=true; hitType=\"bandMember4\"; break; }\n }\n}\n\nif ( ( (hitFlag) && (!distance) ) || ( (hitFlag) && (distance) && (hitDistance<=distance) ) ) { \n if (hitDistance>0) lineOfSightHitResults.push({ \"direction\": \"E\", \"type\": hitType, \"distance\": hitDistance});\n}\n\nreturn lineOfSightHitResults;\n\n}", "title": "" }, { "docid": "e6cdde7eba2b115e86aec07cbed712e2", "score": "0.53281987", "text": "function SpawnCollectables(type, count)\n{\n for(var i = 0; i < count; i++ )\n {\n var startingPlace = CalcSP(maze, existingSessions, collectables);\n collectables.push({type:type, x: startingPlace.x, y: startingPlace.y});\n }\n}", "title": "" }, { "docid": "e5e4df50c2991809ed5d6648fa02f391", "score": "0.53248674", "text": "function spawnLocation() {\n\n //Breaking the entire cavas into a grid of tiles\n let rows = width / tileSize;\n let cols = height / tileSize;\n\n let xPos, yPos;\n\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * cols) * tileSize;\n\n return { x: xPos, y: yPos };\n}", "title": "" }, { "docid": "3db62c888ac27ab3af9060aae29a27c9", "score": "0.53209466", "text": "function useItem(x,y,z,i,b,s){\nif(i==280){//Id to hit the ground\ndx = x; dy = y; dz = z;\nsetTile(dx,dy+1,dz,200);//Loop Look\n}}", "title": "" }, { "docid": "3180f545adf38c174ab1a3a220f2552a", "score": "0.53143114", "text": "playerIsOnTheseTiles () {\n const p = this.player\n const playerPath = p.getCollisionPath()\n\n let left = Math.floor(playerPath.vertices[0].x)\n let right = left\n let bottom = Math.floor(playerPath.vertices[0].y)\n let top = bottom\n\n const theseTiles = []\n\n for (const vertex of playerPath.vertices) {\n const x = Math.floor(vertex.x)\n const y = Math.floor(vertex.y)\n left = Math.min(left, x)\n right = Math.max(right, x)\n bottom = Math.min(bottom, y)\n top = Math.max(top, y)\n if (y in this.tiles && x in this.tiles[y] && this.tiles[y][x] instanceof Tile && theseTiles.indexOf(this.tiles[y][x]) === -1) {\n theseTiles.push(this.tiles[y][x])\n }\n }\n\n for (let y = bottom; y <= top; y++) {\n for (let x = left; x <= right; x++) {\n if (y in this.tiles && x in this.tiles[y] && this.tiles[y][x] instanceof Tile) {\n const corner = [new Vect(x, y, 0), new Vect(x + 1, y, 0), new Vect(x, y + 1, 0), new Vect(x + 1, y + 1, 0)].reduce((u, v) => p.position.substract(u).lengthSquared() < p.position.substract(v).lengthSquared() ? u : v)\n\n if (theseTiles.indexOf(this.tiles[y][x]) === -1 && Collisions.isPointInPath(corner, playerPath)) {\n theseTiles.push(this.tiles[y][x])\n }\n }\n }\n }\n\n return theseTiles\n }", "title": "" }, { "docid": "73fdd22ca47a2992a32b03798be1fe8a", "score": "0.5312524", "text": "function tileMath(x, y) {\n return [1 + (x - (x % 32)) / 32, 300 - (y - (y % 32)) / 32];\n }", "title": "" }, { "docid": "b75e0b33949e639bab006bc4201519e0", "score": "0.53032184", "text": "extract_block(radius/*:number*/, center /*:[number,number,number]*/) {\n const grid = this.grid;\n const unit_cell = this.unit_cell;\n if (grid == null || unit_cell == null) return;\n const fc = unit_cell.fractionalize(center);\n const r = [radius / unit_cell.parameters[0],\n radius / unit_cell.parameters[1],\n radius / unit_cell.parameters[2]];\n const grid_min = grid.frac2grid([fc[0] - r[0], fc[1] - r[1], fc[2] - r[2]]);\n const grid_max = grid.frac2grid([fc[0] + r[0], fc[1] + r[1], fc[2] + r[2]]);\n const size = [grid_max[0] - grid_min[0] + 1,\n grid_max[1] - grid_min[1] + 1,\n grid_max[2] - grid_min[2] + 1];\n let points = [];\n let values = [];\n for (let i = grid_min[0]; i <= grid_max[0]; i++) {\n for (let j = grid_min[1]; j <= grid_max[1]; j++) {\n for (let k = grid_min[2]; k <= grid_max[2]; k++) {\n const frac = grid.grid2frac(i, j, k);\n const orth = unit_cell.orthogonalize(frac);\n points.push(orth);\n const map_value = grid.get_grid_value(i, j, k);\n values.push(map_value);\n }\n }\n }\n this.block.set(points, values, size);\n }", "title": "" }, { "docid": "6ea7f63fbbb8e2f82a565ce70a90ea3c", "score": "0.5299369", "text": "function calcTilePosition(tilelat, tilelon, angleradiansx, angleradiansy) {\n\t//var angleradians = Math.max(angleradiansx, angleradiansy);\n\tvar tana = Math.tan(angleradiansy/2);\n\tvar tiledepth = A / Math.sqrt(1+2*tana*tana);\n\tvar tilewidth = tilesizefactor * tilescalefactor * 2.0 * tiledepth * tana;\n\n\tvar tilepos = calcXYZ(tilelat, tilelon);\n\n\tif( tilelat < 90 && tilelat > -90 ) {\n\t var tileup = calcXYZ(tilelat+0.0001, tilelon);\n\t var tileright = calcXYZ(tilelat, tilelon+0.0001);\n\t} else {\n\t if( tilelat > 0 ) {\n\t\tvar tileup = { x: tilepos.x - 1, y: tilepos.y, z: tilepos.z };\n\t\tvar tileright = { x: tilepos.x, y: tilepos.y+1, z: tilepos.z };\n\t } else {\n\t\tvar tileup = { x: tilepos.x + 1, y: tilepos.y, z: tilepos.z };\n\t\tvar tileright = { x: tilepos.x, y: tilepos.y-1, z: tilepos.z };\n\t }\n\t}\n\n\tvar tiledivwidth = 256;\n\n\tvar tilex = vecm.normalize(vecm.difference(tilepos, tileright));\n\tvar tiley = vecm.normalize(vecm.difference(tileup, tilepos));\n\tvar tilez = vecm.normalize(vecm.difference(tilepos, {x:0, y:0, z:0}));\n\ttilex = vecm.normalize(vecm.crossp(tiley, tilez));\n\ttilez = vecm.normalize(vecm.crossp(tilex, tiley));\n\ttiley = vecm.normalize(vecm.crossp(tilez, tilex));\n\t\n\ttilepos = vecm.normalize(tilepos, tiledepth);\n\n\n\tvar tilecorner = {\n\t x: tilepos.x - 0.5 * tilewidth * ( tilex.x + tiley.x ),\n\t y: tilepos.y - 0.5 * tilewidth * ( tilex.y + tiley.y ),\n\t z: tilepos.z - 0.5 * tilewidth * ( tilex.z + tiley.z )\n\t};\n\n\tvar tileborder = {\n\t x: tilepos.x - 0.5 * tilewidth * tilex.x,\n\t y: tilepos.y - 0.5 * tilewidth * tilex.y,\n\t z: tilepos.z - 0.5 * tilewidth * tilex.z\n\t}\n\t\n\t// rotate 180 deg around z\n\tvar cosa = Math.cos(Math.PI);\n\tvar sina = Math.sin(Math.PI);\n\tvar tilerotate = [ // not used at this time\n\t cosa, -sina, 0, tiledivwidth,\n\t sina, cosa, 0, tiledivwidth,\n\t 0, 0, 1, 0,\n\t 0, 0, 0, 1\n\t];\n\t\n\tvar tileorientation = [\n\t tilex.x, tiley.x, -tilez.x, tilecorner.x,\n\t tilex.y, tiley.y, -tilez.y, tilecorner.y,\n\t tilex.z, tiley.z, -tilez.z, tilecorner.z,\n\t 0, 0, 0, 1\n\t];\n\tvar scale = tilewidth / tiledivwidth;\n\tvar tilescale = [ \n\t scale, 0, 0, 0,\n\t 0, scale, 0, 0,\n\t 0, 0, scale, 0,\n\t 0, 0, 0, 1\n\t];\n\n\t//printmat('tileorientation new', tileorientation);\n\t//printmat('tilescale new', tilescale);\n\t\n\tvar matrix = vecm.matrixmultiply(tileorientation, tilescale);\n\n\tvar angledegx = angleradiansx / Math.PI * 180;\n\tvar angledegy = angleradiansy / Math.PI * 180;\n\n\tvar lonextra = angledegy*(tilescalefactor-1)/2;\n\n\tvar backplane = { a: -tilez.x, b: -tilez.y, c: -tilez.z, d: 0 };\n\tvar frontplane = { a: -tilez.x, b: -tilez.y, c: -tilez.z, \n \t d: vecm.dotp(tilez, tilepos) };\n\t\n\tvar position = {\n\t lat: tilelat,\n\t latmin: tilelat - angledegy/2,\n\t latmax: tilelat + angledegy/2,\n\t lon: tilelon,\n\t lonmin: tilelon - angledegx/2,\n\t lonmax: tilelon + angledegx/2,\n\t widthpx: tiledivwidth,\n\t radius: 1.41421356237 * tilewidth / tilesizefactor,\n\t width: tilewidth / tilesizefactor,\n\t tilewidth: tilewidth,\n\t tilescale: 1.0 / tilesizefactor,\n\t depth: tiledepth,\n\t height: tiledepth - A,\n\t center: tilepos,\n\t corner: tilecorner,\n\t border: tileborder,\n\t right: tilex,\n\t down: tiley,\n\t transform: matrix\n\t};\n\n\tif( position.latmin < -90 ) {\n\t position.latmin = -90;\n\t position.lonmin = -180;\n\t position.lonmax = 180;\n\t}\n\tif( position.latmax > 90 ) {\n\t position.latmax = 90;\n\t position.lonmin = -180;\n\t position.lonmax = 180;\n\t}\n\n\tvar latdiff = 0;//(position.latmax - position.latmin)/10;\n\tposition.waterarea = [\n\t [ position.latmax + latdiff, position.lonmin-lonextra/3 ],\n\t [ position.latmax + latdiff, position.lonmax+lonextra/3 ],\n\t [ position.latmax, position.lonmax+lonextra/3 ],\n\t [ position.latmin, position.lonmax+lonextra/3 ],\n\t [ position.latmin - latdiff, position.lonmax+lonextra/3 ],\n\t [ position.latmin - latdiff, position.lonmin-lonextra/3 ],\n\t [ position.latmin, position.lonmin-lonextra/3 ],\n\t [ position.latmax, position.lonmin-lonextra/3 ] \n\t];\n\n\tvar top = calcXYZ(position.latmax, position.lonmin).z;\n\tvar bottom = calcXYZ(position.latmin, position.lonmin).z;\n\n\tposition.planes = {\n\t back: backplane,\n\t front: frontplane,\n\t top: vecm.createplane(calcXYZ(position.latmax, position.lonmin),\n\t\t\t\t calcXYZ(position.latmax, position.lonmax),\n\t\t\t\t { x:0, y: 0, z: top }),\n\t bottom: vecm.createplane(calcXYZ(position.latmin, position.lonmin),\n\t\t\t\t { x:0, y: 0, z: bottom },\n\t\t\t\t calcXYZ(position.latmin, position.lonmax)),\n\t miny: vecm.createplane(calcXYZ(position.latmin, position.lonmin),\n\t\t\t calcXYZ(position.latmin, position.lonmax),\n\t\t\t calcXYZ(position.latmin, position.lonmax, 100)),\n\t maxy: vecm.createplane(calcXYZ(position.latmax, position.lonmax, 100),\n\t\t\t calcXYZ(position.latmax, position.lonmax),\n\t\t\t calcXYZ(position.latmax, position.lonmin)),\n\t minx: vecm.createplane(calcXYZ(position.latmax, position.lonmin-lonextra, 100),\n\t\t\t calcXYZ(position.latmax, position.lonmin-lonextra),\n\t\t\t calcXYZ(position.latmin, position.lonmin-lonextra)),\n\t maxx: vecm.createplane(calcXYZ(position.latmin, position.lonmax+lonextra),\n\t\t\t calcXYZ(position.latmax, position.lonmax+lonextra),\n\t\t\t calcXYZ(position.latmax, position.lonmax+lonextra, 100))\n\t}\n\treturn position;\n }", "title": "" }, { "docid": "bc50bbdfeae392c9695450d9d1b51f2b", "score": "0.52980155", "text": "function parseData() {\n\t\t//$log.log(preDebugMsg + \"parseData\");\n\t\tparsingDataNow = true;\n\t\tresetVars();\n\t\tvar firstNonNullData = true;\n\t\tvar minXVal = 0;\n\t\tvar maxXVal = 0;\n\t\tvar minYVal = 0;\n\t\tvar maxYVal = 0;\n\t\tvar dataIsCorrupt = false;\n\n\t\tfor(var src = 0; src < dataMappings.length; src++) {\n\t\t\t// not done this way, dataMappings[src].activate(dataMappings[src].active);\n\t\t\tif(dataMappings[src].active) {\n\t\t\t\tvar w = $scope.getWebbleByInstanceId(dataMappings[src].srcID);\n\t\t\t\tvar ls = w.scope().gimme(dataMappings[src].slotName);\n\n\t\t\t\tfor(var f = 0; f < dataMappings[src].map.length; f++) {\n\t\t\t\t\tvar fieldInfo = ls[dataMappings[src].map[f].srcIdx];\n\t\t\t\t\tdataMappings[src].map[f].listen = fieldInfo.listen;\n\n\t\t\t\t\tif(dataMappings[src].map[f].name == \"dataX\") {\n\t\t\t\t\t\tvar lenX = fieldInfo.size;\n\t\t\t\t\t\tdataMappings[src].xFun = fieldInfo.val;\n\t\t\t\t\t\tdataMappings[src].selFun = fieldInfo.sel;\n\t\t\t\t\t\tdataMappings[src].size = lenX;\n\t\t\t\t\t\tdataMappings[src].newSelections = fieldInfo.newSel;\n\t\t\t\t\t}\n\t\t\t\t\tif(dataMappings[src].map[f].name == \"dataY\") {\n\t\t\t\t\t\tvar lenY = fieldInfo.size;\n\t\t\t\t\t\tdataMappings[src].yFun = fieldInfo.val;\n\t\t\t\t\t\tdataMappings[src].newSelections = fieldInfo.newSel;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdataMappings[src].clean = true;\n\t\t}\n\n\t\tfor(var src = 0; !dataIsCorrupt && src < dataMappings.length; src++) {\n\t\t\tvar fx = dataMappings[src].xFun;\n\t\t\tvar fy = dataMappings[src].yFun;\n\n\t\t\tfor(i = 0; !dataIsCorrupt && i < dataMappings[src].size; i++) {\n\t\t\t\tx = fx(i);\n\t\t\t\ty = fy(i);\n\n\t\t\t\tif(x !== null && y !== null) {\n\t\t\t\t\tunique++;\n\n\t\t\t\t\tif(firstNonNullData) {\n\t\t\t\t\t\tif(typeof x == 'number') {\n\t\t\t\t\t\t\txType = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(x instanceof Date) {\n\t\t\t\t\t\t\txType = 1;\n\t\t\t\t\t\t\t//x = x.getTime();\n\t\t\t\t\t\t\tx = new Date(x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof x == 'string') {\n\t\t\t\t\t\t\txType = 2;\n\t\t\t\t\t\t\tx = Date.parse(x); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\tvar xs = x.toString().substr(0,32);\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + xs + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(typeof y == 'number') {\n\t\t\t\t\t\t\tyType = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y instanceof Date) {\n\t\t\t\t\t\t\tyType = 1;\n\t\t\t\t\t\t\t//y = y.getTime();\n\t\t\t\t\t\t\ty = new Date(y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof y == 'string') {\n\t\t\t\t\t\t\tyType = 2;\n\t\t\t\t\t\t\ty = Date.parse(y); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\tvar ys = y.toString().substr(0,32);\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + ys + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tminXVal = x;\n\t\t\t\t\t\tmaxXVal = x;\n\t\t\t\t\t\tminYVal = y;\n\t\t\t\t\t\tmaxYVal = y;\n\n\t\t\t\t\t\tfirstNonNullData = false;\n\t\t\t\t\t}\n\t\t\t\t\telse { // not first non-null data\n\t\t\t\t\t\tif(typeof x == 'number') {\n\t\t\t\t\t\t\tif(xType != 0) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(x instanceof Date) {\n\t\t\t\t\t\t\tif(xType != 1) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//x = x.getTime();\n\t\t\t\t\t\t\tx = new Date(x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof x == 'string') {\n\t\t\t\t\t\t\tif(xType != 2) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tx = Date.parse(x); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + x + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(typeof y == 'number') {\n\t\t\t\t\t\t\tif(yType != 0) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y instanceof Date) {\n\t\t\t\t\t\t\tif(yType != 1) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//y = y.getTime();\n\t\t\t\t\t\t\ty = new Date(y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof y == 'string') {\n\t\t\t\t\t\t\tif(yType != 2) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ty = Date.parse(y); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + y + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tminXVal = Math.min(x, minXVal);\n\t\t\t\t\t\tmaxXVal = Math.max(x, maxXVal);\n\t\t\t\t\t\tminYVal = Math.min(y, minYVal);\n\t\t\t\t\t\tmaxYVal = Math.max(y, maxYVal);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isNaN(x) || isNaN(y)) {\n\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tNULLs++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(firstNonNullData) {\n\t\t\tdataIsCorrupt = true; // only null values\n\t\t}\n\n\t\tif(!dataIsCorrupt) {\n\t\t\tlimits = {};\n\n\t\t\tif(minXVal == maxXVal) {\n\t\t\t\tminXVal--;\n\t\t\t\tmaxXVal++;\n\t\t\t}\n\n\t\t\tif(minYVal == maxYVal) {\n\t\t\t\tminYVal--;\n\t\t\t\tmaxYVal++;\n\t\t\t}\n\n\t\t\tlimits.minX = minXVal;\n\t\t\tlimits.maxX = maxXVal;\n\t\t\tlimits.minY = minYVal;\n\t\t\tlimits.maxY = maxYVal;\n\t\t\tlimits.spanX = maxXVal - minXVal;\n\t\t\tlimits.spanY = maxYVal - minYVal;\n\t\t\tif(limits.spanX <= 0) {\n\t\t\t\tlimits.spanX = 1;\n\t\t\t}\n\t\t\tif(limits.spanY <= 0) {\n\t\t\t\tlimits.spanY = 1;\n\t\t\t}\n\n\t\t\tzoomMinX = limits.minX;\n\t\t\tzoomMaxX = limits.maxX;\n\t\t\tzoomMinY = limits.minY;\n\t\t\tzoomMaxY = limits.maxY;\n\t\t\t$scope.set(\"MinX\", limits.minX);\n\t\t\t$scope.set(\"MaxX\", limits.maxX);\n\t\t\t$scope.set(\"MinY\", limits.minY);\n\t\t\t$scope.set(\"MaxY\", limits.maxY);\n\n\t\t\tif(xType == 1 || xType == 2) {\n\t\t\t\tif(limits.minX == limits.maxX) {\n\t\t\t\t\tlimits.dateFormatX = 'full';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar d1 = new Date(limits.minX);\n\t\t\t\t\tvar d2 = new Date(limits.maxX);\n\t\t\t\t\tif(d2.getFullYear() - d1.getFullYear() > 10) {\n\t\t\t\t\t\tlimits.dateFormatX = 'onlyYear';\n\t\t\t\t\t}\n\t\t\t\t\telse if(d2.getFullYear() - d1.getFullYear() > 1) {\n\t\t\t\t\t\tlimits.dateFormatX = 'yearMonth';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar days = (d2.getTime() - d1.getTime()) / (24*3600*1000);\n\t\t\t\t\t\tif(d2.getMonth() != d1.getMonth()) {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'monthDay';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 5) {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'day';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 1) {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'dayTime';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'time';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(yType == 1 || yType == 2) {\n\t\t\t\tif(limits.minY == limits.maxY) {\n\t\t\t\t\tlimits.dateFormatY = 'full';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar d1 = new Date(limits.minY);\n\t\t\t\t\tvar d2 = new Date(limits.maxY);\n\t\t\t\t\tif(d2.getFullYear() - d1.getFullYear() > 10) {\n\t\t\t\t\t\tlimits.dateFormatY = 'onlyYear';\n\t\t\t\t\t}\n\t\t\t\t\telse if(d2.getFullYear() - d1.getFullYear() > 1) {\n\t\t\t\t\t\tlimits.dateFormatY = 'yearMonth';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar days = (d2.getTime() - d1.getTime()) / (24*3600*1000);\n\t\t\t\t\t\tif(d2.getMonth() != d1.getMonth()) {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'monthDay';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 5) {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'day';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 1) {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'dayTime';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'time';\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//$log.log(preDebugMsg + \"parseData limits: \" + JSON.stringify(limits));\n\t\t}\n\n\t\tif(dataIsCorrupt) {\n\t\t\t//$log.log(preDebugMsg + \"data is corrupt\");\n\n\t\t\tfor(var src = 0; src < dataMappings.length; src++) {\n\t\t\t\tfor(var f = 0; f < dataMappings[src].map.length; f++) {\n\t\t\t\t\tif(dataMappings[src].map[f].listen !== null) {\n\t\t\t\t\t\t//$log.log(preDebugMsg + \"Data corrupt, stop listening to \" + dataMappings[src].map[f].name + \" \" + dataMappings[src].map[i].srcIdx);\n\t\t\t\t\t\tdataMappings[src].map[f].listen(myInstanceId, false, null, null, []);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresetVars();\n\t\t}\n\n\t\tif(unique > 0) {\n\t\t\tvar giveUp = checkSelectionsAfterNewData();\n\t\t\tif(giveUp) {\n\t\t\t\t$scope.selectAll();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tupdateLocalSelections(false);\n\t\t\t\tsaveSelectionsInSlot();\n\t\t\t}\n\t\t}\n\t\telse { // no data\n\t\t\tupdateLocalSelections(false);\n\n\t\t\tif(selectionCtx === null) {\n\t\t\t\tselectionCtx = selectionCanvas.getContext(\"2d\");\n\t\t\t\tvar W = selectionCanvas.width;\n\t\t\t\tvar H = selectionCanvas.height;\n\t\t\t\tselectionCtx.clearRect(0,0, W,H);\n\t\t\t}\n\t\t}\n\t\tparsingDataNow = false;\n\t\tupdateGraphicsHelper(false, true, true);\n\t}", "title": "" }, { "docid": "4b2397b5097b5f3c57b2036db597dd5f", "score": "0.5293831", "text": "function start() {\n\tfor (i = 0; i < boxesArray.length; i++) {\n\t\t// This condition is checking the boxArray for any objects with position set to true\n\t\tif (boxesArray[i].position === true) {\n\t\t\t// When it finds an object with position set to true it puts an image in the corresponding box\n\t\t\tdocument.getElementById(boxesArray[i].boxSelect).src = imageSmile;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "221327117c1ebda5e00593b0376f388d", "score": "0.5293298", "text": "function getBoardTile(x, y) {\n var i, j;\n i = 0;\n while (i < 5) {\n j = 0;\n while (j < 5) {\n var id = \"row_\" + i + \"_column_\" + j + \"_\" + document.currRotation;\n var elem = document.getElementById(id);\n var bound = elem.getBoundingClientRect();\n var xMatch = x >= bound.left && x <= bound.right;\n var yMatch = y >= bound.top && y <= bound.bottom;\n if (xMatch && yMatch)\n return [id, elem.innerText];\n\n j++;\n }\n i++;\n }\n}", "title": "" }, { "docid": "0d6098769523a4693ae90378685b0d75", "score": "0.52882594", "text": "function getAvailableGridPoints_Spawn() : Array {\r\n\tvar availableGridPoints : Array = new Array();\r\n\tvar ii : int;\r\n\tvar jj : int;\r\n\tfor ( jj = gridSizeZ-2; jj >= 1; jj-- ) {\r\n\t\tfor ( ii = 1; ii < gridSizeX-1; ii++ ) {\r\n\t\t\tif ( canMoveGrid[ii, jj] ) {\r\n\t\t\t\tavailableGridPoints.Push(new Vector2(ii,jj));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn availableGridPoints;\r\n}", "title": "" }, { "docid": "4ac197bf58c9c6d8dd7320fae4503ba7", "score": "0.52880555", "text": "function setIntTiles(tileIdx, tile)\n{\n switch(tileIdx)\n {\n case 60: // Regular locker.\n tile.img = tileImages[60];\n tile.playerAt = false;\n tile.search = true;\n itemTiles.push(tile);\n break;\n\t\tcase 17: //locker against wall bottom (up)\n\t\t\ttile.img = tileImages[17];\n\t\t\ttile.collider.h = 32;\n\t\t\ttile.playerAt = false;\n tile.search = true;\n itemTiles.push(tile);\n\t\t\tbreak;\n\t\tcase 19: //locker against wall bottom (left)\n\t\t\ttile.img = tileImages[19];\n\t\t\ttile.collider.w = 32;\n\t\t\ttile.playerAt = false;\n tile.search = true;\n itemTiles.push(tile);\n\t\t\tbreak;\n\t\tcase 21: // locker against wall bottom (right)\n tile.img = tileImages[21];\n tile.collider.x += 32;\n tile.collider.w = 32;\n\t\t\ttile.playerAt = false;\n tile.search = true;\n itemTiles.push(tile);\n break;\n\t\tcase 22: // locker against wall top (down)\n tile.img = tileImages[22];\n tile.collider.y += 32;\n tile.collider.h = 32;\n\t\t\ttile.playerAt = false;\n tile.search = true;\n itemTiles.push(tile);\n break;\n case 25: // File shelf bottom (up).\n tile.img = tileImages[25];\n tile.collider.h = 32;\n break;\n case 27: // File shelf bottom (left).\n tile.img = tileImages[27];\n tile.collider.w = 32;\n break;\n case 29: // File shelf bottom (right).\n tile.img = tileImages[29];\n tile.collider.x += 32;\n tile.collider.w = 32;\n break;\n case 31: // File shelf bottom (down).\n tile.img = tileImages[31];\n tile.collider.y += 32;\n tile.collider.h = 32;\n break;\n case 33: // Server tower bottom (up).\n tile.img = tileImages[33];\n tile.collider.h = 32;\n break;\n case 35: // Server tower bottom (left).\n tile.img = tileImages[35];\n tile.collider.w = 32;\n break;\n case 37: // Server tower bottom (right).\n tile.img = tileImages[37];\n tile.collider.x += 32;\n tile.collider.w = 32;\n break;\n case 39: // Server tower bottom (down).\n tile.img = tileImages[39];\n tile.collider.y += 32;\n tile.collider.h = 32;\n break;\n case 41: // Tape storage bottom (up).\n tile.img = tileImages[41];\n tile.collider.h = 32;\n break;\n case 43: // Tape storage bottom (left).\n tile.img = tileImages[43];\n tile.collider.w = 32;\n break;\n case 45: // Tape storage bottom (right).\n tile.img = tileImages[45];\n tile.collider.x += 32;\n tile.collider.w = 32;\n break;\n case 47: // Tape storage bottom (down).\n tile.img = tileImages[47];\n tile.collider.y += 32;\n tile.collider.h = 32;\n break;\n case 50: // Desk 1 left bottom (up).\n tile.img = tileImages[50];\n tile.collider.h = 32;\n break;\n case 51: // Desk 1 right bottom (up).\n tile.img = tileImages[51];\n tile.collider.h = 32;\n break;\n case 57: // Vending machines bottom (up).\n tile.img = tileImages[57];\n tile.collider.h = 32;\n break;\n case 65: // Washing machine bottom (up).\n tile.img = tileImages[65];\n tile.collider.h = 32;\n break;\n case 67: // Dryer bottom (up).\n tile.img = tileImages[67];\n tile.collider.h = 32;\n break;\n case 71: // Urinal bottom (up).\n tile.img = tileImages[71];\n tile.collider.h = 32;\n break;\n case 78: // Bottom left bathroom sinks (up).\n tile.img = tileImages[78];\n tile.collider.h = 32;\n break;\n case 79: // Bottom right bathroom sinks (up).\n tile.img = tileImages[79];\n tile.collider.h = 32;\n break;\n default:\n tile.img = tileImages[tileIdx];\n break;\n }\n}", "title": "" }, { "docid": "10c6edd500eda971c3a2588dc287e801", "score": "0.52810824", "text": "constructor(tileset, tilesize, width, height) {\n super(width, height);\n this.ts = tilesize;\n this.img = createGraphics(tilesize*width,tilesize*height);\n //TODO: find out if graphics or image is better\n this.tileset = tileset;\n this.tileset.loadPixels();\n let w = round(this.tileset.width / tilesize);\n let h = round(this.tileset.height / tilesize);\n this.indexOf = {};\n let k = 0;\n //index all the tiles, from top to bottom left to right\n for (let j = 0; j < h; j++) {\n for (let i = 0; i < w; i++) {\n this.indexOf[k] = {\n x : i,\n y : j\n }\n k++;\n }\n };\n }", "title": "" }, { "docid": "d12c8c7316a34ba42ce3659bb7ad8281", "score": "0.527633", "text": "generate() {\n // New boxes\n const boxes = [];\n\n for (var i = -1; i < 2; i++) {\n for (var j = -1; j < 2; j++) {\n for (var k = -1; k < 2; k++) {\n const sum = abs(i) + abs(j) + abs(k);\n\n // Only create box if it's not a center box\n if (sum > 1) {\n const newSize = this.size/3;\n boxes.push(new Box(this.x + i*newSize, this.y + j*newSize,\n this.z + k*newSize, newSize));\n }\n }\n }\n }\n \n return boxes;\n }", "title": "" }, { "docid": "6b4605b876bcba7b36b069e2e761c646", "score": "0.52601534", "text": "getCoords(x, y)\n {\n let coords = {};\n coords.x = (x*this.tileSize) + this.tileSize / 2;\n coords.y = (y* this.tileSize) + this.tileSize / 2;\n\n return coords;\n }", "title": "" }, { "docid": "285614880dfa8cd76aaa631980c4e7ca", "score": "0.5253634", "text": "function setInRange() {\n //Set up all necessary variables\n let tileX = $(`#${clickedTile}`).data(\"info\").x;\n let tileY = $(`#${clickedTile}`).data(\"info\").y;\n\n // It might be possible to simplify these, but in all honesty this is just my level of smartness\n // and I can not go beyond it at this point. Hell, I'm happy to have worked this out in the first\n // place.\n //\n let searchY = tileY - radius;\n let searchX = tileX - 0;\n let startingX = searchX;\n let hitPeak = false;\n\n //Run the loope twice, counting up and then down!\n for (let y = 0; y < 2; y++) {\n //For when counting up, do the following\n if (hitPeak === false) {\n let width = 1;\n for (let i = 0; i < radius; i++) {\n for (let w = 0; w < width; w++) {\n //ignore the tile if it is off the map\n if ((allTilesIDs.includes(`${searchY}-${searchX}`)) === false) {} else {\n //Set the relevant tiles to be \"in range\" of the city!\n $(`#${searchY}-${searchX}`).css(\"border-color\", \"red\");\n $(`#${searchY}-${searchX}`).css(\"color\", \"white\");\n $(`#${searchY}-${searchX}`).data(\"info\").cityRange = true;\n $(`#${searchY}-${searchX}`).css('animation-name', \"border\");\n $(`#${searchY}-${searchX}`).css('animation-duration', \"2s\");\n $(`#${searchY}-${searchX}`).css('animation-iteration-count', \"infinite\");\n }\n searchX += 1;\n }\n //update variables for next loop\n width += 2;\n searchY += 1;\n startingX -= 1;\n searchX = startingX;\n }\n //mark that the mid point has been reached\n if (searchY === tileY) {\n hitPeak = true; //yeah boiiiii\n }\n\n //when the mid-point has been passed, we instead run the follow for loop,\n //which counts down instead of up\n } else {\n let width = ((radius * 2) + 1);\n for (let i = 0; i < (radius + 1); i++) {\n for (let w = 0; w < width; w++) {\n if ((allTilesIDs.includes(`${searchY}-${searchX}`)) === false) {\n console.log(\"Undefined tile ignored.\")\n } else {\n //Set the relevant tiles to be \"in range\" of the city!\n $(`#${searchY}-${searchX}`).css(\"border-color\", \"red\");\n $(`#${searchY}-${searchX}`).css(\"color\", \"white\");\n $(`#${searchY}-${searchX}`).data(\"info\").cityRange = true;\n $(`#${searchY}-${searchX}`).css('animation-name', \"border\");\n $(`#${searchY}-${searchX}`).css('animation-duration', \"2s\");\n $(`#${searchY}-${searchX}`).css('animation-iteration-count', \"infinite\");\n }\n searchX += 1;\n }\n //Add to variables to move row and column\n width -= 2;\n searchY += 1;\n startingX += 1;\n searchX = startingX;\n }\n };\n };\n}", "title": "" }, { "docid": "1fdba09bb3723386f517c6aa9cc709e4", "score": "0.5251282", "text": "findObjectBorder(obj, origin)\n {\n let squares = [];\n let width = Math.floor(obj.sprite.width/32);\n let height = Math.floor(obj.sprite.height/32);\n\n let x = obj.x;\n let y = obj.y;\n //North\n for(let i = 0; i < width; i++)\n {\n if(this.navmap[x+i][y-1] != 1)\n {\n if(!this.isOccupied(x+i, y-1))\n {\n let d = this.getDistance(x+i, y-1, origin);\n squares.push({x :x+i, y: y-1, d:d});\n }\n }\n }\n\n //South\n for(let i = 0; i < width; i++)\n {\n if(this.navmap[x+i][y+ height] != 1)\n {\n if(!this.isOccupied(x+i, y + height))\n {\n let d = this.getDistance(x+1, y + height, origin);\n squares.push({x :x+i, y: y + height, d:d});\n }\n }\n }\n\n //WEST\n for(let i = 0; i < height; i++)\n {\n if(this.navmap[x-1][y+i] != 1)\n {\n if(!this.isOccupied(x-1, y+i))\n {\n let d = this.getDistance(x-1, y+i, origin);\n squares.push({x :x-1, y: y+i, d:d});\n }\n }\n }\n\n //EAST\n for(let i = 0; i < height; i++)\n {\n if(this.navmap[x + width][y+i] != 1)\n {\n if(!this.isOccupied(x + width, y+i))\n {\n let d = this.getDistance(x + width, y+i, origin);\n squares.push({x :x + width, y: y+i, d:d});\n }\n }\n }\n\n //NorthWest\n if(this.navmap[x-1][y-1] != 1)\n {\n if(!this.isOccupied(x-1, y-1))\n {\n let d = this.getDistance(x-1, y-1, origin);\n squares.push({x : x-1, y : y-1, d:d});\n }\n }\n\n //NorthEast\n if(this.navmap[x + width][y-1] != 1)\n {\n if(!this.isOccupied(x + width, y-1))\n {\n let d = this.getDistance(x + width, y-1, origin);\n squares.push({x : x + width, y : y-1, d:d});\n }\n }\n\n //SouthWest\n if(this.navmap[x-1][y + height] != 1)\n {\n if(!this.isOccupied(x-1, y + height))\n {\n let d = this.getDistance(x-1, y + height, origin);\n squares.push({x : x-1, y : y + height, d:d});\n }\n }\n\n //SouthEast\n if(this.navmap[x + width][y + height] != 1)\n {\n if(!this.isOccupied(x + width, y + height))\n {\n let d = this.getDistance(x + width, y + height, origin);\n squares.push({x : x + width, y : y + height, d:d});\n }\n }\n\n squares.sort(function(a,b){return a.d-b.d});\n return squares; \n\n \n }", "title": "" }, { "docid": "908c6836f36d23e99b9bcc4a96f8a441", "score": "0.5250941", "text": "_getBlocksAtCardinals() {\n\t\tlet startX = this.coords.x,\n\t\t\tstartY = this.coords.y,\n\t\t\tyUpperBound = this.game.grid[startX].length,\n\t\t\tblocks = [];\n\n\t\tif ((startY - 1) >= 0) {\n\t\t\tlet upperBlock = this.game.grid[startX][startY - 1];\n\t\t\tif (upperBlock) {\n\t\t\t\tblocks.push(this.game.grid[startX][startY - 1]);\n\t\t\t}\n\t\t}\n\n\t\tif ((startY + 1) < yUpperBound) {\n\t\t\tlet bottomBlock = this.game.grid[startX][startY + 1];\n\t\t\tif (bottomBlock) {\n\t\t\t\tblocks.push(this.game.grid[startX][startY + 1]);\n\t\t\t}\n\t\t}\n\n\t\tif ((startX - 1) >= 0) {\n\t\t\tlet leftBlock = this.game.grid[startX - 1][startY];\n\t\t\tif (!!leftBlock) {\n\t\t\t\tblocks.push(this.game.grid[startX - 1][startY]);\n\t\t\t}\n\t\t}\n\n\t\tif ((startX + 1) < 5) {\n\t\t\tlet rightBlock = this.game.grid[startX + 1][startY];\n\t\t\tif (rightBlock) {\n\t\t\t\tblocks.push(this.game.grid[startX + 1][startY]);\n\t\t\t}\n\t\t}\n\n\t\treturn blocks;\n\t}", "title": "" }, { "docid": "485d4f4b8eed1a3fef5734dd73f760ca", "score": "0.5250851", "text": "function generateTileMap()\n {\n for( var y = 0; y < rows ; y++ )\n {\n // create an array row in the array\n tileGridArray[y] = [];\n\n for( var x = 0; x < cols ; x++ )\n {\n // create a new tile object\n var tile = new Tile({\n 'mine' : isMine(),\n 'x' : x * tileWidth,\n 'y' : y * tileHeight,\n 'row' : y,\n 'col' : x,\n });\n \n // push the tile to our tile array\n tileGridArray[y].push( tile );\n \n // draw the tile onto the screen\n renderTile( tile );\n } \n }\n\n // check result\n console.log( tileGridArray );\n }", "title": "" }, { "docid": "0377b8b4f5dea1088283ce219ce08f37", "score": "0.52471685", "text": "update() {\n this.ctx.fillStyle = 'white'\n this.ctx.fillRect(0, 0, canvas.width, canvas.height)\n\n let max = 0\n let lowest = Infinity\n let totalDb = 0\n\n for(let x in this.grid) {\n for(let y in this.grid[x]) {\n //this gets executed for every tile\n\n \n this.ctx.beginPath()\n\n let totalwattmeter2 = 0\n\n for(let speaker of this.speakers) {\n let distance = Math.sqrt((speaker.x-x)**2 + (speaker.y-y)**2 + (8-2)**2)\n totalwattmeter2 += (speaker.watt)/(4*Math.PI*(distance**2))\n }\n\n\n this.grid[x][y].wattmeter2 = totalwattmeter2\n this.grid[x][y].irel = totalwattmeter2/I0\n let decibel = 0\n if(totalwattmeter2 == 0) decibel = 0\n else decibel = this.grid[x][y].decibel = 10*Math.log10(this.grid[x][y].irel) - protection\n\n if(decibel > this.range[0]) this.ctx.fillStyle = heatMapColorforValue((decibel - this.range[0])/(this.range[1]-this.range[0]))\n else this.ctx.fillStyle = heatMapColorforValue(0)\n \n //if tile is speaker\n if(this.speakers.findIndex(s => s.x == x && s.y == y) != -1) this.ctx.fillStyle = 'black'\n else {\n if(this.grid[x][y].decibel > max) max = this.grid[x][y].decibel \n else if(this.grid[x][y].decibel < lowest) lowest = this.grid[x][y].decibel\n \n totalDb += this.grid[x][y].decibel\n }\n \n\n \n \n //choose the color of the block\n this.ctx.rect(this.spacingX*x, this.spacingY*y, this.spacingX, this.spacingY)\n this.ctx.fill()\n\t\t\n }\n }\n\n\n\n\t\n document.getElementById('speakersAmount').innerHTML = this.speakers.length\n document.getElementById('highestDb').innerHTML = Math.round(max*100)/100\n document.getElementById('lowestDb').innerHTML = Math.round(lowest*100)/100\n document.getElementById('gridaverage').innerHTML = Math.round(totalDb/(this.width*this.height-this.speakers.length)*100)/100\n \t\n\t\n }", "title": "" }, { "docid": "9b75f994619dfcef85d1c7500b16dc9c", "score": "0.52418554", "text": "function InitBox(x, y, img){ \n //Fonction qui crée un nouvel objet box à une position x,y avec une image de fond\n \n var box = document.createElement(\"img\");\n if(img==\"\")\n\t\tbox = document.createElement(\"div\");\n \n box.style.display = \"inline-block\";\n box.style.width = width_box +\"px\";\n box.style.height = height_box +\"px\";\n box.style.marginLeft = x +\"px\";\n box.style.marginTop = y +\"px\";\n \n box.setAttribute(\"class\", \"box\");\n zonejeu.insertBefore(box, joueur);\n \n //sprite qu'on veut comme image de fond\n if(img==\"bord_g\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (1).png\";\n if(img==\"bord_haut\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (2).png\";\n if(img==\"bord_d\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (3).png\";\n if(img==\"interieur_g\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (4).png\";\n if(img==\"interieur_centre\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (5).png\";\n if(img==\"interieur_d\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (6).png\";\n if(img==\"bord_tourne_g\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (7).png\";\n if(img==\"interieur_tourne_bg\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (8).png\";\n if(img==\"interieur_b\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (9).png\";\n if(img==\"interieur_tourne_bd\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (10).png\";\n if(img==\"bord_tourne_d\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (11).png\";\n if(img==\"interieur_bg\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (12).png\";\n if(img==\"interieur_bd\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (13).png\";\n if(img==\"mini_g\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (14).png\";\n if(img==\"mini_haut\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (15).png\";\n if(img==\"mini_d\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Tile (16).png\";\n if(img==\"squelette1\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Bones (1).png\";\n if(img==\"squelette2\")\n\t\tbox.src = \"Sprites/Map/png/Tiles/Bones (2).png\";\n if(img==\"boite\")\n\t\tbox.src = \"Sprites/Map/png/Objects/Crate.png\";\n\n map.push({ //propriétés d'une box\n width: width_box,\n height: height_box,\n x: x,\n y: y,\n div: box //le div de haque box pour le css\n });\n}", "title": "" }, { "docid": "8ef11deaec0b2115d8b93dfb57f90a03", "score": "0.52416253", "text": "function loadTiles(){ \n if(tilePool.length > 7)\n {\n isDouble = 0; \n var myTableDiv = document.getElementById(\"draggable\");\n for(var x = currentLengthRack; x < 7; x++){\n var nextLetter = getRandomInt(tilePool.length);\n $( '<img id=\"tile'+tileCount+'\" value=\"'+ tilePool[nextLetter].value+'\" letter=\"'+tilePool[nextLetter].letter+'\" class=\"tile draggable ui-widget-content\" src=\"graphics_data/Scrabble_Tiles/Scrabble_Tile_'+tilePool[nextLetter].letter +'.jpg\" width=\"60\" height=\"65\"/>').appendTo( myTableDiv );\n rack[currentLengthRack] = \"tile\"+ tileCount;\n currentLengthRack++;\n tilePool.splice(nextLetter, 1);\n tileCount++;\n $( \"#draggable img\" ).draggable({\n revert : reverToRack, \n refreshPositions: true,\n snapTolerance: \"3\",\n stop: function(){\n $(this).draggable('option','revert', reverToRack);\n }\n }).droppable({ //prevent user from placing letter tiles on top of eachother, learned about this from: https://stackoverflow.com/questions/6071409/draggable-revert-if-outside-this-div-and-inside-of-other-draggables-using-both\n greedy: true,\n tolerance: 'pointer',\n drop: function(event,ui){\n ui.draggable.animate(ui.draggable.data().origPosition= { top : 0, left : 0 },\"slow\"); //set the dragged tile to always revert\n }\n });\n } \n $('#remaining_tile div').html(function(){\n return('<div>'+tilePool.length+ '</div>');\n });\n }\n }", "title": "" }, { "docid": "4ed79fc7d7b991fa7bd9f712e6827ec4", "score": "0.5241321", "text": "getPointing_at(program_state) {\n\n /*get this.cursor */\n let ray = this.MouseMonitor.ray;\n if (ray === undefined) {\n return;\n }\n\n let min_t = Infinity;\n let min_block = undefined;\n\n this.blocks.forEach(item => {\n let curr = this.ray_block_intersects(ray, item.position, program_state.camera_transform.times(vec4(0, 0, 0, 1)).to3())\n if (curr !== null) {\n if (curr < min_t) {\n min_t = curr;\n min_block = item;\n }\n }\n })\n if (min_block !== undefined) {\n this.cursor = min_block;\n\n } else { //if pointing at nothing, clear this.outlines and this.cursor\n this.outlines = [];\n this.cursor = undefined;\n }\n // if (this.selected.length !== 0) {\n // console.log(this.selected);\n // }\n\n /*get this.outlines*/\n if (this.state === PLACING || this.state === MULTICOPY) {\n let new_outlines = []\n if (min_block !== undefined || this.intersectFloor(program_state)) {\n const candidates = (min_block !== undefined) ? this.getOutlineCandidates(min_block) : this.getOutlineCandidates(this.dummyBlock, true);\n\n let outline_pos = undefined;\n let min_t = Infinity;\n candidates.forEach(candidate => {\n let curr = this.ray_block_intersects(ray, candidate, program_state.camera_transform.times(vec4(0, 0, 0, 1)).to3())\n if (curr !== null) {\n if (curr < min_t) {\n min_t = curr;\n outline_pos = candidate;\n }\n }\n })\n this.pointed_coord = undefined;\n if (outline_pos !== undefined) {\n this.pointed_coord = position_to_coord(outline_pos);\n }\n if (this.state === PLACING) {\n if (outline_pos !== undefined) {\n new_outlines.push(outline_pos);\n this.outlines = new_outlines;\n }\n } else if (this.state === MULTICOPY) {\n\n if (outline_pos !== undefined) {\n new_outlines = this.selected_BlockGroup.getOutlines(outline_pos);\n this.outlines = new_outlines;\n }\n\n }\n }\n }\n // else if (this.state === MULTICOPY) {\n // if (this.cursor === undefined) {\n // this.outlines = [];\n // } else {\n // this.outlines = this.selected_BlockGroup.getOutlines(this.cursor.position);\n // }\n // }\n }", "title": "" }, { "docid": "974038f5d7877d298de97c79afafdb7a", "score": "0.52407223", "text": "function findBorderTiles(tiles) {\n \n}", "title": "" }, { "docid": "a72ee303e4717a190694423e2d6fe84e", "score": "0.5237845", "text": "function box(){ boxw=v1*ftw[ifont];boxt=fth[ifont];askwidth[mw]=ftw[ifont]; \n boxx=mx1[mw]=cx; boxy=my1[mw]=cy-fth[ifont];\n mx2[mw]=boxx+boxw; my2[mw]=boxy+boxt; }", "title": "" }, { "docid": "102c68e65c114b34201adc4a12523a2e", "score": "0.52289337", "text": "function setTiles(tile) {\n switch (game.mode) {\n case 'P': //passables\n\n var passable = game.mapData.passables[tile.gridLocation.y][tile.gridLocation.x];\n if (game.currentTexture === 'passable') { //clear both flags\n passable[0] = 0;\n passable[1] = 0;\n }\n else if (game.currentTexture === 'unpassableRight') {\n passable[0] = 1; //flag right\n }\n else if (game.currentTexture === 'unpassableDown') {\n passable[1] = 1; //flag down\n }\n\n\n break;\n case 'S':\n //an object representing the current structure\n var structure = {\n key: game.currentTexture,\n frame: game.textureFrameNumber,\n x: tile.gridLocation.x,\n y: tile.gridLocation.y\n };\n //if I already have this structure, I don't need two\n game.mapData.structures.forEach(function(existingStructure, index) {\n //this function is below and compares two object for sameness\n if (isEquivalent(existingStructure, structure)) {\n //delete the old one\n game.mapData.structures.splice(index, 1);\n }\n });\n //set the data\n game.mapData.structures.push(structure);\n break;\n case 'E':\n //an object representing the current structure\n console.log(game.textureRow)\n console.log(game.textureColumn)\n if (game.textureColumn == 0 && game.textureRow == 0) //event\n {\n if (!game.prompedForEventKey) {\n game.prompedForEventKey = true;\n var nameKey = prompt(\"Enter the event key: \");\n }\n\n if (typeof nameKey === 'undefined') {\n var nameKey = game.mapData.events[game.mapData.events.length - 1].key;\n }\n var event = {\n key: nameKey,\n x: tile.gridLocation.x,\n y: tile.gridLocation.y\n };\n //if I already have an event here, I don't need two\n var found = false;\n game.mapData.events.forEach(function(existingEvent, index) {\n //this function is below and compares two object for sameness\n if (existingEvent.x === tile.gridLocation.x && existingEvent.y === tile.gridLocation.y) {\n console.log(\"already there!\")\n found = true;\n }\n });\n //set the data\n if (!found) {\n game.mapData.events.push(event);\n }\n\n }\n else if (game.textureColumn == 1 && game.textureRow == 0) {\n console.log(\"highlight\")\n game.mapData.structures.forEach(function(existingStructure, index) {\n //this function is below and compares two object for sameness\n if (existingStructure.x === tile.gridLocation.x && existingStructure.y === tile.gridLocation.y) {\n existingStructure.highlighted = true;\n }\n });\n }\n else if (game.textureColumn == 0 && game.textureRow == 1) {\n //if I already have an event here, I don't need two\n console.log(\"deletion\")\n for (var i = game.mapData.structures.length - 1; i >= 0; i--) {\n var existingStructure = game.mapData.structures[i];\n if (existingStructure.x === tile.gridLocation.x && existingStructure.y === tile.gridLocation.y) {\n game.mapData.structures.splice(i, 1);\n }\n }\n }\n else if (game.textureColumn == 0 && game.textureRow == 2) {\n //if I already have an event here, I don't need two\n console.log(\"enemy\");\n\n if (!game.prompedForEnemyKey) {\n game.prompedForEnemyKey = true;\n var cohortKey = prompt(\"Enter the enemy cohort array: \");\n }\n\n if (typeof cohortKey === 'undefined') {\n var cohortKey = game.mapData.enemies[game.mapData.enemies.length - 1].cohort;\n }\n var enemy = {\n cohort: cohortKey,\n x: tile.gridLocation.x,\n y: tile.gridLocation.y\n };\n //if I already have an event here, I don't need two\n var found = false;\n game.mapData.enemies.forEach(function(existingEnemy, index) {\n //this function is below and compares two object for sameness\n if (existingEnemy.x === tile.gridLocation.x && existingEnemy.y === tile.gridLocation.y) {\n console.log(\"already there!\")\n found = true;\n }\n });\n //set the data\n if (!found) {\n game.mapData.enemies.push(enemy);\n }\n }\n\n\n break;\n case 'N':\n if (!game.prompedForNPCKey) {\n game.prompedForNPCKey = true;\n var nameKey = prompt(\"Enter the npc key: \");\n }\n\n if (typeof nameKey === 'undefined') {\n var nameKey = game.mapData.npcs[game.mapData.npcs.length - 1].key;\n }\n var npc = {\n nameKey: nameKey,\n key: game.currentTexture,\n x: tile.gridLocation.x,\n y: tile.gridLocation.y\n };\n //if I already have an npc here, I don't need two\n var found = false;\n // game.mapData.npcs.forEach(function(existingNPC, index) {\n // //this function is below and compares two object for sameness\n // if (existingNPC.x === tile.gridLocation.x && existingNPC.y === tile.gridLocation.y) {\n // found = true;\n // }\n // });\n //set the data\n if (!found) {\n game.mapData.npcs.push(npc);\n }\n break;\n default:\n console.log(\"unspecified mode!\");\n }\n\n //this function compares two object and returns true if they're identical\n //http://adripofjavascript.com/blog/drips/object-equality-in-javascript.html\n function isEquivalent(a, b) {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n\n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n\n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n\n // If we made it this far, objects\n // are considered equivalent\n return true;\n }\n\n}", "title": "" }, { "docid": "8597e085a255d5f238c92bdc50792380", "score": "0.5228235", "text": "function getSurroundingTiles(){\r\n var tiles = [];\r\n var counter = 0;\r\n var counter2 = 0;\r\n var row = currentPlayer.rowLocation;\r\n var col = currentPlayer.colLocation;\r\n\r\n // For North Tile\r\n if(row-1 >= 0 && currentGameBoard[row][col].t_object.north &&\r\n (currentGameBoard[row-1][col].available || currentGameBoard[row-1][col].staged || currentGameBoard[row-1][col].t_object.south)) {\r\n\r\n tiles[counter] = currentGameBoard[row-1][col];\r\n if(currentGameBoard[row-1][col].t_object.south){\r\n currentGameBoard[row-1][col].connected = true;\r\n currentConnectedTiles[counter2++] = currentGameBoard[row-1][col].location;\r\n }\r\n counter++;\r\n }\r\n\r\n // For East Tile\r\n if (col+1 < gameBoardSize.col && currentGameBoard[row][col].t_object.east &&\r\n (currentGameBoard[row][col+1].available || currentGameBoard[row][col+1].staged || currentGameBoard[row][col+1].t_object.west)) {\r\n\r\n tiles[counter] = currentGameBoard[row][col+1];\r\n if(currentGameBoard[row][col+1].t_object.west){\r\n currentGameBoard[row][col+1].connected = true;\r\n currentConnectedTiles[counter2++] = currentGameBoard[row][col+1].location;\r\n }\r\n counter++;\r\n }\r\n\r\n // For South Tile\r\n if (row+1 < gameBoardSize.row && currentGameBoard[row][col].t_object.south &&\r\n (currentGameBoard[row+1][col].available || currentGameBoard[row+1][col].staged || currentGameBoard[row+1][col].t_object.north)) {\r\n tiles[counter] = currentGameBoard[row+1][col];\r\n if(currentGameBoard[row+1][col].t_object.north){\r\n currentGameBoard[row+1][col].connected = true;\r\n currentConnectedTiles[counter2++] = currentGameBoard[row+1][col].location;\r\n }\r\n counter++;\r\n }\r\n\r\n // For West Tile\r\n if (col-1 >= 0 && currentGameBoard[row][col].t_object.west &&\r\n (currentGameBoard[row][col-1].available || currentGameBoard[row][col-1].staged || currentGameBoard[row][col-1].t_object.east)) {\r\n tiles[counter] = currentGameBoard[row][col-1];\r\n if(currentGameBoard[row][col-1].t_object.east) {\r\n currentGameBoard[row][col-1].connected = true;\r\n currentConnectedTiles[counter2] = currentGameBoard[row][col-1].location;\r\n }\r\n }\r\n\r\n return tiles;\r\n}", "title": "" }, { "docid": "fb23b44de9b78a8de880b2a04088feed", "score": "0.5223403", "text": "function arrange_tiles(ARRANGE_METHOD) {\n\tvar external_gap = 20;\n\tvar internal_gap = 10;\n\tvar num_columns = Math.floor(($(window).width() - external_gap) / ($('.tile').outerWidth(true) + internal_gap));\n\tvar col = 0;\n\tvar vertical_position = new Array();\n\t\n\tfor (var i = 0; i < num_columns; i++)\n\t\tvertical_position.push(0);\n\tswitch(ARRANGE_METHOD)\n\t{\n\t\tcase 0:\n\t\t\t$('.tile').each(function(index, element) {\n\t\t\t\t$(this).css('left', (col + 1) * 10 + col * $(this).outerWidth() + 'px');\n\t\t\t\t$(this).css('top', vertical_position[col] + 10 + 'px');\n\t\t\t\tvertical_position[col] += $(this).outerHeight() + 10;\n\t\t\t\tcol = (col + 1 ) % num_columns;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$('.tile').each(function(index, element) { \n\t\t\t\t$(this).css('left', (col + 1) * 10 + col * $(this).outerWidth() + 'px');\n\t\t\t\t$(this).css('top', vertical_position[col\t] + 10 + 'px');\n\t\t\t\tvertical_position[col] += $(this).outerHeight() + 10;\n\t\t\t\tcol = vertical_position.getIndexOfLowerValue();\n\t\t\t});\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "ac5e8b17e35601d02e1814bf6c0b595b", "score": "0.5220074", "text": "function DefineOrthos(photo, requested_tile)\n{\n // This method takes in a single photo as input, and transforms a grid of 2d map tiles into it's space\n\n // Define the camera to transform the tiles into image space\n console.log(\"Using source image '%s' id=%d\", photo.file, photo.id);\n\n var cam = new CamPos();\n\n cam.SetImage(photo);\n\n // Define the centre tile\n var vp_tile = new MapTile();\n\n vp_tile.defineFromGeo(Number(photo.viewpoint_lat), Number(photo.viewpoint_lon), 18);// <---- Fixed zoom level for now\n\n // Generate a grid of tiles around the centre tile (3 == radius == 7x7 grid)\n var grid = vp_tile.generateGrid(3);\n\n var tile_array = []; // tile_array 2d array indexed by tile and then by its geometry (actual metres on the ground as four lines)\n // tile_array[tile][side_of_tile_1_of_4]\n for (var y=0; y<grid.length; y++)\n {\n for (var x=0; x<grid[y].length; x++)\n {\n var tile = grid[y][x];\n\n var geom = tile.getGeometry(); // returns an array of four items (each side of the tile)\n tile_array.push({\n tile_x: tile.x,\n tile_y: tile.y,\n tile_z: tile.zoom,\n ground_geometry: geom\n });\n\n // console.log(\"Tile X: %d, Y: %d\",tile.x, tile.y);\n\n //tile_array.push(geom);\n }\n }\n\n\n\n var obliqueThresh = config.obliqueThreshold;\n var usable_area = -((config.usableImageArea* 2) - 1); // usableImageArea = 0.6 = the bottom 60% of the image (i.e. the highest 'Y' coordinate)\n\n //var lineClip = new LineClip.ClipReal();\n\n var tiles_to_extract = [];\n\n var dropped_request = false;\n\n // var bleh = false;\n\n for (var t=0; t<tile_array.length; t++)\n {\n // bleh = false;\n // if (tile_array[t].tile_x == 129545 && tile_array[t].tile_y == 86110) bleh = true;\n\n var curtile = tile_array[t].ground_geometry;\n\n var tile_sides_to_render = [];\n\n for (var l=0; l<curtile.length; l++)\n {\n var line = curtile[l];\n\n var d1 = cam.Map3D(line.x1, line.y1, line.z1);\n var d2 = cam.Map3D(line.x2, line.y2, line.z2);\n\n\n // if (bleh) console.log(d1, d2);\n\n if (1==1)//d1.d>0 && d2.d>0 && d1.d < obliqueThresh && d2.d < obliqueThresh) // if it's valid\n {\n var testLine = {\n X1: d1.u,\n Y1: d1.v,\n X2: d2.u,\n Y2: d2.v\n };\n\n // if (bleh) console.log(testLine);\n\n var lineout = LineClip.ClipReal(testLine, -1, -1, 1, 1);\n\n // if (lineout.visible) {\n\n var unusable_zone = false;\n if (testLine.Y1 < usable_area && testLine.Y2 < usable_area)\n {\n // if (bleh) console.log(\"Tile is in UNUSABLE ZONE! == %d\", usable_area);\n unusable_zone = true;\n }\n\n // if (!lineout.visible && bleh==true) console.log(\"Tile-line is invisible\");\n\n var line_segment = {\n u1: (testLine.X1 + 1.0) / 2,// [u1, v1] now represent normalised 0..1 logical image UV coordinates\n v1: (testLine.Y1 + 1.0) / 2,// scale these coords with image dimensions and use to extract the tile\n u2: (testLine.X2 + 1.0) / 2,// with the origin in the top-left and [1, 1] in bottom right a la standard computer graphics displays\n v2: (testLine.Y2 + 1.0) / 2,\n visible: lineout.visible,\n unusable_zone: unusable_zone\n };\n\n tile_sides_to_render.push(line_segment);\n\n // }\n }\n }\n\n var tile_unusable = false;\n var tun = 0;\n\n for (var q=0; q<tile_sides_to_render.length; q++)\n if (tile_sides_to_render[q].unusable_zone === true) tun++;\n\n // if (bleh) console.log(\"Side to render = %d\", tun);\n\n if (tun == 4) tile_unusable = true;\n\n // if (bleh) console.log(\"Tile unusable = %s\", tile_unusable);\n\n var num_vis_edges = 0;\n\n for (var tv=0; tv<tile_sides_to_render.length; tv++)\n {\n if (tile_sides_to_render[tv].visible === true)\n num_vis_edges++;\n }\n\n // if (bleh) console.log(\"Num Vis edges = %d\", num_vis_edges);\n\n if (num_vis_edges > 0 && !tile_unusable)\n {\n // if (bleh) console.log(\"Tile is at leasy party on the image\");\n\n var is_partial = false;\n if (num_vis_edges < 4) is_partial = true;\n\n // if (bleh) console.log(\"Partial = %s\", is_partial);\n\n var tile_to_extract = {\n photo: photo,\n tile: {\n x: tile_array[t].tile_x,\n y: tile_array[t].tile_y,\n zoom: tile_array[t].tile_z\n },\n partial: is_partial,\n vertices: []\n };\n\n // 0 = top, 1 = bottom, 2 = left, 3 = right\n tile_to_extract.vertices.push({u: tile_sides_to_render[0].u1, v: tile_sides_to_render[0].v1});\n tile_to_extract.vertices.push({u: tile_sides_to_render[0].u2, v: tile_sides_to_render[0].v2});\n tile_to_extract.vertices.push({u: tile_sides_to_render[1].u2, v: tile_sides_to_render[1].v2});\n tile_to_extract.vertices.push({u: tile_sides_to_render[1].u1, v: tile_sides_to_render[1].v1});\n\n // for (var g=0; g<4; g++)\n // tile_to_extract.geometry.push(tile_sides_to_render[g]);\n\n tiles_to_extract.push(tile_to_extract);\n }\n // console.log(\"ACCEPTED %s/%s/%s.jpg\", tile_array[t].tile_z,tile_array[t].tile_y,tile_array[t].tile_x, tile_sides_to_render.length);\n // } else {\n // console.log(\"Rejected %s/%s/%s.jpg cos only %d sides\", tile_array[t].tile_z,tile_array[t].tile_y,tile_array[t].tile_x, tile_sides_to_render.length);\n // if (tile_array[t].tile_x == requested_tile.x && tile_array[t].tile_y == requested_tile.y && tile_array[t].tile_z == requested_tile.zoom)\n // {\n // dropped_request = true; //uhoh! the tile we asked for is off the edge of the nearest possible image\n // }\n\n }\n\n\n return {\n dropped_request: dropped_request,\n extract: tiles_to_extract\n };\n}", "title": "" }, { "docid": "fb8c96cf9287c188dd4180754d35465a", "score": "0.52195793", "text": "function getSquareArray() {\n\n let counter = 1;\n let x_ptr = 20\n \n\n while(x_ptr <= 400){\n let y_ptr = 20\n while(y_ptr <= 400){\n gridSquares[counter] = {\n x: x_ptr,\n y: y_ptr,\n width: 20,\n height: 20\n }\n y_ptr = y_ptr + 20;\n counter++;\n }\n x_ptr = x_ptr + 20;\n \n }\n \n \n \n \n }", "title": "" }, { "docid": "56ff7467b6ec8af9c1bc42688624f4c7", "score": "0.5216461", "text": "findCoord(x, y) {\n var xEst = Math.floor(x * 10 / this.boxsize) / 10; var yEst = Math.floor(y * 10 / this.boxsize) / 10;\n var xPred = this.boxsize * Math.round(xEst); var yPred = this.boxsize * Math.round(yEst);\n var xDist = x - xPred; var yDist = y - yPred;\n var distance = Math.sqrt(xDist * xDist + yDist * yDist);\n \n if (distance <= this.boxsize/2) {\n console.log(xPred, yPred);\n return [xPred, yPred]; \n }\n else { return null }\n }", "title": "" }, { "docid": "e88c8470cefa19cca56ba1f275ddd086", "score": "0.5213815", "text": "function findstartLoc(width, height) {\n\n\t//Start from the center\n\tif(originCenter) {\n\t\treturn [width/2, height/2, getRandomNumber(0, 2*Math.PI)];\n\t\t\n\t\t//var pos = Math.floor(Math.random()*butterflyPointsExtr.length);\n\t\t//return [butterflyPointsExtr[pos].x, butterflyPointsExtr[pos].y, getRandomNumber(0, 2*Math.PI)];\n\t\t//var pos = Math.floor(Math.random()*hex.length);\n\t\t//return [hex[pos].x, hex[pos].y, getRandomNumber(0, 2*Math.PI)];\n\t} else {\n\t\t//Start from just outside the screen\n\t\tif(Math.random() > 0.5) {\n\t\t\tif(Math.random() > 0.5) {\n\t\t\t\t//before x axis\n\t\t\t\treturn [-10, getRandomNumber(0, height), getRandomNumber(0, Math.PI)];\n\t\t\t} else {\n\t\t\t\t//after x axis\n\t\t\t\treturn [width+10, getRandomNumber(0, height), getRandomNumber(Math.PI, 2*Math.PI)];\n\t\t\t}//else\n\t\t} else {\n\t\t\tif(Math.random() > 0.5) {\n\t\t\t\t//above y axis\n\t\t\t\treturn [getRandomNumber(0, width), -10, getRandomNumber(-Math.PI/2, Math.PI/2)];\n\t\t\t} else {\n\t\t\t\t//below y axis\n\t\t\t\treturn [getRandomNumber(0, height), height + 10, getRandomNumber(Math.PI/2, Math.PI*3/2)];\n\t\t\t}//else\n\t\t}//else\n\t}//else\n}//function findstartLoc", "title": "" }, { "docid": "033cd55fce98e9d52c61f0a74fbdd6ff", "score": "0.5211859", "text": "function spotsToPositionPieces(data) {\n let numSpots = 5;\n let totalNumSpots = 0;\n let numRows = 5;\n // Creates five rows..\n for (var j = 0; j < numRows; j++) {\n //each containing six spots\n for (var i = numSpots; i >= totalNumSpots; i--) {\n // Gets data from JSON file\n let image = data.puzzles.firstPuzzle.emptySpots[i];\n // Adds a piece with a similar shape of puzzle piece image to occupy the space until the real piece is dropped\n let pieceHidingLayer = $('<img>').addClass(`hidingLayer${i}`).addClass(\"spotImage\").attr({\n src: `${image}`\n }).appendTo(`#spotToPosition${i}`);\n // On click, changes the layer opacity to 0.6\n pieceHidingLayer.one(\"click\", function() {\n $(this).addClass(\"clicked\").css({\n \"opacity\": \"0.6\"\n });\n });\n\n // Makes the spot droppable\n $(`#spotToPosition${i}`).droppable({\n drop: onDrop\n });\n }\n // Goes for the next row\n numSpots += 6;\n totalNumSpots += 6;\n }\n}", "title": "" }, { "docid": "d2ab5af109bb0ada97ac8558de5bb50d", "score": "0.5209136", "text": "function setUp( ) {\n // draw bordering walls\n for(let i = 0; i < GRID_SIZE; i++){\n grid[i] = new Array(GRID_SIZE);\n }\n\n for(let x = 0; x < GRID_SIZE; x++) {\n grid[0][x] = 1;\n grid[GRID_SIZE - 1][x] = 1;\n\n grid[x][0] = 1;\n grid[x][GRID_SIZE - 1] = 1;\n }\n\n // draw individual boxes on canvas\n for(let x = 1; x <= (CANVAS_SIZE / BOX); x++) {\n for(let y = 1; y <= (CANVAS_SIZE / BOX); y++){\n grid[x][y] = (Math.random() < 0.25) ? 1 : 0;\n }\n }\n\n // set up start and end points (will be randomized later)\n if(DEBUG) console.table(grid);\n start = {x: 2, y: 2};\n grid[start.x][start.y] = 2;\n\n goal = {x: 25, y: 25};\n grid[goal.x][goal.y] = 3;\n\n for(let i = 0; i < GRID_SIZE; i++) {\n for(let j = 0; j < GRID_SIZE; j++){\n ctx.fillStyle = colorMap[grid[i][j]];\n ctx.fillRect(i*BOX, j*BOX, BOX, BOX);\n ctx.strokeStyle = \"black\";\n ctx.strokeRect(i*BOX, j*BOX, BOX, BOX);\n }\n }\n refresh = setInterval(dfs, 25 );\n}", "title": "" }, { "docid": "0839a07bd118397105d748f4b0a61326", "score": "0.5208295", "text": "function generateLookups() {\n\tfor (var x=0; x<w; x++) {\n\t\tvar cameraX = 2 * x / w - 1; //x-coordinate in camera space\n\t\tcameraXCoords.push(cameraX);\n\t}\n}", "title": "" }, { "docid": "691a9cc683b4550fa613c19824bbe86d", "score": "0.52056473", "text": "for (let x = minx; x <= maxx; x += 1) {\n for (let y = miny; y <= maxy; y += 1) {\n const dX = x - minx;\n const screen = Math.floor(dX / 2);\n const column = dX % 2;\n const row = y - miny;\n const urlB = tileServerB\n ? getTileUrlFromCoordsAndTileserver(\n x,\n y,\n zoomLevel,\n tileServerB.url,\n tileServerB.name,\n tileServerB.apiKey,\n tileServerB.wmtsLayerName,\n )\n : undefined;\n const task = {\n groupId,\n projectId,\n taskId: `${zoomLevel}-${x}-${y}`,\n url: getTileUrlFromCoordsAndTileserver(\n x,\n y,\n zoomLevel,\n tileServer.url,\n tileServer.name,\n tileServer.apiKey,\n tileServer.wmtsLayerName,\n ),\n urlB,\n };\n // $FlowFixMe\n screens[screen][row + 3 * column] = task;\n }\n }", "title": "" }, { "docid": "b3cf80a0c3e55b36ffd4ec9729cd609a", "score": "0.52049255", "text": "function createTiles() {\n\t\tvar tileCount = 1;\n\t\tfor (var i = 0; i < NUMBER_ROWS_COLS; i++) {\n\t\t\tfor (var j = 0; j < NUMBER_ROWS_COLS; j++) {\n\t\t\t\tif (tileCount != 16\t) {\n\t\t\t\t\tvar newTile = document.createElement(\"div\");\n\t\t\t\t\tnewTile.innerHTML = tileCount;\n\t\t\t\t\tnewTile.style.backgroundPosition = -j * HEIGHT_WIDTH +\n\t\t\t\t\t\t \"px \" + (-i * HEIGHT_WIDTH) + \"px\";\n\t\t\t\t\tnewTile.style.left = j * HEIGHT_WIDTH + \"px\";\n\t\t\t\t\tnewTile.style.top = i * HEIGHT_WIDTH + \"px\";\n\t\t\t\t\tnewTile.className = \"puzzleTiles\";\n\t\t\t\t\tnewTile.id = \"tile_\" + i + \"_\" + j;\n\t\t\t\t\tnewTile.onclick = moveOneTile;\n\t\t\t\t\tnewTile.onmouseover = onTile;\n\t\t\t\t\tnewTile.onmouseout = offTile;\n\t\t\t\t\tdocument.getElementById(\"puzzlearea\").appendChild(newTile);\n\t\t\t\t\toriginalPosition.push(newTile.id);\n\t\t\t\t\ttileCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a5e397fac88dbf9c2ff3bae161343db6", "score": "0.5203976", "text": "function grass_create(){\n map.setTileIndexCallback(Array(frame(3, 2),frame(4, 2),frame(5, 2),frame(33, 2),frame(34, 2),frame(35, 2),frame(63, 2),frame(64, 2),frame(65, 2)),function(sprite,tile){\n var leftTile = map.getTile(tile.x-1, tile.y);\n var rightTile = map.getTile(tile.x+1, tile.y);\n var left2Tile = map.getTile(tile.x-2, tile.y);\n var right2Tile = map.getTile(tile.x+2, tile.y);\n\n map.removeTile(tile.x, tile.y);\n\n if(leftTile.index == frame(68, 2) && (left2Tile.index == frame(69, 2) || left2Tile.index == frame(155, 2))){\n //left and second left have been updated\n map.putTile(frame(68, 2), tile.x, tile.y); \n //left tile\n map.removeTile(tile.x-1, tile.y);\n map.putTile(frame(155, 2), tile.x-1, tile.y);\n }else if(rightTile.index == frame(69, 2) && (right2Tile.index == frame(68, 2) || right2Tile.index == frame(155, 2))){\n //left and second left have been updated\n map.putTile(frame(69, 2), tile.x, tile.y); \n //left tile\n map.removeTile(tile.x-1, tile.y);\n map.putTile(frame(155, 2), tile.x-1, tile.y);\n }else if(leftTile.index == frame(123, 2)){\n //left tile has been updated\n map.putTile(frame(68, 2), tile.x, tile.y); \n //left tile\n map.removeTile(tile.x-1, tile.y);\n map.putTile(frame(69, 2), tile.x-1, tile.y);\n }else if(rightTile.index == frame(123, 2)){\n //right tile has been updated\n map.putTile(frame(69, 2), tile.x, tile.y); \n //right tile\n map.removeTile(tile.x+1, tile.y);\n map.putTile(frame(68, 2), tile.x+1, tile.y); \n }else{\n //all the tiles left and right are the default\n map.putTile(frame(123, 2), tile.x, tile.y); \n }\n\n }, game)\n}", "title": "" }, { "docid": "907fcf99cb02170a46ac41e517a53663", "score": "0.52027994", "text": "function zShape(){\n //Left top square ************************************************************\n blockUnit.push(eval(\"row\" + rowCount + \"squ\" + (squareCount + 1)));\n //Right top square ************************************************************\n blockUnit.push(eval(currentSquare));\n //Bottom left square **********************************************************\n blockUnit.push(eval(\"row\" + (rowCount - 1) + \"squ\" + squareCount));\n //Bottom right square *********************************************************\n blockUnit.push(eval(\"row\" + (rowCount - 1) + \"squ\" + (squareCount - 1)));\n}", "title": "" }, { "docid": "9d09c66c41bbdcc381e7232955d214f4", "score": "0.51997995", "text": "function getGrid(start, index, numCol, numRow, x, y)\r {\r var columns = numCol;\r var m = index;\r var thestartPosition = [((m) % columns) * x, (\r Math.floor((m / columns)) *\r y)] + start;\r return thestartPosition;\r }", "title": "" } ]
ffe2f525463d209c9639717f657c76b8
Funcion llamada a cada frame
[ { "docid": "f53b1b85cb51c513f949e9db4edaca03", "score": "0.0", "text": "function tick(){\n\nrequestAnimationFrame(tick);\ndrawAll(); //esta funcion llama a los objectos que van a ser dibujados\n//Las funciones de animacion deben ser llamadas acá\nanimate_rueda();\nanimate_sillas();\n}", "title": "" } ]
[ { "docid": "460378f558cb46d619f9c4166b41df56", "score": "0.70439076", "text": "function frame() {\n drawFrame();\n\n frameIndex++;\n\n if (frameIndex === 15) {\n frameIndex = 0;\n }\n}", "title": "" }, { "docid": "5aa5431a4efa856f1defbb33fccb5547", "score": "0.7042933", "text": "frameProcess(){ \n //Propagates frame process\n for (let i=0; i<this.skills.length; i++){\n this.skills[i].frameProcess();\n }\n this.move();\n this.processProjectiles();\n }", "title": "" }, { "docid": "c75efd90c8b8de4d85d7d316faa2295b", "score": "0.6915644", "text": "function frameLoop(){ \n actualizarEstadoJuego();\n moverNave();\n moverDisparos();\n moverDisparosEnemigos();\n verificarContacto(); \n actualizaEnemigos();\n dibujarFondo();\n dibujarEnemigos();\n dibujarDisparosEnemigos();\n dibujarDisparos();\n dibujarTexto();\n dibujarNave(); \n}", "title": "" }, { "docid": "037554c5377ccfcb7b31c79cdfda95da", "score": "0.67434555", "text": "function nextFrame() {\n \"use strict\";\n\n\n if (CALLS.currentFrame < CALLS.frameFunctions.length) {\n drawCurrentFrame();\n CALLS.currentFrame += 1;\n } else {\n resetFrames();\n }\n\n\n}", "title": "" }, { "docid": "aa302d235644fb98c0f16368450c8d67", "score": "0.6725239", "text": "function locateFrames() {\n\t\tvar frameWidth = 720;// $('.movie > img').outerWidth();\n\t\tvar frameHeight = 405;\n\t\tvar padFrame = ( windowWidth - frameWidth ) / 2;\n\t\tvar padFrameTop = ( windowHeight - frameHeight ) / 2;\n\t\t$('.movie > img').css( 'left', padFrame ).css( 'top', padFrameTop );\n\t}", "title": "" }, { "docid": "4b6d5ef160e81964be1b2d4092b9742f", "score": "0.6724771", "text": "everyFrame() {\n background(this.backgroundColour);\n this.frameInc++\n this.drawGrid();\n this.flash();\n this.show(); // display the shape and the shapes that have landed\n this.moveY();\n }", "title": "" }, { "docid": "ea63a3b25e2f722b3eb3d55df70f65fd", "score": "0.66990024", "text": "countFrame() {\n\t\tthis.frameCount ++;\n\t}", "title": "" }, { "docid": "1c24485b0cd60d24b02f69f0b952d54e", "score": "0.66409343", "text": "goToFrame(frame) {\n let p_list=[];\n for (let video of this._videos)\n {\n video.onPlay();\n p_list.push(video.gotoFrame(Math.min(frame,video._numFrames-1), true));\n }\n return Promise.all(p_list);\n }", "title": "" }, { "docid": "8ab3870d463cad82c1f5513ba96345db", "score": "0.6600276", "text": "function onRenderFrame() { }", "title": "" }, { "docid": "cc48070e9a4ba3b1d84897d95d87400e", "score": "0.65876436", "text": "nextFrame() {\n if (this.currentFrameIndex <= this.maxFrameIndex) {\n this.currentFrameIndex ++;\n this.renderFrame();\n }\n\n // Check if new fetch is necessary\n if (this.highestFrameIndex < this.maxFrameIndex && this.highestFrameIndex - this.currentFrameIndex < 20) {\n this.fetchForwardFrames(30);\n }\n\n // Check if old frames can get removed\n if (this.currentFrameIndex - this.lowestFrameIndex > 30) {\n this.imgBuffer.shift();\n this.lowestFrameIndex ++;\n }\n }", "title": "" }, { "docid": "688e9f3c200cc8d24c422a3a74549f3c", "score": "0.65779984", "text": "function frame()\n{\n fno = new Array;\n len = $('[id=\"frame_no\"]').length;\n var counterframe=0;\n for (fn of $('[id=\"frame_no\"]')) \n {\n temp = fn.innerHTML;\n fno.push(temp);\n } \n\n for(i=0;i<len;i++)\n {\n if(fno[i])\n {\n counterframe= +counterframe + ((+fno[i])*mf[i]);\n }\n }\n \n frame_Str=new String;\n if(counterframe>0){\n frame_Str=frame_Str+\" [ \"+counterframe+\" Pcs ]\";\n }\n\n document.getElementById(\"Framee\").innerHTML=frame_Str;\n}", "title": "" }, { "docid": "9c0dedef8740cebedda135bf37b0104f", "score": "0.65507114", "text": "frame() {\n\t\tif (!this.isRunning) return;\n\t\tthis.frameCount = Math.floor((Date.now() - this.startTime) / (50 / 3));\n\t\tthis.callback(this);\n\t\twindow.requestAnimationFrame(this.frame.bind(this));\n\t}", "title": "" }, { "docid": "c06bd7cc05c226cfcaa7b21a3ca498a2", "score": "0.64938486", "text": "frame() {\n this.motion();\n this.display();\n }", "title": "" }, { "docid": "9510db73f2f7d896a840f91e894b94d4", "score": "0.64859194", "text": "static get frames() { return Loop.ƒFrames; }", "title": "" }, { "docid": "ed08e53618cd2f88e5d681c0a191b953", "score": "0.6446571", "text": "function createFrameSlots() {\n for (var i = 0; i < totalFrames; i++) {\n\n //Create sender side frame slots \n var sfSlot = createFrameUi(\"readyFrame\", \"Frame \" + i, i, i);\n sfSlot.attr(\"title\", \"Click to mark to demage.\");\n\n sfSlot.on(\"click\", function() {\n log(\"User: \" + $(this).text() + \"- Marked to demage.\");\n $(this).addClass(\"damagedFrame\");\n });\n\n sfSlots.push(sfSlot);\n $(\"#sender\").append(sfSlot);\n\n\n //Create received side frame slots\n var rfSlot = createFrameUi(\"expectedFrame\", \"Frame \" + i, i);\n rfSlots.push(rfSlot);\n $(\"#receiver\").append(rfSlot);\n }\n}", "title": "" }, { "docid": "f1770d3879aa85e57fb48474f37c8c96", "score": "0.6434838", "text": "function moveToNextFrame() {\n\tdocument.getElementById(\"displayarea\").value = frames[current];\n current = (current + 1) % frames.length;\n\ttimeout = setTimeout(\"moveToNextFrame();\", speed*250);\n}", "title": "" }, { "docid": "d4836df22bfa6989a05122c3ace96365", "score": "0.6432847", "text": "function addFrame(){\n var f = new Frame(upper, lower);\n frames.push(f);\n}", "title": "" }, { "docid": "8b37038f020ea09f0dabfe0973471e41", "score": "0.6416207", "text": "beginFrame() {\n this.itemsLeft = this.maxItemsPerFrame;\n }", "title": "" }, { "docid": "ad7ea192f80841597b7d35a7aaeddbfb", "score": "0.6413999", "text": "function frame() {\n if (getLeftPosition(elem) == 0) {\n clearInterval(id);\n } else {\n pos = 50 * sign; \n for(var i = 0; i < pages.length; i++) {\n var item = pages[i];\n var new_pos = getLeftPosition(item) + pos;\n item.style.left = new_pos + 'px';\n } \n }\n }", "title": "" }, { "docid": "9462d87d8b5f34d4b42b2c3db4058274", "score": "0.64122796", "text": "loopAllFrames() {\n this.currentImage = this.animationSequence.shift();\n this.animationSequence.push(this.currentImage);\n }", "title": "" }, { "docid": "313452c389461cf4951c40314141e5b3", "score": "0.63830614", "text": "function frame() {\n // si la bar est à 100% on la reset à 0\n if (width >= 100) {\n clearInterval(id);\n i = 0;\n } else {\n // sinon augmente la taille de la progression\n width++;\n elem.style.width = width + \"%\";\n elem.innerHTML = width + \"%\";\n elem.style.width = width + \"%\";\n // change la couleur, on appele la fonction vue plus haut\n setBg();\n }\n }", "title": "" }, { "docid": "61b91880176cc3c117b9eec227d27890", "score": "0.63816065", "text": "function frame() {\n if (pos == 350) {\n clearInterval(id);\n } else {\n \n // pos ++;\n // elem.style.top = pos + 'px';\n // elem.style.left = pos + 'px';\n }\n }", "title": "" }, { "docid": "660cd7a328a1f82aa0682d3561d1c7d7", "score": "0.6363763", "text": "frame(){\n\n }", "title": "" }, { "docid": "b626d98b0edf917ec872759ee69887bb", "score": "0.635804", "text": "function handleFrameCount() {\n frameCount += 1;\n pipeFrameCount += 1;\n\n if(frameCount >= FRAME_LIMIT) {\n frameCount = 0;\n runner.currLoopIndex += 1;\n }\n\n if (runner.currLoopIndex >= runner.cycle_loop.length) {\n runner.currLoopIndex = 0;\n }\n\n\n if(pipeFrameCount % 50 == 0) {\n spawnPipes();\n }\n\n if(pipeFrameCount % 100 == 0) {\n spawnZombies();\n }\n\n}", "title": "" }, { "docid": "4384b7cd93132d20d2669b6b76a36208", "score": "0.6353566", "text": "function nextFrame() {\r\n\r\n\t\t\t\tif (reverse == true) {\r\n\t\t\t\t\tif ( currentFrame == 0 ) {\r\n\t\t\t\t\t\t++currentLoop;\r\n\t\t\t\t\t\treverse = false;\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t--currentFrame;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t++currentFrame;\r\n\t\t\t\t}\r\n\t\t\t\tif ( currentLoop == loopAmount ) {\r\n\t\t\t\t\tanimationRunning = false;\r\n\t\t\t\t\tonComplete();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif ( currentFrame == end ) {\r\n\t\t\t\t\tif ( loopType == 'none' ) {\r\n\t\t\t\t\t\tanimationRunning = false;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t} else if ( loopType == 'restart' ) {\r\n\t\t\t\t\t\t++currentLoop;\r\n\t\t\t\t\t\tcurrentFrame = 0;\r\n\t\t\t\t\t\tanimateSequence();\r\n\t\t\t\t\t} else if ( loopType == 'reverse' ) {\r\n\t\t\t\t\t\t++currentLoop;\r\n\t\t\t\t\t\treverse = true;\r\n\t\t\t\t\t\tcurrentFrame = currentFrame - 2;\r\n\t\t\t\t\t\tanimateSequence();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if ( currentFrame < 10 ) {\r\n\t\t\t\t\tcalcTrailing(digits - 1);\r\n\t\t\t $('body').children('img').css('display', 'none');\r\n\t\t\t $('body').children('img').eq(currentFrame).css('display', 'block');\r\n\t\t\t\t\t//changeSrc(currentFrame);\r\n\t\t\t\t\tanimateSequence();\r\n\t\t\t\t} else if ( currentFrame < 100 ) {\r\n\t\t\t\t\tcalcTrailing(digits - 2);\r\n\t\t\t container.children('img').css('display', 'none');\r\n\t\t\t container.children('img').eq(currentFrame).css('display', 'block');\r\n\t\t\t\t\t//changeSrc(currentFrame);\r\n\t\t\t\t\tanimateSequence();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "title": "" }, { "docid": "399a1825e6ac68fc66e2b901701ad7fd", "score": "0.6345119", "text": "function changeFrame(fr,clear=true){\n if(clear){\n canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height);\n }\n\tvar end=0;\n\tif(pAnn.events[eve].frames.length>0){\n if(fr!=undefined){\n if(document.getElementById('loopCheck').checked==0){\n if(pAnn.events[eve].frames.length<=fr){\n fr=pAnn.events[eve].frames.length-1;\n end=1\n }else if(fr<0){\n fr=0;\n end=1;\n }\n }else if(pAnn.events[eve].frames.length<=fr){\n fr=0;\n }else if(fr<0){\n fr=pAnn.events[eve].frames.length-1;\n }\n frame=fr;\n }\n \n var frm=pAnn.events[eve].frames[frame];\n\n\t\tif(\"filename\" in frm){\n var img=pAnn.images[frm.filename]\n drawFrame(canvas,img,frm);\n\t\t}\n\t}else{\n\t\tend=1;\n\t}\n return end;\n}", "title": "" }, { "docid": "a325d738183399f705682ff69badca8d", "score": "0.63337255", "text": "function frame() {\n if (pos == 350) {\n clearInterval(id);\n } else {\n pos++;\n elem.style.top = pos + 'px';\n elem.style.left = pos + 'px';\n }\n }", "title": "" }, { "docid": "c5558a69513311904a900b9947e5a275", "score": "0.63095045", "text": "function frame(){\n\t//FRAME DEBUG\n\t\t// noFill();\n\t\t// stroke(0)\n\t\t// strokeWeight(1);\n\t\n\t//Frame Appearance\n\tnoStroke();\n\tfill(0);\n\t\n\t//Frame Render\n\trect(0, 0, canvasWidth, frameThickness);\n\trect(0, canvasWidth-frameThickness, canvasWidth, frameThickness);\n\trect(0, 0, frameThickness, canvasWidth);\n\trect(canvasWidth-frameThickness, 0, frameThickness, canvasWidth);\n}", "title": "" }, { "docid": "9d5869bf09ca81e8984ac09ad96cd1e8", "score": "0.6308606", "text": "function update(){\n //console.log(frames);\n //borramos primero\n ctx.clearRect(0,0,canvas.width,canvas.height);\n //dibujamos con orden de tamaños\n Road();\n drawLines();\n car.draw();\n}", "title": "" }, { "docid": "c9c87f39b672b8a9b9e0bf2532b85851", "score": "0.6277661", "text": "get frames() { return this._frames; }", "title": "" }, { "docid": "dcb10919ebf13652fbaa305900324654", "score": "0.6235839", "text": "function setupFrame() \n{\n\tvar allAreas = document.getElementsByTagName(\"area\");\n\t\n\tfor (i=0; i<allAreas.length; i++)\n\t{\n\t\tallAreas[i].index = i;\n\n\t\taddEvent(allAreas[i], \"mouseover\", writeFrame, false);\n\t\taddEvent(allAreas[i], \"mouseout\", clearFrame, false);\n\t}\n}", "title": "" }, { "docid": "857379322ef7acd40d4cc19d4bd47e7b", "score": "0.6218107", "text": "function frame() {\n \tif (pos4 == spos4) {\n \t\tclearInterval(id);\n \t}\n\t\telse if (pos3 >= 890) {\n \t\tpos4++;\n \t\telem.style.top = pos4 + 'px';\n \t\t//elem.style.left = pos4 - 'px';\n\t\tconsole.log(elem.style.top);\n\n \t}\n }", "title": "" }, { "docid": "a6913065a980bd1acafc5ea23051df78", "score": "0.6205205", "text": "function draw() {\n console.log(frameCount);\n}", "title": "" }, { "docid": "4ba6340d3c28627e41149977f5843aa7", "score": "0.62045825", "text": "addFaceFrames() {\n this.frames = [];\n for (let index = 0; index < config.maxFaces; index++) {\n let frame = document.createElement('div');\n frame.classList.add('face-frame');\n document.body.appendChild(frame);\n this.frames.push(frame);\n }\n }", "title": "" }, { "docid": "96b900b133d7576f59140d19c9fa7279", "score": "0.61728376", "text": "function frame() {\n timeNow = timestamp();\n delta = ((timeNow - timeLast) / 1000);\n dt = (dt + Math.min(1, delta));\n fps = (1 / delta);\n\n stats.begin();\n\n // Update config in desired frame rate\n while (dt > (1 / frameRate)) {\n dt = dt - (1 / frameRate);\n frameStep = (frameStep + 1) % frameRate;\n frameCounter++;\n sceneFrameCounter++;\n\n\n if (frameCounter == 1) {\n sceneFrameCounter = frameCounter - 1 + 1;\n position = { x: 850, y : 750 };\n newPosition = position;\n \n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter > 1 && frameCounter < 91) {\n sceneFrameCounter = frameCounter - 1 + 1;\n position = { x: 850, y : 750 };\n newPosition = getShiftPosition(position, { x : 850, y : 850 }, 60, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 91 && frameCounter < 151) {\n sceneFrameCounter = frameCounter - 91 + 1;\n rotationPosition = { x: 800, y : 900 };\n newPosition = getCirclePosition(rotationPosition, 50, 0, 90, 60, false, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 151 && frameCounter < 211) {\n sceneFrameCounter = frameCounter - 151 + 1;\n position = { x: 800, y : 950 };\n newPosition = getShiftPosition(position, { x : 700, y : 950 }, 60, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 211 && frameCounter < 271) {\n sceneFrameCounter = frameCounter - 211 + 1;\n rotationPosition = { x: 700, y : 1000 };\n newPosition = getCirclePosition(rotationPosition, 50, 180, 270, 60, true, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 271 && frameCounter < 331) {\n sceneFrameCounter = frameCounter - 271 + 1;\n position = { x: 650, y : 1000 };\n newPosition = getShiftPosition(position, { x : 650, y : 1100 }, 60, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 331 && frameCounter < 391) {\n sceneFrameCounter = frameCounter - 331 + 1;\n rotationPosition = { x: 600, y : 1100 };\n newPosition = getCirclePosition(rotationPosition, 50, 0, 90, 60, false, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 391 && frameCounter < 631) {\n sceneFrameCounter = frameCounter - 391 + 1;\n position = { x: 600, y : 1150 };\n newPosition = getShiftPosition(position, { x : 200, y : 1150 }, 240, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 631 && frameCounter < 691) {\n sceneFrameCounter = frameCounter - 631 + 1;\n rotationPosition = { x: 200, y : 1100 };\n newPosition = getCirclePosition(rotationPosition, 50, 90, 180, 60, false, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 691 && frameCounter < 871) {\n sceneFrameCounter = frameCounter - 691 + 1;\n position = { x: 150, y : 1100 };\n newPosition = getShiftPosition(position, { x : 150, y : 800 }, 180, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 871 && frameCounter < 931) {\n sceneFrameCounter = frameCounter - 871 + 1;\n rotationPosition = { x: 200, y : 800 };\n newPosition = getCirclePosition(rotationPosition, 50, 180, 270, 60, false, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 931 && frameCounter < 1051) {\n sceneFrameCounter = frameCounter - 931 + 1;\n position = { x: 200, y : 750 };\n newPosition = getShiftPosition(position, { x : 400, y : 750 }, 120, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1051 && frameCounter < 1111) {\n sceneFrameCounter = frameCounter - 1051 + 1;\n rotationPosition = { x: 400, y : 700 };\n newPosition = getCirclePosition(rotationPosition, 50, 0, 90, 60, true, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1111 && frameCounter < 1171) {\n sceneFrameCounter = frameCounter - 1111 + 1;\n position = { x: 450, y : 700 };\n newPosition = getShiftPosition(position, { x : 450, y : 600 }, 60, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1171 && frameCounter < 1231) {\n sceneFrameCounter = frameCounter - 1171 + 1;\n rotationPosition = { x: 500, y : 600 };\n newPosition = getCirclePosition(rotationPosition, 50, 180, 270, 60, false, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1231 && frameCounter < 1411) {\n sceneFrameCounter = frameCounter - 1231 + 1;\n position = { x: 500, y : 550 };\n newPosition = getShiftPosition(position, { x : 800, y : 550 }, 180, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1411 && frameCounter < 1471) {\n sceneFrameCounter = frameCounter - 1411 + 1;\n rotationPosition = { x: 800, y : 600 };\n newPosition = getCirclePosition(rotationPosition, 50, -90, 0, 60, false, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1471 && frameCounter < 1561) {\n sceneFrameCounter = frameCounter - 1471 + 1;\n position = { x: 850, y : 600 };\n newPosition = getShiftPosition(position, { x : 850, y : 700 }, 60, dt);\n\n renderConfig.position.x = newPosition.x;\n renderConfig.position.y = newPosition.y;\n }\n else if (frameCounter >= 1561) {\n sceneFrameCounter = 0;\n frameCounter = 0;\n }\n }\n\n // Update and render ppv in original frame rate\n ppv.update(renderConfig);\n ppv.render();\n\n stats.end();\n\n if (isLooping) {\n timeLast = timeNow;\n\n requestAnimFrame(frame);\n }\n }", "title": "" }, { "docid": "0dd6df038bd2d54a2d3be00e0655b2ef", "score": "0.61717993", "text": "firstFrame() {\r\n this.currentFrame = 0;\r\n this.emit(exports.PlayerEvent.FrameFirst);\r\n }", "title": "" }, { "docid": "92a85ca3bc316e2e1ac4916f301b71b4", "score": "0.61567956", "text": "frame() {\n this.frameCount++;\n //Update the characteristics of each character according to the input\n for (let player in this.characters) {\n let char = this.characters[player];\n let input = this.inputs[player];\n let [diry, dirx, skillNum] = input.get();\n //Only process inputs if input queue isnt empty\n if (dirx !== undefined) {\n char.receiveInput(dirx, diry, skillNum);\n //Stream the player's input if there is any\n this.sendUpdate('update', player, input.pack(diry, dirx, skillNum))\n }\n //Stop all character actions to prevent massive desync\n else{\n char.receiveInput(0, 0, 0);\n }\n char.frameProcess();\n char.attackList.forEach(hitbox=>this.checkAllHits(hitbox, player));\n char.projectileList.forEach(hitbox=>this.checkAllHits(hitbox, player));\n }\n this.checkVictory();\n }", "title": "" }, { "docid": "e0efbd9ae516557acb88c0876eb5be43", "score": "0.6154029", "text": "getLaggingFrames() {\n\t\t\tlet self = this;\n\t\t\t//A function that capture's the sprites properties\n\t\t\tvar setProperties = function setProperties(sprite) {\n\t\t\t\tif (self.animation.properties.position) {\n\t\t\t\t\tsprite._previousX = sprite.x;\n\t\t\t\t\tsprite._previousY = sprite.y;\n\t\t\t\t}\n\t\t\t\tif (self.animation.properties.rotation) {\n\t\t\t\t\tsprite._previousRotation = sprite.rotation;\n\t\t\t\t}\n\t\t\t\tif (self.animation.properties.size) {\n\t\t\t\t\tsprite._previousWidth = sprite.width;\n\t\t\t\t\tsprite._previousHeight = sprite.height;\n\t\t\t\t}\n\t\t\t\tif (self.animation.properties.scale) {\n\t\t\t\t\tsprite._previousScaleX = sprite.scale.x;\n\t\t\t\t\tsprite._previousScaleY = sprite.scale.y;\n\t\t\t\t}\n\t\t\t\tif (self.animation.properties.alpha) {\n\t\t\t\t\tsprite._previousAlpha = sprite.alpha;\n\t\t\t\t}\n\t\t\t\tif (self.animation.properties.tile) {\n\t\t\t\t\tif (sprite.tilePosition !== undefined) {\n\t\t\t\t\t\tsprite._previousTilePositionX = sprite.tilePosition.x;\n\t\t\t\t\t\tsprite._previousTilePositionY = sprite.tilePosition.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (sprite.tileScale !== undefined) {\n\t\t\t\t\t\tsprite._previousTileScaleX = sprite.tileScale.x;\n\t\t\t\t\t\tsprite._previousTileScaleY = sprite.tileScale.y;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sprite.children && sprite.children.length > 0) {\n\t\t\t\t\tfor (var i = 0, len = sprite.children.length; i < len; i++) {\n\t\t\t\t\t\tvar child = sprite.children[i];\n\t\t\t\t\t\tsetProperties(child);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t//loop through the all the sprites and capture their properties\n\t\t\tfor (var i = 0, len = this.stage.children.length; i < len; i++) {\n\t\t\t\tvar sprite = this.stage.children[i];\n\t\t\t\tsetProperties(sprite);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d8fffae248cc32aa9ebbe1bcf22defb8", "score": "0.6145568", "text": "addFaceFrames() {\n this.frames = [];\n if (CONFIG.mobile) {\n let frame = document.createElement('div');\n frame.classList.add('face-frame');\n document.body.appendChild(frame);\n this.frames.push(frame);\n } else {\n for (let index = 0; index < CONFIG.faceSlots.length; index++) {\n let frame = document.createElement('div');\n frame.classList.add('face-frame');\n document.body.appendChild(frame);\n this.frames.push(frame);\n }\n }\n }", "title": "" }, { "docid": "0f6537f568d0644c81c42ade0f8c1792", "score": "0.61232775", "text": "function updateVisitedFrames(){\n visitedFrames.add(videotagging.getCurrentFrame());\n}", "title": "" }, { "docid": "dab16d9b4f705a0d9765abcb2dd9bfe1", "score": "0.61040694", "text": "function Frame01() {\n\n t.to(introCard, .5, { x: -300, ease: Power3.easeInOut, delay: 2 });\n\n t.delayedCall(2, Frame02);\n\n }", "title": "" }, { "docid": "fdd27ae73c6d29b7e3cdf8a2649ba776", "score": "0.61032206", "text": "function analyzeFrame() {\n let frame;\n \n // Start collecting and analyzing video frames\n frame = snapshot();\n posenetCalc(frame);\n\n}", "title": "" }, { "docid": "e9428e2024c03fd30649398ff5edadc5", "score": "0.6102058", "text": "function getFrame() {\n // CLEAR EVERYTHING \n context.clearRect(0, 0, canvas.width, canvas.height);\n\n // GETTING PICTURE\n frame();\n\n // REQUEST ANIMATION FRAME\n setTimeout(() => {\n requestAnimationFrame(getFrame);\n }, fps);\n \n}", "title": "" }, { "docid": "230d10515aac769db81b238e0e29dd71", "score": "0.6099076", "text": "function ChangeFrame()\n{\n\tiCurrFrame=iCurrFrame < 0 ? 0 : iCurrFrame;\n\tiCurrFrame=iCurrFrame > iMaxFrame ? iMaxFrame : iCurrFrame;\t\n\t$('#CURRTIME').html(myFrames[iCurrFrame]);\n\tfor(var myObjectId in myNotifyList)\n\t{\n\t\tmyNotifyList[myObjectId](myLog[myFrames[iCurrFrame]]);\n\t}\n\t$('#myTimeSlider').val(iCurrFrame);\t\n}", "title": "" }, { "docid": "9ffb27c92dca05458bb532f6529ef030", "score": "0.6086422", "text": "function frame0(){\n init();\n del = 0;\n\n // TweenMax.set(leftarrow,{left:-43});\n // TweenMax.set(rightarrow,{left:266});\n\n tl.to([frame1blocker,legal], .4, {opacity:1}, \"+=4\")\n .to([leftarrow,rightarrow], .5, {opacity:1, ease:Sine.easeInOut})\n .to(leftarrow, .25, {left:-33, ease:Sine.easeInOut})\n .to(rightarrow, .25, {left:270, ease:Sine.easeInOut}, \"-=.25\")\n .to(logo, .4, {opacity:1}, \"-=.2\")\n .from(text1, .4, {top:\"-=10\"})\n .to(text1, .4, {opacity:1}, \"-=0.4\")\n .to(text1, .4, {opacity:0}, \"+=3\")\n .to([eftext1,eftext2], .4, {opacity:1})\n .from([eftext1,eftext2], .4, {top:\"-=10\"}, \"-=.4\")\n .to(cta, .4, {opacity:1}, \"-=.1\")\n .from(cta, .4, {top:\"-=10\"}, \"-=.4\")\n ;\n }", "title": "" }, { "docid": "6d67cb096d9eff22a62757cab23dbadb", "score": "0.60864097", "text": "function frame () {\n\tmap.frame();\n}", "title": "" }, { "docid": "085b029d82c412ddfeb5f9b8256e8881", "score": "0.60795546", "text": "static PushLocalFrame() {}", "title": "" }, { "docid": "9166170a1b2510477f19dd9206fc5a9c", "score": "0.6073918", "text": "frame() {\n this.feetAngle();\n this.display();\n this.move();\n }", "title": "" }, { "docid": "9ccf1efd055c1f2bda8659ec8318f657", "score": "0.6071924", "text": "getFrameCounter() {\r\n const frame = padNumber(this.currentFrame + 1, 3);\r\n const total = padNumber(this.frameCount, 3);\r\n return `${frame} / ${total}`;\r\n }", "title": "" }, { "docid": "813208978f6021d5f93b2eea05adba75", "score": "0.60700524", "text": "function updateVisitedFrames() {\n if (videotagging.imagelist) {\n visitedFrames.add(videotagging.imagelist[videotagging.imageIndex].split(path.sep).pop());\n visitedFramesNumber.add(videotagging.imageIndex);\n } else {\n visitedFrames.add(videotagging.getCurrentFrameId());\n }\n}", "title": "" }, { "docid": "1cf7111b3999fb3c03c90e5f6fef1e15", "score": "0.6069963", "text": "updateRunFrame() {\n this.currentRunFrame = this.currentRunFrame === this.runAnimation.length - 1 ?\n 0 : this.currentRunFrame + 1;\n }", "title": "" }, { "docid": "01271c48a3069b26f44441e76af6d123", "score": "0.6067146", "text": "function _goToFrame(n) {\n if (n > 0 && (n < _frames.length || _frames.length == 1)) {\n _satanimatedTileLayer.clear();\n _frame = n;\n _redraw();\n }\n }", "title": "" }, { "docid": "23ae98a3f47c1d36172856448fe0b2cf", "score": "0.60649496", "text": "function drawFrame() {\n draw(0, 150, 300, 150);\n draw(225, 300, 225, 0);\n draw(225, 0, 75, 0);\n draw(75, 0, 75, 25);\n }", "title": "" }, { "docid": "ec905d0cd945763bb3f34548674c9702", "score": "0.60644424", "text": "function frame() {\n \tif (pos == spos) {\n \t\tclearInterval(id);\n \t}\n\t\telse {\n \t\tpos++;\n \t\telem.style.top = pos + 'px';\n \t\telem.style.left = pos - 'px';\n\t\tconsole.log(elem.style.top);\n\n \t}\n }", "title": "" }, { "docid": "a42346b8ce5308adc8e7a2db9b13b78d", "score": "0.6051928", "text": "prepare() {\n // Init Indices\n this.currentFrameIndex = 75;\n this.lowestFrameIndex = 50;\n this.highestFrameIndex = 50;\n\n // fetch first 50 frames\n this.fetchForwardFrames(50);\n }", "title": "" }, { "docid": "01e5d70bc49555f0a25e5a7ed2d565dd", "score": "0.6045759", "text": "function processed() {\n // Move to next frame\n index++\n\n var hasPendingFrames = index < frames.length\n\n // Check for pending frames, if any process\n if (hasPendingFrames) {\n setTimeout(process, 1);\n return\n }\n\n // If still capturing and no pending frames, start waiting again\n if (capturing) {\n waiting = true\n return\n }\n\n // If done capturing and no pending frames, we're done\n render();\n }", "title": "" }, { "docid": "7e95c159873aaf86d951f4098e97696d", "score": "0.6035563", "text": "function updateFrame() {\n\tvar video = document.getElementById(\"movies\");\n\n\t// calculate out the current position based on frame\n\t// count, then draw the image there using the video\n\t// as a source\n\tvar framePosition = frameCount % frameGrid;\n\tvar frameX = (framePosition % frameColumns) * frameWidth;\n\tvar frameY = (Math.floor(framePosition / frameRows)) * frameHeight;\n\tctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, frameX, frameY, frameWidth, frameHeight);\n\n\tframeCount++;\n}", "title": "" }, { "docid": "b58483ab520cf240b6644b74fe952698", "score": "0.60351247", "text": "constructor() {\r\n this.frameNumber = 0\r\n }", "title": "" }, { "docid": "3f10729fd824e1696bf06e69fb68a639", "score": "0.60214746", "text": "next_frame() {\n // execute current frame's callback, if applicable\n if(this.frame_idx >= 0) {\n let template = this.frames[this.frame_idx].template;\n let callback = this.frame_callbacks.get(template);\n if (callback !== undefined) {\n callback.bind(this)();\n }\n\n let event = 'forward ' + this.frame_idx + ' ' + template;\n this.logger.logTimestamp(event, this.pid)\n }\n\n this.frame_idx += 1;\n while(this.frames[this.frame_idx].is_blocker()) this.frame_idx += 1;\n let frame = this.frames[this.frame_idx];\n frame.fill_in_data(this.uds);\n return frame;\n }", "title": "" }, { "docid": "29d32ce535da03e16bcb15826c91f26c", "score": "0.602034", "text": "handleFrame(event) {\n const balls = this.balls;\n for (let i = 0; i < balls.length - 1; i++) {\n for (let j = i + 1; j < balls.length; j++) {\n balls[i].react(balls[j]);\n }\n }\n\n // note: the advantage of this for loop initialization syntax is that balls.length is evaluated once only\n for (let i = 0, l = balls.length; i < l; i++) {\n balls[i].iterate();\n }\n }", "title": "" }, { "docid": "5de9498874e0cf295779ebb6a7cca2a0", "score": "0.6015284", "text": "function update()\n {\n frames++;\n //console.log(frames);\n ctx.clearRect(0,0,canvas.width,canvas.height);\n defini_dif();\n fondito.draw();\n avioncito.draw();\n // niv_conta++;\n //semillita.draw();\n drawSemi();\n suelecito.draw();\n drawArbol();\n textito.draw();\n //console.log(tiempo);\n textito_tiempo.draw();\n checarTiempo();\n //console.log(niv_conta)\n //nubesita1.draw();\n //nubesita2.draw();\n defini_dif();\n //console.log(niv_conta)\n \n \n dibujarNube();\n //console.log(numRanAlto);\n //console.log(\"la dif es \"+dificultad_jug1);\n // checarColision();\n //console.log(tipoarbol)\n colision();\n\n }", "title": "" }, { "docid": "a334faee3b9ce460b0153cd8c9087f61", "score": "0.60143006", "text": "function getFrame(value){\n\t\t\tplayButtonDecor(value);\n\t\t\tif(value === \"start\"){\n\t\t\t\tframe_counter ++;\n\t\t\t\trunAnimation = requestAnimationFrame(drawCanvas);\n\t\t\t\tstop_runing = false;\n\t\t\t\tif(frame_counter > 1){\n\t\t\t\t\tcancelAnimationFrame(runAnimation);\n\t\t\t\t\tframe_counter = 1;\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tcancelAnimationFrame(runAnimation);\n\t\t\t\tstop_runing = true;\n\t\t\t\tframe_counter --;\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "fe262df6601eaee1e3153d06bf16e883", "score": "0.5999439", "text": "function frame () {\n if (!animationActive) return\n const expectedFrameNumber = (Date.now() - animationStartTime) / 1000 * 60\n const updateCount = Math.min(expectedFrameNumber - lastFrameNumber, 10)\n lastFrameNumber = expectedFrameNumber\n for (let i = 0; i < updateCount; i++) {\n update()\n if (!shouldAnimate()) {\n animationActive = false\n break\n }\n }\n draw()\n if (animationActive) {\n window.requestAnimationFrame(frame)\n }\n }", "title": "" }, { "docid": "2fb17db3ff28816c162fea3896a13131", "score": "0.59957814", "text": "static frameCounter() {\n const time = performance.now();\n\n if (FPS.start === null) {\n FPS.start = time;\n FPS.prevFrameTime = time;\n } else {\n FPS.frameCount++;\n FPS.frames.push(time - FPS.prevFrameTime);\n }\n\n FPS.prevFrameTime = time;\n\n if (FPS.running) {\n requestAnimationFrame(FPS.frameCounter)\n }\n }", "title": "" }, { "docid": "a0d78c19352dbcf0f5999b8223d00522", "score": "0.59951186", "text": "function Animate(id, frames, frame, noLoop) {\n //check if we are looping, or have not reached finish of animation\n if (!noLoop || (frame < frames.length - 1)) \n {\n //set next recursive run of animation\n window.requestAnimationFrame(function (timestamp) {\n Animate(id, frames, frame, noLoop);\n });\n\n //set frame if first run\n if (!frame) frame = 0;\n\n //get img(s) hat are being animated\n var vImgs = $(id).toArray();\n \n //loop through all lements being animated and update animation\n frame = (frame + 1) % frames.length; //up frame w/ wrapping\n vImgs.forEach(function (img) {\n img.src = frames[frame].src; //set src to that of the new frame\n });\n }\n}", "title": "" }, { "docid": "555f92beb2306a24762dd58515bb9643", "score": "0.5982995", "text": "function frameLoop() {\n try {\n now = timestamp(); // time at the start of this loop\n delta = delta + Math.min(1, (now - last) / 1000);\n while(delta > step) { // make sure the game catches up if the delta is too high\n delta = delta - step;\n activeRenderers = game.run(step, config, controls);\n }\n\n canvas.registerRenderers(activeRenderers);\n canvas.drawFrame(\n activeRenderers,\n {\n controls,\n player: game.player,\n map: game.map,\n score: game.score\n }\n );\n\n last = now;\n requestAnimationFrame(frameLoop, canvas.element);\n }\n catch (error) {\n showErrorMessage(error);\n }\n }", "title": "" }, { "docid": "69c1205bd986d23bf481422d127cdbdb", "score": "0.59829414", "text": "static frameCounter() {\n const time = performance.now();\n\n if (FPS.start === null) {\n FPS.start = time;\n FPS.prevFrameTime = time;\n } else {\n FPS.frameCount++;\n FPS.frames.push(time - FPS.prevFrameTime);\n }\n\n FPS.prevFrameTime = time;\n\n if (FPS.running) {\n requestAnimationFrame(FPS.frameCounter)\n }\n }", "title": "" }, { "docid": "69c1205bd986d23bf481422d127cdbdb", "score": "0.59829414", "text": "static frameCounter() {\n const time = performance.now();\n\n if (FPS.start === null) {\n FPS.start = time;\n FPS.prevFrameTime = time;\n } else {\n FPS.frameCount++;\n FPS.frames.push(time - FPS.prevFrameTime);\n }\n\n FPS.prevFrameTime = time;\n\n if (FPS.running) {\n requestAnimationFrame(FPS.frameCounter)\n }\n }", "title": "" }, { "docid": "daf0a8595b063cb47e43f2abaa066dad", "score": "0.598273", "text": "firstFrame() {\n this.tlc.first();\n Metrics.getInstance().updateMetric(metrics.keys.Timeline.FIRST_FRAME, 1);\n }", "title": "" }, { "docid": "3aaee35ef28e802a9c30ec9b3f9b666b", "score": "0.5966934", "text": "function frame(xdir, ydir) {\n if (movement == 0) {\n if (fillmove > 1) {\n randomFill();\n fullBoardCheck();\n if (gameOver == 0) {\n $(\"#score\").html(\"Remaining Colors: \" + remaining);\n }\n }\n solokey = 0;\n clearInterval(id);\n } else {\n movement = 0;\n move(xdir, ydir);\n fillmove++;\n }\n}", "title": "" }, { "docid": "a45ffeb60aea742560c772c723f93f7d", "score": "0.5965801", "text": "function updateFrame(){\r\n\r\n\tcurrentFrame-=(-1);\r\n\tcurrentFrame = currentFrame % cols;\r\n\tif(switch1==1||switch1==2||switch1==3)\r\n\t{\r\n\t\tcurrentFrame = xx % cols;\r\n\t}\r\n\tsrcX= currentFrame * width;\r\n\t\r\n\t\r\n\tsrcY= height;\r\nc.clearRect(0, 0, canvas.width, canvas.height);\r\n}", "title": "" }, { "docid": "6e837071cf1eda582868618ea27f5a96", "score": "0.5959052", "text": "function showFrame(num) {\n\tif (tl) tl.pause();\n\tvar elements = e(\"frame-\"+num).children;\n\tfor (var i = 0; i < elements.length; i++) {\n\t\telements[i].style.visibility = \"visible\";\n\t}\n}", "title": "" }, { "docid": "1b50ddde253f539fccc99e050207fea9", "score": "0.5955884", "text": "function executeFrame(){\n var i, j, circle;\n c.fillStyle = 'rgba(255,255,255,1)';\n c.fillRect(0, 0, canv.width, canv.height);\n c.drawImage(bg,0,0);\n c.drawImage(bg,0,409);\n\n if(gameStatus != 'Over'){\n ball.update();\n if(ball.bounce(pads) === 'GameOver'){\n gameStatus = 'Over';\n }\n\n // count animation step and add to animation offset\n animationStep = ball.countMovePerFrame(offset, animationOffset);\n animationOffset += animationStep;\n\n \n \n }\n else{\n c.font = \"100px Helvetica\";\n c.fillStyle = 'rgba(120,120,0,1)';\n c.fillText('Game\\nOver',50, canv.height/2);\n }\n ball.draw(animationOffset);\n\n for (var i = 0; i < pads.length; i++) {\n pads[i].draw(animationOffset);\n };\n c.font = \"30px Helvetica\";\n\n c.fillText('Score: '+score.toString(),10,50);\n\n\n // Schedule the next frame\n requestAnimFrame(executeFrame);\n}", "title": "" }, { "docid": "a4bbf2ade60d3b99a1a31bf804552f13", "score": "0.595544", "text": "function frame(timeStamp){\n //init\n if (!prevTime) prevTime = timeStamp\n const elapsedTime = timeStamp - prevTime // helps moves things at a constant rate\n prevTime = timeStamp\n\n //update\n for (const obj of updatables) obj.update(elapsedTime)\n\n // drawing\n clearCtx(ctx)\n for (const obj of drawables) obj.draw(ctx)\n\n // Cleanup and advancing conditions\n totalTime += elapsedTime\n if (!(updatables.length == 0 && drawables.length == 0)) // stop after 3 seconds\n window.requestAnimationFrame(frame) // weird mutual recursion, but okay\n else{\n clearCtx(ctx)\n console.log(\"Firworkds over\")\n }\n }", "title": "" }, { "docid": "1101c6b2f87c38f4be6c4c29752f1de9", "score": "0.594411", "text": "writeFrame(pixels) {\r\n if (this.frameCount === 0)\r\n this.writeFirstFrame(pixels);\r\n else\r\n this.writeAdditionalFrame(pixels);\r\n this.frameCount += 1;\r\n }", "title": "" }, { "docid": "c4a7c22d4e1f622f3074c58d82ae7cff", "score": "0.5940776", "text": "function animateFrame() {\n renderCanvas();\n ballMovement();\n checkBallBoudries();\n compPlayer();\n window.requestAnimationFrame(animateFrame);\n}", "title": "" }, { "docid": "e9a50f7fc55dcc489f77612df5d519a7", "score": "0.59374195", "text": "function nextFrame() {\r\n canvas.width = canvas.width; //clears canvas\r\n for (let i = 0; i < drawnItemsList.length; i++) {\r\n drawnItemsList[i].applyFrame();\r\n\r\n if (drawnItemsList[i].lifeTime < 0 ) { // removing objects\r\n drawnItemsList.splice(i,1);\r\n i--;\r\n }\r\n }\r\n\r\n if (typeof arcCount !== \"number\"){\r\n return;\r\n }\r\n\r\n if (fireworkCount > 0 && arcCount % 20 === 0) {\r\n if (fireworkCount % 2 === 0) {\r\n drawnItemsList.push(new Firework({colour : 'lightblue',\r\n lifetime : Math.floor(Math.random() * 50) + 125,\r\n trailColours : ['lightblue', 'blue', '#A5F2F3'],\r\n explosionColours : ['blue', 'lightblue', '#A5F2F3'],\r\n xVel : (-1.5 + (0.2 * (15 - fireworkCount))) } ))\r\n }\r\n else {\r\n drawnItemsList.push(new Firework({colour : 'orange',\r\n lifetime : Math.floor(Math.random() * 50) + 125,\r\n trailColours : ['orange', 'red', 'yellow'],\r\n explosionColours : ['orange', 'red', 'yellow'],\r\n xVel : (-1.5 + (0.2 * (15 - fireworkCount))) } ))\r\n }\r\n\r\n fireworkCount-- ;\r\n }\r\n\r\n arcCount-- ;\r\n // iCount++;\r\n // if (iCount === 20) {\r\n // newFirework();\r\n // console.log(drawnItemsList.length)\r\n // iCount = 0;\r\n // }\r\n\r\n // newFirework( )\r\n}", "title": "" }, { "docid": "b6b208fc3a3d5e519c057d7f6e271ce7", "score": "0.59372133", "text": "function preload(){\n // //2 string represents path of where image is in computer\n // var frameString = \"assets/Thatwasclose0.jpg\";\n // //3 load image based on path giving it\n // frameArray[0] = loadImage(frameString);\n\n //6 - create for loop\n for(var frames = 0; frames< frameAmounts; frames++){\n //7 cancel out //2 and //3 and paste here\n //remove 0 out of Thatwasclose and replace with frames\n var frameString = \"assets/Thatwasclose\" + frames + \".jpg\";\n frameArray[frames] = loadImage(frameString);\n }\n}", "title": "" }, { "docid": "d24becb52484f78910019af593f5f1b6", "score": "0.5937142", "text": "function _nextFrame() {\n \n // Increment (or decrement) the frame counter based on animation direction\n _frame += _direction;\n\n // Test if requested frame lies outside specified array of frames\n if (_frames.length > 1 && (_frame >= _frames.length -1 || _frame < 0)) {\n \n // Varies depending on desired loop behaviour\n switch (_options.loopbehaviour) {\n\n // Loop (default) the animation from the other end\n case 'loop':\n _frame = _frames.length - (_direction * _frame) -1;\n break;\n\n // Stop the animation\n case 'stop':\n _stop();\n _frame -= _direction;\n break;\n\n // Continue by reversing direction of animation\n case 'bounce':\n _direction *= -1;\n _frame = _frame + (2 * _direction);\n break;\n }\n }\n // Push the next frame onto the queue\n _redraw();\n }", "title": "" }, { "docid": "ef2b9d011c1dc50f1ea1ad38b92e31cc", "score": "0.59293795", "text": "nextFrame() {\n this.tlc.next();\n this.tlc.clamp();\n Metrics.getInstance().updateMetric(metrics.keys.Timeline.NEXT_FRAME, 1);\n }", "title": "" }, { "docid": "3087303a9033311b57ea8b6a036dd89c", "score": "0.5918637", "text": "function FrameTerminator(){\n\n\n\n}", "title": "" }, { "docid": "a364cb70561bf174708d77acbcc8c5e4", "score": "0.59182245", "text": "function animationLoop() {\r\n //1 on effface le canvas\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n //2.1 on dessine les objets\r\n afficheInfoJeu(colorPause);\r\n\r\n switch (etatJeu) {\r\n case \"MenuPrincipal\":\r\n afficheMenuPrincipal();\r\n break;\r\n case \"JeuEnCours\":\r\n updateJeu();\r\n break;\r\n case \"ChangementNiveau\":\r\n scoreColor(score);\r\n afficheEcranChangementNiveau();\r\n break;\r\n case \"Pause\" :\r\n //afficheEcranPause();\r\n break;\r\n case \"Play\":\r\n break;\r\n case \"GameOver\":\r\n tableauDesBalles =[];\r\n niveau = 1;\r\n creerDesBalles(niveau+nbBallSupp)\r\n afficheEcranGameOver();\r\n break;\r\n case \"Restart\" :\r\n afficheEcranRestart();\r\n break;\r\n }\r\n \r\n //5 on demande au navigateur de rappeller la fct \r\n //animationLoop dans 1/60eme de seconde\r\n requestAnimationFrame(animationLoop);\r\n //on fait une recurrence de la fonction qui s'appelle elle mm\r\n}", "title": "" }, { "docid": "77ef5b498c375105b4245e5d575b858d", "score": "0.5917838", "text": "function loadPlyMultipleFrame(startframe, endframe) {\n\tplyToLoad = endframe-startframe+1;\n\tif (endframe-startframe <= 0) {\n\t\talert('The endframe should be larger than the startframe!');\n\t\treturn;\t\n\t}\n\tif (plyToLoad>MAX_DENSE_FRAME) {\n\t\tif(!confirm('Frames more than ' + MAX_DENSE_FRAME.toString() + ' will be sparsified, are you sure to continue?')) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// remove loaded frames not in the range to save space\n\tfor (var i=denseLoadedTimestamp.length-1; i>=0; i--){\n\t\tif (denseLoadedTimestamp[i] < startframe || denseLoadedTimestamp[i] > endframe) {\n\t\t\tdenseLoadedTimestamp.splice(i, 1);\n\t\t\tscene3D.remove(plyParticleBuffer[i]);\t\n\t\t\tplyParticleBuffer.splice(i,1);\n\t\t\tplyVerticeBuffer.splice(i,1);\n\t\t}\t\n\t}\n\n\t// frames to be loaded\n\tfor (var frame = startframe; frame<=endframe; frame++){\n\t\tif (fullCamList.indexOf(frame) > -1 &&\n\t\t\t\tdenseLoadedTimestamp.indexOf(frame) < 0) {\n\t\t\tdenseLoadingTimestamp.push(frame);\n\t\t}\t\n\t}\n\n\tloadPlySingleFrame();\t\n\tdocument.addEventListener(\"singleLoadDone\", loadPlySingleFrame, false);\n}", "title": "" }, { "docid": "7aed368e219578c6adaef2dd05904f88", "score": "0.5914187", "text": "frame () {\n\t\t// This is to call the parent class's delete method\n\t\tsuper.frame();\n\n\t\tif (this.state === 'swinging') this.swing();\n\t\telse if (this.state === 'pulling' && this.shouldStopPulling()) this.stopPulling();\n\t\telse if (this.state === 'pulling' && this.shouldRemoveLastChain()) this.removeLastChain();\n\t\telse if (this.state === 'throwing' && this.shouldGenerateAnotherChain()) this.generateChain();\n\n\t\tif (this.hookedObject) {\n\t\t\t// Updates the hooked object's position to follow the hook at every frame.\n\t\t\tthis.hookedObject.position = this.position.add(this.hookedObject.offset);\n\t\t}\n\t}", "title": "" }, { "docid": "ce5defd5de8aec6a5f64d145a2503ab9", "score": "0.5913384", "text": "function setEntitiesAnimationFrames() {\n atlasFramesRecord = game.cache.getJSON('atlasFramesRecord');\n for (let frameName of Object.keys(atlasFramesRecord.frames)) {\n if (/^run/.test(frameName)) playerRunFrames.push(frameName);\n if (/^idle/.test(frameName)) playerIdleFrames.push(frameName);\n if (/^climb/.test(frameName)) playerClimbFrames.push(frameName);\n if (/^fall/.test(frameName)) playerFallFrames.push(frameName);\n if (/^jump/.test(frameName)) playerJumpFrames.push(frameName);\n if (/^coin/.test(frameName)) coinFrames.push(frameName);\n if (/^walk/.test(frameName)) ennemyFrames.push(frameName);\n if (/^door/.test(frameName)) doorFrames.push(frameName);\n }\n}", "title": "" }, { "docid": "2ed446f91d0b9e7ac16ed8573abf4151", "score": "0.59129494", "text": "function frame(array) {\n var stop = 0;\n var frame = \"\";\n var inFrame = \"\";\n var string = \"\";\n \n for (var i = 0; i < array.length; i++) {\n if (array[i].length > stop) {\n stop = array[i].length;\n }\n inFrame += \"* \" + array[i] + \" *\" + \"\\n\";\n }\n for (var j = 0; j < stop + 4; j++) {\n frame += \"*\";\n }\n string = frame + \"\\n\" + inFrame + frame;\n return string;\n }", "title": "" }, { "docid": "7c06fdaea5ca4f1e098ba616edbce843", "score": "0.5910524", "text": "function frame1() {\n\t\t\t\tvar tl = new TimelineMax();\n\t\t\t\ttl\n\t\t\t\t.to(circle1_mc,.3,{alpha:1,onStart:circleOneIn},\"frame1\")\n\t\t\t\treturn tl;\t\n\t\t\n\t\t\t}", "title": "" }, { "docid": "cf43c2b80d45319153db7c1a84b6e993", "score": "0.59102106", "text": "function frame() {\n\n\t\t\tsecondsSinceLastClick = secondsSinceLastClick + 0.10;\n\t\t\tx= x + 2 - Math.random() * 4; \n\t\t\ty = y + 2 - Math.random() *4; \n\n\n\t\t \tfor (var i = 0; i < antArray.length; i++ ){\n \t\t\t\t//console.log(\"this is my divarray in move:\" + antArray[i]); \n\n\n \t\t\t\tvar temp = antArray[i].style.bottom.split(\"px\");\n\n \t\t\t\tvar newY = parseInt(temp[0])\n\n \t\t\t\tnewY += Math.random() * 30;\n\n \t\t\t\t//Only reset the ants if it has been less than 30 seconds since the user's last click!\n \t\t\t\t//console.log(\"secondsSinceLastClick is \" + secondsSinceLastClick)\n \t\t\t\tif (secondsSinceLastClick < 30){\n \t\t\t\t\tif (newY >= window.innerHeight){\n \t\t\t\t\t\tnewY = 0;\n \t\t\t\t\t}\n \t\t\t\t}\n\n\n \t\t\t\tantArray[i].style.bottom = newY +'px'; \n \t\t\t\t//console.log(\"this is newY:\" + newY); \n \t\t\t\t//console.log(\"this is my divarray in move222:\" + antArray[i]); \n \t\t\t}\n\n\t \tif ( left == window.innerWidth)\n \t\t\tclearInterval(id)\n \t\t}", "title": "" }, { "docid": "aaf11003917d55c66b604c8c7b44c36f", "score": "0.58993924", "text": "formatFrames() {\r\n return this.global.frames.join(\"\\n=========================================\\n\");\r\n }", "title": "" }, { "docid": "651211e8d92ba3d759c4b77e818057e2", "score": "0.5898462", "text": "function changeFrame(value) {\n if (frame + value >= 0 && frame + value < game.length && gameMode) {\n setFrame(frame + value)\n } else if (frame + value === game.length) {\n setFrame(0)\n setGameMode(false)\n }\n }", "title": "" }, { "docid": "4b025bf551ef6068296e75746ceebfde", "score": "0.5898194", "text": "function init(){\n\t//aplica a função no click dos divs\n\t$('#container').click(function (event){\n\t\tclicked(event);\n\t});\n\t\n\t//ativa o \"enterframe\"\n\tinterval = setInterval(\"nextStep()\", 1000/30);//30fps\n}", "title": "" }, { "docid": "a3411e38f38fd09d5701262927f0325d", "score": "0.5892797", "text": "frameProcess(){\n //If skill is active, active process\n if (this.curFrame > 0){\n this.activeProcess();\n }\n //Lower cooldown every frame\n if (this.curCooldown > 0){\n this.curCooldown--;\n }\n }", "title": "" }, { "docid": "17dab115f0d34a94b3fbcf2ebd9ad6be", "score": "0.5891863", "text": "function frame()\n {\n if (largeur >= fin)\n {\n clearInterval(id);\n } \n else\n {\n largeur++;\n if(largeur >= 100)\t\t\t\t\t// Si on dépasse 100%, on reste à 100%\n {\n largeur = 100;\n clearInterval(id);\t\t\t\t// Puis on arrête\n }\n elem.style.width = largeur + '%';\n document.getElementById(\"label\").innerHTML = (largeur|0) + '%';\t// On change dans l'HTML, et on tronque pour ne pas avoir de virgule\n }\n }", "title": "" }, { "docid": "b77959ddae97b3141c3a3ff0cbb52d21", "score": "0.5886513", "text": "pushFrame(pixels) {\n\t\tpixels.forEeach(pixel => this.pushPixel(pixel));\n\t}", "title": "" }, { "docid": "e3d7948bb265d647eddc00b814c89700", "score": "0.5861601", "text": "function sendToFrames ( init ) {\n\t\t\tconsole.log(\"Page.slideshowsInit.sendToFrames\");\n\n\t\t\t// ROLL A DICE TO KNOW IF VIDEOS SHOULD BE INCLUDED OR NOT\n\t\t\tvar dice = Math.random();\n\t\t\tself.movieQuota = 0;\n\t\t\tif ( dice > 0.5 ) {\n\t\t\t\tself.movieQuota = 1;\n\t\t\t} \n\t\t\t// console.log( 200, \"Movie quota is \", self.movieQuota );\n\n\t\t\t// GET 2 HORIZONTAL + 2 VERTICAL (MOVIES ARE HORIZONTAL)\n\t\t\t// PUSH TO currentVert + currentHoriz\n\t\t\tfor ( var i = self.slideshowContent.length - 1; i >= 0; i-- ) {\n\t\t\t\t\n\t\t\t\tvar elem = self.slideshowContent[i];\n\t\t\t\t\n\t\t\t\tif ( 'movie' in elem ) {\n\t\t\t\t\t// console.log( 195, \"Webcam running: \", Webcam.running );\n\t\t\t\t\tif ( !Webcam.running && currentHoriz.length < 2 ) {\n\t\t\t\t\t\tcurrentHoriz.push( self.slideshowContent.splice(i,1) );\t\n\t\t\t\t\t\tself.movieQuota = 0;\n\t\t\t\t\t}\t\n\t\t\t\t// ELSE IF IMAGE: SORT INTO VERT AND HORIZ\n\t\t\t\t} else if ( 'image' in elem ) {\n\t\t\t\t\tif ( elem['image']['height'] > elem['image']['width'] ) {\n\t\t\t\t\t\tif ( currentVert.length < 2 ) {\n\t\t\t\t\t\t\tcurrentVert.push( self.slideshowContent.splice(i,1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// IF MOVIE QUOTA IS 1: KEEP GOING\n\t\t\t\t\t\tif ( currentHoriz.length < 2 && self.movieQuota === 0 ) {\n\t\t\t\t\t\t\tcurrentHoriz.push( self.slideshowContent.splice(i,1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tvar delay_2 = 4000,\n\t\t\t\tdelay_3 = 8000,\n\t\t\t\tdelay_4 = 15000; \n\n\t\t\t// IF FIRST TIME\n\t\t\tif ( init ) {\n\t\t\t\tdelay_2 = 0;\n\t\t\t\tdelay_3 = 0;\n\t\t\t\tdelay_4 = 0; \n\t\t\t}\n\n\t\t\tself.injectImage( \"#slideshow_1\", currentVert[0] );\n\t\t\t_.delay( function(){\n\t\t\t\tself.injectImage( \"#slideshow_2\", currentHoriz[0] );\t\t\t\t\n\t\t\t}, delay_2 );\n\t\t\t_.delay( function(){\n\t\t\t\tself.injectImage( \"#slideshow_3\", currentHoriz[1] );\t\t\t\t\n\t\t\t}, delay_3 );\n\t\t\t_.delay( function(){\n\t\t\t\tself.injectImage( \"#slideshow_4\", currentVert[1] );\t\t\n\t\t\t\tcurrentVert.length = 0;\n\t\t\t\tcurrentHoriz.length = 0;\t\t\n\t\t\t}, delay_4 );\n\n\t\t}", "title": "" }, { "docid": "4876c60a94214ecd5fe55a1d0e4d6aa8", "score": "0.5857472", "text": "function readWordFramePerFrame() {\n outputDisplay(true);\n \n counter++; // Increases index position in the list of words\n if (counter > wordsList.length) {\n counter = 0;\n stop();\n }\n }", "title": "" }, { "docid": "68e8db28e7cdf08163cc2671b6a68966", "score": "0.5851742", "text": "function everyFrame() {\n update();\n requestAnimationFrame(everyFrame);\n}", "title": "" }, { "docid": "d34c7298190ba0dff06a85c107b4d43c", "score": "0.58493626", "text": "function animationFrame()\n{\n let elapsed = (Date.now() - startTimeMS) / 1000; // Start a a new clock cycle and divide it by 1000. \n startTimeMS = Date.now();\n\n frameTimer = frameTimer - elapsed; // Run through timer.\n\n // If the frame timer expires.\n if (frameTimer <= 0) {\n frameTimer = frameTimeMax; // Hit max frames.\n frameX++; // Increment frame x by one, move along spritesheet.\n\n // If hit max x frame.\n if (frameX > frameXMax) {\n frameX = 0; // Reset x frames.\n frameY++; // Increment frame y by one, move down spritesheet.\n\n // If hit max y frame.\n if (frameY > frameYMax) {\n frameY = 0; // Reset y frames.\n }\n }\n\n frame++; // Increment frames.\n\n // if hit max frames.\n if (frame > frameMax) {\n frame = 0; // Reset frames.\n frameX = 0; // Reset x frames.\n frameY = 0; // Reset y frames.\n }\n }\n}", "title": "" }, { "docid": "3029478d55024ede679acc06e7a434e8", "score": "0.5846315", "text": "async function step () {\n\tif (RUNNING) {\n\t\t//render frame\n\t\ttry {\n\t\t\tawait ffmpeg.frame(VIDEO, COUNT);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\n\t\tdisplay.start(COUNT);\n\t\tawait delay(5000);\n\t\tdisplay.end();\n\t\t//wipe frame\n\t\ttry {\n\t\t\tawait ffmpeg.clear(COUNT);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t\tCOUNT++;\n\t}\n}", "title": "" }, { "docid": "2d99a0217e6b5e51305cca3be7f81232", "score": "0.5844023", "text": "function drawNextFrame() {\n drawNext = true;\n}", "title": "" }, { "docid": "57f3ad5f9c1ef06fb0b55231b5c6b608", "score": "0.584138", "text": "function animFrame(i) {\n setTimeout(function () {\n incrAngle = self.protractor.getPointFromAnglitude(i, self.protractor.magnitude);\n self.moveTo(incrAngle);\n if (dir) { i++ } else { i-- };\n if (i != finalAngle) {\n animFrame(i);\n } else {\n self.moveTo(self.protractor.getPointFromAnglitude(finalAngle, self.protractor.magnitude));\n }\n 7 // this is the time in ms between frames\n });\n }", "title": "" } ]
7ba647a568883ea03a763170d48a269d
pick the locale from the array try ['enau', 'engb'] as 'enau', 'engb', 'en', as in move through the list trying each substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
[ { "docid": "37dd416755c4006f1b9531bb4c6b7a1a", "score": "0.0", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" } ]
[ { "docid": "f8e3073f64ca049d08490fc227a66426", "score": "0.71346146", "text": "function chooseLocale(names) {\n let next;\n let locale;\n let i = 0;\n while (i < names.length) {\n const split = normalizeLocale(names[i]).split('-');\n let j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n // the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "683d91db53896ae11a29423ba11d19bc", "score": "0.7116722", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.70747524", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.7070656", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" }, { "docid": "06b92bbcf34707b756c759e79ec4e9dc", "score": "0.7066789", "text": "function chooseLocale(names) {\n\t\t var i = 0, j, next, locale, split;\n\t\t\n\t\t while (i < names.length) {\n\t\t split = normalizeLocale(names[i]).split('-');\n\t\t j = split.length;\n\t\t next = normalizeLocale(names[i + 1]);\n\t\t next = next ? next.split('-') : null;\n\t\t while (j > 0) {\n\t\t locale = loadLocale(split.slice(0, j).join('-'));\n\t\t if (locale) {\n\t\t return locale;\n\t\t }\n\t\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t\t //the next array item is better than a shallower substring of this one\n\t\t break;\n\t\t }\n\t\t j--;\n\t\t }\n\t\t i++;\n\t\t }\n\t\t return null;\n\t\t}", "title": "" }, { "docid": "1b4371ca298d5b2a655ab2efa4696290", "score": "0.7064215", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "e47db7c55f442ddd3bf6b57a31520049", "score": "0.7056188", "text": "function chooseLocale(names) {\n\t\tvar i = 0, j, next, locale, split;\n\n\t\twhile (i < names.length) {\n\t\t\tsplit = normalizeLocale(names[i]).split('-');\n\t\t\tj = split.length;\n\t\t\tnext = normalizeLocale(names[i + 1]);\n\t\t\tnext = next ? next.split('-') : null;\n\t\t\twhile (j > 0) {\n\t\t\t\tlocale = loadLocale(split.slice(0, j).join('-'));\n\t\t\t\tif (locale) {\n\t\t\t\t\treturn locale;\n\t\t\t\t}\n\t\t\t\tif (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t\t\t\t\t//the next array item is better than a shallower substring of this one\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tj--;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "7c4e2b06d4ba3835690e97d7163b418d", "score": "0.70456874", "text": "function chooseLocale(names) {\n var i = 0,\n j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "b1c4c803eeb0b69226521e457a1d64d9", "score": "0.70321524", "text": "function chooseLocale(names){for(var j,next,locale,split,i=0;i<names.length;){for(split=normalizeLocale(names[i]).split(\"-\"),j=split.length,next=normalizeLocale(names[i+1]),next=next?next.split(\"-\"):null;j>0;){if(locale=loadLocale(split.slice(0,j).join(\"-\")))return locale;if(next&&next.length>=j&&compareArrays(split,next,!0)>=j-1)\n//the next array item is better than a shallower substring of this one\nbreak;j--}i++}return null}", "title": "" }, { "docid": "487979dde69b02e1dbc987ab02d63e4f", "score": "0.7031046", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "e9a49a83d4b5d2919ac8daae22a7b19e", "score": "0.7015662", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "ad8b39f2f527227954ebdaee03712e76", "score": "0.7010839", "text": "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "title": "" }, { "docid": "3c9a97f8c8763e4b0072c9036ab19a78", "score": "0.700897", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "title": "" }, { "docid": "b16995a4cc0f049e381b7f5b83ffbe19", "score": "0.70015323", "text": "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return null;\n\t }", "title": "" } ]
79f0e8e8e3a9eece347b53893c6b1c1a
Rotate an object around an arbitrary axis in object space
[ { "docid": "97c93a086adf8905500e49aca7b139d7", "score": "0.7490373", "text": "static rotateAroundObjectAxis(object, axis, radians) {\n GameUtils.rotObjectMatrix = new THREE.Matrix4();\n GameUtils.rotObjectMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // object.matrix.multiplySelf(rotObjectMatrix); // post-multiply\n // new code for Three.JS r55+:\n object.matrix.multiply(GameUtils.rotObjectMatrix);\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js r50-r58:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // new code for Three.js r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n }", "title": "" } ]
[ { "docid": "8c8cffb9f59212eb26c3ff0192f7dd55", "score": "0.76930106", "text": "rotate(angle, axis, point) {\n // translate object to the origin before rotation\n if(point != null){\n this.translate(point[0],point[1],point[2]);\n }\n \n // perform rotation\n this._rot[0] = this._rot[0] + angle * axis[0];\n this._rot[1] = this._rot[1] + angle * axis[1];\n this._rot[2] = this._rot[2] + angle * axis[2];\n this._instanceMatrix = mult(rotate(angle, axis), this._instanceMatrix);\n\n // translate object back to its initial position after rotation\n if(point!=null){\n this.translate(-point[0],-point[1],-point[2]);\n }\n }", "title": "" }, { "docid": "f70d8522b5383b1ec62cba93b19a3d39", "score": "0.75464725", "text": "function rotateAroundObjectAxis(object, axis, radians) {\n var rotObjectMatrix = new THREE.Matrix4();\n rotObjectMatrix.makeRotationAxis(axis.normalize(), radians);\n object.matrix.multiply(rotObjectMatrix);\n object.rotation.setFromRotationMatrix(object.matrix);\n}", "title": "" }, { "docid": "c7e7eab9fcb5db2dcff4bbab592f8b85", "score": "0.7512044", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n var rotWorldMatrix = new THREE.Matrix4();\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n object.matrix = rotWorldMatrix;\n object.rotation.setFromRotationMatrix(object.matrix);\n}", "title": "" }, { "docid": "1224ab3ef0ce14fa5e6d7d879782dacc", "score": "0.74996877", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n rotWorldMatrix = new THREE.Matrix4();\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n object.matrix = rotWorldMatrix;\n object.rotation.setFromRotationMatrix(object.matrix);\n}", "title": "" }, { "docid": "12f167de67770c40d4e53e9910641c94", "score": "0.74807864", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n\tvar rotWorldMatrix = new THREE.Matrix4();\n\trotWorldMatrix.makeRotationAxis(\n\t\taxis.normalize(), radians\n\t);\n\n\trotWorldMatrix.multiply(object.matrix);\n\tconsole.log(object.matrix);\n\tobject.matrix = rotWorldMatrix;\n\n\tobject.setRotationFromMatrix(object.matrix, object.scale);\n}", "title": "" }, { "docid": "897e87d20384337012cdeab75c1ec57e", "score": "0.74214846", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n\t rotWorldMatrix = new THREE.Matrix4();\n\t rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\t rotWorldMatrix.multiply(object.matrix); // pre-multiply\n\t object.matrix = rotWorldMatrix;\n\t object.rotation.setFromRotationMatrix(object.matrix);\n\t}", "title": "" }, { "docid": "ca4a80857750b34fbf8ab10ad4969a88", "score": "0.7394253", "text": "function rotateAroundObjectAxis(object, axis, radians) {\n var rotObjectMatrix = new THREE.Matrix4();\n rotObjectMatrix.makeRotationAxis(axis.normalize(), radians);\n object.matrix.multiply(rotObjectMatrix);\n object.rotation.setFromRotationMatrix(object.matrix);\n }", "title": "" }, { "docid": "9d3a8afa536bc593e066475af456a627", "score": "0.73855734", "text": "function rotateAroundObjectAxis(object, axis, radians) {\n\t rotObjectMatrix = new THREE.Matrix4();\n\t rotObjectMatrix.makeRotationAxis(axis.normalize(), radians);\n \n\t // old code for Three.JS pre r54:\n\t // object.matrix.multiplySelf(rotObjectMatrix); // post-multiply\n\t // new code for Three.JS r55+:\n\t object.matrix.multiply(rotObjectMatrix);\n \n\t // old code for Three.js pre r49:\n\t // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n\t // old code for Three.js r50-r58:\n\t // object.rotation.setEulerFromRotationMatrix(object.matrix);\n\t // new code for Three.js r59+:\n\t object.rotation.setFromRotationMatrix(object.matrix);\n\t}", "title": "" }, { "docid": "2688026e2bb044f952fbed25121d6598", "score": "0.73779005", "text": "function rotateAroundObjectAxis(object, axis, radians) {\n var rotObjectMatrix;\n rotObjectMatrix = new THREE.Matrix4();\n rotObjectMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // object.matrix.multiplySelf(rotObjectMatrix); // post-multiply\n // new code for Three.JS r55+:\n object.matrix.multiply(rotObjectMatrix);\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js r50-r58:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // new code for Three.js r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n }", "title": "" }, { "docid": "4e5fe38bc533cab5d8915d664d53c955", "score": "0.7373017", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n\t\tvar rotWorldMatrix = new THREE.Matrix4();\n\t\trotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\t\n\t\trotWorldMatrix.multiply(object.matrix); // pre-multiply\n\t\n\t\tobject.matrix = rotWorldMatrix;\n\t\tobject.rotation.setFromRotationMatrix(object.matrix);\n\t}", "title": "" }, { "docid": "b92f549d12ab370b7146fb0eb324b18c", "score": "0.7340625", "text": "rotateObject(object, angle, origin) {\n object.transform(`r${angle}, ${origin.x}, ${origin.y}`);\n }", "title": "" }, { "docid": "9f22506a76906afe349e98073be17bc1", "score": "0.7287958", "text": "function rotateAroundWorldAxis(delta, object, axis, radians) {\n let rotWorldMatrix = new THREE.Matrix4();\n\n const rotMult = delta * rollSpeed;\n\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians * rotMult);\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n object.matrix = rotWorldMatrix;\n object.rotation.setFromRotationMatrix(object.matrix);\n}", "title": "" }, { "docid": "eed87c2469d439f79913c237d40b6750", "score": "0.7272131", "text": "function rotate(axis, radians) {\n\n var o = origin();\n\n mat4.rotate(o.localmatrix, o.localmatrix, radians, axis);\n\n mat4.multiply(o.localvectors, o.localvectors, o.localmatrix);\n\n setW(o.localvectors);\n \n return o;\n\n}", "title": "" }, { "docid": "9b66b4dfae00e52ead36288eeebeb3a1", "score": "0.72226095", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n rotWorldMatrix = new THREE.Matrix4();\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // rotWorldMatrix.multiply(object.matrix);\n // new code for Three.JS r55+:\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n\n object.matrix = rotWorldMatrix;\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js pre r59:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // code for r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n}", "title": "" }, { "docid": "e6f26559be6a76f72d20ab028afa5aa5", "score": "0.72216755", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n var rotWorldMatrix = new THREE.Matrix4();\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // rotWorldMatrix.multiply(object.matrix);\n // new code for Three.JS r55+:\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n\n object.matrix = rotWorldMatrix;\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js pre r59:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // code for r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n}", "title": "" }, { "docid": "848499d403b4d8ccf7ddf32d9d1c383a", "score": "0.7214853", "text": "static rotateAroundWorldAxis(object, axis, radians) {\n GameUtils.rotWorldMatrix = new THREE.Matrix4();\n GameUtils.rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // rotWorldMatrix.multiply(object.matrix);\n // new code for Three.JS r55+:\n GameUtils.rotWorldMatrix.multiply(object.matrix); // pre-multiply\n\n object.matrix = GameUtils.rotWorldMatrix;\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js pre r59:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // code for r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n }", "title": "" }, { "docid": "ecd338ccbf2cb53949ce8001a7707c45", "score": "0.7207491", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n rotWorldMatrix = new THREE.Matrix4();\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // rotWorldMatrix.multiply(object.matrix);\n // new code for Three.JS r55+:\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n\n object.matrix = rotWorldMatrix;\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js pre r59:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // code for r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n }", "title": "" }, { "docid": "e0215bc69551ce04da9987db6581f1e3", "score": "0.7203571", "text": "function rotateAbout(obj, pivot, axis, theta){\n obj.position.sub(pivot); //remove the offset\n obj.position.applyAxisAngle(axis, theta); //rotate the position\n obj.position.add(pivot); //re-add the offset\n obj.rotateOnAxis(axis, theta); //rotate the object\n}", "title": "" }, { "docid": "a75223b13f72cc48fddcac9fbb101f49", "score": "0.72031945", "text": "function rotateAroundWorldAxis(object, axis, radians) {\n var rotWorldMatrix;\n rotWorldMatrix = new THREE.Matrix4();\n rotWorldMatrix.makeRotationAxis(axis.normalize(), radians);\n\n // old code for Three.JS pre r54:\n // rotWorldMatrix.multiply(object.matrix);\n // new code for Three.JS r55+:\n rotWorldMatrix.multiply(object.matrix); // pre-multiply\n\n object.matrix = rotWorldMatrix;\n\n // old code for Three.js pre r49:\n // object.rotation.getRotationFromMatrix(object.matrix, object.scale);\n // old code for Three.js pre r59:\n // object.rotation.setEulerFromRotationMatrix(object.matrix);\n // code for r59+:\n object.rotation.setFromRotationMatrix(object.matrix);\n }", "title": "" }, { "docid": "556ed9f93846980ce986f956142c4a82", "score": "0.7195335", "text": "function rotateAxis() {\n if(xIsRotating) {\n rotationObjects.rotation.x += rotInc;\n remainingRot -= rotInc;\n \n if(remainingRot <= 0) {\n rotationObjects.rotation.x = originalXRot + (Math.PI / 2);\n originalXRot = rotationObjects.rotation.x;\n remainingRot = Math.PI / 2;\n xIsRotating = false;\n }\n }\n \n else if(yIsRotating) {\n rotationObjects.rotation.y += rotInc;\n remainingRot -= rotInc;\n \n if(remainingRot <= 0) {\n rotationObjects.rotation.y = originalYRot + (Math.PI / 2);\n originalYRot = rotationObjects.rotation.y;\n remainingRot = Math.PI / 2;\n yIsRotating = false;\n }\n }\n \n else if(zIsRotating) {\n rotationObjects.rotation.z += rotInc;\n remainingRot -= rotInc;\n \n if(remainingRot <= 0) {\n rotationObjects.rotation.z = originalZRot + (Math.PI / 2);\n originalZRot = rotationObjects.rotation.z;\n remainingRot = Math.PI / 2;\n zIsRotating = false;\n }\n }\n}", "title": "" }, { "docid": "f80673cf647c4e28ce23f807bbfdd37d", "score": "0.7169024", "text": "function rotate(axis, rotation) {\n if (axis == \"x\") {\n // rotate the camera along the local y axis around its focal point\n cameraDolly.rotation.y += rotation;\n\n // clamp assigned value to 0 - Math.PI * 2 \n if (cameraDolly.rotation.y > Math.PI * 2) {\n cameraDolly.rotation.y -= Math.PI * 2;\n } else if (cameraDolly.rotation.y < 0) {\n cameraDolly.rotation.y += Math.PI * 2;\n }\n cameraDolly.updateMatrix();\n } else if (axis == \"y\") {\n // rotate the camera axis along local x-axis (up/down)\n cameraDollyVertical.rotation.x += rotation;\n cameraDollyVertical.updateMatrix();\n }\n }", "title": "" }, { "docid": "0270e465dd30ee808c73c845eb585c1b", "score": "0.68911886", "text": "rotate( theta, axis ) {\n\n var ctm = mat4.create();\n\n if ( axis === \"X\" ) {\n mat4.fromRotation( ctm, theta, vec3.fromValues( 1, 0, 0 ) );\n } else if ( axis === \"Y\" ) {\n mat4.fromRotation( ctm, theta, vec3.fromValues( 0, 1, 0 ) );\n } else if ( axis === \"Z\" ) {\n mat4.fromRotation( ctm, theta, vec3.fromValues( 0, 0, 1 ) );\n } else {\n throw Error( \"Axis isn't specified correctly.\" );\n }\n\n return ctm;\n\n\n }", "title": "" }, { "docid": "00601ae1e71778994f1ade66b92bf288", "score": "0.68214154", "text": "function rotateAroundObject(x0, y0, object) {\n const degree = object.angle / 180 * Math.PI;\n const cos = Math.cos(degree);\n const sin = Math.sin(degree);\n\n const offsetX = x0 - object.width / 2;\n const offsetY = y0 - object.height / 2;\n\n const dx = offsetX * cos - offsetY * sin;\n const dy = offsetY * cos + offsetX * sin;\n const xAfter = dx + object.x + object.width / 2;\n const yAfter = dy + object.y + object.height / 2;\n return {\n x: xAfter,\n y: yAfter,\n };\n}", "title": "" }, { "docid": "8229dedc68d299a59e76f4c6b1244fd9", "score": "0.6747853", "text": "setRotationRadians(xAxis, yAxis, zAxis) { this.rotation = [xAxis, yAxis, zAxis]; }", "title": "" }, { "docid": "ab1c026449f3460d76c27687e91aa987", "score": "0.67368114", "text": "rotateX(rad) {\n this.obj.rotation.x = rad;\n this.obj.updateMatrixWorld();\n }", "title": "" }, { "docid": "ab1c026449f3460d76c27687e91aa987", "score": "0.67368114", "text": "rotateX(rad) {\n this.obj.rotation.x = rad;\n this.obj.updateMatrixWorld();\n }", "title": "" }, { "docid": "ab1c026449f3460d76c27687e91aa987", "score": "0.67368114", "text": "rotateX(rad) {\n this.obj.rotation.x = rad;\n this.obj.updateMatrixWorld();\n }", "title": "" }, { "docid": "cbf7c709a4748d2aecabc2e22fc110e9", "score": "0.67130363", "text": "function rotateForAxis(axis, coor, angle) {\n angle = radians(angle);\n static = coor.splice(axis, 1)[0];\n c1 = coor[0];\n c2 = coor[1];\n\n coor = [\n Math.cos(angle) * c1 - Math.sin(angle) * c2,\n Math.sin(angle) * c1 + Math.cos(angle) * c2];\n\n coor.splice(axis, 0, static);\n\n return coor;\n}", "title": "" }, { "docid": "e9373033404dfa78e3520f4ca65eb4be", "score": "0.6699767", "text": "function rotateaxis(point, axis, angle) {\n\tvar x = axis.x;\n\tvar y = axis.y;\n\tvar z = axis.z;\n\tvar cosa = Math.cos(angle);\n\tvar sina = Math.sin(angle);\n\t\n\tvar rotmatrix = [\n\t cosa + x*x*(1-cosa), x*y*(1-cosa)-z*sina, x*z*(1-cosa)+y*sina, 0,\n\t x*y*(1-cosa)+z*sina, cosa+y*y*(1-cosa), y*z*(1-cosa)-x*sina, 0,\n\t x*z*(1-cosa)-y*sina, y*z*(1-cosa)+x*sina, cosa+z*z*(1-cosa), 0,\n\t 0, 0, 0, 1\n\t];\n\treturn multiply(rotmatrix, point);\n }", "title": "" }, { "docid": "d7ffcabea121f516b4ccacede80f70f4", "score": "0.6643158", "text": "function rotateAboutPoint(obj, point, axis, theta) {\n obj.position.sub(point); // remove the offset\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\n obj.position.add(point); // re-add the offset\n\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\n}", "title": "" }, { "docid": "878976e5329cd4d6cced6c1a7ce79a89", "score": "0.65757227", "text": "Rotate(float, float, float) {\n\n }", "title": "" }, { "docid": "d14be353d765493e3618607a2e62b97c", "score": "0.65156305", "text": "rotate(angle){\n const {x, y} = this\n this.x = (x * Math.cos(angle)) - (y * Math.sin(angle))\n this.y = (x * Math.sin(angle)) + (y * Math.cos(angle))\n return this // chainable\n }", "title": "" }, { "docid": "bfca32acc664dcae6d9b66caa2e3f061", "score": "0.6505051", "text": "rotate(xin, yin) {\n const radians = Math.atan2(this.y, this.x);\n const x = xin * Math.cos(radians) - yin * Math.sin(radians);\n const y = xin * Math.sin(radians) + yin * Math.cos(radians);\n return {\n x,\n y\n };\n }", "title": "" }, { "docid": "07f1e3fb7c846f8f1929e06686ae7ac5", "score": "0.6418498", "text": "function rotate(coor) {\n return rotateForAxis(\n 2, rotateForAxis(\n 1, rotateForAxis(\n 0, coor, rotate_a[0]), rotate_a[1]), rotate_a[2]);\n}", "title": "" }, { "docid": "6ddc52fcbf58357689908cb717483166", "score": "0.63988966", "text": "rotate() { \n this._shape = this.getRotatedBody();\n this._calculateProperties();\n }", "title": "" }, { "docid": "889b0585270c3e13ead36852ed8ab952", "score": "0.6383085", "text": "rotate(...args) {\n if ( this._movement ) return;\n super.rotate(...args);\n }", "title": "" }, { "docid": "c4f82ee2c9a452859dd2aedb1c24fe72", "score": "0.636364", "text": "rotate(angle = 0) {\n let l = this.len();\n let a = this.angle();\n this.x = Math.cos(angle + a) * l;\n this.y = Math.sin(angle + a) * l;\n return this;\n }", "title": "" }, { "docid": "1399083463abf056893270e48270fb80", "score": "0.63185763", "text": "function RotateAroundOrigin(x, y, angle) {\n return Rotate(0, 0, x, y, angle);\n}", "title": "" }, { "docid": "7216031e68bf77f473c2f24165ef7c71", "score": "0.62687117", "text": "rotate(angle) {\n //Convert from degree to radian \n angle = (angle * Math.PI) / 180;\n //Rotation \n this.transformationMatrix.elements[0] = Math.cos(angle);\n this.transformationMatrix.elements[1] = Math.sin(angle);\n this.transformationMatrix.elements[2] = -Math.sin(angle);\n this.transformationMatrix.elements[3] = Math.cos(angle);\n }", "title": "" }, { "docid": "4773fb465941193bb6fc0127e8635cd1", "score": "0.6255023", "text": "function moveObject() {\n //accelerates and spins user left\n if (movingLeft) {\n if (dx > -15) {\n ax = -0.5;\n }\n\n degree -= 10;\n }\n\n //accelerates user down\n if (movingDown && dy < 10) {\n ay = 0.5;\n }\n\n //accelerates and spins user right\n if (movingRight) {\n if (dx < 15) {\n ax = 0.5;\n }\n\n degree += 10;\n }\n}", "title": "" }, { "docid": "96d018f36ea394ca52a11fe5f3c93051", "score": "0.62542695", "text": "orbit(startCoords, endCoords) {\n var t = new Transform( $(\"#lego-space\").style.transform );\n var magicNumber = .2; //how much should the axis rotate for a given distance mouse movement\n var existingDegX = t.getPropValueInDegree(\"rotateX\");\n var existingDegY = t.getPropValueInDegree(\"rotateY\");\n var xDeg = Math.round((endCoords[0] - startCoords[0]) * magicNumber) + existingDegY;\n var yDeg = Math.round((endCoords[1] - startCoords[1]) * -1 * magicNumber) + existingDegX;\n t.transform[\"rotateX\"] = yDeg + \"deg\";\n t.transform[\"rotateY\"] = xDeg + \"deg\";\n $(\"#lego-space\").style.transform = t.toString();\n }", "title": "" }, { "docid": "522fc7b99af55d54c4b88c06242c35b5", "score": "0.6237984", "text": "rotateCamera() {\n var axis = new THREE.Vector3(), quaternion = new THREE.Quaternion(), eyeDirection = new THREE.Vector3(), objectUpDirection = new THREE.Vector3(), objectSidewaysDirection = new THREE.Vector3(), moveDirection = new THREE.Vector3(), angle;\n moveDirection.set(this._moveCurr.x - this._movePrev.x, this._moveCurr.y - this._movePrev.y, 0);\n angle = moveDirection.length();\n if (angle) {\n this._eye.copy(this.object.position).sub(this.rotationCenter);\n eyeDirection.copy(this._eye).normalize();\n objectUpDirection.copy(this.object.up).normalize();\n objectSidewaysDirection.crossVectors(objectUpDirection, eyeDirection).normalize();\n objectUpDirection.setLength(this._moveCurr.y - this._movePrev.y);\n objectSidewaysDirection.setLength(this._moveCurr.x - this._movePrev.x);\n moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));\n axis.crossVectors(moveDirection, this._eye).normalize();\n var zoomFactor = this.object.zoom;\n angle *= this.rotateSpeed;\n angle /= zoomFactor;\n quaternion.setFromAxisAngle(axis, angle);\n this._eye.applyQuaternion(quaternion);\n this.object.up.applyQuaternion(quaternion);\n this._lastAxis.copy(axis);\n this._lastAngle = angle;\n }\n else if (!this.staticMoving && this._lastAngle) {\n this._lastAngle *= Math.sqrt(1.0 - this.dynamicDampingFactor);\n this._eye.copy(this.object.position).sub(this.rotationCenter);\n quaternion.setFromAxisAngle(this._lastAxis, this._lastAngle);\n this._eye.applyQuaternion(quaternion);\n this.object.up.applyQuaternion(quaternion);\n }\n this._movePrev.copy(this._moveCurr);\n }", "title": "" }, { "docid": "f7735d364ae070972042bdb4913c9b66", "score": "0.6230667", "text": "function rotate_3d(v, theta)\n{\n\n}", "title": "" }, { "docid": "845b600913b663954f380bd098f8c270", "score": "0.62051547", "text": "function rotatePoint(point, axis, rotation)\n{\n var relPoint = new PVector(point.x, point.y);\n relPoint.sub(axis);\n\n var newPoint = new PVector(relPoint.x * Math.cos(rotation) - relPoint.y * Math.sin(rotation), relPoint.x * Math.sin(rotation) + relPoint.y * Math.cos(rotation));\n newPoint.add(axis);\n return newPoint;\n}", "title": "" }, { "docid": "784e0d7530d355661985951bdd9e4f8a", "score": "0.61856335", "text": "function rotateObjets() {\n //expresses angle without referring back to math i can't remember\n degree = THREE.Math.degToRad(0);\n //all figures rotate around their origin\n for (let i = 0; i < figures.length; i++) {\n figures[i].rotateY(degree);\n degree += 0.005;\n }\n}", "title": "" }, { "docid": "8f6eba08901d8f9bb5a924790d2b63a1", "score": "0.61580235", "text": "function planeRotation() {\n plane.rotate = atan2(mouseY - plane.y, mouseX - plane.x) + 90;\n}", "title": "" }, { "docid": "74a82d5681aaf9e0322d7b541f6529bf", "score": "0.6152687", "text": "function rotateAboutPoint(obj, point, axis, theta, pointIsWorld) {\n pointIsWorld = (pointIsWorld === undefined) ? false : pointIsWorld;\n\n if (pointIsWorld) {\n obj.parent.localToWorld(obj.position); // compensate for world coordinate\n }\n\n obj.position.sub(point); // remove the offset\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\n obj.position.add(point); // re-add the offset\n\n if (pointIsWorld) {\n obj.parent.worldToLocal(obj.position); // undo world coordinates compensation\n }\n\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\n}", "title": "" }, { "docid": "01bba38dec3819acbac30dab36247d4c", "score": "0.6137124", "text": "static rotate_pose(pose, axis_of_rotation, angle, point_of_rotation = [0, 0, 0]){\n \tif(Vector.is_pose(pose) == false){\n \tdde_error(\"pose is not properly formatted\")\n }\n \tlet DCM = Vector.pull(pose, [0, 2], [0, 2])\n DCM = Vector.rotate_DCM(DCM, axis_of_rotation, angle)\n let axis\n switch(axis_of_rotation){\n \tcase \"X\":\n \taxis = [1, 0, 0]\n break\n case \"Y\":\n \taxis = [0, 1, 0]\n \tbreak\n case \"Z\":\n \taxis = [0, 0, 1]\n \tbreak\n case \"X'\":\n \taxis = [DCM[0][0], DCM[1][0], DCM[2][0]]\n \tbreak\n \tcase \"Y'\":\n \taxis = [DCM[0][1], DCM[1][1], DCM[2][1]]\n \tbreak\n case \"Z'\":\n \taxis = [DCM[0][2], DCM[1][2], DCM[2][2]]\n \tbreak\n default:\n \taxis = axis_of_rotation\n }\n let position = Vector.transpose(Vector.pull(pose, [0, 2], 3))\n position = Vector.rotate(position, axis, angle, point_of_rotation)\n return Vector.make_pose(position, DCM)\n }", "title": "" }, { "docid": "1f54d2c150e2847e2430984aac3a97d7", "score": "0.61269534", "text": "static RotationAxis(axis, angle) {\r\n\t var result = Matrix.Zero();\r\n\t Matrix.RotationAxisToRef(axis, angle, result);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "1f54d2c150e2847e2430984aac3a97d7", "score": "0.61269534", "text": "static RotationAxis(axis, angle) {\r\n\t var result = Matrix.Zero();\r\n\t Matrix.RotationAxisToRef(axis, angle, result);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "24d1fde9a323e660259bad840b5d3ff7", "score": "0.61077046", "text": "function rotate(d) {\n //define the 3 axes\n var X = new THREE.Vector3(1,0,0);\n var Y = new THREE.Vector3(0,1,0);\n var Z = new THREE.Vector3(0,0,1);\n\n //rotate sphere position\n d.sphere_position.applyAxisAngle(X, -d.pitch);\n d.sphere_position.applyAxisAngle(Y, d.yaw);\n d.sphere_position.applyAxisAngle(Z, -d.roll);\n\n //rotate each finger\n for (var i = 0; i < d.fingers.length; i++) {\n d.fingers[i].tip.applyAxisAngle(X, -d.pitch);\n d.fingers[i].tip.applyAxisAngle(Y, d.yaw);\n d.fingers[i].tip.applyAxisAngle(Z, -d.roll);\n\n d.fingers[i].direction.applyAxisAngle(X, -d.pitch);\n d.fingers[i].direction.applyAxisAngle(Y, d.yaw);\n d.fingers[i].direction.applyAxisAngle(Z, -d.roll);\n }\n\n //rotate hand position\n d.pitch = 0;\n d.yaw = 0;\n d.roll = 0;\n}", "title": "" }, { "docid": "34041ac37217bd2b85df89fc6517d13b", "score": "0.6101006", "text": "function rotateAboutPoint(obj, point, axis, theta, pointIsWorld){\n\tpointIsWorld = (pointIsWorld === undefined)? false : pointIsWorld;\n\n\tif(pointIsWorld){\n\t\tobj.parent.localToWorld(obj.position); // compensate for world coordinate\n\t}\n\n\tobj.position.sub(point); // remove the offset\n\tobj.position.applyAxisAngle(axis, theta); // rotate the POSITION\n\tobj.position.add(point); // re-add the offset\n\n\tif(pointIsWorld){\n\t\tobj.parent.worldToLocal(obj.position); // undo world coordinates compensation\n\t}\n\n\tobj.rotateOnAxis(axis, theta); // rotate the OBJECT\n}", "title": "" }, { "docid": "c6a3f3e99a4d32483ae92405f1930830", "score": "0.6100184", "text": "rotate(a) {\n let xp = Math.cos(a) * this.x - Math.sin(a) * this.y;\n let yp = Math.sin(a) * this.x + Math.cos(a) * this.y;\n return new Vec2(xp, yp);\n }", "title": "" }, { "docid": "aa1fe11bdd95b0e8828a625cca2320e2", "score": "0.60920376", "text": "static RotationAxisToRef(axis, angle, result) {\r\n\t var s = Math.sin(-angle);\r\n\t var c = Math.cos(-angle);\r\n\t var c1 = 1 - c;\r\n\t axis.normalize();\r\n\t result.m[0] = (axis.x * axis.x) * c1 + c;\r\n\t result.m[1] = (axis.x * axis.y) * c1 - (axis.z * s);\r\n\t result.m[2] = (axis.x * axis.z) * c1 + (axis.y * s);\r\n\t result.m[3] = 0.0;\r\n\t result.m[4] = (axis.y * axis.x) * c1 + (axis.z * s);\r\n\t result.m[5] = (axis.y * axis.y) * c1 + c;\r\n\t result.m[6] = (axis.y * axis.z) * c1 - (axis.x * s);\r\n\t result.m[7] = 0.0;\r\n\t result.m[8] = (axis.z * axis.x) * c1 - (axis.y * s);\r\n\t result.m[9] = (axis.z * axis.y) * c1 + (axis.x * s);\r\n\t result.m[10] = (axis.z * axis.z) * c1 + c;\r\n\t result.m[11] = 0.0;\r\n\t result.m[15] = 1.0;\r\n\t }", "title": "" }, { "docid": "aa1fe11bdd95b0e8828a625cca2320e2", "score": "0.60920376", "text": "static RotationAxisToRef(axis, angle, result) {\r\n\t var s = Math.sin(-angle);\r\n\t var c = Math.cos(-angle);\r\n\t var c1 = 1 - c;\r\n\t axis.normalize();\r\n\t result.m[0] = (axis.x * axis.x) * c1 + c;\r\n\t result.m[1] = (axis.x * axis.y) * c1 - (axis.z * s);\r\n\t result.m[2] = (axis.x * axis.z) * c1 + (axis.y * s);\r\n\t result.m[3] = 0.0;\r\n\t result.m[4] = (axis.y * axis.x) * c1 + (axis.z * s);\r\n\t result.m[5] = (axis.y * axis.y) * c1 + c;\r\n\t result.m[6] = (axis.y * axis.z) * c1 - (axis.x * s);\r\n\t result.m[7] = 0.0;\r\n\t result.m[8] = (axis.z * axis.x) * c1 - (axis.y * s);\r\n\t result.m[9] = (axis.z * axis.y) * c1 + (axis.x * s);\r\n\t result.m[10] = (axis.z * axis.z) * c1 + c;\r\n\t result.m[11] = 0.0;\r\n\t result.m[15] = 1.0;\r\n\t }", "title": "" }, { "docid": "0931d4082f55b9c122892a21b127dd5c", "score": "0.6090212", "text": "rotate(angle, center, angleUnit = math_util_1.AngleUnit.Radians) {\r\n\t if (angleUnit === math_util_1.AngleUnit.Degrees) {\r\n\t angle *= math_util_1.MathUtil.DegreesToRadians;\r\n\t }\r\n\t if (center) {\r\n\t var x = center.x;\r\n\t var y = center.y;\r\n\t }\r\n\t else {\r\n\t var x = this.tx;\r\n\t var y = this.ty;\r\n\t }\r\n\t const cos = Math.cos(angle);\r\n\t const sin = Math.sin(angle);\r\n\t const tx = x - x * cos + y * sin;\r\n\t const ty = y - x * sin - y * cos;\r\n\t const a = this.a;\r\n\t const b = this.b;\r\n\t const c = this.c;\r\n\t const d = this.d;\r\n\t this.a = cos * a + sin * c;\r\n\t this.b = cos * b + sin * d;\r\n\t this.c = -sin * a + cos * c;\r\n\t this.d = -sin * b + cos * d;\r\n\t this.tx += tx * a + ty * c;\r\n\t this.ty += tx * b + ty * d;\r\n\t return this;\r\n\t }", "title": "" }, { "docid": "0931d4082f55b9c122892a21b127dd5c", "score": "0.6090212", "text": "rotate(angle, center, angleUnit = math_util_1.AngleUnit.Radians) {\r\n\t if (angleUnit === math_util_1.AngleUnit.Degrees) {\r\n\t angle *= math_util_1.MathUtil.DegreesToRadians;\r\n\t }\r\n\t if (center) {\r\n\t var x = center.x;\r\n\t var y = center.y;\r\n\t }\r\n\t else {\r\n\t var x = this.tx;\r\n\t var y = this.ty;\r\n\t }\r\n\t const cos = Math.cos(angle);\r\n\t const sin = Math.sin(angle);\r\n\t const tx = x - x * cos + y * sin;\r\n\t const ty = y - x * sin - y * cos;\r\n\t const a = this.a;\r\n\t const b = this.b;\r\n\t const c = this.c;\r\n\t const d = this.d;\r\n\t this.a = cos * a + sin * c;\r\n\t this.b = cos * b + sin * d;\r\n\t this.c = -sin * a + cos * c;\r\n\t this.d = -sin * b + cos * d;\r\n\t this.tx += tx * a + ty * c;\r\n\t this.ty += tx * b + ty * d;\r\n\t return this;\r\n\t }", "title": "" }, { "docid": "02736481e3b03fd6ba4f28d3fdd1a332", "score": "0.6073793", "text": "function rotateObject(obj, ref, px = 0, py = 0, pz = 0, rx = 0, ry = 0, rz = 0) {\n try {\n obj.object3D.position.x = ref.position.x + px;\n obj.object3D.position.y = ref.position.y + py;\n obj.object3D.position.z = ref.position.z + pz;\n obj.object3D.rotation.x = THREE.Math.degToRad(ref.rotation.x + rx);\n obj.object3D.rotation.y = THREE.Math.degToRad(ref.rotation.y + ry);\n obj.object3D.rotation.z = THREE.Math.degToRad(ref.rotation.z + rz);\n } catch(error) {\n console.log('Tried to move object but got error: ' + error) // This try/catch block shouldn't be required...\n }\n}", "title": "" }, { "docid": "cdd6beba1d61f7659de8ab6a5b9754f6", "score": "0.6057905", "text": "rotate(radiansAngle)\r\n {\r\n this.rotation += radiansAngle;\r\n }", "title": "" }, { "docid": "cdd6beba1d61f7659de8ab6a5b9754f6", "score": "0.6057905", "text": "rotate(radiansAngle)\r\n {\r\n this.rotation += radiansAngle;\r\n }", "title": "" }, { "docid": "b062b41e04558d63462697cc2d14375f", "score": "0.6029978", "text": "static RotationAxis(axis, angle) {\n var result = new Matrix();\n Matrix.RotationAxisToRef(axis, angle, result);\n return result;\n }", "title": "" }, { "docid": "c8d13a913d9aba60a48176b801459a20", "score": "0.60181504", "text": "function rotate(){\n if(!collision_rotation()) piece.rotateCW(ctx);\n}", "title": "" }, { "docid": "a538c1baa0861f5758bf2a5a54e8ac35", "score": "0.60072696", "text": "rotateObject(obj) {\n var point;\n var rotateHandler = this.scene.onPointerObservable.add((pointerInfo) => {\n if ( pointerInfo.type == BABYLON.PointerEventTypes.POINTERDOWN ) {\n point = pointerInfo.pickInfo.pickedPoint;\n }\n if ( pointerInfo.type == BABYLON.PointerEventTypes.POINTERUP ) {\n this.scene.onPointerObservable.remove(rotateHandler);\n if ( pointerInfo.pickInfo.hit && VRSPACEUI.findRootNode(pointerInfo.pickInfo.pickedMesh) == obj ) {\n var dest = pointerInfo.pickInfo.pickedPoint;\n\n //var center = obj.position;\n var center = new BABYLON.Vector3(obj.position.x, (dest.y+point.y)/2, obj.position.z);\n var vFrom = point.subtract(center).normalize();\n var vTo = dest.subtract(center).normalize();\n \n var rotationMatrix = new BABYLON.Matrix();\n BABYLON.Matrix.RotationAlignToRef(vFrom, vTo, rotationMatrix);\n var quat = BABYLON.Quaternion.FromRotationMatrix(rotationMatrix);\n var result = BABYLON.Quaternion.FromEulerVector(obj.rotation).multiply(quat).toEulerAngles();\n\n console.log( obj.rotation+\"->\"+result);\n\n // vertical pointer movement:\n var dy = dest.y - point.y;\n // horizontal pointer movement:\n var dxz = new BABYLON.Vector3(dest.x,0,dest.z).subtract(new BABYLON.Vector3(point.x,0,point.z)).length();\n if ( Math.abs(dxz) > Math.abs(dy*3) ) {\n // mostly horizontal movement, rotation only around y\n console.log(\"Y rotation\")\n this.worldManager.VRSPACE.sendEvent(obj.VRObject, {rotation: { x:obj.rotation.x, y:result.y, z:obj.rotation.z}} );\n } else {\n // rotating around all axes\n this.worldManager.VRSPACE.sendEvent(obj.VRObject, {rotation: { x:result.x, y:result.y, z:result.z}} );\n }\n\n }\n }\n });\n }", "title": "" }, { "docid": "b43cef733bcb98fbe0ef6769333cf05e", "score": "0.5999658", "text": "function rotatePendulumContinuous(object, rot) {\n createjs.Tween.get(object).to({\n rotation: rot\n }, 500, createjs.Ease.getPowInOut(1));\n}", "title": "" }, { "docid": "9da3b0665d6c71ce1984ec2c7ae460fa", "score": "0.5996961", "text": "rotate(angle) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const a1 = this.a;\n const c1 = this.c;\n const tx1 = this.tx;\n this.a = a1 * cos - this.b * sin;\n this.b = a1 * sin + this.b * cos;\n this.c = c1 * cos - this.d * sin;\n this.d = c1 * sin + this.d * cos;\n this.tx = tx1 * cos - this.ty * sin;\n this.ty = tx1 * sin + this.ty * cos;\n return this;\n }", "title": "" }, { "docid": "e72406b98a9db40f7856699205edf6bf", "score": "0.5993383", "text": "rotate(rotateBy){\n this.props.angle = this.props.angle + rotateBy;\n //todo: change to a mathematical formula to converting \n //angle to quadrant \n if (this.props.angle >= 180){\n this.props.angle = -180;\n }else if (this.props.angle < -180){\n this.props.angle = 90;\n }\n }", "title": "" }, { "docid": "5f787515636325fed21184ffe08864d7", "score": "0.59919083", "text": "static RotationFromAxis(axis1, axis2, axis3) {\n var rotation = Vector3.Zero();\n Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation);\n return rotation;\n }", "title": "" }, { "docid": "4f2240b677cbffc191cdb07e5bf863fe", "score": "0.59878325", "text": "rotate(angle) {\n this.angle += angle;\n }", "title": "" }, { "docid": "70142fa19821b742adec68e448f25e5a", "score": "0.598359", "text": "static rotate_DCM(DCM = [[1, 0, 0],[0, 1, 0],[0, 0, 1]], axis_of_rotation, angle){\n \tlet trans_matrix = Vector.identity_matrix(3)\n let x_vector, y_vector, z_vector\n \tswitch(axis_of_rotation){\n \tcase \"X\":\n \ttrans_matrix[1][1] = cosd(angle)\n trans_matrix[2][2] = cosd(angle)\n trans_matrix[2][1] = sind(angle)\n trans_matrix[1][2] = -sind(angle)\n break\n case \"Y\":\n \ttrans_matrix[0][0] = cosd(angle)\n trans_matrix[2][2] = cosd(angle)\n trans_matrix[0][2] = sind(angle)\n trans_matrix[2][0] = -sind(angle)\n \tbreak\n case \"Z\":\n \ttrans_matrix[0][0] = cosd(angle)\n trans_matrix[1][1] = cosd(angle)\n trans_matrix[1][0] = sind(angle)\n trans_matrix[0][1] = -sind(angle)\n \tbreak\n case \"X'\":\n \tx_vector = [DCM[0][0], DCM[1][0], DCM[2][0]]\n \tDCM = Vector.rotate_DCM(DCM, x_vector, angle)\n \tbreak\n \tcase \"Y'\":\n \ty_vector = [DCM[0][1], DCM[1][1], DCM[2][1]]\n \tDCM = Vector.rotate_DCM(DCM, y_vector, angle)\n \tbreak\n case \"Z'\":\n \tz_vector = [DCM[0][2], DCM[1][2], DCM[2][2]]\n \tDCM = Vector.rotate_DCM(DCM, z_vector, angle)\n \tbreak\n default:\n \tx_vector = [DCM[0][0], DCM[1][0], DCM[2][0]]\n y_vector = [DCM[0][1], DCM[1][1], DCM[2][1]]\n z_vector = [DCM[0][2], DCM[1][2], DCM[2][2]]\n x_vector = Vector.rotate(x_vector, axis_of_rotation, angle)\n y_vector = Vector.rotate(y_vector, axis_of_rotation, angle)\n z_vector = Vector.rotate(z_vector, axis_of_rotation, angle)\n DCM = Vector.transpose([x_vector, y_vector, z_vector])\n return DCM\n }\n return Vector.matrix_multiply(DCM, trans_matrix)\n }", "title": "" }, { "docid": "f26d14cdfa90f234862cf0ba6c37f656", "score": "0.59482616", "text": "xRotate(degree)\n {\n var radians = Math.toRadians(degree);\n var Rx = mat3.create();\n Rx[4] = Math.cos(radians);\n Rx[5] = -Math.sin(radians);\n Rx[7] = Math.sin(radians);\n Rx[8] = Math.cos(radians);\n\n this.multi(Rx); // If P is the set of surface points, then this method performs the matrix multiplcation: Rx * P\n this.erase(); // Note that one could use two canvases to speed things up, which also eliminates the need to erase.\n this.draw();\n }", "title": "" }, { "docid": "c09548825ce09222152a0da2009ecaa2", "score": "0.5946529", "text": "setRotationDegrees(xAxis, yAxis, zAxis) {\r\n const degreesToRadians = Math.PI / 180;\r\n xAxis *= degreesToRadians;\r\n yAxis *= degreesToRadians;\r\n zAxis *= degreesToRadians;\r\n this.rotation = [xAxis, yAxis, zAxis];\r\n }", "title": "" }, { "docid": "af5384c61c8c75d5c0f83114e308a24a", "score": "0.5945127", "text": "function makeLengthAngleAxisTransform( cyl, cylAxis, center )\r\n{\r\n\tcyl.matrixAutoUpdate = false;\r\n\r\n\t// From left to right using frames: translate, then rotate; TR.\r\n\t// So translate is first.\r\n\tcyl.matrix.makeTranslation( center.x, center.y, center.z );\r\n\r\n\t// take cross product of cylAxis and up vector to get axis of rotation\r\n\tvar yAxis = new THREE.Vector3(0,1,0);\r\n\t// Needed later for dot product, just do it now;\r\n\t// a little lazy, should really copy it to a local Vector3.\r\n\tcylAxis.normalize();\r\n\tvar rotationAxis = new THREE.Vector3();\r\n\trotationAxis.crossVectors( cylAxis, yAxis );\r\n\tif ( rotationAxis.length() < 0.000001 )\r\n\t{\r\n\t\t// Special case: if rotationAxis is just about zero, set to X axis,\r\n\t\t// so that the angle can be given as 0 or PI. This works ONLY\r\n\t\t// because we know one of the two axes is +Y.\r\n\t\trotationAxis.set( 1, 0, 0 );\r\n\t}\r\n\trotationAxis.normalize();\r\n\r\n\t// take dot product of cylAxis and up vector to get cosine of angle of rotation\r\n\tvar theta = -Math.acos( cylAxis.dot( yAxis ) );\r\n\t//cyl.matrix.makeRotationAxis( rotationAxis, theta );\r\n\tvar rotMatrix = new THREE.Matrix4();\r\n\trotMatrix.makeRotationAxis( rotationAxis, theta );\r\n\tcyl.matrix.multiply( rotMatrix );\r\n}", "title": "" }, { "docid": "d1ce2678bd04527e1a4ed2f214e03afb", "score": "0.5934554", "text": "Rotate(direction) {\n this.angle += this.rotationSpeed * direction;\n }", "title": "" }, { "docid": "3cf8760fac3ddbc440a71a0ad8101a35", "score": "0.59141725", "text": "rotateX(angle) {\n var radian = 0;\n if (GLBoost[\"VALUE_ANGLE_UNIT\"] === GLBoost.DEGREE) {\n radian = MathUtil.degreeToRadian(angle);\n } else {\n radian = angle;\n }\n\n var cos = Math.cos(radian);\n var sin = Math.sin(radian);\n return this.setComponents(1, 0, 0, 0, cos, -sin, 0, sin, cos);\n }", "title": "" }, { "docid": "ba25c4af4641d3aba2604d7a68fb0b0f", "score": "0.59005547", "text": "function gRotate(theta,x,y,z) {\n modelMatrix = mult(rotate(theta,[x,y,z]), modelMatrix) ;\n}", "title": "" }, { "docid": "7a63746ef03d1e92ef4a317e79691981", "score": "0.5893536", "text": "applyRotation() {\n //matrix math would be more efficient here. consider for optimzation\n if (this.rotVelocity != 0) {\n for (let i in this.points) {\n let newX = this.points[i].x * Math.cos(this.rotVelocity) - this.points[i].y * Math.sin(this.rotVelocity);\n let newY = this.points[i].y * Math.cos(this.rotVelocity) + this.points[i].x * Math.sin(this.rotVelocity);\n this.points[i].x = newX;\n this.points[i].y = newY;\n }\n }\n }", "title": "" }, { "docid": "a1e9b2ec06a0eca5ae8452b9f5fdbde1", "score": "0.58894295", "text": "rotate(event)\r\n\t {\r\n\t \tif (event.deltaY >0)\r\n\t \t {\r\n\t \t \tthis.angle +=10;\r\n\t \t \tif (this.angle >360)\r\n\t \t \t {\r\n\t \t \t \tthis.angle = 0;\r\n\t \t \t }\r\n\t \t }\r\n\t \t else\r\n\t \t {\r\n\t \t \tthis.angle -=10;\r\n\t \t \tif (this.angle <0)\r\n\t \t \t {\r\n\t \t \t \tthis.angle =360;\r\n\t \t \t }\r\n\t \t }\r\n\t }", "title": "" }, { "docid": "d36f05d5b90c3db8df963a93423e422e", "score": "0.58829194", "text": "function rotate90Clockwise(rectangle) {\n let x = -(rectangle.y + rectangle.height);\n let y = rectangle.x;\n let width = rectangle.height;\n let height = rectangle.width;\n rectangle.x = x;\n rectangle.y = y;\n rectangle.width = width;\n rectangle.height = height;\n}", "title": "" }, { "docid": "a2878361ff94afcdaf1697820fc5d813", "score": "0.58757895", "text": "rotateTurtle(x, y, z) {\n var e = new THREE.Euler(\n x * 3.14/180,\n\t\t\t\ty * 3.14/180,\n\t\t\t\tz * 3.14/180);\n this.state.dir.applyEuler(e);\n }", "title": "" }, { "docid": "ddf7cba67a61cea14441833014e835d4", "score": "0.58689034", "text": "function gRotate(theta,x,y,z) {\n modelMatrix = mult(modelMatrix,rotate(theta,[x,y,z])) ;\n}", "title": "" }, { "docid": "ddf7cba67a61cea14441833014e835d4", "score": "0.58689034", "text": "function gRotate(theta,x,y,z) {\n modelMatrix = mult(modelMatrix,rotate(theta,[x,y,z])) ;\n}", "title": "" }, { "docid": "a055418f1107217b11dc62fdcbb7926e", "score": "0.5864831", "text": "rotateVel(angle) {\n\t\tthis.velocity.x = (this.velocity.x * Math.cos(angle)) - (this.velocity.y * Math.sin(angle)),\n\t\t\tthis.velocity.y = (this.velocity.x * Math.sin(angle)) + (this.velocity.y * Math.cos(angle))\n\t}", "title": "" }, { "docid": "59d4b8e4f7fa8d0b418bf682ceae1547", "score": "0.58554465", "text": "static RotationAxisToRef(axis, angle, result) {\n var s = Math.sin(-angle);\n var c = Math.cos(-angle);\n var c1 = 1 - c;\n axis.normalize();\n const m = result._m;\n m[0] = (axis._x * axis._x) * c1 + c;\n m[1] = (axis._x * axis._y) * c1 - (axis._z * s);\n m[2] = (axis._x * axis._z) * c1 + (axis._y * s);\n m[3] = 0.0;\n m[4] = (axis._y * axis._x) * c1 + (axis._z * s);\n m[5] = (axis._y * axis._y) * c1 + c;\n m[6] = (axis._y * axis._z) * c1 - (axis._x * s);\n m[7] = 0.0;\n m[8] = (axis._z * axis._x) * c1 - (axis._y * s);\n m[9] = (axis._z * axis._y) * c1 + (axis._x * s);\n m[10] = (axis._z * axis._z) * c1 + c;\n m[11] = 0.0;\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n result._markAsUpdated();\n }", "title": "" }, { "docid": "3a453972f96c09e692f15d2e77c6def8", "score": "0.58483654", "text": "function rotateObjects() {\n for (var i = 0; i < pos.length; i++) {\n pos[i] += inc; objects[i].visibility = 'visible';\n objects[i].left = (r * Math.cos(pos[i])) + xoff;\n objects[i].top = (r * Math.sin(pos[i])) + yoff;\n }\n rotateTimer = setTimeout(rotateObjects(), 70);\n}", "title": "" }, { "docid": "c2b934eea08def0179afc29da1a14b26", "score": "0.5842902", "text": "static RotationFromAxis(axis1, axis2, axis3, out) {\r\n\t out = out || new Vector3();\r\n\t quaternion_1.Quaternion.RotationQuaternionFromAxis(axis1, axis2, axis3, quaternion_1.Quaternion.scratch0);\r\n\t return quaternion_1.Quaternion.scratch0.toEulerAngles(out);\r\n\t }", "title": "" }, { "docid": "c2b934eea08def0179afc29da1a14b26", "score": "0.5842902", "text": "static RotationFromAxis(axis1, axis2, axis3, out) {\r\n\t out = out || new Vector3();\r\n\t quaternion_1.Quaternion.RotationQuaternionFromAxis(axis1, axis2, axis3, quaternion_1.Quaternion.scratch0);\r\n\t return quaternion_1.Quaternion.scratch0.toEulerAngles(out);\r\n\t }", "title": "" }, { "docid": "278f6c18466524be8d782acfe714ae86", "score": "0.58421195", "text": "function tweenRotation(object) {\n var randomDelay = game.rnd.between(0, 900);\n var amountRotation = 5;\n object.angle = amountRotation * -1;\n object.anchor.set(.5);\n var move = game.add.tween(object).to({\n angle: amountRotation,\n }, 800, Phaser.Easing.Quadratic.InOut, true, randomDelay, -1, true);\n}", "title": "" }, { "docid": "663cd362cd2dbee6f547a373f4f68cd1", "score": "0.58300567", "text": "rotate(angleInRadians) {\n const m = this.getCurrentMatrix();\n this.setCurrentMatrix(m3.rotate(m, -angleInRadians));\n }", "title": "" }, { "docid": "01f5c0b639184ac6271410ea2da434aa", "score": "0.58234525", "text": "function boatRotate(object, dir) {\n var id = window.setInterval(function() {\n if (dir < 0) {\n if (object.rotation[1] < degToRad(90)) {\n object.rotateObject(0, 5, 0);\n } else {\n boatMove(object, dir);\n window.clearInterval(id);\n }\n } else {\n if (object.rotation[1] > degToRad(-90)) {\n object.rotateObject(0, -5, 0);\n } else {\n boatMove(object, dir);\n window.clearInterval(id);\n }\n }\n }, 50);\n}", "title": "" }, { "docid": "d1a076f02e6690ea391ca8160709382c", "score": "0.58124846", "text": "static RotationAxis(axis, angle) {\n return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());\n }", "title": "" }, { "docid": "d1a076f02e6690ea391ca8160709382c", "score": "0.58124846", "text": "static RotationAxis(axis, angle) {\n return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());\n }", "title": "" }, { "docid": "98f8761264d0d4c09475d1c92493d3e4", "score": "0.5810772", "text": "setRotation(rotation, update=true){\n this.setMatrixProperty('rotation', rotation, update);\n }", "title": "" }, { "docid": "ce06b87786d7305673830bdd6993ceb1", "score": "0.58086866", "text": "rotateTurtle(x, y, z) {\n var e = new THREE.Euler(\n x * 3.14/180,\n\t\t\t\ty * 3.14/180,\n\t\t\t\tz * 3.14/180);\n console.log(x + \", \" + y);\n this.state.dir.applyEuler(e);\n this.state.dir.normalize();\n }", "title": "" }, { "docid": "52a4c05237c50bf916a868db34864ac9", "score": "0.58052886", "text": "updateRotation() {\n this.viewNode.rotation = this.shapePiece.rotationProperty.value;\n if ( this.positioned ) {\n this.shadowNode.rotation = this.shapePiece.rotationProperty.value;\n }\n }", "title": "" }, { "docid": "1df7afb974d536e42754ae1d501e349d", "score": "0.58029413", "text": "function rotateTo(actual) {\n //Z axis\n var axis = new THREE.Vector3(0, 0, 1);\n\n //current intersection point\n actual.y = 0;\n\n //angle between the previous and current intersection points\n var angle = axis.angleTo(actual) - axis.angleTo(previous);\n\n //get the rotation's direction \n if (actual.x < 0) {\n angle = -angle;\n }\n\n //limit the rotation speed\n while (Math.abs(angle) > rotationSpeed) {\n angle -= angle / 10;\n }\n\n rotateBy(angle);\n\n //set previous for the next iteration\t\n previous = actual;\n previous.y = 0;\n}", "title": "" }, { "docid": "8bd860b17cca7a2abfd6ce11df6ab419", "score": "0.5797971", "text": "function rotation(x, y, z) {\n return new THREE.Matrix4().set(\n Math.cos(z) * Math.cos(y), -Math.sin(z) * Math.cos(x) + Math.cos(z) * Math.sin(y) * Math.sin(x), Math.sin(z) * Math.sin(x) + Math.cos(z) * Math.sin(y) * Math.cos(x), 0,\n Math.sin(z) * Math.cos(y), Math.cos(z) * Math.cos(x) + Math.sin(z) * Math.sin(y) * Math.sin(x), -Math.cos(z) * Math.sin(x) + Math.sin(z) * Math.sin(y) * Math.cos(x), 0,\n -Math.sin(y), Math.cos(y) * Math.sin(x), Math.cos(y) * Math.cos(x), 0,\n 0, 0, 0, 1\n )\n}", "title": "" }, { "docid": "9ea108dbba2419d0bb15b42545f0e25c", "score": "0.5760443", "text": "function draw_object(o, buffer){\n buffer.ctx.save();\n buffer.ctx.translate(o.x, o.y);\n buffer.ctx.rotate(-o.heading);\n buffer.ctx.drawImage(o.predraw, -o.size, -o.size);\n buffer.ctx.restore();\n\n}", "title": "" }, { "docid": "faa39ce158bdf7fd5072408e6e227632", "score": "0.5753696", "text": "function objectRot(div, degree){\n $({degrees: degree}).animate({degrees: degree}, {\n\tduration: 2000,\n\tstep: function(now) {\n\t $(div).css({\n\t\ttransform: 'rotate(' + now + 'deg)'\n\t });\n\t}\n });\n return degree;\n}", "title": "" }, { "docid": "d0945a4024a2e9d71c24924b3e0370aa", "score": "0.5739302", "text": "rotate180() {\n map.data.rotate180()\n\n // decrement and wrap to 4 cardinals\n this.dir = this.dir - 1\n if ( this.dir < 0 ) {\n this.dir = 3\n }\n\n render()\n }", "title": "" }, { "docid": "d1eed6430018f26e3f6474e94fb26e72", "score": "0.57371974", "text": "rotation()\r\n {\r\n var rotMatrix = mat4.create();\r\n\r\n mat4.rotateY(rotMatrix, rotMatrix, this.currentAngle % (2 * Math.PI));\r\n\r\n return rotMatrix;\r\n }", "title": "" } ]
8e4ff4c916e06e4482a53dc8f448a718
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
[ { "docid": "38124867e08d09dda7aed9d57520aa65", "score": "0.0", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" } ]
[ { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "d56f92493593e892fc14c7a45faf9e51", "score": "0.7240845", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "1bf168cbadd2a9dd910959f3398e558b", "score": "0.7238394", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?');\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "451a60703e12e7d45cc8b1b425b505c6", "score": "0.7230461", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined$1(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "12e7de0dd8e0c4aff05fb2a9ae2cda85", "score": "0.721812", "text": "function getSetGlobalLocale (key, values) {\r\n var data;\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key);\r\n }\r\n else {\r\n data = defineLocale(key, values);\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data;\r\n }\r\n else {\r\n if ((typeof console !== 'undefined') && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr;\r\n }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "fe475f8018713e87edec3e2c7662e345", "score": "0.7209526", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fe475f8018713e87edec3e2c7662e345", "score": "0.7209526", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fe475f8018713e87edec3e2c7662e345", "score": "0.7209526", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" } ]
973c5a52dc6601b6afe6c08638c95484
Check input string is correct hex string or not
[ { "docid": "b37b39f55ec09f507a90744328e691eb", "score": "0.76435316", "text": "function isCorrectHexStr(str) {\n if (/^(\\-|\\+)?([0-9A-Fa-f]+|Infinity)$/.test(str)) {\n return true;\n }\n return false;\n}", "title": "" } ]
[ { "docid": "79cb603410a266efb9ec0941dfaa8a08", "score": "0.7998675", "text": "function isHex(string)\r\n{\r\n for (i=0; i<string.length; i++)\r\n {\r\n if (isNaN(parseInt(string.charAt(i), 16)))\r\n {return false;}\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "b713d56fb47b174213b1ea5941c70380", "score": "0.7896532", "text": "static isHex(input) {\n const hexRegEx = /([0-9]|[a-f])/gim;\n return (input.match(hexRegEx) || []).length === input.length;\n }", "title": "" }, { "docid": "3da9b278066adaa556e92b60d21eaeac", "score": "0.78946507", "text": "function isHex(str) {\n // optional # at beginning\n // matches a-f, A-F, 0-9 exactly 6 or 3 times\n let hexRegex = /^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/\n return hexRegex.test(str)\n}", "title": "" }, { "docid": "385a593bcdf3c10f25edf2e5db3178cb", "score": "0.7807681", "text": "function isValidHexCode(str) {\n\treturn /^#[a-f0-9]{6}$/i.test(str);\n}", "title": "" }, { "docid": "34eaaf5d953682cf95c62fabe52d84c5", "score": "0.7678878", "text": "function checkHex(value){\n\treturn /^#([A-Fa-f0-9]{3}$)|([A-Fa-f0-9]{6}$)/.test(value)\n}", "title": "" }, { "docid": "c936258551b40c85ed7b5f1c0ef36b4e", "score": "0.76138055", "text": "function isHexadecimal(string){\n if(typeof string === 'string' && (string.length >= 3 && string.length <=6) && !isNaN(Number(\"0x\" + string))){ /// 0x = Hexadecimal 0b = Binary 0o = Octal\n return \"string is a valid hexadecimal color\";\n } else {\n return \"string isn't a valid hexadecimal color\";\n }\n}", "title": "" }, { "docid": "30a415b6ea5d8af2efdbc411e39a8ec2", "score": "0.75355315", "text": "function isHex(val) {\n const hexRegExp = /^-?[0-9a-fA-F]+$/;\n\n if (hexRegExp.test(val)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "70eb2ed1b983d217f7b293a600e51b4d", "score": "0.7528124", "text": "function isHex(value) {\n if (value.length == 0) return false;\n if (value.startsWith('0x') || value.startsWith('0X')) {\n value = value.substring(2);\n }\n let reg_exp = /^[0-9a-fA-F]+$/;\n if (reg_exp.test(value) && value.length % 2 == 0) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "4c14fbadb7b1c6ace3eb0abb317a3801", "score": "0.752214", "text": "function isHex(value) {\n return /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(value);\n}", "title": "" }, { "docid": "cb438a9e87de0c5fcbec9bb85eb3d6fd", "score": "0.746379", "text": "function isHexString(str) {\n /* istanbul ignore next */\n if (typeof str !== \"string\") {\n throw new Error(\"Expected parameter str to be type string, was type \".concat(typeof str));\n }\n\n return /^[0-9A-Fa-f]*$/g.test(str);\n}", "title": "" }, { "docid": "495865c4da93fb88ba21e9f7570d7655", "score": "0.74421644", "text": "function isHexPrefixed(str){return str.slice(0,2)==='0x';}", "title": "" }, { "docid": "88226a7a6a56df26a24f00e2cfd732b9", "score": "0.74335", "text": "function isValidHex(hex) {\n return /^(0x)?([0-9a-f]{2})+$/i.test(hex);\n}", "title": "" }, { "docid": "ad9d05af9e77f665f58f81969db65f11", "score": "0.74253786", "text": "function isValidHex(hex) {\r\n const isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\r\n return isOk;\r\n}", "title": "" }, { "docid": "1a1dcdca58d8a3dc7ddcc8551cb9bf0a", "score": "0.73451346", "text": "function isHexadecimalColor(string) {\n if (string.charAt(0) === '#' && string.length === 7) {\n return 'It is valid color';\n } else {\n return 'It is not valid color';\n }\n}", "title": "" }, { "docid": "1c4036dc372447be63f5424ada3dd76e", "score": "0.7334065", "text": "function validHex(t) {\n\tfor (var i = 0; i < t.length; i++) {\n\t\tvar c = t.charAt(i);\n\t\tif (!((c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'))) return false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "91a282b33b63107d604cf952a8d72a55", "score": "0.7193588", "text": "function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))\n return false;\n if (length && value.length !== 2 + 2 * length)\n return false;\n return true;\n}", "title": "" }, { "docid": "4fd55880e25cf588575abfa6d05e4b68", "score": "0.7140354", "text": "function isHexadecimal(str) {\n if (isString(str))\n return hexadecimal.test(str);\n\n return false;\n}", "title": "" }, { "docid": "bc48fa2306ca182514f1127825c2e599", "score": "0.7126041", "text": "function checkHex(hex) {\n const prefixed = hex.includes('#');\n const prefix = !prefixed ? '#' : '';\n if (!/[\\dA-Fa-f]{3}|[\\dA-Fa-f]{6}/.test(prefix + hex)) {\n return null;\n } else if (hex.length + !prefixed == 7) {\n return prefix + hex;\n } else if (hex.length + !prefixed == 4) {\n return prefix + hex;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.7106599", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "ca1181be0fe02bcdf8754df274edcbfa", "score": "0.70054436", "text": "function isHexDigit(c){\r\n return /^[0-9A-Fa-f]$/.test(c);\r\n}", "title": "" }, { "docid": "5a1daeebfad1f4a695f40720fcd3aafe", "score": "0.69950175", "text": "function charInHex(){\r\n \r\n let validChar = true; \r\n let charArr = [...awaitedArr];\r\n \r\n charArr.forEach(char => {\r\n //not in range\r\n if(!char.match(/[a-fA-F]/)){\r\n if(!isNaN(char)){\r\n validChar = true;\r\n }else\r\n validChar = false;\r\n }\r\n \r\n })\r\n \r\n return validChar;\r\n \r\n }", "title": "" }, { "docid": "4b9bef78b0bd261425a48b85d4532f78", "score": "0.6979085", "text": "function isValid_64_Hex_string(value) {\n\tif (typeof value === 'string') {\n\t\treturn /^[0-9a-f]{64}$/.test(value);\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "cbe3f17be6a561e396e259478eebb7a2", "score": "0.6948093", "text": "function resemblesData (string) {\n const fixed = ethUtil.addHexPrefix(string)\n const isValidAddress = ethUtil.isValidAddress(fixed)\n return !isValidAddress && isValidHex(string)\n}", "title": "" }, { "docid": "b2acd2e2b19b6027678af585ed366d06", "score": "0.6903769", "text": "function isHexaColor(str) {\n if (!isString(str))\n return false;\n else\n return hexaColor.test(str);\n}", "title": "" }, { "docid": "62d70a74d7ee97a2c45b4afda83663d8", "score": "0.68850684", "text": "function resemblesData(string) {\n var fixed = ethUtil.addHexPrefix(string);\n var isValidAddress = ethUtil.isValidAddress(fixed);\n return !isValidAddress && isValidHex(string);\n}", "title": "" }, { "docid": "0d38d8dd7256fd30ac55ba8fc4a96596", "score": "0.68125886", "text": "function isColorStringHexRGB(raw) {\n return hexRGBRegex.test(raw);\n}", "title": "" }, { "docid": "e336a05fd4920923c48269c55c3ab154", "score": "0.67807174", "text": "function isHexChar(c) {\n if ((c >= 'A' && c <= 'F') ||\n (c >= 'a' && c <= 'f') ||\n (c >= '0' && c <= '9')) {\n return 1;\n }\n return 0;\n}", "title": "" }, { "docid": "0900140605c99e09835f598b1af7c360", "score": "0.6736063", "text": "function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(\"[isHexPrefixed] input must be type 'string', received type \" + typeof str);\n }\n return str[0] === '0' && str[1] === 'x';\n}", "title": "" }, { "docid": "65b74c1540cf36c378dae4280b00a403", "score": "0.6716053", "text": "function isHexChar(c) {\n if ((c >= 'A' && c <= 'F') ||\n (c >= 'a' && c <= 'f') ||\n (c >= '0' && c <= '9')) {\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "38fcc788781d06e7ab75908dbd546e46", "score": "0.67160183", "text": "function isHexChar(c) {\r\n if ((c >= 'A' && c <= 'F') ||\r\n (c >= 'a' && c <= 'f') ||\r\n (c >= '0' && c <= '9')) {\r\n return 1;\r\n }\r\n return 0;\r\n}", "title": "" }, { "docid": "ce6f048a9ffa0c052dcd38eb7b8ca188", "score": "0.66858816", "text": "function isValidColor(text) {\n return hexColorRegEx.test(text);\n}", "title": "" }, { "docid": "dd8740663142215f4f747c80ebf05f94", "score": "0.6638231", "text": "function isValidColor(str) {\r\n return str.match(/^#[a-f0-9]{6}$/i) !== null;\r\n}", "title": "" }, { "docid": "c937f9c96647cefdf58dcb3167f0e672", "score": "0.66184515", "text": "function isHexColor(c) {\n\t\treturn /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(c)\n\t}", "title": "" }, { "docid": "eca105c76aa7edecd5b8f0e7ed1041f2", "score": "0.66173226", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "eca105c76aa7edecd5b8f0e7ed1041f2", "score": "0.66173226", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "2add3838e396d609e2d0d1465ab5150d", "score": "0.6613861", "text": "function isHexColor(hex) {\n return /^#([0-9A-F]{3}){1,2}$/i.test(hex);\n}", "title": "" }, { "docid": "6f4cc082f9ed9f4db99d056d80a55486", "score": "0.6589293", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (character === 0x00085) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "e5ade75c2d832c8fb1c49305fed76483", "score": "0.65844774", "text": "function testAscii(string){\n var pat = /^[\\x00-\\x7F]+$/;\n return pat.test(string);\n}", "title": "" }, { "docid": "7ebb301315e12e6a9ce4f48f9dc71021", "score": "0.6571711", "text": "function isAddress(address) {\n return /^0x[a-f\\d]{40}$/i.test(address);\n}", "title": "" }, { "docid": "8ba7ba1281e5e4ae5b410086a9c6ddd5", "score": "0.64975774", "text": "validateData() {\n const isValid = /^0x[a-fA-F0-9]{40}$/.test(this.state.address);\n this.setState({ isValid, status: \"\" });\n return isValid;\n }", "title": "" }, { "docid": "28d26ea04517afd4f34c1c5ae6ac9732", "score": "0.64880383", "text": "function numInHex(){\r\n let validNum = true;\r\n \r\n charArr.forEach(char => {\r\n if(char > 9 || char < 0){\r\n //not in range\r\n validNum = false;\r\n }\r\n });\r\n return validNum;\r\n }", "title": "" }, { "docid": "178c71d29e3799dd5385bad36643d03e", "score": "0.6459307", "text": "function isColorStringHexRGBA(raw) {\n return isColorStringHexARGB(raw); // No way to differentiate these two formats, so just use the same test\n}", "title": "" }, { "docid": "29a8a00874367abb7f46d610be389012", "score": "0.64467156", "text": "function base32hex_sniff(base32) {\n if (base32.indexOf(\"0\") >= 0) return true\n if (base32.indexOf(\"1\") >= 0) return true\n if (base32.indexOf(\"8\") >= 0) return true\n if (base32.indexOf(\"9\") >= 0) return true\n return false\n}", "title": "" }, { "docid": "8842269c25b7b23c82684aed9c712c4c", "score": "0.644492", "text": "function isColorStringHexARGB(raw) {\n return hexRGBARegex.test(raw);\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.62811965", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "fae410bb095e9b952f7f17248416f301", "score": "0.62776446", "text": "isHexadecimal() {\n return this.addValidation({\n type: \"validation\",\n validation: \"isHexadecimal\",\n });\n }", "title": "" }, { "docid": "034f57e06d2f8e090fa1e1cf4b7703ab", "score": "0.62760377", "text": "function validate_hash(id, size)\n{\n\t// String.prototype.isHex = function() {\n\t// \treturn /^[0-9a-fA-F]+$/.test(this);\n\t// }\n\n\t// get digest\n\tdigest = document.getElementById(id).value.trim();\n\n\t// check if digest is in format 0x...\n\tif (digest.length == (2+size) && digest.startsWith(\"0x\") && digest.slice(2).isHex())\n\t{\n\t\tdocument.getElementById(id).value = digest.toLowerCase();\n\t\treturn digest.slice(2);\n\t}\n\n\t// check if digest is still valid but without 0x\n\telse if (digest.length == size && digest.isHex())\n\t{\n\t\tdocument.getElementById(id).value = \"0x\" + digest.toLowerCase();\n\t\treturn digest;\n\t}\n\n\t// error\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "2803d58615eb598e8787cecb4426c51a", "score": "0.6264519", "text": "function omniHex(s){ var h = '';for(var i=0;i<s.length;i++) {h +=s.charCodeAt(i).toString(16);}return h;}", "title": "" }, { "docid": "813e435d95ecea99c58c43048e4ab421", "score": "0.6254481", "text": "function check (buffer) {\n\t if (buffer.length < 8) return false\n\t if (buffer.length > 72) return false\n\t if (buffer[0] !== 0x30) return false\n\t if (buffer[1] !== buffer.length - 2) return false\n\t if (buffer[2] !== 0x02) return false\n\n\t var lenR = buffer[3]\n\t if (lenR === 0) return false\n\t if (5 + lenR >= buffer.length) return false\n\t if (buffer[4 + lenR] !== 0x02) return false\n\n\t var lenS = buffer[5 + lenR]\n\t if (lenS === 0) return false\n\t if ((6 + lenR + lenS) !== buffer.length) return false\n\n\t if (buffer[4] & 0x80) return false\n\t if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n\t if (buffer[lenR + 6] & 0x80) return false\n\t if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n\t return true\n\t}", "title": "" }, { "docid": "577a2c1f06d9b73a50400210872ed5d2", "score": "0.6195926", "text": "function checkIfHexOrRGB(color) {\n if (\n isValidRGB(color.split(\",\")[0], color.split(\",\")[1], color.split(\",\")[2])\n ) {\n return reformatRGB(color);\n } else if (color.length === 3 || color.length === 6) {\n return hexColorToRGB(color);\n }\n }", "title": "" }, { "docid": "778be171bd77544bf3cbb69f137e6c56", "score": "0.6183531", "text": "function checkValidCustomId(id) {\n return id.match(/^[\\x00-\\xFF]*$/);\n }", "title": "" }, { "docid": "2002c935574081e7a89672f2db16b40f", "score": "0.61539763", "text": "isHexColor() {\n return this.addValidation({\n type: \"validation\",\n validation: \"isHexColor\",\n });\n }", "title": "" }, { "docid": "cfec3e12ab89c3aeef42110c69716aed", "score": "0.6142832", "text": "function validateEtherAddress(address: string): boolean {\n if (address.substring(0, 2) != '0x') return false;\n else if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) return false;\n else if (\n /^(0x)?[0-9a-f]{40}$/.test(address) ||\n /^(0x)?[0-9A-F]{40}$/.test(address)\n )\n return true;\n else return isChecksumAddress(address);\n}", "title": "" }, { "docid": "c43fe2c51eefe685a359c05265d88e3e", "score": "0.612578", "text": "function validNmeaChecksum(nmeaSentence) {\n var _a = nmeaSentence.split(\"*\"), sentenceWithoutChecksum = _a[0], checksumString = _a[1];\n var correctChecksum = computeNmeaChecksum(sentenceWithoutChecksum);\n // checksum is a 2 digit hex value\n var actualChecksum = parseInt(checksumString, 16);\n return correctChecksum === actualChecksum;\n}", "title": "" }, { "docid": "c2325727eee7335e7efba9b0d6686264", "score": "0.61179703", "text": "function isIdValid(id) {\n return id.match(/^[0-9a-fA-F]{24}$/);\n}", "title": "" }, { "docid": "1ac987b55685d0ea042ecf064bc88cc7", "score": "0.60677516", "text": "function isMD5Encrypted(inputString) {\r\n return /[a-fA-F0-9]{32}/.test(inputString);\r\n }", "title": "" }, { "docid": "51550479c4cd2523233a6694a430fcf7", "score": "0.60516423", "text": "function ensure0x(hex = '') {\n const hexString = hex.toString();\n if (typeof hexString === 'string' && hexString.indexOf('0x') !== 0) {\n return `0x${hexString}`;\n }\n return hexString;\n}", "title": "" }, { "docid": "85de7637cf121d20d42da36e3010728e", "score": "0.6050721", "text": "function stripHexPrefix(str){if(typeof str!=='string'){return str;}return isHexPrefixed(str)?str.slice(2):str;}", "title": "" }, { "docid": "f48e8dcd8ecf21a4b924ca39d5990339", "score": "0.60464764", "text": "function isMAC48Address(inputString) {\n return !!inputString.match(/^[0-9A-F]{2}(-[0-9A-F]{2}){5}$/g);\n}", "title": "" }, { "docid": "88ad0a781546de248515e41e7ebba605", "score": "0.60413045", "text": "function parseHex(string, expand) {\n string = string.replace(/^#/g, '');\n if (!string.match(/^[A-F0-9]{3,6}/ig)) return '';\n if (string.length !== 3 && string.length !== 6) return '';\n if (string.length === 3 && expand) {\n string = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];\n }\n return '#' + string;\n }", "title": "" }, { "docid": "6ddbfd25fc8caeadcb6f4fd7872a8709", "score": "0.6016074", "text": "function test(val, expect) {\n var res = Duktape.enc('hex', CBOR.encode(val));\n // print(res);\n if (res !== expect) {\n print('MISMATCH, got ' + res + ', expected ' + expect);\n }\n}", "title": "" }, { "docid": "833031ed2cb44c7d332c0f744fd88c8a", "score": "0.59785867", "text": "function parseHexUtf8(str, start, end) {\n\t var result = '';\n\t while (start < end) {\n\t result += String.fromCharCode(\n\t (hexToInt(str.charCodeAt(start++)) << 4) |\n\t hexToInt(str.charCodeAt(start++)));\n\t }\n\t return result;\n\t}", "title": "" }, { "docid": "b66bae9f55d8d054df0af522df833061", "score": "0.5969937", "text": "function isValidSHA256(sha256) {\n var re = /\\b^[A-Fa-f0-9]{64}$\\b/\n return re.test(sha256)\n}", "title": "" }, { "docid": "d6a980436dbac69c4a1c5c68980bea86", "score": "0.5957917", "text": "function isBase58(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] < 0 || str[i] > 58) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a03e520a9a2068c2a6a6929384b3483d", "score": "0.59541714", "text": "function hex_digit_ques_(c) /* (c : char) -> bool */ {\n return ((digit_ques_(c)) || ((((((c >= 0x0061)) && ((c <= 0x0066)))) || ((((c >= 0x0041)) && ((c <= 0x0046)))))));\n}", "title": "" }, { "docid": "c2cd7d5a3d33057b68ad299adff437ea", "score": "0.59499824", "text": "function isValid(input) {\n var checkDigitIndex = input.length - 1;\n return input.substr(checkDigitIndex) === create(input.substr(0, checkDigitIndex));\n }", "title": "" }, { "docid": "e6a043078707176ba92307f35a759c69", "score": "0.59475076", "text": "function parseHex(string, expand) {\n string = string.replace(/^#/g, '');\n if( !string.match(/^[A-F0-9]{3,6}/ig) ) return '';\n if( string.length !== 3 && string.length !== 6 ) return '';\n if( string.length === 3 && expand ) {\n string = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];\n }\n return '#' + string;\n }", "title": "" }, { "docid": "162d0f94235835c45099d36363ce704c", "score": "0.5939543", "text": "function validHash(hash) {\n for (var i = 0; i < difficulty; i++) {\n if (hash[i] !== '0') return false;\n }\n return true;\n}", "title": "" }, { "docid": "aec6a9c2d1ca8a05f8a01ea167d093d0", "score": "0.5938712", "text": "function isValidASCIIString(str){\n if(typeof(str)!=='string'){\n return false;\n }\n for(var i=0;i<str.length;i++){\n if(str.charCodeAt(i)>127){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "448f7ae9eb00ee6e73740e29c663777b", "score": "0.5937986", "text": "function parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}", "title": "" }, { "docid": "448f7ae9eb00ee6e73740e29c663777b", "score": "0.5937986", "text": "function parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}", "title": "" }, { "docid": "448f7ae9eb00ee6e73740e29c663777b", "score": "0.5937986", "text": "function parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}", "title": "" }, { "docid": "448f7ae9eb00ee6e73740e29c663777b", "score": "0.5937986", "text": "function parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}", "title": "" }, { "docid": "448f7ae9eb00ee6e73740e29c663777b", "score": "0.5937986", "text": "function parseHexUtf8(str, start, end) {\n var result = '';\n while (start < end) {\n result += String.fromCharCode(\n (hexToInt(str.charCodeAt(start++)) << 4) |\n hexToInt(str.charCodeAt(start++)));\n }\n return result;\n}", "title": "" }, { "docid": "90fd2757924503ed23aaee65c2e446f4", "score": "0.59357756", "text": "validateDmac() {\n let regex = /^[a-fA-F0-9]{4}\\.[a-fA-F0-9]{4}\\.[a-fA-F0-9]{4}$/;\n if (regex.test(this.state.dmac.replace(/^\\s+|\\s+$/g, \"\"))) return true;\n this.setState(\n {\n dmacError: true,\n },\n () => {\n return false;\n }\n );\n }", "title": "" }, { "docid": "a92434461fb5dca73067905f6b440948", "score": "0.59213555", "text": "function hexToAscii(hex) {\n console.log('input hex:', hex);\n var ascii = '';\n if (isCorrectHexStr(hex) == false) {\n return '';\n }\n for (var i = 0; i < hex.length; i += 2) {\n var subStr = hex.substr(i, 2).trim();\n if (subStr.length != 2) {\n return '';\n }\n var parsed = Number.parseInt(subStr, 16);\n if (Number.isNaN(parsed)) {\n return '';\n }\n ascii += String.fromCharCode(parsed);\n }\n console.log('return ascii:', ascii);\n return ascii;\n}", "title": "" }, { "docid": "8543f27e137d2dd4cbf53d3e1b986403", "score": "0.5915998", "text": "static test(color) {\n return typeof color === 'string' && (isHex.test(color) || isRgb.test(color));\n }", "title": "" }, { "docid": "da511f38542072dabea63141412e5ae1", "score": "0.5898424", "text": "function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }", "title": "" }, { "docid": "da511f38542072dabea63141412e5ae1", "score": "0.5898424", "text": "function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }", "title": "" }, { "docid": "da511f38542072dabea63141412e5ae1", "score": "0.5898424", "text": "function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }", "title": "" }, { "docid": "837e5a40702c58bba4e26eae98396ae9", "score": "0.5897372", "text": "function isIdInvalidFormat(id) {\n\tif (id.match(/^[0-9a-fA-F]{24}$/)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "ab336efa6209807f04166a3a233b1984", "score": "0.5891563", "text": "function _hex6(str) {\n if ('#' === str[0] && 7 === str.length && /^#[\\da-fA-F]{6}$/.test(str)) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: MAX_COLOR_ALPHA\n };\n }\n}", "title": "" }, { "docid": "5a5288fd4ec75d1bf0e0a0644677ee70", "score": "0.58910364", "text": "function isHexDigit(code) {\n return isDigit(code) || // 0 .. 9\n code >= 0x0041 && code <= 0x0046 || // A .. F\n code >= 0x0061 && code <= 0x0066 // a .. f\n ;\n} // uppercase letter", "title": "" }, { "docid": "5a5288fd4ec75d1bf0e0a0644677ee70", "score": "0.58910364", "text": "function isHexDigit(code) {\n return isDigit(code) || // 0 .. 9\n code >= 0x0041 && code <= 0x0046 || // A .. F\n code >= 0x0061 && code <= 0x0066 // a .. f\n ;\n} // uppercase letter", "title": "" }, { "docid": "742e0e1bbc4679445dc24a703619bff3", "score": "0.5890594", "text": "function parseHex(str) {\n var c = str.match(/\\w/g), n;\n\n if (c.length === 3) {\n c = [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n\n n = +(\"0x\" + c.join(\"\"));\n\n return {\n \"r\": (n & 0xFF0000) >> 16,\n \"g\": (n & 0x00FF00) >> 8,\n \"b\": (n & 0x0000FF),\n \"a\": 1\n };\n }", "title": "" }, { "docid": "b9e0efdee09cd4af28ee2c4513c60569", "score": "0.5889167", "text": "function i4things_parse_hex(str) {\r\n var result = [];\r\n while (str.length >= 2) {\r\n result.push(parseInt(str.substring(0, 2), 16));\r\n str = str.substring(2, str.length);\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "fa043128567066d6819bc3242c440d76", "score": "0.58854824", "text": "static test (color) {\r\n return (typeof color === 'string')\r\n && (isHex.test(color) || isRgb.test(color))\r\n }", "title": "" }, { "docid": "ecc6b4964993d2ac2d9c7e30bc303d38", "score": "0.5883596", "text": "function isAddress(string) {\n try {\n bitcoin.Address.fromBase58Check(string)\n } catch (e) {\n return false\n }\n\n return true\n}", "title": "" }, { "docid": "9a21588c6aa239946e0b4b5a2cf57cca", "score": "0.5871967", "text": "function hexStrToUtf8Str(hex) {\n var str = stringTransform_1.safeBufferFromTo(hex, \"hex\", \"utf8\");\n if (stringTransform_1.safeBufferFromTo(str, \"utf8\", \"hex\") !== hex) {\n throw new Error(\"Invalid UTF8 data\");\n }\n return str;\n }", "title": "" }, { "docid": "48db363409793728ac8a20c435879b0f", "score": "0.58699393", "text": "function verifyAddress(){\n // TODO bitcore address checking\n return (txInfo.receivingAddress.length !== 34 ? false : true)\n }", "title": "" } ]
e492b81f7537eb7e59cac4bb8667863e
Populate filters and axes selector
[ { "docid": "b3f531962fcd1c45ef093da52224fa11", "score": "0.0", "text": "function popControl() {\n\tvar prevBu = rawDataObject.prevBu,\n\t\txName = rawDataObject.xList[0],\n\t\tyName = rawDataObject.yList[0],\n\t\tbuName = rawDataObject.buName,\n\t\tdata = rawDataObject.dataObject.slice(),\n\t\tnewBu = $(\"#choose_bu\").val(),\n\t\tshowEffect = \"drop\";\n\t\t\n\tsaveSession(prevBu);\n d3.select(\"#grid_svg\").remove();\n\td3.select(\"#div_click_tooltip\").remove();\n\t$(\"#input_xmin\").val(\"\");\n\t$(\"#input_xmax\").val(\"\");\n\t$(\"#input_ymin\").val(\"\");\n\t$(\"#input_ymax\").val(\"\");\n\t\n\t\n\tif (newBu != \"default Business Unit\") {\n\t\tfor (var i = data.length - 1; i >= 0; i--) {\n\t\t\tif (data[i][buName] != $(\"#choose_bu\").val()) {\n\t\t\t\tdata.splice(i, 1);\n\t\t\t}\n\t\t}\n\t\trawDataObject.buData = data;\n\t} else {\n\t\trawDataObject.buData = data;\n\t}\n\t\n\tdefineX(Object.keys(data[0]));\n\tdefineY(Object.keys(data[0]));\n\tdefineTooltip(Object.keys(data[0]));\n\tcreateCheckBox(data);\n $(\"#choose_x\").val(xName);\n\t$(\"#choose_y\").val(yName);\n\t$(\"#control_tabs\").tabs();\n\t$(\"#visualization_tabs\").tabs({ selected: 1 });\n\t$(\"#control_tabs\").show(showEffect);\n\t$(\"#visualization_tabs\").show(showEffect);\n\t\n\t$(\"#choose_x\").selectmenu({\n\t\twidth: $(this).width()\n\t});\n\t$(\"#choose_y\").selectmenu({\n\t\twidth: $(this).width()\n\t});\n\t\n\t$(\"#input_xmin\").attr(\"placeholder\", \"enter minimum x\");\n\t$(\"#input_xmax\").attr(\"placeholder\", \"enter maximum x\");\n\t$(\"#input_ymin\").attr(\"placeholder\", \"enter minimum y\");\n\t$(\"#input_ymax\").attr(\"placeholder\", \"enter maximum y\");\n\t\n\t$(\"#input_xmin\").mask(\"#,##0\", {reverse:true, maxlength:false});\n\t$(\"#input_xmax\").mask(\"#,##0\", {reverse:true, maxlength:false});\n\t$(\"#input_ymin\").mask(\"#0.00\", {reverse:true, maxlength:false});\n\t$(\"#input_ymax\").mask(\"#0.00\", {reverse:true, maxlength:false});\n\n\tif (typeof(localStorage[newBu]) != \"undefined\") {\n\t\tretrieveSession(newBu);\n\t\tupdateAllSvg();\n\t}\n\t\n\tfor (var i = 0; i < 1; i++) {\n\t\tfor (var key in data[i]) {\n\t\t\tif (key.toLowerCase().substring(0, 6) == \"filter\") {\n\t\t\t\t$(\".checkbox[name='\" + key + \"'][value='\" + data[i][key] + \"']\").prop(\"checked\", true).button(\"refresh\");\n\t\t\t}\n\t\t\tupdateSelectAll(key);\n\t\t}\n\t}\n\tupdateAllSvg();\n}", "title": "" } ]
[ { "docid": "2d4a3b5f21b6e07a5ba2c6cd502a2b00", "score": "0.7063487", "text": "setupSelectFilters() {\n const selectFilters = document.querySelectorAll(`cagov-chart-filter-select.js-filter-${this.chartConfigKey} select`);\n\n selectFilters.forEach((selectFilter) => {\n selectFilter.addEventListener(\n 'change',\n this.chartFilterSelectsHandler.bind(this, selectFilters),\n false,\n );\n });\n }", "title": "" }, { "docid": "7036411a66ee641938beda5b7f7a8b35", "score": "0.66505414", "text": "function initFilters() {\r\n $('#grid_filter').append($('#filters').html());\r\n var dateFilterControl = $('#grid_filter #dateFilter').DateFilter(dateFilter, {\r\n startDate: new Date(2006, 0, 1)\r\n });\r\n dateFilterControl.onChanged = function () {\r\n columnFilters.clear();\r\n dataTable.draw();\r\n }\r\n $('#grid-container [type=search]').on('change', function () {\r\n columnFilters.clear();\r\n });\r\n $('#grid-container #companyName').on('change', function () {\r\n companyName = $(this).val();\r\n dataTable.draw();\r\n });\r\n }", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.65511155", "text": "function setFilters(){}", "title": "" }, { "docid": "b581e31ffc3f67ff1e1e8b4917d5baed", "score": "0.6543925", "text": "function filtersSetup (){\n\n var datesList = []; \n var citiesList = []; \n var statesList = [];\n var countryList = [];\n var shapesList = [];\n\n var dateSelectInputs = d3.select(\"#dateSelect\");\n var citySelectInputs = d3.select(\"#citySelect\");\n var stateSelectInputs = d3.select(\"#stateSelect\");\n var countrySelectInputs = d3.select(\"#countrySelect\");\n var shapeSelectInputs = d3.select(\"#shapeSelect\");\n\n data.forEach(object => {\n datesList.push(object.datetime);\n citiesList.push(object.city);\n statesList.push(object.state);\n countryList.push(object.country);\n shapesList.push(object.shape);\n\n });\n\n // We only need unique options for the filters\n var uniqueDatesList = datesList.filter(onlyUnique);\n uniqueDatesList.sort();\n var uniqueCitiesList = citiesList.filter(onlyUnique);\n uniqueCitiesList.sort();\n var uniqueStatesList = statesList.filter(onlyUnique);\n uniqueStatesList.sort();\n var uniqueCountryList = countryList.filter(onlyUnique);\n uniqueCountryList.sort();\n var uniqueShapesList = shapesList.filter(onlyUnique);\n uniqueShapesList.sort();\n\n //Fill in options for filters\n uniqueDatesList.forEach(item => dateSelectInputs.append(\"option\").text(item));\n uniqueCitiesList.forEach(item => citySelectInputs.append(\"option\").text(item));\n uniqueStatesList.forEach(item => stateSelectInputs.append(\"option\").text(item));\n uniqueCountryList.forEach(item => countrySelectInputs.append(\"option\").text(item));\n uniqueShapesList.forEach(item => shapeSelectInputs.append(\"option\").text(item));\n\n}", "title": "" }, { "docid": "e285facb89582215c4be360a55f55a80", "score": "0.6494476", "text": "function initializeEventListeners() {\n\n var toggle = document.getElementById('dynamic-filtering');\n var applyButton = document.getElementById('apply-filter');\n toggle.addEventListener('change', function() {\n // console.log(toggle.checked);\n useDynamicFiltering = toggle.checked;\n if (toggle.checked) {\n applyButton.style.display = 'none';\n updateVisibleData();\n } else {\n applyButton.style.display = 'block';\n }\n });\n\n // Radius A filter\n var radiusA = document.getElementById('radius-a');\n var radiusACircle = document.getElementById('radius-a-circle')\n radiusA.addEventListener('input', function() {\n // console.log('radius a new value is ' + this.value);\n filters.radiusA = radiusA.value;\n radiusACircle.setAttribute('r', radiusA.value * pxPerMile);\n if (useDynamicFiltering) updateVisibleData();\n });\n\n // Radius B filter\n var radiusB = document.getElementById('radius-b');\n var radiusBCircle = document.getElementById('radius-b-circle')\n radiusB.addEventListener('input', function() {\n // console.log('radius b new value is ' + this.value);\n filters.radiusB = radiusB.value;\n radiusBCircle.setAttribute('r', radiusB.value * pxPerMile);\n if (useDynamicFiltering) updateVisibleData();\n });\n\n // Multi select settings for category filter\n $('#select-category').multiSelect({\n selectionHeader: 'Viewing',\n selectableHeader: 'All',\n afterSelect: function(value){\n value.forEach(function(item) {\n filters.categories.push(item);\n });\n // console.log(filters.categories);\n if (useDynamicFiltering) updateVisibleData();\n },\n afterDeselect: function(value){\n filters.categories.splice(filters.categories.indexOf(value[0]), 1);\n // console.log(filters.categories);\n if (useDynamicFiltering) updateVisibleData();\n }\n });\n\n $('#select-category-all').click(function() {\n $('#select-category').multiSelect('select_all');\n });\n\n $('#select-category-none').click(function() {\n filters.categories = [];\n $('#select-category').multiSelect('deselect_all');\n });\n\n $('#select-category').multiSelect('select_all');\n\n // Multi select settings for resolution filter\n $('#select-resolution').multiSelect({\n selectionHeader: 'Viewing',\n selectableHeader: 'All',\n afterSelect: function(value){\n value.forEach(function(item) {\n filters.resolutions.push(item);\n });\n // console.log(filters.resolutions);\n if (useDynamicFiltering) updateVisibleData();\n },\n afterDeselect: function(value){\n filters.resolutions.splice(filters.resolutions.indexOf(value[0]), 1);\n // console.log(filters.resolutions);\n if (useDynamicFiltering) updateVisibleData();\n }\n });\n\n $('#select-resolution-all').click(function() {\n $('#select-resolution').multiSelect('select_all');\n });\n\n $('#select-resolution-none').click(function() {\n filters.resolutions = [];\n $('#select-resolution').multiSelect('deselect_all');\n });\n\n $('#select-resolution').multiSelect('select_all');\n // filters.resolutions = filters.resolutions.slice(1);\n\n // Time filter\n var timeFrom = document.getElementById('time-from');\n timeFrom.addEventListener('input', function() {\n filters.timeFrom = timeFrom.value;\n });\n\n var timeTo = document.getElementById('time-to');\n timeTo.addEventListener('input', function() {\n filters.timeTo = timeTo.value;\n })\n\n var submitButton = document.getElementById('submit-time');\n submitButton.addEventListener('click', updateVisibleData);\n\n var applyFilterButton = document.getElementById('apply-filter');\n applyFilterButton.addEventListener('click', updateVisibleData);\n }", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6494061", "text": "function setFilters() {}", "title": "" } ]
5167b82683b9b21bb29a6d4844f00933
adds the del fn to a del button
[ { "docid": "0f5c1f0f6f38a362d5425fd38631c94a", "score": "0.7853695", "text": "function adddelBtnFn(delBtn) {\n\tdelBtn.addEventListener(\"click\", function() {\n\t\tvar listItem = delBtn.parentElement;\n\t\tdeleteListItem(listItem);\n\t})\n}", "title": "" } ]
[ { "docid": "579dbd3cd06fc1a28058defae6725f2f", "score": "0.76384723", "text": "function delbutn(id) {\n\t\treturn $(\"<button id='del_\" + id\n\t\t\t\t\t\t+ \"' title='Delete this archiving task.'>Del</button>\")\n\t\t\t.button({\n\t\t\t\ticons : {\n\t\t\t\t\tprimary : \"ui-icon-trash\"\n\t\t\t\t},\n\t\t\t\ttext : false\n\t\t\t});\n\t}", "title": "" }, { "docid": "480bcade0b3de0ab2c9f864e65146e7e", "score": "0.7598834", "text": "function addDeleteFunction(btn) {\n btn.click(function(){\n\n var thumb = btn.next().find('img').attr('src');\n \t\tvar url = btn.next().find('a').attr('href');\n \t\t \n \t\t// pass to delete helper\n \t\t$.post('mark.php', {a: 'del', f: url, t: thumb});\n \t\t\t\t\t\t\t\n \t\t// remove image from view & rearrange layout\n \t\tmarked.isotope('remove', btn.parent()).isotope('layout');\t\n \t}) \n }", "title": "" }, { "docid": "196ca85c56c783effde5ec3cc329c3e3", "score": "0.74842435", "text": "function createDeleteButton(){\n\n}", "title": "" }, { "docid": "b6939712bc94d3971a77d21b837abed4", "score": "0.7470893", "text": "function delBtn() {\r\n document.getElementById('delBtn').deleteRow();\r\n }", "title": "" }, { "docid": "8f0435c7ff618d439866e3d513545359", "score": "0.71765023", "text": "function delButtonCallback(i){\n return function(){\n del(i);\n listings.splice(i,1);\n }\n }", "title": "" }, { "docid": "dfa220e6ce7f3a90802dffc48bd28fae", "score": "0.7144992", "text": "delegateDeleteButton(){\n\t\tlet instance = this;\n\t\t\n\t\tinstance.labelDisplay = instance.removeLastDigit;\n\t\tinstance.warning = false;\n\t\tinstance.emitListener(instance.labelDisplay);\n\t}", "title": "" }, { "docid": "0b5fe273c4efee229665e0f3a48e27d8", "score": "0.71259147", "text": "function addDeleteButton(listItem) {\n\tvar delBtn = document.createElement(\"button\");\n\tlistItem.appendChild(delBtn);\n\tdelBtn.appendChild(document.createTextNode(\"Delete\"));\n\tdelBtn.classList.add(\"delBtn\");\n\tadddelBtnFn(delBtn);\n}", "title": "" }, { "docid": "21be3b763a38886775fd962f1cdf4d67", "score": "0.70607036", "text": "function add_delete()\n{\n\tvar field_id = 'fc_' + field_cnt++;\n\tvar temp = 'tm_' + field_cnt++;\n\tvar dd_id = 'dd_' + dd_cnt++;\n\tvar dd_id2 = 'dd_' + dd_cnt++;\n\n\tvar element = '<fieldset class=\"modx-level2 fields2\" id=\"dd-delete\">';\n\t\telement += '<dl id=\"dl-delete\">';\n\t\t\telement += '<dt class=\"copy-rows\">';\n\t\t\t\telement += '<label>Delete:</label>';\n\t\t\t\telement += '<img class=\"action-image\" src=\"./images/plus.png\" alt=\"Add file\" title=\"Add file\" onclick=\"add_file_delete();\" /><img class=\"action-image\" src=\"./images/delete.png\" alt=\"Delete\" onclick=\"$(\\'#dd-delete\\').remove(); document.getElementById(\\'addDeleteField\\').style.display=\\'\\';\" />';\n\t\t\telement += '</dt>';\n\n\t\t\telement += '<dd class=\"copy-rows\" id=\"' + dd_id2 + '\">';\n\t\t\t\telement += '<input class=\"inputbox copy-to\" name=\"delete[' + temp + ']\" size=\"85\" maxlength=\"255\" value=\"\" type=\"text\" />';\n\t\t\t\telement += '<img class=\"action-image\" src=\"./images/delete.png\" alt=\"Delete\" onclick=\"$(\\'#' + dd_id2 + '\\').remove()\" />';\n\t\t\telement += '</dd>';\n\t\telement += '</dl>';\n\telement += '</fieldset>';\n\n\t$('#delete-field').append(element);\n}", "title": "" }, { "docid": "36740a99a614ec1e8ef7f190894e9645", "score": "0.7022957", "text": "function insertBtnDelete() {\n let btn = createBtn();\n insertPropertyInElement({\n element: btn,\n textHTML: 'delete',\n classe: 'btn-delete',\n identify: 'btn-delete',\n });\n btn.addEventListener('click', function (event) {\n deleteTodo(event);\n });\n return btn;\n}", "title": "" }, { "docid": "57a69f8f91d0a3cfe013e70b85bc4aaa", "score": "0.69704324", "text": "function deleteBtnListener(i) {\n i.addEventListener(\"click\", deleting);\n}", "title": "" }, { "docid": "625d9293112cdd7bd91876d22aadd5df", "score": "0.6946742", "text": "function delButton(place, btnVal) {\n var btn = document.createElement(\"BUTTON\"); // Create a <button> element\n\n btn.setAttribute(\"id\", \"btnRemove\");\n btn.setAttribute(\"value\", btnVal);\n btn.setAttribute(\"onclick\", \"delListItem(this)\");\n btn.className = \"badge badge-pill badge-danger\";\n btn.innerHTML = \"<h6><small>Delete</small></h6>\";\n //var t = document.createTextNode('<img src =\"images/icon.png\">'); // Create a text node\n //btn.appendChild(t); // Append the text to <button>\n place.appendChild(btn); // Append <button> to <body>\n}", "title": "" }, { "docid": "555f292644e70c2ff9211ebcb825d3ff", "score": "0.6938397", "text": "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "title": "" }, { "docid": "2ea5280ff10858c9449a95409fbcf019", "score": "0.68610287", "text": "function handleDeleteButton() {\n list.removeChild(this.parentNode);\n}", "title": "" }, { "docid": "4977944d4fd8eda510829a70c327521c", "score": "0.6808981", "text": "function deleteButtonPressed(note) {\n removeFromDb(note);\n}", "title": "" }, { "docid": "bbf9127788458489a2ac3f7939226365", "score": "0.6793434", "text": "function deleteButton(li) {\n\tvar btn = document.createElement(\"button\");\n\tbtn.appendChild(document.createTextNode(\"Delete\"));\n\tli.appendChild(btn);\n\tbtn.onclick = removeParent;\n}", "title": "" }, { "docid": "7ac2a7435930ab097a25d79004869512", "score": "0.6786842", "text": "function removeActionButton() {\n\n }", "title": "" }, { "docid": "0cf393c56631fb48d91ac63ff866ebb6", "score": "0.67782295", "text": "function createDeleteButton() {\r\n let liList = document.querySelectorAll('li');\r\n for (let i = 0; i < liList.length; i++) {\r\n let del = document.createElement('span');\r\n let label = document.createTextNode('x');\r\n del.className = 'done';\r\n del.appendChild(label);\r\n liList[i].appendChild(del);\r\n }\r\n let delBtn = document.querySelectorAll('.done');\r\n for (let i = 0; i < delBtn.length; i++) {\r\n delBtn[i].onclick = function () {\r\n let temp = this.parentElement;\r\n temp.style.display = 'none';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "aaddab9389df21fa93c9c79788d04f81", "score": "0.6763164", "text": "'click .delete'() {\n Mechanics.remove(this._id);\n swal('Eliminado','Mecanico Eliminado Del Registro','success');\n console.log(\"PI-5: Eliminar Mecánicos\");\n console.log(\"PI-5.1: Mecánico eliminado\");\n }", "title": "" }, { "docid": "008f04fa4c659279566fee27d5a52184", "score": "0.6716455", "text": "function deleteButtonPressed(todo) {\n myPouchDb.remove(todo, (err, data) => {\n err ? console.error(err) : console.log(data)\n })\n }", "title": "" }, { "docid": "2519d1203bf9acd3d57f5af0c3f1a1fd", "score": "0.67098784", "text": "'click #delete'() {\n console.log(`delete ${this._id}`);\n Services.remove({_id: this._id});\n }", "title": "" }, { "docid": "ea4cff52c36f43140d44d5de357e8e61", "score": "0.66761905", "text": "function deleteButton() {\n let dB = document.createElement(\"button\");\n dB.className = \"deleteBtn\";\n dB.textContent = \"Delete Card\";\n dB.addEventListener(\"click\", deletebutton);\n return dB;\n }", "title": "" }, { "docid": "6836a8ca0df2c99b006f2a3833411179", "score": "0.66683143", "text": "function BtnDelete() {\n transacionAjax_D_elete(\"D_elete\");\n}", "title": "" }, { "docid": "b4a04055b1b0ca75077a3f465e7d512b", "score": "0.66614246", "text": "function deleteButtons() {\n var btnNum = $(this).attr(\"data-num\")\n\n // Delete the button clicked\n gifs.splice(btnNum, 1);\n\n // Create the buttons again\n renderButtons();\n }", "title": "" }, { "docid": "0eedf1482812d0f89455b40b84075dc5", "score": "0.6661163", "text": "function clickDelete() {\n\tviewAddToDo.style.display = \"none\";\n}", "title": "" }, { "docid": "802582cd5a3771c019df1755eb04f8e6", "score": "0.665984", "text": "function delLine(event){ \n\tvar tbutton = event.target; // get the element we clicked\n\tif (tbutton.className === \"dltbtn\"){ //check if element is a dlt button\n\t\tvar temp_parent = tbutton.parentElement; // get the parent and store in variable, here parents = li block\n\t\tvar gd_parent = temp_parent.parentElement; // get the \"grand parent\" (UL)\n\t\tgd_parent.removeChild(temp_parent); //Kick out the parents from the heritage ^^\n\t}\n}", "title": "" }, { "docid": "d49c787c0f8c62fd8222a9bb4c302792", "score": "0.66594887", "text": "function deleteStep() {\n\t// doesn't do anything right now. The delete step button should reference here\n}", "title": "" }, { "docid": "82ba5bde43987ba96e188a5944d4248f", "score": "0.6622817", "text": "function pa_del( cmd )\n{\n\tif (pa_current_widget && (cmd.split(' ')[1]) ) {\n\t\teval('delete pa_current_widget.' + cmd.split(' ')[1] + ';');\n\t}\n\telse {\n\t\tconsole.log('widget not setted');\n\t}\n\tpa_update_all();\n}", "title": "" }, { "docid": "b5294a3a371a38cf6020b790baf077f5", "score": "0.6616905", "text": "function addDelete() {\n\t\tvar deleteButtons = document.getElementsByClassName('delete');\n\n\t\tfor(var i = 0; i < deleteButtons.length; i++) {\n\t\t\tdeleteButtons[i].addEventListener('click', function(event) {\n\t\t\t\t// alert(event.target.parentElement);\n\t\t\t\tvar thisTodo = event.target.parentElement;\n\t\t\t\ttodos.removeChild(thisTodo);\n\t\t\t});\n\t\t}\t\n\t}", "title": "" }, { "docid": "6df33a4193af78965ad0732f9f02b864", "score": "0.6610124", "text": "function deleter() {\n inputField.remove();\n xButton.remove();\n }", "title": "" }, { "docid": "3c046430a0f056f7dddf2785b7df77be", "score": "0.6587797", "text": "function createDelButton() {\n var delButton = document.createElement(\"button\");\n delButton.innerHTML = \"Delete\";\n delButton.classList.add(\"button\", \"singleDeleteButton\");\n return delButton;\n}", "title": "" }, { "docid": "d3a70ce251c677d2b6bbe1d683b124d6", "score": "0.65835446", "text": "function onTarefaDeleteClick() {\n\t\t$(this).parent('.tarefa-item')\n\t\t\t.off('click')\n\t\t \t.hide('slow', function() {\n\t\t \t$(this).remove();\n\t\t});\n\t}", "title": "" }, { "docid": "db18183791fe040038ca5f0705658126", "score": "0.6567292", "text": "function markToDelete() {\n \tvar button = document.querySelectorAll(\"button\");\n \tfor (var i = 0; i < button.length; i++) {\n \tbutton[i].addEventListener('click', deleteIt, false);\n \t}\n }", "title": "" }, { "docid": "8f1e9c0cbc8fb854c2f75d72792f329c", "score": "0.6557331", "text": "function deleteButtonClicked(event)\n{\n const id= event.target.value;\n taskManager.deleteTask(id);\n displayTask(); \n}", "title": "" }, { "docid": "0ea453f3b07b7a24cdf673247ce171d8", "score": "0.65353507", "text": "function toolToDelete(that){\n\t//On stock l'id passé en parametre de la fonction\n\tvar id = that.id;\n\n\t//Puis on viens chercher les informations détaillées dans la liste\n\tlet getName = document.getElementById('getName' + id).innerHTML;\n\n\t//On donne à l'action du formulaire l'id du produit pour le passer en paramètre dans le controller: updateAction\n\tlet $form = $('#delete_form');\n\t$form.data().value = id;\n\tlet action = $form.data().path.replace(':slug:', '') + $form.data().value;\n\t$form[0].action = action;\n\n\t//On vide le contenu html des fenêtre modale pour éviter l'incrémentation des informations\n\t$('.deleteModalTitle').empty();\n\t$('#delete_modal_body').empty();\n\n\t//Puis on personnalise en JS les informations html des fenêtre modale\n\t$('.deleteModalTitle').prepend(\"Supprimer '\" + getName + \"'\");\n\t$('.delete_modal_body').prepend(\"Vous vous apprêtez à supprimer définitivement l'outil '\" + getName + \"'<br />Confirmer ?\");\n}", "title": "" }, { "docid": "8781c95ab1de2777c03a695f0741df38", "score": "0.64923483", "text": "function deleteWord(wordButton)\n{\n wordButton.style.color = 'white'\n wordButton.dataset.deleted = 'true'\n wordButton.classList.remove('btn-outline-dark')\n wordButton.classList.add('btn-outline-danger')\n\n}", "title": "" }, { "docid": "d257bb2230fc95253cb9835f9fba42b9", "score": "0.6467869", "text": "deleteProduct(deleteButton){\r\n if (deleteButton.name == \"delete\") {\r\n deleteButton.parentElement.parentElement.parentElement.remove()\r\n this.showMessage(\"Produto deletado com sucesso\", \"success\")\r\n }\r\n }", "title": "" }, { "docid": "863ffdaa71a8fe13983de35a1541fb49", "score": "0.64581525", "text": "function addButton(){\n const button = document.createElement(\"button\")\n button.innerText = \"x\"\n button.addEventListener(\"click\", (e) => {\n e.target.remove()\n })\n }", "title": "" }, { "docid": "13a4edb8dfec7bd3da58f915fda38589", "score": "0.64488995", "text": "function delclick(event){\n\tif(event.target.classList.contains('delete')){\n\t\tevent.target.closest('li').remove();\n\t}\n\n}", "title": "" }, { "docid": "d5c7ba7bd8e8b6a7745e1bb320249440", "score": "0.64464396", "text": "function createDelBtnAndListElement() {\n\tvar span = document.createElement(\"span\");\n\tspan.innerHTML = \"<button class=\\\"delete\\\">x</button>\";\n\n\tvar li = document.createElement(\"li\");\n\tli.appendChild(document.createTextNode(input.value));\n\tli.appendChild(span);\n\tinput.value = \"\";\n\tul.appendChild(li);\n}", "title": "" }, { "docid": "67839fd3996bdbd47127306a74c69046", "score": "0.6445596", "text": "function deleteItems(event) {\n\tvar target = event.target;\n\tvar btncheck = event.target.nodeName;\n\tif (btncheck === \"BUTTON\") {\n\ttarget.parentNode.parentNode.remove();\t\n\t}\n}", "title": "" }, { "docid": "37a3ed36812dfccd0816d6349a61384f", "score": "0.64433914", "text": "function attachClickToDeleteButtons() {\n $(\"#page_table\").find(\"[class='btn btn-primary btn-sm delete']\").each(function (index, value) {\n $(value).click(function () {\n\n $('#pagetodelete').val($(this).attr(\"data-id-person\"));\n\n });\n });\n }", "title": "" }, { "docid": "aa0c1861c7a719c8ef1462922e3f3c9f", "score": "0.6441329", "text": "deleteClicked() {\n\t\tthis.state.delOnClick()\n\t\tif (this.state.buttonState)\n\t\t\tthis.setNewState()\n\t}", "title": "" }, { "docid": "a6d52ae0a86dc924a983e418b8653d79", "score": "0.6428431", "text": "function deleteButton(id) {\n var html = '<form action=\"/users/' + id + '\" method=\"POST\" style=\"display:inline\">';\n html += '<input type=\"hidden\" name=\"_method\" value=\"DELETE\">';\n html += '<button>Delete</button>';\n html += '</form>';\n\n return html;\n}", "title": "" }, { "docid": "faa6083207094b67649e76b4d08fe71e", "score": "0.64277893", "text": "function _fnClickDelete() {\n if (!confirm(\"Ar tikrai norite ištrinti pasirinktą eilutę?\")) return;\n var anSelected = fnGetSelected(oINST.oTable);\n //Duomenu gavimas pagal pasirinkta eilute - oINST.oTable.fnGetData(anSelected[0]) - eilutes masyvas, tame tarpe pasleptu duomenu\n oINST.oTable.fnGetData(anSelected[0])\n var id = oINST.oTable.fnGetData(anSelected[0])[0];\n var obj = this;\n CallServer(JSON.stringify({ id: id, DataObject: _SD.Config.tblUpdate }), obj.fnResponse_DeleteUser, anSelected, '/' + _SD.Config.Controler + '/Delete', 'json');\n }", "title": "" }, { "docid": "fa4adf75648236044fd9f54b47ce6763", "score": "0.64227843", "text": "function fnPostDelete() {\n debugs(\"In fnPostDelete\", \"A\");\n fnResetStyle();\n //fnCalHolHeading();\n}", "title": "" }, { "docid": "5c74f89a27219520fe78ffa669ac0f0b", "score": "0.6414887", "text": "delete() {\n $(this.DOMelement).remove();\n }", "title": "" }, { "docid": "d1340250bb0651a74722f0523c201a24", "score": "0.6405503", "text": "buttonDeleteLanguages(){\n return [{\n text: \"destroy\",\n icon: \"nf nf-fa-trash\",\n action: (row, col, id )=>{\n return this.$refs.tableLanguages.delete(id, bbn._(\"Are you sure you want to continue?\"));\n },\n notext: true\n }]\n }", "title": "" }, { "docid": "4c54795a8dcf0e7d8572f83054b02f5a", "score": "0.64038", "text": "function deleteRow(thisButton){\n\tthisButton.parent().parent().remove();\n}", "title": "" }, { "docid": "fddfb5b855f5a16760c8a6d62aef339f", "score": "0.6400572", "text": "function del(d) {\r\n\r\n d.parentNode.remove()\r\n}", "title": "" }, { "docid": "3537d6973e9ba24efd38e0a4c08fe8aa", "score": "0.6390388", "text": "function toggleDelete() {\n\tdelMode = !delMode;\n\tsetActive('btnd-del', delMode);\n}", "title": "" }, { "docid": "c8e4daa2d36a7dad8050ea3e3a26d242", "score": "0.63901466", "text": "function deleteButton() {\n $('.delete').click(function() {\n deleteCountdown(this);\n });\n}", "title": "" }, { "docid": "c85314f8b0b1f570207841d6e586ed28", "score": "0.6377376", "text": "function deleteItem(event) {\n\tif (typeof event.data == 'undefined'){\n\t\t//get items timestamp\n\t\tvar delTask = event.target.getAttribute('timestamp');\n\t\t$(\"#delItem\").val(delTask);\n\t\t$(\"#delItemDesc\").html(event.target.getAttribute('date') + \"&nbsp;\" + event.target.getAttribute('sum') + \"&euro;&nbsp;\" + event.target.getAttribute('desc'));\n\t\t// hide/show forms\n\t\tdocument.getElementById(\"entry_delete\").style.display=\"block\";\n\t\n\t\t// delete the parent of the button, which is the list item, so it no longer is displayed\n\t\tevent.target.parentNode.parentNode.removeChild(event.target.parentNode);\n\t}\n\telse if (event.data.delItem){\n\t\tvar delTask = $(\"#delItem\").val();\n\t\tvar objectStore = db.transaction([\"expanses\"],\"readwrite\").objectStore(\"expanses\");\n\t\t\n\t\tdocument.getElementById(\"entry_delete\").style.display=\"none\";\n\t\tobjectStore.delete(delTask);\n\t}\n}", "title": "" }, { "docid": "46e9bfc3d345b28fa669d997c68a9b29", "score": "0.6367076", "text": "function clickDelBtn() {\n const delEachFavBtn = document.querySelectorAll(\".js-delete-btn\");\n for (const eachbtn of delEachFavBtn) {\n eachbtn.addEventListener(\"click\", deleteOneSerie);\n }\n}", "title": "" }, { "docid": "4af70037f72d2477c06e8a38b2c091bd", "score": "0.63666415", "text": "function deleteLink (f) {\n const definedDeleteButtons = Array.from(document.getElementsByClassName('delete-button'))\n const deleteAll = document.getElementById('delete-all')\n\n definedDeleteButtons.forEach(link => f(link, deleteAll))\n}", "title": "" }, { "docid": "4e8489cc8ec0a4ffb737a5ce95ff99f2", "score": "0.6358434", "text": "function onDeleteBtnClick(){\n\tvar input = $(\"<input>\").attr({\n\t\t'type':'hidden',\n\t\t'name':'images_to_delete[]'\n\t});\n\t\n\tinput.val($(this).data('id'));\n\n\t$(this).parents('form').append(input);\n\t$(this).parents('li').remove();\n}", "title": "" }, { "docid": "cedf6a1ca38999eb70f82b3d679424a3", "score": "0.635672", "text": "function createButtonRemove(e,element){\n\t \tvar suppr = $('<input type=\"button\" id=\"tagremove\" title=\"delete\" value=\"Delete\" name=\"remove\" />');\n\t \tsuppr.insertAfter($(\"#tagsubmit\"))\n\t \t\t.css({\n\t\t \t\tborder \t\t\t: \"1px solid #000\",\n\t\t \t\tbackgroundColor : \"#fff\",\n\t\t \t\tcolor \t\t\t: \"#000\",\n\t\t \t\tfontSize \t\t: \"10px\",\n\t \t\t\tmarginRight \t: \"2px\",\n\t \t\t\twidth \t\t\t: \"54px\",\n\t \t\t\tcursor\t\t\t: \"pointer\",\t \t\t\t\t \t\t\n\t \t\t});\n\n\t\t\tsuppr.click(function() {\n\t\t\t\tedit = true;\n\t\t\t\topac = true;\n\t\t\t\telement.remove();\n\t\t\t\t$(\"#form-block\").remove();\t\t\t\t\n\n\t\t\t\tfor(var i=0; i<data.tags.length; i++){\n\t\t\t\t\tif(data.tags[i].x == e.pageX ){\n\t\t\t\t\t\tdata.tags.splice(i,1);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t});\t\t\n\t\t}", "title": "" }, { "docid": "c0a0a34149de6855b24eebea340de228", "score": "0.6350546", "text": "get removeBtn() {\n return app.client.$(\"button=Remove\");\n }", "title": "" }, { "docid": "ae82b55c3e8a2178390687f7c8b1317a", "score": "0.6349542", "text": "function createDeleteButton(node) {\n \"use strict\";\n var removeButton = document.createElement('button');\n removeButton.appendChild(document.createTextNode(\"delete\"));\n node.appendChild(removeButton);\n removeButton.onclick = function (e) {\n confirmDeletion(node, removeButton);\n e.stopPropagation();\n };\n}", "title": "" }, { "docid": "34415a9108fb5720a20034090bc810eb", "score": "0.6345461", "text": "function fnDel() {\n\n var addFlag = $pltGrid.paragonGridCheckedDeleteData();\n\n if (addFlag === false) {\n //삭제버튼 이벤트 로직 수행.\n var saveUrl = \"/ctrl/master/palletId/savePalletId\";\n var msg = \"MSG_COM_CFM_001\"; //삭제하시겠습니까?\n\n var rowData = {\n modFlag: \"MOD_FLAG\",\n pltId: \"PLT_ID\",\n clientCd: \"CLIENT_CD\"\n };\n\n //1. 체크된 리스트.\n var jsonData = $pltGrid.getSelectedJsonDataChk(\"dt_data\", rowData, $pltGrid);\n\n // console.log(\"선택된 삭제 데이터:\", jsonData);\n //ajax Event.\n fnAjaxSave(jsonData, saveUrl, msg);\n }\n }", "title": "" }, { "docid": "082a86dd2e5126301b7f9fa9e29c2919", "score": "0.63269013", "text": "function del(){\n if(deleteButton.value == \"AC\")\n {\n input.value = \"0\";\n dot_added = false;\n operator_added = false;\n deleteButton.value = \"CE\";\n }\n else\n {\n // increment the errors when we press the CE button\n // but only when we actually have something to delete\n if(input.value != \"0\")\n {\n incrementErrors();\n }\n\n var last_char = input.value.charAt(input.value.length-1);\n if(last_char == \".\") dot_added = false;\n else if(operators.indexOf(last_char) > -1) operator_added = false;\n\n input.value = input.value.substr(0, input.value.length-1);\n last_char = input.value.charAt(input.value.length-1);\n\n if(last_char == \".\") dot_added = true;\n else if(operators.indexOf(last_char) > -1) operator_added = true;\n\n if(input.value.length == 0) input.value = \"0\";\n }\n}", "title": "" }, { "docid": "6178419fe44beee939c43471f9d2e026", "score": "0.6322519", "text": "function deleteBtn() {\n\tvar changer = trashBtn[i]\n\tlistItems[i].addEventListener(\"mouseover\", function() {\n\t\tchanger.innerHTML = \"<i class=\\\"fas fa-trash-alt\\\">\";\n\t\t// this.innerHTML = textInside + \"<span class=\\\"deleteBtn\\\"><i class=\\\"fas fa-trash-alt\\\"></i></span>\";\n\t\t// reset the colors after a short delay\n\t\t\n\n\t});\n\tlistItems[i].addEventListener(\"mouseout\", function(){\n\t\tchanger.innerHTML = \"\";\n\t});\n}", "title": "" }, { "docid": "61c0fd72a01aba8531a5fa0dbcdd1632", "score": "0.63192135", "text": "exitDelete(){\n this.confirmDelete = false;\n }", "title": "" }, { "docid": "6a81c4e856c6837a6b0a04928185f34e", "score": "0.6316615", "text": "function listenForDelete(deleteButton) {\n\n // When the user clicks the delete button,\n // mark the reference for deletion.\n deleteButton.addEventListener('click',\n function() {\n markReferenceForDeletion(deleteButton)\n },\n {once:true});\n\n}", "title": "" }, { "docid": "81ef84e7ee946ee029026b1b0291b784", "score": "0.6312759", "text": "function deleterequest(id) {\n\t\t$('#delete'+id).click(function(e){\n\t\t\te.preventDefault();\n\t\t\t$('#delete'+id).hide();\n\t\t\t$('#confirmdelete'+id).show();\n\t\t});\n\t\t$('#yesdelete'+id).click(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar base=$('#base').html();\n\t\t\t$.post(base+'/charts/deleterow',{id:id},function(d){\n\t\t\t\tif (d==1) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t\t//$('#datarow'+id).hide('fast');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t});\n\t\t$('#nodelete'+id).click(function(e){\n\t\t\te.preventDefault();\n\t\t\t$('#delete'+id).show();\n\t\t\t$('#confirmdelete'+id).hide();\n\t\t});\n\t}", "title": "" }, { "docid": "0bb38c746a36a33aa2f437ad32003782", "score": "0.63064677", "text": "deleteNoteClicked(cb, id) {\n cb(id)\n console.log(\"delete button clicked\")\n }", "title": "" }, { "docid": "9a78614de70bd2270ba3241bbc93e4f6", "score": "0.6300233", "text": "function deleteButtons() {\n $(\".delBtn\").on(\"click\", function (e) {\n e.preventDefault();\n var hour = e.target.id.substring(7);\n console.log(\"Deleteing: \" + hour);\n $(\"#text-\" + hour).val(\"\");\n localStorage.removeItem(hour);\n });\n }", "title": "" }, { "docid": "4e23fb27d0132630a9342fa409afb8bc", "score": "0.6295143", "text": "function deleteListItem () {\n\n}", "title": "" }, { "docid": "102153fbf5059e8eccf246752c06cdae", "score": "0.62895316", "text": "function createDeleteButton(id) {\n let btn = document.createElement('button'); \n btn.className = 'btn btn-primary'; \n btn.id = id; \n btn.innerHTML = 'Delete'; \n btn.onclick = () => {\n console.log(`Delete row with id: item-${id}`); \n let elementToDelete = document.getElementById(`item-${id}`); \n elementToDelete.parentNode.removeChild(elementToDelete); \n }; \n return btn; \n}", "title": "" }, { "docid": "d28f623a66938e02d68c69c645498950", "score": "0.62760377", "text": "function deleteTodo() {\n console.log(\"delete press\");\n $(this).parent().remove();\n}", "title": "" }, { "docid": "ea962577e848de1a01e2ad12e89d7c87", "score": "0.6275118", "text": "function btnDel() {\n\n if(editSelectedId != null) {\n var res = confirm(\"Tem certeza que deseja remover este produto?\")\n if(res == true) {\n database.ref('products/' + editSelectedId).remove()\n\n $('#del').modal('toggle');\n }\n\n } else {\n alert(\"Selecione um produto para remover\")\n }\n}", "title": "" }, { "docid": "4384a7898c29e2419cc9f107e67bb1fd", "score": "0.62712306", "text": "clickDelete()\n {\n const deleteButton = this.wrapper.find( IconButton )\n .findWhere( node => node.props().iconType === 'delete' );\n\n if ( !this.wrapper.prop( 'isDeletable' ) )\n {\n throw new Error( ERR.MODULE_HAS_NO_DELETE );\n }\n\n deleteButton.driver().click();\n return this.wrapper;\n }", "title": "" }, { "docid": "089770bd20979b234e6f0e24e4f458f6", "score": "0.6261447", "text": "function createDeleteButton(target){\n\tvar deleteButton = $('<button>',{\n\t\"class\":\"btn btn-danger btn-xs\",\n\t\"id\":\"deleteButton\"\n\t}).bind('click',function(){\n\t\tvar item = $(this).closest($(target));\n\t\titem.remove();\n\t}).append($('<span>',{\n\t\"class\":\"glyphicon glyphicon-trash\"\n\t}));\n\treturn deleteButton;\n\t}", "title": "" }, { "docid": "eff7e5f6bb91222ee825803c0ce3d0d3", "score": "0.6252976", "text": "function echoRemove(id,functionName){\n\t\tvar output = \"\";\n\t\tif(functionName !== undefined){\n\t\t\toutput = '<td class=\"center removeIcon\"><button class=\"btn btn-danger btn-circle\" type=\"button\" onclick=\"'+functionName+'('+id+')\"><i class=\"fa fa-times\"></i></button></td>'\n\t\t} else {\n\t\t\toutput = '<td class=\"center removeIcon\"><button class=\"btn btn-danger btn-circle\" type=\"button\" onclick=\"del('+id+')\"><i class=\"fa fa-times\"></i></button></td>'\n\t\t}\n\t\treturn output;\n}", "title": "" }, { "docid": "cd5269a94aec698624dec7bded12418d", "score": "0.62481606", "text": "onDelete() {\n\t\t$(\".aimeos.basket-bulk\").on(\"click\", \".buttons .delete\", ev => {\n\t\t\t$(ev.currentTarget).parents(\".details\").remove();\n\t\t});\n\t}", "title": "" }, { "docid": "6c3b67ed79c7ec002980a708bcf5928d", "score": "0.624374", "text": "function del(e) {\r\n firebase.database().ref('todos').child(e.id).remove()\r\n e.parentNode.remove()\r\n}", "title": "" }, { "docid": "2b800a78f7e64be5f6fae35570934897", "score": "0.62414426", "text": "function deleteBtn() {\n $(\".recent-search\").empty();\n let buttonDelete = $(this).attr(\"data-index\");\n buttons.splice(buttonDelete, 1);\n displaySearched();\n console.log(\"value: \", buttonDelete);\n}", "title": "" }, { "docid": "f5da5dadf1dbf978c1919d2d68909c2d", "score": "0.62404746", "text": "function Delete(event) {\n\t// console.log('delete', event.target);\n\t// eventAdd = event.target.parentElement; \n\t// eventAdd.parentNode.removeChild(event.target.parentNode);\t\t\t\t\nevent.target.parentElement.parentNode.removeChild(event.target.parentNode)\n}", "title": "" }, { "docid": "f4cd30cb27fcf405cd67d024f120a362", "score": "0.6232118", "text": "function createDeleteButton(){\n var div = document.createElement('div');\n div.className = \"end\";\n var buttonNode = document.createElement('button');\n buttonNode.className = \"btn btn-delete\";\n buttonNode.innerHTML = \"Delete\";\n buttonNode.onclick = deleteItem;\n div.appendChild(buttonNode);\n return div;\n}", "title": "" }, { "docid": "d44413a37f6e6350bff49c741f3a58c2", "score": "0.6220695", "text": "function createDeleteTeamButton(team) {\n let btn = document.createElement('button');\n btn.className = 'btn btn-primary';\n btn.innerHTML = 'Delete Team';\n // console.log('before the on click fx');\n // console.log(btn)\n btn.onclick = () => {\n // console.log('inside delete team button');\n let index = teams.indexOf(team);\n teams.splice(index, 1);\n drawDOM();\n };\n // need to return the button in order to append button on row and table levels\n return btn;\n}", "title": "" }, { "docid": "b16674b62153cb9a0cc9ed18cb0a731c", "score": "0.62195635", "text": "function deleteEmployee() {\n console.log('deleteButton');\n $(this).parent().remove();\n} // end deleteEmployee", "title": "" }, { "docid": "3b8637685cb0171206c4a3bc309dedbe", "score": "0.62184125", "text": "function onClick(e) {\n if (swiped || preventSwipe) {\n e.preventDefault();\n e.stopPropagation();\n }\n if (swiped && e.target === deleteBtn) {\n var li = findListItemNode(e.target),\n event = document.createEvent(\"Events\");\n\n // must send event before removal from the dom\n event.initEvent(\"delete\", true, true, null, null, null, null, null, null, null, null, null, null, null, null);\n li.dispatchEvent(event);\n\n removeElement(li);\n hideButton();\n }\n }", "title": "" }, { "docid": "e41ae7320921708c3c021ce1316c3820", "score": "0.6215537", "text": "function onclick_btn_delete_pro(){\n\t\tvar table = $(\"#table-erd-current\").val();\n\t\tvar columns = $('#column-erd-current').val();\n\t\tfor(var temp = 0 ; temp < columns.length ; temp++){\n\t\t\tfor(var i = 0 ; i < RootNode.instance.childs.length;i++){\n\t\t\t\tif(table == RootNode.instance.childs[i].tableName){\n\t\t\t\t\tvar tableCurrent = RootNode.instance.childs[i];\n\t\t\t\t\tfor(var j = 0 ; j < tableCurrent.childs.length;j++){\n\t\t\t\t\t\tif(tableCurrent.childs[j].json == \"column\")\n\t\t\t\t\t\t\tif(tableCurrent.childs[j].columnName == columns[temp]){\n\t\t\t\t\t\t\t\t RootNode.instance.childs[i].childs.splice(j,1);\n\t\t\t\t\t\t\t\tdelete_data_d3(table,columns[temp]);\n\t\t\t\t\t\t\t\tbreak;\n\t\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}\n\t\t}\n\t\t$(\"#btn-delete-pro\").prop(\"disabled\",true);\n\t\t\n\t}", "title": "" }, { "docid": "86abfc9f8ebdf0cbee7877b027d0fe66", "score": "0.6209667", "text": "function dltRctions(){\n\t$(\".fa-delete\").on(\"click\", function(){\n\t\tvar parent= $(this).parents();\n\t\tparent[1].remove();\n });\n}", "title": "" }, { "docid": "d29b2692213dee78304edde0392581b1", "score": "0.6208184", "text": "function removeEntry() {\n\t\t\tlet removeButton = document.createElement('button');\n\t\t\tremoveButton.textContent = 'remove';\n\t\t\tremoveButton.style.color = 'white';\n\t\t\tremoveButton.addEventListener('click', () => {\n\t\t\tresults.removeChild(showText);\n\t\t\tremoveButton.remove();\n\t\t\t});\n\t\t\tresults.appendChild(removeButton);\n\t\t}", "title": "" }, { "docid": "0fd1d330d11520bcfd9a22043fd751f2", "score": "0.62020695", "text": "function createDltBtn (li){\n const remove = document.createElement('button')\n remove.className = 'btn-remove'\n remove.innerHTML = 'X'\n li.prepend(remove)\n}", "title": "" }, { "docid": "f14ad04d73b79ade0335a7a68c9d003b", "score": "0.6194421", "text": "function deleteBtn() {\n let td = document.createElement(\"td\")\n let button = document.createElement(\"button\")\n button.setAttribute(\"type\", \"button\")\n button.classList.add(\"btn\", \"btn-danger\", \"btn-sm\")\n let i = document.createElement(\"i\")\n i.classList.add(\"fas\", \"fa-trash-alt\")\n button.appendChild(i)\n tx = document.createTextNode(\" Šalinti\")\n button.appendChild(tx)\n button.onclick = deleteTask\n td.appendChild(button)\n return td\n}", "title": "" }, { "docid": "aa754933d73493b63c0e3b6744fb9a39", "score": "0.6186961", "text": "function deleteButton(event) {\r\n\tlet ele = event.target;\r\n\r\n\t//before the item is deleted, it is faded to red.\r\n\tele.parentNode.style.color = \"red\";\r\n\tele.parentNode.style.opacity = 0.7;\r\n\r\n\t//The faded item is visible for nearly 100ms and this is achieved using setTimeout function in javascript.\r\n\tsetTimeout(function () {\r\n\t\tele.parentNode.remove(ele);\r\n\t}, 100);\r\n\r\n}", "title": "" }, { "docid": "4f4c200d8f70302e2a3dea70121237d8", "score": "0.61867267", "text": "function delBtn(key) {\r\n store.dispatch({\r\n type: DELETE, payload: key\r\n })\r\n console.log('action dispatched')\r\n}", "title": "" }, { "docid": "9fba41a8c6c9a9fec3120933906bf81b", "score": "0.61703587", "text": "function deleteIt() {\n \t\tthis.parentNode.setAttribute(\"id\",\"toDelete\");\n \t\tvar post = document.querySelector(\"#toDelete\");\n\t\tpost.parentNode.removeChild(post);\n }", "title": "" }, { "docid": "e26fe43015ce66835771e2368cc96b63", "score": "0.6167315", "text": "addDeleteSelf(data,alt_icon){\r\n let icon=alt_icon || \"rubbish.svg\";\r\n return (\r\n <ActionButton button_icon={icon} button_class=\"delete-self-button\" titletext={gettext(\"Delete\")} handleClick={this.deleteSelf.bind(this,data)}/>\r\n );\r\n }", "title": "" }, { "docid": "4d27259bbe2c829c2beb6042f155e043", "score": "0.6166639", "text": "function onclick_btn_delete_rela(){\n\t\tvar d = d3.select(\"#line\"+$('#fk-table-erd-current').val()+$('#fk-refertable-erd-current').val()).data()[0];\n\t\tfor(var i = 0 ; i < listRelationship.length ; i ++){\n\t\t\tif(listRelationship[i].table == d.table && listRelationship[i].referTbl){\n\t\t\t\tlistRelationship.splice(i,1);\n\t\t\t}\n\t\t}\n\t\td3.select('#line'+d.table+d.referTbl).remove();\n\t\t$(\"#fk-table-erd-current\").val(null);\n\t\t$(\"#fk-refertable-erd-current\").val(null);\n\t\tvar colId ;\n\t\tvar tableCurrent ;\n\t\tfor(var i = 0 ; i < RootNode.instance.childs.length;i++){\n\t\t\tif(d.referTbl == RootNode.instance.childs[i].tableName){\n\t\t\t tableCurrent = RootNode.instance.childs[i];\n\t\t\t\tfor(var j = 0 ; j < tableCurrent.childs.length;j++){\n\t\t\t\t\tif(tableCurrent.childs[j].json == \"column\")\n\t\t\t\t\t\tif(tableCurrent.childs[j].foreignKey == true){\n\t\t\t\t\t\t\tcolId = tableCurrent.childs[j].tempId;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar relatedList = TablesList.findRelatedElements(tableCurrent, colId);\n\t\tInfoPanel.deleteRela(tableCurrent, colId, relatedList);\n\t\t$('#btn-delete-rela').prop('disabled',true);\n\t}", "title": "" }, { "docid": "0f432513408c2a04f52766573345699f", "score": "0.6162884", "text": "function del(id, type) {\n var confirmButton = '<button type=\"button\" class=\"btn btn-danger btn-sm\" onclick=\"delConfirm(' + id + ', \\'' + type + '\\', 1)\"><span class=\"glyphicon glyphicon-ok\" aria-hidden=\"true\"></span> Yes</button>';\n var cancelButton = '<button type=\"button\" data-dismiss=\"alert\" class=\"btn btn-default btn-sm\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span> No</button>';\n var alertDiv = '<div class=\"alert alert-danger fade-in\" role=\"alert\"><h4>Deletion</h4><p>Confirm deletion ?</p>' + '<p>' + confirmButton + cancelButton + '</p></div>';\n $('#' + type + '_messages').append(alertDiv);\n}", "title": "" }, { "docid": "1b7e6460de9f6ebe73e965a125d7afd6", "score": "0.6159243", "text": "function removeButton(){ \n fila.pop();//1\n fila.print();//2\n}", "title": "" }, { "docid": "b2f7f05bb54a626ae765682bfcc2b65c", "score": "0.61572754", "text": "function handleDelete(id) {\n onClick(id);\n }", "title": "" }, { "docid": "6b3ae717892abe912027a2a6a919cac4", "score": "0.6156042", "text": "function remove(){\n const btn = event.target;\n const index = parseInt(btn.parentElement.getAttribute(\"idx\"), 10);\n lists.splice(index, 1);\n document.getElementById(\"sec\").innerHTML = lists.map((list, i) => {\n return `<li idx=\"${i}\">${lists}<button type=\"button\" onclick=\"remove()\">Delete</button></li>`\n });\n}", "title": "" }, { "docid": "60c8f575606680ae0913e3df99cea60b", "score": "0.61496603", "text": "function deleteObjectAction(button) {\n\t\tif (button) {\n\t\t\t// delete\n\t\t\tbutton.addEventListener('click', function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// FRM2 (10) only if object exists\n\t\t\t\tif (!_objectData || !_objectData._id) {\n\t\t\t\t\treturn alert('No object!');\n\t\t\t\t}\n\t\t\t\tif (confirm('Delete these object?')) {\n\n\t\t\t\t\tcrud.deleteObject(_objectData._id,function(err,data) {\n\t\t\t\t\t\tif (err) \n\t\t\t\t\t\t\treturn alert('Could not delete object');\n\t\t\t\t\t\tvar tViewObject = topicView.getTopicView();\n\t\t\t\t\t\t/* NJM3 (4) */\n\t\t\t\t\t\tcrud.removeContentItem(tViewObject.title,'objekt',function(err,data) {\n\t\t\t\t\t\t\t_objectData = null;\n\t\t\t\t\t\t\tshowObject();\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} // end deleteButtonAction", "title": "" }, { "docid": "2bd776b2aadb877dca6c8901fbc06152", "score": "0.61481684", "text": "function clickToDeleteButton(){\n var deleteButtons = document.getElementsByClassName(\"deleteButton\");\n var i;\n for (i = 0; i < deleteButtons.length; i++) {\n deleteButtons[i].onclick = function() {\n var div = this.parentElement;\n div.style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "ae52f5fe4312a5d91135eb0224be54ad", "score": "0.614509", "text": "function bindDelete() {\n var deleteButtons = document.getElementsByClassName('js-note-delete');\n for (var i=0; i < deleteButtons.length; i++) {\n deleteButtons[i].addEventListener('click', deleteNote);\n };\n }", "title": "" }, { "docid": "ae52f5fe4312a5d91135eb0224be54ad", "score": "0.614509", "text": "function bindDelete() {\n var deleteButtons = document.getElementsByClassName('js-note-delete');\n for (var i=0; i < deleteButtons.length; i++) {\n deleteButtons[i].addEventListener('click', deleteNote);\n };\n }", "title": "" }, { "docid": "438098b685f4442fc137519eaed671f9", "score": "0.6142129", "text": "function appendDeleteBtn(commentList){\n const deleteBtn = document.createElement(\"button\");\n deleteBtn.innerText = \"Delete\";\n commentList.appendChild(deleteBtn);\n \n deleteBtn.addEventListener(\"click\", function(e){\n e.target.parentElement.remove();\n });\n }", "title": "" } ]
36763c2fbf93a6ef544b52b2cd0b3032
Function: exportGroupRecursively Usage: export all group of layer to a file Input: document or layerset Return: file(s)
[ { "docid": "085ee7c7a8aecb2896ea830976ad302d", "score": "0.74784786", "text": "function exportGroupRecursively(exportOptions, dupObj, oriObj, dupDocRef) {\n setInvisibleAllLayerSets(dupObj, false);\n\n for (var i = 0; i < dupObj.layerSets.length; i++) {\n if (exportOptions.visibleOnly)\n if (!oriObj.layerSets[i].visible)\n continue;\n\n dupObj.layerSets[i].visible = true;\n\n var tmpName = exportOptions.fileNamePrefix + \"_\" + dupObj.layerSets[i].name;\n\n var duppedDocumentTmp = dupDocRef.duplicate();\n\n if (exportOptions.fileType != pngIndex)\n duppedDocumentTmp.flatten();\n else\n if (exportOptions.pngTrim)\n app.activeDocument.trim(TrimType.TRANSPARENT);\n\n saveFile(duppedDocumentTmp, tmpName, exportOptions);\n\n duppedDocumentTmp.close(SaveOptions.DONOTSAVECHANGES);\n\n dupObj.layerSets[i].visible = false;\n }\n\n // Recursive\n // for (var i = 0; i < dupObj.layerSets.length; i++) {\n // // if (visibleOnly) {\n // // if (!oriObj.layerSets[i].visible) {\n // // continue;\n\n // exportGroupRecursively(exportOptions, dupObj, oriObj, fileName);\n // }\n}", "title": "" } ]
[ { "docid": "017f1244cba5afa5d58deed21e7eea80", "score": "0.7073268", "text": "function exportSubgroups() {\n if (!outFolder.exists) outFolder.create();\n var savedState = app.activeDocument.activeHistoryState;\n\n // Stores saved layer info: name, coordinates, width and height\n var lyrInfo = \"\";\n\n // Define pixels as unit of measurement\n var defaultRulerUnits = preferences.rulerUnits;\n preferences.rulerUnits = Units.PIXELS;\n\n var selectLayers = getSelectedLayersId();\n if (selectLayers == null || selectLayers.length == 0) {\n alert(\"NO_LAYER_SELECTED\");\n return;\n }\n\n for (var i = 0; i < selectLayers.length; i++) {\n setSelectedLayers(selectLayers[i]);\n var layer = activeDocument.activeLayer;\n lyrInfo += scan(layer);\n }\n\n // Resumes back to original ruler units\n preferences.rulerUnits = defaultRulerUnits;\n // Writes stored layer info into single file\n if (saveLyrInfo && lyrInfo != \"\") {\n writeFile(\"ASSET NAME, COORDINATE, WIDTH, HEIGHT\\n\" + lyrInfo, originPath + \"/out/\");\n }\n\n app.activeDocument.activeHistoryState = savedState;\n}", "title": "" }, { "docid": "fa157f0b203259df5905cea325c2e53c", "score": "0.66042715", "text": "function exportLayerRecursively(exportOptions, dupObj, oriObj, dupDocRef) {\n setInvisibleAllArtLayers(dupObj);\n\n for (var k = 0; k < dupObj.artLayers.length; k++) {\n if (exportOptions.visibleOnly)\n if (!oriObj.artLayers[k].visible)\n continue;\n\n dupObj.artLayers[k].visible = true;\n\n var tmpName = exportOptions.fileNamePrefix + \"_\" + dupObj.artLayers[k].name;\n\n var duppedDocumentTmp = dupDocRef.duplicate();\n\n if (exportOptions.fileType != pngIndex)\n duppedDocumentTmp.flatten();\n else\n if (exportOptions.pngTrim)\n app.activeDocument.trim(TrimType.TRANSPARENT);\n\n saveFile(duppedDocumentTmp, tmpName, exportOptions);\n\n duppedDocumentTmp.close(SaveOptions.DONOTSAVECHANGES);\n\n dupObj.artLayers[k].visible = false;\n }\n\n // Recursive\n for (var i = 0; i < dupObj.layerSets.length; i++) {\n if (exportOptions.visibleOnly)\n if (!oriObj.layerSets[i].visible)\n continue;\n\n exportLayerRecursively(exportOptions, dupObj.layerSets[i], oriObj.layerSets[i], dupDocRef); // recursive\n }\n}", "title": "" }, { "docid": "0570d22d6e5a8fb1e8c9db427677e9e4", "score": "0.6393819", "text": "function exportChildren(dupObj, orgObj, exportInfo, dupDocRef, prefix)\n{\n\tfor( var i = 0; i < dupObj.artLayers.length; i++)\n\t{\n\t\tif (!orgObj.artLayers[i].visible)\n\t\t\tcontinue;\n\n\n\t\tg_cnt_src++;\n\n\n\t\tvar strFile = prefix;\n\t\tvar dstRect;\n\t\tvar dstFile;\n\n\t\tvar layerName = dupObj.artLayers[i].name; // store layer name before change doc\n\t\tvar duppedTmp;\n\n\n\t\tstrFile = prefix +\"_\"+layerName;\n\n\t\tstrFile = strFile.replace(/[:\\/\\\\*\\?\\\"\\<\\>\\|]/g, \"_\"); // '/\\:*?\"<>|' -> '_'\n\t\tstrFile = strFile.toLowerCase();\n\t\tstrFile = StrReplace(strFile, \"-\", \"_\");\n\t\tstrFile = StrReplace(strFile, \" \", \"_\");\n\t\tstrFile = IntToStr(g_cnt_src) + \"_\" + strFile + \".png\";\n\n\t\tdstFile = exportInfo.workSrc + \"/\" + strFile;\n\t\tdstRect = exportInfo.workSrc + \"/\" + \"zzzrf2yr_\" + strFile;\n\n\n\n\t\tdupObj.artLayers[i].visible = true;\n\n\t\tduppedTmp = dupDocRef.duplicate();\n\t\tSaveToPng(duppedTmp, dstRect);\n\n\n\t\tapp.activeDocument.trim(TrimType.TRANSPARENT);\n\t\tSaveToPng(duppedTmp, dstFile);\n\n\t\tduppedTmp.close(SaveOptions.DONOTSAVECHANGES);\n\t\tdupObj.artLayers[i].visible = false;\n\t}\n\n\n\tvar sub_idx=0;\n\tfor( var i = 0; i < dupObj.layerSets.length; i++)\n\t{\n\t\t// visible layer only\n\t\tif (!orgObj.layerSets[i].visible)\n\t\t\tcontinue;\n\n\t\tvar name = orgObj.layerSets[i].name;\n\n\t\t//var strFile = prefix;\n\t\t//strFile += \"_\" + zeroSuppress(i, 4) + \"s\";\n\n\t\tvar len = name.length;\n\n\t\t\n\t\tif(7 < len && name.substring(0, 4) == \"grp \")\n\t\t{\n\t\t\tname = name.substring(4, len);\n\t\t\t//g_cnt_src =0;\n\n\t\t\tg_File.writeln(name);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tname = prefix;\n\t\t}\n\n\n\t\texportChildren(dupObj.layerSets[i], orgObj.layerSets[i], exportInfo, dupDocRef, name); // recursive call\n\t}\n}", "title": "" }, { "docid": "a094082ad3f36648732d10bf52da5812", "score": "0.63679236", "text": "function exportObjectGroup(layer, root, config) {\n var element = XML.Element({\n _attr: {\n name: layer.id,\n width: layer.size.width,\n height: layer.size.height\n }\n });\n root.push({objectgroup: element});\n \n // TODO - Add exporting of objects\n element.close();\n}", "title": "" }, { "docid": "9b73ac3a2fbebda78e9ebde7aaa22b82", "score": "0.5599358", "text": "function SaveAllLayers(fileName, layers){\r\n var len = layers.length;\r\n var parent = layers.parent;\r\n var newLayer;\r\n for(var i = 0; i < len; i++){\r\n var layer = layers[i];\r\n if (layer.typename == 'ArtLayer' && layer.visible && layer.kind != LayerKind.TEXT) {\r\n if (HalfSize) SaveLayer(layer, app.activeDocument.path + \"/\" + fileName + \"_png\", true);\r\n\t\t\tSaveLayer(layer, app.activeDocument.path + \"/\" + fileName + \"_png_HD\", false);\t\r\n } else {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "01871196b2444cfbb90c24218ad1bf51", "score": "0.54301804", "text": "getDetachedGroupByExportedSymbolLayer(exportedLayer) {\n const document = DOM.getSelectedDocument();\n const layerId = exportedLayer.do_objectID;\n const originalSymbolInstance = document.getLayerWithID(layerId);\n\n // Keep name and rename duplicate to recognize it if something is broken during export\n const layerName = originalSymbolInstance.name;\n const duplicatedSymbolInstance = originalSymbolInstance.duplicate();\n duplicatedSymbolInstance.name = '[export copy] ' + layerName;\n\n const detachedGroup = this.recursivelyDetachSymbols(duplicatedSymbolInstance);\n\n // Get data of the symbolInstance duplicate\n const detachedGroupExport = DOM.export(detachedGroup, {\n formats: 'json',\n output: false,\n });\n\n // Reset original name\n detachedGroupExport.name = layerName;\n\n // Remove the duplicate of the symbolInstance\n detachedGroup.remove();\n\n // Set layerId of the old symbol instance to the exported group,\n // because we want to keep that id to match exporables (attachments)\n detachedGroupExport.do_objectID = layerId;\n\n return detachedGroupExport;\n }", "title": "" }, { "docid": "aaeee0634363f98c1232825552d480db", "score": "0.54164416", "text": "function collectAllLayers (doc, allLayers){\r for (var m = 0; m < doc.layers.length; m++){\r var theLayer = doc.layers[m];\r if (theLayer.visible && theLayer.layers && theLayer.layers.length > 0)\r {\r collectAllLayers(theLayer, allLayers);\r } else {\r if (checkSmartLayer(theLayer))\r {\r if(theLayer.visible) \r {\r $.writeln(\"collected indexes \"+theLayer.name+\" @index \"+theLayer.itemIndex);\r layerNameToLayerIndex[theLayer.name] = theLayer.itemIndex;\r layerIndexToLayerName[theLayer.itemIndex] = theLayer.name;\r collectedLayersArr.push(theLayer.itemIndex);\r addSelectedLayer(theLayer.name);\r }\r }\r }\r }\r \r return allLayers;\r}", "title": "" }, { "docid": "a5f12d56271b9ba4d702229f3855ca45", "score": "0.54099035", "text": "function recurse(renderer, el, group) {\n el = el.lastChild;\n var prev, idx = 0;\n\n visit(group, function(item) {\n prev = renderer.draw(el, item, prev);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n domClear(el, 1 + idx);\n }", "title": "" }, { "docid": "c2bb767461ec2a2885086d13bde08959", "score": "0.5407184", "text": "function newGroupFromLayers(parentDoc) {\n var desc = new ActionDescriptor();\n var ref = new ActionReference();\n ref.putClass( sTID('layerSection') );\n desc.putReference( cTID('null'), ref );\n var lref = new ActionReference();\n lref.putEnumerated( cTID('Lyr '), cTID('Ordn'), cTID('Trgt') );\n desc.putReference( cTID('From'), lref);\n executeAction( cTID('Mk '), desc, DialogModes.NO );\n}", "title": "" }, { "docid": "692777b9551487b744ddfb0e006ed294", "score": "0.5399318", "text": "function collectLayers (theParent, allLayers) { \r if (!allLayers) {var allLayers = new Array} \r else {}; \r for (var m = theParent.layers.length - 1; m >= 0;m--) { \r var theLayer = theParent.layers[m]; \r// apply the function to layersets; \r if (theLayer.typename == \"ArtLayer\") { \r allLayers.push(theLayer) \r } \r else { \r allLayers = (collectLayers(theLayer, allLayers)) \r// this line includes the layer groups; \r allLayers.push(theLayer); \r } \r }; \r return allLayers \r}", "title": "" }, { "docid": "aa5307159110c5e503b8289944f003c4", "score": "0.5330009", "text": "function fnExportModel (argName, argAsName) {\n\n // Find named object 'group-argName' or fail\n var tmpGroup = scene.getObjectByName(\"group-\" + argName);\n if (! tmpGroup) {\n fnLog (\"3d: fnExport: No group found named group-\" + argName);\n return;\n }\n\n // Kludge switcheroo the entire group as one object to world center\n // then back after export, so import can move it where it wants\n var tmpPos = tmpGroup.position;\n tmpGroup.position = {x:0, y:0, z:0};\n var tmpJSON = tmpGroup.toJSON();\n tmpGroup.position = tmpPos; // Put back. Isnt there smarter way?\n\n // REQUIRES JQUERY: ajax request to:\n $.ajax({\n type: \"POST\",\n url: sExportCGI + \"?\" + argAsName, // Only cgi parm is name\n data: JSON.stringify(tmpJSON),\n contentType: \"application/json\", // superfluous?\n dataType: \"json\", // Docs: 'for response' ?! (not data)\n success: null, // Callback on success, reqd but 'null ok'\n dataType: \"text\" // Datatype expected BACK from server! Alt: html\n });\n\n // Include error/success msg to screen\n} // End function", "title": "" }, { "docid": "064bf6bedec537cff8d919717b04f8ad", "score": "0.52932346", "text": "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}", "title": "" }, { "docid": "8fbab57a2c65fbb8100633059337b069", "score": "0.5262588", "text": "groupRecursive(group, fieldsToGroup, aggegateOptions, sortOptions) {\n if (fieldsToGroup == undefined || fieldsToGroup == null) {\n return;\n }\n\n if (group.level > fieldsToGroup.length - 1) {\n group.aggregate = {\n aggregate: aggegateOptions.aggregate,\n value: aggregator[aggegateOptions.aggregate](group.items, aggegateOptions.field)\n };\n\n group.lowestGroup = true;\n group.items = this.sortItems(group.items, sortOptions);\n return;\n }\n\n group.groups = this.group(group.items, fieldsToGroup[group.level], group.level + 1, sortOptions);\n\n const keys = group.groups.keys();\n\n for (let key of keys) {\n const childGroup = group.groups.get(key);\n this.groupRecursive(childGroup, fieldsToGroup, aggegateOptions, sortOptions);\n }\n\n group.aggregate = {\n aggregate: aggegateOptions.aggregate,\n value: aggregator[aggegateOptions.aggregate](group.items, aggegateOptions.field)\n };\n\n group.items = Array.from(group.groups, items => items[1]);\n delete group.groups;\n }", "title": "" }, { "docid": "41b58c11d52fa9e154acae40b3b0a390", "score": "0.51833785", "text": "exportLayersAsPNG ()\n {\n let linksDiv = document.getElementById(\"png-links-div\");\n\n if (linksDiv !== null)\n {\n linksDiv.parentElement.removeChild(linksDiv);\n }\n\n linksDiv = document.createElement(\"div\");\n linksDiv.setAttribute(\"id\", \"png-links-div\");\n\n // The idea here is to draw each layer on a canvas and scan the pixels of that canvas to fill the matrix\n this.layers.forEach((layer) => {\n layer.getCanvas().toBlob((blob) =>\n {\n let text = document.createTextNode(\"Download \" + layer.layerName + \" PNG \"),\n link = document.getElementById(layer.layerName + \"-png-download\");\n\n if (link === null)\n {\n let newImg = document.createElement('img'),\n url = URL.createObjectURL(blob);\n\n newImg.src = url;\n\n link = document.createElement(\"a\");\n link.appendChild(text);\n linksDiv.appendChild(link);\n }\n\n // Browsers that support HTML5 download attribute\n let url = URL.createObjectURL(blob);\n link.setAttribute(\"class\", \"export-download\");\n link.setAttribute(\"id\", layer.layerName + \"-png-download\");\n link.setAttribute(\"href\", url);\n link.setAttribute(\"download\", layer.layerName);\n });\n });\n\n document.body.appendChild(linksDiv);\n }", "title": "" }, { "docid": "0fd8f4209369dd2043855c9d1f79c5b9", "score": "0.5170225", "text": "function exportAll() {\n if (!outFolder.exists) outFolder.create();\n var savedState = app.activeDocument.activeHistoryState;\n\n // Stores saved layer info: name, coordinates, width and height\n var lyrInfo = \"\";\n\n // Define pixels as unit of measurement\n var defaultRulerUnits = preferences.rulerUnits;\n preferences.rulerUnits = Units.PIXELS;\n\n lyrInfo += scan(doc);\n\n // Resumes back to original ruler units\n preferences.rulerUnits = defaultRulerUnits;\n // Writes stored layer info into single file\n if (saveLyrInfo && lyrInfo != \"\") {\n writeFile(\"ASSET NAME, COORDINATE, WIDTH, HEIGHT\\n\" + lyrInfo, originPath + \"/out/\");\n }\n\n app.activeDocument.activeHistoryState = savedState;\n}", "title": "" }, { "docid": "6d3986a279b7f9a1d27c49bfca154830", "score": "0.51592463", "text": "exportLayersAsCSV ()\n {\n let core = this.pixelInstance.core,\n height = core.publicInstance.getPageDimensionsAtZoomLevel(this.pageIndex, this.zoomLevel).height,\n width = core.publicInstance.getPageDimensionsAtZoomLevel(this.pageIndex, this.zoomLevel).width;\n\n let progressCanvas = this.uiManager.createExportElements(this).progressCanvas;\n this.initializeMatrix();\n this.exportLayersCount = this.layers.length;\n\n // The idea here is to draw each layer on a canvas and scan the pixels of that canvas to fill the matrix\n this.layers.forEach ((layer) => {\n let layerCanvas = document.createElement('canvas');\n layerCanvas.setAttribute(\"class\", \"export-page-canvas\");\n layerCanvas.setAttribute(\"id\", \"layer-\" + layer.layerId + \"-export-canvas\");\n layerCanvas.width = width;\n layerCanvas.height = height;\n\n layer.drawLayerInPageCoords(this.zoomLevel, layerCanvas, this.pageIndex);\n this.fillMatrix(layer, this.matrix, layerCanvas, progressCanvas);\n });\n }", "title": "" }, { "docid": "e018f1b246930802236b54d7666757ec", "score": "0.5088805", "text": "function Grouping() {}", "title": "" }, { "docid": "3370fde93f96cb3400720d888aaac27f", "score": "0.506423", "text": "function iterate(grp)\r\n \t{\r\n \t\tgrp.children.forEach(function(childNode){\r\n \t\t if (childNode.type === \"GRP\")\r\n {\r\n \t\t\t iterate(childNode);\r\n }\r\n else\r\n {\r\n childNode.skew(degH, degV);\r\n }\r\n \t\t});\r\n \t}", "title": "" }, { "docid": "01221cd7e2f65353d6b4f12f8adfb063", "score": "0.50621814", "text": "function processGroup(grp) {\r\tvar name = grp.name;\r\tvar len = grp.pageItems.length;\r\tif (len === 0) {\r\t\tgrp.remove();\r\t\treturn;\r\t}\r\tfor (var i = 0; i < len; i++) {\r\t\tvar element = grp.pageItems[i];\r\t\tif (element.typename === 'GroupItem') {\r\t\t\t// The problem is that a block of text comes through as a GroupItem\r // So I need to check if this is a textblock\r\t\t\t// Set a flag (forced to false if empty group, which will recurse and get zapped)\r\t\t\tvar isText = (element.pageItems.length > 0);\r // I iterate through the group. If every child is a TextFrame, this is text...\r\t\t\tfor (var j = 0; j < element.pageItems.length; j++) {\r\t\t\t\tif (element.pageItems[j].typename !== 'TextFrame') {\r\t\t\t\t\tisText = false;\r\t\t\t\t\tbreak;\r\t\t\t\t}\r }\r\t\t\t// Did the group contain any only textframes?\r\t\t\tif (isText) {\r // All children are text, so treat as such\r\t\t\t\t// We need a new group, to append new text\r\t\t\t\t// NOTE: that's a to-come\r\t\t\t\talert('Set ***text*** attributes for ' + element.name);\r \t\t\tvar textFrame = setTextFrameAttributes(element);\r\t\t\t} else {\r // Whatever we've got, it isn't just text, or it's an empty group.\r\t\t\t\t// Recurse, anyway\r\t\t\t\talert('Recurse with group ' + element.name)\r\t\t\t\tprocessGroup(element);\r\t\t\t}\r\t\t} else {\r // Not a groupitem so ought to be a path...\r if (element.typename === 'PathItem') {\r alert('Processing path ' + element.name);\r setPathAttributes(element);\r } else {\r alert('Unknown element ' + element.name);\r }\r }\r\t}\r}", "title": "" }, { "docid": "cc139e6d5a9e7029c1795796a8a2e860", "score": "0.50507784", "text": "function createLayerFiles(file_input_path,layer_template) {\n fs.readFile(file_input_path, 'utf8', function (err, data) {\n if (err) throw err;\n mapfile = JSON.parse(data);\n //console.log(mapfile.layers[0].layer);\n\n var theLayers = mapfile.layers;\n\n for (layerID in theLayers) {\n myLayer = theLayers[layerID].layer;\n name = JSON.stringify(myLayer.layerName).replace(/['\"]/g, '');\n try {\n writeLayerFile(myLayer, name,layer_template );\n }\n catch (err) {\n throw \"Can not create the Layer files because \" + err;\n }\n }\n });\n}", "title": "" }, { "docid": "13b4ef9103dd6a765b93c798ef752ca0", "score": "0.50506496", "text": "function endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}", "title": "" }, { "docid": "13b4ef9103dd6a765b93c798ef752ca0", "score": "0.50506496", "text": "function endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}", "title": "" }, { "docid": "13b4ef9103dd6a765b93c798ef752ca0", "score": "0.50506496", "text": "function endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "9339ed7a2799c5dbd320789525d534da", "score": "0.5040777", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n}", "title": "" }, { "docid": "380f00865dd5f13cc8b6ed21dff899e7", "score": "0.5038136", "text": "function renderGroupImages(node) {\n var imageGroup = node.getAttribute('data-lightbox-group');\n var imageNodesInGroup = lightboxGroups[imageGroup];\n\n var groupImagesContainer = getImageGroupContainerNode();\n off('.' + GROUP_IMAGE_CONTAINER_CLASS,'click','.' + LIGHTBOX_GROUP_CLASS, handleImageGroupClick);\n groupImagesContainer.innerHTML = '';\n\n if(imageNodesInGroup.length < 2) { return; }\n\n for(var i = 0; i < imageNodesInGroup.length; i++) {\n var currentNode = imageNodesInGroup[i];\n var imgSource = currentNode.getAttribute('original-src');\n var description = currentNode.getAttribute('desc');\n var currentImageNode = createElementFromTemplate(groupImagesHTML, {\n imageGroupClassName: LIGHTBOX_GROUP_CLASS,\n src: imgSource,\n desc: description\n });\n \n if(imgSource === node.getAttribute('original-src')) {\n addClassToNode(currentImageNode,CURRENT_ACTIVE_IMAGE_IN_GROUP_CLASS);\n }\n\n // potentially a reflow concern but modern browsers batch appends well\n groupImagesContainer.appendChild(currentImageNode);\n }\n on('.' + GROUP_IMAGE_CONTAINER_CLASS,'click','.' + LIGHTBOX_GROUP_CLASS, handleImageGroupClick);\n }", "title": "" }, { "docid": "940e9056dbb798aaf2989534f9719e64", "score": "0.5033345", "text": "function exportTerrainLayer(layer, root, config) {\n var tileset = config.tilesets['tilesheet'],\n element = XML.Element({\n _attr: {\n name: layer.id,\n width: layer.size.width,\n height: layer.size.height\n }\n }),\n data = XML.Element({ \n });\n root.push({layer: element});\n element.push({data: data});\n \n for (var i = 0; i < layer.tiles.length; i++) {\n var tile = layer.tiles[i],\n info = (tile ? tileset.tiles[tile.tn] || {gid: 0} : {gid: 0});\n data.push({\n tile: {\n _attr: {\n gid: info.gid\n }\n }\n });\n }\n data.close();\n element.close();\n}", "title": "" }, { "docid": "615bf5d2a100474c831a8f9e22bcf386", "score": "0.5028219", "text": "function endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n }", "title": "" }, { "docid": "094e42fe46854927499c07b139314b16", "score": "0.5009036", "text": "function recurse(renderer, el, group) {\n el = el.lastChild;\n var prev, idx = 0;\n\n Object(_util_visit__WEBPACK_IMPORTED_MODULE_6__[\"visit\"])(group, function(item) {\n prev = renderer.draw(el, item, prev);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n Object(_util_dom__WEBPACK_IMPORTED_MODULE_3__[\"domClear\"])(el, 1 + idx);\n}", "title": "" }, { "docid": "33889818ebee8ffc0e49976c660f9e9e", "score": "0.5006177", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n {\n endOperation_R1(ops[i]);\n }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n {\n endOperation_W1(ops[i$1]);\n }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n {\n endOperation_R2(ops[i$2]);\n }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n {\n endOperation_W2(ops[i$3]);\n }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n {\n endOperation_finish(ops[i$4]);\n }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "0fd337f2a236e910e5914f55d09809cc", "score": "0.5004098", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }", "title": "" }, { "docid": "f4891731366093d331da7ac7e6c420fe", "score": "0.49948797", "text": "function recurse(renderer, el, group) {\n el = el.lastChild;\n var prev, idx = 0;\n\n Object(_util_visit__WEBPACK_IMPORTED_MODULE_5__[\"visit\"])(group, function(item) {\n prev = renderer.draw(el, item, prev);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n Object(_util_dom__WEBPACK_IMPORTED_MODULE_2__[\"domClear\"])(el, 1 + idx);\n}", "title": "" }, { "docid": "f4891731366093d331da7ac7e6c420fe", "score": "0.49948797", "text": "function recurse(renderer, el, group) {\n el = el.lastChild;\n var prev, idx = 0;\n\n Object(_util_visit__WEBPACK_IMPORTED_MODULE_5__[\"visit\"])(group, function(item) {\n prev = renderer.draw(el, item, prev);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n Object(_util_dom__WEBPACK_IMPORTED_MODULE_2__[\"domClear\"])(el, 1 + idx);\n}", "title": "" }, { "docid": "e44c4b69f80d4811e6c6d3e9b9a1b1f0", "score": "0.49844056", "text": "function iterate(grp)\r\n \t{\r\n \t\tgrp.children.forEach(function(childNode){\r\n \t\t if (childNode.type === \"GRP\")\r\n {\r\n \t\t\t iterate(childNode);\r\n }\r\n else\r\n {\r\n childNode.rotate(degs);\r\n }\r\n \t\t});\r\n \t}", "title": "" }, { "docid": "24814cd4a554b8024c94ae9e50f4ac1c", "score": "0.49788415", "text": "function closeGroup() {\n if (group) {\n var symbol = new SceneJS.Symbol({\n sid: group.name\n });\n var geometry = new SceneJS.Geometry({\n primitive: \"triangles\",\n positions: group.positions,\n normals: group.normals,\n indices: group.indices,\n uv: group.uv\n });\n if (group.materialName) {\n\n /* If group has material then, assuming that an MTL file has been loaded,\n * define geometry within an instance of the corresponding Material node\n * that will (should) have been defined (within a Symbol node) when the\n * MTL file was parsed.\n */\n symbol.addNode(\n new SceneJS.Instance({\n uri: \"../\" + group.materialName }, // Back up a level out of group's Name\n geometry));\n } else {\n symbol.addNode(geometry);\n }\n node.addNode(symbol);\n groupNames.push(group.name);\n }\n }", "title": "" }, { "docid": "1d39b87dde485c2979ff91fd8c655231", "score": "0.49727315", "text": "function endOperations(group) {\n\t var ops = group.ops\n\t for (var i = 0; i < ops.length; i++) // Read DOM\n\t { endOperation_R1(ops[i]) }\n\t for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n\t { endOperation_W1(ops[i$1]) }\n\t for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n\t { endOperation_R2(ops[i$2]) }\n\t for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n\t { endOperation_W2(ops[i$3]) }\n\t for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n\t { endOperation_finish(ops[i$4]) }\n\t}", "title": "" }, { "docid": "1d39b87dde485c2979ff91fd8c655231", "score": "0.49727315", "text": "function endOperations(group) {\n\t var ops = group.ops\n\t for (var i = 0; i < ops.length; i++) // Read DOM\n\t { endOperation_R1(ops[i]) }\n\t for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n\t { endOperation_W1(ops[i$1]) }\n\t for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n\t { endOperation_R2(ops[i$2]) }\n\t for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n\t { endOperation_W2(ops[i$3]) }\n\t for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n\t { endOperation_finish(ops[i$4]) }\n\t}", "title": "" }, { "docid": "aa21b0e512c7e06861e2dcfb448ae553", "score": "0.49674806", "text": "createPerspectiveGroup(fieldsToGroup, aggegateOptions, sortOptions) {\n const dataCopy = this.data.slice(0);\n\n const root = {\n level: 0,\n title: \"None\",\n items: dataCopy,\n isGroup: true\n };\n\n if (dataCopy != null && dataCopy.length !== 0) {\n this.groupRecursive(root, fieldsToGroup, aggegateOptions, sortOptions);\n }\n\n return root;\n }", "title": "" }, { "docid": "62d00eaa8c34bad494df65075bebf08c", "score": "0.49563268", "text": "function scan(canvas) {\n var lyrInfo = \"\";\n //var docPath = activeDocument.path;\n\n // Scan layer group inside the canvas\n for (var i = 0; i < canvas.layerSets.length; i++) {\n progress.update(10);\n var layer = canvas.layerSets[i];\n // Check if layer name ends with \"@\", which signifies for export layer\n if (layer.name.substr(-1) == \"@\") {\n progress.message(\"scanning layer: \" + layer.name);\n // Collect about-to-be-exported layer information\n lyrInfo += recordLayerInfo(layer);\n progress.update(20);\n // Prepare layer for possible trim and resize defined by the Shape layer within it\n progress.message(\"preparing layer: \" + layer.name);\n if (prepare(layer, false, true) == -1){\n // error occured\n continue;\n }\n progress.update(50);\n progress.message(\"exporting layer: \" + layer.name);\n saveLayer(layer.name);\n progress.update(100);\n $.sleep(200);\n } else if (layer.name.slice(-4) == \"_BTN\") {\n progress.message(\"scanning button: \" + layer.name);\n // current layer is a Button group\n // Collect about-to-be-exported layer information\n lyrInfo += recordLayerInfo(layer);\n progress.update(15);\n var regex = /(normal|hover|disabled|pressed|selected|clicked)/;\n // iterate every group inside _BTN group\n for (var k = 0; k < layer.layers.length; k++) {\n progress.message(\"scanning \" + layer.name + \" -> \" + layer.layers[k].name);\n if (layer.layers[k].name.match(regex) != null) {\n progress.update(20);\n // Prepare layer for possible trim and resize defined by the Shape layer within it\n progress.message(\"preparing \" + layer.name + \": \" + layer.layers[k].name);\n if (prepare(layer.layers[k], true, true) == -1 ) { continue; }\n progress.update(50);\n progress.message(\"exporting \" + layer.name + \": \" + layer.layers[k].name);\n saveLayer(layer.name + \".\" + layer.layers[k].name);\n }\n progress.update(100);\n $.sleep(200);\n }\n } else {\n // Recursive\n lyrInfo += scan(canvas.layerSets[i]);\n }\n }\n\n // Find art layers in current group whose name ends with \"@\"\n for (var j = 0; j < canvas.artLayers.length; j++) {\n progress.update(20);\n progress.message(\"scanning layer: \" + canvas.artLayers[j].name);\n if (canvas.artLayers[j].name.substr(-1) == \"@\") {\n lyrInfo += recordLayerInfo(layer);\n progress.update(30);\n progress.message(\"preparing layer: \" + canvas.artLayers[j].name);\n if (prepare(layer, false, false) == -1 ) { continue; }\n progress.update(60);\n progress.message(\"exporting layer: \" + canvas.artLayers[j].name);\n saveLayer(canvas.artLayers[j].name);\n }\n progress.update(100);\n progress.message(\"Complete\");\n $.sleep(200);\n }\n\n return lyrInfo;\n}", "title": "" }, { "docid": "a9a487f69bc1b8be2bd1f5f5e150b465", "score": "0.494288", "text": "function explorerTreeCollapseAll(group) {\n var li, lis = getElementsByClass('li','xT' + group + '-o');\n for (var lii = 0; lii < lis.length; lii++) {\n li = lis[lii];\n if (li.nodeName.toLowerCase() == 'li') _explorerTreeClose(li, group);\n }\n}", "title": "" }, { "docid": "b26f93aec9e23857d17f031e5b68387f", "score": "0.4931748", "text": "function exportSelected() {\n if (!outFolder.exists) outFolder.create();\n var savedState = app.activeDocument.activeHistoryState;\n\n // Stores saved layer info: name, coordinates, width and height\n var lyrInfo = \"\";\n\n // Define pixels as unit of measurement\n var defaultRulerUnits = preferences.rulerUnits;\n preferences.rulerUnits = Units.PIXELS;\n\n var selectLayers = getSelectedLayersId();\n if (selectLayers == null || selectLayers.length == 0) {\n alert(\"NO_LAYER_SELECTED\");\n return;\n }\n\n lyrInfo += scanLayersList(selectLayers);\n\n // Resumes back to original ruler units\n preferences.rulerUnits = defaultRulerUnits;\n // Writes stored layer info into single file\n if (saveLyrInfo && lyrInfo != \"\") {\n writeFile(\"ASSET NAME, COORDINATE, WIDTH, HEIGHT\\n\" + lyrInfo, originPath + \"/out/\");\n }\n\n app.activeDocument.activeHistoryState = savedState;\n}", "title": "" }, { "docid": "81548d567ecbf4aab90b41cfdfbb021b", "score": "0.49256247", "text": "function endOperations(group) {\n\t\t var ops = group.ops\n\t\t for (var i = 0; i < ops.length; i++) // Read DOM\n\t\t { endOperation_R1(ops[i]) }\n\t\t for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n\t\t { endOperation_W1(ops[i$1]) }\n\t\t for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n\t\t { endOperation_R2(ops[i$2]) }\n\t\t for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n\t\t { endOperation_W2(ops[i$3]) }\n\t\t for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n\t\t { endOperation_finish(ops[i$4]) }\n\t\t}", "title": "" }, { "docid": "f249ff7d93b3b7087bd4bd3225cb7603", "score": "0.49011457", "text": "function myExportAllStories(myExportFormat, myFolder){\n\tfor(myCounter = 0; myCounter < app.activeDocument.stories.length; myCounter++){\n\t\tmyStory = app.activeDocument.stories.item(myCounter);\n\t\tmyID = myStory.id;\n\t\tswitch(myExportFormat){\n\t\t\tcase 0:\n\t\t\t\tmyFormat = ExportFormat.textType;\n\t\t\t\tmyExtension = \".txt\"\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tmyFormat = ExportFormat.RTF;\n\t\t\t\tmyExtension = \".rtf\"\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tmyFormat = ExportFormat.taggedText;\n\t\t\t\tmyExtension = \".txt\"\n\t\t\t\tbreak;\n\t\t}\n\t\tmyFileName = \"StoryID\" + myID + myExtension;\n\t\tmyFilePath = myFolder + \"/\" + myFileName;\n\t\tmyFile = new File(myFilePath);\n\t\tmyStory.exportFile(myFormat, myFile);\n\t}\n}", "title": "" }, { "docid": "b570357be8ea1f29807c6ea101175ba9", "score": "0.48944673", "text": "function recurse(renderer,el,group){el=el.lastChild;var prev,idx=0;visit(group,function(item){prev=renderer.draw(el,item,prev);++idx;});// remove any extraneous DOM elements\ndomClear(el,1+idx);}// Bind a scenegraph item to an SVG DOM element.", "title": "" }, { "docid": "6e631a7a280d028856342e11e2e57bf2", "score": "0.48783004", "text": "function parseGroupPaths(group){\n\n\tlet $ = cheerio.load(group)\n\tvar paths = _.reduce($('path'), function (items, path) {\n\t\t\n\t\tlet pathArr = parse($(path).attr('d'))\n\t\tlet formattedArr = formatPathArr(pathArr)\n\t\t\n\t\titems.push(formatPathArr(pathArr))\n\t\treturn items\n\t}, [])\t\n\n\treturn paths\n\t\t\n}", "title": "" }, { "docid": "c687f3975ea82130d42655f0bbdbeb8e", "score": "0.48701954", "text": "function hashGroup(i) {\n if(i === groupHashes.length) {\n // done, return SHA-1 digest and path namer\n return callback(null, {hash: md.digest(), pathNamer: pathNamer});\n }\n\n // digest group hash\n var groupHash = groupHashes[i];\n md.update(groupHash);\n\n // choose a path and namer from the permutations\n var chosenPath = null;\n var chosenNamer = null;\n var permutator = new Permutator(groups[groupHash]);\n jsonld.setImmediate(function() {permutate();});\n function permutate() {\n var permutation = permutator.next();\n var pathNamerCopy = pathNamer.clone();\n\n // build adjacent path\n var path = '';\n var recurse = [];\n for(var n in permutation) {\n var bnode = permutation[n];\n\n // use canonical name if available\n if(namer.isNamed(bnode)) {\n path += namer.getName(bnode);\n } else {\n // recurse if bnode isn't named in the path yet\n if(!pathNamerCopy.isNamed(bnode)) {\n recurse.push(bnode);\n }\n path += pathNamerCopy.getName(bnode);\n }\n\n // skip permutation if path is already >= chosen path\n if(chosenPath !== null && path.length >= chosenPath.length &&\n path > chosenPath) {\n return nextPermutation(true);\n }\n }\n\n // does the next recursion\n nextRecursion(0);\n function nextRecursion(n) {\n if(n === recurse.length) {\n // done, do next permutation\n return nextPermutation(false);\n }\n\n // do recursion\n var bnode = recurse[n];\n _hashPaths(bnode, bnodes, namer, pathNamerCopy,\n function(err, result) {\n if(err) {\n return callback(err);\n }\n path += pathNamerCopy.getName(bnode) + '<' + result.hash + '>';\n pathNamerCopy = result.pathNamer;\n\n // skip permutation if path is already >= chosen path\n if(chosenPath !== null && path.length >= chosenPath.length &&\n path > chosenPath) {\n return nextPermutation(true);\n }\n\n // do next recursion\n nextRecursion(n + 1);\n });\n }\n\n // stores the results of this permutation and runs the next\n function nextPermutation(skipped) {\n if(!skipped && (chosenPath === null || path < chosenPath)) {\n chosenPath = path;\n chosenNamer = pathNamerCopy;\n }\n\n // do next permutation\n if(permutator.hasNext()) {\n jsonld.setImmediate(function() {permutate();});\n } else {\n // digest chosen path and update namer\n md.update(chosenPath);\n pathNamer = chosenNamer;\n\n // hash the next group\n hashGroup(i + 1);\n }\n }\n }\n }", "title": "" }, { "docid": "b24416d4a35c334c73a00e08158d8db1", "score": "0.4862805", "text": "function HandleLayerPlacement(targetArray)\n {\n for (var n = 0; n < targetArray.length; n++)\n {\n //If the layer is in a clipping mask, release the clipping mask before merging down, then push the layer to an array to re-clip later\n if (targetArray[n].grouped)\n {\n doc.activeLayer = targetArray[n];\n \n ReleaseClippingMask();\n \n var layer = adj_layer.duplicate(targetArray[n], ElementPlacement.PLACEBEFORE);\n \n doc.activeLayer = layer; \n\n executeAction(stringIDToTypeID(\"mergeLayersNew\"), undefined, DialogModes.NO);\n \n clippingArray.push(targetArray[n]);\n }\n else\n {\n var layer = adj_layer.duplicate(targetArray[n], ElementPlacement.PLACEBEFORE);\n \n doc.activeLayer = layer; \n\n executeAction(stringIDToTypeID(\"mergeLayersNew\"), undefined, DialogModes.NO);\n } \n \n continue;\n }\n\n // Iterate backwards (bottom-to-top in Photoshop layers) and remake clipping masks\n if (clippingArray.length > 0)\n {\n for (var n = clippingArray.length - 1; n >= 0; n--)\n {\n doc.activeLayer = clippingArray[n];\n MakeClippingMask();\n continue;\n }\n }\n\n alert( \"All Done!\" );\n }", "title": "" }, { "docid": "9f74586bda10b81eaec03421aa668f73", "score": "0.4859536", "text": "function visitLayers(layerSet, callback) {\r\n var result;\r\n for (var index = 0; index < layerSet.length; index++) {\r\n var layer = layerSet[index];\r\n var callResult = callback(layer);\r\n if (callResult) {\r\n result = callResult;\r\n }\r\n if (layer.layers) {\r\n callResult = visitLayers(layer.layers, callback);\r\n if (callResult) {\r\n result = callResult;\r\n }\r\n }\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "8994338e0e355f62012f524bc1ff1602", "score": "0.4842964", "text": "function writeTree(tree, basePath, extension) {\n for (const [resourceName, data] of tree.entries()) {\n if (data instanceof Map) {\n writeTree(data, path_1.join(basePath, resourceName), extension);\n }\n else {\n // All elements that are not Maps are tree leaves\n writeDataFile(path_1.join(basePath, resourceName + extension), data);\n }\n }\n}", "title": "" }, { "docid": "ef8c7d802de326889a8d4094451af78a", "score": "0.48348394", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "037f2fd75d762d43caf3cde1f11beb5c", "score": "0.48288158", "text": "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "title": "" }, { "docid": "794715bcb0aa1ae82961be497db7629f", "score": "0.4828725", "text": "function copyMaskedLayerAsGroup(lyr, mask) {\n var maskBounds = mask.mask.geometricBounds;\n var newMask, newGroup;\n if (!testBoundsIntersection(artboardBounds, maskBounds)) {\n return;\n }\n newGroup = doc.groupItems.add();\n newGroup.move(destGroup, ElementPlacement.PLACEATEND);\n forEach(mask.items, function(item) {\n copyPageItem(item, newGroup);\n });\n if (newGroup.pageItems.length > 0) {\n // newMask = duplicateItem(mask.mask, destGroup);\n // TODO: refactor\n newMask = mask.mask.duplicate(destGroup, ElementPlacement.PLACEATEND);\n newMask.moveToBeginning(newGroup);\n newGroup.clipped = true;\n } else {\n newGroup.remove();\n }\n }", "title": "" }, { "docid": "b52923cd52bce0f84874f3307352e5a4", "score": "0.48257723", "text": "function LayerGroup(dataset) {\nvar _el = El('canvas'),\n _canvas = _el.node(),\n _ctx = _canvas.getContext('2d'),\n _lyr, _filteredArcs, _bounds;\n\nif (dataset) {\n_filteredArcs = dataset.arcs ? new FilteredArcCollection(dataset.arcs) : null;\n}\n\nthis.hide = function() {\n_el.hide();\n};\n\nthis.showLayer = function(lyr) {\n_lyr = lyr;\n_bounds = getDisplayBounds(lyr, dataset);\n};\n\nthis.getLayer = function() {\nreturn _lyr;\n};\n\nthis.getElement = function() {\nreturn El(_canvas);\n};\n\nthis.getBounds = function() {\nreturn _bounds;\n};\n\nthis.getDataset = function() {\nreturn dataset;\n};\n\nthis.getArcs = function() {\nreturn _filteredArcs;\n};\n\nthis.setArcs = function(arcs) {\n_filteredArcs = arcs;\n};\n\n// Rebuild filtered arcs\nthis.updated = function() {\nif (dataset && _filteredArcs) {\n _filteredArcs.update(dataset.arcs);\n}\n};\n\nthis.setRetainedPct = function(pct) {\n_filteredArcs.setRetainedPct(pct);\nreturn this;\n};\n\nthis.drawStructure = function(lyr, style, ext) {\nupdateCanvas(ext);\n_el.show();\nif (_filteredArcs) {\n drawArcs(style, style.arcFlags, ext);\n}\nif (lyr.geometry_type == 'point') {\n drawPoints(lyr.shapes, style, ext);\n}\n};\n\nthis.drawShapes = function(lyr, style, ext) {\nvar type = lyr.geometry_type;\n updateCanvas(ext);\n_el.show();\nif (type == 'point') {\n drawPoints(lyr.shapes, style, ext);\n} else {\n drawPathShapes(lyr.shapes, style, ext);\n}\n};\n\nthis.remove = function() {\nthis.getElement().remove();\n};\n\nfunction getDisplayBounds(lyr, dataset) {\nvar arcBounds = dataset && dataset.arcs ? dataset.arcs.getBounds() : null,\n bounds;\nif (lyr.geometry_type == 'point') {\n bounds = MapShaper.getLayerBounds(lyr);\n if (!bounds || bounds.area() > 0 === false) {\n // if a point layer has no extent (e.g. contains only a single point),\n // then use arc bounds, to match any path layers in the dataset.\n bounds = arcBounds;\n }\n} else {\n bounds = arcBounds || new Bounds();\n}\nreturn bounds;\n}\n\nfunction drawPathShapes(shapes, style, ext) {\nvar arcs = _filteredArcs.getArcCollection(ext),\n start = getPathStart(style),\n draw = getShapePencil(arcs, ext),\n end = getPathEnd(style);\nfor (var i=0, n=shapes.length; i<n; i++) {\n start(_ctx);\n draw(shapes[i], _ctx);\n end(_ctx);\n}\n}\n\nfunction drawArcs(style, flags, ext) {\nvar arcs = _filteredArcs.getArcCollection(ext),\n darkStyle = {strokeWidth: style.strokeWidth, strokeColor: style.strokeColors[1]},\n lightStyle = {strokeWidth: style.strokeWidth, strokeColor: style.strokeColors[0]};\nsetArcVisibility(flags, arcs, ext);\ndrawFlaggedArcs(2, flags, lightStyle, arcs, ext);\ndrawFlaggedArcs(3, flags, darkStyle, arcs, ext);\n}\n\nfunction setArcVisibility(flags, arcs, ext) {\nvar minPathLen = 0.5 * ext.getPixelSize(),\n geoBounds = ext.getBounds(),\n geoBBox = geoBounds.toArray(),\n allIn = geoBounds.contains(arcs.getBounds()),\n visible;\n// don't continue dropping paths if user zooms out farther than full extent\nif (ext.scale() < 1) minPathLen *= ext.scale();\nfor (var i=0, n=arcs.size(); i<n; i++) {\n visible = !arcs.arcIsSmaller(i, minPathLen) && (allIn ||\n arcs.arcIntersectsBBox(i, geoBBox));\n // mark visible arcs by setting second flag bit to 1\n flags[i] = (flags[i] & 1) | (visible ? 2 : 0);\n}\n}\n\nfunction drawFlaggedArcs(flag, flags, style, arcs, ext) {\nvar start = getPathStart(style),\n end = getPathEnd(style),\n t = getScaledTransform(ext),\n ctx = _ctx,\n n = 25, // render paths in batches of this size (an optimization)\n count = 0;\nstart(ctx);\nfor (i=0, n=arcs.size(); i<n; i++) {\n if (flags[i] != flag) continue;\n if (++count % n === 0) {\n end(ctx);\n start(ctx);\n }\n drawPath(arcs.getArcIter(i), t, ctx);\n}\nend(ctx);\n}\n\nfunction drawPoints(shapes, style, ext) {\nvar t = getScaledTransform(ext),\n size = (style.dotSize || 3) * gui.getPixelRatio(),\n drawPoint = style.roundDot ? drawCircle : drawSquare,\n shp, p;\n\n// TODO: don't try to draw offscreen points\n_ctx.fillStyle = style.dotColor || \"black\";\nfor (var i=0, n=shapes.length; i<n; i++) {\n shp = shapes[i];\n for (var j=0, m=shp ? shp.length : 0; j<m; j++) {\n p = shp[j];\n drawPoint(p[0] * t.mx + t.bx, p[1] * t.my + t.by, size, _ctx);\n }\n}\n}\n\nfunction clearCanvas() {\n_ctx.clearRect(0, 0, _canvas.width, _canvas.height);\n}\n\nfunction updateCanvas(ext) {\nvar w = ext.width(),\n h = ext.height(),\n pixRatio = gui.getPixelRatio();\nclearCanvas();\n_canvas.width = w * pixRatio;\n_canvas.height = h * pixRatio;\n_el.classed('retina', pixRatio == 2);\n}\n}", "title": "" }, { "docid": "c77ea9f167ad0306a7797b3a0f00f0fb", "score": "0.47959223", "text": "processGroup(group) {\n //console.log(` - processGroup(${group ? group.id : undefined})`);\n this.appendNavigationGroup(group);\n }", "title": "" }, { "docid": "4d2e745537f224828eb191b76f183ca0", "score": "0.4770825", "text": "function exportJSON(layer, file_path){\n\n // initialize the layer array\n var layerArray = [];\n\n // create the variables\n var layerName = String(layer.name());\n var layerFrame = layer.absoluteRect();\n var layerXpos = String(layerFrame.x());\n var layerYpos = String(layerFrame.y());\n var layerHeight = String(layerFrame.height());\n var layerWidth = String(layerFrame.width());\n\n // add the strings to the array\n layerArray.push({\n name: layerName,\n xPos: layerXpos,\n yPos: layerYpos,\n height: layerHeight,\n width: layerWidth,\n });\n \n // Create the JSON object from the layer array\n var jsonObj = { \"layer\": layerArray };\n // Convert the object to a json string\n var file = NSString.stringWithString(JSON.stringify(jsonObj, null, \"\\t\"));\n // Save the file\n [file writeToFile:file_path+layerName+\".json\" atomically:true encoding:NSUTF8StringEncoding error:null];\n\n var alertMessage = layerName+\".json saved to: \" + file_path;\n alert(\"Layer JSON Exported!\", alertMessage);\n}", "title": "" }, { "docid": "b161b15320de3b5e0d1806d52b95510a", "score": "0.4755483", "text": "exportLayersAsImageData ()\n {\n this.dataCanvases = [];\n\n let height = this.pixelInstance.core.publicInstance.getPageDimensionsAtZoomLevel(this.pageIndex, this.zoomLevel).height,\n width = this.pixelInstance.core.publicInstance.getPageDimensionsAtZoomLevel(this.pageIndex, this.zoomLevel).width;\n\n let progressCanvas = this.uiManager.createExportElements(this).progressCanvas;\n\n // The idea here is to draw each layer on a canvas and scan the pixels of that canvas to fill the matrix\n this.layers.forEach ((layer) => {\n let layerCanvas = document.createElement('canvas');\n layerCanvas.setAttribute(\"class\", \"export-page-canvas\");\n layerCanvas.setAttribute(\"id\", \"layer-\" + layer.layerId + \"-export-canvas\");\n layerCanvas.setAttribute(\"style\", \"position: absolute; top: 0; left: 0;\");\n layerCanvas.width = width;\n layerCanvas.height = height;\n\n layer.drawLayerInPageCoords(this.zoomLevel, layerCanvas, this.pageIndex);\n\n let pngCanvas = document.createElement('canvas');\n pngCanvas.setAttribute(\"class\", \"export-page-data-canvas\");\n pngCanvas.setAttribute(\"id\", \"layer-\" + layer.layerId + \"-export-canvas\");\n pngCanvas.setAttribute(\"value\", layer.layerName);\n pngCanvas.setAttribute(\"style\", \"position: absolute; top: 0; left: 0;\");\n pngCanvas.width = width;\n pngCanvas.height = height;\n\n this.dataCanvases.push(pngCanvas);\n this.getImageData(this.pixelInstance.core.getSettings().renderer._canvas, pngCanvas, this.pageIndex, layerCanvas, progressCanvas);\n });\n }", "title": "" }, { "docid": "7c35e73feca90112601b20086b35a853", "score": "0.47553524", "text": "function iterate(task, grp)\n \t{\n \t var i, childNode;\n \t\tfor (i=0; i<grp.children.length; i++)\n \t\t{\n childNode = grp.children[i];\n task(childNode);\n \t\t\tif ((childNode.children !== undefined) && (childNode.children.length > 0))\n {\n \t\t\t\titerate(task, childNode);\n }\n \t\t}\n \t}", "title": "" }, { "docid": "ea48f8c9fc7ca0c7957d41d2c75ddcb3", "score": "0.47535226", "text": "addGroupedRecords(arr, groups) {\n if (Array.isArray(groups)) {\n groups.forEach(child => {\n if (child.children) {\n this.addGroupedRecords(arr, child.children);\n } else {\n arr.push(child);\n }\n });\n }\n }", "title": "" }, { "docid": "1613cf3e1ad2bb1731a4b714449afef3", "score": "0.4750454", "text": "function iterate(task, grp)\n \t{\n \t var i, childNode;\n \t\tfor(i=0; i<grp.children.length; i++)\n \t\t{\n childNode = grp.children[i];\n task(childNode);\n \t\t\tif ((childNode.children !== undefined) && (childNode.children.length > 0))\n {\n \t\t\t\titerate(task, childNode);\n }\n \t\t}\n \t}", "title": "" }, { "docid": "61f3efec21b9c55b5a484753a6b1608c", "score": "0.47425216", "text": "function loopLayers(layers, callback) {\n\n for (var i = 0; i < [layers count]; i++) {\n\n var layer = [layers objectAtIndex: i];\n\n // Group\n if ([layer isMemberOfClass: [MSLayerGroup class]]) {\n callback(layer);\n loopLayers([layer layers], callback);\n }\n // Layer\n else {\n callback(layer);\n if ([layer isMemberOfClass: [MSTextLayer class]]) {\n layer.setName(layer.stringValue());\n layer.setNameIsFixed(false);\n }\n\n }\n\n }\n }", "title": "" } ]
c37f1a251ba1687aebf3c28dd4967d4c
Check email address validity
[ { "docid": "1aee9c9bf039584099708fc37b82caad", "score": "0.0", "text": "function CheckEmail(email) {\r\n\t\tif (email.search(/^[a-z0-9\\'\\-_]+[a-z\\'0-9\\-_.]*@[a-z0-9\\-_]+[a-z0-9\\-_.]*\\.[a-z]{2,4}$/i) == -1) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "title": "" } ]
[ { "docid": "d288a16f3f10ef481bbfc308e3db349d", "score": "0.81051445", "text": "function validateEmail(email){}", "title": "" }, { "docid": "50acda036cdc8b0f8fb880370629214f", "score": "0.80743414", "text": "function validateEmail(address) {\n\tvar filter = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n\treturn filter.test(address);\n}", "title": "" }, { "docid": "e4a07e78a6f6162c65a546a63af1d315", "score": "0.8069123", "text": "function check_email(address){\n\tvar isValid = true;\n\tvar mailFilter = /^(([^<>()[\\]\\\\.,;:\\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\tif(!(mailFilter.test(address)))\n\t{\n\t\tisValid = false;\n\t}\n\tif(!isValid)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "06a222d470740c3ba1595533f38468e6", "score": "0.80301565", "text": "function valid_email_address(email) {\n var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n return pattern.test(email);\n }", "title": "" }, { "docid": "cdb05143d95997b345274371a1af4628", "score": "0.8020848", "text": "function validEmail(address) {\n var regex = /^[a-zA-Z0-9\\.!#$%&'\\*+-\\/=?\\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)+$/\n return regex.test(address);\n}", "title": "" }, { "docid": "f62c3b09098637c2eef02595271b25f8", "score": "0.7982992", "text": "function valid_email_address(email) {\n var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n return pattern.test(email);\n }", "title": "" }, { "docid": "c29850394a897b4608b84a4c08d58a65", "score": "0.7886847", "text": "function isEmailStringValid(){\n\treturn true;\n}", "title": "" }, { "docid": "fc8ec16f8d9289b9ef1bc448270114c4", "score": "0.7880644", "text": "function checkemail(emailaddress){\n\t\"use strict\";\n\tvar pattern = new RegExp(/^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i); \n\treturn pattern.test(emailaddress); \n}", "title": "" }, { "docid": "e2846dd601972469de24c160b20b10ef", "score": "0.78511506", "text": "function checkEmail(value) {\n var email_input = cleanWhitespace(value);\n // Ensure there is an @ in between characters\n return validate(email_input, /^[^@\\s]+@[^@\\s]+$/g);\n}", "title": "" }, { "docid": "8afacde0696a3b741d7d2da023123e01", "score": "0.7842936", "text": "isValidEmail(email){\n // expecting a string\n if(typeof email !== 'string'){\n throw new Error('Expecting a string as an email');\n }\n\n // check email's format\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(email))\n return (true);\n\n return false;\n }", "title": "" }, { "docid": "8e04ee93b2cf01baaee1de1aa6dc86f5", "score": "0.78356403", "text": "function validateEmail(email)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email); \n}", "title": "" }, { "docid": "3c608a4acb87712746f3201fe4c9c1d8", "score": "0.7834406", "text": "function validateEmail(email) \n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "d62bf00d2ab5a55f32ebec73d5841111", "score": "0.7832572", "text": "function validateEmail(email){\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "5b13a241cd81d8f907ea3d3d464bdbd8", "score": "0.7815114", "text": "function validateEmail(email) {\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "title": "" }, { "docid": "5e3e469974dc0408bea27d1d768c1760", "score": "0.7810134", "text": "function validateEmail() {\n var x = v3.value;\n var atpos = x.indexOf(\"@\");\n var dotpos = x.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {\n window.alert(\"Not a valid e-mail address!\");\n return true;\n }\n}", "title": "" }, { "docid": "8c91b29bfaf77cf07b95f2b21a99fe1d", "score": "0.7790942", "text": "function validateEmail(email) {\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "title": "" }, { "docid": "1bbd38e42af007128bd364d327cd0a44", "score": "0.7755564", "text": "function checkEmail(input) {\n\tconst re = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/\n\tif (input.value.length < 7) {\n\t\tdisplayError(input, `${fieldName(input)} must be at least 7 characters`);\n\t} else if (input.value.length > 254) {\n\t\tdisplayError(input, `${fieldName(input)} must be less than 254 characters`);\n\t} else {\n\t\tif(re.test(input.value.trim())) {\n\t\t\tdisplaySuccess(input);\n\t\t} else {\n\t\t\tdisplayError(input, \"Email is not valid\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ae4c7ebb1dd87a3640bc0fad6b42e95c", "score": "0.77553093", "text": "validEmail(input) {\n if (validEmail.test(input)) return true;\n else return false;\n }", "title": "" }, { "docid": "033721d97fbf73d941557324af20a83a", "score": "0.77537197", "text": "function validateEmail(email)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "067db244eb962f0018a80ebcefd760b9", "score": "0.7743105", "text": "function validateEmail(email) {\n var re = /\\S+@\\S+.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "9b5351c9f257c4dda063eef1d465fc75", "score": "0.77285653", "text": "function emailValido(email) {\n\n var regex = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i;\n\n if (!regex.test(email)) {\n return false;\n\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "55c396a667e8bfe3f0178cc76d119405", "score": "0.7722538", "text": "isValidEmailAddress( email ){\r\n var pattern = new RegExp(\"^[a-zA-Z0-9\\\\-_]+(\\\\.[a-zA-Z0-9\\\\-_]+)*@[a-z0-9]+(\\\\-[a-z0-9]+)*(\\\\.[a-z0-9]+(\\\\-[a-z0-9]+)*)*\\\\.[a-z]{2,4}$\")\r\n if (pattern.test(email)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "title": "" }, { "docid": "42aa234a20887bcf2ecb6bbfc886d62d", "score": "0.7721834", "text": "function validateEmailAddress() {\n var email = $.email.getValue().trim();\n if (email_regex.test(email)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "4e75e658ea97a4dacbda8f6359438870", "score": "0.77194095", "text": "function check_email(val){\n if(!val.match(/\\S+@\\S+\\.\\S+/)){ \n return false;\n }\n if( val.indexOf(' ')!=-1 || val.indexOf('..')!=-1){\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "fc38e74ebeab76c15f19ad42fa618e96", "score": "0.77146864", "text": "function checkEmail() {\r\n const email = document.querySelector(\"input[name='email']\");\r\n\r\n // Checks if email is valid when an email address was entered\r\n if (email.value != \"\") {\r\n if (email.value.trim().length == 0) { // trim() not needed since pattern doesn't have spaces affect the length of characters very much\r\n alert(\"An email cannot be just spaces\");\r\n errCtr++;\r\n } else {\r\n if (email.validity.tooLong) {\r\n alert(\"Email is too long, it shouldn't exceed 30 characters\");\r\n errCtr++;\r\n } else if (email.validity.tooShort) {\r\n alert(\"Email is too short, it shouldn't be below 9 characters\");\r\n errCtr++;\r\n } else if (email.validity.patternMismatch) {\r\n alert(\"Email is in the wrong format, it should look something like this: example@gmail.com\");\r\n errCtr++;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1dc9040548694f1cc909002f42bfe507", "score": "0.77146584", "text": "function checkEmail(value){\n\tvar errors=false;\n var emailExp = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n var ArEmailExp = /[\\u0600-\\u06FF\\u0750-\\u077F]/;\n if(value.match(emailExp) && !value.match(ArEmailExp)){\n errors = true;\n }else{\n errors = false;\n // eMassage = mailMassage;\n }\n\treturn errors;\n // handleErrors('regEmail');\n}", "title": "" }, { "docid": "a07438931ff5619d50ec5b11fb716646", "score": "0.77095103", "text": "function isValidEmail(email){\n if(typeof(email) !== 'string'){\n return false;\n }\n var at = email.lastIndexOf('@');\n \n // Make sure the at (@) sybmol exists and \n // it is not the first or last character\n if(at < 1 || (at + 1) === email.length){\n return false;\n }\n \n // Make sure there aren't multiple periods together\n if(/(\\.{2,})/.test(email)){\n return false;\n }\n \n // Break up the local and domain portions\n var local = email.substring(0, at);\n var domain = email.substring(at + 1);\n \n // Check lengths\n if(local.length < 1 || local.length > 64 || domain.length < 4 || domain.length > 255){\n return false;\n }\n \n // Make sure local and domain don't start with or end with a period\n if(/(^\\.|\\.$)/.test(local) || /(^\\.|\\.$)/.test(domain)){\n return false;\n }\n \n // Check for quoted-string addresses\n // Since almost anything is allowed in a quoted-string address,\n // we're just going to let them go through\n if(!/^\"(.+)\"$/.test(local)){\n // It's a dot-string address...check for valid characters\n if(!/^[\\-a-zA-Z0-9!#$%*\\/?|\\^{}`~&'+=_\\.]*$/.test(local)){\n return false;\n }\n }\n \n // Make sure domain contains only valid characters and at least one period\n if(!/^[\\-a-zA-Z0-9\\.]*$/.test(domain) || domain.indexOf(\".\") === -1){\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "5cd38e28bb20366b8d7f7b28b616c22e", "score": "0.7706203", "text": "function EmailIsValid(email) {\n //var regExp = /.+@.+\\..+/;\n var regExp = /^([a-z0-9_-]+\\.)*[a-z0-9_-]+@[a-z0-9_-]+(\\.[a-z0-9_-]+)*\\.[a-z]{2,6}$/;\n return regExp.test(email);\n}", "title": "" }, { "docid": "2a899d71e41f760cfebc476a0301ed38", "score": "0.7686961", "text": "function valida_email(e) {\r\n\ter_email = /^[\\w-]+(\\.[\\w-]+)*@(([\\w-]{2,63}\\.)+[A-Za-z]{2,6}|\\[\\d{1,3}(\\.\\d{1,3}){3}\\])$/;\r\n\treturn er_email.test(e);\r\n}", "title": "" }, { "docid": "b382685efb6cb8a6a824ce067a205e7f", "score": "0.7672266", "text": "function validEmail(email) {\n\tvar re = /\\S+@\\S+\\.\\S+/;\n\treturn re.test(email);\n}", "title": "" }, { "docid": "8581a4343e19d27da5e9994e3754d5bf", "score": "0.76681775", "text": "function Emailvalidation(email) {\n valid = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)\n if (valid) {\n return true;\n } else {\n console.log(\". Pls provide a valid email\")\n return false;\n }\n}", "title": "" }, { "docid": "3552cdfd4506437cee60c04afad86afd", "score": "0.7660533", "text": "function validateEmail(email){ \n if(email.match(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/)) \n return true;\n else\n return false;\n }", "title": "" }, { "docid": "302a8fed868f8ddec47c4e5b83dd41af", "score": "0.7659296", "text": "function checkEmail(input) {\r\n const regExEmail = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\r\n\r\n //if (regular expression representing a valid email, then true else false)\r\n if (regExEmail.test(input.value.trim())) {\r\n showSuccess(input);\r\n } else {\r\n showError(input, 'enter valid email-id');\r\n }\r\n}", "title": "" }, { "docid": "3b2b44a17ef4c56a8794bbf32e803b02", "score": "0.7652685", "text": "function validEmail(email) \n{\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email))\n {\n return (true)\n }\n return (false)\n}", "title": "" }, { "docid": "811934bd263f5daa83cd3c1873a60e84", "score": "0.76468647", "text": "function checkEmail(v_email)\n{\n\tvar l_ret=true;\n\tvar l_reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/;\n\tif (l_reg.exec(v_email)==null){l_ret=false;}\n\treturn l_ret;\n}", "title": "" }, { "docid": "e4930069a160ee635d88a42fc41ea9dc", "score": "0.76454926", "text": "function checkEmail () {\n\t\tvar email = document.getElementById( 'email' ).value;\n\t\tvar ok = /^[0-9a-zA-Z]+([._]?[0-9a-zA-Z])*@[0-9a-zA-Z]+([._-]?[0-9a-zA-Z])*[.]{1}[0-9a-zA-Z]{2,3}$/.test( email );\n\t\tif ( !ok ) {\n\t\t\tsetMessage( 'email', 'eEmail', errorMessages.emailIncorrecto, 'invalid' );\n\t\t} else {\n\t\t\tclearMessage( 'email', 'eEmail' );\n\t\t}\n\t\treturn ok;\n\t}", "title": "" }, { "docid": "73c44f24810b3e4c3123bbe930efcd21", "score": "0.762845", "text": "function validateEmail() {\n var e = /^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+)*\\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/; //This is a regular expression for email\n if(e.test(userEmailVal)) {\n }\n else {\n }\n }", "title": "" }, { "docid": "666a565021236d5fe5dc4183a26ac0ba", "score": "0.7627024", "text": "function checkEmail(email) {\n\tvar character = /@/;\n\tif(email.match(character)) return true;\n\telse return false;\n}", "title": "" }, { "docid": "6f3106ec9d65bbd043d664347188bab4", "score": "0.76256555", "text": "function checkCharactersEmailAddress (emailAddress) {\n\n characterTest = /^[\\w!#$%&\\'*+\\-\\/=?^`{|}~]+(\\.[\\w!#$%&\\'*+\\-\\/=?^`{|}~]+)*@[a-z\\d]([a-z\\d-]*[a-z\\d])?(\\.[a-z\\d]([a-z\\d-]*[a-z\\d])?)*\\.[a-z]{2,6}$/i\n\n lengthTest = /^(.{1,64})@(.{4,255})$/\n\n if (characterTest.test(emailAddress) && lengthTest.test(emailAddress)) {\n\n \treturn true\n\n } else {\n\n \treturn false\n\n }\n}", "title": "" }, { "docid": "e83438fe28cf1723744e43212577b7ee", "score": "0.76254517", "text": "function validateEmail(addr,man,db) {\nif (addr == '' && man) {\n if (db) alert('email address is mandatory');\n return false;\n}\nif (addr == '') return true;\nvar invalidChars = '\\/\\'\\\\ \";:?!()[]\\{\\}^|';\nfor (i=0; i<invalidChars.length; i++) {\n if (addr.indexOf(invalidChars.charAt(i),0) > -1) {\n if (db) alert('email address contains invalid characters');\n return false;\n }\n}\nfor (i=0; i<addr.length; i++) {\n if (addr.charCodeAt(i)>127) {\n if (db) alert(\"email address contains non ascii characters.\");\n return false;\n }\n}\n\nvar atPos = addr.indexOf('@',0);\nif (atPos == -1) {\n if (db) alert('email address must contain an @');\n return false;\n}\nif (atPos == 0) {\n if (db) alert('email address must not start with @');\n return false;\n}\nif (addr.indexOf('@', atPos + 1) > - 1) {\n if (db) alert('email address must contain only one @');\n return false;\n}\nif (addr.indexOf('.', atPos) == -1) {\n if (db) alert('email address must contain a period in the domain name');\n return false;\n}\nif (addr.indexOf('@.',0) != -1) {\n if (db) alert('period must not immediately follow @ in email address');\n return false;\n}\nif (addr.indexOf('.@',0) != -1){\n if (db) alert('period must not immediately precede @ in email address');\n return false;\n}\nif (addr.indexOf('..',0) != -1) {\n if (db) alert('two periods must not be adjacent in email address');\n return false;\n}\nvar suffix = addr.substring(addr.lastIndexOf('.')+1);\nif (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 if (db) alert('invalid primary domain in email address');\n return false;\n}\nreturn true;\n}", "title": "" }, { "docid": "6b89bc6ca98490c8ab96a79aa6f26ca0", "score": "0.76215637", "text": "function checkEmail(input) {\n const re = /^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i;\n\n if (re.test(input.value.trim())) {\n showSuccess(input);\n } else {\n showError(input, \"show-error messages\");\n }\n}", "title": "" }, { "docid": "135eabf8f35cf1b957c49577b126038f", "score": "0.76202923", "text": "function validateEmail(input){\n var re = /\\S+@\\S+\\.\\S+/;\n if(re.test(input.value)){\n success(input);\n }\n else{\n error(input, `Email is not valid. `);\n }\n}", "title": "" }, { "docid": "bdbcc861e22e76a22a8e4e510d0a23fb", "score": "0.7618753", "text": "validatEmailAddress(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(String(email).toLowerCase());\n }", "title": "" }, { "docid": "5103b3c25fb1d24fe10cf2c6250c419d", "score": "0.76169807", "text": "function EmailAddress_isEmailAddressValid(emailAddr) {\n if(emailAddr.length == 0)\n return true;\n\n var name = emailAddr;\n var domain = \"\";\n var ampersandIndex = emailAddr.indexOf(\"@\");\n if(ampersandIndex != -1) {\n name = emailAddr.substring(0, ampersandIndex);\n domain = emailAddr.substring(ampersandIndex+1, emailAddr.length);\n\n if(name == \"\" || domain == \"\")\n return false;\n }\n\n if(!top.code.DomainName_isDomainNameValid(domain))\n return false;\n\n for(var i = 0; i < name.length; i++) {\n var ch = name.charAt(i);\n\n // first character cannot be a dot for email address \n if(i == 0 && ch == '.')\n\treturn false;\n\n if(!top.code.string_isAlpha(ch) && !top.code.string_isNumeric(ch)\n && ch != '-' && ch != '_' && ch != '.')\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "01b29d45c6f86e79502fb2906777c1aa", "score": "0.7608551", "text": "function emailCheck() {}", "title": "" }, { "docid": "de525552dd871a7b0dc8f6d0cac3d277", "score": "0.76082295", "text": "function validEmail(email) {\n\tvar regex = /\\S+@\\S+\\.\\S+/;\n\treturn regex.test(email);\n}", "title": "" }, { "docid": "28368cf0a5c8dbfb94e99b6dc07a9e4f", "score": "0.760702", "text": "function checkEnteredEmail() {\n var emailSplit = email.split('@');\n return emailSplit[1] == 'asu.edu';\n}", "title": "" }, { "docid": "0a3fdef4e71a009e636c930dfa74c453", "score": "0.7600291", "text": "function emailValidate(input) {\n\tvar emailFilter = /^[^@]+@[^@.]+\\.[^@]*\\w\\w$/ ;\n var illegalChars= /[\\(\\)\\<\\>\\,\\;\\:\\\\\\\"\\[\\]]/ ;\n\tif(!emailFilter.test(input) || illegalChars.test(input)) {\n\t\treturn false;\t\n\t}\n\telse return true;\n\t\n}", "title": "" }, { "docid": "0c881c7cee545baf55c85189f452d4a3", "score": "0.75981414", "text": "function check_email()\r\n\t{\r\n\t\tuser_email = $(\"#user_email\").val();\r\n\t\tvar 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\t\tif (!re.test(user_email))\r\n\t\t{\r\n\t\t\t$(\"#email_Error\").html(\"Enter valid email address.\");\r\n\t\t\t$(\"#email_Error\").show();\r\n\t\t\terror_count = 1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$(\"#email_Error\").hide();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a619a0f16c920f77a8f86254806f2e5a", "score": "0.7591244", "text": "function emailValidityCheck(input) {\n const regex = /^(([^<>()\\[\\]\\\\.,;:\\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(input.value.trim() === ''){\n showError(input, `Please enter a valid ${input.name} address.`);\n } else {\n showSuccess(input);\n }\n}", "title": "" }, { "docid": "584949ce6e3ec5d86111d34764abfc37", "score": "0.7582772", "text": "function validmail(){\r\n\tvar em = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\r\n\tif(em.test(user.val()))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "title": "" }, { "docid": "2eb22827d4e1de02576401c64967e7b8", "score": "0.7574825", "text": "_validateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "0291951cb407e3977c2d25e18c5030d1", "score": "0.7574178", "text": "function checkEmail(email) {\n const regEx = /^(([^<>()\\[\\]\\\\.,;:\\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\n if(regEx.test(email.value.trim())) {\n showSuccess(email);\n } else {\n showError(email, 'Email is not valid')\n }\n}", "title": "" }, { "docid": "5e123902a1a6a98b3df98a70a5dbf6a4", "score": "0.7571089", "text": "function checkEmail(element){if(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(element.value)){return(true);\r\n }element.value=\"\";\r\n alert(\"Invalid E-mail Address! Please re-enter.\");\r\n return(false);\r\n }", "title": "" }, { "docid": "ec7442b23894b99f11885407549a1cf5", "score": "0.7568187", "text": "function emailValidate(){\n var regexp = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/\n if ( email.value.match(regexp)){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d918b08436964a13e25301835eb2bda9", "score": "0.75660896", "text": "function isEmailAddressValid(mail) {\n\n\t if (mail == null) return false ;\n\t if ( Trim(mail) == \"\" ) return false ;\n\n\t var supported = 0;\n\t if (window.RegExp){\n\t var tempStr = \"a\";\n\t var tempReg = new RegExp(tempStr);\n\t if (tempReg.test(tempStr)) supported = 1;\n\t }\n\t if (!supported) return (mail.indexOf(\".\") > 2) && (mail.indexOf(\"@\") > 0);\n\n\t var r1 = new RegExp(\"(@.*@)|(\\\\.\\\\.)|(@\\\\.)|(^\\\\.)\");\n\t var r2 = new RegExp(\"^.+\\\\@(\\\\[?)[a-zA-Z0-9\\\\-\\\\.]+\\\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\\\]?)$\");\n\t return (!r1.test(mail) && r2.test(mail));\n\n}", "title": "" }, { "docid": "1e9f602c7da8b11fe8f9daa403d1d588", "score": "0.7560331", "text": "function validEmail(email){\n var pattern = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i;\n if( email.match(pattern) )\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "167fd26ce6fa3c407378ec667241cdc2", "score": "0.75587565", "text": "function checkEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n }", "title": "" }, { "docid": "ea476b462e1ed4c8e12b5b2a2c9d58ce", "score": "0.75475603", "text": "function isValidEmail(input) {\n var atPos = input.indexOf('@'),\n dotPos = input.lastIndexOf('.');\n if (atPos < 1 || dotPos < atPos + 2 || dotPos + 2 >= input.length) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ea476b462e1ed4c8e12b5b2a2c9d58ce", "score": "0.75475603", "text": "function isValidEmail(input) {\n var atPos = input.indexOf('@'),\n dotPos = input.lastIndexOf('.');\n if (atPos < 1 || dotPos < atPos + 2 || dotPos + 2 >= input.length) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "321589c168db318a14f0c58f2cf36c10", "score": "0.75467485", "text": "function checkEmail(email) {\n\n // As per the HTML5 Specification with one correction - required also domain with dot\n // (so @localhost or @something won't work)\n var email_re = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)+$/;\n\n return email.match(email_re) != null;\n\n}", "title": "" }, { "docid": "e23962aba7971039f61fa4192d0f5aca", "score": "0.75446504", "text": "function isValidEmail(input) {\n if (input.value.length > 0) { //safety net to make sure blank input is not tested\n const REGEX = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/; //reg expression for valid email address\n return REGEX.test(input.value); //checking if input value is a valid email address\n }\n return false;\n}", "title": "" }, { "docid": "a160c2e0732c2481883df64f911d01fc", "score": "0.7539563", "text": "function validEmail (email) { \n valid = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)\n if (valid) { \n return true;\n } else {\n console.log(\". Please enter a valid email\")\n return false;\n }\n}", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "9095e35f4b6f79710c2d4a6d563209cd", "score": "0.75392693", "text": "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 }", "title": "" }, { "docid": "f19667c0ee48eb78589b37fe70dd8dc7", "score": "0.75345904", "text": "function checkEmail(email) {\n //check if email is actually an email\n var regex = /\\S+@\\S+\\.\\S+/;\n return regex.test(email);\n}", "title": "" }, { "docid": "860655afc6ccc0ac3fb362e892f2adf2", "score": "0.7534065", "text": "function isEmailValid(email)\n{\n var validemail=/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if (validemail.test(email))\n {\n return true;\n }\n\n alert(\"Please enter a valid email address!\")\n return false;\n}", "title": "" }, { "docid": "2e6f890baa6ecee3a3013aa376cf1b37", "score": "0.75315464", "text": "function validEmail(email)\n{\n\tvar atpos=email.indexOf(\"@\");\n\tvar dotpos=email.lastIndexOf(\".\");\n\tif (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)\n\t{\n\t\talert(\"Please enter a valid e-mail address.\");\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "79dd4c7119c30c1de4e9c3f530e6eee8", "score": "0.7524216", "text": "function validateEmail(sEmail) {\nvar filter = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\nif (filter.test(sEmail)) {\nreturn true;\n}\nelse {\nreturn false;\n}\n}", "title": "" }, { "docid": "bce216c461536535520b9b4648596c9a", "score": "0.75189096", "text": "function validateEmail() {\n const emailRegex = /^(([^<>()[\\]\\\\.,;:\\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 (!emailRegex.test(String(email).toLowerCase())) {\n setError(\"Make sure you write a valid email\");\n return false;\n } else {\n setError(\"\");\n return true;\n }\n }", "title": "" }, { "docid": "9122efc04db5de52d3b432f365b63a53", "score": "0.75163424", "text": "function validate_email() {\n var email = document.getElementById(\"email\").value;\n var remail_pattern = /^([A-z])+(\\.?\\w+)*@[A-z]+(\\.[A-z]{2,4}){1,2}/;\n return (remail_pattern.test(email));\n}", "title": "" }, { "docid": "42591faba665ceb0483613a2e1ffc45b", "score": "0.7507878", "text": "function checkMail(email){\n if (/^[a-zA-Z0-9._]+@[a-zA-Z]*+.[a-zA-Z]*/.test(email))\n {\n return (true);\n }else{\n alert(\"You have entered an invalid email address!\")\n return (false);\n }\n}", "title": "" }, { "docid": "f0a7ceb60393c20521a62a5a70212cf1", "score": "0.7505493", "text": "validateEmail(email) {\n const re = new RegExp([\n /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@/,\n /(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+/,\n /(?:[A-Z]{2}|edu|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\\b/\n ].map(r => r.source).join(''));\n return re.test(email);\n }", "title": "" }, { "docid": "6a4351becc8463041eaeee59fb0c5c40", "score": "0.7502336", "text": "function validateEmail() {\n\t\tlet $email = $('#mail').val();\n\t\tlet checkEmailRegExp = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;\n\t\tlet validEmail = $email.match(checkEmailRegExp);\n\t\tif (!validEmail) {\n\t\t\t$('#mail').before('<span class=\"formError\">Enter a valid email: example (jon.doe@gmail.com)</span>');\n\t\t\tevent.preventDefault();\n\t\t}\n\t}", "title": "" }, { "docid": "a3afa20bccbbca2364bdb83f763a8581", "score": "0.7498864", "text": "function checkemail(emailAddress) {\n\tvar str = emailAddress;\n\tvar filter = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\tif (filter.test(str)) {\n\t\ttestresults = true;\n\t} else {\n\t\ttestresults = false;\n\t}\n\treturn (testresults);\n}", "title": "" }, { "docid": "5871934e304ee7a0f7eae53647bfe291", "score": "0.74968797", "text": "function isValidEmail(value) {\n return emailValidator.validate(value);\n }", "title": "" }, { "docid": "470b1aed0e806701b97ffce70c45221b", "score": "0.74952364", "text": "function isValidEmail(emailAddress) {\n var emailAddressTld = emailAddress.split('.').pop() || '';\n return (0, uri_utils_1.isKnownTld)(emailAddressTld);\n}", "title": "" }, { "docid": "8e391040219dd0f25ffff28e20407f49", "score": "0.74925923", "text": "function validateEmail(email)\r\n{\r\n//convert our parameter to a string\r\nemail = String(email);\r\n\r\n//make sure it only contains letters without spaces\r\nvar stringIndex = email.search(/^\\w*\\@\\w*\\.[A-Za-z]{2,4}$/);\r\n\r\n//stringIndex holds the position of the search. We want it at 0\r\nif (stringIndex == \"0\")\r\n return true;\r\nelse\r\n return false;\r\n}", "title": "" }, { "docid": "68bbd8fda9e71ce329b0b6be6efd30ee", "score": "0.7487639", "text": "function checkemail(emailAddress) {\n\tvar str = emailAddress;\n\tvar filter = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\t\n\tif (filter.test(str)) {\n\t\ttestresults = true;\n\t} else {\n\t\ttestresults = false;\n\t}\n\treturn (testresults);\n}", "title": "" }, { "docid": "4b2f3e0915ae58701882500f1a195e24", "score": "0.7484344", "text": "function ValidateEmail(uemail)\n{\nvar mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\nvar uemail_len = uemail.value.length;\nif(uemail_len ==0){\n\talert(\"You have entered an invalid email address!\");\n\tuemail.focus();\n\treturn false;\n}else if(uemail.value.match(mailformat)){\n\treturn true;\n}else{\n\talert(\"You have entered an invalid email address!\");\n\tuemail.focus();\n\treturn false;\n}\n}", "title": "" }, { "docid": "8b2ece4a3db9271dc430916e0fc46f80", "score": "0.7483208", "text": "function email_check(email){\n let mail_format = /^(([^<>()[\\]\\\\.,;:\\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 (email.match(mail_format)){\n return true\n }\n else{\n return false\n }\n\n}", "title": "" }, { "docid": "8ab5c61ac3ccaf1b2ecfd03c45f6d3a5", "score": "0.7478363", "text": "function validateEmail(email) {\r\n re = /^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/;\r\n if (!re.exec(email)) return false;\r\n return true;\r\n}", "title": "" }, { "docid": "331f429e77907a42bee8d1931f8a9322", "score": "0.7477358", "text": "function isValidEmail() {\n\t\tconst email = emailField;\n\t\tconst emailInput = email.value;\n\t\tconst isValid = /^[^@\\s]+@[^@.]+\\.[a-z]+$/i.test(emailInput);\n\t\tif (!isValid && emailInput.length < 1) {\n\t\t\temail.parentNode.lastElementChild.textContent =\n\t\t\t\t'Email field cannot be blank';\n\t\t} else if (!isValid) {\n\t\t\temail.parentNode.lastElementChild.textContent =\n\t\t\t\t'Email address must be formatted correctly';\n\t\t}\n\t\treturn isValid;\n\t}", "title": "" }, { "docid": "c8632d363e18f02cbe3b7b0aa1eb8dce", "score": "0.74754924", "text": "function validar_email(email) {\n\tvar regex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\treturn regex.test(email) ? true : false;\n}", "title": "" }, { "docid": "3906b6f794d156ffc0fe8880f3f95216", "score": "0.74730533", "text": "function validEmail(string){\n // Get until the end of the actual email.\n // For example: \"email@email.com :)\" should return false.\n return _.endsWith(string, '.com');\n}", "title": "" }, { "docid": "31d50f0f57eb6330bfb65189e320c396", "score": "0.747098", "text": "_emailValid(email) {\n\t\t\treturn email !== \"\"\n\t\t\t\t&& email.indexOf(\"@\") > 2\n\t\t\t\t&& email.indexOf(\"@\") < email.lastIndexOf(\".\")\n\t\t\t\t&& email.lastIndexOf(\".\") < email.length;\n\t\t}", "title": "" }, { "docid": "8ca627a7e8a64ca102ce4252563cebdf", "score": "0.7467474", "text": "function checkEmail(){\n var email = document.getElementById('email').value;\n let emailRegEx= RegExp('^[a-zA-Z]+([._+-]{0,1}[a-zA-Z0-9]+)*@[a-zA-Z0-9]+.[(com)|(co)|(net)]+(?:\\\\.[a-z]{2,}){0,1}$');\n if(!emailRegEx.test(email)){\n alert('Incorrect Email');\n return false;\n }\n else\n return true;\n\n}", "title": "" }, { "docid": "cda51ff0bca5dcb732bf52005de9b31f", "score": "0.74665767", "text": "function isValidEmailAddress( emailAddress )\n\t{\n \tvar pattern = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\n \treturn pattern.test( emailAddress );\n\t}", "title": "" }, { "docid": "126984deb3ac5934f682a5fba70b49ea", "score": "0.74648917", "text": "function validateEmail(){\n // get value of input email\n var email=$(\"#email_2\").val();\n // use reular expression\n var reg = /^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/\n if(reg.test(email)){\n return true;\n }else{\n return false;\n }\n\n }", "title": "" }, { "docid": "d4a1dd9f9b414ed1b1f599f40e56df82", "score": "0.74648315", "text": "function validEmail(e) {\n \tvar filter = /^\\s*[\\w\\-\\+_]+(\\.[\\w\\-\\+_]+)*\\@[\\w\\-\\+_]+\\.[\\w\\-\\+_]+(\\.[\\w\\-\\+_]+)*\\s*$/;\n \treturn String(e).search (filter) != -1;\n\t}", "title": "" }, { "docid": "60bbd6389dc77946b23d0d933095cfef", "score": "0.7463574", "text": "function checkEmail(input) {\n \n const regexp = /^(\\w[-._+\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,3})$/;\n if (regexp.test(input.value.trim())) {\n showSuccess(input)\n } else {\n showError(input, 'Email is not invalid');\n }\n}", "title": "" }, { "docid": "fa19ab5a05f2627fd091b84dd38d4e2e", "score": "0.746005", "text": "function validateEmail(email) {\r\n\t var re = /^(?:[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\r\n\t return re.test(email);\r\n\t }", "title": "" }, { "docid": "408192f162506a1ed97aa633e22fe6e5", "score": "0.74574864", "text": "function isValid(email) {\n var flag = true;\n if (indexOf(email, '@') == -1) {\n flag = false;\n }\n else if (email[0] == '@' || email[0] == '.') {\n flag = false;\n }\n else if (countChar(email, '@') != 1) {\n flag = false;\n }\n else {\n var arr = splitString(email, '@');\n var firstPart = arr[0];\n var secondPart = arr[1];\n if (firstPart[firstPart.length - 1] == '.') {\n flag = false;\n }\n if (tldDot(secondPart)) {\n flag = false;\n }\n if (!tldValid(secondPart)) {\n flag = false;\n }\n if (!charCheck(firstPart)) {\n flag = false;\n }\n if (doubleDots(firstPart)) {\n flag = false;\n }\n }\n if (flag) {\n console.log(\"Email is Valid.\");\n }\n else {\n console.log(\"Email is Invalid.\")\n }\n\n}", "title": "" }, { "docid": "717ad38991386c0643e62e389f11d360", "score": "0.7457279", "text": "function validateEmail(email) {\r\n var reg = /^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\r\n if (reg.test(email)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" } ]
5933e35b3c2d55dbe41524cfa4077ce6
Recursively creates a tree that contains the given tree.
[ { "docid": "526d658a346bc93a77d9a831b1c12d73", "score": "0.0", "text": "function parentise(tree, h)\n{\n\tif (h === tree.height)\n\t{\n\t\treturn tree;\n\t}\n\n\treturn {\n\t\tctor: '_Array',\n\t\theight: h,\n\t\ttable: [parentise(tree, h - 1)],\n\t\tlengths: [length(tree)]\n\t};\n}", "title": "" } ]
[ { "docid": "0a35ef965c37d24e4df4aaaf3f9993c6", "score": "0.7117637", "text": "function constructTree() {\n\n}", "title": "" }, { "docid": "66843dc129a63c9a7aef943a3544039a", "score": "0.7069809", "text": "function createTree() {\n // A function that adds children to a node\n // The temporary holder for each row of nodes\n // The index of the current value\n // The current tree's depth\n // The tree's max depth\n // The current node\n var addNodes, row, val, d, depth, node;\n\n // Adds children to the provided node\n // param: The node to add the children\n addNodes = function(prtNode) {\n\n // Create the nodes and increase the value\n prtNode.left = {\n val : vals[val],\n left : null,\n right: null\n };\n ++val;\n prtNode.right = {\n val : vals[val],\n left : null,\n right: null\n };\n ++val;\n\n // Add the nodes to temp holder\n row.next.push(prtNode.left, prtNode.right);\n };\n\n // Set the temp holders, value, and max depth\n row = {\n now : [tree],\n next: []\n };\n val = 1;\n depth = 3;\n\n // Add the nodes to tree\n for (d=1; d<depth; d++) {\n // Add nodes\n row.now.forEach(function(node) {\n addNodes(node);\n });\n // Reset temp arrays\n row.now = row.next.slice(0);\n row.next = [];\n }\n }", "title": "" }, { "docid": "50bf5703a082aefd6e741c558b411984", "score": "0.7042464", "text": "function createTree() {\n // A function that adds children to a node\n // The temporary holder for each row of nodes\n // The index of the current value\n // The current tree's depth\n // The tree's max depth\n // The current node\n var addNodes, row, val, d, depth, node;\n\n // Adds children to the provided node\n // param: The node to add the children\n addNodes = function(prtNode) {\n\n // Create the nodes and increase the value\n prtNode.left = {\n val : vals[val],\n left : null,\n right: null\n };\n ++val;\n prtNode.right = {\n val : vals[val],\n left : null,\n right: null\n };\n ++val;\n\n // Add the nodes to temp holder\n row.next.push(prtNode.left, prtNode.right);\n };\n\n // Set the temp holders, value, and max depth\n row = {\n now : [tree],\n next: []\n };\n val = 1;\n depth = 4;\n\n // Add the nodes to tree\n d = 0;\n while (++d < depth) {\n // Add nodes\n row.now.forEach(function(node) {\n addNodes(node);\n });\n // Reset temp arrays\n row.now = row.next.slice(0);\n row.next = [];\n }\n }", "title": "" }, { "docid": "6e26591ab6fd860302fdbea7b5d1c226", "score": "0.6647227", "text": "function plainTree(treeData, parent, options) {\r\n\t\t\t if (treeData && treeData.length <= 0) {\r\n\t\t\t\t return;\r\n\t\t\t } else {\r\n\t\t\t\t var ul = $(\"<ul></ul>\");\r\n\t\t\t\t ul.addClass(\"x-tree-group\");\r\n\t\t\t\t $.each(treeData, function(index, node) {\r\n\t\t\t\t\t var children, hasChildren;\r\n\t\t\t\t\t var children = node[options.attrRef.children];\r\n\t\t\t\t\t hasChildren = (children && children.length > 0) ? true : false;\r\n\t\t\t\t\t li = makeNode(node, hasChildren, options);\r\n\t\t\t\t\t ul.append(li);\r\n\t\t\t\t\t parent.append(ul);\r\n\t\t\t\t\t plainTree(children, li, options);\r\n\t\t\t\t });\r\n\t\t\t }\r\n\t\t }", "title": "" }, { "docid": "73ae819eade7080f591f0096ae13bd3b", "score": "0.66396356", "text": "buildTree() {\n for (let currentNode of this.tree){\n for (let checkChild of this.tree){\n if (currentNode.name === checkChild.parentName){\n currentNode.addChild(checkChild)\n checkChild.parentNode = currentNode\n }\n }\n if(currentNode.parentName=== \"root\"){\n var rootNode = currentNode\n }\n }\n\n<<<<<<< HEAD\n\t//Assign Positions and Levels by making calls to assignPosition() and assignLevel()\n this.assignLevelPosition(rootNode,0,{})\n=======\n //Assign Positions and Levels by making calls to assignPosition() and assignLevel()\n }", "title": "" }, { "docid": "0429402b4f796fe0f0099dce99eb324c", "score": "0.6625219", "text": "createTree(props) {\n return new Tree(props);\n }", "title": "" }, { "docid": "fb1c6b336ea46504a936080547b5c11d", "score": "0.6505023", "text": "function createTree(arr){\n// minimum value of i should be 1 at least (0th index is padding)\n\t// let i=1;\n\t\t\n\t\tfunction doit(parentNode,num){\n\t\twhile(num<arr.length){\n\t\t\t// console.log(\"i is:\",i);\n\t\t\t// let root = new Node; \n\t\t\t// root.setNode(arr[i],[]);\n\t\t\t// console.log(\"2i:\",2*i,\"=>\",arr[2*i]);\n\t\t\tif(arr[2*num]&&arr[2*num+1]){ // if has both children, pass children array\n\t\t\t\tlet fchild = new Node; // GOTCHA: children is array of Nodes\n\t\t\t\t// console.log(\"tathaastu, here is a fchild for you\",fchild.setNode(arr[2*i],null));\n\t\t\t\t// console.log(\"Fchild:\",fchild);\n\t\t\t\t\n\t\t\t\tlet schild = new Node;\n\t\t\t\t; //** init empty children with \"\" not blank array\n\t\t\t\t\n\t\t\t\tparentNode.setNode(arr[num],[fchild.setNode(arr[2*num],doit(fchild,2*num)),schild.setNode(arr[2*num+1],doit(schild,2*num+1))]);\n\t\t\t\tconsole.log(\"Parent node is:\",arr[num],\"fchild:\",fchild,\"schild:\",schild);\n\t// NEED to connect the root above to it's parent #####\n\t//storing all nodes in an array could be one option\n\t// i = 1 createNode with children null\n\t// try to assign fchild s child again to that null <<< prob could be here\n\t// setNode is not working probably. But first iteration is working!\n\t// i = 2 now. new root is created. we dont want that!\n\t// try recursion here\n\t\t\t}\n\t\t\telse if(arr[2*num]) { // if one child, pass on the only child\n\t\t\t\tlet fchild = new Node;\n\t\t\t\t\n\t\t\t\tparentNode.setNode(arr[num],[fchild.setNode(arr[2*num],null)]);\n\t\t\t\tconsole.log(\"Parent node is:\",arr[num],\"only fchild:\",fchild);\n\t\t\t}\n\t\t\t\n\t\treturn root;\n\t\t}\n\t\t// i++;\n\t}\n\t// arr.splice(0,1); // delete first number from array\n\t// createTree(arr,[]);\n\tlet mainroot = new Node;\n\tdoit(mainroot,1);\n\t// console.log(\"MR:\",mainroot.children[0]);\n\treturn mainroot;\n}", "title": "" }, { "docid": "c7b5c8353125b003d0a1b1575b47dccd", "score": "0.64890397", "text": "async createTree() {\n const rootArtist = this.state.rootArtist;\n var rootNode = {\n artist: rootArtist,\n name: rootArtist.name,\n _collapsed: true,\n children: []\n }\n rootNode.children = await this.addChildren(rootArtist, rootNode.children, 1);\n this.setState({ \n treeData: [rootNode]\n });\n this._isMounted = true;\n }", "title": "" }, { "docid": "fbe58285fe008e2d2d4788167ebdc23c", "score": "0.6470014", "text": "buildTree() {\n // Add child links for each parent\n for(let node of this.nodes){\n if (node.parentNode != null){\n let parent = node.parentNode\n parent.addChild(node);\n }\n }\n for(let node of this.nodes){\n if (node.parentName == \"root\"){\n this.assignLevel(node,0);\n this.assignPosition(node,0);\n }\n }\n }", "title": "" }, { "docid": "e518205218969b0516e686a196ed472d", "score": "0.6452138", "text": "buildTree() {\r\n\t\tvar len = this.tree_nodes.length;\r\n\t\tfor(var i =0; i<len;i++)\r\n\t\t{ \r\n\t\t\tfor(var j=1;j<len;j++)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif(this.tree_nodes[j].parentName == this.tree_nodes[i].name)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.tree_nodes[i].children.push(this.tree_nodes[j]);\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tfor(var s=0; s<len;s++)\t\t\t\r\n\t\t{\r\n\t\t\tthis.assignLevel(this.tree_nodes[s],this.tree_nodes[s].level);\r\n\t\t}\r\n\t\t\r\n\t\tthis.assignPosition(this.tree_nodes,this.tree_nodes[0].position);\r\n\t\t\t\r\n\t\t\r\n\t//Assign Positions and Levels by making calls to assignPosition() and assignLevel()\r\n\t}", "title": "" }, { "docid": "3c54b27cd55277d8d167f28991e50228", "score": "0.6443789", "text": "function Tree(arr){\n let res = new Node(arr[0]);\n \n res.left = arr[1] ? Tree(arr[1]): null;\n res.right = arr[2] ? Tree(arr[2]) : null;\n\n return res;\n}", "title": "" }, { "docid": "886275350023718f1a480b55da57801b", "score": "0.6441122", "text": "function makeTree() {\n\treturn {\"key\": null, \"value\": null, \"parent\": null, \"direction\": null, \"left\": null, \"right\": null};\n}", "title": "" }, { "docid": "013f3d1a472fe46e42c5fe7e2b442a93", "score": "0.6430089", "text": "insertRecursively(val) {\n let node = new Node(val);\n\n if (this.root == null) {\n this.root = node;\n } else {\n this.root.insert(node);\n }\n\n return this;\n }", "title": "" }, { "docid": "01f6af8b3a7e2d9b6daac9a4d4a55b0b", "score": "0.6413662", "text": "create(tree) {\n return {\n props: {},\n tree: Object.keys(tree).reduce((result, field) => {\n result[field] = tree[field].getTree();\n return result;\n }, {}),\n };\n }", "title": "" }, { "docid": "70eda151618d7f55e94a18c98e7a6207", "score": "0.6359488", "text": "function treeMaker() {\n let trees = [];\n\n function addTree(tree) {\n trees.push(tree);\n return trees;\n }\n\n return addTree; // remember, we are returning a function here\n}", "title": "" }, { "docid": "ded8f81099e959381b842d953a73455a", "score": "0.6319632", "text": "function wrapRecurse(node) {\n var children = node.getChildren();\n var wrapped = [];\n for ( var i = 0; i < children.length; i++ ) {\n var wrappedNode = new TreeNode(children[i],node);\n wrapped.push(wrappedNode);\n wrapRecurse(wrappedNode);\n }\n node.children = wrapped;\n }", "title": "" }, { "docid": "960cf75c4153bf02129440749a5ec380", "score": "0.6298819", "text": "function createTree(array, obj) {\r\n array.append(createTreeDom(obj));\r\n}", "title": "" }, { "docid": "69819bae155841185f10676c019b0bb8", "score": "0.62901026", "text": "buildTree() {\n // note: in this function you will assign positions and levels by making calls to assignPosition() and assignLevel()\n var arrLength = window.arr.length;\n // nested to link parents with the children\n for (var i = 0; i < arrLength; i++) {\n for (var j = i; j < arrLength; j++) {\n //if the i node is the j nodes parent, add the j node to the i node's children array\n if (window.arr[j].parentName == window.arr[i].name) {\n window.arr[i].addChild(window.arr[j]);\n window.arr[j].parentNode = window.arr[i];\n }\n }\n }\n this.assignLevel(window.arr[0], 0)\n this.assignPosition(window.arr[0], 0)\n console.log(window.arr)\n }", "title": "" }, { "docid": "8ee9ffc80f574d659c6016a99d648204", "score": "0.6255813", "text": "make_tree(tree_string) {\n let node = [];\n if (tree_string[this.index] === \"'\") {\n this.index++;\n node.push(tree_string[this.index]);\n this.index++;\n return node;\n }\n this.index++;\n node.push(this.make_tree(tree_string)); // find and push left child\n this.index++;\n node.push(this.make_tree(tree_string)); // find and push right child\n return node;\n }", "title": "" }, { "docid": "0e9d3536e7416b4b7385357aeee284ed", "score": "0.62461346", "text": "function createTree(nodes) {\n\t\t \tvar tree = [];\n\t\t \tfor (var i = 0; i < nodes.length; i++) {\n\t\t \tvar node = nodes[i];\n\t\t \taddToTree(node, tree);\n\t\t \t}\n\t\t \treturn tree;\n\t\t}", "title": "" }, { "docid": "0cc23d3746cccf3e82078d67f92b6f87", "score": "0.623466", "text": "function generateTestTree1() {\n const testTree1 = new TreeNode(5);\n\n const leftNode = new TreeNode(7);\n const rightNode = new TreeNode(7);\n const leftmostNode = new TreeNode(9);\n const rightmostNode = new TreeNode(9)\n\n testTree1.left = leftNode;\n testTree1.right = rightNode;\n leftNode.left = leftmostNode;\n rightNode.right = rightmostNode;\n\n return testTree1;\n }", "title": "" }, { "docid": "ef22ec888a4b4f28a8586f72c9ff05c5", "score": "0.62260205", "text": "function createTree(rootNode, root, level) {\n var queue = [];\n queue.push(root);\n queue.push(null); //null keeps track of level\n var level = 1;\n while (queue.length != 0) {\n var node = queue.shift();\n if (!node) {\n //either hit a new level or queue is entirely empty\n level++;\n queue.push(null);\n if (!queue[0])\n break;\n else\n continue;\n }\n\n var id = node.id;\n var elements = node.elements;\n\n //create a div with unique ID to be toggled with collapse()\n var collapseDiv = $(\"<div></div>\", { \"id\": id });\n //create a div to hold all nodes in a level\n var levelContainer = $(\"<div></div>\", { \"class\": level + \"_level level\" });\n\n if (node.id) {\n collapseDiv.addClass(\"collapse\");\n }\n\n elements.forEach(function(element) {\n var anchor = createAnchor(element, level);\n var iconDiv = createIcon(element, level);\n var textLabel = createTextLabel(element);\n\n if (element.child) {\n queue.push(element.child);\n //if this element has children, and a user hovers over this, show a bottom border to denote\n // this element will expand its children if clicked.\n anchor.hover(function() {\n //when a mouse enters\n $(this).css(\"border-bottom\", \"medium outset #9c8585\")\n }, function() {\n //when a mouse leaves\n $(this).css(\"border-bottom\", \"medium solid rgba(255,255,255,0)\")\n })\n }\n anchor.append(iconDiv);\n anchor.append(textLabel);\n levelContainer.append(anchor);\n\n });\n collapseDiv.append(levelContainer)\n rootNode.append(collapseDiv);\n }\n maxLevel = level;\n return;\n\n}", "title": "" }, { "docid": "d9f067cf5cee008b26ba0d9767f1a4a6", "score": "0.6203639", "text": "function build_binarytree() {\n var tree = []\n var current = tree\n return function foo(node) {\n if (current === tree) {\n tree.push(node)\n current = []\n tree.push(current)\n } else {\n if (current.length < 2) {\n current.push(node)\n } else if (current.length === 2) {\n if (Array.isArray(current[0])) {\n var arr = current[0]\n if (arr[1].length < 2) {\n arr[1].push(node)\n } else {\n if (Array.isArray(current[1])) {\n var arr = current[1]\n if (arr[1].length < 2) {\n arr[1].push(node)\n } else {\n current = current[0][1]\n foo(node)\n }\n } else {\n current[1] = [current[1], [node]]\n }\n }\n } else {\n current[0] = [current[0], [node]]\n }\n } else {\n throw Error(tree)\n }\n }\n return tree.slice()\n }\n}", "title": "" }, { "docid": "9296c2160ab0d5077edf070ca63bb7b3", "score": "0.6179678", "text": "function createTree() {\n tree = new MerkleTree(leaves, sha256);\n console.log(\"Tree\");\n console.log(tree);\n}", "title": "" }, { "docid": "78f1d8d0209c121579a0ce1942795e8a", "score": "0.6172083", "text": "static build(data) {\n return buildTree(data);\n }", "title": "" }, { "docid": "86b3c1ad384662849025a90c8179b791", "score": "0.6128489", "text": "insertRecursively(val) {\n let newNode = new Node(val);\n\n function _insertHelper(node, curr=null) {\n if(node !== null) curr = node\n if(node === null) return curr\n if(node.left === null && node.right === null) return curr;\n\n let parent = newNode.val < node.val ? _insertHelper(node.left, curr) : _insertHelper(node.right, curr);\n\n return parent;\n }\n\n if (this.root === null) {\n this.root = newNode;\n } else {\n let p = _insertHelper(this.root)\n p.val > newNode.val ? p.left = newNode : p.right = newNode;\n }\n return this;\n }", "title": "" }, { "docid": "f525321af35a3d90ec50f089e2245212", "score": "0.6121874", "text": "function reConstructBinaryTree(pre, vin) {\n\tlet node = new TreeNode()\n\n\tfunction createTree(node, pre, vin) {\n\t\tif (pre.length === 0) {\n\t\t\tnode.val = null\n\t\t\treturn\n\t\t}\n\t\tlet rootnode = pre[0]\n\t\tlet index = vin.indexOf(rootnode)\n\t\tlet lchildvinarr = vin.slice(0, index),\n\t\t\trchildvinarr = vin.slice(index + 1),\n\t\t\tlchildvinlen = lchildvinarr.length,\n\t\t\trchildvinlen = rchildvinarr.length\n\t\tlet lchildprearr = pre.slice(1, lchildvinlen + 1),\n\t\t\trchildprearr = pre.slice(lchildvinlen + 1)\n\t\tnode.val = rootnode\n\t\tnode.left = new TreeNode()\n\t\tnode.right = new TreeNode()\n\t\tif (node.val) {\n\t\t\tcreateTree(node.left, lchildprearr, lchildvinarr)\n\t\t\tcreateTree(node.right, rchildprearr, rchildvinarr)\n\t\t}\n\t}\n\tcreateTree(node, pre, vin)\n\treturn node\n}", "title": "" }, { "docid": "1bca7cbab0b22f36fcbbc5968771f77e", "score": "0.60821605", "text": "insertRecursively(val) {\n // special case for empty tree\n if (!this.root) {\n this.root = new Node(val);\n }\n else {\n this.insertRecursivelyHelper(this.root, val);\n }\n return this;\n }", "title": "" }, { "docid": "5c5d591a89deabe0e0dfd98d5030713c", "score": "0.60668", "text": "function createRepresentationOfTree() {\n let indent = 0;\n\n for (let i = tree.length - 1; i >= 0; i--) {\n let link = document.createElement(\"a\");\n setMultipleAttributes(link, {\n \"data-findnode\": tree[i].getAttribute(\"data-cbnode\"),\n href: \"javascript:void(0)\",\n style:\n \"margin-left: \" + indent + \"em; transform: translateX(-\" + indent + \"em\"\n });\n link.innerText = \"<\" + tree[i].nodeName.toString().toLowerCase() + \">\";\n if (i == 0) link.classList.add(\"active\");\n navDiv.append(link);\n indent += 0.2;\n }\n}", "title": "" }, { "docid": "3b8fe7f9c880b9790ff11bd7eccb714b", "score": "0.6050805", "text": "function create(key, obj, level, hasNext, parent) {\n var nodeInfo = {\n parent: parent,\n key: key,\n obj: obj,\n type: typeofEx(obj),\n level: level,\n descendantsLength: 0,\n hasNext: hasNext\n };\n // TODO: there should be a better way to count descendantsLength\n var ancestor = parent;\n while(ancestor) {\n ancestor.descendantsLength++;\n ancestor = ancestor.parent;\n }\n switch(nodeInfo.type) {\n case 'object':\n nodeInfo.openToken = '{';\n nodeInfo.closeToken = '}';\n nodeInfo.children = createObjectChildren(nodeInfo);\n break;\n case 'array':\n nodeInfo.openToken = '[';\n nodeInfo.closeToken = ']';\n nodeInfo.children = createArrayChildren(nodeInfo);\n break;\n case 'string':\n nodeInfo.simpleContent = '\"' + obj + '\"';\n break;\n // number, boolean, null, undefined\n default: \n nodeInfo.simpleContent = '' + obj\n break;\n }\n if (nodeInfo.children) {\n return createNested(nodeInfo);\n } else {\n return createSimple(nodeInfo);\n }\n }", "title": "" }, { "docid": "12c1909a023a23510d602b6e32aad2a2", "score": "0.60173297", "text": "function generateTestTree2() {\n const testTree2 = new TreeNode(5);\n\n const leftNode = new TreeNode(7);\n const rightNode = new TreeNode(7);\n const leftmostNode = new TreeNode(9);\n const rightmostNode = new TreeNode(9)\n\n testTree2.left = leftNode;\n testTree2.right = rightNode;\n leftNode.left = leftmostNode;\n rightNode.left = rightmostNode; // not anymore!\n\n return testTree2;\n }", "title": "" }, { "docid": "988808a3b4e595cb2bc28b5d23a2c5ab", "score": "0.6015055", "text": "function _buildModelTreeRec(node) {\n\n instanceTree.enumNodeChildren(node.dbId, function (childId) {\n\n var childNode = null;\n\n if (createNodeFunc) {\n\n childNode = createNodeFunc(childId);\n } else {\n\n node.children = node.children || [];\n\n childNode = {\n dbId: childId,\n name: instanceTree.getNodeName(childId)\n };\n\n node.children.push(childNode);\n }\n\n _buildModelTreeRec(childNode);\n });\n }", "title": "" }, { "docid": "988808a3b4e595cb2bc28b5d23a2c5ab", "score": "0.6015055", "text": "function _buildModelTreeRec(node) {\n\n instanceTree.enumNodeChildren(node.dbId, function (childId) {\n\n var childNode = null;\n\n if (createNodeFunc) {\n\n childNode = createNodeFunc(childId);\n } else {\n\n node.children = node.children || [];\n\n childNode = {\n dbId: childId,\n name: instanceTree.getNodeName(childId)\n };\n\n node.children.push(childNode);\n }\n\n _buildModelTreeRec(childNode);\n });\n }", "title": "" }, { "docid": "109c35e88cb08fd240b0e8cf25b2bd0b", "score": "0.60142225", "text": "create_html_in(parent, depth = 0, node = undefined) {\n \n let current = node === undefined ? this._tree : node;\n\n let listitem = document.createElement(\"li\");\n let listitemspan = document.createElement(\"span\");\n listitemspan.innerText = current.label();\n listitem.append(listitemspan);\n\n let nextparent = document.createElement(\"ul\");\n nextparent.classList.add(\"tree_view\");\n nextparent.classList.add(\"collapsed_sublist\");\n \n let onclickfunc = () => {\n nextparent.classList.toggle(\"collapsed_sublist\");\n current.activate(1);\n };\n let ondblclickfunc = () => {\n current.activate(2);\n };\n let passed_click_func = onclickfunc;\n let passed_dblclick_func = onclickfunc;\n\n if(this._debouncing != null) {\n passed_click_func = this._debouncing.debounce(\"treeview-click\", onclickfunc, 100);\n passed_dblclick_func = this._debouncing.debounce(\"treeview-click\", ondblclickfunc, 10);\n }\n listitem.addEventListener(\"click\", passed_click_func);\n\n listitem.addEventListener(\"mouseenter\", () => {\n current.activate(0);\n });\n listitem.addEventListener(\"mouseleave\", () => {\n current.activate(-1);\n });\n\n listitem.addEventListener(\"dblclick\", passed_dblclick_func);\n\n current.setRepresentative(listitem);\n \n\n nextparent.append(listitem);\n\n let children = current.children();\n if(children.length == 0) {\n // current is a leaf node\n \n }\n else {\n // current is the root of a non-trivial subtree\n for(let n of children) {\n this.create_html_in(nextparent, depth + 1, n);\n }\n }\n parent.append(nextparent);\n }", "title": "" }, { "docid": "e321a3ae5907de51c9009f58b272639c", "score": "0.60116726", "text": "function createNestedTree (adoptedFlatArray) {\n let all = {}\n let root\n adoptedFlatArray.forEach(function (item) {\n all[item.name] = item\n })\n Object.keys(all).forEach(function (name) {\n const node = all[name]\n if (node.parent in all) {\n const child = all[node.parent]\n if (!('children' in child)) {\n child.children = []\n }\n child.children.push(node)\n } else {\n root = all[name]\n }\n })\n return root\n}", "title": "" }, { "docid": "c59fa08b36d541c3124a253c8a096af5", "score": "0.6005175", "text": "convert(treeData, y = 0) {\n if (treeData === null) return null\n\n const { width, height } = this.bb.addBoundingBox(\n treeData.width,\n treeData.height\n )\n let children = []\n if (treeData.children && treeData.children.length) {\n for (let i = 0; i < treeData.children.length; i++) {\n children[i] = this.convert(treeData.children[i], y + height)\n }\n }\n\n return new Tree(width, height, y, children)\n }", "title": "" }, { "docid": "aa5ceaa7e9c5310057895faf7bdbf372", "score": "0.59749335", "text": "function wrapTree(t) {\n console.log('我是t',t)\n var wt = {\n t: t,\n prelim: 0,\n mod: 0,\n shift: 0,\n change: 0,\n msel: 0,\n mser: 0,\n };\n t.x = 0;\n t.y = 0;\n if (size) {\n wt.x_size = 1;\n wt.y_size = 1;\n }\n else if (typeof nodeSize == \"object\") { // fixed array\n wt.x_size = nodeSize[0];\n wt.y_size = nodeSize[1];\n }\n else { // use nodeSize function\n var ns = nodeSize(t);\n wt.x_size = ns[0];\n wt.y_size = ns[1];\n }\n if (setNodeSizes) {\n t.x_size = wt.x_size;\n t.y_size = wt.y_size;\n }\n\n var children = [];\n var num_children = t.children ? t.children.length : 0;\n for (var i = 0; i < num_children; ++i) {\n children.push(wrapTree(t.children[i]));\n }\n wt.children = children;\n wt.num_children = num_children;\n\n return wt;\n }", "title": "" }, { "docid": "27d1c15460806f6ac3ff71f26fe1c280", "score": "0.59448797", "text": "function insertRecursively(root, data) {\n // If the tree is empty create new node.\n if (root == null) root = new Node(data);\n else if (data <= root.data) root.left = insert(root.left, data);\n else root.right = insert(root.right, data);\n\n return root;\n}", "title": "" }, { "docid": "56fed6ba487b1a82d789eadb8787c450", "score": "0.5944597", "text": "function arrayTree(arr, root, index) {\n if(index < arr.length) {\n root = new node(arr[index]);\n\n root.LChild = arrayTree(arr, root.LChild,2*index + 1);\n root.RChild = arrayTree(arr, root.RChild,2*index + 2);\n }\n return root;\n}", "title": "" }, { "docid": "35d895058b2ed4d45f46bd007cc2652e", "score": "0.59308755", "text": "function createTree(arr) {\n \n // if arr empty, exit\n if (!arr.length) return null;\n \n // create var to hold root node (return later)\n let root;\n\n // initialize queue with Node (that has val of first ele in array)\n let queue = [ new TreeNode(arr[0]) ];\n\n // loop through all numbers in array\n for (let i = 0; i < arr.length; i++) {\n\n // remove first node from queue, store in var\n let node = queue.shift();\n\n // capture root node\n if (i === 0) root = node;\n \n // grab 2 positions of two children\n let child1Idx = 2*i + 1;\n let child2Idx = 2*i + 2;\n\n // grab children and create nodes (if person exists at index) \n let child1 = null;\n let child2 = null;\n if (arr[child1Idx]) child1 = new TreeNode(arr[child1Idx]);\n if (arr[child2Idx]) child2 = new TreeNode(arr[child2Idx]);\n\n // assign children to parent node\n node.left = child1;\n node.right = child2;\n\n // push left and right childs to queue (if they exist)\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n\n return root;\n}", "title": "" }, { "docid": "f9f83485f05a77186b2c7972cdc77752", "score": "0.5920113", "text": "function tree(data) {\n const root = d3.hierarchy(data);\n\n return d3.tree().size([width - node_width, root.height * 2 * node_height])(root);\n}", "title": "" }, { "docid": "e45da9cf5f72ce3f3ca5b5fc8d2bd983", "score": "0.5902554", "text": "function makeTree(target, options) {\r\n\t\t\t // var menuList = options.params.navbarNode.menuList;\r\n\t\t\t var treeData = options.params.navbarNode.menuList;\r\n\t\t\t if(treeData){\r\n\t\t\t\t plainTree(treeData, target, options);\r\n\t\t\t }else{\r\n\t\t\t\t $.ajax({\r\n\t\t\t\t\t url : options.url,\r\n\t\t\t\t\t data : options.params,\r\n\t\t\t\t\t type : options.method,\r\n\t\t\t\t\t dataType : options.dataType,\r\n\t\t\t\t\t contentType : options.contentType,\r\n\t\t\t\t\t success : function(result) {\r\n\t\t\t\t\t\t var treeData;\r\n\t\t\t\t\t\t treeData = result[options.resultRef];\r\n\t\t\t\t\t\t window.top[cacheKey] = treeData;\r\n\t\t\t\t\t\t plainTree(treeData, target, options);\r\n\t\t\t\t\t },\r\n\t\t\t\t\t error : function(result) {\r\n\t\t\t\t\t\t alert(\"load tree data error.\");\r\n\t\t\t\t\t }\r\n\t\t\t\t });\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }", "title": "" }, { "docid": "4d72c3aa79b768788225248bea705fd5", "score": "0.588433", "text": "load(data) {\n\t\t\tif (!data) return;\n\t\t\tconst applyToTree = (root, node) => {\n\t\t\t\tif (!root) root = new Node(node.value);\n\t\t\t\tif (node.children) node.children.forEach(child => {\n\t\t\t\t\tconst node = new Node(child.value);\n\t\t\t\t\troot.addChild(node);\n\t\t\t\t\tapplyToTree(child.children && child.children.length > 0 ? node : root, child);\n\t\t\t\t});\n\t\t\t\treturn root;\n\t\t\t}\n\t\t\tthis.root = applyToTree(null, data);\n\t\t}", "title": "" }, { "docid": "f183e53d7828a98b62759d2eee2b60ca", "score": "0.58826315", "text": "function BuildNode() {\n var my_index = index;\n index++;\n var child_array = new Array();\n while (index < code_info_array.length &&\n code_info_array[index].outer_index == my_index) {\n child_array.push(BuildNode());\n }\n var node = new CodeInfoTreeNode(code_info_array[my_index], child_array,\n my_index);\n for (var i = 0; i < child_array.length; i++) {\n child_array[i].parent = node;\n }\n return node;\n }", "title": "" }, { "docid": "2c2ff97310f63e3e84323cce8921a1bf", "score": "0.5880988", "text": "function buildup(obj) {\n if (obj === null) {\n return null;\n }\n // if (Array.isArray(obj)) {\n // obj = {type: obj[0].type === 'paragraph' ? 'root' : 'paragraph', children: obj};\n // }\n if (obj.type !== 'paragraph' && obj.type !== 'root') {\n obj = {type: 'paragraph', children: [].concat(obj)};\n }\n if (obj.type === 'paragraph') {\n obj = {type: 'root', children: [].concat(obj)};\n }\n return obj;\n}", "title": "" }, { "docid": "b164e94212a486bfa930d5c7a48903d5", "score": "0.5876961", "text": "function loadTree (data) {\n // Just need to restore the `parent` parameter\n self.root = data;\n\n function restoreParent (root) {\n if (root.left) {\n root.left.parent = root;\n restoreParent(root.left);\n }\n\n if (root.right) {\n root.right.parent = root;\n restoreParent(root.right);\n }\n }\n\n restoreParent(self.root);\n }", "title": "" }, { "docid": "b164e94212a486bfa930d5c7a48903d5", "score": "0.5876961", "text": "function loadTree (data) {\n // Just need to restore the `parent` parameter\n self.root = data;\n\n function restoreParent (root) {\n if (root.left) {\n root.left.parent = root;\n restoreParent(root.left);\n }\n\n if (root.right) {\n root.right.parent = root;\n restoreParent(root.right);\n }\n }\n\n restoreParent(self.root);\n }", "title": "" }, { "docid": "25d9e74a12694093cf080c332c9faaef", "score": "0.5875647", "text": "function newFunc(...args) {\r\n const curr = new Node(args, count, level);\r\n \r\n if (!level) tree = curr;\r\n \r\n if (parents.length) {\r\n parents[parents.length - 1].children.push(curr);\r\n }\r\n count++;\r\n level++;\r\n \r\n parents.push(curr);\r\n const res = func(...args);\r\n parents.pop();\r\n \r\n level--;\r\n \r\n return res;\r\n }", "title": "" }, { "docid": "d1a0b98a770276f9643f9f6cc8ed469d", "score": "0.58717084", "text": "function buildTree() {\r\n const tree = getTree();\r\n const targetid = getTargetId();\r\n if (targetid) {\r\n setTargetNodeStyle(targetid, tree);\r\n }\r\n\r\n $('#tree').treeview({\r\n data: tree, // data is not optional\r\n levels: 5, // expand all to search target node\r\n collapseIcon: 'bi bi-caret-down',\r\n expandIcon: 'bi bi-caret-right',\r\n enableLinks: true,\r\n showBorder: false,\r\n backColor: 'transparent',\r\n onNodeSelected: (event, data) => {\r\n if (data.nodes) {\r\n // If this is not leaf, unselect\r\n $('#tree').treeview('unselectNode', [data.nodeId, { silent: true }]);\r\n } else {\r\n // move page when clicked item background too\r\n location.href = data.href;\r\n }\r\n $('#tree').treeview('toggleNodeExpanded', [data.nodeId, { silent: true }]);\r\n },\r\n });\r\n}", "title": "" }, { "docid": "575d1fca1a78e126845178ff4eb67194", "score": "0.5864338", "text": "_createRootNode() {\n const position = config.position;\n const velocity = config.velocity;\n const splitChance = config.splitChance;\n const radius = config.radius;\n const layer = this.layer;\n return new TreeNode(null, position, velocity, splitChance, radius, layer);\n }", "title": "" }, { "docid": "6eacdf8958c9ae18ba1601664bd34795", "score": "0.58632463", "text": "function addChildrenRecursively(node) {\n var _a;\n curCancellationToken.throwIfCancellationRequested();\n if (!node || ts.isToken(node)) {\n return;\n }\n switch (node.kind) {\n case 162 /* Constructor */:\n // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it.\n var ctr = node;\n addNodeWithRecursiveChild(ctr, ctr.body);\n // Parameter properties are children of the class, not the constructor.\n for (var _i = 0, _b = ctr.parameters; _i < _b.length; _i++) {\n var param = _b[_i];\n if (ts.isParameterPropertyDeclaration(param, ctr)) {\n addLeafNode(param);\n }\n }\n break;\n case 161 /* MethodDeclaration */:\n case 163 /* GetAccessor */:\n case 164 /* SetAccessor */:\n case 160 /* MethodSignature */:\n if (!ts.hasDynamicName(node)) {\n addNodeWithRecursiveChild(node, node.body);\n }\n break;\n case 159 /* PropertyDeclaration */:\n case 158 /* PropertySignature */:\n if (!ts.hasDynamicName(node)) {\n addLeafNode(node);\n }\n break;\n case 255 /* ImportClause */:\n var importClause = node;\n // Handle default import case e.g.:\n // import d from \"mod\";\n if (importClause.name) {\n addLeafNode(importClause.name);\n }\n // Handle named bindings in imports e.g.:\n // import * as NS from \"mod\";\n // import {a, b as B} from \"mod\";\n var namedBindings = importClause.namedBindings;\n if (namedBindings) {\n if (namedBindings.kind === 256 /* NamespaceImport */) {\n addLeafNode(namedBindings);\n }\n else {\n for (var _c = 0, _d = namedBindings.elements; _c < _d.length; _c++) {\n var element = _d[_c];\n addLeafNode(element);\n }\n }\n }\n break;\n case 282 /* ShorthandPropertyAssignment */:\n addNodeWithRecursiveChild(node, node.name);\n break;\n case 283 /* SpreadAssignment */:\n var expression = node.expression;\n // Use the expression as the name of the SpreadAssignment, otherwise show as <unknown>.\n ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node);\n break;\n case 191 /* BindingElement */:\n case 281 /* PropertyAssignment */:\n case 242 /* VariableDeclaration */:\n var _e = node, name = _e.name, initializer = _e.initializer;\n if (ts.isBindingPattern(name)) {\n addChildrenRecursively(name);\n }\n else if (initializer && isFunctionOrClassExpression(initializer)) {\n // Add a node for the VariableDeclaration, but not for the initializer.\n startNode(node);\n ts.forEachChild(initializer, addChildrenRecursively);\n endNode();\n }\n else {\n addNodeWithRecursiveChild(node, initializer);\n }\n break;\n case 244 /* FunctionDeclaration */:\n var nameNode = node.name;\n // If we see a function declaration track as a possible ES5 class\n if (nameNode && ts.isIdentifier(nameNode)) {\n addTrackedEs5Class(nameNode.text);\n }\n addNodeWithRecursiveChild(node, node.body);\n break;\n case 202 /* ArrowFunction */:\n case 201 /* FunctionExpression */:\n addNodeWithRecursiveChild(node, node.body);\n break;\n case 248 /* EnumDeclaration */:\n startNode(node);\n for (var _f = 0, _g = node.members; _f < _g.length; _f++) {\n var member = _g[_f];\n if (!isComputedProperty(member)) {\n addLeafNode(member);\n }\n }\n endNode();\n break;\n case 245 /* ClassDeclaration */:\n case 214 /* ClassExpression */:\n case 246 /* InterfaceDeclaration */:\n startNode(node);\n for (var _h = 0, _j = node.members; _h < _j.length; _h++) {\n var member = _j[_h];\n addChildrenRecursively(member);\n }\n endNode();\n break;\n case 249 /* ModuleDeclaration */:\n addNodeWithRecursiveChild(node, getInteriorModule(node).body);\n break;\n case 259 /* ExportAssignment */:\n case 263 /* ExportSpecifier */:\n case 253 /* ImportEqualsDeclaration */:\n case 167 /* IndexSignature */:\n case 165 /* CallSignature */:\n case 166 /* ConstructSignature */:\n case 247 /* TypeAliasDeclaration */:\n addLeafNode(node);\n break;\n case 196 /* CallExpression */:\n case 209 /* BinaryExpression */: {\n var special = ts.getAssignmentDeclarationKind(node);\n switch (special) {\n case 1 /* ExportsProperty */:\n case 2 /* ModuleExports */:\n addNodeWithRecursiveChild(node, node.right);\n return;\n case 6 /* Prototype */:\n case 3 /* PrototypeProperty */: {\n var binaryExpression = node;\n var assignmentTarget = binaryExpression.left;\n var prototypeAccess = special === 3 /* PrototypeProperty */ ?\n assignmentTarget.expression :\n assignmentTarget;\n var depth = 0;\n var className = void 0;\n // If we see a prototype assignment, start tracking the target as a class\n // This is only done for simple classes not nested assignments.\n if (ts.isIdentifier(prototypeAccess.expression)) {\n addTrackedEs5Class(prototypeAccess.expression.text);\n className = prototypeAccess.expression;\n }\n else {\n _a = startNestedNodes(binaryExpression, prototypeAccess.expression), depth = _a[0], className = _a[1];\n }\n if (special === 6 /* Prototype */) {\n if (ts.isObjectLiteralExpression(binaryExpression.right)) {\n if (binaryExpression.right.properties.length > 0) {\n startNode(binaryExpression, className);\n ts.forEachChild(binaryExpression.right, addChildrenRecursively);\n endNode();\n }\n }\n }\n else if (ts.isFunctionExpression(binaryExpression.right) || ts.isArrowFunction(binaryExpression.right)) {\n addNodeWithRecursiveChild(node, binaryExpression.right, className);\n }\n else {\n startNode(binaryExpression, className);\n addNodeWithRecursiveChild(node, binaryExpression.right, assignmentTarget.name);\n endNode();\n }\n endNestedNodes(depth);\n return;\n }\n case 7 /* ObjectDefinePropertyValue */:\n case 9 /* ObjectDefinePrototypeProperty */: {\n var defineCall = node;\n var className = special === 7 /* ObjectDefinePropertyValue */ ?\n defineCall.arguments[0] :\n defineCall.arguments[0].expression;\n var memberName = defineCall.arguments[1];\n var _k = startNestedNodes(node, className), depth = _k[0], classNameIdentifier = _k[1];\n startNode(node, classNameIdentifier);\n startNode(node, ts.setTextRange(ts.createIdentifier(memberName.text), memberName));\n addChildrenRecursively(node.arguments[2]);\n endNode();\n endNode();\n endNestedNodes(depth);\n return;\n }\n case 5 /* Property */: {\n var binaryExpression = node;\n var assignmentTarget = binaryExpression.left;\n var targetFunction = assignmentTarget.expression;\n if (ts.isIdentifier(targetFunction) && ts.getElementOrPropertyAccessName(assignmentTarget) !== \"prototype\" &&\n trackedEs5Classes && trackedEs5Classes.has(targetFunction.text)) {\n if (ts.isFunctionExpression(binaryExpression.right) || ts.isArrowFunction(binaryExpression.right)) {\n addNodeWithRecursiveChild(node, binaryExpression.right, targetFunction);\n }\n else if (ts.isBindableStaticAccessExpression(assignmentTarget)) {\n startNode(binaryExpression, targetFunction);\n addNodeWithRecursiveChild(binaryExpression.left, binaryExpression.right, ts.getNameOrArgument(assignmentTarget));\n endNode();\n }\n return;\n }\n break;\n }\n case 4 /* ThisProperty */:\n case 0 /* None */:\n case 8 /* ObjectDefinePropertyExports */:\n break;\n default:\n ts.Debug.assertNever(special);\n }\n }\n // falls through\n default:\n if (ts.hasJSDocNodes(node)) {\n ts.forEach(node.jsDoc, function (jsDoc) {\n ts.forEach(jsDoc.tags, function (tag) {\n if (ts.isJSDocTypeAlias(tag)) {\n addLeafNode(tag);\n }\n });\n });\n }\n ts.forEachChild(node, addChildrenRecursively);\n }\n }", "title": "" }, { "docid": "33185b95cbad46685eca6918cc5df71a", "score": "0.58623993", "text": "function tree() {\n var separation = defaultSeparation$1, dx = 1, dy = 1, nodeSize = null;\n function tree(root) {\n var t = treeRoot(root);\n // Compute the layout using Buchheim et al.’s algorithm.\n (t.eachAfter(firstWalk), t.parent.m = -t.z);\n t.eachBefore(secondWalk);\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode); else // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n {\n var left = root, right = root, bottom = root;\n root.eachBefore(function (node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2, tx = s - left.x, kx = dx / (right.x + s + tx), ky = dy / (bottom.depth || 1);\n root.eachBefore(function (node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n return root;\n }\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;\n while ((vim = nextRight(vim), vip = nextLeft(vip), vim && vip)) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n tree.separation = function (x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n tree.size = function (x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : nodeSize ? null : [dx, dy];\n };\n tree.nodeSize = function (x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : nodeSize ? [dx, dy] : null;\n };\n return tree;\n }", "title": "" }, { "docid": "715816c7d5f145b1f7068b55e27f5097", "score": "0.58522236", "text": "function getTree(root, deps) {\n var tree;\n\n tree = {};\n\n populateItem(tree, root, deps);\n\n return tree;\n}", "title": "" }, { "docid": "a49d823c37d6deb3575b1046a95fd20e", "score": "0.58490014", "text": "function TreeUtils(){}", "title": "" }, { "docid": "d28e5cfb36f8823dc22107f7614f43b5", "score": "0.584635", "text": "function tree() {\n\t\t var separation = defaultSeparation$1,\n\t\t dx = 1,\n\t\t dy = 1,\n\t\t nodeSize = null;\n\n\t\t function tree(root) {\n\t\t var t = treeRoot(root);\n\n\t\t // Compute the layout using Buchheim et al.’s algorithm.\n\t\t t.eachAfter(firstWalk), t.parent.m = -t.z;\n\t\t t.eachBefore(secondWalk);\n\n\t\t // If a fixed node size is specified, scale x and y.\n\t\t if (nodeSize) root.eachBefore(sizeNode);\n\n\t\t // If a fixed tree size is specified, scale x and y based on the extent.\n\t\t // Compute the left-most, right-most, and depth-most nodes for extents.\n\t\t else {\n\t\t var left = root,\n\t\t right = root,\n\t\t bottom = root;\n\t\t root.eachBefore(function(node) {\n\t\t if (node.x < left.x) left = node;\n\t\t if (node.x > right.x) right = node;\n\t\t if (node.depth > bottom.depth) bottom = node;\n\t\t });\n\t\t var s = left === right ? 1 : separation(left, right) / 2,\n\t\t tx = s - left.x,\n\t\t kx = dx / (right.x + s + tx),\n\t\t ky = dy / (bottom.depth || 1);\n\t\t root.eachBefore(function(node) {\n\t\t node.x = (node.x + tx) * kx;\n\t\t node.y = node.depth * ky;\n\t\t });\n\t\t }\n\n\t\t return root;\n\t\t }\n\n\t\t // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n\t\t // applied recursively to the children of v, as well as the function\n\t\t // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n\t\t // node v is placed to the midpoint of its outermost children.\n\t\t function firstWalk(v) {\n\t\t var children = v.children,\n\t\t siblings = v.parent.children,\n\t\t w = v.i ? siblings[v.i - 1] : null;\n\t\t if (children) {\n\t\t executeShifts(v);\n\t\t var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n\t\t if (w) {\n\t\t v.z = w.z + separation(v._, w._);\n\t\t v.m = v.z - midpoint;\n\t\t } else {\n\t\t v.z = midpoint;\n\t\t }\n\t\t } else if (w) {\n\t\t v.z = w.z + separation(v._, w._);\n\t\t }\n\t\t v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n\t\t }\n\n\t\t // Computes all real x-coordinates by summing up the modifiers recursively.\n\t\t function secondWalk(v) {\n\t\t v._.x = v.z + v.parent.m;\n\t\t v.m += v.parent.m;\n\t\t }\n\n\t\t // The core of the algorithm. Here, a new subtree is combined with the\n\t\t // previous subtrees. Threads are used to traverse the inside and outside\n\t\t // contours of the left and right subtree up to the highest common level. The\n\t\t // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n\t\t // superscript o means outside and i means inside, the subscript - means left\n\t\t // subtree and + means right subtree. For summing up the modifiers along the\n\t\t // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n\t\t // nodes of the inside contours conflict, we compute the left one of the\n\t\t // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n\t\t // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n\t\t // Finally, we add a new thread (if necessary).\n\t\t function apportion(v, w, ancestor) {\n\t\t if (w) {\n\t\t var vip = v,\n\t\t vop = v,\n\t\t vim = w,\n\t\t vom = vip.parent.children[0],\n\t\t sip = vip.m,\n\t\t sop = vop.m,\n\t\t sim = vim.m,\n\t\t som = vom.m,\n\t\t shift;\n\t\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t\t vom = nextLeft(vom);\n\t\t vop = nextRight(vop);\n\t\t vop.a = v;\n\t\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t\t if (shift > 0) {\n\t\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t\t sip += shift;\n\t\t sop += shift;\n\t\t }\n\t\t sim += vim.m;\n\t\t sip += vip.m;\n\t\t som += vom.m;\n\t\t sop += vop.m;\n\t\t }\n\t\t if (vim && !nextRight(vop)) {\n\t\t vop.t = vim;\n\t\t vop.m += sim - sop;\n\t\t }\n\t\t if (vip && !nextLeft(vom)) {\n\t\t vom.t = vip;\n\t\t vom.m += sip - som;\n\t\t ancestor = v;\n\t\t }\n\t\t }\n\t\t return ancestor;\n\t\t }\n\n\t\t function sizeNode(node) {\n\t\t node.x *= dx;\n\t\t node.y = node.depth * dy;\n\t\t }\n\n\t\t tree.separation = function(x) {\n\t\t return arguments.length ? (separation = x, tree) : separation;\n\t\t };\n\n\t\t tree.size = function(x) {\n\t\t return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n\t\t };\n\n\t\t tree.nodeSize = function(x) {\n\t\t return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n\t\t };\n\n\t\t return tree;\n\t\t }", "title": "" }, { "docid": "605533ce9b027b61e2ba8531b9578c7c", "score": "0.5836689", "text": "function recuTree (node, [head, ...tail ]) {\n if(head) {\n for (var i=0; i < head.length; i++) {\n node.children.push(new Node(head[i]))\n node.children[i].parent = node\n recuTree(node.children[i], tail)\n }\n }\n}", "title": "" }, { "docid": "53efb8039152fb46c4ebfdbc749491ff", "score": "0.5818987", "text": "function Tree() {\n // ----------\n // Attributes\n // ----------\n \n this.root = null; // Note the NULL root node of this tree.\n this.cur = {}; // Note the EMPTY current node of the tree we're building.\n\n\n // -- ------- --\n // -- Methods --\n // -- ------- --\n\n // Add a node: kind in {branch, leaf}.\n this.addNode = function(name, kind) {\n // Construct the node object.\n var node = { name: name,\n children: [],\n parent: {}\n };\n\n // Check to see if it needs to be the root node.\n if ( (this.root == null) || (!this.root) )\n {\n // We are the root node.\n this.root = node;\n }\n else\n {\n // We are the children.\n // Make our parent the CURrent node...\n node.parent = this.cur;\n // ... and add ourselves (via the unfrotunately-named\n // \"push\" function) to the children array of the current node.\n this.cur.children.push(node);\n }\n // If we are an interior/branch node, then...\n if (kind == \"branch\")\n {\n // ... update the CURrent node pointer to ourselves.\n this.cur = node;\n }\n };\n\n // Note that we're done with this branch of the tree...\n this.endChildren = function() {\n // ... by moving \"up\" to our parent node (if possible).\n if ((this.cur.parent !== null) && (this.cur.parent.name !== undefined))\n {\n this.cur = this.cur.parent;\n }\n else\n {\n // TODO: Some sort of error logging.\n // This really should not happen, but it will, of course.\n }\n };\n\n // Return a string representation of the tree.\n this.toString = function() {\n // Initialize the result string.\n var traversalResult = \"\";\n\n // Recursive function to handle the expansion of the nodes.\n function expand(node, depth)\n {\n // Space out based on the current depth so\n // this looks at least a little tree-like.\n for (var i = 0; i < depth; i++)\n {\n traversalResult += \"-\";\n }\n\n // If there are no children (i.e., leaf nodes)...\n if (!node.children || node.children.length === 0)\n {\n // ... note the leaf node.\n traversalResult += \"[\" + node.name + \"]\";\n traversalResult += \"\\n\";\n }\n else\n {\n // There are children, so note these interior/branch nodes and ...\n traversalResult += \"<\" + node.name + \"> \\n\";\n // .. recursively expand them.\n for (var i = 0; i < node.children.length; i++)\n {\n expand(node.children[i], depth + 1);\n }\n }\n }\n // Make the initial call to expand from the root.\n expand(this.root, 0);\n // Return the result.\n return traversalResult;\n };\n}", "title": "" }, { "docid": "35510ed2ec40c7cfcf7c98bfa31f0415", "score": "0.5816047", "text": "function buildTree(config) {\n var treeData = config.treeData,\n order = config.order || false,\n type = config.type || 'normal',\n id = config.id,\n $el = $('<ul class=\"pho-tree\" id=\"' + id + '\"></ul>'),\n target_all = config.target ? 'target=\"' + config.target + '\"' : '';\n\n appendChildren(treeData, $el);\n initInteractive($el);\n return $el;\n\n function appendChildren(data, $parent) {\n var $node;\n var $sub;\n\n if (order) {\n data = ourderByProperty(data, order);\n }\n angular.forEach(data, function (d) {\n //build $node, set info as 'data' property\n if (type === 'normal') {\n $node = $('<li><label><a href=\"javascript:void(0);\">' + d.name + '</a></label></li>');\n } else {\n var url = d.url ? d.url : 'javascript:void(0);',\n target = d.target ? 'target=\"' + d.target + '\"' : target_all;\n $node = $('<li><label><a href=\"' + url + '\" ' + target + '>' + d.name + '</a></label></li>');\n }\n $node.data('data', d);\n\n //append $node to $parent\n $parent.append($node);\n\n //if d has items, append items\n if (d.items.length > 0) {\n $sub = $('<ul class=\"pho-tree-menu\"></ul>');\n $node.append($sub);\n appendChildren(d.items, $sub)\n }\n\n });\n //order data array by given property\n function ourderByProperty(data, property) {\n if (!property) {\n return data;\n }\n\n var arr = data.splice(0, 1);\n\n for (var i = 0, l = data.length; i < l; i++) {\n for (var j = 0, m = arr.length; j < m; j++) {\n if (data[i][property] < arr[j][property] && j !== m) {\n continue;\n } else {\n arr.splice(j, 0, data[i]);\n break;\n }\n }\n }\n\n return arr.reverse();\n }\n }\n }", "title": "" }, { "docid": "51c0e50da57e834e8903dfd38aae2d92", "score": "0.581259", "text": "function createBinaryTree(arr){\n if (arr.length === 1) {\n return new Node(arr[0]);\n }\n let mid = Math.floor(arr.length / 2);\n let node = new Node(arr[mid]);\n node.left = createBinaryTree(arr.slice(0,mid));\n node.right = createBinaryTree(arr.slice(mid,arr.length));\n return node;\n}", "title": "" }, { "docid": "33cbcd654bd21b8ab27388dafbe69405", "score": "0.5805035", "text": "function tree(list) {\n var mapped = {}\n for (var i = 0, item; i < list.length; i++) {\n item = list[i]\n if (!item || !item.id) continue\n mapped[item.id] = item\n }\n \n var result = []\n for (var ii = 0; ii < list.length; ii++) {\n item = list[ii]\n \n if (!item) continue\n /* jshint -W041 */\n if (item.pid == undefined && item.parentId == undefined) {\n result.push(item)\n continue\n }\n var parent = mapped[item.pid] || mapped[item.parentId]\n if (!parent) continue\n if (!parent.children) parent.children = []\n parent.children.push(item)\n }\n return result\n }", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.58015805", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.58015805", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.58015805", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.58015805", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.58015805", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.58015805", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "1d3927b6316cdd700c64643a64c5b9a0", "score": "0.57858115", "text": "function buildTree(i, tree) {\n _.each(tree, function(val, key) {\n try {\n var Nodes = _.filter(GROUPED_DOTS[KEYS[i]], function(item) {\n return item.Numbering.startsWith(val.Numbering + \".\");\n });\n\n if (Nodes.length > 0) {\n val = Object.assign(val, { Nodes: Nodes });\n buildTree(i + 1, Nodes);\n } else {\n //val = Object.assign(val, {\"Nodes\":[]});\n }\n val = Object.assign(val, { Level: levelOfItem(val) });\n } catch (e) {} //if error, tree will be untouched\n });\n}", "title": "" }, { "docid": "be72c5a4c884e21cf7ab4a6b8bb8b810", "score": "0.57782805", "text": "function buildHierarchy($appendTo, nodeData, level, opts, callback)\n\t{\n\t\tvar $nodeWrapper;\n\t\t// Construct the node\n\t\tvar $childNodes = nodeData.children;\n\t\tvar hasChildren = $childNodes ? $childNodes.length : false;\n\t\tvar isVerticalNode = (opts.verticalDepth && (level + 1) >= opts.verticalDepth) ? true : false;\n\t\tif(Object.keys(nodeData).length > 1)\n\t\t{ // if nodeData has nested structure\n\t\t\t$nodeWrapper = isVerticalNode ? $appendTo : $('<table>');\n\t\t\tif(!isVerticalNode)\n\t\t\t{\n\t\t\t\t$appendTo.append($nodeWrapper);\n\t\t\t}\n\t\t\t$.when(createNode(nodeData, level, opts))\n\t\t\t\t.done(function($nodeDiv)\n\t\t\t\t{\n\t\t\t\t\tif(isVerticalNode)\n\t\t\t\t\t{\n\t\t\t\t\t\t$nodeWrapper.append($nodeDiv);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$nodeWrapper.append($nodeDiv.wrap('<tr><td' + (hasChildren ? ' colspan=\"' + $childNodes.length * 2 + '\"' : '') + '></td></tr>').closest('tr'));\n\t\t\t\t\t}\n\t\t\t\t\tif(callback)\n\t\t\t\t\t{\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.fail(function()\n\t\t\t\t{\n\t\t\t\t\tconsole.log('Failed to creat node')\n\t\t\t\t});\n\t\t}\n\t\t// Construct the inferior nodes and connectiong lines\n\t\tif(hasChildren)\n\t\t{\n\t\t\tif(Object.keys(nodeData).length === 1)\n\t\t\t{ // if nodeData is just an array\n\t\t\t\t$nodeWrapper = $appendTo;\n\t\t\t}\n\t\t\tvar isHidden = (level + 1 >= opts.depth || nodeData.collapsed) ? ' hidden' : '';\n\t\t\tvar isVerticalLayer = (opts.verticalDepth && (level + 2) >= opts.verticalDepth) ? true : false;\n\t\t\t\n\t\t\t// draw the line close to parent node\n\t\t\tif(!isVerticalLayer)\n\t\t\t{\n\t\t\t\t$nodeWrapper.append('<tr class=\"lines' + isHidden + '\"><td colspan=\"' + $childNodes.length * 2 + '\"><div class=\"downLine\"></div></td></tr>');\n\t\t\t}\n\t\t\t// draw the lines close to children nodes\n\t\t\tvar lineLayer = '<tr class=\"lines' + isHidden + '\"><td class=\"rightLine\">&nbsp;</td>';\n\t\t\tfor(var i = 1; i < $childNodes.length; i++)\n\t\t\t{\n\t\t\t\tlineLayer += '<td class=\"leftLine topLine\">&nbsp;</td><td class=\"rightLine topLine\">&nbsp;</td>';\n\t\t\t}\n\t\t\tlineLayer += '<td class=\"leftLine\">&nbsp;</td></tr>';\n\t\t\tvar $nodeLayer;\n\t\t\tif(isVerticalLayer)\n\t\t\t{\n\t\t\t\t$nodeLayer = $('<ul>');\n\t\t\t\tif(isHidden)\n\t\t\t\t{\n\t\t\t\t\t$nodeLayer.addClass(isHidden);\n\t\t\t\t}\n\t\t\t\tif(level + 2 === opts.verticalDepth)\n\t\t\t\t{\n\t\t\t\t\t$nodeWrapper.append('<tr class=\"verticalNodes' + isHidden + '\"><td></td></tr>')\n\t\t\t\t\t\t.find('.verticalNodes').children().append($nodeLayer);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$nodeWrapper.append($nodeLayer);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nodeLayer = $('<tr class=\"nodes' + isHidden + '\">');\n\t\t\t\t$nodeWrapper.append(lineLayer).append($nodeLayer);\n\t\t\t}\n\t\t\t// recurse through children nodes\n\t\t\t$.each($childNodes, function()\n\t\t\t{\n\t\t\t\tvar $nodeCell = isVerticalLayer ? $('<li>') : $('<td colspan=\"2\">');\n\t\t\t\t$nodeLayer.append($nodeCell);\n\t\t\t\tbuildHierarchy($nodeCell, this, level + 1, opts, callback);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "1410c9e60e2ec3357d86eed6319eebc5", "score": "0.57584774", "text": "function list_to_tree(array){\n var map = {};\n for(var i = 0; i < array.length; i++){\n var obj = array[i];\n obj.children= [];\n\n map[obj.id] = obj;\n\n var parent = obj.parentId || '-';\n if(!map[parent]){\n map[parent] = {\n children: []\n };\n }\n map[parent].children.push(obj);\n }\n console.log(map);\n return map['-'].children;\n\n}", "title": "" }, { "docid": "d4ac8aecad6fb1d050bc468446f3475e", "score": "0.57516074", "text": "function createFolderXmlTree(treeNode, xmlNode, indent) {\n if (indent === void 0) { indent = Camel.increaseIndent(\"\"); }\n var folder = treeNode.data || treeNode;\n var count = 0;\n var parentName = getFolderCamelNodeId(folder);\n if (folder) {\n if (!xmlNode) {\n xmlNode = document.createElement(parentName);\n var rootJson = Camel.getRouteFolderJSON(folder);\n if (rootJson) {\n Camel.setRouteNodeJSON(xmlNode, rootJson, indent);\n }\n }\n var doc = xmlNode.ownerDocument || document;\n var namespaceURI = xmlNode.namespaceURI;\n var from = parentName !== \"route\";\n var childIndent = Camel.increaseIndent(indent);\n angular.forEach(treeNode.children || treeNode.getChildren(), function (childTreeNode) {\n var childFolder = childTreeNode.data || childTreeNode;\n var name = Camel.getFolderCamelNodeId(childFolder);\n var json = Camel.getRouteFolderJSON(childFolder);\n if (name && json) {\n var language = false;\n if (name === \"endpoint\") {\n if (from) {\n name = \"to\";\n }\n else {\n name = \"from\";\n from = true;\n }\n }\n if (name === \"expression\") {\n var languageName = json[\"language\"];\n if (languageName) {\n name = languageName;\n language = true;\n }\n }\n // lets create the XML\n xmlNode.appendChild(doc.createTextNode(\"\\n\" + childIndent));\n var newNode = doc.createElementNS(namespaceURI, name);\n Camel.setRouteNodeJSON(newNode, json, childIndent);\n xmlNode.appendChild(newNode);\n count += 1;\n createFolderXmlTree(childTreeNode, newNode, childIndent);\n }\n });\n if (count) {\n xmlNode.appendChild(doc.createTextNode(\"\\n\" + indent));\n }\n }\n return xmlNode;\n }", "title": "" }, { "docid": "50f42d9524adbf2fb646d557e333c3b4", "score": "0.5726124", "text": "function copyTree(oldTree){\n\tvar newTree = {}; //copy of old tree with values passed, not references\n\tfor(var i in oldTree){\n\t\tif(i !== \"children\"){\n\t\t\t//copy all of the attributes and values that aren't \"children\"\n\t\t\tnewTree[i] = oldTree[i];\n\t\t}\n\t}\n\t//now deal with children\n\tif(oldTree.children && oldTree.children.length){\n\t\tnewTree.children = [];\n\t\tfor(var i = 0; i < oldTree.children.length; i++){\n\t\t\tnewTree.children.push(copyTree(oldTree.children[i])); //recursive function call\n\t\t}\n\t}\n\treturn newTree;\n}", "title": "" }, { "docid": "862c810aefcc29613a89bcac6e3efb12", "score": "0.57148737", "text": "function TreeViewImpl_createTree(info) {\n// Debug.log('==START createTree')\n info.foldersToggled = [] // all folders that get toggled at client side, starting empty\n var container = document.getElementById(info.id);\n var buf = new StringBuffer();\n TreeViewImpl_createChildNodes(buf, info);\n container.innerHTML = buf.toString();\n// Debug.log('--END createTree')\n}", "title": "" }, { "docid": "739cbc951587855e4fc1dc376e289509", "score": "0.57113457", "text": "function tree(list) {\n\t\t var mapped = {}\n\t\t for (var i = 0, item; i < list.length; i++) {\n\t\t item = list[i]\n\t\t if (!item || !item.id) continue\n\t\t mapped[item.id] = item\n\t\t }\n\t\n\t\t var result = []\n\t\t for (var ii = 0; ii < list.length; ii++) {\n\t\t item = list[ii]\n\t\n\t\t if (!item) continue\n\t\t /* jshint -W041 */\n\t\t if (item.pid == undefined && item.parentId == undefined) {\n\t\t result.push(item)\n\t\t continue\n\t\t }\n\t\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t\t if (!parent) continue\n\t\t if (!parent.children) parent.children = []\n\t\t parent.children.push(item)\n\t\t }\n\t\t return result\n\t\t}", "title": "" }, { "docid": "31ccbc3ead23dc302a9b9e8d06986531", "score": "0.57083154", "text": "function Tree()\n{\n this.treeRoot=null;\n this.expandAble=false;\n this.expandDepth=1;\n this.browser=0;\n \n \n this.displayTree=displayTree;\n this.addRoot=addRoot;\n this.addItem=addItem;\n this.createNodeIndex=createNodeIndex;\n\n}", "title": "" }, { "docid": "5ed43c9cc8f587ec902f9c9b2cca9c3a", "score": "0.57059175", "text": "function addTree(newick, name) {\n\n if (name === undefined) {\n var num = trees.length;\n name = \"Tree \" + num;\n }\n var tree = convertTree(newick);\n\n /*try {\n var tree = convertTree(newick); // calls convert function from above\n //console.log(tree)\n } catch (err) {\n throw \"Invalid Newick\";\n }*/\n for (var i = 0; i < trees.length; i++) {\n if (name === trees[i].name) {\n throw \"Tree With Name Already Exists\";\n }\n }\n //add required parameters to each node\n postorderTraverse(tree, function(d) {\n d.ID = makeId(\"node_\");\n d.leaves = getChildLeaves(d);\n d.clickedParentHighlight = false;\n d.mouseoverHighlight = false; //when mouse is over node\n d.mouseoverLinkHighlight = false; //when mouse is over branch between two nodes\n d.correspondingHighlight = false;\n d.collapsed = false; //variable to obtain the node/nodes where collapsing starts\n });\n\n var root_ID = makeId(\"node_\");\n for (var i = 0; i < tree.children.length; i++){\n tree.children[i].ID = root_ID;\n }\n\n\n var fullTree = {\n root: tree,\n name: name,\n data: {}\n };\n fullTree.data.autoCollapseDepth = getRecommendedAutoCollapse(tree);\n\n\n trees.push(fullTree);\n\n\n return fullTree;\n }", "title": "" }, { "docid": "7ddf5326bfeacdd1ad46443545081caf", "score": "0.57018864", "text": "cloneTree(treeDataArr) {\n let newTree = [];\n for (var i = 0; i < treeDataArr.length; i++) {\n let newNode = {};\n for (let k in treeDataArr[i]) {\n if (treeDataArr[i].hasOwnProperty(k)) {\n if (k === 'children') {\n newNode[k] = this.cloneTree(treeDataArr[i][k]);\n } else {\n newNode[k] = treeDataArr[i][k]\n }\n }\n }\n newTree.push(newNode);\n }\n return newTree\n }", "title": "" }, { "docid": "71f42612d7b06c05ffa4169dd9e2e65b", "score": "0.56975096", "text": "function arrToTree() {\n\tlet nums = [10, 5, 15, 3, 20, 7, 13]\n\n\tlet tree = new Tree();\n\tfor (let i=0; i<nums.length; i++) {\n\t\ttree.addValue(nums[i]);\n\t}\n\n\treturn tree;\n}", "title": "" }, { "docid": "6f9b4a27cea6585148a01559d74e89c0", "score": "0.5693455", "text": "function _tree(list) {\n let mapped = {};\n let result = [];\n for (let i = 0, item; i < list.length; i++) {\n item = list[i];\n if (!item || !item.id) continue;\n mapped[item.id] = item;\n }\n for (let ii = 0, item; ii < list.length; ii++) {\n item = list[ii]\n if (!item) continue\n if (item.pid == undefined && item.parentId == undefined) {\n result.push(item)\n continue;\n }\n let parent = mapped[item.pid] || mapped[item.parentId]\n if (!parent) continue\n if (!parent.children) parent.children = []\n parent.children.push(item);\n }\n return result\n}", "title": "" }, { "docid": "effd93f2fdd9eee8723f549e5e0cce5e", "score": "0.5690116", "text": "function generateBinaryTree(depth) {\n if (typeof depth != \"number\" || depth < 1) {\n throw new Error();\n } \n\n let bt = new BinaryTree();\n let curr = [bt.root];\n let prev = [];\n\n for (let i = 1; i < depth; ++i) {\n prev = curr;\n curr = [];\n\n prev.forEach(node => {\n curr.push(node.addLeft());\n curr.push(node.addRight());\n });\n }\n\n return bt;\n}", "title": "" }, { "docid": "8bbb89c33c30ccde2a82cf90f5dffa77", "score": "0.56880933", "text": "function list_to_tree(list) {\n var map = {},\n node,\n roots = [],\n i;\n for (i = 0; i < list.length; i += 1) {\n map[list[i].id] = i; // initialize the map\n list[i].children = []; // initialize the children\n }\n for (i = 0; i < list.length; i += 1) {\n node = list[i];\n if (node.parentId !== null) {\n // if you have dangling branches check that map[node.parentId] exists\n list[map[node.parentId]].children.push(node);\n } else {\n roots.push(node);\n }\n }\n return roots;\n}", "title": "" }, { "docid": "e8f08ba6cb069ffe8f17d571f07677f5", "score": "0.56835884", "text": "function tree(list) {\n\t\t var mapped = {}\n\t\t for (var i = 0, item; i < list.length; i++) {\n\t\t item = list[i]\n\t\t if (!item || !item.id) continue\n\t\t mapped[item.id] = item\n\t\t }\n\n\t\t var result = []\n\t\t for (var ii = 0; ii < list.length; ii++) {\n\t\t item = list[ii]\n\n\t\t if (!item) continue\n\t\t /* jshint -W041 */\n\t\t if (item.pid == undefined && item.parentId == undefined) {\n\t\t result.push(item)\n\t\t continue\n\t\t }\n\t\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t\t if (!parent) continue\n\t\t if (!parent.children) parent.children = []\n\t\t parent.children.push(item)\n\t\t }\n\t\t return result\n\t\t}", "title": "" }, { "docid": "351333d82ef18e6584c1d107360abd82", "score": "0.5676614", "text": "function buildTree(cats, out, options, parent, depth) {\r\n\t\tvar len = cats.length,\r\n\t\t\tcat;\r\n\r\n\t\tdepth = depth ? depth : 0;\r\n\t\toptions.depth = options.depth ? options.depth : 0;\r\n\r\n\t\twhile (len--) {\r\n\t\t\tcat = cats[len];\r\n\t\t\t\r\n\t\t\tif (cat.categories) {\r\n\t\t\t\tif (parent) {\r\n\t\t\t\t\tcat.parent = parent;\r\n\t\t\t\t}\r\n\t\t\t\tbuildTree(cat.categories, out, options, cat, depth + 1);\r\n\t\t\t} else {\r\n\t\t\t\taddLeaf(out, cat, parent);\r\n\t\t\t}\r\n\t\t}\r\n\t\toptions.depth = mathMax(options.depth, depth);\r\n\t}", "title": "" }, { "docid": "d51117c27e700d44f44638fcb00f6c3a", "score": "0.5675941", "text": "function Trees() {\n}", "title": "" }, { "docid": "d51117c27e700d44f44638fcb00f6c3a", "score": "0.5675941", "text": "function Trees() {\n}", "title": "" }, { "docid": "74e7877bd16bd16d3462e6d3fdc0f07b", "score": "0.56593937", "text": "insertRecursively(val) {\n\t\tif (!this.root) {\n\t\t\tthis.root = new Node(val);\n\t\t\treturn this;\n\t\t}\n\t\tthis.root.insert(val);\n\t\treturn this;\n\t}", "title": "" }, { "docid": "055f5f35763dba476734cdc671490724", "score": "0.5658549", "text": "function createEntTree(dm_entity_id) { \n\tvar newTree = entTree(dm_entity_id);\n\tentity_trees[dm_entity_id] = newTree;\n}", "title": "" }, { "docid": "63fd992e4108050f69699d51b6bf854d", "score": "0.5655669", "text": "function galleryTreeBuild(where, level, data){\n\n\tif(data.length == 0) return true;\n\t\n\twhere.empty();\n\n\t$.each(data, function(i, d){\n\t\t\n\t\tvar li_ \t= $('<li />').appendTo(where);\n\t\tvar item_\t= $('<div id=\"'+d.id_content+'\" class=\"item clearfix dropme\"/>').appendTo(li_);\n\t\tvar act_\t= $('<span class=\"toggle\" style=\"margin-left:'+(level * 16)+'px\" />').appendTo(item_).bind('click', function() {\n\n\t\t\tif($(this).parent('li').hasClass('opened')){\n\t\t\t\tgalleryTreeClose($(this));\n\t\t\t}else{\n\t\t\t\tgalleryTreeOpen(d.id_content, (level+1), $(this));\n\t\t\t}\n\t\t});\n\n\t\t$('<a class=\"name\" href=\"#'+d.id_content+'\">'+d.contentName+'</a>').appendTo(item_).bind('click', function() {\n\t\t\tgalleryAlbum(d.id_content, false);\n\t\t});\n\t\t\n\t\t$('<ul />').appendTo(li_);\n\n\t\tconsole.log(treeReload);\n\t\t//// Reload tree\n\t\tif(treeReload.length > 0){\n\t\t\ttreeReload.some(function(item, index){\n\t\t\t\tif(item == d.id_content) act_.trigger('click');\n\t\t\t});\n\t\t}\t\n\t});\n}", "title": "" }, { "docid": "7e367a06731a1494ea663be74a643c7d", "score": "0.56530774", "text": "function tree(list) {\n\t var mapped = {}\n\t for (var i = 0, item; i < list.length; i++) {\n\t item = list[i]\n\t if (!item || !item.id) continue\n\t mapped[item.id] = item\n\t }\n\n\t var result = []\n\t for (var ii = 0; ii < list.length; ii++) {\n\t item = list[ii]\n\n\t if (!item) continue\n\t /* jshint -W041 */\n\t if (item.pid == undefined && item.parentId == undefined) {\n\t result.push(item)\n\t continue\n\t }\n\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t if (!parent) continue\n\t if (!parent.children) parent.children = []\n\t parent.children.push(item)\n\t }\n\t return result\n\t}", "title": "" }, { "docid": "7e367a06731a1494ea663be74a643c7d", "score": "0.56530774", "text": "function tree(list) {\n\t var mapped = {}\n\t for (var i = 0, item; i < list.length; i++) {\n\t item = list[i]\n\t if (!item || !item.id) continue\n\t mapped[item.id] = item\n\t }\n\n\t var result = []\n\t for (var ii = 0; ii < list.length; ii++) {\n\t item = list[ii]\n\n\t if (!item) continue\n\t /* jshint -W041 */\n\t if (item.pid == undefined && item.parentId == undefined) {\n\t result.push(item)\n\t continue\n\t }\n\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t if (!parent) continue\n\t if (!parent.children) parent.children = []\n\t parent.children.push(item)\n\t }\n\t return result\n\t}", "title": "" }, { "docid": "7e367a06731a1494ea663be74a643c7d", "score": "0.56530774", "text": "function tree(list) {\n\t var mapped = {}\n\t for (var i = 0, item; i < list.length; i++) {\n\t item = list[i]\n\t if (!item || !item.id) continue\n\t mapped[item.id] = item\n\t }\n\n\t var result = []\n\t for (var ii = 0; ii < list.length; ii++) {\n\t item = list[ii]\n\n\t if (!item) continue\n\t /* jshint -W041 */\n\t if (item.pid == undefined && item.parentId == undefined) {\n\t result.push(item)\n\t continue\n\t }\n\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t if (!parent) continue\n\t if (!parent.children) parent.children = []\n\t parent.children.push(item)\n\t }\n\t return result\n\t}", "title": "" }, { "docid": "7e367a06731a1494ea663be74a643c7d", "score": "0.56530774", "text": "function tree(list) {\n\t var mapped = {}\n\t for (var i = 0, item; i < list.length; i++) {\n\t item = list[i]\n\t if (!item || !item.id) continue\n\t mapped[item.id] = item\n\t }\n\n\t var result = []\n\t for (var ii = 0; ii < list.length; ii++) {\n\t item = list[ii]\n\n\t if (!item) continue\n\t /* jshint -W041 */\n\t if (item.pid == undefined && item.parentId == undefined) {\n\t result.push(item)\n\t continue\n\t }\n\t var parent = mapped[item.pid] || mapped[item.parentId]\n\t if (!parent) continue\n\t if (!parent.children) parent.children = []\n\t parent.children.push(item)\n\t }\n\t return result\n\t}", "title": "" }, { "docid": "2ab6fe0ca6c66d35eb1dea8ca4eb377c", "score": "0.5644836", "text": "addToTree() {\n let parser = new NFQReflowTemplateParser(this.props, this.children, this.template);\n let renderedTemplate = parser.parse();\n\n this.usedChildren = parser.getUsedChilds();\n\n this.hash = NFQReflowTree.addNode(this, renderedTemplate);\n }", "title": "" }, { "docid": "5ee81ab52d3b542119482281f5b5f7f5", "score": "0.56359017", "text": "function addDirectoryTreeToJSTree(parent, tree) {\n //if the current node is a directory\n if (tree.type === 'directory') {\n let childId = $('#file-container').jstree(true).create_node(parent, {\n 'id': getTimeStampWithMS(),\n 'text': tree.name,\n 'icon': folderIconPath,\n 'type': 'folder'\n });\n //recursive call for children\n if (tree.children) {\n tree.children.forEach((element) => {\n addDirectoryTreeToJSTree(childId, element)\n });\n }\n }\n //if the current node is a file\n if (tree.type === 'file') {\n let stats = fs.statSync(tree.path);\n let sizeInMb = stats[\"size\"] / 1000000.0;\n let modifiedDateMs = stats[\"mtimeMs\"];\n let birthtime = stats[\"birthtime\"];\n $('#file-container').jstree(tree).create_node(parent, {\n 'id': getTimeStampWithMS(),\n 'text': tree.name,\n 'type': 'file',\n 'icon': fileIconPath,\n 'data': {\n \"sourceFile\": tree.path,\n \"notes\": \"\",\n \"size\": sizeInMb,\n \"modifiedDateMs\": modifiedDateMs,\n \"birthtime\": birthtime\n },\n });\n }\n}", "title": "" }, { "docid": "90fb5727024b7d34143eabcbe19e58b1", "score": "0.5634405", "text": "function parseTree(db, n, parent, hasParent){\n var node = db[i];\n var obj = node;\n obj.parent = parent;\n obj.depth = n;\n if(parent == null){\n var prop = [];\n } else{\n var prop = parent.properties.slice();\n obj.hasParent = hasParent;\n if(hasParent){\n prop.push(parent.name);\n }\n }\n obj.properties = prop;\n i++;\n if(node.weight){ // neither leaf node nor undefined\n if(node.weight == 1){\n //Trim tree to leaf\n var right = parseTree(db, n, parent, true);\n var left = parseTree(db, n, parent, false);\n if(right.name == null){\n left.hasParent = hasParent;\n return left;\n } else{\n right.hasParent = hasParent;\n return right;\n }\n } else{\n obj.children = []\n obj.children[0] = parseTree(db, n + 1, obj, true);\n obj.children[1] = parseTree(db, n + 1, obj, false);\n }\n } else if(node.weight == undefined){ // null node\n obj.name = null; \n }\n return obj;\n }", "title": "" }, { "docid": "22c912e52edd01ed3f4324eeddd28e5d", "score": "0.56296134", "text": "tree() {\n var list = [this];\n this.children.forEach((child) => {\n list.push(child.tree());\n });\n \n return _.flatten(list);\n }", "title": "" }, { "docid": "87be75e325e61424b020c7c517d7d041", "score": "0.56264627", "text": "function traverse(node){\n const tree = {value : node.value,\n height : node.height};\n tree.left = (node.left === null)? null : traverse(node.left);\n tree.right = (node.right === null)?null : traverse(node.right);\n return tree;\n}", "title": "" }, { "docid": "6069c854dace18c3ffce85c176ef7027", "score": "0.5624904", "text": "function createTreeNode(_id, _text, _type, _children) {\n return { id: _id, text: _text, type: _type, children: _children };\n}", "title": "" }, { "docid": "b3dfa18a11beb0c58875f04a363ff8c8", "score": "0.5619299", "text": "function createNodeJson(node, levelConfig, index, maxlvl) {\n var childNode, children, stepSize, color,\n lvl = levelConfig[index] || globals,\n newNode = {\n id: getProperty(node, lvl.idPath) || '',\n name: node[lvl.namePath] || '',\n lvl: index,\n size: getProperty(node, lvl.areaPath) !== undefined ? getProperty(node, lvl.areaPath) : 1,\n colorSize: getProperty(node, lvl.colorPath) || 0,\n fontSize: lvl.fontSize,\n fontFamily: lvl.fontFamily,\n fontColor: lvl.fontColor\n };\n\n\n // Check if leaf node:\n if (!getProperty(node, lvl.childrenPath)) {\n if (maxlvl.value < index) maxlvl.value = index; // Update the max depth to the leaf's depth (if deeper than maxlvl's value):\n return newNode;\n }\n\n // Set default properties of node with children:\n newNode.children = [];\n newNode.childrenReference = [];\n\n // Node has children, so set them up first:\n children = getProperty(node, lvl.childrenPath);\n\n //Convert to array if it is not\n if (!is(children,'array')) {\n a = [];\n Object.keys(children).forEach(function (k) {\n a.push(children[k]);\n });\n children = a;\n }\n\n\n for (var i = 0; i < children.length; i += 1) {\n childNode = createNodeJson(children[i], levelConfig, index + 1, maxlvl); //recursion\n childNode.parent = newNode;\n childNode.index = i; // Set node's index to match the index it appears in the original dataset.\n\n // If parent has no size, default to adding child colors.\n if (getProperty(node, lvl.areaPath) === undefined) {\n newNode.size += childNode.size;\n }\n\n // If parent has no color, default to adding child colors.\n if (getProperty(node, lvl.colorPath) === undefined) {\n newNode.colorSize += childNode.colorSize;\n }\n\n newNode.minSize = Math.min(newNode.minSize || childNode.size, childNode.size);\n newNode.maxSize = Math.max(newNode.maxSize || childNode.size + 1, childNode.size);\n newNode.minColor = Math.min(newNode.minColor || childNode.colorSize, childNode.colorSize);\n newNode.maxColor = Math.max(newNode.maxColor || childNode.colorSize + 1, childNode.colorSize);\n\n // d3 reorganizes the children later in the code, so the following array is used to preserve children order for indexing:\n newNode.children[i] = newNode.childrenReference[i] = childNode;\n }\n\n nodeScale.range(levelConfig.length <= index + 1 ? globals.colorPalette : levelConfig[index + 1].colorPalette);\n // Set domain of color values:\n stepSize = (newNode.maxColor - newNode.minColor) / Math.max(nodeScale.range().length - 1, 1);\n nodeScale.domain(d3.range(newNode.minColor, newNode.maxColor + stepSize, stepSize));\n\n for (var i = 0; i < children.length; i += 1) newNode.children[i].color = nodeScale(newNode.children[i].colorSize);\n\n return newNode;\n }", "title": "" }, { "docid": "979f7ee369295bc7150314e48627a22f", "score": "0.5612709", "text": "function Tree(){\n this.root = null;\n}", "title": "" }, { "docid": "5bcba45df371d590edf3ea59010dbc37", "score": "0.55958694", "text": "addChildren(value) {\n const child = new Tree(value);\n this.children.push(child);\n }", "title": "" }, { "docid": "e62432728c484abeb2f791da0495ae00", "score": "0.5586109", "text": "function createHTMLTree(html, root) {\n const template = isTemplate(root)\n ? root\n : document.createElement('template')\n template.innerHTML = html\n return template.content\n }", "title": "" } ]
eda302d414eb54cedb9eb6b7e8b6d033
Move numbers to the up side
[ { "docid": "97005987be8abc44173f9b259c081a32", "score": "0.69096965", "text": "function moveUp() {\n\tfor (let i = 0; i < WIDTH; i++) {\n\t\tcolumn = removeZeros(FIELD.map((e) => e[i]));\n\t\tcolumn = slideLeft(column);\n\t\tfor (let j = 0; j < HEIGHT; j++) {\n\t\t\tFIELD[j][i] = column[j];\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "220434f89f7f468ab1b453fef9fbe4b5", "score": "0.6970587", "text": "function moveUp() {\n\t\t var newIndexEmptyCell = +emptyCell.style.order + numberOfCellsInRow;\n\t\t if(newIndexEmptyCell <= numberOfCells) {\n\t\t \texchangeEmptyCellByOrder(newIndexEmptyCell);\n\t\t }\n\t}", "title": "" }, { "docid": "0f4d79fee6b7e2009b311878f753bab1", "score": "0.69446397", "text": "function up() {\n\tcurrIndex = Math.max(0, currIndex - 1);\n\tdisplay();\n}", "title": "" }, { "docid": "97f5b5e8ad2a32e12d6951ab243ec677", "score": "0.6902081", "text": "_sortBottomUp(): void {\n let current = this.size - 1;\n let parent = current % 2 === 0 ? current / 2 - 1 : (current + 1) / 2 - 1;\n\n while (current > 0 && this._values[current] < this._values[parent]) {\n this._swapIndices(current, parent);\n\n current = parent;\n parent = current % 2 === 0 ? current / 2 - 1 : (current + 1) / 2 - 1;\n }\n }", "title": "" }, { "docid": "77a0b678d2cf9d4f929d0bbf42b93294", "score": "0.68974304", "text": "function moveFroggerUp() {\n var curCol = getCurrentColumn();;\n var curCell = getCurrentCell();\n if (curCell == 1) {\n return;\n }\n var nextCol = curCol;\n var nextCell = curCell - 1;\n moveFrogger(nextCol, nextCell);\n }", "title": "" }, { "docid": "85efdd05910f2a0db75dc077c393549d", "score": "0.67878246", "text": "moveUp(){\n if ( this.selected && (this.selected.source.num > 1) ){\n this.order(this.selected.source.num, this.selected.source.num - 1, this.selected);\n }\n }", "title": "" }, { "docid": "525bbc68c31f1373d4b241973f45e2f2", "score": "0.6628711", "text": "function shiftUp() {\n for (x = 0; x < maxX; x++) {\n y = 0;\n j = 0;\n added = false;\n while (numbers[j][x] === 0) {\n j++;\n if (j === maxY) {\n break;\n }\n }\n if (j === maxY) {\n y = maxY;\n } else {\n numbers[y][x] = numbers[j][x];\n animateShiftY(j, x, y);\n j++;\n }\n for (j; j < maxY; j++) {\n if (numbers[j][x] !== 0) {\n if (numbers[j][x] === numbers[y][x] && added === false) {\n numbers[y][x] += numbers[j][x];\n animateAddY(j, y, x);\n added = true;\n } else {\n y++;\n numbers[y][x] = numbers[j][x];\n animateShiftY(j, x, y);\n added = false;\n }\n }\n }\n y++;\n for (y; y < maxY; y++) {\n numbers[y][x] = 0;\n }\n }\n}", "title": "" }, { "docid": "f1a0ca24337d549ad93c2b10f00b6fa2", "score": "0.6593182", "text": "function goUp() {\n setCount(count + 1);\n }", "title": "" }, { "docid": "da784f641f472c0e62adf780acb7ccd0", "score": "0.65501285", "text": "function moveUp() {\n for ( var i = 1; i < 4; i ++ ) {\n for ( var j = 0; j < 4; j ++ ) {\n if (arr[i - 1][j] == 0 && arr[i][j] != 0) {\n arr[i - 1][j] = arr[i][j];\n arr[i][j] = 0;\n }\n if (arr[i - 1][j] != 0 && arr[i][j] != 0 && arr[i - 1][j] == arr[i][j]) {\n arr[i - 1][j] *= 2;\n arr[i][j] = 0;\n }\n }\n }\n}", "title": "" }, { "docid": "92b23c355a80da16c77ac163801c4d32", "score": "0.6512389", "text": "stepUp() {\n // uses the Number representation since it simplifies the calculations\n const value = this.valueAsNumber;\n const step = this._getActualStep();\n if (isNaN(value)) {\n this.value = this.max !== null ? Math.min(step, this.max) : step;\n } else {\n const newValue = handleDecimalOperation('+', value, step);\n\n this.value = this.max !== null ? Math.min(newValue, this.max) : newValue;\n }\n }", "title": "" }, { "docid": "a2872887661545657a1175679d669b1b", "score": "0.63821197", "text": "siftUp(node) {\n const parent = this._getParentOfIndex(node.index);\n if (parent) {\n if (node.value < parent.value) {\n this._swap(node.index, parent.index)\n node = {'index': parent.index, 'value': node.value}\n this.siftUp(node)\n }\n }\n }", "title": "" }, { "docid": "da8154b2912f43a8b4755fc1da83c765", "score": "0.6369591", "text": "function move_up(selection_id)\n{\n // find the corresponding row\n var current_row = find_row(selection_id);\n var row_idx = current_row.parent().children().index(current_row);\n\n if (row_idx <= 0)\n // can't move up, already the first row!\n return;\n\n // swap!\n var prev_row = current_row.parent().children().eq(row_idx - 1);\n prev_row.insertAfter(current_row);\n\n refresh_rank();\n}", "title": "" }, { "docid": "49e0bcb991f00c7cc7ab86caf53dd4e6", "score": "0.6367034", "text": "function moveUp() {\r\n var i = arrayPos + offset - 1;\r\n var nextTrack;\r\n var nextTitleDiv;\r\n\r\n if (i >= arrayPos) { i++; }\r\n if (i >= 0) {\r\n nextTrack = dataHolder._trackArray[i].track;\r\n nextTitleDiv = nextTrack.getTitleDiv();\r\n if (nextTitleDiv.position().top > titlediv.position().top) {\r\n nextTitleDiv.css('top', parseFloat(nextTitleDiv.css('top')) + 2 + titlediv.height() + 'px');\r\n titledivPlaceholder.css('top', parseFloat(titledivPlaceholder.css('top')) - 2 - nextTitleDiv.height() + 'px');\r\n offset--;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fed9545247ab5a37e912a597636245b6", "score": "0.63480705", "text": "function moveUp(up = true) {\n // get the tiles from the current column\n for(let i=0; i<4; i++) {\n let column = [];\n // create an array of new column elements\n for(let k=0; k<4; k++) \n column.push(parseInt(squares[i + (width * k)].innerText));\n // get the non-zero tiles\n let filteredColumn = column.filter(n=>n);\n // get the number of empty tiles\n let missing = 4 - (filteredColumn.length);\n // create an array of empty tiles\n let zeros = Array(missing).fill(0);\n // manipulate the new columns according to the key pressed\n let newRow = up ? filteredColumn.concat(zeros): \n zeros.concat(filteredColumn);\n // manipulate the DOM accordingly\n for(let k=0; k<4; k++) \n squares[i + (width * k)].innerText = newRow[k];\n }\n }", "title": "" }, { "docid": "20255da29b036c5a59dba6f9ff4fc8f5", "score": "0.6346851", "text": "function upFront(array, num){\narray.unshift(num);\nreturn(array); \n\n}", "title": "" }, { "docid": "08f07372a847ac147d5bcaef9dd2bed5", "score": "0.6345076", "text": "moveUp() {\n this.dir = -1;\n }", "title": "" }, { "docid": "7f9d36fa3c54eb6dc5b7dab260178e38", "score": "0.6293141", "text": "function moveUp(pos)\n{\n\tmove(pos, pos - 1);\n}", "title": "" }, { "docid": "072acc2f97322e329dbbc6302275b365", "score": "0.62502134", "text": "function moveUp() {\n for (var j = 0; j < size; j++) {\n for (var i = 1; i < size; i++) {\n if (cells[i][j].value) {\n var row = i;\n while (row > 0) {\n if (!cells[row - 1][j].value) {\n cells[row - 1][j].value = cells[row][j].value;\n cells[row][j].value = 0;\n row--;\n }\n else if (cells[row][j].value === cells[row - 1][j].value) {\n cells[row - 1][j].value *= 2;\n score += cells[row - 1][j].value;\n cells[row][j].value = 0;\n break;\n }\n else break;\n }\n }\n }\n }\n pasteNewCell();\n}", "title": "" }, { "docid": "50a8da413df0cbf11181705040a40b12", "score": "0.6215875", "text": "function moveUp() {\n let currentTableRow = $(this)\n .parent() // td\n .parent(); // tr\n let previousTableRow = currentTableRow.prev();\n\n currentTableRow\n .insertBefore(previousTableRow);\n fixLinks();\n }", "title": "" }, { "docid": "d29bc4e901c559f5bb491ab815c0a548", "score": "0.62061083", "text": "function slideUp() {\n for (let i = 0; i < lenBoard; i++) {\n isMoved = []\n // Adiciona no array os numero diferentes de 0\n for (let j = lenBoard - 1; j >= 0; j--) {\n if (grid[j][i] !== 0)\n isMoved.push(grid[j][i])\n }\n // Concatena os numeros iguais\n concatNumbers(isMoved)\n // Completa os arrays com o número 0\n for (let j = isMoved.length; j < 4; j++) {\n isMoved.unshift(0)\n }\n // Altera a coluna do grid\n for (let k = 0; k < lenBoard; k++) {\n grid[k][i] = isMoved[lenBoard - (k + 1)]\n }\n }\n}", "title": "" }, { "docid": "ad88d6dda6ff90248d36f2e35aa951ea", "score": "0.6172", "text": "function jumpUp(values) {\n var index, stepIndex;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function jumpUp$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n index = 0;\n stepIndex = 0;\n\n case 2:\n if (!(index < values.length)) {\n _context5.next = 10;\n break;\n }\n\n index = clampToArraySize(index, values);\n _context5.next = 6;\n return values[index];\n\n case 6:\n stepIndex++;\n index += stepIndex % 2 ? 2 : -1;\n _context5.next = 2;\n break;\n\n case 10:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _marked5);\n}", "title": "" }, { "docid": "4d22f5d53cb444dddc9f75c8b15df57d", "score": "0.61425984", "text": "function up(){\n\t\t\tbird.css('top', parseInt(bird.css('top')) - 7);\n\t\t}", "title": "" }, { "docid": "f9d8c032dd3e5fc9752617b1e3fe2af9", "score": "0.6124733", "text": "function alignUp(x, multiple) {\n if (x % multiple > 0) {\n x += multiple - (x % multiple);\n }\n return x;\n}", "title": "" }, { "docid": "f9d8c032dd3e5fc9752617b1e3fe2af9", "score": "0.6124733", "text": "function alignUp(x, multiple) {\n if (x % multiple > 0) {\n x += multiple - (x % multiple);\n }\n return x;\n}", "title": "" }, { "docid": "f9d8c032dd3e5fc9752617b1e3fe2af9", "score": "0.6124733", "text": "function alignUp(x, multiple) {\n if (x % multiple > 0) {\n x += multiple - (x % multiple);\n }\n return x;\n}", "title": "" }, { "docid": "c1bd7c5f935d8602cc8158d2128cdeae", "score": "0.6101371", "text": "function alignUp(x, multiple) {\n if (x % multiple > 0) {\n x += multiple - (x % multiple);\n }\n return x;\n }", "title": "" }, { "docid": "1034a9c3d4a99ceaf351a46e3523d082", "score": "0.60697705", "text": "function item_exchange_up() {\n $.each(items_selected, function (i, v) {\n items_selected[i] = v - 1;\n [content[v-1], content[v]] = [content[v], content[v-1]]\n });\n }", "title": "" }, { "docid": "0a4ab50502542ebe910460b2a52f7336", "score": "0.6068115", "text": "bubbleUp() {\n let idx = this.values.length - 1;\n let element = this.values[idx];\n // bubble up until reach the beginning of array\n while (idx > 0) {\n let parentIdx = Math.floor((idx - 1) / 2);\n let parent = this.values[parentIdx];\n // or until element is in correct spot\n if (element <= parent) break;\n\n this.values[parentIdx] = element;\n this.values[idx] = parent;\n idx = parentIdx;\n }\n }", "title": "" }, { "docid": "236004c490b4bfb82a6a44d51b9ae4b1", "score": "0.60527307", "text": "function moveUp(e) {\n e.shiftKey ? moveAvatar(0, -2) : moveAvatar(-2, -2);\n}", "title": "" }, { "docid": "413bcbd3454141c6b398bb110eb56200", "score": "0.6052644", "text": "function unshift(nums,newNums){\n for(var i=nums.length;i>=0;--i){\n nums[i] = nums[i-1];\n }\n nums[0] = newNums;\n return nums;\n}", "title": "" }, { "docid": "e77ced95b8ab6c173e3cff9bd0a73ad5", "score": "0.60372454", "text": "function moveup() {\n var grid = $(\"#TestCaseProceduresGrid\");\n var rowIds = grid.jqGrid('getGridParam', 'selarrrow');\n for (var i = 0; i < rowIds.length; i++) {\n var row = grid.find(\"tr#\" + rowIds[i] + \"\");\n // Get the previous/next element in the DOMs\n var newRow = row.prev();\n // Check to see if it is a row\n if (newRow.is(\"tr\") && !newRow.hasClass(\"jqgfirstrow\") && !newRow.hasClass(\"ui-state-highlight\")) {\n row.detach();\n // Move row above/next previous\n newRow.before(row);\n }\n }\n reorder();\n}", "title": "" }, { "docid": "d2310e65b6e7b813bc0dbf7ff016a2be", "score": "0.60333586", "text": "moveUp(gameboard) {\n let tempGameboard = this.compressUp(gameboard);\n let finalGameboard = this.mergeUp(tempGameboard)\n return (this.compressUp(finalGameboard));\n }", "title": "" }, { "docid": "9c36ff980caa9681dd5086f3596de905", "score": "0.60234195", "text": "moveUp(worker) {\n this.moveTo0(this.bottomOf, worker);\n }", "title": "" }, { "docid": "28f4debb3637f4f459287f43224560e2", "score": "0.6014334", "text": "function pushBlocksUp(){\n\tvar x,y;\n\tfor(x=1; x<ROWS; x++){\n\t\tfor(y=0; y<COLS; y++){\n\t\t\tif(x == (ROWS-1)){\n\t\t\t\tboard[x][y] = 0;\n\t\t\t}else{\n\t\t\t\tboard[x][y] = board[x+1][y];\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "718ef0a8b2d70eb6c34a2f64289a7775", "score": "0.60097116", "text": "function up () {\n var index = {h: current.h, v: current.v - 1};\n if (get(index.h, index.v)) {\n _set(index);\n }\n \n }", "title": "" }, { "docid": "f3cd580abd994897a3d5bdfdd738d180", "score": "0.6006087", "text": "moveUp(t) {\n this.tileTo[1] -= 1; this.timeMoved = t; this.direction = directions.up;\n }", "title": "" }, { "docid": "79b1aa97a226cb7a02e8162beaddd2c3", "score": "0.59919244", "text": "unshift(value) {\n \n }", "title": "" }, { "docid": "eca7da783d4a09a68f575df3b4903520", "score": "0.598089", "text": "_siftUp(startIdx) {\n //this._siftUp2(startIdx)\n //return\n\n let currentIdx = startIdx || this.count - 1\n while (this._tree.hasParent(currentIdx) &&\n this._smaller(this._tree.get(currentIdx),\n this._tree.parent(currentIdx))) {\n const parentIdx = this._tree.parentIdx(currentIdx)\n this._tree.swap(currentIdx, parentIdx)\n currentIdx = parentIdx\n }\n }", "title": "" }, { "docid": "36104e9be352dfe44756d5e5a7fb175c", "score": "0.5970296", "text": "function lineup(items) {\n\tvar left = void 0,\n\t right = void 0,\n\t offset = void 0;\n\t// items needs to have at least two items.\n\tfor (var i = 1; i < items.length; i++) {\n\t\tleft = items[i - 1];right = items[i];\n\t\toffset = right.bounds.center.x - right.bounds.left + (left.bounds.right - left.bounds.center.x);\n\t\tright.position.x = left.position.x + offset;\n\t}\n}", "title": "" }, { "docid": "ee5826812f86bb5f4aca821b361deb93", "score": "0.5969883", "text": "bubbleUp() {\n let idx = this.values.length - 1;\n const element = this.values[idx];\n while (idx > 0) {\n // finding the parent is the inverse of the formula above\n let parentIdx = Math.floor((idx - 1) / 2);\n let parent = this.values[parentIdx];\n if (element <= parent) break;\n this.values[parentIdx] = element;\n this.values[idx] = parent;\n idx = parentIdx;\n }\n }", "title": "" }, { "docid": "2cd7d5db4a7003f42b74002a81d365a4", "score": "0.5966484", "text": "function up(){\n bird.css('top', parseInt(bird.css('top')) -10);\n }", "title": "" }, { "docid": "e431851cb6de3e6e3e3f3d338b173e8f", "score": "0.5954977", "text": "function MoveUp(bases, outJust, hitter, first, second, third) {\n const finalBases = [];\n if (bases === 0) {\n if (outJust === \"F\") {\n if (first !== 0) {\n finalBases.push(first);\n }\n else {\n finalBases.push(0);\n }\n if (second !== 0) {\n finalBases.push(second);\n }\n else {\n finalBases.push(0);\n }\n if (third !== 0) {\n finalBases.push(third);\n }\n else {\n finalBases.push(0);\n }\n\n finalBases.push(0);\n }\n else {\n if (first !== 0) {\n finalBases.push(hitter);\n }\n else {\n finalBases.push(0);\n }\n if (second !== 0) {\n finalBases.push(second);\n }\n else {\n finalBases.push(0);\n }\n if (third !== 0) {\n finalBases.push(third);\n }\n else {\n finalBases.push(0);\n }\n\n finalBases.push(0);\n }\n }\n else if (bases === 1) {\n finalBases.push(hitter);\n if (first !== 0) {\n finalBases.push(first);\n }\n else {\n finalBases.push(0);\n }\n if (second !== 0) {\n finalBases.push(second);\n }\n else {\n finalBases.push(0);\n }\n if (third !== 0) {\n finalBases.push(third);\n }\n else {\n finalBases.push(0);\n }\n }\n\n else if (bases === 2) {\n var runs = 0;\n finalBases.push(0);\n finalBases.push(hitter);\n if (first !== 0) {\n finalBases.push(first);\n }\n else {\n finalBases.push(0);\n }\n if (second !== 0) {\n runs = runs + 1;\n }\n if (third !== 0) {\n runs = runs + 1;\n }\n finalBases.push(runs);\n }\n\n else if (bases === 3) {\n var runs = 0;\n finalBases.push(0);\n finalBases.push(0);\n finalBases.push(hitter);\n if (first !== 0) {\n runs = runs + 1;\n }\n if (second !== 0) {\n runs = runs + 1;\n }\n if (third !== 0) {\n runs = runs + 1;\n }\n finalBases.push(runs);\n }\n\n else {\n finalBases.push(0);\n finalBases.push(0);\n finalBases.push(0);\n finalBases.push(4);\n }\n\n return finalBases;\n }", "title": "" }, { "docid": "8dcff8d30a6b0254fd04855048bd0af0", "score": "0.59244573", "text": "function moveDodgerUp() {\n const upNumbers = dodger.style.bottom.replace(\"px\",\"\");\n const up = parseInt(upNumbers, 10);\n\n if (up < 380) {\n dodger.style.bottom = (`${up + 20}px`);\n e.preventDefault();\n }\n}", "title": "" }, { "docid": "508d4b3ef4be30f4a9e525dd6edca2d4", "score": "0.5921247", "text": "function shiftDown() {\n for (x = 0; x < maxX; x++) {\n y = maxY - 1;\n j = maxY - 1;\n added = false;\n while (numbers[j][x] === 0) {\n j--;\n if (j === -1) {\n break;\n }\n }\n if (j === -1) {\n y = -1;\n } else {\n numbers[y][x] = numbers[j][x];\n animateShiftY(j, x, y);\n j--;\n }\n for (j; j > -1; j--) {\n if (numbers[j][x] !== 0) {\n if (numbers[j][x] === numbers[y][x] && added === false) {\n numbers[y][x] += numbers[j][x];\n animateAddY(j, y, x);\n added = true;\n } else {\n y--;\n numbers[y][x] = numbers[j][x];\n animateShiftY(j, x, y);\n added = false;\n }\n }\n }\n y--;\n for (y; y > -1; y--) {\n numbers[y][x] = 0;\n }\n }\n}", "title": "" }, { "docid": "86124f6bf8fabc547b50a272d42405c2", "score": "0.58969265", "text": "bubbleUp() {\n let index = this.values.length - 1;\n while(true) {\n const parentIndex = Math.floor((index -1) / 2);\n if (!this.values[parentIndex]) break;\n if (this.values[parentIndex].priority < this.values[index].priority) break;\n // swap\n [this.values[parentIndex], this.values[index]] = [this.values[index], this.values[parentIndex]];\n index = parentIndex;\n }\n }", "title": "" }, { "docid": "5bce0190c2fed5b31cba03513539d410", "score": "0.5896757", "text": "moveUp() {\n // If we are the first ones, don't do anything\n if (this.element.previousElementSibling == null) {\n return;\n }\n\n var elem = this.element.previousElementSibling;\n\n // Switch indexes\n var idx = this.index;\n this.index = elem.task.index;\n elem.task.index = idx;\n\n this.element.parentElement.insertBefore(this.element, elem);\n\n this.parent.onchangeorder();\n\n // Notify the server\n fetch(`/tasks/${this.id}/moveup`, {\n method: 'POST',\n });\n }", "title": "" }, { "docid": "761dde8af17c4b4fe0ef205a62abd695", "score": "0.5896654", "text": "moveUp() {\n this.location = add(this.location, vec2(0, -this.baseVelocity));\n }", "title": "" }, { "docid": "9b036cc55d37822bef6d2cfd5699d96a", "score": "0.58906054", "text": "bubbleUp(index) {\n // find the index of the parent node\n const parentIndex = Math.floor((index - 1) / 2);\n // check to see if the value at this index needs to be shifted up\n if (this.storage[parentIndex] < this.storage[index]) {\n // if the parent index is less than the new index then shift the new index up\n [this.storage[parentIndex], this.storage[index]] = [this.storage[index], this.storage[parentIndex]];\n // need to repeat process until the new index is in correct position\n // call the function recursively until the new index is in the correct spot\n this.bubbleUp(parentIndex);\n }\n }", "title": "" }, { "docid": "945f3b85e9a4c4f731abd5bf7b5131a9", "score": "0.5868417", "text": "function down () {\n var index = {h: current.h, v: current.v + 1};\n if (get(index.h, index.v)) {\n _set(index);\n }\n \n }", "title": "" }, { "docid": "2fd664bddfc9a059549196eded316725", "score": "0.58646876", "text": "function ex4(array) {\n\n let counter = array.pop();\n\n while (counter-- > 0) {\n array.unshift(array.pop());\n }\n console.log(array.join(' '));\n}", "title": "" }, { "docid": "e0c636cc04da3b9daa164e6fcc7e6926", "score": "0.58624095", "text": "function moveSongUp(nummer){\n\ttitles.splice (nummer-1, 0, titles[nummer] );\t\n\ttitles.splice(nummer+1,1);\t\n\t// dates.splice (nummer-1, 0, dates[nummer] );\t\t\n\t// dates.splice(nummer+1,1);\n\turls.splice (nummer-1, 0, urls[nummer] );\t\t\n\turls.splice(nummer+1,1);\n\tstoreAll();\n\tshowPlaylist();\t\t\n}", "title": "" }, { "docid": "fcde40d997b25de2a2ee03fc6cd65cfb", "score": "0.58496946", "text": "function moveUp(tableId, pos)\n{\n\tmove(tableId, pos, pos - 1);\n}", "title": "" }, { "docid": "56ac1d4941db4ce6fa6d61d9ab5f98fe", "score": "0.5844789", "text": "function counterUp() {\n\tcounter++\n\t$(\".moves\").text(counter);\n\tif (counter % 8 === 0) {\n\t\tlet modulo = counter % 8;\n\t\t$(\"ul.stars\").children().eq(n).children().removeClass(\"fa-star\").addClass(\"fa-star-o\");\n\t\tn--;\n\t\tstars--;\n\t\tif (stars < 1) {\n\t\t\tstars = 1;\n\t\t};\n\t\tif (n < 1) {\n\t\t\tn = 1;\n\t\t};\n\t};\n}", "title": "" }, { "docid": "c57af1af13b611a59bf59147c0a1515c", "score": "0.5844375", "text": "function bump(bumping, val) {\n //nothing to do:\n if (bumping === top.prev) return;\n bridge(bumping, val);\n //point down to the old mru:\n val.prev = top.prev;\n //point up to whatever was above mru\n val.next = topIndex;\n //and point back:\n top.prev = bumping;\n //the old mru has to point up the new one:\n store[val.prev].next = bumping;\n\n }", "title": "" }, { "docid": "6e57e794d58a0666a517e5d0fb60f83e", "score": "0.5828767", "text": "moveUp(dist) {\n\n this.position[1] += dist;\n\n }", "title": "" }, { "docid": "b15a4121087dcf3b3739bb55a8846375", "score": "0.58281803", "text": "function sumUp(numbers) {\n return numbers.reduce((prev , current) => prev + current)\n}", "title": "" }, { "docid": "0b7fb8e440f7f5bb882c8992cf5db8c2", "score": "0.58196706", "text": "function moveFroggerDown() {\n var curCol = getCurrentColumn();;\n var curCell = getCurrentCell();\n if (curCell == gridSize) {\n return;\n }\n var nextCol = curCol;\n var nextCell = curCell + 1;\n moveFrogger(nextCol, nextCell);\n }", "title": "" }, { "docid": "0c4d6c453afc32501db9834ea93ac913", "score": "0.5818923", "text": "up() {\n this.y = Math.max(0, this.y - this.speed);\n }", "title": "" }, { "docid": "e84dd45fe181d8d400f748de4a527151", "score": "0.58165896", "text": "function swapUp(bocks, emp) {\n temp = bocks[emp.y - 1][emp.x].v;\n bocks[emp.y - 1][emp.x].v = emp.v;\n emp.v = temp;\n emp = bocks[emp.y - 1][emp.x];\n moves += 1;\n return emp;\n}", "title": "" }, { "docid": "a81475d0d99cdfcd66a58c8197775078", "score": "0.58161306", "text": "function pl1moveUp() {\n\t\t$player1.html('<img src=\"player1/up.png\">');\n\t\tplayer1upDown -= 20;\n\t\t$player1.css(\"top\", player1upDown + \"px\");\n\t}", "title": "" }, { "docid": "e8b8401110e183b2c84a7c394db07242", "score": "0.58126307", "text": "moveUp(){\n this.y-=10; \n }", "title": "" }, { "docid": "37137c2ceafe2fb5284c38243a463f7d", "score": "0.58012", "text": "function moveUp() {\n let char = document.getElementById('character');\n let curr = parseInt(char.style.bottom)\n char.style.bottom = (curr + speed) + 'px';\n}", "title": "" }, { "docid": "e0ce9a0c215778fbfa15940000be4943", "score": "0.57975787", "text": "function moveUp(){\n let circle = document.getElementById('circle');\n let posTop = circle.offsetTop;\n circle.style.top = posTop - 1 + 'px';\n}", "title": "" }, { "docid": "517707a2b73abf6c272688c8757e5179", "score": "0.5788992", "text": "function addUp(num) {\n\tlet total = 0;\n\t\n\tfor(let i = 0; i<= num; i++) {\n\t\ttotal = total + i;\n\t}\n\t\n\treturn total;\n}", "title": "" }, { "docid": "87e7c880c04802e3037a00a90a6afa21", "score": "0.5782704", "text": "function up(index) {\r\n if (user_player_arr.length > 1 && index > 0) {\r\n let up_player = user_player_arr.splice(index, 1);\r\n let down_player = user_player_arr.splice(index - 1, 1);\r\n let temp;\r\n temp = up_player[0];\r\n up_player[0] = down_player[0];\r\n down_player[0] = temp;\r\n user_player_arr.splice(index - 1, 0, down_player[0], up_player[0]);\r\n show();\r\n }\r\n}", "title": "" }, { "docid": "e8fb8535c04f27a7cc4bc2572997d4ba", "score": "0.5776428", "text": "siftDown(index) {}", "title": "" }, { "docid": "1950a8d94e0ed9c3a09dee712f9ae0f0", "score": "0.57646096", "text": "function pl2moveUp() {\n\t\t$player2.html('<img src=\"player2/up.png\">');\n\t\tplayer2upDown -= 20;\n\t\t$player2.css(\"top\", player2upDown + \"px\");\n\t}", "title": "" }, { "docid": "b58297cd4af56f183f5dec766402b7cf", "score": "0.5764337", "text": "function countUpAndDown(n) {\n\n\tvar updownStr='';\n\n for (var i=1; i <= n; i++) { //string i to n\n \tif (i==1) { //for first value\n\t \t\tupdownStr=i.toString();\n\t }\n\t else {\n\t\t updownStr+=' ' +i.toString(); \t\t\n \t}\n\t}\n\n\tfor (i=n-1; i>=1; i--) { //append n to i; do not add n to the string\n\t updownStr+=' ' +i.toString();\n\t}\n\n\tconsole.log('***** Function Count Up and Down *****');\n console.log('Numbers: ' +updownStr);\n\n\tconsole.log(''); //print extra space \n console.log('');\n}", "title": "" }, { "docid": "581dc3051ae29b0b852d31754a2ad7db", "score": "0.57572824", "text": "function countUpAndDown(n) {\n console.log(\"Going Up!\");\n for (let i = 0; i < n; i++) {\n console.log(i);\n }\n console.log(\"At the top! \\nGoing down...\");\n for (let j = n - 1; j >= 0; j-- ) {\n console.log(j)\n }\n console.log(\"Back down. Bye!\")\n}", "title": "" }, { "docid": "d312fa032ab67744b3588a1cadc2c79e", "score": "0.57433516", "text": "function nextCoordinateUp (coordinate) {\n return addRow(coordinate, 1)\n }", "title": "" }, { "docid": "5144d57b0807500be1c7ebedd29a83e9", "score": "0.5729616", "text": "unshift() {}", "title": "" }, { "docid": "170f9b00167ec0f55d8c1717e499b9c5", "score": "0.5728833", "text": "function switchItUp(number){\n return [\n 'Zero', 'One', 'Two', 'Three', 'Four', \n 'Five', 'Six', 'Seven', 'Eight', \n 'Nine', 'Ten'\n ][number];\n}", "title": "" }, { "docid": "2834a273744cc65d3bb08df3fc683ac9", "score": "0.5715404", "text": "moveUp(e) {\r\n if (e.keyCode === 38)\r\n this.direction(0, -this.increaseSpeed); // UP //\r\n }", "title": "" }, { "docid": "11c933195d86b40facdb3fdce079c6c2", "score": "0.5709762", "text": "function Moveup(){\r\n if (board.hasWon()) {\r\n return;\r\n }\r\nelse{\r\n let direction = 1;\r\n let boardClone = Object.assign(\r\n Object.create(Object.getPrototypeOf(board)),\r\n board\r\n );\r\n let newBoard = boardClone.move(direction);\r\n setBoard(newBoard);\r\n} \r\n}", "title": "" }, { "docid": "bd3c680a9bc8aae0f6d1df5ec8b8389b", "score": "0.56960386", "text": "function roundUp(num){\n return Math.ceil(num)\n }", "title": "" }, { "docid": "1146e689d78c0b9fd717613204153801", "score": "0.56945497", "text": "function up() {\n moveFocus(-1);\n }", "title": "" }, { "docid": "7e34977b9a3e0457f7480efa5cb9bef1", "score": "0.5694257", "text": "bubbleUp() {\n // get index of inserted element\n let index = this.values.length - 1;\n\n while (index > 0) {\n const parentIndex = Math.floor((index - 1)/2);\n if (this.values[parentIndex] < this.values[index]) {\n this.swap(index, parentIndex);\n // We reassign our current index to the element’s new index if swapped,\n // and keeps testing parents in a loop until the element fits, or we reach\n // the root of the heap.\n index = parentIndex;\n } else break;\n }\n return 0\n }", "title": "" }, { "docid": "148de4432185ee5efed40a076d80ef53", "score": "0.56929314", "text": "function moveDodgerDown() {\n const downNumbers = dodger.style.bottom.replace(\"px\",\"\");\n const down = parseInt(downNumbers, 10);\n\n if (down > 0) {\n dodger.style.bottom = (`${down - 20}px`);\n \n }\n}", "title": "" }, { "docid": "d8c339a36d4388115dcb3f6173664a6f", "score": "0.5692892", "text": "function moveDown() {\n\tfor (let i = 0; i < WIDTH; i++) {\n\t\tcolumn = removeZeros(\n\t\t\tFIELD.map((e) => e[i]),\n\t\t\t\"r\"\n\t\t);\n\t\tcolumn = slideRight(column);\n\t\tfor (let j = 0; j < HEIGHT; j++) {\n\t\t\tFIELD[j][i] = column[j];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b6f18c4baf19874dbad70b02831448e8", "score": "0.5690202", "text": "moveBackward() {}", "title": "" }, { "docid": "5765360ccb4d34de300cd50fe78c5711", "score": "0.5679204", "text": "function item_up()\r\n{\r\n\tif(document.item_sheet.item_top.value > 10){\r\n\t\tdocument.item_sheet.item_top.value = document.item_sheet.item_top.value * 1 - 10;\r\n\t\titem_swrite();\r\n\t}\r\n}", "title": "" }, { "docid": "4468d7c20801783ff5dc95536170e0e7", "score": "0.56682086", "text": "function U(a,b,c){while(0<c--)a.push(b)}", "title": "" }, { "docid": "9090925cc072fec61f41de578bd0d445", "score": "0.56681114", "text": "function MoveUp()\n\t{\t\n\t\twhile(spriteRec.y > 0.0f)\n\t\t{\n\t\t\tspriteRec = sprite.ClipRect;\n\t\t\tnewYPos = spriteRec.y - speed * Time.deltaTime;\n\t\t\tspriteRec.y = newYPos < 0.0f ? 0.0f : newYPos;\n\t\t\tsprite.ClipRect = spriteRec;\n\t\t\t\n\t\t\tlocalPos = sprite.transform.localPosition;\n\t\t\tlocalPos.y = transformY - (height * sprite.ClipRect.y);\n\t\t\tsprite.transform.localPosition = localPos;\n\t\t\t\n\t\t\tyield;\n\t\t}\n\t}", "title": "" }, { "docid": "04fed45a54f934d248e42bbb8c0070ff", "score": "0.56669486", "text": "function moveSectionUp() {\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.56600773", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "4dcaf74ed43057244818426cb89b067b", "score": "0.56558156", "text": "function moveUp() {\n createjs.Tween.removeAllTweens($scope.answersContainer);\n $scope.stage.update();\n\n createjs.Tween.get($scope.answersContainer, {loop: false})\n .to({\n x: $scope.answersContainer.x,\n y: 0\n }, 2000, createjs.Ease.getPowInOut(1));\n }", "title": "" }, { "docid": "0af681b4adfd88a144ec35051cdd1868", "score": "0.5650516", "text": "function moveUpOrDown(tr, isUp) {\n var $tr = $(tr);\n var idx = $(tr).index();\n var $table = $tr.closest(\"table\");\n var arr = null;\n var tmp = null;\n if ($table.is($(\"#tblOnlineURLs\"))) {\n arr = storage.onlineURLs;\n }\n else if ($table.is($(\"#tblCustomRules\"))) {\n arr = storage.customRules;\n }\n if (isUp) {\n var $prev = $tr.prev();\n if ($prev) {\n $prev.before($tr);\n tmp = arr[idx - 1];\n arr[idx - 1] = arr[idx];\n arr[idx] = tmp;\n }\n } else {\n var $next = $tr.next();\n if ($next) {\n $next.after($tr);\n tmp = arr[idx + 1];\n arr[idx + 1] = arr[idx];\n arr[idx] = tmp;\n }\n }\n}", "title": "" }, { "docid": "9a7e1fd8608f7281aa13e5d00ecbf263", "score": "0.5645242", "text": "function moveSectionUp(){\r\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\r\n\r\n //looping to the bottom if there's no more sections above\r\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\r\n prev = $(SECTION_SEL).last();\r\n }\r\n\r\n if (prev.length) {\r\n scrollPage(prev, null, true);\r\n }\r\n }", "title": "" }, { "docid": "9a7e1fd8608f7281aa13e5d00ecbf263", "score": "0.5645242", "text": "function moveSectionUp(){\r\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\r\n\r\n //looping to the bottom if there's no more sections above\r\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\r\n prev = $(SECTION_SEL).last();\r\n }\r\n\r\n if (prev.length) {\r\n scrollPage(prev, null, true);\r\n }\r\n }", "title": "" }, { "docid": "e18848674fe23e770571b8eb57a595b0", "score": "0.5640125", "text": "function countUpAndDown(n) {\n console.log(\"Going up!\");\n for (let i = 0; i < n; i++) {\n console.log(i);\n }\n console.log(\"At the top!\\nGoing down...\");\n for (let j = n - 1; j >= 0; j--) {\n console.log(j);\n }\n console.log(\"Back down. Bye!\");\n}", "title": "" }, { "docid": "4e89dd1bdffffcf0959a5daa3c6a8639", "score": "0.56386447", "text": "goUp(snake) {\n this.updateDirection(snake, { x: snake[0].x, y: snake[0].y - 1 }, this.DIRECTION.UP)\n }", "title": "" }, { "docid": "a0d84e03b5308156b51c272accc4c3a1", "score": "0.5633273", "text": "function combineUporDown() {\n for (var o = 0; o <9; o++) { \n for (var i = 0 ; i < 16; i++) {\n if (tab[i] == tab[i + 4]) {\n tab [i] *=2;\n tab [i + 4] = 0\n }\n }\n }\n }", "title": "" }, { "docid": "34d6bf87fd8214d315fe64c070dcd356", "score": "0.5627542", "text": "function goDown(){\n bird.css('top', parseInt(bird.css('top')) +5);\n }", "title": "" }, { "docid": "dc9cd73de0f70431e8669ec589cc692c", "score": "0.56161183", "text": "levelUp() {\n var reqXP=Character.calcLevelToXP(this._data.level+1);\n this._data.XP=reqXP;\n this._data.level+=1;\n }", "title": "" }, { "docid": "ec248e9891d3eaa5ed7e7d91bf3d4f93", "score": "0.5606896", "text": "moveDown(){\n if ( this.selected && (this.selected.source.num < this.selected.parent.currentData.length) ){\n this.order(this.selected.source.num, this.selected.source.num + 1, this.selected);\n }\n }", "title": "" }, { "docid": "0fbd4ab2d79d74dc3efe51f6737fed9d", "score": "0.5598367", "text": "function goUp(input)\r\n {\r\n var inputs = [];\r\n var index = collectInputs(input, inputs);\r\n if (index > 0 && index < inputs.length)\r\n {\r\n var node = inputs[index-1];\r\n if (node)\r\n node.focus();\r\n }\r\n }", "title": "" }, { "docid": "3fbb0ba5b85f76a1849b5ef37993d57f", "score": "0.5597772", "text": "function arrowUpClicked() {\n\tboardSize = boardSize + 1 < 100 ? boardSize + 1 : boardSize;\n\tboardSizeText.text = boardSize.toString();\n}", "title": "" }, { "docid": "eda3983cb088853f1621f6e5b4b9668c", "score": "0.5595511", "text": "function prev() {\n move(--currentIndex);\n }", "title": "" }, { "docid": "68a343d28a562a6e627852b427b18d72", "score": "0.55949014", "text": "function countUpAndDown(n) {\n console.log(\"going up!\");\n for (let i = 0; i < n; i++) {\n console.log(i);\n }\n console.log(\"at the top, going down!\");\n for (let j = n - 1; j >= 0; j--) {\n console.log(j);\n }\n console.log(\"Back down, bye!\");\n}", "title": "" }, { "docid": "ff29355a0a443485c3b99fff95d6ba91", "score": "0.5593156", "text": "function moveDown()\n\t{\n\t\tundraw();\n\t\t// This will move the tetromino down. Since the width is 10 in this case (right now anyway), this will move down.\n\t\tcurrentTetrominoPosition += width;\n\t\tdraw();\n\t\tfreeze();\n\t}", "title": "" }, { "docid": "4fbd16dfd99922b68efdaea7443ebcfd", "score": "0.5585923", "text": "function pushUp(win) {\n var ws = getWindowState(win);\n var screen = slate.screen().rect();\n var oldMove = ws.lastMove;\n ws.lastMove = directions.up;\n\n // determine if we should resize, and what to resize to:\n let width = win.size().width;\n let height = win.size().height;\n var shouldResize = oldMove === directions.up || oldMove === directions.any || atTopEdge(win);\n if (shouldResize) {\n if (ws.vertIter >= 3) {\n ws.vertIter = 0;\n height = screen.height\n } else {\n if (oldMove === directions.any) {\n width = screen.width;\n }\n height = screen.height * winSizeSequence[ws.vertIter];\n ws.vertIter++;\n }\n }\n\n win.doOperation(slate.operation(\"move\", {\n x: win.topLeft().x,\n y: screen.y,\n width: width,\n height: height,\n }));\n}", "title": "" } ]
f9dd605b7571d555c993a0ab0a7b8e88
Calculates the threshold from a connection's middle which fits the twothirdregion
[ { "docid": "9b39033fc216d95d0a67a7172be93e6a", "score": "0.63141733", "text": "function calculateIntersectionThreshold(connection, intersection) {\n var waypoints = connection.waypoints,\n relevantSegment, alignment, segmentLength, threshold;\n\n if (intersection.index <= 0 || intersection.bendpoint) {\n return null;\n }\n\n // segment relative to connection intersection\n relevantSegment = {\n start: waypoints[intersection.index - 1],\n end: waypoints[intersection.index]\n };\n\n alignment = pointsAligned(relevantSegment.start, relevantSegment.end);\n\n if (!alignment) {\n return null;\n }\n\n if (alignment === 'h') {\n segmentLength = relevantSegment.end.x - relevantSegment.start.x;\n } else {\n segmentLength = relevantSegment.end.y - relevantSegment.start.y;\n }\n\n // calculate threshold relative to 2/3 of segment length\n threshold = calculateSegmentMoveRegion(segmentLength) / 2;\n\n return threshold;\n }", "title": "" } ]
[ { "docid": "3467c83e21eb62eda60063f23571ba02", "score": "0.5630671", "text": "function calculateThreshold(maximum) {\n\t\t\t return {\n\t\t\t \tmin: isPercent ?\n\t\t\t \t\tmaximum * parseFloat(distance) / 100 :\n\t\t\t \t\tparseFloat(distance),\n\t\t\t \tmax: isPercent ?\n\t\t\t\t\t maximum * (1 - parseFloat(distance) / 100) :\n\t\t\t\t\t maximum - parseFloat(distance)\n\t\t\t\t\t};\n\t\t\t }", "title": "" }, { "docid": "6162e68f712cb2d47977022dcb00c075", "score": "0.55048823", "text": "function calculateThreshold() {\r\n sigPossible = 0\r\n for(var k in algs) {\r\n sigPossible += algs[k].signalWeight\r\n }\r\n\r\n sigThreshold = Math.ceil(sigPossible / 2)\r\n}", "title": "" }, { "docid": "4e0722e91ec0c9c0a09578a2068880ca", "score": "0.5469846", "text": "calc(threshold) {\n return this.grid.reduce((total, row) => {\n total += row.reduce((acc, val) => { // eslint-disable-line no-param-reassign\n acc += val >= threshold ? 1 : 0; // eslint-disable-line no-param-reassign\n return acc;\n }, 0);\n\n return total;\n }, 0);\n }", "title": "" }, { "docid": "ab85dd31574d77d09a46a8725842ebce", "score": "0.5408342", "text": "thresholdMet() {}", "title": "" }, { "docid": "9fc3960957c171f1c6b551a587f3b647", "score": "0.53965414", "text": "function filterThreshold(pixels) {\n}", "title": "" }, { "docid": "9fc3960957c171f1c6b551a587f3b647", "score": "0.53965414", "text": "function filterThreshold(pixels) {\n}", "title": "" }, { "docid": "6f7e8986417e9401ec1b480cf466dffb", "score": "0.52091885", "text": "function calcSensitivityPosY(sample) {\n var tp = 0;\n for (var i = 0; i < sample.length; i++) {\n tp += sample[i].color == color1 && sample[i].x < xcut;\n }\n return 30 + (1-tp / n1)*300;\n}", "title": "" }, { "docid": "7fa7e8a235172180dfdbcc08e3a429c3", "score": "0.52008957", "text": "function cal_single_filmunifo(rows,columns,pixel_data_16,pixel_data_8,percentage,pixel_space){\n let mat_16 = cv.matFromArray(rows, columns, cv.CV_16UC1, pixel_data_16);\n let mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n var cal_array = [];\n var boundray_value = 200;\n var rc=rows * columns;\n for (var i = 0; i < rc; i++) {\n cal_array[i] = 65535 - pixel_data_8[i];\n }\n for (var i = 0; i < rc; i++) {\n if (pixel_data_8[i] > boundray_value) {\n pixel_data_8[i] = 0;\n }\n /* else{\n pixel_data_8[i]=1;\n } */\n }\n let bin_mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n let penumbra_mat = cv.matFromArray(rows, columns, cv.CV_16UC1, cal_array);\n console.log(\"binarization\");\n console.log(pixel_data_8);\n let contours = new cv.MatVector();\n let hierarchy = new cv.Mat();\n cv.findContours(bin_mat_8, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);\n let cnt = contours.get(0);\n let moments = cv.moments(cnt, false);\n let cx = moments.m10 / moments.m00;\n let cy = moments.m01 / moments.m00;\n console.log(cx, cy);\n let int_cx = parseInt(cx); //type conversion\n let int_cy = parseInt(cy);\n console.log(int_cx, int_cy);\n //lbs_index:left_Boundary_subscript_index\n var lbs_index;\n for (var i = 1; i < int_cy; i++) {\n if (mat_8.ucharAt(int_cx, i) < boundray_value) {\n lbs_index = i;\n break;\n }\n }\n //rbs_index:right_Boundary_subscript_index\n var rbs_index;\n var rbs_init=columns - 1;\n for (var i = rbs_init; i > int_cy; i--) {\n if (mat_8.ucharAt(int_cx, i) < boundray_value) {\n rbs_index = i;\n break;\n }\n }\n //ubs_index:up_Boundary_subscript_index\n var ubs_index;\n for(var i=1;i<int_cx;i++){\n if(mat_8.ucharAt(i,int_cy)<boundray_value){\n ubs_index=i;\n }\n }\n //dbs_index:down_Boundary_subscript_index\n var dbs_index;\n var dbs_init=rows-1;\n for(var i=dbs_init;i>int_cx;i--){\n if(mat_8.uncharAt(i,int_cy)<boundray_value){\n dbs_index=i;\n }\n }\n if (ubs_index == undefined || dbs_index == undefined) {\n console.log(\"ubs index or dbs index is undefined or not find!\");\n return undefined;\n }\n if (lbs_index == undefined || rbs_index == undefined) {\n console.log(\"lbs index or rbs index is undefined or not find!\");\n return undefined;\n }\n //lmp_value:left_min_pixel_value\n var lmp_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (var i = lbs_index; i < int_cy; i++) {\n if (penumbra_mat.ushortAt(int_cx, i) < lmp_value) {\n lmp_value = penumbra_mat.ushortAt(int_cx, i);\n }\n }\n //rmp_value:right_min_pixel_value\n var rmp_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (var j = int_cy; j < rbs_index; j++) {\n if (penumbra_mat.ushortAt(int_cx, j) < rmp_value) {\n rmp_value = penumbra_mat.ushortAt(int_cx, j);\n }\n }\n //ump_value:up_min_pixel_value\n var ump_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (var i = ubs_index; i < int_cx; i++) {\n if (penumbra_mat.ushortAt(i,int_cy) < ump_value) {\n ump_value = penumbra_mat.ushortAt(i,int_cy);\n }\n }\n //dmp_value:down_min_pixel_value\n var dmp_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (var j = int_cx; j < dbs_index; j++) {\n if (penumbra_mat.ushortAt(j,int_cy) < dmp_value) {\n dmp_value = penumbra_mat.ushortAt(j,int_cy);\n }\n }\n //cd_value:center_dose_value\n var cd_value = parseInt(penumbra_mat.ushortAt(int_cx, int_cy));\n //lcmD_value:left_center_min_D_value\n var lcmD_value = cd_value - lmp_value;\n //rcmD_value: right_center_min_D_value\n var rcmD_value = cd_value - rmp_value;\n //lfpd_value:left_fifty_percent_dose_value\n var lfpd_value = parseInt(lcmD_value / 2 + lmp_value);\n console.log(cd_value, 'left %50 dose value is ' + lfpd_value);\n // rfpd_value:right_fifty_percent_dose_value\n var rfpd_value = parseInt(rcmD_value / 2 + rmp_value);\n console.log(cd_value, 'right %50 dose value is ' + rfpd_value);\n //ucmD_value:up_center_min_D_value\n var ucmD_value = cd_value - ump_value;\n //dcmD_value:down_center_min_D_value\n var dcmD_value = cd_value - dmp_value;\n //ufpd_value:up_fifty_percent_dose_value\n var ufpd_value = parseInt(ucmD_value / 2 + ump_value);\n console.log(cd_value, 'up %50 dose value is ' + ufpd_value);\n // dfpd_value:dwon_fifty_percent_dose_value\n var dfpd_value = parseInt(dcmD_value / 2 + dmp_value);\n console.log(cd_value, 'down %50 dose value is ' + dfpd_value);\n //lfpd_index:left_fifty_percent_dose_index\n var lfpd_index;\n for (var i = lbs_index; i < int_cy; i++) {\n if (Math.abs(penumbra_mat.ushortAt(int_cx, i) - lfpd_value) < 5) {\n lfpd_index = i;\n break;\n }\n }\n //rfpd_index:right_fifty_percent_dose_index\n var rfpd_index;\n for (var i = int_cy; i < rbs_index; i++) {\n if (Math.abs(penumbra_mat.ushortAt(int_cx, i) - rfpd_value) < 5) {\n rfpd_index = i;\n break;\n }\n }\n //ufpd_index:up_fifty_percent_dose_index\n var ufpd_index;\n for (var i = ubs_index; i < int_cx; i++) {\n if (Math.abs(penumbra_mat.ushortAt(i,int_cy) - ufpd_value) < 5) {\n ufpd_index = i;\n break;\n }\n }\n //dfpd_index:down_fifty_percent_dose_index\n var dfpd_index;\n for (var i = int_cx; i < dbs_index; i++) {\n if (Math.abs(penumbra_mat.ushortAt(i,int_cy) - dfpd_value) < 5) {\n dfpd_index = i;\n break;\n }\n }\n var per;\n if(percentage==0.8){\n var edis=cal_film_singdis(int_cx,int_cy,lfpd_index,rfpd_index,ufpd_index,dfpd_index,percentage,pixel_space);\n return edis;\n } else if(percentage==0.9){\n var ndis=cal_film_singdis(int_cx,int_cy,lfpd_index,rfpd_index,ufpd_index,dfpd_index,percentage,pixel_space);\n return ndis;\n }else {\n console.log(\"percentage is incorrect!\");\n return undefined;\n }\n}", "title": "" }, { "docid": "0c11650fcca7a46ec23dd701c58b3973", "score": "0.51539737", "text": "function computeThresholdUsingOtsu(image, scale, bounds, th, g, skipShort, weightGradient, minValue) {\n // clip image edges\n let mask = image.mask().gt(0).focal_min(ee.Number(scale).multiply(3), 'circle', 'meters');\n\n // detect sharp changes\n var edge = ee.Algorithms.CannyEdgeDetector(image, th, g);\n edge = edge.multiply(mask);\n\n // take the largest changes, estimate gradient around edge and use that as a weight\n if(weightGradient) {\n let gradient = image.gradient().abs();\n let edgeGradient = gradient.select(0).max(gradient.select(1)).mask(edge.gt(th))\n .reproject(image.projection().scale(2, 2));\n\n // take the upper percentiles only\n let mode = ee.Number(ee.Dictionary(edgeGradient.reduceRegion(ee.Reducer.mode(), bounds, scale)).values().get(0));\n let σ = ee.Number(ee.Dictionary(edgeGradient.reduceRegion(ee.Reducer.stdDev(), bounds, scale)).values().get(0));\n let buckets = 50;\n let significantEdgesMask = edgeGradient.gt(mode);\n\n edge = edge.updateMask(significantEdgesMask);\n\n if(debug) {\n // gradient around edges\n if(edgeGradient) {\n print(ui.Chart.image.histogram(edgeGradient, bounds, scale, buckets));\n Map.addLayer(edgeGradient, {}, 'edge gradient', false);\n Map.addLayer(significantEdgesMask.mask(significantEdgesMask), {}, 'significant edges', false);\n\n print('Mode: ', mode);\n print('Sigma: ', σ);\n //Map.addLayer(edgeGradient.updateMask(significantEdgesMask), {min:0, max:mode.add(σ.multiply(2)), palette:['ffffff', 'ff0000']}, 'edge gradient, upper percentiles', false)\n }\n }\n }\n\n // advanced, detect edge lengths\n let coonnectedVis;\n if(skipShort) {\n let connected = edge.mask(edge).lt(0.8).connectedPixelCount(50, true);\n\n let edgeLong = connected.gte(50);\n\n edge = edgeLong;\n\n coonnectedVis = connected.updateMask(edgeLong).visualize({palette: ['ffffff', 'ff0000'], min: 0, max: 50});\n }\n\n // buffer around NDWI edges\n let edgeBuffer = edge.focal_max(ee.Number(scale).multiply(1), 'square', 'meters');\n let imageEdge = image.mask(edgeBuffer);\n\n // compute threshold using Otsu thresholding\n let buckets = 100;\n let hist = ee.Dictionary(ee.Dictionary(imageEdge.reduceRegion(ee.Reducer.histogram(buckets), bounds, scale)).values().get(0));\n\n let threshold = ee.Algorithms.If(hist.contains('bucketMeans'), otsu(hist), 0.3);\n threshold = ee.Number(threshold)//.add(0.05)\n\n if(debug) {\n Map.addLayer(edge.mask(edge), {palette:['ff0000']}, 'edges', false);\n\n if(skipShort) {\n Map.addLayer(coonnectedVis, {}, 'edges (connected)', false)\n }\n\n print('Threshold: ', threshold);\n\n print(ui.Chart.image.histogram(image, bounds, scale, buckets));\n print(ui.Chart.image.histogram(imageEdge, bounds, scale, buckets));\n Map.addLayer(mask.mask(mask), {palette:['000000']}, 'image mask', false);\n }\n\n return minValue ? threshold.max(minValue) : threshold;\n}", "title": "" }, { "docid": "7be0c370a8461a4597c0e4a0afa1c1e2", "score": "0.5145012", "text": "function cal_single_filmsym(rows,columns,pixel_data_16,pixel_data_8,percentage,pixel_space){\n let mat_16 = cv.matFromArray(rows, columns, cv.CV_16UC1, pixel_data_16);\n let mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n var cal_array = [];\n var boundray_value = 200;\n var rc=rows * columns;\n for (var i = 0; i < rc; i++) {\n cal_array[i] = 65535 - pixel_data_8[i];\n }\n for (var i = 0; i < rc; i++) {\n if (pixel_data_8[i] > boundray_value) {\n pixel_data_8[i] = 0;\n }\n /* else{\n pixel_data_8[i]=1;\n } */\n }\n let bin_mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n let penumbra_mat = cv.matFromArray(rows, columns, cv.CV_16UC1, cal_array);\n console.log(\"binarization\");\n console.log(pixel_data_8);\n let contours = new cv.MatVector();\n let hierarchy = new cv.Mat();\n cv.findContours(bin_mat_8, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);\n let cnt = contours.get(0);\n let moments = cv.moments(cnt, false);\n let cx = moments.m10 / moments.m00;\n let cy = moments.m01 / moments.m00;\n console.log(cx, cy);\n let int_cx = parseInt(cx); //type conversion\n let int_cy = parseInt(cy);\n console.log(int_cx, int_cy);\n //lbs_index:left_Boundary_subscript_index\n var lbs_index;\n for (var i = 1; i < int_cy; i++) {\n if (mat_8.ucharAt(int_cx, i) < boundray_value) {\n lbs_index = i;\n break;\n }\n }\n //rbs_index:right_Boundary_subscript_index\n var rbs_index;\n var rbs_init=columns - 1;\n for (var i =rbs_init; i > int_cy; i--) {\n if (mat_8.ucharAt(int_cx, i) < boundray_value) {\n rbs_index = i;\n break;\n }\n }\n if (lbs_index == undefined || rbs_index == undefined) {\n return undefined;\n }\n //lmp_value:left_min_pixel_value\n var lmp_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (var i = lbs_index; i < int_cy; i++) {\n if (penumbra_mat.ushortAt(int_cx, i) < lmp_value) {\n lmp_value = penumbra_mat.ushortAt(int_cx, i);\n }\n }\n //rmp_value:right_min_pixel_value\n var rmp_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (var j = int_cy; j < rbs_index; j++) {\n if (penumbra_mat.ushortAt(int_cx, j) < rmp_value) {\n rmp_value = penumbra_mat.ushortAt(int_cx, j);\n }\n }\n //cd_value:center_dose_value\n var cd_value = parseInt(penumbra_mat.ushortAt(int_cx, int_cy));\n //lcmD_value:left_center_min_D_value\n var lcmD_value = cd_value - lmp_value;\n //rcmD_value: right_center_min_D_value\n var rcmD_value = cd_value - rmp_value;\n //lfpd_value:left_fifty_percent_dose_value\n var lfpd_value = parseInt(lcmD_value / 2 + lmp_value);\n console.log(cd_value, 'left %50 dose value is ' + lfpd_value);\n // rfpd_value:right_fifty_percent_dose_value\n var rfpd_value = parseInt(rcmD_value / 2 + rmp_value);\n console.log(cd_value, 'right %50 dose value is ' + rfpd_value);\n //lfpd_index:left_fifty_percent_dose_index\n var lfpd_index;\n for (var i = lbs_index; i < int_cy; i++) {\n if (Math.abs(penumbra_mat.ushortAt(int_cx, i) - lfpd_value) < 5) {\n lfpd_index = i;\n break;\n }\n }\n //rfpd_index:right_fifty_percent_dose_index\n var rfpd_index;\n for (var i = int_cy; i < rbs_index; i++) {\n if (Math.abs(penumbra_mat.ushortAt(int_cx, i) - rfpd_value) < 5) {\n rfpd_index = i;\n break;\n }\n }\n //Slb_index:Symmetry_left_boundary_index\n var Slf_index = parseInt(int_cy - ((int_cy - lfpd_index) *percentage));\n //Srb_index:Symmetry_right_boundary_index\n var Srb_index = parseInt(((rfpd_index - int_cy) * percentage) + int_cy);\n //Slb_distance:Symmetry_left_boundary_distance\n var Slb_distance = (int_cy - lfpd_index) * percentage * pixel_space;\n //Srb_distance:Symmetry_right_boundary_distance\n var Srb_distance = (rfpd_index - int_cy) * percentage * pixel_space;\n //SS_distance:Symmetry_Selected_distance\n var SS_distance = parseInt((Slb_distance < Srb_distance) ? Slb_distance : Srb_distance);\n console.log('SS_distance is ' + SS_distance);\n //SSl_index: Symmetry_Selected_left_index\n var SSl_index = parseInt(int_cy - SS_distance / pixel_space);\n //SSr_index: Symmetry_Selected_right_index\n var SSr_index = parseInt(int_cy + SS_distance / pixel_space);\n //ld_array:left_dose_array\n var ld_array = [];\n for (var i = SSl_index, j = 0; i < int_cy; i++, j++) {\n ld_array[j] = penumbra_mat.ushortAt(int_cx, i);\n }\n console.log(\"ld_array :\");\n console.log(ld_array);\n //rd_array:right_dose_array\n var rd_array = [];\n for (var i = SSr_index, j = 0; i > int_cy; i--, j++) {\n rd_array[j] = penumbra_mat.ushortAt(int_cx, i);\n }\n console.log(\"rd_array :\");\n console.log(rd_array);\n //S_array:Symmetry_array\n var S_array = [];\n var ld_len=ld_array.length;\n for (var i = 0; i < ld_len; i++) {\n S_array[i] = rd_array[i] / ld_array[i];\n }\n var max_Symmetry = S_array[0];\n console.log(\"original max_Symmetry is \" + max_Symmetry);\n for (var i = 1; i < ld_len; i++) {\n if (S_array[i] > max_Symmetry) {\n max_Symmetry = S_array[i];\n }\n }\n if (max_Symmetry == undefined) {\n return undefined;\n }\n console.log(\"S_array\");\n console.log(S_array);\n console.log(\"Slb_index,Srb_index is \" + Slf_index, Srb_index);\n console.log(\"SSl_index,SSr_index is \" + SSl_index, SSr_index);\n console.log(\"Slb_distance,Srb_distance is \" + Slb_distance, Srb_distance);\n console.log(\"final max_Symmetry is \" + max_Symmetry);\n return max_Symmetry;\n}", "title": "" }, { "docid": "2e63b00666b89b4b8ef0dd063f693635", "score": "0.5108495", "text": "function set_IR_thresh(high_thresh, low_thresh){\n\n if(high_thresh >32767 || high_thresh < -32767 || low_thresh >32767 || low_thresh < -32767){\n return NaN;\n }\n var high_thresh_L=0, high_thresh_H=0,low_thresh_L=0,low_thresh_H=0;\n\n if(high_thresh >= 0){\n high_thresh_L = high_thresh % 256;\n high_thresh_H =(high_thresh - high_thresh_L) / 256;\n }else {\n high_thresh_L =(high_thresh + 32768)% 256;\n high_thresh_H=(high_thresh + 32768 -high_thresh_L)/256 +128;\n }\n if(low_thresh>=0){\n low_thresh_L=low_thresh% 256;\n low_thresh_H =(low_thresh- low_thresh_L)/256; \n } else {\n low_thresh_L = (low_thresh + 32768)% 256;\n low_thresh_H = (low_thresh + 32768 - low_thresh_L)/256 + 128;\n }\n i2c_write_reg(0x64,0x0B,[high_thresh_L,high_thresh_H,low_thresh_L,low_thresh_H]);\n}", "title": "" }, { "docid": "d89b615c6e11b5f3e06bfa91ebbd6fdc", "score": "0.5092744", "text": "function cal_center(rows,columns,pixel_data_16,pixel_data_8){\n let mat_16 = cv.matFromArray(rows, columns, cv.CV_16UC1, pixel_data_16);\n let mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n var cal_array = [];\n var boundray_value = 200;\n var rc=rows * columns;\n for (var i = 0; i < rc; i++) {\n cal_array[i] = 65535 - pixel_data_8[i];\n }\n for (var i = 0; i < rc; i++) {\n if (pixel_data_8[i] > boundray_value) {\n pixel_data_8[i] = 0;\n }\n /* else{\n pixel_data_8[i]=1;\n } */\n }\n let bin_mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n console.log(\"binarization\");\n console.log(pixel_data_8);\n let contours = new cv.MatVector();\n let hierarchy = new cv.Mat();\n cv.findContours(bin_mat_8, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);\n let cnt = contours.get(0);\n let moments = cv.moments(cnt, false);\n let cx = moments.m10 / moments.m00;\n let cy = moments.m01 / moments.m00;\n console.log(cx, cy);\n let int_cx = parseInt(cx); //type conversion\n let int_cy = parseInt(cy);\n console.log(int_cx, int_cy);\n if(cx==undefined || cy==undefined){\n console.log(\"image center cx or cy is undefined or not find!\");\n return undefined;\n }\n return {\n x:int_cx,\n y:int_cy\n }\n}", "title": "" }, { "docid": "405c143a28ad9f913ed0f3d6aee261c5", "score": "0.50826716", "text": "function calcSpecificityPosX(sample) {\n var tn = 0;\n for (var i = 0; i < sample.length; i++) {\n tn += sample[i].color == color2 && sample[i].x > xcut;\n }\n return (1-tn / n2)*300+30;\n}", "title": "" }, { "docid": "1897c47e1e8f10b786a552ccfadfc33c", "score": "0.5044523", "text": "getThresholdLevel(series) {\n // default to ok\n var thresholdLevel = 0;\n var value = series.value;\n var thresholds = series.colorData.thresholds;\n // if no thresholds are defined, return 0\n if (thresholds === undefined) {\n return thresholdLevel;\n }\n // make sure thresholds is an array of size 2\n if (thresholds.length !== 2) {\n return thresholdLevel;\n }\n if (value >= thresholds[0]) {\n // value is equal or greater than first threshold\n thresholdLevel = 1;\n }\n if (value >= thresholds[1]) {\n // value is equal or greater than second threshold\n thresholdLevel = 2;\n }\n return thresholdLevel;\n }", "title": "" }, { "docid": "287f0429d710a7362a715e7f80603675", "score": "0.50344044", "text": "function hit(x1,y1,x2,y2){return Math.abs(x1-x2)<CLICKBUSTER_THRESHOLD&&Math.abs(y1-y2)<CLICKBUSTER_THRESHOLD}", "title": "" }, { "docid": "1d76fafe757fa5510626a457ad7575b9", "score": "0.49974823", "text": "get threshold() {\n return gainToDb(this._gt.value);\n }", "title": "" }, { "docid": "c0bf14da37ff198d6711603207b24294", "score": "0.49581197", "text": "findThreshold(points, len, rl){\r\n let max = 0;\r\n for (let i = 0; i < len; i++){\r\n let d = Math.abs(parseFloat(points[i].y) - parseFloat(rl.f(parseFloat(points[i].x))))\r\n if(d > max){\r\n max = d;\r\n }\r\n }\r\n return max;\r\n }", "title": "" }, { "docid": "546cd7cc2172bb62560ef4af14779172", "score": "0.49532306", "text": "findTarget(image) {\n const distMap = colorDistance(image, new Uint8ClampedArray([255, 0, 0, 255]));\n this.view2.setData(distMap.data);\n const binMap = threshold(distMap, 32);\n this.view1.setData(binMap.data);\n const blobs = blobify(binMap);\n // this.output2.value = Array.from(blobs.values()).map(b => JSON.stringify(b)).join('\\n');\n let maxBlob = { centroid: create$2(), count: 0 };\n for (let b of blobs.values()) {\n if (b.count > maxBlob.count)\n maxBlob = b;\n }\n return maxBlob;\n }", "title": "" }, { "docid": "341a92fa8c5d904ab7285e09b2e87a4e", "score": "0.49247664", "text": "function filter_canny(dict) {\n\tconst lowTreshold = \tdict['low'] \t|| 0.01;\n\tconst highTreshold = \tdict['high'] \t|| 0.1;\n\tconst width = \t\t\tdict['width'] \t|| WIDTH;\n\tconst height = \t\t\tdict['height'] \t|| HEIGHT;\n\n\treturn function (img) {\n\t\tconst noiseReductionMask = gaussianMask(2, 1.4);\n\t\tconst horizontalMask = [[-1, 0, 1]];\n\t\tconst verticalMask = [[1], [0], [-1]];\n\n\t\t// Noise reduction\n\t\tlet data = filter_greyScale({})(img);\n\t\tdata = applyMask(data, width, height, noiseReductionMask);\n\n\t\t// Gradient mapping\n\t\tconst Gx = applyMask(data, width, height, horizontalMask);\n\t\tconst Gy = applyMask(data, width, height, verticalMask);\n\t\tconst G = Gx.map((e, i) => (i % 4 === 3) ? 255 : Math.sqrt(e ** 2 + Gy[i] ** 2));\n\n\t\t// Non-maxima deletion\n\t\tfunction isLocalMaxima(e, i) {\n\t\t\tif (e >= G[i - 4] && e >= G[i + 4] && e >= G[i - (width) * 4] && e >= G[i + (width) * 4])\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\tdata = G.map((e, i) => (i % 4 === 3) ? 255 : (isLocalMaxima(e, i) ? e : 0));\n\n\t\t// Outline tresholding (Hysteresis filter)\n\t\tlet accepted = new Array(G.length / 4).fill(0);\n\t\tfunction tresholding(e, i) {\n\t\t\tif (e >= highTreshold) {\n\t\t\t\taccepted[i] = 1;\n\t\t\t\treturn 255;\n\t\t\t} else if (e >= lowTreshold) {\n\t\t\t\tif (accepted[i - 1] === 1 || accepted[i - width] === 1) {\n\t\t\t\t\taccepted[i] = 1;\n\t\t\t\t\treturn 255;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tconst O = data.map((e, i) => (i % 4 === 3) ? 255 : tresholding(e / 255, (i - i % 4) / 4));\n\t\treturn O;\n\t};\n}", "title": "" }, { "docid": "dd36c3380165ce3a8c0be89dae290d76", "score": "0.49240467", "text": "function getc2c3() {\n var n = Math.sqrt(mid[30]);\n var tmp = (mid[26] * mid[25]) - (mid[24] * mid[27]);\n tmp = tmp / (n * mid[29]);\n if (Math.abs(tmp) <= 1.0)\n tmp = Math.sqrt(1.0 - (tmp * tmp)) * mid[29] / n;\n else\n tmp = 0.0;\n c2[0] = -1;\n c3[0] = 1;\n if (mid[29] < 0.0) {\n c2[1] = mid[1] + tmp;\n c3[1] = mid[1] - tmp;\n } else {\n c2[1] = mid[1] - tmp;\n c3[1] = mid[1] + tmp;\n }\n c2c3iterate(c2);\n c2c3iterate(c3);\n}", "title": "" }, { "docid": "947f84f8d977adafbfbd795dae06a489", "score": "0.48963282", "text": "get threshold() {\n\t\treturn parseInt(this.getAttribute('threshold'));\n\t}", "title": "" }, { "docid": "3db570359e250f8d068b6fe384bd94e5", "score": "0.48957643", "text": "function classify_region(r, c, s, pixels, ldim) {\n r = 256 * r;\n c = 256 * c;\n var root = 0;\n var o = 0.0;\n var pow2tdepth = Math.pow(2, tdepth) >> 0; // '>>0' transforms this number to int\n\n for (var i = 0; i < ntrees; ++i) {\n var idx = 1;\n for (var j = 0; j < tdepth; ++j)\n // we use '>> 8' here to perform an integer division: this seems important for performance\n idx = 2 * idx + (pixels[((r + tcodes[root + 4 * idx + 0] * s) >> 8) * ldim + ((c + tcodes[root + 4 * idx + 1] * s) >> 8)] <= pixels[((r + tcodes[root + 4 * idx + 2] * s) >> 8) * ldim + ((c + tcodes[root + 4 * idx + 3] * s) >> 8)]);\n\n o = o + tpreds[pow2tdepth * i + idx - pow2tdepth];\n\n if (o <= thresh[i])\n return -1;\n\n root += 4 * pow2tdepth;\n }\n return o - thresh[ntrees - 1];\n }", "title": "" }, { "docid": "c269cde7398ad296761c82d4ea9f465d", "score": "0.4887933", "text": "function isIntersectionMiddle(intersection, waypoints, treshold) {\n var idx = intersection.index,\n p = intersection.point,\n p0, p1, mid, aligned, xDelta, yDelta;\n\n if (idx <= 0 || intersection.bendpoint) {\n return false;\n }\n\n p0 = waypoints[idx - 1];\n p1 = waypoints[idx];\n mid = getMidPoint(p0, p1),\n aligned = pointsAligned(p0, p1);\n xDelta = Math.abs(p.x - mid.x);\n yDelta = Math.abs(p.y - mid.y);\n\n return aligned && xDelta <= treshold && yDelta <= treshold;\n }", "title": "" }, { "docid": "2f9c2bc6976fbcd3077c58c95fadd0ae", "score": "0.48724055", "text": "function blackedges(cutoff, inData, outData, width, height, sx, sy, tx, ty, coord, filterFlag, edgeFlag) {\n // findblack\n var x_camera, y_camera;\n var x_grid, y_grid;\n var Ax = 0.3125;\n var Ay = -0.16666666666666666;\n var Bx = 0.0;\n var By = 80.0;\n var n = width * height * 4,\n midData = [],\n r, g, b;\n\n if(filterFlag){\n for (var i=0;i<n;i+=4) {\n r = inData[i];\n g = inData[i+1];\n b = inData[i+2];\n\n if (Math.max(r/255, g/255, b/255) <= cutoff) {\n outData[i] = 0;\n outData[i+1] = 0;\n outData[i+2] = 0;\n outData[i+3] = 255;\n } else {\n outData[i] = 255;\n outData[i+1] = 255;\n outData[i+2] = 255;\n outData[i+3] = 255;\n }\n }\n }\n\n if(edgeFlag){\n // blackedges: apply findedges to findblack\n var i,\n outline = [],\n j = 0,\n r, c,\n data1 = [],\n data2 = [],\n gr1, gr2, gg1, gg2, gb1, gb2,\n prog, lastProg = 0,\n convProgress1, convProgress2;\n\n convolve3x3(outData, data1, width, height,\n [[-1, 0, 1],\n [-2, 0, 2],\n [-1, 0, 1]]\n );\n convolve3x3(outData, data2, width, height,\n [[-1, -2, -1],\n [ 0, 0, 0],\n [ 1, 2, 1]]\n );\n\n for (i=0;i<n;i+=4) {\n gr1 = Math.abs(data1[i]);\n gr2 = Math.abs(data2[i]);\n gg1 = Math.abs(data1[i+1]);\n gg2 = Math.abs(data2[i+1]);\n gb1 = Math.abs(data1[i+2]);\n gb2 = Math.abs(data2[i+2]);\n\n outData[i] = 255 - (gr1 + gr2) * 0.8;\n outData[i+1] = 255 - (gg1 + gg2) * 0.8;\n outData[i+2] = 255 - (gb1 + gb2) * 0.8;\n outData[i+3] = inData[i+3];\n }\n\n // wipe out bottom black edge\n for (k=4*width*(height-1);k<4*width*height;k++) {\n outData[k] = 255;\n }\n }\n\n for(var i=0; i<n; i++){\n if(outData[i*4] === 0){\n x_camera = i % width;\n y_camera = (i - x_camera) / width;\n\n x_camera = sx * x_camera + tx;\n y_camera = sy * y_camera + ty;\n\n x_grid = Ax * x_camera + Bx;\n y_grid = Ay * y_camera + By;\n\n coord.push(Math.floor(x_grid));\n coord.push(Math.floor(y_grid));\n }\n }\n}", "title": "" }, { "docid": "b509ec1adf1925671a4c9a96338643ea", "score": "0.48421603", "text": "function tear(threshold) {\n for (let i = 0; i < cloth.sticks.length; i++) {\n // find the distance between two points\n let dist = cloth.sticks[i].startPoint.pos.dist(\n cloth.sticks[i].endPoint.pos\n );\n if (dist > (threshold || 20)) {\n // remove if the dist is > than threshold\n cloth.removeSticks(cloth.sticks[i].startPoint);\n }\n }\n }", "title": "" }, { "docid": "6a2f0ed9fafbd768d900041db4d94500", "score": "0.481719", "text": "static area(contour2) {\n const n = contour2.length;\n let a = 0;\n for(let p = n - 1, q = 0; q < n; p = q++)a += contour2[p].x * contour2[q].y - contour2[q].x * contour2[p].y;\n return a * 0.5;\n }", "title": "" }, { "docid": "fc68e0e9f813afde1f52f1cf77425c91", "score": "0.48016596", "text": "async function threshold() {\n if (runProgram.innerHTML == \"Run\"){\n return;\n }\n counter = 0;\n let cornerValue = Math.floor(3*simThreshold);\n let edgeValue = Math.floor(5*simThreshold);\n let centerValue = Math.floor(8*simThreshold);\n for (let i=0; i<(dimension); i++){\n for (let j=0; j<(dimension); j++){\n let tableValue = tableArray[i][j];\n simValue = 0;\n if (i==0 || j==0 || i==(dimension-1) || j==(dimension-1)){\n if (i==0 && j==0){\n if (tableArray[i][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j]==tableValue) {\n simValue++;\n }\n if(simValue < cornerValue){\n switchArrayVal(i, j);\n }\n }\n else if (i==0 && j==(dimension-1)){\n if (tableArray[i][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j]==tableValue) {\n simValue++;\n }\n if(simValue < cornerValue){\n switchArrayVal(i, j);\n }\n }\n else if (i==(dimension-1) && j==0){\n if (tableArray[i][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j]==tableValue) {\n simValue++;\n }\n if(simValue < cornerValue){\n switchArrayVal(i, j);\n }\n }\n else if (i==(dimension-1) && j==(dimension-1)){\n if (tableArray[i][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j]==tableValue) {\n simValue++;\n }\n if(simValue < cornerValue){\n switchArrayVal(i, j);\n }\n }\n else if (i==0){\n if (tableArray[i][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i][j+1]==tableValue) {\n simValue++;\n }\n if(simValue < edgeValue){\n switchArrayVal(i, j);\n }\n }\n else if (i==(dimension-1)){\n if (tableArray[i][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i][j+1]==tableValue) {\n simValue++;\n }\n if(simValue < edgeValue){\n switchArrayVal(i, j);\n }\n }\n else if (j==0){\n if (tableArray[i-1][j]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j]==tableValue) {\n simValue++;\n }\n if(simValue < edgeValue){\n switchArrayVal(i, j);\n }\n }\n else if (j==(dimension-1)){\n if (tableArray[i-1][j]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j]==tableValue) {\n simValue++;\n }\n if(simValue < edgeValue){\n switchArrayVal(i, j);\n }\n }\n }\n else {\n if (tableArray[i][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j-1]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j]==tableValue) {\n simValue++;\n }\n if (tableArray[i+1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j+1]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j]==tableValue) {\n simValue++;\n }\n if (tableArray[i-1][j-1]==tableValue) {\n simValue++;\n }\n if(simValue < centerValue){\n switchArrayVal(i, j);\n }\n }\n }\n }\n await new Promise((resolve) => \n setTimeout(() => {\n resolve();\n }, 100)\n );\n createTable();\n if (counter == 0) {\n runProgram.innerHTML = \"Run\";\n return;\n }\n genCounter++;\n status.innerHTML = \"Generations: \" + genCounter;\n if (counter > 0) {\n threshold();\n }\n}", "title": "" }, { "docid": "91c64913524228d4886be18eedcab29a", "score": "0.4798569", "text": "function analyzeSensorCoverage3 (part, inputStr, extraParam, DEBUG = false) {\n const inputArr = inputStr.split('\\r\\n');\n\n // UTILITY\n const getManhattanDistance = (x1, y1, x2, y2) => Math.abs(x1 - x2) + Math.abs(y1 - y2);\n const mergeOverlappingRanges = ranges => {\n ranges.sort((a, b) => a[0] - b[0]);\n const mergedRanges = [ ranges[0] ];\n for (const range of ranges) {\n if (range[0] > mergedRanges.at(-1)[1] + 1) mergedRanges.push(range); // no overlap\n else mergedRanges.at(-1)[1] = Math.max(mergedRanges.at(-1)[1], range[1]); // overlap (even if start of interval is 1 more than end of prev)\n }\n return mergedRanges;\n }\n\n // OPTIONAL INIT\n let minSensorX = Infinity;\n let maxSensorX = -Infinity;\n let minSensorY = Infinity;\n let maxSensorY = -Infinity;\n let minBeaconX = Infinity;\n let maxBeaconX = -Infinity;\n let minBeaconY = Infinity;\n let maxBeaconY = -Infinity;\n \n // INIT DATA STRUCTURE\n const SENSOR_DATA = {};\n \n // PARSE DATA\n for (const line of inputArr) {\n\n // ingest from input\n const [LS, RS] = line.split(': closest beacon is at ');\n const [SENSOR_X_DATA, SENSOR_Y_DATA] = LS.split(', ');\n const sensorX = +SENSOR_X_DATA.split('=')[1];\n const sensorY = +SENSOR_Y_DATA.split('=')[1];\n const [BEACON_X_DATA, BEACON_Y_DATA] = RS.split(', ');\n const beaconX = +BEACON_X_DATA.split('=')[1];\n const beaconY = +BEACON_Y_DATA.split('=')[1];\n\n // save critical information to data structure\n const sensor = `${sensorX},${sensorY}`;\n const beacon = [beaconX, beaconY];\n const manhattanDistance = getManhattanDistance(beaconX, beaconY, sensorX, sensorY)\n SENSOR_DATA[sensor] = { beacon, manhattanDistance };\n\n // OPTIONAL\n if (EXPLORE_MIN_MAX) {\n minSensorX = Math.min(minSensorX, sensorX);\n maxSensorX = Math.max(maxSensorX, sensorX);\n minSensorY = Math.min(minSensorY, sensorY);\n maxSensorY = Math.max(maxSensorY, sensorY);\n minBeaconX = Math.min(minBeaconX, beaconX);\n maxBeaconX = Math.max(maxBeaconX, beaconX);\n minBeaconY = Math.min(minBeaconY, beaconY);\n maxBeaconY = Math.max(maxBeaconY, beaconY);\n }\n }\n\n if (EXPLORE_MIN_MAX) {\n console.log(`(sensorX: from ${minSensorX} to ${maxSensorX})`);\n console.log(`(sensorY: from ${minSensorY} to ${maxSensorY})`);\n console.log(`(beaconX: from ${minBeaconX} to ${maxBeaconX})`);\n console.log(`(beaconY: from ${minBeaconY} to ${maxBeaconY})`);\n }\n\n // HELPER FUNCTION\n function getRangesOfEliminatedXValues(row) {\n const MEMO = {};\n function helper(row) {\n if (!(row in MEMO)) {\n // init\n const ranges = [];\n\n // iterate through sensor data\n for (const sensor in SENSOR_DATA) { // check every sensor to see if you can make eliminations in row\n const [sensorX, sensorY] = sensor.split(',').map(n => +n);\n const vertDistanceToRow = Math.abs(row - sensorY);\n if (vertDistanceToRow > SENSOR_DATA[sensor].manhattanDistance) continue; // this sensor's eliminated area does not reach row; skip it\n const horizDistance = SENSOR_DATA[sensor].manhattanDistance - vertDistanceToRow;\n ranges.push([sensorX - horizDistance, sensorX + horizDistance]);\n }\n\n // merge overlapping intervals to get true range of eliminated x values\n MEMO[row] = mergeOverlappingRanges(ranges);\n }\n return MEMO[row];\n }\n return helper(row);\n }\n\n // ANALYZE\n if (part === 1) { // PART 1: FIND # OF ELIMINATED x VALUES IN GIVEN ROW y\n\n // find intervals of eliminated x values in given row y\n const ROW_TO_CHECK = extraParam;\n const ranges = getRangesOfEliminatedXValues(ROW_TO_CHECK);\n\n // NOTE: it turns out that ranges above will only have 1 range with our data. in other words, our data would have it such that all ranges of\n // eliminated x values for given row y from the various sensors will overlap. however, going forward, i will NOT make that assumption, and for\n // purposes of part 1 i will account for the possibility of gaps in between the ranges of eliminated x values for given row y.\n\n // find intervals of gaps\n const gaps = [];\n for (let i = 0; i < ranges.length - 1; ++i) {\n gaps.push([ ranges[i][1] + 1, ranges[i + 1][0] - 1 ]);\n }\n \n // look for beacons in given row y and include them in gaps\n const beaconsInRow = new Set();\n for (const sensor in SENSOR_DATA) {\n const [x, y] = SENSOR_DATA[sensor].beacon;\n if (y === ROW_TO_CHECK) beaconsInRow.add(x);\n }\n for (const beacon of beaconsInRow) gaps.push([beacon, beacon]);\n const gapsWithBeacons = mergeOverlappingRanges(gaps);\n\n // calculate number of eliminated x values\n const spreadOfEliminatedXValues = ranges.at(-1)[1] - ranges[0][0] + 1;\n const gapCount = gapsWithBeacons.reduce((count, [s, e]) => count += e - s + 1, 0);\n return spreadOfEliminatedXValues - gapCount;\n\n } else { // PART 2: FIND COORDS OF UNKNOWN DISTRESS BEACON\n\n // HELPER FUNCTION: GIVEN 4 CORNERS, RETURN WHETHER RECTANGULAR AREA IS FULLY COVERED A SENSOR (AND THUS DOES NOT NEED TO BE CHECKED)\n function areaCoveredBySensor(topLeftX, topLeftY, botRightX, botRightY) {\n const AREA_CORNERS = [\n [topLeftX, topLeftY],\n [topLeftX, botRightY],\n [botRightX, topLeftY],\n [botRightX, botRightY]\n ];\n for (const sensor in SENSOR_DATA) {\n const [sensorX, sensorY] = sensor.split(',').map(n => +n);\n if (AREA_CORNERS.every(corner => {\n const [cornerX, cornerY] = corner;\n return getManhattanDistance(cornerX, cornerY, sensorX, sensorY)\n <= SENSOR_DATA[sensor].manhattanDistance;\n })) {\n if (SEE_AREA_BEING_SKIPPED) {\n console.log(`(SKIPPING REGION WITH AREA: ${\n (botRightX - topLeftX + 1) * (topLeftY - botRightY + 1)})`);\n }\n return true;\n }\n }\n return false;\n }\n\n // HELPER FUNCTION: SEARCH A RECTANGULAR AREA BOUNDED BY GIVEN COORDINATES FOR THE COORDS REPRESENTING THE ANSWER TO PART 2. RETURNS null IF NO ANSWER\n const ALREADY_CHECKED_ROWS = new Set();\n function binarySearchArea(topLeftX, topLeftY, botRightX, botRightY) {\n\n const H = topLeftY - botRightY + 1;\n const W = botRightX - topLeftX + 1;\n if (H < 1 || W < 1) return null; // not analyzing real area\n\n // BASE CASE: search area has been narrowed down to 1 row\n if (H === 1) {\n\n // get eliminated x values for this row\n const y = topLeftY;\n if (ALREADY_CHECKED_ROWS.has(y)) return null;\n ALREADY_CHECKED_ROWS.add(y);\n const ranges = getRangesOfEliminatedXValues(y);\n\n // CHECK IF THIS ROW HAS A SINGLE VALUE OF x NOT ELIMINATED:\n\n // 1) the non-eliminated x is in the middle of the row somewhere\n if (ranges.length > 1) {\n \n if (ranges.length !== 2) { // sanity check to make sure only 1 gap of possible x values\n throw 'ERROR: TOO MANY GAPS BETWEEN ELIMINATED VALUES OF x';\n }\n const sizeOfGap = ranges[1][0] - ranges[0][1] - 1;\n if (sizeOfGap !== 1) { // sanity check to make sure only 1 value of x is not eliminated\n throw `ERROR: TOO MANY NON-ELIMINATED VALUES OF x: ${sizeOfGap}`;\n }\n\n if (!DEBUG) console.log(`(RUN TOOK ${(Date.now() - TIME_AT_START)/1000} SECS)`);\n\n const x = ranges[0][1] + 1; // found x; y is given by index in for loop\n return x * TUNING_FREQUENCY_X_MULTIPLER + y;\n }\n\n // NOTE: THE BELOW ARE POSSIBILITIES THAT ARE HIGHLY IMPROBABLE AND DON'T ACTUALLY HAPPEN WITH THIS DATA\n\n // 2) the non-eliminated x is at the left edge of search area\n else if (ranges[0][0] > 0) {\n if (!DEBUG) console.log(`(RUN TOOK ${(Date.now() - TIME_AT_START)/1000} SECS)`);\n return y; // x is 0\n }\n\n // 3) the non-eliminated x is at the right edge of search area\n else if (ranges[0][1] < LIMIT_OF_SEARCH_AREA) {\n if (!DEBUG) console.log(`(RUN TOOK ${(Date.now() - TIME_AT_START)/1000} SECS)`);\n return LIMIT_OF_SEARCH_AREA * TUNING_FREQUENCY_X_MULTIPLER + y; // x is LIMIT_OF_SEARCH_AREA\n }\n\n return null;\n }\n\n // RECURSIVE CASE: CHECK IF FULL REGION IS ALREADY ELIMINATED BY SENSOR. IF NOT, SPLIT INTO 4 SMALLER REGIONS AND RECURSE\n else {\n\n if (areaCoveredBySensor(topLeftX, topLeftY, botRightX, botRightY)) return null; // OPTIMIZATION: check if region is already eliminated by any one sensor's data\n\n const midX = topLeftX + Math.floor((botRightX - topLeftX) / 2);\n const midY = botRightY + Math.floor((topLeftY - botRightY) / 2);\n\n const recurseTL = binarySearchArea(topLeftX, topLeftY, midX - 1, midY + 1); // recurse top left (do not include midX, midY)\n if (recurseTL !== null) return recurseTL;\n\n const recurseBL = binarySearchArea(topLeftX, midY, midX - 1, botRightY); // recurse bottom left (do not include midX)\n if (recurseBL !== null) return recurseBL;\n\n const recurseTR = binarySearchArea(midX, topLeftY, botRightX, midY + 1); // recurse top right (do not include midY)\n if (recurseTR !== null) return recurseTR;\n \n const recurseBR = binarySearchArea(midX, midY, botRightX, botRightY); // recurse bottom right\n if (recurseBR !== null) return recurseBR;\n return null;\n }\n }\n\n // INIT\n const LIMIT_OF_SEARCH_AREA = extraParam;\n const TUNING_FREQUENCY_X_MULTIPLER = 4000000;\n \n const TIME_AT_START = Date.now();\n if (!DEBUG) console.log('RUNNING PART 2 ANALYSIS (PLEASE WAIT)...');\n\n // ANALYZE\n const res = binarySearchArea(0, LIMIT_OF_SEARCH_AREA, LIMIT_OF_SEARCH_AREA, 0);\n if (res !== null) return res;\n throw 'ERROR: DID NOT FIND LOCATION OF UNKNOWN DISTRESS BEACON';\n\n }\n}", "title": "" }, { "docid": "2b9a6eecc202d372af445aac91d3bba5", "score": "0.47970507", "text": "function ccwPoints(A, B, C) {\n return (C[1]-A[1])*(B[0]-A[0]) > (B[1]-A[1])*(C[0]-A[0]);\n}", "title": "" }, { "docid": "0b9e3bb403be192ef6471afafed1e1b9", "score": "0.47891876", "text": "function pixelDistance(r1, g1, b1, r2, g2, b2) {\n return Math.abs((r1+g1+b1)/3 - (r2+g2+b2)/3);\n}", "title": "" }, { "docid": "ef6253e32a8b62a50fef801cae714827", "score": "0.4783487", "text": "function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3_array__[\"d\" /* bisect */])(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = __WEBPACK_IMPORTED_MODULE_1__array__[\"b\" /* slice */].call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = __WEBPACK_IMPORTED_MODULE_1__array__[\"b\" /* slice */].call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}", "title": "" }, { "docid": "5cd980b201694592b22830c2e929d266", "score": "0.4766754", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "02657ecc471841c26c2c81775d58182b", "score": "0.47504848", "text": "function searchContinuityAboveValueTwoSignals(data1, data2, indexBegin, indexEnd, threshold1, threshold2, winLength) {\n var firstIndex = null;\n var countOfGoodMatches = 0;\n\n for (var i = indexBegin; i <= indexEnd; i++) {\n var alreadyIncremeted1 = false;\n var alreadyIncremeted2 = false;\n\n data1[i].forEach(function(val, index, array) {\n if (val > threshold1 && index != 0) {\n if (!alreadyIncremeted1) {\n alreadyIncremeted1 = true;\n }\n }\n })\n\n data2[i].forEach(function(val, index, array) {\n if (val > threshold2 && index != 0) {\n if (!alreadyIncremeted2) {\n alreadyIncremeted2 = true;\n }\n }\n })\n\n if (alreadyIncremeted1 && alreadyIncremeted2) {\n countOfGoodMatches = countOfGoodMatches + 1;\n if (!firstIndex) {\n firstIndex = i;\n }\n }\n }\n\n if (countOfGoodMatches > winLength) {\n console.log('searchContinuityAboveValueTwoSignals FirstIndex: ', firstIndex);\n return firstIndex;\n } else {\n console.log('searchContinuityAboveValueTwoSignals FirstIndex: FALSE');\n return false;\n }\n}", "title": "" }, { "docid": "cee3d49b92737a152a406733f09efa3d", "score": "0.47492504", "text": "function isOverThreshold(val, sortedEx) {\n return val >= (2 * findMedian(sortedEx)) ? 1 : 0;\n}", "title": "" }, { "docid": "585b15f8a806e7bb58fdc54470cae274", "score": "0.4737998", "text": "function heuristic(a, b) {\n var d = dist(a.r,a.c, b.r,b.c);\n //var d = abs(a.r - b.r) + abs(a.c - b.c);\n return d;\n}", "title": "" }, { "docid": "ee443f7267a1d66306982e6a998933ce", "score": "0.47282708", "text": "function ccw(x1, y1, x2, y2, x3, y3) {\n var cw = ((y3 - y1) * (x2 - x1)) - ((y2 - y1) * (x3 - x1));\n return cw > 0 ? true : !(cw < 0);\n}", "title": "" }, { "docid": "6589197c6e6fd973f2265bfcaa694966", "score": "0.47239313", "text": "function differenceAccuracy(target, data1, data2) \n{\n if (data1.length != data2.length) return null; // if they're not the same width and height(canvas), can't compare accurate image pixel differences.\n var i = 0;\n while (i < (data1.length * 0.25)) \n {\n var average1 = (data1[4*i] + data1[4*i+1] + data1[4*i+2]) / 3; \n var average2 = (data2[4*i] + data2[4*i+1] + data2[4*i+2]) / 3;\n var diff = threshold(fastAbs(average1 - average2)); // this is comparing the difference in pixels between two canvas images. \n target[4*i] = diff;\n target[4*i+1] = diff;\n target[4*i+2] = diff;\n target[4*i+3] = 0xFF;\n ++i;\n }\n\n}", "title": "" }, { "docid": "98397fc579dd34213090bc8f03bf30b6", "score": "0.4719287", "text": "function getMid(p1, p2) {\n return vec3(\n (p1[0] + p2[0]) * 0.5,\n (p1[1] + p2[1]) * 0.5,\n (p1[2] + p2[2]) * 0.5\n );\n}", "title": "" }, { "docid": "a7e1d129941a0b281e6626e1cdb80e5b", "score": "0.47164175", "text": "function matchColorDistance(c1,c2) {\n // ds1: magintude difference between two target color and pixel color (squared)\n var ds1 = Math.pow((c2[0]-c1[0]),2) +\n Math.pow(c2[1]-c1[1],2) +\n Math.pow(c2[2]-c1[2],2) +\n Math.pow(c2[3]-c1[3],2);\n return !isNaN(ds1) && ds1 <= ds2;\n }", "title": "" }, { "docid": "77ce09fa6bcabd0443d4c46b6ffd4dcb", "score": "0.4707906", "text": "function triangleCoverage(x, y) {\n var inside = (edgeFunction(x1, y1, x2, y2, x, y) &&\n edgeFunction(x2, y2, x3, y3, x, y) &&\n edgeFunction(x3, y3, x1, y1, x, y));\n return inside ? 1 : 0;\n }", "title": "" }, { "docid": "e5fc68740410274816b0f808fb38ed67", "score": "0.46985114", "text": "function checkBounds(){\n if(posx >7 && wire.address === 112){\n wire = new i2c(address[1], {device: '/dev/i2c-1'}); // Q0 to Q1 \n posx=0;\n checkQuadrant(wire);\n }\n if(posx > 7 && wire.address === 114){\n wire = new i2c(address[3], {device: '/dev/i2c-1'}); // Q2 to Q3\n posx=0;\n checkQuadrant(wire);\n }\n if(posx <0 && wire.address === 113){\n wire = new i2c(address[0], {device: '/dev/i2c-1'}); // Q1 to Q0\n posx=7;\n checkQuadrant(wire);\n }\n if(posx <0 && wire.address === 115){\n wire = new i2c(address[2], {device: '/dev/i2c-1'}); // Q3 to Q2\n posx=7;\n checkQuadrant(wire);\n }\n if(posy>7 && wire.address === 112){\n wire = new i2c(address[2], {device: '/dev/i2c-1'}); // Q0 to Q2\n posy=0;\n checkQuadrant(wire);\n }\n if(posy>7 && wire.address === 113){\n wire = new i2c(address[3], {device: '/dev/i2c-1'}); // Q1 to Q3\n posy=0;\n checkQuadrant(wire);\n }\n if(posy<0 && wire.address === 114){\n wire = new i2c(address[0], {device: '/dev/i2c-1'}); // Q2 to Q0 \n posy=7;\n checkQuadrant(wire);\n }\n if(posy<0 && wire.address === 115){\n wire = new i2c(address[1], {device: '/dev/i2c-1'}); // Q3 to Q1 \n posy=7;\n checkQuadrant(wire);\n }\n if(posx <0 && wire.address === 112 || posy <0 && wire.address===112){\n b.readTextFile(highScore,printScore);\n }\n if(posx >7 && wire.address === 113 || posy <0 && wire.address===113){\n b.readTextFile(highScore,printScore);\n }\n if(posx <0 && wire.address === 114 || posy >7 && wire.address===114){\n b.readTextFile(highScore,printScore);\n }\n if(posx >7 && wire.address === 115 || posy >7 && wire.address===115){\n b.readTextFile(highScore,printScore);\n }\n return wire; \n}", "title": "" }, { "docid": "2736ca117ae25347a746623b5aee0fcb", "score": "0.46955186", "text": "getThresholdAlignment(callerAxis) {\n if (!isNumber(this.dataMin) ||\n (this !== callerAxis &&\n this.series.some((s) => (s.isDirty || s.isDirtyData)))) {\n this.getSeriesExtremes();\n }\n if (isNumber(this.threshold)) {\n let thresholdAlignment = clamp(((this.threshold - (this.dataMin || 0)) /\n ((this.dataMax || 0) - (this.dataMin || 0))), 0, 1);\n if (this.options.reversed) {\n thresholdAlignment = 1 - thresholdAlignment;\n }\n return thresholdAlignment;\n }\n }", "title": "" }, { "docid": "a32267f8e00caa51cc5f98eaa963d3e8", "score": "0.46912706", "text": "get threshold() {\n return Object(_core_type_Conversions__WEBPACK_IMPORTED_MODULE_5__[\"gainToDb\"])(this._gt.value);\n }", "title": "" }, { "docid": "a27e1f7ddc4012ad92830ce54e97f48f", "score": "0.46904305", "text": "function metCon(distance){\n return distance * .62137;\n}", "title": "" }, { "docid": "fc39a6d76dfaef3abbffdc00445d79f2", "score": "0.46800694", "text": "function regionDetection(x, y) { \n var closest; //closest object\n var distance = Infinity; //distance of closest object\n var location; //location of object in array\n var range = 2;\n\n //check nodes\n for (var i = 0; i < nodes.length; i++) {\n var c = nodes[i].coords; //parsing through the coords of every node\n var dist = (x - c[0])*(x - c[0]) + (y - c[1])*(y - c[1]);\n if (Math.sqrt(dist) <= (range + radius)) {\n if (dist < distance) {\n closest = 'n';\n distance = dist;\n location = i;\n }\n }\n }\n\n //check edges\n for (var i = 0; i < edges.length; i++) {\n var end_nodes = edges[i].coords;\n var coordsA = nodeID(end_nodes[0]).coords;\n var coordsB = nodeID(end_nodes[1]).coords;\n var range = 3;\n\n //check range\n if ((Math.min(coordsA[0], coordsB[0]) - range) <= x <= (Math.max(coordsA[0], coordsB[0]) + range) && //x coords\n (Math.min(coordsA[1], coordsB[1]) - range) <= y <= (Math.max(coordsA[1], coordsB[1]) + range)) { //y coords\n //find distance to line\n var m = (coordsA[1] - coordsB[1]) / (coordsA[0] - coordsB[0]);\n var dist = Math.abs(y - coordsA[1] - m * x + m * coordsA[0]) / Math.sqrt(1 + m * m);\n if (dist < range && dist + radius + range < distance) {\n closest = 'e';\n distance = dist;\n location = i;\n }\n }\n }\n\n if (distance == Infinity) return 'none';\n return [closest, location];\n}", "title": "" }, { "docid": "ea6bb7d37cb51b6486c1f251ba149cc1", "score": "0.4676026", "text": "function findCorrelationPoint(secondMatchedArray, result){\n\n secondMatchedArray.map(function(query){\n\n var correlationPoint= query.match1 + query.match2 + query.match3 + query.inclusion\n query.correlation= correlationPoint\n\n if(biggestCorrelation.correlation <= query.correlation){\n biggestCorrelation= query;\n }\n\n })\n\n }", "title": "" }, { "docid": "5b23484d30959da8290214f108252cd7", "score": "0.46652856", "text": "function cal_film_diagsing(rows,columns,pixel_data_16,pixel_data_8,per,pixel_space){\n let mat_16 = cv.matFromArray(rows, columns, cv.CV_16UC1, pixel_data_16);\n let mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n var cal_array = [];\n var boundray_value = 200;\n var rc=rows * columns;\n for (var i = 0; i < rc; i++) {\n cal_array[i] = 65535 - pixel_data_8[i];\n }\n for (var i = 0; i < rc; i++) {\n if (pixel_data_8[i] > boundray_value) {\n pixel_data_8[i] = 0;\n }\n /* else{\n pixel_data_8[i]=1;\n } */\n }\n let bin_mat_8 = cv.matFromArray(rows, columns, cv.CV_8UC1, pixel_data_8);\n let penumbra_mat = cv.matFromArray(rows, columns, cv.CV_16UC1, cal_array);\n console.log(\"binarization\");\n console.log(pixel_data_8);\n let contours = new cv.MatVector();\n let hierarchy = new cv.Mat();\n cv.findContours(bin_mat_8, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);\n let cnt = contours.get(0);\n let moments = cv.moments(cnt, false);\n let cx = moments.m10 / moments.m00;\n let cy = moments.m01 / moments.m00;\n console.log(cx, cy);\n let int_cx = parseInt(cx); //type conversion\n let int_cy = parseInt(cy);\n console.log(int_cx, int_cy);\n //lub_dx:\n //lub_dy: Upper left half of main diagonal boundary point\n var lub_dx;\n var lub_dy;\n var i,j;\n for (i = int_cx,j=int_cy; i > 0,j>0; i--,j--) {\n if (mat_8.ucharAt(i, j) > boundray_value) {\n lub_dx=i;\n lub_dy=j;\n break;\n }\n }\n if (lub_dx == undefined || lub_dy == undefined) {\n console.log(\"Upper left half of main diagonal boundary point is undefined or not find!\");\n return undefined;\n }\n //rdb_dx:\n //rdb_dy: Down right half of main diagonal boundary point\n var rdb_dx;\n var rdb_dy;\n for (i =int_cx,j=int_cy; i <columns,j<rows;i++,j++) {\n if (mat_8.ucharAt(i,j) > boundray_value) {\n rdb_dx=i;\n rdb_dy=j;\n break;\n }\n }\n if (rdb_dx == undefined || rdb_dy == undefined) {\n console.log(\"Down left half of main diagonal boundary point is undefined or not find!\");\n return undefined;\n }\n //ldb_dx:\n //ldb_dy: Down left half of sub diagonal boundary point\n var ldb_dx;\n var ldb_dy;\n for(i=int_cx,j=int_cy;i>0,j<rows;i--,j++){\n if(mat_8.ucharAt(i,j)>boundray_value){\n ldb_dx=i;\n ldb_dy=j;\n }\n }\n if (ldb_dx == undefined || ldb_dy == undefined) {\n console.log(\"Down left half of sub diagonal boundary point is undefined or not find!\");\n return undefined;\n }\n //rub_dx:\n //rub_dy:Upper right half of sub diagnoal boundary point\n var rub_dx;\n var rub_dy;\n for(i=int_cx,j=int_cy;i<columns,j>0;i++,j--){\n if(mat_8.uncharAt(i,j)>boundray_value){\n rub_dx=i;\n rub_dy=j;\n }\n }\n if (rub_dx == undefined || rub_dy == undefined) {\n console.log(\"Upper right half of sub diagnoal boundary point is undefined or not find!\");\n return undefined;\n }\n //lumin_value:left up main diagonal min_pixel_value\n var lumin_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (i =lub_dx,j=lub_dy ; i < int_cx,j<int_cy; i++,j++) {\n if (penumbra_mat.ushortAt(i, j) < lumin_value) {\n lumin_value = penumbra_mat.ushortAt(i, j);\n }\n }\n //rdmin_value:right down main diagonal min_pixel_value\n var rdmin_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (i = int_cx,j=int_cy;i<rdb_dx,j<rdb_dy; i++,j++) {\n if (penumbra_mat.ushortAt(i, j) < rdmin_value) {\n rdmin_value = penumbra_mat.ushortAt(i, j);\n }\n }\n //ldmin_value:left down sub diagonal min_pixel_value\n var ldmin_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (i = ldb_dx,j=ldb_dy; i < int_cx,j>int_cy;i++,j--) {\n if (penumbra_mat.ushortAt(i,j) < ldmin_value) {\n ldmin_value = penumbra_mat.ushortAt(i,j);\n }\n }\n //rumin_value:right up sub diagonal min_pixel_value\n var rumin_value = penumbra_mat.ushortAt(int_cx, int_cy);\n for (i = int_cx,j=int_cy; i< rub_dx,j>rub_dy;i++,j--) {\n if (penumbra_mat.ushortAt(i,j) < rumin_value) {\n rumin_value = penumbra_mat.ushortAt(i,j);\n }\n }\n //cd_value:center_dose_value\n var cd_value = parseInt(penumbra_mat.ushortAt(int_cx, int_cy));\n //lumD_value:left_up_center_min_D_value\n var lumD_value = cd_value -lumin_value;\n //rdmD_value: right_down_center_min_D_value\n var rdmD_value = cd_value - rdmin_value;\n //lufpd_value:left_up_fifty_percent_dose_value\n var lufpd_value = parseInt(lumD_value / 2 + lumin_value);\n console.log(cd_value, 'left up %50 dose value is ' + lufpd_value);\n // rdfpd_value:right_down_fifty_percent_dose_value\n var rdfpd_value = parseInt(rdmD_value / 2 + rdmin_value);\n console.log(cd_value, 'right down %50 dose value is ' + rdfpd_value);\n //ldmD_value:left_down_center_min_D_value\n var ldmD_value = cd_value - ldmin_value;\n //rumD_value:down_center_min_D_value\n var rumD_value = cd_value - rumin_value;\n //lffpd_value:left_down_fifty_percent_dose_value\n var lffpd_value = parseInt(ldmD_value / 2 + ldmin_value);\n console.log(cd_value, 'left down %50 dose value is ' + lffpd_value);\n // rufpd_value:right_up_fifty_percent_dose_value\n var rufpd_value = parseInt(rumD_value / 2 + rumin_value);\n console.log(cd_value, 'right up %50 dose value is ' + rufpd_value);\n var lufpd_dx;\n var lufpd_dy;\n //lufpd_dx:\n //lufpd_dy:left_up_fifty_percent_dose_point\n for (i =lub_dx,j=lub_dy;i<int_cx,j<int_cy;i++,j++) {\n if (Math.abs(penumbra_mat.ushortAt(i,j)-lufpd_value) < 5) {\n lufpd_dx=i;\n lufpd_dy=j;\n break;\n }\n }\n //rdfpd_dx:\n //rdfpd_dy:right_down_fifty_percent_dose_point\n var rdfpd_dx;\n var rdfpd_dy;\n for (i = int_cx,j=int_cy; i < rdb_dx,j<rdb_dy; i++,j++) {\n if (Math.abs(penumbra_mat.ushortAt(i,j) - rdfpd_value) < 5) {\n rdfpd_dx;\n rdfpd_dy;\n break;\n }\n }\n var lffpd_dx;\n var lffpd_dy;\n //lffpd_dx:\n //lffpd_dy: left_down_fifty_percent_dose_point\n for (i = ldb_dx,j=ldb_dy; i < int_cx,j>int_cy; i++,j--) {\n if (Math.abs(penumbra_mat.ushortAt(i,j) - lffpd_value) < 5) {\n lffpd_dx = i;\n lffpd_dy = j;\n break;\n }\n }\n //rufpd_dx:\n //rufpd_dy: right_up_fifty_percent_dose_point\n var rufpd_dx;\n var rufpd_dy;\n for (i = int_cx,j=int_cy; i <rub_dx,j>rub_dy; i++,j--) {\n if (Math.abs(penumbra_mat.ushortAt(i,j) -rufpd_value) < 5) {\n rufpd_dx=i;\n rufpd_dy=j;\n break;\n }\n }\n if(per==0.9){\n //lunpd_value:left_up_ninety_percent_dose_value\n var lunpd_value = parseInt(lumD_value *per + lumin_value);\n console.log(cd_value, 'left up %90 dose value is ' + lunpd_value);\n // rdnpd_value:right_down_ninety_percent_dose_value\n var rdnpd_value = parseInt(rdmD_value *per + rdmin_value);\n console.log(cd_value, 'right down %90 dose value is ' + rdnpd_value);\n //lfnpd_value:left_down_ninety_percent_dose_value\n var lfnpd_value = parseInt(ldmD_value *per + ldmin_value);\n console.log(cd_value, 'left down %90 dose value is ' + lfnpd_value);\n // runpd_value:right_up_ninety_percent_dose_value\n var runpd_value = parseInt(rumD_value *per + rumin_value);\n console.log(cd_value, 'right up %90 dose value is ' + runpd_value);\n var enp1=cal_film_mainp(int_cx,int_cy,lunpd_value,lub_dx,lub_dy,rdnpd_value,rdb_dx,rdb_dy);\n var ludis=cal_point_distance(lufpd_dx,lufpd_dy,enp1.lunpd_x,enp1.lunpd_y,pixel_space);\n var rddis=cal_point_distance(rdfpd_dx,rdfpd_dy,enp1.rdnpd_x,enp1.rdnpd_y,pixel_space);\n var edis1=(ludis>rddis)?ludis:rddis;\n var enp2=cal_film_subp(int_cx,int_cy,lfnpd_value,ldb_dx,ldb_dy,runpd_value,rub_dx,rub_dy);\n var lfdis=cal_point_distance(lffpd_dx,lffpd_dy,enp2.lfnpd_x,enp2.lfnpd_y,pixel_space);\n var rudis=cal_point_distance(rufpd_dx,rufpd_dy,enp2.runpd_x,enp2.runpd_y,pixel_space);\n var edis2=(lfdis>rudis)?lfdis:rudis;\n var edis=(edis1>edis2)?edis1:edis2;\n return edis;\n }else{\n console.log(\"percentage is error!\");\n return undefined;\n }\n \n}", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "b73eecfd72959925f0a59f38756e7a01", "score": "0.4663869", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "3f09e089d3f14dc70c53f86bf6ce7f08", "score": "0.46541065", "text": "get_segment_intersection(chart, x, y) {\n\t\tvar e1 = 1 // slack for x\n\t\tvar e2 = 300 // slack for collineariy measure\n\t\tfor (var i = 0; i < this.state.datasets.length; i++) {\n\t\t\tvar nodes = chart.getDatasetMeta(i)['data']\n\t\t\tnodes = nodes.filter(x => x['_model']['skip'] == false)\n\t\t\tfor (var j = 0; j < nodes.length - 1; j++) {\n\t\t\t\tvar start_x = nodes[j]['_model']['x']\n\t\t\t\tvar start_y = nodes[j]['_model']['y']\n\t\t\t\tvar end_x = nodes[j + 1]['_model']['x']\n\t\t\t\tvar end_y = nodes[j + 1]['_model']['y']\n\t\t\t\tif (x < (start_x - e1) || x > (end_x + e1)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tvar collinearity = this.collinear(x, y, start_x, start_y, end_x, end_y)\n\t\t\t\tif (collinearity < e2) {\n\t\t\t\t\treturn {'data_idx': nodes[j]['_datasetIndex'], 'i1':nodes[j]['_index'], 'i2':nodes[j+1]['_index']}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}", "title": "" }, { "docid": "61bcb57beb1346a97595bb9d52314538", "score": "0.46505997", "text": "function area(b1, b2, h){\n console.log(.5*(b1 + b2)*h)\n}", "title": "" }, { "docid": "4b609ac7f7d4baf6193da234f67c899a", "score": "0.46480325", "text": "function compareIntersection(a, b) {\n\t return ((a = a.x)[0] < 0 ? a[1] - halfPi$2 - epsilon$3 : halfPi$2 - a[1])\n\t - ((b = b.x)[0] < 0 ? b[1] - halfPi$2 - epsilon$3 : halfPi$2 - b[1]);\n\t}", "title": "" }, { "docid": "61e998cd9542e3fae89f6ab4192b1dd6", "score": "0.46381104", "text": "function isBelowThreshold(currentValue) {\n return currentValue < 40;\n}", "title": "" }, { "docid": "0cbd957bb20316db1c6de3ed004c603b", "score": "0.46331924", "text": "getMiddlePoint(p1, p2) { // two indeces\n // calculate it\n let point1 = this.vertexList[p1];\n let point2 = this.vertexList[p2];\n // console.log(point1);\n let middle = p5.Vector.add(point1, point2).div(2); // FIXME\n\n // add vertex makes sure point is on unit sphere\n let i = this.addVertex(middle);\n return i;\n }", "title": "" }, { "docid": "a8605b169b028be62202f61ed008d3d0", "score": "0.4631741", "text": "function getTileBetween3(x0, y0, x1, y1, x2, y2) {\n var neighbors = getNeighborTiles(x0, y0);\n for(var i = 0; i < neighbors.length; i++) {\n if(hexDist(x1, y1, neighbors[i][0], neighbors[i][1]) == 1 && hexDist(x2, y2, neighbors[i][0], neighbors[i][1]) == 1) {\n return neighbors[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "a48249a973225b48c6fcdcf5a1321069", "score": "0.4624115", "text": "function hit(x1, y1, x2, y2) {\n\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n\n }", "title": "" }, { "docid": "a0de20b01f0813d22b74fc5ecfa919c0", "score": "0.46086872", "text": "function analyzeSensorCoverage2 (part, inputStr, extraParam, DEBUG = false) {\n const inputArr = inputStr.split('\\r\\n');\n\n // UTILITY\n const getManhattanDistance = (x1, y1, x2, y2) => Math.abs(x1 - x2) + Math.abs(y1 - y2);\n const mergeOverlappingRanges = ranges => {\n ranges.sort((a, b) => a[0] - b[0]);\n const mergedRanges = [ ranges[0] ];\n for (const range of ranges) {\n if (range[0] > mergedRanges.at(-1)[1] + 1) mergedRanges.push(range); // no overlap\n else mergedRanges.at(-1)[1] = Math.max(mergedRanges.at(-1)[1], range[1]); // overlap (even if start of interval is 1 more than end of prev)\n }\n return mergedRanges;\n }\n\n // OPTIONAL INIT\n let minSensorX = Infinity;\n let maxSensorX = -Infinity;\n let minSensorY = Infinity;\n let maxSensorY = -Infinity;\n let minBeaconX = Infinity;\n let maxBeaconX = -Infinity;\n let minBeaconY = Infinity;\n let maxBeaconY = -Infinity;\n\n // INIT DATA STRUCTURE\n const SENSOR_DATA = {};\n \n // PARSE DATA\n for (const line of inputArr) {\n\n // ingest from input\n const [LS, RS] = line.split(': closest beacon is at ');\n const [SENSOR_X_DATA, SENSOR_Y_DATA] = LS.split(', ');\n const sensorX = +SENSOR_X_DATA.split('=')[1];\n const sensorY = +SENSOR_Y_DATA.split('=')[1];\n const [BEACON_X_DATA, BEACON_Y_DATA] = RS.split(', ');\n const beaconX = +BEACON_X_DATA.split('=')[1];\n const beaconY = +BEACON_Y_DATA.split('=')[1];\n\n // save critical information to data structure\n const sensor = `${sensorX},${sensorY}`;\n const beacon = [beaconX, beaconY];\n const manhattanDistance = getManhattanDistance(beaconX, beaconY, sensorX, sensorY)\n SENSOR_DATA[sensor] = { beacon, manhattanDistance };\n\n // OPTIONAL\n if (EXPLORE_MIN_MAX) {\n minSensorX = Math.min(minSensorX, sensorX);\n maxSensorX = Math.max(maxSensorX, sensorX);\n minSensorY = Math.min(minSensorY, sensorY);\n maxSensorY = Math.max(maxSensorY, sensorY);\n minBeaconX = Math.min(minBeaconX, beaconX);\n maxBeaconX = Math.max(maxBeaconX, beaconX);\n minBeaconY = Math.min(minBeaconY, beaconY);\n maxBeaconY = Math.max(maxBeaconY, beaconY);\n }\n }\n\n if (EXPLORE_MIN_MAX) {\n console.log(`(sensorX: from ${minSensorX} to ${maxSensorX})`);\n console.log(`(sensorY: from ${minSensorY} to ${maxSensorY})`);\n console.log(`(beaconX: from ${minBeaconX} to ${maxBeaconX})`);\n console.log(`(beaconY: from ${minBeaconY} to ${maxBeaconY})`);\n }\n\n // HELPER FUNCTION\n function getRangesOfEliminatedXValues(row) {\n\n // init\n const ranges = [];\n\n // iterate through sensor data\n for (const sensor in SENSOR_DATA) { // check every sensor to see if you can make eliminations in row\n const [sensorX, sensorY] = sensor.split(',').map(n => +n);\n const vertDistanceToRow = Math.abs(row - sensorY);\n if (vertDistanceToRow > SENSOR_DATA[sensor].manhattanDistance) continue; // this sensor's eliminated area does not reach row; skip it\n const horizDistance = SENSOR_DATA[sensor].manhattanDistance - vertDistanceToRow;\n ranges.push([sensorX - horizDistance, sensorX + horizDistance]);\n }\n\n // merge overlapping intervals to get true range of eliminated x values\n return mergeOverlappingRanges(ranges);\n }\n\n // ANALYZE\n const TIME_AT_START = Date.now();\n if (part === 1) { // PART 1: FIND # OF ELIMINATED x VALUES IN GIVEN ROW y\n\n // find intervals of eliminated x values in given row y\n const ROW_TO_CHECK = extraParam;\n const ranges = getRangesOfEliminatedXValues(ROW_TO_CHECK);\n\n // NOTE: it turns out that ranges above will only have 1 range with our data. in other words, our data would have it such that all ranges of\n // eliminated x values for given row y from the various sensors will overlap. however, going forward, i will NOT make that assumption, and for\n // purposes of part 1 i will account for the possibility of gaps in between the ranges of eliminated x values for given row y.\n\n // find intervals of gaps\n const gaps = [];\n for (let i = 0; i < ranges.length - 1; ++i) {\n gaps.push([ ranges[i][1] + 1, ranges[i + 1][0] - 1 ]);\n }\n \n // look for beacons in given row y and include them in gaps\n const beaconsInRow = new Set();\n for (const sensor in SENSOR_DATA) {\n const [x, y] = SENSOR_DATA[sensor].beacon;\n if (y === ROW_TO_CHECK) beaconsInRow.add(x);\n }\n for (const beacon of beaconsInRow) gaps.push([beacon, beacon]);\n const gapsWithBeacons = mergeOverlappingRanges(gaps);\n\n // calculate number of eliminated x values\n const spreadOfEliminatedXValues = ranges.at(-1)[1] - ranges[0][0] + 1;\n const gapCount = gapsWithBeacons.reduce((count, [s, e]) => count += e - s + 1, 0);\n return spreadOfEliminatedXValues - gapCount;\n\n } else { // PART 2: FIND COORDS OF UNKNOWN DISTRESS BEACON\n\n // HELPER FUNCTION: CHECK IF GIVEN x IS INVALID (ELIMINATED) FOR BEING WITHIN RANGE OF A SENSOR\n function checkIfInSensor(x, y) {\n for (const sensor in SENSOR_DATA) {\n const [sensorX, sensorY] = sensor.split(',').map(n => +n);\n const { manhattanDistance } = SENSOR_DATA[sensor];\n const offsetY = Math.abs(sensorY - y);\n if (offsetY > manhattanDistance) continue;\n const offsetX = manhattanDistance - offsetY;\n if (Math.abs(sensorX - x) <= offsetX) {\n return { inSensor: true, rightmostX: sensorX + offsetX };\n }\n }\n return { inSensor: false, rightmostX: null };\n }\n\n const LIMIT_OF_SEARCH_AREA = extraParam;\n const TUNING_FREQUENCY_X_MULTIPLER = 4000000;\n \n if (!DEBUG) console.log('RUNNING PART 2 ANALYSIS (PLEASE WAIT)...');\n\n for (let y = 0; y <= LIMIT_OF_SEARCH_AREA; ++y) {\n // for (let y = DEBUG ? 0 : 1000000; y <= LIMIT_OF_SEARCH_AREA; ++y) { // speeds up test 4 by starting at 1000000\n // for (let y = DEBUG ? 0 : 2000000; y <= LIMIT_OF_SEARCH_AREA; ++y) { // speeds up test 4 by starting at 2000000\n // for (let y = DEBUG ? 0 : 3000000; y <= LIMIT_OF_SEARCH_AREA; ++y) { // speeds up test 4 by starting at 3000000\n // for (let y = DEBUG ? 0 : 3017867; y <= LIMIT_OF_SEARCH_AREA; ++y) { // speeds up test 4 by starting at correct answer\n \n for (let x = 0; x <= LIMIT_OF_SEARCH_AREA; ++x) {\n const { inSensor, rightmostX } = checkIfInSensor(x, y);\n if (inSensor) {\n if (SEE_AREA_BEING_SKIPPED) {\n console.log(`(y: ${y} | SKIPPING RANGE OF LENGTH: ${rightmostX - x})`);\n }\n x = rightmostX;\n } else {\n if (!DEBUG) console.log(`(RUN TOOK ${(Date.now() - TIME_AT_START)/1000} SECS)`);\n return x * TUNING_FREQUENCY_X_MULTIPLER + y;\n }\n }\n\n }\n\n throw 'ERROR: DID NOT FIND LOCATION OF UNKNOWN DISTRESS BEACON';\n\n }\n}", "title": "" }, { "docid": "4b32cc896052581f9d8899b09267cf18", "score": "0.46041062", "text": "isValidHbond(atom, atomHbond, threshold) {\n let ic = this.icn3d,\n me = ic.icn3dui\n // return: 'donor', 'acceptor', 'both', 'ring', 'none'\n let atomType = this.isHbondDonorAcceptor(atom)\n let atomHbondType = this.isHbondDonorAcceptor(atomHbond)\n\n let maxHbondDist = threshold //3.5;\n let maxHbondSulfurDist = threshold //4.1;\n let maxDist = threshold\n let maxHbondDistSq = maxHbondDist * maxHbondDist\n\n let tolerance = 5\n let maxHbondAccAngle = ((45 + tolerance) * Math.PI) / 180\n let maxHbondDonAngle = ((45 + tolerance) * Math.PI) / 180\n let maxHbondAccPlaneAngle = (90 * Math.PI) / 180\n let maxHbondDonPlaneAngle = (30 * Math.PI) / 180\n\n let donorAtom, acceptorAtom\n\n if (\n (atomType == 'donor' &&\n (atomHbondType == 'acceptor' || atomHbondType == 'both' || atomHbondType == 'ring')) ||\n (atomHbondType == 'acceptor' && (atomType == 'donor' || atomType == 'both' || atomType == 'ring'))\n ) {\n donorAtom = atom\n acceptorAtom = atomHbond\n } else if (\n (atomType == 'acceptor' &&\n (atomHbondType == 'donor' || atomHbondType == 'both' || atomHbondType == 'ring')) ||\n (atomHbondType == 'donor' && (atomType == 'acceptor' || atomType == 'both' || atomType == 'ring'))\n ) {\n acceptorAtom = atom\n donorAtom = atomHbond\n } else if ((atomType == 'both' || atomType == 'ring') && (atomHbondType == 'both' || atomHbondType == 'ring')) {\n donorAtom = atom\n acceptorAtom = atomHbond\n // or\n //donorAtom = atomHbond;\n //acceptorAtom = atom;\n\n if (\n (ic.nucleotides.hasOwnProperty(atom.serial) &&\n ic.nucleotides.hasOwnProperty(atomHbond.serial) &&\n (atomType == 'ring' || atomHbondType == 'ring')) || // 1TUP\n ((atom.het || atomHbond.het) && atomType == 'ring' && atomHbondType == 'ring') // 3GVU\n ) {\n } else {\n maxHbondDonPlaneAngle = (90 * Math.PI) / 180\n }\n } else if (atomType == 'none' || atomHbondType == 'none') {\n return false\n } else {\n return false\n }\n\n let donorAngles = this.calcAngles(donorAtom, acceptorAtom)\n let idealDonorAngle = (90 * Math.PI) / 180 // 90 for sp2, 60 for sp3\n for (let i = 0, il = donorAngles.length; i < il; ++i) {\n if (Math.abs(idealDonorAngle - donorAngles[i]) > maxHbondDonAngle) {\n return false\n }\n }\n\n //if (idealGeometry[donor.index] === AtomGeometry.Trigonal){ // 120\n let outOfPlane1 = this.calcPlaneAngle(donorAtom, acceptorAtom)\n\n if (outOfPlane1 !== undefined && outOfPlane1 > maxHbondDonPlaneAngle) {\n return false\n }\n //}\n\n let acceptorAngles = this.calcAngles(acceptorAtom, donorAtom)\n let idealAcceptorAngle = (90 * Math.PI) / 180\n for (let i = 0, il = acceptorAngles.length; i < il; ++i) {\n if (Math.abs(idealAcceptorAngle - acceptorAngles[i]) > maxHbondAccAngle) {\n return false\n }\n }\n\n //if (idealGeometry[acceptor.index] === AtomGeometry.Trigonal){ // 120\n let outOfPlane2 = this.calcPlaneAngle(acceptorAtom, donorAtom)\n if (outOfPlane2 !== undefined && outOfPlane2 > maxHbondAccPlaneAngle) return false\n //}\n\n return true\n }", "title": "" }, { "docid": "25cf16feda4cd30be8dbbb3105eba5ec", "score": "0.46039966", "text": "function compareIntersection(a, b) {\n\t return ((a = a.x)[0] < 0 ? a[1] - halfPi$3 - epsilon$4 : halfPi$3 - a[1])\n\t - ((b = b.x)[0] < 0 ? b[1] - halfPi$3 - epsilon$4 : halfPi$3 - b[1]);\n\t}", "title": "" }, { "docid": "6e78d859ccb2b69ca86f080c7c8c7778", "score": "0.4603832", "text": "function rcrop(x, y, image, cb) {\n image.crop(x, y, 41, 41, function(err, image) {r\n var img2= image;\n var distance = Jimp.distance(img, img2);\n var diff = Jimp.diff(img, img2); // threshold ranges 0-1 (default: 0.1)\n var retbool= false;\n\n //134, 2\n console.log(\"diff percent: \"+ diff.percent);\n console.log(diff);\n console.log(\"distance: \"+ distance);\n //(distance < 0.15 || diff.percent < 0.2) ? console.log(\"in if match\") : console.log(\"in else no match\");\n //(diff.percent < 0.15) ? console.log(\"in if match\") : console.log(\"in else no match\");\n if(distance < 0.15 || diff.percent < 0.2)\n retbool= true;\n else\n retbool= false;\n cb(x, y, retbool);\n });\n }", "title": "" }, { "docid": "8d5d467ddb1beb1d2003790f7930382d", "score": "0.45868206", "text": "findContourRange() {\n return {\n max: 0,\n min: -15\n }\n }", "title": "" }, { "docid": "189f9800cc31a0409384de55808721dc", "score": "0.45789558", "text": "function lengthOfSection(firstX, firstY, secondX, secondY){\n return Math.sqrt(Math.pow(secondX - firstX, 2) + Math.pow(secondY - firstY, 2));\n}", "title": "" }, { "docid": "a8f18f5e308c5ce921f874b896fc795c", "score": "0.45758027", "text": "function calcMaxAndMinCord(c){\n if(latStart > limiteMax[0])\n limiteMax[0] = c[\"Lat\"];\n if(logStart > limiteMax[1])\n limiteMax[1] = c[\"Log\"];\n if(latStart < limiteMin[0])\n limiteMin[0] = c[\"Lat\"];\n if(logStart < limiteMin[1])\n limiteMin[1] = c[\"Log\"];\n\n}", "title": "" }, { "docid": "c44c46b579206de4ead6d6856b6be084", "score": "0.45625964", "text": "function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }", "title": "" }, { "docid": "d18a4008268ec2778e43d17c1b823b3b", "score": "0.4559012", "text": "function getMarchingIndex(val, corners) {\n var mi = (corners[0][0] > val ? 0 : 1) +\n (corners[0][1] > val ? 0 : 2) +\n (corners[1][1] > val ? 0 : 4) +\n (corners[1][0] > val ? 0 : 8);\n if(mi === 5 || mi === 10) {\n var avg = (corners[0][0] + corners[0][1] +\n corners[1][0] + corners[1][1]) / 4;\n // two peaks with a big valley\n if(val > avg) return (mi === 5) ? 713 : 1114;\n // two valleys with a big ridge\n return (mi === 5) ? 104 : 208;\n }\n return (mi === 15) ? 0 : mi;\n}", "title": "" }, { "docid": "4825beed10ce8067226c55663b38b2f2", "score": "0.4553122", "text": "function heuristic(a, b) {\n // var e = Math.pow((abs(a.i - b.i) + abs(a.j - b.j)), 4)\n var e = dist(a.i, a.j, b.i, b.j);\n if (e != 0) {\n var d = 1 / e;\n } else {\n var d = 0\n }\n return d\n}", "title": "" }, { "docid": "653f89cd0df8b94e4c9a9fe280dabc59", "score": "0.45519087", "text": "function calcCrow(lat1, lon1, lat2, lon2)\r\n{\r\n var R = 6371; // km\r\n var dLat = toRad(lat2-lat1);\r\n var dLon = toRad(lon2-lon1);\r\n var lat1 = toRad(lat1);\r\n var lat2 = toRad(lat2);\r\n\r\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\r\n Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2);\r\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\r\n var d = R * c;\r\n return d;\r\n}", "title": "" }, { "docid": "d35531899b2ff9bbefb67725fcf41b1a", "score": "0.45518774", "text": "function slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n }", "title": "" }, { "docid": "a9d36058bd1e2ba7516d29ac1fc91924", "score": "0.4550524", "text": "function area(a, b, c) { return Math.abs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) / 2;\n}", "title": "" }, { "docid": "56fd17415abd41e1a91e869689f145d3", "score": "0.45477027", "text": "function midPoint(a, b){\n return mix(a, b, 0.5);\n}", "title": "" }, { "docid": "72c5fb77afcfb6357b8a4f87833a0fb0", "score": "0.454067", "text": "function middleToCenter(pA, pB)\r\n{\r\n\treturn Math.pow(Math.pow((pA[0] + pB[0])/2 - scrn.centerX, 2) + Math.pow((pA[1] + pB[1])/2 - scrn.centerY, 2), .5);\r\n}", "title": "" }, { "docid": "63cdbd1ddf3217e574d72d8944dfb61a", "score": "0.45378622", "text": "function slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n }", "title": "" }, { "docid": "63cdbd1ddf3217e574d72d8944dfb61a", "score": "0.45378622", "text": "function slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n }", "title": "" }, { "docid": "6ead8ad9b8a597442af97e2b2493b69c", "score": "0.45318788", "text": "function calcCrow(lat1, lon1, lat2, lon2) \n {\n var R = 6371; // km\n var dLat = toRad(lat2-lat1);\n var dLon = toRad(lon2-lon1);\n var lat1 = toRad(lat1);\n var lat2 = toRad(lat2);\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); \n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n var d = R * c;\n return d;\n }", "title": "" }, { "docid": "33bb17f93788e61ca42e84c244d87f3f", "score": "0.4524382", "text": "function renderThreshold(state) {\n var minThreshold = Number.MAX_VALUE;\n state.metrics.forEach(function(metric) {\n minThreshold = Math.min(minThreshold, metric.threshold);\n });\n var thresholdOffset = Util.getOffsetForValue(\n minThreshold, state.minValue, state.maxValue);\n return svg('svg', {\n 'class': 'threshold-line',\n 'viewBox': '0 0 100 100',\n 'preserveAspectRatio': 'none',\n }, [\n svg('path', {\n 'd': 'M0 ' + thresholdOffset + ' L 100 ' + thresholdOffset,\n 'stroke-dasharray': '2,2'\n })\n ]);\n}", "title": "" }, { "docid": "3360cf2e026627737b76ff073f06c607", "score": "0.45207602", "text": "function compareIntersection(a, b) {\n\t return ((a = a.x)[0] < 0 ? a[1] - halfPi$2 - epsilon$2 : halfPi$2 - a[1])\n\t - ((b = b.x)[0] < 0 ? b[1] - halfPi$2 - epsilon$2 : halfPi$2 - b[1]);\n\t}", "title": "" }, { "docid": "3360cf2e026627737b76ff073f06c607", "score": "0.45207602", "text": "function compareIntersection(a, b) {\n\t return ((a = a.x)[0] < 0 ? a[1] - halfPi$2 - epsilon$2 : halfPi$2 - a[1])\n\t - ((b = b.x)[0] < 0 ? b[1] - halfPi$2 - epsilon$2 : halfPi$2 - b[1]);\n\t}", "title": "" }, { "docid": "3514aaaca77a3b9d2a9bdc7020b48991", "score": "0.4519788", "text": "function getDistanceWeight(target, source, point) {\n // Esprimiamo le coordinate di point traslando l'origine sul source:\n // point['0'] corrisponde alla coordinata x del punto, point['1'] è l'ordinata\n var breakpoint = []\n breakpoint['x'] = point['0'] - source['x'];\n breakpoint['y'] = point['1'] - source['y'];\n\n var delta = []\n delta['x'] = target['x'] - source['x'];\n delta['y'] = target['y'] - source['y'];\n\n\n var intersectpoint = [];\n var angolar_coeff;\n\n // Se delta['x'] è nullo : source e target sono sulla stessa ascissa\n // la retta che li congiunge è verticale e pertanto non esprimibile come y = mx + q\n // Sappiamo però automaticamente che la retta perpendicolare è del tipo y = c\n // quindi l'intersect point avrà X = 0 e Y = breakpoint['y']\n if (delta['x'] == 0) {\n intersectpoint['x'] = 0;\n intersectpoint['y'] = breakpoint['y'];\n }\n else if ( delta['y'] == 0) {\n intersectpoint['x'] = breakpoint['x'];\n intersectpoint['y'] = 0;\n angolar_coeff = 0;\n }\n else {\n angolar_coeff = delta['y'] / delta['x'];\n\n // quindi prendendo il source come origine, la retta che unisce source e target è data da:\n // R: y = angolar_coeff * x\n\n // La retta che interseca perpendicolarmente R e che passa per point è data da :\n // T: y = - x / angolar_coeff + quote\n\n // dobbiamo calcolare quote imponendo che point faccia parte della retta T, quindi calcoliamo:\n // quote = breakpoint_y + (breakpoint_x/angolar_coeff)\n\n var quote = breakpoint['y'] + (breakpoint['x'] / angolar_coeff);\n\n // Adesso mettiamo a sistema le due rette T ed R (che sono perpendicolari) e risolvendo il sistema\n // otteniamo che il punto di intersezione tra le due ha le coordinate:\n // intersectpoint_x = (quote * angolar_coeff) / ((angolar_coeff ^ 2) + 1)\n // intersectpoint_y = intersectpoint_x * angolar_coeff\n\n intersectpoint['x'] = (quote * angolar_coeff) / (Math.pow(angolar_coeff, 2) + 1);\n intersectpoint['y'] = intersectpoint['x'] * angolar_coeff;\n }\n\n\n // Adesso calcoliamo la distanza tra source e target\n var dist_source_target = Math.sqrt(Math.pow(delta['x'], 2) + Math.pow(delta['y'], 2));\n\n // Adesso calcoliamo la distanza tra interscetpoint e source\n // NOTA: le coordinate di intersectpoint sono calcolate traslando l'origine sul source, quindi usando il teorema di pitagora non sottraiamo le coordinate di source perchè sono nulle in questo sistema di riferimento\n // NOTA 2: la distanza che otteniamo è un valore assoluto, è quindi indipendente dal sistema di riferimento e possiamo usarla direttamente per calcolare il peso\n var dist_inter_source = Math.sqrt(Math.pow(intersectpoint['x'], 2) + Math.pow(intersectpoint['y'], 2));\n\n\n // Il peso lo calcolo come percentuale dividendo la distanza dell'intersectpoint dal source per la distanza tra source e target\n var point_weight = dist_inter_source / dist_source_target;\n\n // Dobbiamo stabilire se il peso è positivo o negativo\n // Se la X dell' intersectpoint è compresta tra quella del source e quella del target, allora il peso è positivo\n\n // se la X del target è maggiore della X del source e la X dell'intersectpoint è minore di quella del source, allora il peso è negativo\n if (delta['x'] > 0 && intersectpoint['x'] < 0)\n point_weight = - point_weight;\n\n if (delta['x'] < 0 && intersectpoint['x'] > 0)\n point_weight = - point_weight;\n\n\n\n // Calcolo la distanza tra point e intersectpoint (sono entrambi espressi rispetto a source, ma per la distanza non ci interessa)\n var point_distance = Math.sqrt(Math.pow(intersectpoint['x'] - breakpoint['x'], 2) + Math.pow(intersectpoint['y'] - breakpoint['y'], 2));\n\n\n // Dobbiamo stabilire se prendere la point_distance positiva o negativa\n // La regola è che, andando dal source al target sulla retta che li\n // congiunge, se il breakpoint si trova alla mia sinistra, la distanza\n // è negativa, se invece è alla mia destra è positiva\n\n // questo si traduce nel valutare una diseguaglianza (Y ><= M*X ? dove Y e X sono le coordinate del breakpoint) e la scelta dipende dal quadrante in cui si trova il target.\n\n // [Stiamo considerando le coordinate relative al source]\n // [Quindi delta['x'] e delta['y'] sono proprio le coordinate del target]\n\n // RICORDA: in cytoscape il verso crescente dell'asse Y è verso il\n // basso, quindi occorre fare attenzione al verso delle diseguaglianze\n\n // Target con X negativa => il breakpoint si trova a sinitra della\n // retta quando si trova al di sotto della retta\n if (delta['x'] < 0 && breakpoint['y'] > angolar_coeff * breakpoint['x'])\n point_distance = - point_distance;\n\n // Target con X positiva => il breakpoint si trova a sinistra dela\n // retta quando si trova al di sopra della retta\n if (delta['x'] > 0 && breakpoint['y'] < angolar_coeff * breakpoint['x'])\n point_distance = - point_distance;\n\n // SOURCE CON STESSA X DEL TARGET\n // se il target ha una Y maggiore del source (deltaY>0),\n // allora sto guardando verso il basso, quindi il punto sarà a\n // sinistra quando la sua X sarà positiva\n if (delta['x'] == 0 && delta['y'] > 0 && breakpoint['x'] > 0)\n point_distance = - point_distance;\n // Se invece guardo verso l'alto (target con Y<0), allora il nodo è a\n // sinistra della retta quando ha la X negativa\n if (delta['x'] == 0 && delta['y'] < 0 && breakpoint['x'] < 0)\n point_distance = - point_distance;\n\n\n\n return [point_distance, point_weight];\n}", "title": "" }, { "docid": "ca82041061496411e8e09415f64d64a5", "score": "0.4515972", "text": "LineIntersection2D_5P( A,\n B,\n C,\n D,\n dist ) // double &dist\n {\n\n let rTop = ( A.y - C.y) * ( D.x - C.x ) - ( A.x - C.x ) * ( D.y - C.y );\n let sTop = ( A.y - C.y) * ( B.x - A.x ) - ( A.x - C.x ) * ( B.y - A.y );\n\n let Bot = ( B.x - A.x ) * ( D.y - C.y ) - ( B.y - A.y ) * ( D.x - C.x );\n\n\n if ( Bot == 0 )//parallel\n {\n if ( utils.isEqual( rTop, 0 ) && utils.isEqual( sTop, 0 ) ) {\n return true;\n }\n return false;\n }\n\n let r = rTop / Bot;\n let s = sTop / Bot;\n\n if ( ( r > 0 ) && ( r < 1 ) && ( s > 0 ) && ( s < 1 ) ) {\n //dist.set( Vec2DDistance( A, B ) * r );\n dist = ( Vector2D.Vec2DDistance( A, B ) * r );\n\n return true;\n } else {\n //dist.set(0.0);\n dist = 0.0;\n\n return false;\n };\n }", "title": "" }, { "docid": "9a3ef5872610f6ea083c26cf3cfcb66f", "score": "0.4514111", "text": "function compareIntersection(a,b){return((a=a.x)[0]<0?a[1]-_math__WEBPACK_IMPORTED_MODULE_2__[\"halfPi\"]-_math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"]:_math__WEBPACK_IMPORTED_MODULE_2__[\"halfPi\"]-a[1])-((b=b.x)[0]<0?b[1]-_math__WEBPACK_IMPORTED_MODULE_2__[\"halfPi\"]-_math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"]:_math__WEBPACK_IMPORTED_MODULE_2__[\"halfPi\"]-b[1]);}", "title": "" }, { "docid": "ddadaa7d3b8fbb0d64de4fe6868a003b", "score": "0.4513328", "text": "hits(carX, carY) {\n let x = cos(this.angle) * (carX - this.p1.x) - sin(this.angle) * (carY - this.p1.y) + this.p1.x;\n let y = sin(this.angle) * (carX - this.p1.x) + cos(this.angle) * (carY - this.p1.y) + this.p1.y;\n if (x < this.p1.x + this.w && x > this.p1.x && y < this.p1.y + this.h && y > this.p1.y) {\n fill(255, 0, 0);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "f7c9fffb0b19948e27255d522d05ef80", "score": "0.45123523", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t }", "title": "" }, { "docid": "f7c9fffb0b19948e27255d522d05ef80", "score": "0.45123523", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t }", "title": "" }, { "docid": "f7c9fffb0b19948e27255d522d05ef80", "score": "0.45123523", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t }", "title": "" }, { "docid": "f7c9fffb0b19948e27255d522d05ef80", "score": "0.45123523", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t }", "title": "" }, { "docid": "f7c9fffb0b19948e27255d522d05ef80", "score": "0.45123523", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t }", "title": "" }, { "docid": "96633fa644ba78e270618dff874fdf55", "score": "0.45122865", "text": "static TwoCirclesIntersectionArea( x1, y1, r1,\n x2, y2, r2 ) {\n //first calculate the intersection points\n let iX1 = 0.0, iY1 = 0.0, iX2 = 0.0, iY2 = 0.0;\n\n if ( !TwoCirclesIntersectionPoints (x1, y1, r1, x2, y2, r2,\n iX1, iY1, iX2, iY2 ) ) {\n return 0.0; //no overlap\n };\n\n //calculate the distance between the circle centers\n let d = Math.sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );\n\n //find the angles given that A and B are the two circle centers\n //and C and D are the intersection points\n let CBD = 2 * Math.acos( ( r2 * r2 + d * d - r1 * r1 ) / ( r2 * d * 2 ) );\n\n let CAD = 2 * Math.acos( ( r1 * r1 + d * d - r2 * r2 ) / ( r1 * d * 2 ) );\n\n\n //Then we find the segment of each of the circles cut off by the \n //chord CD, by taking the area of the sector of the circle BCD and\n //subtracting the area of triangle BCD. Similarly we find the area\n //of the sector ACD and subtract the area of triangle ACD.\n\n let area = 0.5 * CBD * r2 * r2 - 0.5 * r2 * r2 * Math.sin( CBD )\n + 0.5 * CAD * r1 * r1 - 0.5 * r1 * r1 * Math.sin( CAD );\n\n return area;\n }", "title": "" }, { "docid": "fab4424c7abeda214d52d648367fe79f", "score": "0.44885424", "text": "function heuristicChebyshev(node1, node2) {\r\n return (\r\n Math.abs(node1.row - node2.row) +\r\n Math.abs(node1.col - node2.col) -\r\n Math.min(Math.abs(node1.row - node2.row), Math.abs(node1.col - node2.col))\r\n );\r\n}", "title": "" }, { "docid": "724c2d00a131a1c23b8683cfd7320cac", "score": "0.4488502", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t}", "title": "" }, { "docid": "724c2d00a131a1c23b8683cfd7320cac", "score": "0.4488502", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t}", "title": "" }, { "docid": "724c2d00a131a1c23b8683cfd7320cac", "score": "0.4488502", "text": "function slope3(that, x2, y2) {\n\t var h0 = that._x1 - that._x0,\n\t h1 = x2 - that._x1,\n\t s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n\t s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n\t p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\t return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n\t}", "title": "" } ]
4b738b70d5472c15eb334600b656e5f8
Tokenizer object Tokenizes a formula into a stream of token strings.
[ { "docid": "456bfb6bc956f6d50d7ce1e208b2a0a2", "score": "0.53852415", "text": "function Tokenizer(str) {\n\tvar i = 0;\n\t\n\t// Returns the index of the next character to tokenize.\n\tthis.position = function() {\n\t\treturn i;\n\t};\n\t\n\t// Returns the next token as a string, or null if the end of the token stream is reached.\n\tthis.peek = function() {\n\t\tif (i == str.length) // End of stream\n\t\t\treturn null;\n\t\t\n\t\tvar match = /^([A-Za-z][a-z]*|[0-9]+|[+\\-^=()])/.exec(str.substring(i));\n\t\tif (match == null)\n\t\t\tthrow {message: \"Invalid symbol\", start: i};\n\t\treturn match[0];\n\t};\n\t\n\t// Returns the next token as a string and advances this tokenizer past the token.\n\tthis.take = function() {\n\t\tvar result = this.peek();\n\t\tif (result == null)\n\t\t\tthrow \"Advancing beyond last token\";\n\t\ti += result.length;\n\t\tskipSpaces();\n\t\treturn result;\n\t};\n\t\n\t// Takes the next token and checks that it matches the given string, or throws an exception.\n\tthis.consume = function(s) {\n\t\tif (this.take() != s)\n\t\t\tthrow \"Token mismatch\";\n\t};\n\t\n\tfunction skipSpaces() {\n\t\tvar match = /^[ \\t]*/.exec(str.substring(i));\n\t\ti += match[0].length;\n\t}\n\t\n\tstr = str.replace(/\\u2212/g, \"-\");\n\tskipSpaces();\n}", "title": "" } ]
[ { "docid": "61e158f26b3075c8886e8205142b87d1", "score": "0.6529383", "text": "function makeTokenizer(rules) {\n function compileRE(re) {\n return new RegExp('^'+re);\n }\n return function (input) {\n var trules = rules.tokens.map(rule => [compileRE(rule[0]), rule[0], rule[1]]);\n var delim = compileRE(rules.delim);\n var matching = true;\n var tokens = [];\n var i = 0;\n while(matching && i < input.length) {\n var inp = input.substr(i);\n var m;\n if (m = inp.match(delim)) {\n i += m[0].length;\n } else {\n matching = false;\n for (var j=0; j<trules.length; j++) {\n var tre = trules[j][0];\n var tfn = trules[j][2];\n if (m = inp.match(tre)) {\n tokens.push(tfn(m[0]));\n i += m[0].length;\n matching = true;\n break;\n }\n }\n }\n }\n if (!matching) return false;\n //pr('TOKENS:',tokens);\n return tokens;\n }\n}", "title": "" }, { "docid": "69a4434a614f7a0bb7760bd5d6fab55d", "score": "0.62740344", "text": "function Tokenizer() {\r\n\tvar self = this;\r\n\r\n\tconstruct.apply(this, arguments);\r\n\r\n\tvar mSource;\r\n\r\n\tvar mLine = 1;\r\n\tvar mColumn = 0;\r\n\tvar mIndex = 0;\r\n\r\n\tvar mTokenLine;\r\n\tvar mTokenColumn;\r\n\tvar mTokenIndex;\r\n\r\n\tfunction construct(aSource) {\r\n\t\tmSource = aSource;\r\n\t}\r\n\r\n\tself.next = function() {\r\n\t\tif (!self.hasNext()) {\r\n\t\t\tthrow error(Diagnostics.tokenenize_eof_reached);\r\n\t\t}\r\n\r\n\t\ttokenStart();\r\n\t\treturn next0();\r\n\t};\r\n\r\n\tself.hasNext = function() {\r\n\t\tskipWhiteSpace();\r\n\r\n\t\treturn !isAtEnd();\r\n\t};\r\n\r\n\t// Grammar Tokenizer\r\n\r\n\tself.hasNext = (function(super_hasNext) {\r\n\t\treturn function() {\r\n\t\t\twhile (super_hasNext()) {\r\n\t\t\t\tif (!(isCharAtOffset(0, '/') && isCharAtOffset(1, '/'))) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\twhile (!isAtEnd() && nextChar() !== '\\n') {\r\n\t\t\t\t\t// skip comments\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t})(self.hasNext);\r\n\r\n\tself.getChar = function() {\r\n\t\tif (isAtEnd()) {\r\n\t\t\tthrow error(Diagnostics.tokenenize_eof_reached);\r\n\t\t}\r\n\r\n\t\treturn nextChar();\r\n\t};\r\n\r\n\tself.ungetChar = function() {\r\n\t\tif (mIndex === 0) {\r\n\t\t\tthrow error(Diagnostics.tokenize_illegal_ungetch);\r\n\t\t}\r\n\r\n\t\t--mIndex;\r\n\t};\r\n\r\n\tfunction next0() {\r\n\t\tvar c = mSource[mIndex];\r\n\r\n\t\tswitch (c) {\r\n\t\t\tcase '[':\r\n\t\t\tcase ']':\r\n\t\t\tcase '(':\r\n\t\t\tcase ')':\r\n\t\t\tcase '{':\r\n\t\t\tcase '}':\r\n\t\t\tcase ';':\r\n\t\t\tcase '|':\r\n\t\t\tcase '?':\r\n\t\t\tcase '+':\r\n\t\t\tcase '*':\r\n\t\t\tcase ':':\r\n\t\t\tcase '@':\r\n\t\t\tcase '.':\r\n\t\t\tcase '#':\r\n\t\t\tcase '%':\r\n\t\t\t\tnextChar();\r\n\t\t\t\treturn new Token(TokenType.SYMBOL, tokenString(), tokenPosition());\r\n\t\t\tcase '\\'':\r\n\t\t\t\treturn parseLiteral();\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif (Tokenizer.isDigit(c)) {\r\n\t\t\treturn parseNumber();\r\n\t\t}\r\n\r\n\t\treturn parseIdentifier();\r\n\t}\r\n\r\n\tfunction parseIdentifier() {\r\n\t\tvar firstChar = nextChar();\r\n\r\n\t\tif (!(Tokenizer.isLetter(firstChar) || (firstChar === '_'))) {\r\n\t\t\tthrow error(Diagnostics.tokenize_invalid_identifier_char);\r\n\t\t}\r\n\r\n\t\twhile (!isAtEnd() && Tokenizer.isIdentifierChar(mSource[mIndex])) {\r\n\t\t\tnextChar();\r\n\t\t}\r\n\r\n\t\treturn new Token(TokenType.IDENTIFIER, tokenString(), tokenPosition());\r\n\t}\r\n\r\n\tfunction parseNumber() {\r\n\t\tdo {\r\n\t\t\tnextChar();\r\n\t\t} while (!isAtEnd() && Tokenizer.isDigit(mSource[mIndex]));\r\n\r\n\t\treturn new Token(TokenType.INT, tokenString(), tokenPosition());\r\n\t}\r\n\r\n\tfunction parseLiteral() {\r\n\t\tvar stopChar = nextChar();\r\n\r\n\t\tvar retval = '';\r\n\t\tvar lastIndex = mIndex;\r\n\t\tdo {\r\n\t\t\tif (isAtEnd()) {\r\n\t\t\t\tthrow error('Unexpected EOF');\r\n\t\t\t}\r\n\r\n\t\t\tvar c = nextChar();\r\n\t\t\tif (c === stopChar) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (c === '\\\\') {\r\n\t\t\t\tretval += mSource.substring(lastIndex, mIndex - 1);\r\n\r\n\t\t\t\t// if at end will fail on the next iteration\r\n\t\t\t\tif (!isAtEnd()) {\r\n\t\t\t\t\tlastIndex = mIndex;\r\n\r\n\t\t\t\t\tvar nc = nextChar();\r\n\t\t\t\t\tif (nc !== '\\\\' && nc !== stopChar) {\r\n\t\t\t\t\t\tthrow error(Diagnostics.tokenize_unexpected_escape);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} while (true);\r\n\r\n\t\tretval += mSource.substring(lastIndex, mIndex - 1);\r\n\t\treturn new Token(TokenType.LITERAL, retval, tokenPosition());\r\n\t}\r\n\r\n\t// Grammar Tokenizer\r\n\r\n\tfunction skipWhiteSpace() {\r\n\t\twhile (!isAtEnd() && Tokenizer.isWhiteSpace(mSource[mIndex])) {\r\n\t\t\tnextChar();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction nextChar() {\r\n\t\tvar retval = mSource[mIndex];\r\n\r\n\t\t++mIndex;\r\n\t\t++mColumn;\r\n\r\n\t\tif (retval === '\\r') {\r\n\t\t\tif (mSource[mIndex] === '\\n') {\r\n\t\t\t\t++mIndex;\r\n\t\t\t}\r\n\r\n\t\t\tretval = '\\n';\r\n\t\t}\r\n\r\n\t\tif (retval === '\\n') {\r\n\t\t\t++mLine;\r\n\t\t\tmColumn = 0;\r\n\t\t}\r\n\r\n\t\treturn retval;\r\n\t}\r\n\r\n\tfunction isCharAtOffset(aOffset, aChar) {\r\n\t\treturn mSource[mIndex + aOffset] === aChar;\r\n\t}\r\n\r\n\tfunction isAtEnd(aOffset) {\r\n\t\treturn (mIndex + (aOffset || 0)) >= mSource.length;\r\n\t}\r\n\r\n\t/*\r\n\tfunction advance(aCount) {\r\n\t\tfor (var i = 0; i < aCount; ++i) {\r\n\t\t\tnextChar();\r\n\t\t}\r\n\t}\r\n\t*/\r\n\r\n\tfunction tokenStart() {\r\n\t\tmTokenLine = mLine;\r\n\t\tmTokenColumn = mColumn;\r\n\t\tmTokenIndex = mIndex;\r\n\t}\r\n\r\n\tfunction tokenPosition() {\r\n\t\treturn new SourcePosition(mTokenIndex, mIndex, mTokenLine, mTokenColumn);\r\n\t}\r\n\r\n\tfunction tokenString() {\r\n\t\treturn mSource.substring(mTokenIndex, mIndex);\r\n\t}\r\n\r\n\tfunction msg(/*aMessage , ..aArgs */) {\r\n\t\tvar message = Util.format.apply(null, arguments);\r\n\r\n\t\treturn Util.format('{}:{} {}', mTokenLine, mTokenColumn, message);\r\n\t}\r\n\r\n\tfunction error(/*aMessage, ..aArgs*/) {\r\n\t\treturn new ParsingException(msg.apply(null, arguments));\r\n\t}\r\n}", "title": "" }, { "docid": "f1caf1ce0032845df7ae9034664c20f0", "score": "0.6178448", "text": "function Tokenizer() {\n\tthis._input = null;\n\t\n\tthis._gStopChars = [\" \", \"{\", \"}\", \"\\n\", \"\\r\", \"\\t\"];\n\t\n\tthis._tokenizeNext = function( pos ){\n\t\tvar stops = [];\n\t\tvar self = this;\n\t\t\n\t\tthis._gStopChars.forEach(function(i) {\n\t\t\tvar foundPos = self._input.indexOf( i, pos );\n\t\t\tif( foundPos !== -1 ){\n\t\t\t\tstops.push( foundPos + 1 )\n\t\t\t}\t\t \n\t\t});\n\t\n if (stops.length === 0) {\n return;\n }\n\n var i = stops.indexOf(Math.min.apply(Math, stops));\n\n\t\tvar stopChar = this._gStopChars[i];\n\t\tvar stopPos = stops[i];\n\t\t\n\t\tvar token = this._input.substr(pos, stopPos-pos);\n // Strip whitespace\n\t\ttoken = token.replace(/[ \\n\\r\\t]/, \"\" );\n\t\t\n\t\treturn { token: token, lastPos: stopPos };\n\t}\n\t\n\tthis._tokenize = function(){\n\t\t// To make it easier to parse, we pad the brackets with spaces.\n\t\tthis._input = this._input.replace( /([{}])/g, \" $1\");\t\n\t\t\n\t\tvar tokens = [];\n\t\t\n\t\tvar head = { lastPos: 0 };\n\n\t\tdo {\n head = this._tokenizeNext( head.lastPos );\n\t\t\tif( head && head.token ) {\n\t\t\t\ttokens.push( head.token );\n\t\t\t}\n\t\t} while (head);\n\t\t\n\t\treturn tokens;\n\t}\n\t\n\tthis.tokenize = function(cfdg) {\n this._input = cfdg;\n\t\treturn this._tokenize();\t\t\n\t}\t\n}", "title": "" }, { "docid": "d77c127244e111e47c498a96be9425b2", "score": "0.6136341", "text": "createTokenizer() {\n this.tokenizer = tokenizer(this.input, {\n ignoreErrors: true,\n });\n }", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.600111", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.600111", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.600111", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "ce07ce04fae8751ecdc515d3cab7598f", "score": "0.5957642", "text": "function getTokens(equation) {\n\n\t//don't want to deal with spaces\n\tequation = equation.split(\" \").join(\"\");\n\n\tvar buffer = '';\n\tvar tokens = new Array();\n\n\tequation.split('').forEach(function(ch) {\n\t\tif(isOperand(ch)) {\n\t\t\tbuffer += ch;\n\t\t} else if(isOperator(ch)) {\n\t\t\ttokens.push(buffer);\n\t\t\ttokens.push(ch);\n\t\t\tbuffer = '';\n\t\t}\n\t});\n\n\tif(buffer != '') tokens.push(buffer);\n\n\treturn tokens;\n}", "title": "" }, { "docid": "2cdc46b31a0325475f2fe43683df016e", "score": "0.5948933", "text": "function tokenizer(input,options){return new _state.Parser(options,input);}", "title": "" }, { "docid": "d2c6a24c3d34e61b3ac86ea17f898411", "score": "0.5932302", "text": "function tokenizer(input) {\n\n // Regex for Validation\n\n let WHITESPACE = /\\s/;\n let NUMBERS = /[0-9]/;\n let LETTERS = /[a-zA-Z]/i;\n\n\n // A current variable used to track the position just like cursor\n let current = 0;\n\n // array for pushing our tokens IN\n let tokens = [];\n\n // our tokens length can be unkown so we have to increment as much as possible\n\n while (current < input.length) {\n\n let char = input[current];\n\n // to check if we have an open parenthises\n\n if (char === '(') {\n\n tokens.push({\n type: 'paren',\n value: '(',\n });\n\n current++;\n\n // continue is for next cycle of loop\n continue;\n }\n\n if (char === ')') {\n tokens.push({\n type: 'paren',\n value: ')',\n });\n current++;\n continue;\n }\n\n // Regex is described above i.e /\\s/ which shows that the whitespace if exist than continue \n\n if (WHITESPACE.test(char)) {\n current++;\n continue;\n }\n\n // Numbers are captured in a sequence as it can be of any number of character\n\n if (NUMBERS.test(char)) {\n\n // value variable (String) so store/push characters into it \n let value = '';\n\n // loop through each number until a character is found i.e not a number\n while (NUMBERS.test(char)) {\n value += char;\n char = input[++current];\n }\n\n // push number token to tokens array\n\n tokens.push({ type: 'number', value });\n\n // And we continue on.\n continue;\n }\n\n // String for double quote\n if (char === '\"') {\n\n let value = '';\n\n\n char = input[++current];\n\n // iterate through character until next double qoute is found\n while (char !== '\"') {\n value += char;\n char = input[++current];\n }\n\n // Skip the closing double quote.\n char = input[++current];\n\n // add our `string` token to the `tokens` array.\n tokens.push({ type: 'string', value });\n\n continue;\n }\n\n if (LETTERS.test(char)) {\n let value = '';\n\n // Again we're just going to loop through all the letters pushing them to\n // a value.\n while (LETTERS.test(char)) {\n value += char;\n char = input[++current];\n }\n\n // And pushing that value as a token with the type `name` and continuing.\n tokens.push({ type: 'name', value });\n\n continue;\n }\n\n // if we have not matched a character by now, we're going to throw\n // an error and completely exit.\n throw new TypeError('I dont know what this character is: ' + char);\n }\n\n // At the end of our `tokenizer` we simply return the tokens array.\n return tokens;\n}", "title": "" }, { "docid": "3cabca89ef09e94aeba8a993b6185a41", "score": "0.58816206", "text": "lex() {\n while (!this.willOverflow()) {\n this.tokens.push(this.tokenize())\n }\n\n return this.tokens\n }", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.5874999", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.5874999", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.5874999", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.5849654", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.5849654", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.5849654", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.5849654", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "4ba2449f3e0cfaeffbcecd6015be49ff", "score": "0.5849654", "text": "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "title": "" }, { "docid": "9e5fd6cfa9dcdfa184b2f7018e389f11", "score": "0.5839102", "text": "function Tokenizer(str) {\n this._str = str;\n this._pos = 0;\n this._queue = new BoundedQueue(3); // Bounded queue of last emitted tokens.\n this._token = undefined; // Current token.\n this._doc = undefined; // Javadoc.\n}", "title": "" }, { "docid": "91556d3ab0245420b63dfeb5342e7331", "score": "0.5833776", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options);\n}", "title": "" }, { "docid": "156226382709916808ed867b24b4920a", "score": "0.57795584", "text": "function TOKENIZER(tokens) {\n\n\tthis.tokenexpr = tokens;\n\tthis.parsedtokens = [];\n\tfor (var i=0;i<tokens.length;i++) {\n\t\tassert(tokens[i].re, \"Invalid token RE specified while parsing\");\n\t\tassert(tokens[i].tag, \"Invalid token tag specified while parsing\");\n\t}\n\n}", "title": "" }, { "docid": "95bd14b67f01b167d7770733514a301c", "score": "0.5774365", "text": "function tokenizer(input, options) {\n\t return new Parser(options, input)\n\t }", "title": "" }, { "docid": "8eac86416bc7794c532884babc8ad2bb", "score": "0.5757682", "text": "function tokenizer(input, options) {\n return parser(options, input);\n}", "title": "" }, { "docid": "064b84e22a7faf46b066887b245b474b", "score": "0.5717647", "text": "_generateTokenizer() {\n let tokenizerCode = fs.readFileSync(\n `${__dirname}/../templates/tokenizer.template`,\n 'utf-8'\n );\n\n this._resultData = this._resultData.replace(\n '<<TOKENIZER>>',\n () => tokenizerCode,\n );\n }", "title": "" }, { "docid": "04ece4a6d721c258550ad00b75411294", "score": "0.5704776", "text": "function tokenizer(input, options) {\n\t return new Parser(options, input)\n\t}", "title": "" }, { "docid": "c3d59a743d7bf76b8b1dbf3a0d476bea", "score": "0.56683177", "text": "function parse(formulaStr) {\n var tokenizer = new Tokenizer(formulaStr);\n return parseEquation(tokenizer);\n}", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.5656521", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.5656521", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "6b05d725b02fb3ffef7248222093e957", "score": "0.5628351", "text": "function TokenStream(input) {\n var current = null;\n // List of all keywords that are available\n var keywords = \" function macro group if elseif else return execute true false var for foreach in \";\n var lastVal = null;\n return {\n next: next,\n peek: peek,\n eof: eof,\n croak: input.croak,\n last: last\n };\n\n function is_keyword(x) {\n return keywords.indexOf(\" \" + x + \" \") >= 0;\n }\n\n function is_digit(ch) {\n return /[0-9]/i.test(ch);\n }\n\n function is_id_start(ch) {\n return /[a-z0-9_\\$]/i.test(ch);\n }\n\n function is_id(ch) {\n return is_id_start(ch);\n }\n\n function is_ivar(ch) {\n return /\\$[a-z0-9-_]/i.test(ch);\n }\n\n function is_op_char(ch) {\n return \"+-*/%^=&|<>!\".indexOf(ch) >= 0;\n }\n\n function is_punc(ch) {\n return \",;(){}[]\".indexOf(ch) >= 0;\n }\n\n function is_whitespace(ch) {\n return \" \\t\\n\\r\".indexOf(ch) >= 0;\n }\n // Read until the given predicate returns false\n function read_while(predicate) {\n var str = \"\";\n while (!input.eof() && predicate(input.peek()))\n str += input.next();\n return str;\n }\n\n function try_number() {\n input.next();\n if (is_digit(input.peek())) {\n var num = read_number();\n num.value *= -1;\n return num;\n }\n input.croak(\"Can't handle character: \" + input.peek());\n }\n\n function read_number() {\n var has_dot = false;\n var number = read_while(function(ch) {\n if (ch == \".\") {\n if (has_dot) return false;\n has_dot = true;\n return true;\n }\n return is_digit(ch);\n });\n return {\n type: \"num\",\n value: parseFloat(number)\n };\n }\n // Read identifiers, can return a keyword, an ivar ($variable), or reg (anything else)\n function read_ident() {\n var id = read_while(is_id);\n var type;\n if (is_keyword(id)) type = \"kw\";\n else if (is_ivar(id)) type = \"ivar\"\n else type = \"reg\";\n\n return {\n type: type,\n value: id\n };\n }\n\n function read_escaped(end) {\n var escaped = false,\n str = \"\";\n input.next();\n while (!input.eof()) {\n var ch = input.next();\n if (escaped) {\n str += ch;\n escaped = false;\n } else if (ch == \"\\\\\") {\n escaped = true;\n } else if (ch == end) {\n break;\n } else {\n str += ch;\n }\n }\n return str;\n }\n /* Evaluation blocks\n Inside a string, content inside `` will be parsed as if it was normal syntax.\n This allows for easier variable/macro integration: \"math result: `math(1,2) + 2`\" rather than \"math result: \" + (math(1,2) + 2)\n (Although the second option is still available if you need it).\n */\n function read_evaled(val) {\n // Don't do it if it doesn't need evaluation\n if (val.indexOf(\"`\") >= 0) {\n\n var evalBlock = false,\n final = [],\n str = \"\";\n var arr = val.split('');\n\n for (var i = 0; i < arr.length; i++) {\n var ch = arr[i];\n\n // Currently in an eval block\n if (evalBlock) {\n if (ch == '`') {\n evalBlock = false;\n // Parse the whole thing as if it was a full code block\n var parsedEval = Parser(TokenStream(InputStream(str)));\n if (parsedEval.prog.length != 0) {\n for (var x = 0; x < parsedEval.prog.length; x++) {\n if (parsedEval.prog[x].type == \"comment\") {\n input.croak(\"Comments are not allowed in evaluation blocks\");\n } else if (parsedEval.prog[x].type == \"function\") {\n input.croak(\"Functions are not allowed in evaluation blocks\");\n } else if (parsedEval.prog[x].type == \"macro\") {\n input.croak(\"Creating macros is not allowed in evaluation blocks\");\n }\n }\n final.push(parsedEval);\n }\n str = \"\";\n } else {\n str += ch;\n\n if (i == arr.length - 1) {\n if (str) final.push({\n type: \"str\",\n value: str\n });\n }\n }\n }\n // Don't evalBlock\n else {\n if (ch == '`') {\n evalBlock = true;\n if (str) final.push({\n type: \"str\",\n value: str\n });\n str = \"\";\n } else {\n str += ch;\n if (i == arr.length - 1) {\n if (str) final.push({\n type: \"str\",\n value: str\n });\n }\n }\n }\n }\n return final;\n } else {\n return val;\n }\n }\n\n function read_string() {\n return {\n type: \"str\",\n value: read_evaled(read_escaped('\"'))\n };\n }\n\n function selector_or_setting() {\n var lastNewLine = input.lastWasNewLine();\n input.next();\n if (input.peek() == '!') {\n if (!lastNewLine) input.croak('Settings with \"@!\" need to start at the begining of a line');\n return read_settings();\n } else {\n return read_selector();\n }\n }\n\n function read_selector() {\n var output = read_while(function(ch) {\n return (!is_whitespace(ch) && ch != ';')\n });\n\n return {\n type: 'selector',\n value: '@' + output\n };\n }\n\n function read_settings() {\n var output = read_while(function(ch) {\n return ch != \"\\n\"\n });\n return {\n type: \"setting\",\n value: output.replace('\\r', '')\n };\n }\n\n function read_relative() {\n var val = read_while(function(ch) {\n return (!is_whitespace(ch) && ch != \";\");\n });\n return {\n type: 'relative',\n value: val\n };\n }\n\n function read_colon() {\n input.next();\n return {\n type: 'colon'\n };\n }\n // Read comments that need to be added (#)\n function read_comment() {\n if (!input.lastWasNewLine()) input.croak('Comments with \"#\" need to start at the begining of a line');\n var output = read_while(function(ch) {\n return ch != \"\\n\"\n });\n return {\n type: \"comment\",\n value: output.replace('\\r', '')\n };\n }\n\n function skip_comment() {\n read_while(function(ch) {\n return ch != \"\\n\"\n });\n input.next();\n }\n // Check whether or not the line is a // comment, skip it if so\n function check_comment() {\n var output = read_while(function(ch) {\n return ch == \"/\"\n });\n if (output == '//') {\n skip_comment();\n } else {\n input.next();\n }\n }\n // Read the next character, assign tokens\n function read_next() {\n read_while(is_whitespace);\n if (input.eof()) return null;\n var ch = input.peek();\n if (ch == \"#\") {\n return read_comment();\n }\n if (ch == \"/\") {\n check_comment();\n return read_next();\n }\n if (ch == \"@\") return selector_or_setting();\n if (ch == '\"') return read_string();\n if (ch == \"~\") return read_relative();\n if (ch == \":\") return read_colon();\n if (is_digit(ch)) return read_number();\n if (is_id_start(ch)) return read_ident();\n if (is_punc(ch)) return {\n type: \"punc\",\n value: input.next()\n };\n if (is_op_char(ch)) return {\n type: \"op\",\n value: read_while(is_op_char)\n };\n\n input.croak(\"Can't handle character: \" + ch);\n }\n\n function peek() {\n return current || (current = read_next());\n }\n\n function last() {\n return lastVal;\n }\n\n function next() {\n lastVal = peek();\n var tok = current;\n current = null;\n return tok || read_next();\n }\n\n function eof() {\n return peek() == null;\n }\n}", "title": "" }, { "docid": "81bc9f2926976a4d45cbbdf5da19d06f", "score": "0.5627085", "text": "function tokenizer(input, options) { return new _state.Parser(options, input); }", "title": "" }, { "docid": "2a39da31692e06597bbf01c980b5d98a", "score": "0.56234956", "text": "generateBuiltInTokenizer() {\n this.writeData('TOKENIZER', JAVA_TOKENIZER_TEMPLATE);\n }", "title": "" }, { "docid": "053895d673858be993057269698bf14e", "score": "0.5602041", "text": "function parse(formulaStr) {\n\tvar tokenizer = new Tokenizer(formulaStr);\n\treturn parseEquation(tokenizer);\n}", "title": "" }, { "docid": "23078c006fbcc6d6f4a8c1e19f12ddef", "score": "0.55614436", "text": "generateBuiltInTokenizer() {\n this.writeData('TOKENIZER', CPP_TOKENIZER_TEMPLATE);\n }", "title": "" }, { "docid": "4e3f1959cf32befc153d75b0969a2606", "score": "0.5538752", "text": "function tokenize(content) {\n\t\n\tif (!content.endsWith('\\n')) {\n\t\tcontent += '\\n';\n\t}\n\t\n\t//Not the full list of tokens; namely, brackets aren't in this list.\n\t//Sorted by longest first, for greediness.\n\tvar tokens = [\n\t\t\"==\",\n\t\t\"!=\",\n\t\t\"<=\",\n\t\t\">=\",\n\t\t\"+=\",\n\t\t\"-=\",\n\t\t\"*=\",\n\t\t\"/=\",\n\t\t\"%=\",\n\t\t\"**=\",\n\t\t\"<\",\n\t\t\">\",\n\t\t\"=\",\n\t\t\"+\",\n\t\t\"-\",\n\t\t\",\",\n\t\t\"/\",\n\t\t\"%\",\n\t\t\"**\",\n\t\t\"*\",\n\t\t\".\",\n\t\t\":\",\n\t\t\";\",\n\t\t\"\\\\\",\n\t];\n\t\n\t\n\tvar result = [];\n\tmacros = [];\n\t\n\t//var isInString = false;\n\tvar bracketsLevel = 0;\n\tvar currentLine = {};\n \n fileStack = [{\n \"name\": \"<main>\",\n \"currentLineNb\": 1,\n \"currentColNb\": 1,\n \"remainingChars\": content.length+1, //does not matter\n\t}];\n\t\n\tvar i = 0;\n\t\n\tfunction addToken(text) {\n\t\t\n\t\tif (text.length === 0) {\n\t\t\terror(\"Token is empty, lexer broke\");\n\t\t}\n\t\t\n\t\t//debug(\"Adding token '\"+text+\"' at \"+currentLineNb+\":\"+currentColNb);\n\t\t\n\t\tcurrentLine.tokens.push(new Token(text, getFileStackCopy()));\n\t\t\n\t\tmoveCursor(text.length-1);\n }\n \n //Length = length of the macro resolution\n //callCols, callLines = how many cols/lines the macro CALL takes\n //callNbChars = how many characters the macro call takes\n //Name: used in stack trace, should be macro name or file name\n //startingCol, startingLine: the col/line of the macro start in the file it is declared\n function addFile(length, callNbChars, callCols, callLines, name, startingCol, startingLine) {\n fileStack.push({\n name,\n remainingChars: length,\n callNbChars,\n callCols,\n callLines,\n currentLineNb: 0+startingLine,\n currentColNb: 0+startingCol,\n });\n //console.log(JSON.stringify(fileStack));\n }\n\t\n\tfunction newLogicalLine() {\n\t\t\n\t\tif (currentLine.tokens !== undefined && currentLine.tokens.length > 0) {\n\t\t\tresult.push(currentLine);\n\t\t}\n\t\t\n\t\tcurrentLine = new LogicalLine();\n\t}\n\t\n\tnewLogicalLine();\n\n\tfunction moveCursor(amount) {\n\t\tfor (var j = 0; j < amount; j++) {\n\n\t\t\tif (fileStack[fileStack.length-1].remainingChars > 0) {\n\t\t\t\tfileStack[fileStack.length-1].remainingChars--;\n\t\t\t\tif (fileStack[fileStack.length-1].remainingChars === 0) {\n\t\t\t\t\t//debug(\"macro lines = \"+macroLines+\", macro cols = \"+macroCols);\n\t\t\t\t\tfileStack[fileStack.length-2].currentLineNb += fileStack[fileStack.length-1].callLines;\n\t\t\t\t\tfileStack[fileStack.length-2].currentColNb += fileStack[fileStack.length-1].callLines-1;\n\t\t\t\t\tfileStack[fileStack.length-2].remainingChars -= fileStack[fileStack.length-1].callNbChars;\n\t\t\t\t\tfileStack.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfileStack[fileStack.length-1].currentColNb++;\n\t\t\tif (content[i+j] === \"\\n\") {\n\t\t\t\t\n\t\t\t\tfileStack[fileStack.length-1].currentLineNb++;\n\t\t\t\tfileStack[fileStack.length-1].currentColNb = 1;\n\t\t\t}\n\t\t}\n\t\ti += amount;\n\t}\n\n\tfunction parsePreprocessingDirective(content) {\n\n\t\tdebug(\"Parsing preprocessing directive '\"+content+\"'\");\n\t\tif (content.startsWith(\"#!define \") || content.startsWith(\"#!defineMember \")) {\n\t\t\tmacros.push(parseMacro({\n\t\t\t\tfileStack: getFileStackCopy(),\n\t\t\t\tcontent: content,\n\t\t\t}));\n\t\t} else if (content.startsWith(\"#!mainFile \")) {\n\t\t\t//we must ignore this preprocessor directive\n\n\t\t} else if (content.startsWith(\"#!obfuscate\")) {\n\t\t\tobfuscationSettings = {\n\t\t\t\tobfuscateNames: true,\n\t\t\t\tobfuscateStrings: true,\n\t\t\t\tobfuscateConstants: true,\n\t\t\t\tobfuscateInspector: true,\n\t\t\t\truleFilling: true,\n\t\t\t\tcopyProtection: true,\n\t\t\t}\n\n\t\t\tvar disabledObfuscationTechniques = content.substring(\"#!obfuscate\".length).trim().split(\" \").map(x => x.trim());\n\t\t\tfor (var tech of disabledObfuscationTechniques) {\n\t\t\t\tif (tech === \"noNameObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateNames = false;\n\t\t\t\t} else if (tech === \"noStringObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateStrings = false;\n\t\t\t\t} else if (tech === \"noConstantObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateConstants = false;\n\t\t\t\t} else if (tech === \"noInspectorObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateInspector = false;\n\t\t\t\t} else if (tech === \"noRuleFilling\") {\n\t\t\t\t\tobfuscationSettings.ruleFilling = false;\n\t\t\t\t} else if (tech === \"noCopyProtection\") {\n\t\t\t\t\tobfuscationSettings.copyProtection = false;\n\t\t\t\t} else if (tech !== \"\") {\n\t\t\t\t\terror(\"Unknown obfuscation setting '\"+tech+\"', valid ones are: \"+Object.keys(obfuscationSettings).map(x => \"no\"+x[0].toUpperCase()+x.slice(1)).join(\", \"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if (content.startsWith(\"#!disableOptimizations\")) {\n\t\t\tenableOptimization = false;\n\n\t\t} else if (content.startsWith(\"#!extension\")) {\n\t\t\tvar addedExtension = content.substring(\"#!extension\".length).trim()\n\t\t\tif (!(addedExtension in customGameSettingsSchema.extensions.values)) {\n\t\t\t\terror(\"Unknown extension '\"+addedExtension+\"', valid ones are: \"+Object.keys(customGameSettingsSchema.extensions.values).join(\", \"))\n\t\t\t}\n\t\t\tactivatedExtensions.push(addedExtension);\n\t\t} else if (content.startsWith(\"#!optimizeForSize\")) {\n\t\t\toptimizeForSize = true;\n\n\t\t} else if (content.startsWith(\"#!replace0ByCapturePercentage\")) {\n\t\t\tif (replacementFor0 !== null) {\n\t\t\t\terror(\"A replacement for 0 has already been defined\");\n\t\t\t}\n\t\t\treplacementFor0 = \"getCapturePercentage\";\n\n\t\t} else if (content.startsWith(\"#!replace0ByIsMatchComplete\")) {\n\t\t\tif (replacementFor0 !== null) {\n\t\t\t\terror(\"A replacement for 0 has already been defined\");\n\t\t\t}\n\t\t\treplacementFor0 = \"isMatchComplete\";\n\n\t\t} else if (content.startsWith(\"#!replace0ByPayloadProgressPercentage\")) {\n\t\t\tif (replacementFor0 !== null) {\n\t\t\t\terror(\"A replacement for 0 has already been defined\");\n\t\t\t}\n\t\t\treplacementFor0 = \"getPayloadProgressPercentage\";\n\n\t\t\t/* Could also use:\n\t\t\t- isAssemblingHeroes()\n\t\t\t- isInSetup()\n\t\t\t- isWaitingForPlayers()\n\t\t\t- isGameInProgress()\n\t\t\tbut they are not really reliable compared to the other functions as players may decide to start the game or change gamemode.\n\t\t\t*/\n\n\t\t} else if (content.startsWith(\"#!replace1ByMatchRound\")) {\n\t\t\tif (replacementFor1 !== null) {\n\t\t\t\terror(\"A replacement for 1 has already been defined\");\n\t\t\t}\n\t\t\treplacementFor1 = \"getMatchRound\";\n\n\t\t} else if (content.startsWith(\"#!replaceTeam1ByControlScoringTeam\")) {\n\t\t\tif (replacementForTeam1 !== null) {\n\t\t\t\terror(\"A replacement for Team.1 has already been defined\");\n\t\t\t}\n\t\t\treplacementForTeam1 = \"getControlScoringTeam\";\n\n\t\t} else if (content.startsWith(\"#!suppressWarnings \")) {\n\t\t\tvar firstSpaceIndex = content.indexOf(\" \");\n\t\t\tglobalSuppressedWarnings.push(...content.substring(firstSpaceIndex).trim().split(\" \").map(x => x.trim()));\n\n\t\t} else {\n\t\t\terror(\"Unknown preprocessor directive '\"+content+\"'\");\n\t\t}\n\t}\n\n\t\n\tfor (i = 0; i < content.length; moveCursor(1)) {\n\t\t\n //console.log(JSON.stringify(fileStack));\n\t\t\t\t\t\t\n\t\tif (content[i] === '\\n') {\n\t\t\t\n\t\t\t//Only end the logical line if the newline is not within brackets.\n\t\t\tif (bracketsLevel === 0) {\n\t\t\t\tnewLogicalLine();\n }\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif (content[i] === \"\\t\") {\n\t\t\t\tif (currentLine.tokens.length === 0) {\n\t\t\t\t\tcurrentLine.indentLevel += 4;\n\t\t\t\t}\n\t\t\t} else if (content[i] === ' ') {\n //increase indentation if no token yet; else, do nothing\n\t\t\t\tif (currentLine.tokens.length === 0) {\n\t\t\t \tcurrentLine.indentLevel++;\n }\n\t\t\t} else if (content[i] === '\\r') {\n\t\t\t\t//do nothing\n\n\t\t\t} else if (content[i] === '\\\\') {\n\t\t\t\tvar j = i+1;\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (content[j] === \"\\n\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (content[j] !== \" \" && content[j] !== \"\\r\") {\n\t\t\t\t\t\terror(\"A backslash can only be put at the end of a line\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//j++;\n\t\t\t\tmoveCursor(j-i-1 + \"\\n\".length);\n\n\t\t\t} else if (content[i] === '(' || content[i] === '[' || content[i] === '{') {\n\t\t\t\tbracketsLevel++;\n\t\t\t\taddToken(content[i]);\n\t\t\t\t\n\t\t\t} else if (content[i] === ')' || content[i] === ']' || content[i] === '}') {\n\t\t\t\tbracketsLevel--;\n\t\t\t\tif (bracketsLevel < 0) {\n\t\t\t\t\terror(\"Brackets level below 0 (extraneous closing bracket)\");\n\t\t\t\t}\n\t\t\t\taddToken(content[i]);\n\t\t\t\t\n\t\t\t} else if (content.startsWith(\"#!\", i)) {\n\t\t\t\tvar j = i;\n\t\t\t\tvar isBackslashed = false;\n\t\t\t\tvar preprocessingDirectiveContent = \"\";\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (content[j] === \"\\\\\") {\n\t\t\t\t\t\tisBackslashed = true;\n\t\t\t\t\t\tif (j < content.length-1 && ![\" \", \"\\r\", \"\\n\"].includes(content[j+1])) {\n\t\t\t\t\t\t\tpreprocessingDirectiveContent += content[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (!isBackslashed && content[j] === \"\\n\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (content[j] !== \" \" && content[j] !== \"\\r\") {\n\t\t\t\t\t\tisBackslashed = false;\n\t\t\t\t\t\tpreprocessingDirectiveContent += content[j];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpreprocessingDirectiveContent += content[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (preprocessingDirectiveContent.startsWith(\"#!include \")) {\n\t\t\t\t\t\n\t\t\t\t\tvar space = preprocessingDirectiveContent.indexOf(\" \");\n\t\t\t\t\tvar path = getFilePath(preprocessingDirectiveContent.substring(space));\n\t\t\t\t\tvar importedFileContent = getFileContent(path);\n\t\t\t\t\t\n\t\t\t\t\tcontent = content.substring(0, i) + importedFileContent + content.substring(i+preprocessingDirectiveContent.length);\n\t\t\t\t\taddFile(importedFileContent.length, preprocessingDirectiveContent.length-i, preprocessingDirectiveContent.length-i, 0, getFilenameFromPath(path), 0, 1);\n\t\t\t\t\ti--;\n\t\t\t\t\tfileStack[fileStack.length-1].remainingChars++;\n\t\t\t\t} else {\n\t\t\t\t\tparsePreprocessingDirective(preprocessingDirectiveContent);\n\t\t\t\t\tmoveCursor(j-i-1);\n\t\t\t\t}\n\n\t\t\t} else if (content[i] === '#') {\n\t\t\t\t//Get to the end of the comment. Note: backslashes don't work to continue a line comment.\n\t\t\t\tvar j = i+1;\n\t\t\t\tfor (; j < content.length && content[j] !== \"\\n\"; j++);\n\n\t\t\t\t//To facilitate parsing, do not add the comment if it is in parentheses, as it won't be used for action comments.\n\t\t\t\tif (bracketsLevel !== 0) {\n\t\t\t\t\tmoveCursor(j-i-1);\n\t\t\t\t} else {\n\t\t\t\t\taddToken(content.substring(i, j))\n\t\t\t\t}\n\t\t\t\n\t\t\t} else if (content.startsWith(\"/*\", i)) {\n\t\t\t\t\n\t\t\t\t//Get to the end of the multiline comment\n\t\t\t\tvar j = i+\"/*\".length;\n\t\t\t\tvar foundEndOfComment = false;\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (content.startsWith(\"*/\", j)) {\n\t\t\t\t\t\tfoundEndOfComment = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (!foundEndOfComment) {\n\t\t\t\t\terror(\"Multiline comment isn't terminated (found end of file while searching for end of comment)\");\n\t\t\t\t}\n\t\t\t\tj += \"*/\".length;\n\t\t\t\tmoveCursor(j-i-1);\n\n\n\t\t\t} else if (content.startsWith(\"*/\", i)) {\n\t\t\t\t//All ends should be found when a multiline comment start is found.\n\t\t\t\terror(\"Found end of multiline comment, but no matching beginning\");\n\t\t\t\t\n\t\t\t} else if (content[i] === '\"' || content[i] === \"'\") {\n\t\t\t\tvar strDelimiter = content[i];\n\t\t\t\tvar foundEndOfString = false;\n\t\t\t\tvar isBackslashed = false;\n\n\t\t\t\t//Get to the end of the string\n\t\t\t\tvar j = i+1;\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (!isBackslashed && content[j] === strDelimiter) {\n\t\t\t\t\t\tfoundEndOfString = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (content[j] === '\\\\' && !isBackslashed) {\n\t\t\t\t\t\tisBackslashed = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisBackslashed = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!foundEndOfString) {\n\t\t\t\t\terror(\"String isn't terminated (found end of file while searching for end of string)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tj += strDelimiter.length; //account for closing delimiter\n\t\t\t\taddToken(content.substring(i, j));\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//Get token\n var j = i;\n //Increases j as long as there are characters that can compose a word\n\t\t\t\tfor (; j < content.length && isVarChar(content[j]); j++);\n \n //If j > i, then there was a word, instead of an operator\n\t\t\t\tif (j > i) {\n\n\t\t\t\t\tvar macroWasFound = false;\n\n\t\t\t\t\t//Test each macro\n\t\t\t\t\tfor (var k = 0; k < macros.length; k++) {\n\t\t\t\t\t\tif (content.substring(i,j) === macros[k].name) {\n\n\t\t\t\t\t\t\tvar text;\n\t\t\t\t\t\t\tvar replacement;\n\t\t\t\t\t\t\tvar macroCols = 0;\n\t\t\t\t\t\t\tvar macroLines = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (macros[k].isFunction) {\n\t\t\t\t\t\t\t\t//debug(\"Resolving function macro \"+macros[k].name);\n\t\t\t\t\t\t\t\tvar bracketPos = getBracketPositions(content.substring(i), true, true);\n\t\t\t\t\t\t\t\ttext = content.substring(i, i+bracketPos[1]+1);\n\t\t\t\t\t\t\t\tvar macroArgs = getArgs(content.substring(i+bracketPos[0]+1, i+bracketPos[1]));\n\t\t\t\t\t\t\t\treplacement = resolveMacro(macros[k], macroArgs, currentLine.indentLevel);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//debug(\"Resolving normal macro \"+macros[k].name);\n\t\t\t\t\t\t\t\ttext = macros[k].name;\n\t\t\t\t\t\t\t\t//replacement = macros[k].replacement;\n\t\t\t\t\t\t\t\treplacement = resolveMacro(macros[k], [], currentLine.indentLevel);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontent = content.substring(0, i) + replacement + content.substring(i+text.length);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (text.indexOf('\\n') >= 0) {\n\t\t\t\t\t\t\t\tmacroCols = text.length - text.lastIndexOf('\\n');\n\t\t\t\t\t\t\t\tmacroLines = text.split('\\n').length-1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmacroCols = text.length;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\t\t\t\terror(\"Replacement is undefined\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\taddFile(replacement.length, text.length, macroCols, macroLines, macros[k].name, macros[k].startingCol, macros[k].fileStack[macros[k].fileStack.length-1].currentLineNb);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//debug(\"Text: \"+text);\n\t\t\t\t\t\t\t//debug(\"Replacement: \"+replacement);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tk = 0;\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\tfileStack[fileStack.length-1].remainingChars++;\n\t\t\t\t\t\t\tmacroWasFound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!macroWasFound) {\n\t\t\t\t\t\t//Handle the special case of min= and max= operators\n\t\t\t\t\t\tif ((content.substring(i,j) === \"min\" || content.substring(i,j) === \"max\") && content[i+\"min\".length] === '=') {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taddToken(content.substring(i, j))\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tvar hasTokenBeenFound = false;\n\t\t\t\t\t//Test each remaining token\n\t\t\t\t\tfor (var h = 0; h < tokens.length; h++) {\n\t\t\t\t\t\tif (content.startsWith(tokens[h], i)) {\n\n\t\t\t\t\t\t\taddToken(content.substring(i, i+tokens[h].length));\n\t\t\t\t\t\t\thasTokenBeenFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!hasTokenBeenFound) {\n\t\t\t\t\t\terror(\"Unknown token '\"+content[i]+\"'\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\n\tif (bracketsLevel > 0) {\n\t\terror(\"Found end of file, but a bracket isn't closed\");\n\t}\n\n\tif (DEBUG_MODE) {\n\t\t//console.log(\"macros = \");\n\t\t//console.log(macros);\n\t\t//console.log(rules);\n\t\tconsole.log(result.join(\"\\n\"));\n\t\t//console.log(result);\n\t}\n\t\n\t\n\treturn result;\n\t\n}", "title": "" }, { "docid": "f7585545f2d2bb316ab921f75193d3a9", "score": "0.5538752", "text": "function tokenize(content) {\n\t\n\tif (!content.endsWith('\\n')) {\n\t\tcontent += '\\n';\n\t}\n\t\n\t//Not the full list of tokens; namely, brackets aren't in this list.\n\t//Sorted by longest first, for greediness.\n\tvar tokens = [\n\t\t\"==\",\n\t\t\"!=\",\n\t\t\"<=\",\n\t\t\">=\",\n\t\t\"+=\",\n\t\t\"-=\",\n\t\t\"*=\",\n\t\t\"/=\",\n\t\t\"%=\",\n\t\t\"**=\",\n\t\t\"<\",\n\t\t\">\",\n\t\t\"=\",\n\t\t\"+\",\n\t\t\"-\",\n\t\t\",\",\n\t\t\"/\",\n\t\t\"%\",\n\t\t\"**\",\n\t\t\"*\",\n\t\t\".\",\n\t\t\":\",\n\t\t\";\",\n\t\t\"\\\\\",\n\t];\n\t\n\t\n\tvar result = [];\n\tmacros = [];\n\t\n\t//var isInString = false;\n\tvar bracketsLevel = 0;\n\tvar currentLine = {};\n \n fileStack = [{\n \"name\": \"<main>\",\n \"currentLineNb\": 1,\n \"currentColNb\": 1,\n \"remainingChars\": content.length+1, //does not matter\n\t}];\n\t\n\tvar i = 0;\n\t\n\tfunction addToken(text) {\n\t\t\n\t\tif (text.length === 0) {\n\t\t\terror(\"Token is empty, lexer broke\");\n\t\t}\n\t\t\n\t\t//debug(\"Adding token '\"+text+\"' at \"+currentLineNb+\":\"+currentColNb);\n\t\t\n\t\tcurrentLine.tokens.push(new Token(text, getFileStackCopy()));\n\t\t\n\t\tmoveCursor(text.length-1);\n }\n \n //Length = length of the macro resolution\n //callCols, callLines = how many cols/lines the macro CALL takes\n //callNbChars = how many characters the macro call takes\n //Name: used in stack trace, should be macro name or file name\n //startingCol, startingLine: the col/line of the macro start in the file it is declared\n function addFile(length, callNbChars, callCols, callLines, name, startingCol, startingLine) {\n fileStack.push({\n name,\n remainingChars: length,\n callNbChars,\n callCols,\n callLines,\n currentLineNb: 0+startingLine,\n currentColNb: 0+startingCol,\n });\n //console.log(JSON.stringify(fileStack));\n }\n\t\n\tfunction newLogicalLine() {\n\t\t\n\t\tif (currentLine.tokens !== undefined && currentLine.tokens.length > 0) {\n\t\t\tresult.push(currentLine);\n\t\t}\n\t\t\n\t\tcurrentLine = new LogicalLine();\n\t}\n\t\n\tnewLogicalLine();\n\n\tfunction moveCursor(amount) {\n\t\tfor (var j = 0; j < amount; j++) {\n\n\t\t\tif (fileStack[fileStack.length-1].remainingChars > 0) {\n\t\t\t\tfileStack[fileStack.length-1].remainingChars--;\n\t\t\t\tif (fileStack[fileStack.length-1].remainingChars === 0) {\n\t\t\t\t\t//debug(\"macro lines = \"+macroLines+\", macro cols = \"+macroCols);\n\t\t\t\t\tfileStack[fileStack.length-2].currentLineNb += fileStack[fileStack.length-1].callLines;\n\t\t\t\t\tfileStack[fileStack.length-2].currentColNb += fileStack[fileStack.length-1].callLines-1;\n\t\t\t\t\tfileStack[fileStack.length-2].remainingChars -= fileStack[fileStack.length-1].callNbChars;\n\t\t\t\t\tfileStack.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfileStack[fileStack.length-1].currentColNb++;\n\t\t\tif (content[i+j] === \"\\n\") {\n\t\t\t\t\n\t\t\t\tfileStack[fileStack.length-1].currentLineNb++;\n\t\t\t\tfileStack[fileStack.length-1].currentColNb = 1;\n\t\t\t}\n\t\t}\n\t\ti += amount;\n\t}\n\n\tfunction parsePreprocessingDirective(content) {\n\n\t\tdebug(\"Parsing preprocessing directive '\"+content+\"'\");\n\t\tif (content.startsWith(\"#!define \") || content.startsWith(\"#!defineMember \")) {\n\t\t\tmacros.push(parseMacro({\n\t\t\t\tfileStack: getFileStackCopy(),\n\t\t\t\tcontent: content,\n\t\t\t}));\n\t\t} else if (content.startsWith(\"#!mainFile \")) {\n\t\t\t//we must ignore this preprocessor directive\n\n\t\t} else if (content.startsWith(\"#!obfuscate\")) {\n\t\t\tobfuscationSettings = {\n\t\t\t\tobfuscateNames: true,\n\t\t\t\tobfuscateStrings: true,\n\t\t\t\tobfuscateConstants: true,\n\t\t\t\tobfuscateInspector: true,\n\t\t\t\truleFilling: true,\n\t\t\t\tcopyProtection: true,\n\t\t\t}\n\n\t\t\tvar disabledObfuscationTechniques = content.substring(\"#!obfuscate\".length).trim().split(\" \").map(x => x.trim());\n\t\t\tfor (var tech of disabledObfuscationTechniques) {\n\t\t\t\tif (tech === \"noNameObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateNames = false;\n\t\t\t\t} else if (tech === \"noStringObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateStrings = false;\n\t\t\t\t} else if (tech === \"noConstantObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateConstants = false;\n\t\t\t\t} else if (tech === \"noInspectorObfuscation\") {\n\t\t\t\t\tobfuscationSettings.obfuscateInspector = false;\n\t\t\t\t} else if (tech === \"noRuleFilling\") {\n\t\t\t\t\tobfuscationSettings.ruleFilling = false;\n\t\t\t\t} else if (tech === \"noCopyProtection\") {\n\t\t\t\t\tobfuscationSettings.copyProtection = false;\n\t\t\t\t} else if (tech !== \"\") {\n\t\t\t\t\terror(\"Unknown obfuscation setting '\"+tech+\"', valid ones are: \"+Object.keys(obfuscationSettings).map(x => \"no\"+x[0].toUpperCase()+x.slice(1)).join(\", \"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if (content.startsWith(\"#!disableOptimizations\")) {\n\t\t\tenableOptimization = false;\n\n\t\t} else if (content.startsWith(\"#!suppressWarnings \")) {\n\t\t\tvar firstSpaceIndex = content.indexOf(\" \");\n\t\t\tglobalSuppressedWarnings.push(...content.substring(firstSpaceIndex).trim().split(\" \").map(x => x.trim()));\n\n\t\t} else {\n\t\t\terror(\"Unknown preprocessor directive '\"+content+\"'\");\n\t\t}\n\t}\n\n\t\n\tfor (i = 0; i < content.length; moveCursor(1)) {\n\t\t\n //console.log(JSON.stringify(fileStack));\n\t\t\t\t\t\t\n\t\tif (content[i] === '\\n') {\n\t\t\t\n\t\t\t//Only end the logical line if the newline is not within brackets.\n\t\t\tif (bracketsLevel === 0) {\n\t\t\t\tnewLogicalLine();\n }\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif (content[i] === \"\\t\") {\n\t\t\t\tif (currentLine.tokens.length === 0) {\n\t\t\t\t\tcurrentLine.indentLevel += 4;\n\t\t\t\t}\n\t\t\t} else if (content[i] === ' ') {\n //increase indentation if no token yet; else, do nothing\n\t\t\t\tif (currentLine.tokens.length === 0) {\n\t\t\t \tcurrentLine.indentLevel++;\n }\n\t\t\t} else if (content[i] === '\\r') {\n\t\t\t\t//do nothing\n\n\t\t\t} else if (content[i] === '\\\\') {\n\t\t\t\tvar j = i+1;\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (content[j] === \"\\n\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (content[j] !== \" \" && content[j] !== \"\\r\") {\n\t\t\t\t\t\terror(\"A backslash can only be put at the end of a line\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//j++;\n\t\t\t\tmoveCursor(j-i-1 + \"\\n\".length);\n\n\t\t\t} else if (content[i] === '(' || content[i] === '[' || content[i] === '{') {\n\t\t\t\tbracketsLevel++;\n\t\t\t\taddToken(content[i]);\n\t\t\t\t\n\t\t\t} else if (content[i] === ')' || content[i] === ']' || content[i] === '}') {\n\t\t\t\tbracketsLevel--;\n\t\t\t\tif (bracketsLevel < 0) {\n\t\t\t\t\terror(\"Brackets level below 0 (extraneous closing bracket)\");\n\t\t\t\t}\n\t\t\t\taddToken(content[i]);\n\t\t\t\t\n\t\t\t} else if (content.startsWith(\"#!\", i)) {\n\t\t\t\tvar j = i;\n\t\t\t\tvar isBackslashed = false;\n\t\t\t\tvar preprocessingDirectiveContent = \"\";\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (content[j] === \"\\\\\") {\n\t\t\t\t\t\tisBackslashed = true;\n\t\t\t\t\t\t//preprocessingDirectiveContent += content[j];\n\t\t\t\t\t} else if (!isBackslashed && content[j] === \"\\n\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (content[j] !== \" \" && content[j] !== \"\\r\") {\n\t\t\t\t\t\tisBackslashed = false;\n\t\t\t\t\t\tpreprocessingDirectiveContent += content[j];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpreprocessingDirectiveContent += content[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (preprocessingDirectiveContent.startsWith(\"#!include \")) {\n\t\t\t\t\t\n\t\t\t\t\tvar space = preprocessingDirectiveContent.indexOf(\" \");\n\t\t\t\t\tvar path = getFilePath(preprocessingDirectiveContent.substring(space));\n\t\t\t\t\tvar importedFileContent = getFileContent(path);\n\t\t\t\t\t\n\t\t\t\t\tcontent = content.substring(0, i) + importedFileContent + content.substring(i+preprocessingDirectiveContent.length);\n\t\t\t\t\taddFile(importedFileContent.length, preprocessingDirectiveContent.length-i, preprocessingDirectiveContent.length-i, 0, getFilenameFromPath(path), 0, 1);\n\t\t\t\t\ti--;\n\t\t\t\t\tfileStack[fileStack.length-1].remainingChars++;\n\t\t\t\t} else {\n\t\t\t\t\tparsePreprocessingDirective(preprocessingDirectiveContent);\n\t\t\t\t\tmoveCursor(j-i-1);\n\t\t\t\t}\n\n\t\t\t} else if (content[i] === '#') {\n\t\t\t\t//Get to the end of the comment. Note: backslashes don't work to continue a line comment.\n\t\t\t\tvar j = i+1;\n\t\t\t\tfor (; j < content.length && content[j] !== \"\\n\"; j++);\n\n\t\t\t\t//To facilitate parsing, do not add the comment if it is in parentheses, as it won't be used for action comments.\n\t\t\t\tif (bracketsLevel !== 0) {\n\t\t\t\t\tmoveCursor(j-i-1);\n\t\t\t\t} else {\n\t\t\t\t\taddToken(content.substring(i, j))\n\t\t\t\t}\n\t\t\t\n\t\t\t} else if (content.startsWith(\"/*\", i)) {\n\t\t\t\t\n\t\t\t\t//Get to the end of the multiline comment\n\t\t\t\tvar j = i+\"/*\".length;\n\t\t\t\tvar foundEndOfComment = false;\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (content.startsWith(\"*/\", j)) {\n\t\t\t\t\t\tfoundEndOfComment = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (!foundEndOfComment) {\n\t\t\t\t\terror(\"Multiline comment isn't terminated (found end of file while searching for end of comment)\");\n\t\t\t\t}\n\t\t\t\tj += \"*/\".length;\n\t\t\t\tmoveCursor(j-i-1);\n\n\n\t\t\t} else if (content.startsWith(\"*/\", i)) {\n\t\t\t\t//All ends should be found when a multiline comment start is found.\n\t\t\t\terror(\"Found end of multiline comment, but no matching beginning\");\n\t\t\t\t\n\t\t\t} else if (content[i] === '\"' || content[i] === \"'\") {\n\t\t\t\tvar strDelimiter = content[i];\n\t\t\t\tvar foundEndOfString = false;\n\t\t\t\tvar isBackslashed = false;\n\n\t\t\t\t//Get to the end of the string\n\t\t\t\tvar j = i+1;\n\t\t\t\tfor (; j < content.length; j++) {\n\t\t\t\t\tif (!isBackslashed && content[j] === strDelimiter) {\n\t\t\t\t\t\tfoundEndOfString = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (content[j] === '\\\\' && !isBackslashed) {\n\t\t\t\t\t\tisBackslashed = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisBackslashed = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!foundEndOfString) {\n\t\t\t\t\terror(\"String isn't terminated (found end of file while searching for end of string)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tj += strDelimiter.length; //account for closing delimiter\n\t\t\t\taddToken(content.substring(i, j));\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//Get token\n var j = i;\n //Increases j as long as there are characters that can compose a word\n\t\t\t\tfor (; j < content.length && isVarChar(content[j]); j++);\n \n //If j > i, then there was a word, instead of an operator\n\t\t\t\tif (j > i) {\n\n\t\t\t\t\tvar macroWasFound = false;\n\n\t\t\t\t\t//Test each macro\n\t\t\t\t\tfor (var k = 0; k < macros.length; k++) {\n\t\t\t\t\t\tif (content.substring(i,j) === macros[k].name) {\n\n\t\t\t\t\t\t\tvar text;\n\t\t\t\t\t\t\tvar replacement;\n\t\t\t\t\t\t\tvar macroCols = 0;\n\t\t\t\t\t\t\tvar macroLines = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (macros[k].isFunction) {\n\t\t\t\t\t\t\t\t//debug(\"Resolving function macro \"+macros[k].name);\n\t\t\t\t\t\t\t\tvar bracketPos = getBracketPositions(content.substring(i), true, true);\n\t\t\t\t\t\t\t\ttext = content.substring(i, i+bracketPos[1]+1);\n\t\t\t\t\t\t\t\tvar macroArgs = getArgs(content.substring(i+bracketPos[0]+1, i+bracketPos[1]));\n\t\t\t\t\t\t\t\treplacement = resolveMacro(macros[k], macroArgs, currentLine.indentLevel);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//debug(\"Resolving normal macro \"+macros[k].name);\n\t\t\t\t\t\t\t\ttext = macros[k].name;\n\t\t\t\t\t\t\t\t//replacement = macros[k].replacement;\n\t\t\t\t\t\t\t\treplacement = resolveMacro(macros[k], [], currentLine.indentLevel);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontent = content.substring(0, i) + replacement + content.substring(i+text.length);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (text.indexOf('\\n') >= 0) {\n\t\t\t\t\t\t\t\tmacroCols = text.length - text.lastIndexOf('\\n');\n\t\t\t\t\t\t\t\tmacroLines = text.split('\\n').length-1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmacroCols = text.length;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\t\t\t\terror(\"Replacement is undefined\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\taddFile(replacement.length, text.length, macroCols, macroLines, macros[k].name, macros[k].startingCol, macros[k].fileStack[macros[k].fileStack.length-1].currentLineNb);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//debug(\"Text: \"+text);\n\t\t\t\t\t\t\t//debug(\"Replacement: \"+replacement);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tk = 0;\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\tfileStack[fileStack.length-1].remainingChars++;\n\t\t\t\t\t\t\tmacroWasFound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!macroWasFound) {\n\t\t\t\t\t\t//Handle the special case of min= and max= operators\n\t\t\t\t\t\tif ((content.substring(i,j) === \"min\" || content.substring(i,j) === \"max\") && content[i+\"min\".length] === '=') {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taddToken(content.substring(i, j))\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tvar hasTokenBeenFound = false;\n\t\t\t\t\t//Test each remaining token\n\t\t\t\t\tfor (var h = 0; h < tokens.length; h++) {\n\t\t\t\t\t\tif (content.startsWith(tokens[h], i)) {\n\n\t\t\t\t\t\t\taddToken(content.substring(i, i+tokens[h].length));\n\t\t\t\t\t\t\thasTokenBeenFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!hasTokenBeenFound) {\n\t\t\t\t\t\terror(\"Unknown token '\"+content[i]+\"'\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\n\tif (bracketsLevel > 0) {\n\t\terror(\"Found end of file, but a bracket isn't closed\");\n\t}\n\n\tif (DEBUG_MODE) {\n\t\t//console.log(\"macros = \");\n\t\t//console.log(macros);\n\t\t//console.log(rules);\n\t\tconsole.log(result.join(\"\\n\"));\n\t\t//console.log(result);\n\t}\n\t\n\t\n\treturn result;\n\t\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.55380285", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "532a4b3128b7f5fd01ab0473b580cd21", "score": "0.55302584", "text": "function Tokenizer(str) {\n var i = 0;\n \n // Returns the index of the next character to tokenize.\n this.position = function() {\n return i;\n };\n \n // Returns the next token as a string, or null if the end of the token stream is reached.\n this.peek = function() {\n if (i == str.length) // End of stream\n return null;\n \n var match = /^([A-Za-z][a-z]*|[0-9]+|[+\\-^=()])/.exec(str.substring(i));\n if (match == null)\n throw {message: \"Invalid symbol\", start: i};\n return match[0];\n };\n \n // Returns the next token as a string and advances this tokenizer past the token.\n this.take = function() {\n var result = this.peek();\n if (result == null)\n throw \"Advancing beyond last token\";\n i += result.length;\n skipSpaces();\n return result;\n };\n \n // Takes the next token and checks that it matches the given string, or throws an exception.\n this.consume = function(s) {\n if (this.take() != s)\n throw \"Token mismatch\";\n };\n \n function skipSpaces() {\n var match = /^[ \\t]*/.exec(str.substring(i));\n i += match[0].length;\n }\n \n str = str.replace(/\\u2212/g, \"-\");\n skipSpaces();\n}", "title": "" }, { "docid": "2234fd70d67e90bc8ec4e7260789c0eb", "score": "0.5509127", "text": "function tokenize(str) \r\n{\r\n //ARRAY OF TOKENS\r\n var result=[]; \r\n \r\n // REMOVE SPACES THEY DON'T MATTER\r\n str = str.replace(/\\s+/g, \"\");\r\n\r\n // CONVERT TO ARRAY OF CHARACTERS\r\n str=str.split(\"\");\r\n\r\n var buffer=\"\";\r\n str.forEach(function (char, idx)\r\n {\r\n if(isDigit(char)) \r\n {\r\n buffer += char;\r\n } \r\n else if(char == \".\")\r\n {\r\n buffer += char;\r\n }\r\n else if (isLetter(char)) \r\n {\r\n buffer += char;\r\n } \r\n else if (isOperator(char)) \r\n {\r\n if(buffer !== \"\") result.push(buffer);\r\n result.push(char);\r\n buffer = \"\";\r\n } \r\n else if (isLeftParenthesis(char)) \r\n {\r\n result.push(char);\r\n } \r\n else if (isRightParenthesis(char)) \r\n {\r\n if(buffer !== \"\") result.push(buffer);\r\n result.push(char);\r\n buffer = \"\";\r\n } \r\n\r\n if(idx == str.length-1 && (buffer !== \"\") )\r\n {\r\n result.push(buffer);\r\n buffer=\"\"; \r\n }\r\n });\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "8fb3954be5844ff4b48af60558ac7780", "score": "0.5486057", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (c == ' ' || c == '\\t' || (c == '\\n' && nesting_level)) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n token_type = TOKENTYPE.UNKNOWN;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (c == '.') {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if ((c == 'E' || c == 'e') && (isDigit(c2) || c2 == '-' || c2 == '+')) {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n // this is no legal number, exponent is missing.\n token_type = TOKENTYPE.UNKNOWN;\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (currentIsAlpha()) {\n while (currentIsAlpha() || isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS[token]) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "a45b0a549ea5e990a1d0f7a4c6145546", "score": "0.54724586", "text": "function Tokenizer(s, f, l) {\n this.cursor = 0;\n this.source = String(s);\n this.tokens = [];\n this.tokenIndex = 0;\n this.lookahead = 0;\n this.scanNewlines = false;\n this.unexpectedEOF = false;\n this.filename = f || \"\";\n this.lineno = l || 1;\n this.blackList = blackLists[Narcissus.options.version];\n this.blockComments = null;\n }", "title": "" }, { "docid": "4a7c396150e875ff8f1ea4e1e57fb021", "score": "0.5471157", "text": "parse(input) {\n\t\tthis.tokens = [];\n\t\tfor (let i = 0, token, t; i < input.length;) {\n\t\t\tt = input[i];\n\t\t\tif (NUMBER.test(t)) {\n\t\t\t\twhile (input[++i] && NUMBER.test(input[i]) && (t += input[i]));\n\t\t\t\tif (input[i] === 'i') { // imaginary number\n\t\t\t\t\tt += input[i++];\n\t\t\t\t\t// expressions are treated like numeric literals except they are not cast to a number\n\t\t\t\t\t// evaluation of these is left to the application\n\t\t\t\t\ttoken = new Token(t, 'expression', this.tokens.length);\n\t\t\t\t} else {\n\t\t\t\t\ttoken = new Token(Number(t), 'number', this.tokens.length);\n\t\t\t\t}\n\t\t\t\tthis.tokens.push(token);\n\t\t\t\tcontinue;\n\t\t\t} else if (WORD.test(t)) {\n\t\t\t\twhile (input[++i] && (WORD.test(input[i])||NUMBER.test(input[i])) && (t += input[i]));\n\t\t\t\tif (input[i] == OPEN) {\n\t\t\t\t\ttoken = new Token(t, 'function', this.tokens.length);\n\t\t\t\t} else if (t == 'i') { // 1i implied\n\t\t\t\t\ttoken = new Token(t, 'expression', this.tokens.length);\n\t\t\t\t} else {\n\t\t\t\t\ttoken = new Token(t, 'variable', this.tokens.length);\n\t\t\t\t}\n\t\t\t\tthis.tokens.push(token);\n\t\t\t\tcontinue;\n\t\t\t} else if (this.OPERATORS.includes(t)) {\n\t\t\t\tif (t == '*' && input[i+1] == '*') {\n\t\t\t\t\tt += input[++i];\n\t\t\t\t}\n\t\t\t\ttoken = new Token(t, 'operator', this.tokens.length);\n\t\t\t\tthis.tokens.push(token);\n\t\t\t}\n\t\t\t++i;\n\t\t}\n\t\t// argument counting pass\n\t\tfor (let t = 0, prev, next, token, stack = []; t < this.tokens.length; t++) {\n\t\t\tprev = this.tokens[t-1];\n\t\t\ttoken = this.tokens[t];\n\t\t\tnext = this.tokens[t+1];\n\t\t\tif (token.type == 'operator') {\n\t\t\t\tswitch (token.value) {\n\t\t\t\t\tcase OPEN:\n\t\t\t\t\t\t// start of expression closure or function call\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CLOSE:\n\t\t\t\t\t\t// end of expression closure or function call\n\t\t\t\t\t\tif (stack.length) {\n\t\t\t\t\t\t\t// make sure this isn't a 0-argument function call\n\t\t\t\t\t\t\t// if it isn't, assume 1 more argument than commas counted\n\t\t\t\t\t\t\tif (token.index > stack[stack.length-1].index + 1) {\n\t\t\t\t\t\t\t\tstack[stack.length-1].args++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstack.pop();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ARG_SEPARATOR:\n\t\t\t\t\t\tif (stack.length) {\n\t\t\t\t\t\t\tstack[stack.length-1].args++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// TODO: throw error if there's a floating comma?\n\t\t\t\t\t\t\tthrow token.toString() + ' not allowed outside a function argument list';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tlet leftArg = prev && (prev.type !== 'operator' || prev.value !== OPEN);\n\t\t\t\t\t\tlet rightArg = next && (next.type !== 'operator' || next.value !== CLOSE);\n\t\t\t\t\t\tif (token.value == '-' && !leftArg && rightArg) {\n\t\t\t\t\t\t\t// unary subtract\n\t\t\t\t\t\t\ttoken.args = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// operators count values on either side )+( assumes 2, (+) is 0 and invalid\n\t\t\t\t\t\tif (leftArg && rightArg) {\n\t\t\t\t\t\t\ttoken.args = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow token.toString() + ' requires left and right operands.';\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (token.type == 'function') {\n\t\t\t\t// beginning of function call\n\t\t\t\tstack.push(token);\n\t\t\t}\n\t\t}\n\t\t//console.log('Tokens:', this.tokens);\n\t\treturn this;\n\t}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5454899", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5454899", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5454899", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.5454899", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "5a433a38c62e72a5849658b468c02484", "score": "0.54335046", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // check for binary, octal, or hex\n\n var _c = currentString(state, 2);\n\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state); // get the digits after the radix\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state); // get the word size\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n return;\n } // get number, can have a single dot\n\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (hasOwnProperty$1(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5429812", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5429812", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5429812", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5429812", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5429812", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5429812", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "8bf049d264716c46b125c6b84b61574c", "score": "0.54209584", "text": "tokenize(input) {\n this.#programCode = input;\n this.#cursorPosition = 0;\n\n const tokens = [];\n let char = null;\n\n while (this.#cursorPosition < this.#programCode.length) {\n char = this.#getCurrentChar();\n\n // Hey, we found a number, lets investigate further and check how large this number is\n // and if it spans over multiple characters.\n if (this.#isNumber(char)) {\n tokens.push(new Token(Tokens.Integer, this.#tokenizeNumber()));\n continue;\n }\n\n // That's a variable name, but we have to be careful because it could be one of the\n // reserved keywords as well.\n if (this.#isName(char)) {\n tokens.push(this.#checkKeywords(this.#tokenizeName()));\n continue;\n }\n\n // We found an arrow operator (i.e. \"->\"). But this might be the prefix of a negative\n // number as well.\n if (this.#isArrow(char)) {\n tokens.push(this.#tokenizeArrow());\n continue;\n }\n\n // Nothing matched so far, test the other possibilities...\n if (char === \"{\") {\n tokens.push(new Token(Tokens.LSPAREN));\n } else if (char === \"}\") {\n tokens.push(new Token(Tokens.RSPAREN));\n } else if (char === \"(\") {\n tokens.push(new Token(Tokens.LRPAREN));\n } else if (char === \")\") {\n tokens.push(new Token(Tokens.RRPAREN));\n } else if (char === \",\") {\n tokens.push(new Token(Tokens.Comma));\n } else if (char === \"=\") {\n tokens.push(new Token(Tokens.Assign));\n }\n\n // ... and advance the cursor manually\n this.#advanceCursor();\n }\n\n return tokens;\n }", "title": "" }, { "docid": "ca00734d0043ff49c94ca5b60bb478ec", "score": "0.5420429", "text": "function getToken() {\n\t token_type = TOKENTYPE.NULL;\n\t token = '';\n\t comment = '';\n\t\n\t // skip over whitespaces\n\t // space, tab, and newline when inside parameters\n\t while (parse.isWhitespace(c, nesting_level)) {\n\t next();\n\t }\n\t\n\t // skip comment\n\t if (c == '#') {\n\t while (c != '\\n' && c != '') {\n\t comment += c;\n\t next();\n\t }\n\t }\n\t\n\t // check for end of expression\n\t if (c == '') {\n\t // token is still empty\n\t token_type = TOKENTYPE.DELIMITER;\n\t return;\n\t }\n\t\n\t // check for new line character\n\t if (c == '\\n' && !nesting_level) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t token = c;\n\t next();\n\t return;\n\t }\n\t\n\t // check for delimiters consisting of 3 characters\n\t var c2 = c + nextPreview();\n\t var c3 = c2 + nextNextPreview();\n\t if (c3.length == 3 && DELIMITERS[c3]) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t token = c3;\n\t next();\n\t next();\n\t next();\n\t return;\n\t }\n\t\n\t // check for delimiters consisting of 2 characters\n\t if (c2.length == 2 && DELIMITERS[c2]) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t token = c2;\n\t next();\n\t next();\n\t return;\n\t }\n\t\n\t // check for delimiters consisting of 1 character\n\t if (DELIMITERS[c]) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t token = c;\n\t next();\n\t return;\n\t }\n\t\n\t // check for a number\n\t if (parse.isDigitDot(c)) {\n\t token_type = TOKENTYPE.NUMBER;\n\t\n\t // get number, can have a single dot\n\t if (c == '.') {\n\t token += c;\n\t next();\n\t\n\t if (!parse.isDigit(c)) {\n\t // this is no number, it is just a dot (can be dot notation)\n\t token_type = TOKENTYPE.DELIMITER;\n\t }\n\t }\n\t else {\n\t while (parse.isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\t if (parse.isDecimalMark(c, nextPreview())) {\n\t token += c;\n\t next();\n\t }\n\t }\n\t while (parse.isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\t\n\t // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\t c2 = nextPreview();\n\t if (c == 'E' || c == 'e') {\n\t if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n\t token += c;\n\t next();\n\t\n\t if (c == '+' || c == '-') {\n\t token += c;\n\t next();\n\t }\n\t\n\t // Scientific notation MUST be followed by an exponent\n\t if (!parse.isDigit(c)) {\n\t throw createSyntaxError('Digit expected, got \"' + c + '\"');\n\t }\n\t\n\t while (parse.isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\t\n\t if (parse.isDecimalMark(c, nextPreview())) {\n\t throw createSyntaxError('Digit expected, got \"' + c + '\"');\n\t }\n\t }\n\t else if (c2 == '.') {\n\t next();\n\t throw createSyntaxError('Digit expected, got \"' + c + '\"');\n\t }\n\t }\n\t\n\t return;\n\t }\n\t\n\t // check for variables, functions, named operators\n\t if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n\t while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\t\n\t if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t }\n\t else {\n\t token_type = TOKENTYPE.SYMBOL;\n\t }\n\t\n\t return;\n\t }\n\t\n\t // something unknown is found, wrong characters -> a syntax error\n\t token_type = TOKENTYPE.UNKNOWN;\n\t while (c != '') {\n\t token += c;\n\t next();\n\t }\n\t throw createSyntaxError('Syntax error in part \"' + token + '\"');\n\t }", "title": "" }, { "docid": "0cc7560fbfee1c4fd69ffe7a64c9f922", "score": "0.5419539", "text": "function factory$4(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now;\n eat.file = self.file;\n\n // Sync initial offset.\n updatePosition('');\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function() {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now();\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n var fn;\n\n if (\n prev &&\n node.type === prev.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote;\n node = fn.call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.slice(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position\n }\n }\n }\n}", "title": "" }, { "docid": "8a58a63d77b11cb09ecc807926e261fc", "score": "0.54192233", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // check for binary, octal, or hex\n\n var _c = currentString(state, 2);\n\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state); // get the digits after the radix\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state); // get the word size\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n return;\n } // get number, can have a single dot\n\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (Object(_utils_object_js__WEBPACK_IMPORTED_MODULE_3__[\"hasOwnProperty\"])(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "0fceaaeb5737a99053db53db85a45466", "score": "0.54192233", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // check for binary, octal, or hex\n\n var _c = currentString(state, 2);\n\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n return;\n } // get number, can have a single dot\n\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (Object(_utils_object_js__WEBPACK_IMPORTED_MODULE_3__[\"hasOwnProperty\"])(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "6467752bcac88fa7e6e845f03f26721f", "score": "0.54192233", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // check for binary, octal, or hex\n\n var _c = currentString(state, 2);\n\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state); // get the digits after the radix\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state); // get the word size\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n return;\n } // get number, can have a single dot\n\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (object_hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "eb5fb82228a97a04e8e142e77439aeba", "score": "0.5399635", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c == ' ' || c == '\\t') { // space or tab\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n token_type = TOKENTYPE.UNKNOWN;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (c == '.') {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for scientific notation like \"2.3e-4\" or \"1.23e50\"\n if (c == 'E' || c == 'e') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n // this is no legal number, exponent is missing.\n token_type = TOKENTYPE.UNKNOWN;\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n }\n\n return;\n }\n\n // check for variables or functions\n if (isAlpha(c)) {\n token_type = TOKENTYPE.SYMBOL;\n\n while (isAlpha(c) || isDigit(c)) {\n token += c;\n next();\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "d2cfef5be77cbad978b04b7bf2f811b6", "score": "0.5396105", "text": "tokenize() {\n let character = this.next()\n\n if (character === '@') {\n return this.lexVariableName()\n } else if (character === null) {\n return { val: null, type: types.EOF, position: this.position }\n } else if (character === '\"' || character === \"'\") { // eslint-disable-line quotes\n return this.lexString()\n } else if (character === '/') {\n this.lexComment()\n return this.tokenize()\n } else if (~'=.'.indexOf(character)) {\n return this.lexSingle()\n } else if (~formats.whitespace.indexOf(character)) {\n this.skipWhitespace()\n return this.tokenize()\n } else if (this.keywordStart(character)) {\n return this.lexKeyword()\n throw Error\n } else {\n return console.error('unknown character', character)\n }\n }", "title": "" }, { "docid": "be6636e20e4ae22b201e66b158583d12", "score": "0.5394128", "text": "function getToken() {\n for (i = 0; i < matchersLen; i += 1) {\n matchedContent = matchers[i](parseStr, offset, tokenList);\n\n if (matchedContent !== null) {\n // We matched something. Build a better token object.\n token = {\n line: line,\n col: col,\n offset: offset,\n type: types[i],\n content: matchedContent\n };\n\n if (tokenFactory) {\n token = tokenFactory(token);\n }\n\n return;\n }\n }\n\n token = null;\n }", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.5391992", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.5391992", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.5391992", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.5391992", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.5391992", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "5817a656dda766a4102c67e28dbedaa5", "score": "0.5389646", "text": "function GenTokenParser(){}", "title": "" }, { "docid": "c55fb482a2a86618b27f26c96f11624d", "score": "0.53837377", "text": "function getToken (state) {\n state.tokenType = TOKENTYPE.NULL\n state.token = ''\n state.comment = ''\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' &&\n currentCharacter(state) !== '') {\n state.comment += currentCharacter(state)\n next(state)\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state)\n } else {\n break\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER\n return\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = currentCharacter(state)\n next(state)\n return\n }\n\n const c1 = currentCharacter(state)\n const c2 = currentString(state, 2)\n const c3 = currentString(state, 3)\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = c3\n next(state)\n next(state)\n next(state)\n return\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = c2\n next(state)\n next(state)\n return\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER\n state.token = c1\n next(state)\n return\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER\n\n // check for binary, octal, or hex\n const c2 = currentString(state, 2)\n if (c2 === '0b' || c2 === '0o' || c2 === '0x') {\n state.token += currentCharacter(state)\n next(state)\n state.token += currentCharacter(state)\n next(state)\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.'\n next(state)\n // get the digits after the radix\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i'\n next(state)\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n }\n return\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state)\n next(state)\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER\n return\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state)\n next(state)\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state)\n next(state)\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"')\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"')\n }\n } else if (nextCharacter(state) === '.') {\n next(state)\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"')\n }\n }\n\n return\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state)\n next(state)\n }\n\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER\n } else {\n state.tokenType = TOKENTYPE.SYMBOL\n }\n\n return\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state)\n next(state)\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"')\n }", "title": "" }, { "docid": "e7dd6aa8727804809f64227689557dbc", "score": "0.5373054", "text": "function lisp_tokenize(str)\n{\n var tokens = [];\n str = str.toString();\n var i = 0;\n while(i < str.length) {\n var c = str.charAt(i);\n if(c === ';') {\n while(c !== '\\n') {\n c = str.charAt(++i);\n }\n ++i;\n continue;\n }\n if(c === ' ') {\n ++i;\n continue;\n }\n if(c === '\\n') {\n tokens.push(c);\n ++i;\n continue;\n }\n if(c === '(' || c === ')') {\n tokens.push(c);\n ++i;\n continue;\n }\n\n // A string.\n if(c === '\"') {\n ++i;\n var start = i;\n var count = 0;\n c = str.charAt(i);\n while(c != '\"') {\n ++count;\n ++i;\n c = str.charAt(i);\n }\n tokens.push(str.substring(start, start + count));\n ++i;\n continue;\n }\n\n // A symbol or procedure name.\n var start = i;\n var count = 0;\n while(i < str.length && (c !== ' ' && c !== '\\n') && c !== '(' && c !== ')') {\n ++count;\n c = str.charAt(i++);\n }\n --count;\n --i;\n tokens.push(str.substring(start, start + count));\n }\n return tokens;\n}", "title": "" }, { "docid": "bd8dc88b9c47f62d8472600c253e004d", "score": "0.5361833", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c == ' ' || c == '\\t') { // space, tab\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n token_type = TOKENTYPE.UNKNOWN;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (c == '.') {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c == 'E' || c == 'e') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n // this is no legal number, exponent is missing.\n token_type = TOKENTYPE.UNKNOWN;\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (isAlpha(c)) {\n while (isAlpha(c) || isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS[token]) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n}", "title": "" }, { "docid": "bd8dc88b9c47f62d8472600c253e004d", "score": "0.5361833", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c == ' ' || c == '\\t') { // space, tab\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n token_type = TOKENTYPE.UNKNOWN;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (c == '.') {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c == 'E' || c == 'e') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n // this is no legal number, exponent is missing.\n token_type = TOKENTYPE.UNKNOWN;\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (isAlpha(c)) {\n while (isAlpha(c) || isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS[token]) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n}", "title": "" }, { "docid": "0afd060c44ffa2e2524b66eff5db1529", "score": "0.5359328", "text": "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "title": "" }, { "docid": "e9d403686a82acc8e8a3d202268689e8", "score": "0.5352543", "text": "tokenize(s) {\n let rs=[];\n while (s!=null && s.length > 0) {\n let pm=/^([\\(\\)])(.*)/.exec(s); \n if (pm != null) {\n rs.push(new Pren(pm[1]));\n s=pm[2];\n continue;\n }\n let nm=/^(-[0-9\\.]+)(.*)/.exec(s); // prefix - to a number?\n if (nm != null && (rs.length==0 || rs[rs.length-1].isA() == 'Verb')) {\n rs.push(new Noun(nm[1]));\n s=nm[2];\n continue;\n }\n\n nm=/^([0-9\\.]+)(.*)/.exec(s);\n if (nm != null) {\n rs.push(new Noun(nm[1]));\n s=nm[2];\n continue;\n }\n\n let m=/^([A-Za-z]+|.)(.*)/.exec(s);\n let sym=m[1].trim();\n if (sym.length > 0) {\n let v=Symbols[sym];\n if (v == undefined) this.ErrorList.push('Undefined: '+m[1]);\n rs.push(v);\n }\n s=m[2];\n }\n return rs;\n }", "title": "" }, { "docid": "1093e22b0fa8f6c46682b0550f2b53ff", "score": "0.53341794", "text": "nextToken() {\r\n this._eatWhitespace();\r\n \r\n if (this.pos >= this.str.length) {\r\n return {tokenType: TclTokenizer.TOKEN_TYPE_EOF};\r\n }\r\n var ch = this.str.charAt(this.pos);\r\n if (TclTokenizer.isWordChar(ch)) {\r\n return {tokenType: TclTokenizer.TOKEN_TYPE_WORD, value: this._extractWord()};\r\n } else if (ch === '{') {\r\n return {tokenType: TclTokenizer.TOKEN_TYPE_WORD, value: this._extractBracedWord()};\r\n } else {\r\n throw new TclError(\"Unexpected token '\" + ch + \"' at pos \" + this.pos + \".\");\r\n }\r\n }", "title": "" }, { "docid": "7e6c42539d532e32ff8f17cedd3d0cc4", "score": "0.5331761", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // get number, can have a single dot\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if ((0, _object.hasOwnProperty)(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "73486872bba76717770d6f8da1a86aee", "score": "0.53203326", "text": "nextToken() {\n if (this._input == null) {\n throw new Error(\"nextToken requires a non-null input stream.\");\n }\n // Mark start location in char stream so unbuffered streams are\n // guaranteed at least have text of current token\n let tokenStartMarker = this._input.mark();\n try {\n outer: while (true) {\n if (this._hitEOF) {\n return this.emitEOF();\n }\n this._token = undefined;\n this._channel = Token_1.Token.DEFAULT_CHANNEL;\n this._tokenStartCharIndex = this._input.index;\n this._tokenStartCharPositionInLine = this.interpreter.charPositionInLine;\n this._tokenStartLine = this.interpreter.line;\n this._text = undefined;\n do {\n this._type = Token_1.Token.INVALID_TYPE;\n //\t\t\t\tSystem.out.println(\"nextToken line \"+tokenStartLine+\" at \"+((char)input.LA(1))+\n //\t\t\t\t\t\t\t\t \" in mode \"+mode+\n //\t\t\t\t\t\t\t\t \" at index \"+input.index);\n let ttype;\n try {\n ttype = this.interpreter.match(this._input, this._mode);\n }\n catch (e) {\n if (e instanceof LexerNoViableAltException_1.LexerNoViableAltException) {\n this.notifyListeners(e); // report error\n this.recover(e);\n ttype = Lexer.SKIP;\n }\n else {\n throw e;\n }\n }\n if (this._input.LA(1) === IntStream_1.IntStream.EOF) {\n this._hitEOF = true;\n }\n if (this._type === Token_1.Token.INVALID_TYPE) {\n this._type = ttype;\n }\n if (this._type === Lexer.SKIP) {\n continue outer;\n }\n } while (this._type === Lexer.MORE);\n if (this._token == null) {\n return this.emit();\n }\n return this._token;\n }\n }\n finally {\n // make sure we release marker after match or\n // unbuffered char stream will keep buffering\n this._input.release(tokenStartMarker);\n }\n }", "title": "" }, { "docid": "c36f07e9d109ea814180d797efa27cb1", "score": "0.53082067", "text": "function tokenize_latex_math(input)\n{\n var result = [];\n var in_text_mode = 0;\n var brace_level = [];\n var pos = 0;\n\n/*\n if(input.charAt(0) == '$' &&\n input.charAt(input.length-1) == '$')\n input = input.slice(1, input.length-1);\n*/\n /*==========================================================================================================\n tokenize_re is a regular expression object containing pattern and applicable flags.\n\n Element zero of the array contains the entire match, while elements 1 – n contain any submatches\n that have occurred within the match.\n\n If the global flag is set for a regular expression, exec searches the string beginning at the position\n indicated by the value of lastIndex. If the global flag is not set, exec ignores the value of lastIndex\n and searches from the beginning of the string.\n\n The array returned by the exec method has three properties, input, index and lastIndex. The input property\n contains the entire searched string. The index property contains the position of the matched substring\n within the complete searched string.\n\n The lastIndex property contains the position following the last character in the match.\n ==========================================================================================================*/\n while(1) {\n if(!in_text_mode) {\n tokenize_re.lastIndex = pos; // start token search from current position\n var m = tokenize_re.exec(input); // store matched token into m\n pos = tokenize_re.lastIndex; // update current position of for the next search\n\n if(m == null)\n return result; // the only exit for the non-in_text_mode loop\n\n else if( m[1] != null) {\n result.push(m[1], m[2]);\n } else if(m[3] == '\\\\sp') {\n result.push('^');\n } else if(m[3] == '\\\\sb') {\n result.push('_');\n } else\n {\n// if(m[0] == '$') {\n// in_text_mode = 1;\n// } else\n if(m[4] != null) {\n continue;\n } else if(m[3] != null && m[3] in tokenize_text_commands) {\n in_text_mode = 2;\n brace_level.push(0);\n }\n\n result.push(m[0]); // store the current token\n }\n }\n else // in_text_mode:\n {\n tokenize_text_re.lastIndex = pos;\n var m = tokenize_text_re.exec(input);\n pos = tokenize_text_re.lastIndex;\n\n if(m == null) {\n return result;\n } else if(m[0] == '$') {\n in_text_mode = 0;\n } else if(m[0] == '{') {\n brace_level[brace_level.length-1]++;\n } else if(m[0] == '}') {\n if(--brace_level[brace_level.length-1] <= 0) {\n in_text_mode = 0;\n brace_level.pop();\n }\n }\n result.push(m[0]);\n }\n }\n}", "title": "" }, { "docid": "2dbec96d8c1706e4fd04935c2e380d32", "score": "0.5296988", "text": "function getToken() {\n\t token_type = TOKENTYPE.NULL;\n\t token = '';\n\n\t // skip over whitespaces\n\t while (c == ' ' || c == '\\t') { // space, tab\n\t // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n\t next();\n\t }\n\n\t // skip comment\n\t if (c == '#') {\n\t while (c != '\\n' && c != '') {\n\t next();\n\t }\n\t }\n\n\t // check for end of expression\n\t if (c == '') {\n\t // token is still empty\n\t token_type = TOKENTYPE.DELIMITER;\n\t return;\n\t }\n\n\t // check for delimiters consisting of 2 characters\n\t var c2 = c + nextPreview();\n\t if (DELIMITERS[c2]) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t token = c2;\n\t next();\n\t next();\n\t return;\n\t }\n\n\t // check for delimiters consisting of 1 character\n\t if (DELIMITERS[c]) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t token = c;\n\t next();\n\t return;\n\t }\n\n\t // check for a number\n\t if (isDigitDot(c)) {\n\t token_type = TOKENTYPE.NUMBER;\n\n\t // get number, can have a single dot\n\t if (c == '.') {\n\t token += c;\n\t next();\n\n\t if (!isDigit(c)) {\n\t // this is no legal number, it is just a dot\n\t token_type = TOKENTYPE.UNKNOWN;\n\t }\n\t }\n\t else {\n\t while (isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\t if (c == '.') {\n\t token += c;\n\t next();\n\t }\n\t }\n\t while (isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\n\t // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n\t if (c == 'E' || c == 'e') {\n\t token += c;\n\t next();\n\n\t if (c == '+' || c == '-') {\n\t token += c;\n\t next();\n\t }\n\n\t // Scientific notation MUST be followed by an exponent\n\t if (!isDigit(c)) {\n\t // this is no legal number, exponent is missing.\n\t token_type = TOKENTYPE.UNKNOWN;\n\t }\n\n\t while (isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\t }\n\n\t return;\n\t }\n\n\t // check for variables, functions, named operators\n\t if (isAlpha(c)) {\n\t while (isAlpha(c) || isDigit(c)) {\n\t token += c;\n\t next();\n\t }\n\n\t if (NAMED_DELIMITERS[token]) {\n\t token_type = TOKENTYPE.DELIMITER;\n\t }\n\t else {\n\t token_type = TOKENTYPE.SYMBOL;\n\t }\n\n\t return;\n\t }\n\n\t // something unknown is found, wrong characters -> a syntax error\n\t token_type = TOKENTYPE.UNKNOWN;\n\t while (c != '') {\n\t token += c;\n\t next();\n\t }\n\t throw createSyntaxError('Syntax error in part \"' + token + '\"');\n\t}", "title": "" }, { "docid": "6f8d8027a1718a9ee53f9d5234df4ad5", "score": "0.5293071", "text": "function Tokenizer(s, f, l, allowHTMLComments) {\n this.cursor = 0;\n this.source = String(s);\n this.tokens = [];\n this.tokenIndex = 0;\n this.lookahead = 0;\n this.scanNewlines = false;\n this.filename = f || \"\";\n this.lineno = l || 1;\n this.allowHTMLComments = allowHTMLComments;\n this.blockComments = null;\n}", "title": "" }, { "docid": "6b2e3700860d56db6b1ce610928eefcf", "score": "0.5285615", "text": "function tokenizer(source) {\r\n var parts = [];\r\n var position = 0;\r\n tagRegex.index = 0;\r\n var match;\r\n while ((match = tagRegex.exec(source))) {\r\n var index = match.index;\r\n match = match[0];\r\n if (index > position) { // Raw text was before this tag\r\n parts.push(source.substr(position, index - position));\r\n }\r\n position = index + match.length;\r\n\r\n // Create a token and tag the position in the source file for error reporting.\r\n var obj = {start: index, end: position};\r\n var i;\r\n\r\n if (match[1] === \"{\") { // Raw expression\r\n obj.name = match.substr(2, match.length - 4);\r\n } else if (match[1] === \"#\") { // Open tag\r\n obj.open = true;\r\n if (match[match.length - 2] === \")\") { // With arguments\r\n i = match.indexOf(\"(\");\r\n obj.name = match.substr(2, i - 2);\r\n obj.args = match.substr(i + 1, match.length - i - 3);\r\n } else { // Without arguments\r\n obj.name = match.substr(2, match.length - 3);\r\n }\r\n } else if (match[1] === \"/\") { // Close tag\r\n obj.close = true;\r\n obj.name = match.substr(2, match.length - 3);\r\n } else { // Normal tag\r\n if (match[match.length - 2] === \")\") { // With arguments\r\n i = match.indexOf(\"(\");\r\n obj.name = match.substr(1, i - 1);\r\n obj.args = match.substr(i + 1, match.length - i - 3);\r\n } else { // Without arguments\r\n obj.name = match.substr(1, match.length - 2);\r\n }\r\n }\r\n parts.push(obj);\r\n tagRegex.lastIndex = position;\r\n }\r\n if (source.length > position) { // There is raw text left over\r\n parts.push(source.substr(position));\r\n }\r\n return parts;\r\n }", "title": "" }, { "docid": "40a8f8647c973bec0abb799ee96bb1f0", "score": "0.52817136", "text": "function tokenizeExpression(expression){\n var index = 0;\n var tokenQueue = [];\n\n while(index<expression.length){\n var startChar = expression.charAt(index);\n // Three cases to consider. Simple symbol, number, and function name.\n if(isASimpleSymbol(startChar)){\n tokenQueue.push(startChar);\n index = index + 1;\n }else if(isANumber(startChar)){\n // Push the number starting at position index onto the queue.\n var numToPush = longestNumberFromPosition(index, expression);\n tokenQueue.push(numToPush);\n index = index + numToPush.length;\n }else{\n // Push the function name starting at position index onto the queue.\n var functionName = functionNameFromPosition(index, expression);\n tokenQueue.push(functionName);\n index = index + functionName.length;\n }\n }\n return tokenQueue;\n}", "title": "" }, { "docid": "06ef02c1ef2833fa6b19dee11e12fa96", "score": "0.52646744", "text": "function tokenize(remainder, tokens, buffer, getTokenType) {\n\tif (isTokenCharacter(remainder[0])) {\n\t\treturn tokenize(remainder.substring(1), tokens, (buffer || '') + remainder[0], getTokenType);\n\t} else {\n\t\tvar token = { type: getTokenType(buffer), text: buffer };\n\t\tif(remainder.length == 0) {\n\t\t\treturn (tokens || []).concat(token); \n\t\t} else {\n\t\t\treturn tokenize(remainder.substring(1), (tokens || []).concat(token), null, getTokenType);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b3f0e8500731bfa60e2af6b7431ef016", "score": "0.5249094", "text": "function HeaderTokenizer() {\n // Call the Stream.Transform constructor\n Stream.Transform.call(this);\n\n // Initialize state\n this.state = this.states.FIELD_NAME;\n this.currentToken = {type: 'field_name', value: \"\"};\n\n // If someone attaches a new event listener for the 'done' event after\n // we are already in the DONE state, then just re-fire the event.\n this.on('newListener', function(name, listener) {\n if (name === 'done' && this.state === this.states.DONE) {\n listener();\n }\n });\n}", "title": "" }, { "docid": "299c1ef56b33601aaeeb48303d6f1e35", "score": "0.52293456", "text": "function factory(type) {\n\t return tokenize;\n\n\t /* Tokenizer for a bound `type`. */\n\t function tokenize(value, location) {\n\t var self = this;\n\t var offset = self.offset;\n\t var tokens = [];\n\t var methods = self[type + 'Methods'];\n\t var tokenizers = self[type + 'Tokenizers'];\n\t var line = location.line;\n\t var column = location.column;\n\t var index;\n\t var length;\n\t var method;\n\t var name;\n\t var matched;\n\t var valueLength;\n\n\t /* Trim white space only lines. */\n\t if (!value) {\n\t return tokens;\n\t }\n\n\t /* Expose on `eat`. */\n\t eat.now = now;\n\t eat.file = self.file;\n\n\t /* Sync initial offset. */\n\t updatePosition('');\n\n\t /* Iterate over `value`, and iterate over all\n\t * tokenizers. When one eats something, re-iterate\n\t * with the remaining value. If no tokenizer eats,\n\t * something failed (should not happen) and an\n\t * exception is thrown. */\n\t while (value) {\n\t index = -1;\n\t length = methods.length;\n\t matched = false;\n\n\t while (++index < length) {\n\t name = methods[index];\n\t method = tokenizers[name];\n\n\t if (\n\t method &&\n\t (!method.onlyAtStart || self.atStart) &&\n\t (!method.notInList || !self.inList) &&\n\t (!method.notInBlock || !self.inBlock) &&\n\t (!method.notInLink || !self.inLink)\n\t ) {\n\t valueLength = value.length;\n\n\t method.apply(self, [eat, value]);\n\n\t matched = valueLength !== value.length;\n\n\t if (matched) {\n\t break;\n\t }\n\t }\n\t }\n\n\t /* istanbul ignore if */\n\t if (!matched) {\n\t self.file.fail(new Error('Infinite loop'), eat.now());\n\t }\n\t }\n\n\t self.eof = now();\n\n\t return tokens;\n\n\t /**\n\t * Update line, column, and offset based on\n\t * `value`.\n\t *\n\t * @example\n\t * updatePosition('foo');\n\t *\n\t * @param {string} subvalue - Subvalue to eat.\n\t */\n\t function updatePosition(subvalue) {\n\t var lastIndex = -1;\n\t var index = subvalue.indexOf('\\n');\n\n\t while (index !== -1) {\n\t line++;\n\t lastIndex = index;\n\t index = subvalue.indexOf('\\n', index + 1);\n\t }\n\n\t if (lastIndex === -1) {\n\t column += subvalue.length;\n\t } else {\n\t column = subvalue.length - lastIndex;\n\t }\n\n\t if (line in offset) {\n\t if (lastIndex !== -1) {\n\t column += offset[line];\n\t } else if (column <= offset[line]) {\n\t column = offset[line] + 1;\n\t }\n\t }\n\t }\n\n\t /**\n\t * Get offset. Called before the first character is\n\t * eaten to retrieve the range's offsets.\n\t *\n\t * @return {Function} - `done`, to be called when\n\t * the last character is eaten.\n\t */\n\t function getOffset() {\n\t var indentation = [];\n\t var pos = line + 1;\n\n\t /**\n\t * Done. Called when the last character is\n\t * eaten to retrieve the range’s offsets.\n\t *\n\t * @return {Array.<number>} - Offset.\n\t */\n\t return function () {\n\t var last = line + 1;\n\n\t while (pos < last) {\n\t indentation.push((offset[pos] || 0) + 1);\n\n\t pos++;\n\t }\n\n\t return indentation;\n\t };\n\t }\n\n\t /**\n\t * Get the current position.\n\t *\n\t * @example\n\t * position = now(); // {line: 1, column: 1, offset: 0}\n\t *\n\t * @return {Object} - Current Position.\n\t */\n\t function now() {\n\t var pos = {line: line, column: column};\n\n\t pos.offset = self.toOffset(pos);\n\n\t return pos;\n\t }\n\n\t /**\n\t * Store position information for a node.\n\t *\n\t * @example\n\t * start = now();\n\t * updatePosition('foo');\n\t * location = new Position(start);\n\t * // {\n\t * // start: {line: 1, column: 1, offset: 0},\n\t * // end: {line: 1, column: 3, offset: 2}\n\t * // }\n\t *\n\t * @param {Object} start - Starting position.\n\t */\n\t function Position(start) {\n\t this.start = start;\n\t this.end = now();\n\t }\n\n\t /**\n\t * Throw when a value is incorrectly eaten.\n\t * This shouldn’t happen but will throw on new,\n\t * incorrect rules.\n\t *\n\t * @example\n\t * // When the current value is set to `foo bar`.\n\t * validateEat('foo');\n\t * eat('foo');\n\t *\n\t * validateEat('bar');\n\t * // throws, because the space is not eaten.\n\t *\n\t * @param {string} subvalue - Value to be eaten.\n\t * @throws {Error} - When `subvalue` cannot be eaten.\n\t */\n\t function validateEat(subvalue) {\n\t /* istanbul ignore if */\n\t if (value.substring(0, subvalue.length) !== subvalue) {\n\t /* Capture stack-trace. */\n\t self.file.fail(\n\t new Error(\n\t 'Incorrectly eaten value: please report this ' +\n\t 'warning on http://git.io/vg5Ft'\n\t ),\n\t now()\n\t );\n\t }\n\t }\n\n\t /**\n\t * Mark position and patch `node.position`.\n\t *\n\t * @example\n\t * var update = position();\n\t * updatePosition('foo');\n\t * update({});\n\t * // {\n\t * // position: {\n\t * // start: {line: 1, column: 1, offset: 0},\n\t * // end: {line: 1, column: 3, offset: 2}\n\t * // }\n\t * // }\n\t *\n\t * @returns {Function} - Updater.\n\t */\n\t function position() {\n\t var before = now();\n\n\t return update;\n\n\t /**\n\t * Add the position to a node.\n\t *\n\t * @example\n\t * update({type: 'text', value: 'foo'});\n\t *\n\t * @param {Node} node - Node to attach position\n\t * on.\n\t * @param {Array} [indent] - Indentation for\n\t * `node`.\n\t * @return {Node} - `node`.\n\t */\n\t function update(node, indent) {\n\t var prev = node.position;\n\t var start = prev ? prev.start : before;\n\t var combined = [];\n\t var n = prev && prev.end.line;\n\t var l = before.line;\n\n\t node.position = new Position(start);\n\n\t /* If there was already a `position`, this\n\t * node was merged. Fixing `start` wasn’t\n\t * hard, but the indent is different.\n\t * Especially because some information, the\n\t * indent between `n` and `l` wasn’t\n\t * tracked. Luckily, that space is\n\t * (should be?) empty, so we can safely\n\t * check for it now. */\n\t if (prev && indent && prev.indent) {\n\t combined = prev.indent;\n\n\t if (n < l) {\n\t while (++n < l) {\n\t combined.push((offset[n] || 0) + 1);\n\t }\n\n\t combined.push(before.column);\n\t }\n\n\t indent = combined.concat(indent);\n\t }\n\n\t node.position.indent = indent || [];\n\n\t return node;\n\t }\n\t }\n\n\t /**\n\t * Add `node` to `parent`s children or to `tokens`.\n\t * Performs merges where possible.\n\t *\n\t * @example\n\t * add({});\n\t *\n\t * add({}, {children: []});\n\t *\n\t * @param {Object} node - Node to add.\n\t * @param {Object} [parent] - Parent to insert into.\n\t * @return {Object} - Added or merged into node.\n\t */\n\t function add(node, parent) {\n\t var children = parent ? parent.children : tokens;\n\t var prev = children[children.length - 1];\n\n\t if (\n\t prev &&\n\t node.type === prev.type &&\n\t node.type in MERGEABLE_NODES &&\n\t mergeable(prev) &&\n\t mergeable(node)\n\t ) {\n\t node = MERGEABLE_NODES[node.type].call(self, prev, node);\n\t }\n\n\t if (node !== prev) {\n\t children.push(node);\n\t }\n\n\t if (self.atStart && tokens.length !== 0) {\n\t self.exitStart();\n\t }\n\n\t return node;\n\t }\n\n\t /**\n\t * Remove `subvalue` from `value`.\n\t * `subvalue` must be at the start of `value`.\n\t *\n\t * @example\n\t * eat('foo')({type: 'text', value: 'foo'});\n\t *\n\t * @param {string} subvalue - Removed from `value`,\n\t * and passed to `updatePosition`.\n\t * @return {Function} - Wrapper around `add`, which\n\t * also adds `position` to node.\n\t */\n\t function eat(subvalue) {\n\t var indent = getOffset();\n\t var pos = position();\n\t var current = now();\n\n\t validateEat(subvalue);\n\n\t apply.reset = reset;\n\t reset.test = test;\n\t apply.test = test;\n\n\t value = value.substring(subvalue.length);\n\n\t updatePosition(subvalue);\n\n\t indent = indent();\n\n\t return apply;\n\n\t /**\n\t * Add the given arguments, add `position` to\n\t * the returned node, and return the node.\n\t *\n\t * @param {Object} node - Node to add.\n\t * @param {Object} [parent] - Node to insert into.\n\t * @return {Node} - Added node.\n\t */\n\t function apply(node, parent) {\n\t return pos(add(pos(node), parent), indent);\n\t }\n\n\t /**\n\t * Functions just like apply, but resets the\n\t * content: the line and column are reversed,\n\t * and the eaten value is re-added.\n\t *\n\t * This is useful for nodes with a single\n\t * type of content, such as lists and tables.\n\t *\n\t * See `apply` above for what parameters are\n\t * expected.\n\t *\n\t * @return {Node} - Added node.\n\t */\n\t function reset() {\n\t var node = apply.apply(null, arguments);\n\n\t line = current.line;\n\t column = current.column;\n\t value = subvalue + value;\n\n\t return node;\n\t }\n\n\t /**\n\t * Test the position, after eating, and reverse\n\t * to a not-eaten state.\n\t *\n\t * @return {Position} - Position after eating `subvalue`.\n\t */\n\t function test() {\n\t var result = pos({});\n\n\t line = current.line;\n\t column = current.column;\n\t value = subvalue + value;\n\n\t return result.position;\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "f8a2cf8c6d7865a4f7111d7d8da43e3a", "score": "0.52288014", "text": "function parseFormula() {\n\n var listOfVariables = data.getSection('listOfVariables');\n var formulaString = data.getSection('modelFormula').model;\n console.log(listOfVariables, formulaString);\n\n if (!formulaString || typeof formulaString != 'string') return;\n\n /* ------ Initialize Variables ------ */\n\n // splits the formula into terms\n var terms = formulaString.split(/\\s*[~]\\s*/)[1].split(/\\s*[+]\\s*/);\n\n // retrieves only variable names\n var variables = listOfVariables.model.map(function(variable) {\n return variable.name;\n });\n\n // an array of formula terms representing the formula model\n var formula = [];\n\n // an array of strings representing linear terms\n var linearTerms = [];\n\n // an array of strings representing interaction terms\n var interactionTerms = {};\n\n\n /* ------ Build Model ------ */\n\n // attempt to split each term to determine if it's linear\n terms.forEach(function(term) {\n var splitTerm = term.split(/\\s*[*]\\s*/);\n\n // if this term is linear, add it to the array of linear terms\n if (splitTerm.length == 1) {\n linearTerms.push(removeFactor(term));\n }\n\n // else, this is an interaction term - add it to the array of interaction terms\n else {\n var name = removeFactor(splitTerm[0]);\n var interaction = removeFactor(splitTerm[1]);\n\n // if there was not a previously existing interaction term, create a new array\n if (interactionTerms[name] == null) {\n interactionTerms[name] = [];\n }\n\n interactionTerms[name].push(interaction);\n };\n });\n\n // create the formula model\n // using the list of variable names as keys to look up the properties for each term\n variables.forEach(function(term) {\n formula.push({\n 'name': term,\n 'linear': linearTerms.indexOf(term) != -1,\n 'interaction': interactionTerms[term] || null\n });\n });\n\n return formula;\n }", "title": "" }, { "docid": "da75af1efca742cc0a62e4a0820c5dd7", "score": "0.52275234", "text": "function tokenize(content){if(!content.endsWith('\\n')){content+='\\n';}//Not the full list of tokens; namely, brackets aren't in this list.\n//Sorted by longest first, for greediness.\nvar tokens=[\"==\",\"!=\",\"<=\",\">=\",\"+=\",\"-=\",\"*=\",\"/=\",\"%=\",\"**=\",\"<\",\">\",\"=\",\"+\",\"-\",\",\",\"/\",\"%\",\"**\",\"*\",\".\",\":\",\";\",\"\\\\\"];var result=[];macros=[];//var isInString = false;\nvar bracketsLevel=0;var currentLine={};fileStack=[{\"name\":\"<main>\",\"currentLineNb\":1,\"currentColNb\":1,\"remainingChars\":content.length+1//does not matter\n}];var i=0;function addToken(text){if(text.length===0){error(\"Token is empty, lexer broke\");}//debug(\"Adding token '\"+text+\"' at \"+currentLineNb+\":\"+currentColNb);\ncurrentLine.tokens.push(new Token(text,getFileStackCopy()));moveCursor(text.length-1);}//Length = length of the macro resolution\n//callCols, callLines = how many cols/lines the macro CALL takes\n//callNbChars = how many characters the macro call takes\n//Name: used in stack trace, should be macro name or file name\n//startingCol, startingLine: the col/line of the macro start in the file it is declared\nfunction addFile(length,callNbChars,callCols,callLines,name,startingCol,startingLine){fileStack.push({name:name,remainingChars:length,callNbChars:callNbChars,callCols:callCols,callLines:callLines,currentLineNb:0+startingLine,currentColNb:0+startingCol});//console.log(JSON.stringify(fileStack));\n}function newLogicalLine(){if(currentLine.tokens!==undefined&&currentLine.tokens.length>0){result.push(currentLine);}currentLine=new LogicalLine();}newLogicalLine();function moveCursor(amount){for(var j=0;j<amount;j++){if(fileStack[fileStack.length-1].remainingChars>0){fileStack[fileStack.length-1].remainingChars--;if(fileStack[fileStack.length-1].remainingChars===0){//debug(\"macro lines = \"+macroLines+\", macro cols = \"+macroCols);\nfileStack[fileStack.length-2].currentLineNb+=fileStack[fileStack.length-1].callLines;fileStack[fileStack.length-2].currentColNb+=fileStack[fileStack.length-1].callLines-1;fileStack[fileStack.length-2].remainingChars-=fileStack[fileStack.length-1].callNbChars;fileStack.pop();}}fileStack[fileStack.length-1].currentColNb++;if(content[i+j]===\"\\n\"){fileStack[fileStack.length-1].currentLineNb++;fileStack[fileStack.length-1].currentColNb=1;}}i+=amount;}function parsePreprocessingDirective(content){debug(\"Parsing preprocessing directive '\"+content+\"'\");if(content.startsWith(\"#!define \")||content.startsWith(\"#!defineMember \")){macros.push(parseMacro({fileStack:getFileStackCopy(),content:content}));}else if(content.startsWith(\"#!mainFile \")){//we must ignore this preprocessor directive\n}else if(content.startsWith(\"#!obfuscate\")){obfuscationSettings={obfuscateNames:true,obfuscateStrings:true,obfuscateConstants:true,obfuscateInspector:true,ruleFilling:true,copyProtection:true};var disabledObfuscationTechniques=content.substring(\"#!obfuscate\".length).trim().split(\" \").map(function(x){return x.trim();});var _iteratorNormalCompletion32=true;var _didIteratorError32=false;var _iteratorError32=undefined;try{for(var _iterator32=disabledObfuscationTechniques[Symbol.iterator](),_step32;!(_iteratorNormalCompletion32=(_step32=_iterator32.next()).done);_iteratorNormalCompletion32=true){var tech=_step32.value;if(tech===\"noNameObfuscation\"){obfuscationSettings.obfuscateNames=false;}else if(tech===\"noStringObfuscation\"){obfuscationSettings.obfuscateStrings=false;}else if(tech===\"noConstantObfuscation\"){obfuscationSettings.obfuscateConstants=false;}else if(tech===\"noInspectorObfuscation\"){obfuscationSettings.obfuscateInspector=false;}else if(tech===\"noRuleFilling\"){obfuscationSettings.ruleFilling=false;}else if(tech===\"noCopyProtection\"){obfuscationSettings.copyProtection=false;}else if(tech!==\"\"){error(\"Unknown obfuscation setting '\"+tech+\"', valid ones are: \"+Object.keys(obfuscationSettings).map(function(x){return\"no\"+x[0].toUpperCase()+x.slice(1);}).join(\", \"));}}}catch(err){_didIteratorError32=true;_iteratorError32=err;}finally{try{if(!_iteratorNormalCompletion32&&_iterator32[\"return\"]!=null){_iterator32[\"return\"]();}}finally{if(_didIteratorError32){throw _iteratorError32;}}}}else if(content.startsWith(\"#!disableOptimizations\")){enableOptimization=false;}else if(content.startsWith(\"#!suppressWarnings \")){var _globalSuppressedWarn;var firstSpaceIndex=content.indexOf(\" \");(_globalSuppressedWarn=globalSuppressedWarnings).push.apply(_globalSuppressedWarn,_toConsumableArray(content.substring(firstSpaceIndex).trim().split(\" \").map(function(x){return x.trim();})));}else{error(\"Unknown preprocessor directive '\"+content+\"'\");}}for(i=0;i<content.length;moveCursor(1)){//console.log(JSON.stringify(fileStack));\nif(content[i]==='\\n'){//Only end the logical line if the newline is not within brackets.\nif(bracketsLevel===0){newLogicalLine();}}else{if(content[i]===\"\\t\"){if(currentLine.tokens.length===0){currentLine.indentLevel+=4;}}else if(content[i]===' '){//increase indentation if no token yet; else, do nothing\nif(currentLine.tokens.length===0){currentLine.indentLevel++;}}else if(content[i]==='\\r'){//do nothing\n}else if(content[i]==='\\\\'){var j=i+1;for(;j<content.length;j++){if(content[j]===\"\\n\"){break;}else if(content[j]!==\" \"&&content[j]!==\"\\r\"){error(\"A backslash can only be put at the end of a line\");}}//j++;\nmoveCursor(j-i-1+\"\\n\".length);}else if(content[i]==='('||content[i]==='['||content[i]==='{'){bracketsLevel++;addToken(content[i]);}else if(content[i]===')'||content[i]===']'||content[i]==='}'){bracketsLevel--;if(bracketsLevel<0){error(\"Brackets level below 0 (extraneous closing bracket)\");}addToken(content[i]);}else if(content.startsWith(\"#!\",i)){var j=i;var isBackslashed=false;var preprocessingDirectiveContent=\"\";for(;j<content.length;j++){if(content[j]===\"\\\\\"){isBackslashed=true;//preprocessingDirectiveContent += content[j];\n}else if(!isBackslashed&&content[j]===\"\\n\"){break;}else if(content[j]!==\" \"&&content[j]!==\"\\r\"){isBackslashed=false;preprocessingDirectiveContent+=content[j];}else{preprocessingDirectiveContent+=content[j];}}if(preprocessingDirectiveContent.startsWith(\"#!include \")){var space=preprocessingDirectiveContent.indexOf(\" \");var path=getFilePath(preprocessingDirectiveContent.substring(space));var importedFileContent=getFileContent(path);content=content.substring(0,i)+importedFileContent+content.substring(i+preprocessingDirectiveContent.length);addFile(importedFileContent.length,preprocessingDirectiveContent.length-i,preprocessingDirectiveContent.length-i,0,getFilenameFromPath(path),0,1);i--;fileStack[fileStack.length-1].remainingChars++;}else{parsePreprocessingDirective(preprocessingDirectiveContent);moveCursor(j-i-1);}}else if(content[i]==='#'){//Get to the end of the comment. Note: backslashes don't work to continue a line comment.\nvar j=i+1;for(;j<content.length&&content[j]!==\"\\n\";j++){;}//To facilitate parsing, do not add the comment if it is in parentheses, as it won't be used for action comments.\nif(bracketsLevel!==0){moveCursor(j-i-1);}else{addToken(content.substring(i,j));}}else if(content.startsWith(\"/*\",i)){//Get to the end of the multiline comment\nvar j=i+\"/*\".length;var foundEndOfComment=false;for(;j<content.length;j++){if(content.startsWith(\"*/\",j)){foundEndOfComment=true;break;}};if(!foundEndOfComment){error(\"Multiline comment isn't terminated (found end of file while searching for end of comment)\");}j+=\"*/\".length;moveCursor(j-i-1);}else if(content.startsWith(\"*/\",i)){//All ends should be found when a multiline comment start is found.\nerror(\"Found end of multiline comment, but no matching beginning\");}else if(content[i]==='\"'||content[i]===\"'\"){var strDelimiter=content[i];var foundEndOfString=false;var isBackslashed=false;//Get to the end of the string\nvar j=i+1;for(;j<content.length;j++){if(!isBackslashed&&content[j]===strDelimiter){foundEndOfString=true;break;}if(content[j]==='\\\\'&&!isBackslashed){isBackslashed=true;}else{isBackslashed=false;}}if(!foundEndOfString){error(\"String isn't terminated (found end of file while searching for end of string)\");}j+=strDelimiter.length;//account for closing delimiter\naddToken(content.substring(i,j));}else{//Get token\nvar j=i;//Increases j as long as there are characters that can compose a word\nfor(;j<content.length&&isVarChar(content[j]);j++){;}//If j > i, then there was a word, instead of an operator\nif(j>i){var macroWasFound=false;//Test each macro\nfor(var k=0;k<macros.length;k++){if(content.substring(i,j)===macros[k].name){var text;var replacement;var macroCols=0;var macroLines=0;if(macros[k].isFunction){//debug(\"Resolving function macro \"+macros[k].name);\nvar bracketPos=getBracketPositions(content.substring(i),true,true);text=content.substring(i,i+bracketPos[1]+1);var macroArgs=getArgs(content.substring(i+bracketPos[0]+1,i+bracketPos[1]));replacement=resolveMacro(macros[k],macroArgs,currentLine.indentLevel);}else{//debug(\"Resolving normal macro \"+macros[k].name);\ntext=macros[k].name;//replacement = macros[k].replacement;\nreplacement=resolveMacro(macros[k],[],currentLine.indentLevel);}content=content.substring(0,i)+replacement+content.substring(i+text.length);if(text.indexOf('\\n')>=0){macroCols=text.length-text.lastIndexOf('\\n');macroLines=text.split('\\n').length-1;}else{macroCols=text.length;}if(replacement===undefined){error(\"Replacement is undefined\");}addFile(replacement.length,text.length,macroCols,macroLines,macros[k].name,macros[k].startingCol,macros[k].fileStack[macros[k].fileStack.length-1].currentLineNb);//debug(\"Text: \"+text);\n//debug(\"Replacement: \"+replacement);\nk=0;i--;fileStack[fileStack.length-1].remainingChars++;macroWasFound=true;}}if(!macroWasFound){//Handle the special case of min= and max= operators\nif((content.substring(i,j)===\"min\"||content.substring(i,j)===\"max\")&&content[i+\"min\".length]==='='){j++;}addToken(content.substring(i,j));}}else{var hasTokenBeenFound=false;//Test each remaining token\nfor(var h=0;h<tokens.length;h++){if(content.startsWith(tokens[h],i)){addToken(content.substring(i,i+tokens[h].length));hasTokenBeenFound=true;break;}}if(!hasTokenBeenFound){error(\"Unknown token '\"+content[i]+\"'\");}}}}}if(bracketsLevel>0){error(\"Found end of file, but a bracket isn't closed\");}if(DEBUG_MODE){//console.log(\"macros = \");\n//console.log(macros);\n//console.log(rules);\nconsole.log(result.join(\"\\n\"));//console.log(result);\n}return result;}", "title": "" }, { "docid": "ee53bbe428655c72a7eda29fd3825dc8", "score": "0.5225928", "text": "function stringToTokens(input) {\n // Define the shape of tokens to look for.\n // We're using regexps for this because they're good/quick for simple\n // tokenizers; this isn't how all compilers are written. :'D\n const tokenizerRules = [\n {\n regex: /\\(/,\n token: \"parenOpen\"\n },\n {\n regex: /\\)/,\n token: \"parenClose\"\n },\n {\n regex: /,/,\n token: \"comma\"\n },\n {\n regex: /;/,\n token: \"semicolon\"\n },\n {\n regex: /([0-9])+/,\n token: \"literalNumber\"\n },\n {\n // This (...) business is to \"capture\" a chunk of text.\n // We didn't care about this for parenOpen, but we want\n // to keep what the identifier text is.\n regex: /([a-z][a-zA-Z0-9]*)/,\n token: \"identifier\"\n },\n ];\n\n // A function that attempts to figure out what the next chunk\n // of the code is. It looks through the above rules, and tries\n // each in sequence; if no rules match, it has a whinge.\n function getNextToken(input) {\n for (let i = 0; i < tokenizerRules.length; i++) {\n const rule = tokenizerRules[i];\n const matches = input.match(\n new RegExp(`^${rule.regex.source}`)\n );\n if (matches !== null) {\n return {\n remaining: input.slice(matches[0].length),\n newToken: {\n // Which rule did we match? eg. parenOpen\n type: rule.token,\n // If we captured something, store it:\n capture: matches[1]\n }\n };\n }\n }\n throw new Error(`Unrecognised input: ${input}`);\n }\n\n // Go!\n // We're cheating here by just flat-out ignoring whitespace: both\n // at the beginning (trimLeft), and on every loop.\n // A lot of languages can mostly ignore it, but you can't do this\n // for, say, Python or Ruby.\n let tokens = [];\n let remaining = input.trimLeft();\n while (remaining.length > 0) {\n const result = getNextToken(remaining);\n remaining = result.remaining.trim();\n tokens.push(result.newToken);\n }\n return tokens;\n}", "title": "" }, { "docid": "59e6a4e5f8cdf0eabd8324f5519a8b42", "score": "0.52203155", "text": "function CMCTokenizer()\n{\n // Private member variables\n \n var mOriginalString = \"\";\n var mPos = -1;\n var mTokens = new Array();\n \n // Public member functions\n \n this.Tokenize = function( str )\n {\n var token = null;\n \n mOriginalString = str;\n mPos = -1;\n \n for ( var i = 0; token = ReadNextToken(); i++ )\n {\n mTokens[i] = token;\n }\n \n return mTokens;\n }\n \n // Private member functions\n \n function IsNameChar( c )\n {\n if ( !c ) { return false; }\n else if ( c == \"\\\"\" ) { return false; }\n else if ( c == \"+\" ) { return false; }\n else if ( c == \"^\" ) { return false; }\n else if ( c == \"|\" ) { return false; }\n else if ( c == \"&\" ) { return false; }\n else if ( c == \"(\" ) { return false; }\n else if ( c == \")\" ) { return false; }\n else if ( IsWhiteSpace( c ) ) { return false; }\n else { return true; }\n }\n \n function IsWhiteSpace( c )\n {\n if ( !c )\n {\n\t\t\treturn false;\n\t\t}\n else if ( c == \" \" )\n {\n\t\t\treturn true;\n\t\t}\n else if ( c.charCodeAt( 0 ) == 12288 )\n {\n\t\t\treturn true;\n\t\t}\n else\n {\n\t\t\treturn false;\n }\n }\n \n function Peek()\n {\n return mOriginalString.charAt( mPos + 1 );\n }\n \n function Read()\n {\n mPos++;\n }\n \n function ReadString()\n {\n var str = \"\";\n \n for ( ; ; )\n {\n var c = Peek();\n \n if ( !c )\n {\n return (str == \"\") ? null : str;\n }\n \n if ( c == \"\\\\\" )\n {\n Read();\n \n if ( !Peek() )\n {\n return null;\n }\n \n Read();\n \n continue;\n }\n \n if ( c == \"\\\"\" )\n {\n Read();\n \n break;\n }\n else\n {\n Read();\n str += c;\n }\n }\n \n return str;\n }\n \n function ReadNextToken()\n {\n var c = Peek();\n var token = null;\n var tokenText = \"\";\n \n if ( !c )\n {\n token = null;\n }\n else if ( IsWhiteSpace( c ) )\n {\n for ( c = Peek(); IsWhiteSpace( c ); c = Peek() )\n {\n Read();\n tokenText += c;\n }\n \n token = new CMCToken( tokenText, CMCToken.WhiteSpace );\n }\n else if ( c == \"(\" )\n {\n Read();\n token = new CMCToken( c, CMCToken.LeftParen );\n }\n else if ( c == \")\" )\n {\n Read();\n token = new CMCToken( c, CMCToken.RightParen );\n }\n else if ( c == \"^\" )\n {\n Read();\n token = new CMCToken( c, CMCToken.Subtract );\n }\n else if ( c == \"+\" || c == \"&\" )\n {\n Read();\n token = new CMCToken( c, CMCToken.And );\n }\n else if ( c == \"|\" )\n {\n Read();\n token = new CMCToken( c, CMCToken.Or );\n }\n else if ( c == \"!\" )\n {\n Read();\n token = new CMCToken( c, CMCToken.Not );\n }\n else if ( c == \"\\\"\" )\n {\n Read();\n\n var str = ReadString();\n\n if (str.Contains(gConnectors))\n {\n str = str.replace(gConnectorRegex, \" \");\n str = str.Trim();\n }\n \n token = new CMCToken( str, (str == null) ? CMCToken.Error : CMCToken.Phrase );\n }\n else\n {\n for ( c = Peek(); IsNameChar( c ); c = Peek() )\n {\n Read();\n tokenText += c;\n }\n \n if ( tokenText == \"and\" || tokenText == \"AND\" )\n {\n token = new CMCToken( tokenText, CMCToken.And );\n }\n else if ( tokenText == \"or\" || tokenText == \"OR\" )\n {\n token = new CMCToken( tokenText, CMCToken.Or );\n }\n else if ( tokenText == \"not\" || tokenText == \"NOT\" )\n {\n token = new CMCToken( tokenText, CMCToken.Not );\n }\n else\n {\n\t\t\t\tvar tokenType\t= CMCToken.Word;\n\t\t\t\t\n\t\t\t\tif ( gSearchDBs[0].SearchType == \"NGram\" )\n\t\t\t\t{\n\t\t\t\t\ttokenType = CMCToken.Phrase;\n\t\t\t\t}\n\n\t if (tokenText.Contains(gConnectors))\n\t\t\t\t{\n\t\t\t\t tokenText = tokenText.replace(gConnectorRegex, \" \");\n\t\t\t\t tokenText = tokenText.Trim();\n\t\t\t\t token = new CMCToken(tokenText, CMCToken.Phrase);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t token = new CMCToken(tokenText, tokenType);\n\t\t\t\t}\n }\n }\n \n return token;\n }\n}", "title": "" }, { "docid": "0d2038605495a33803b26efa8efca1ae", "score": "0.52125764", "text": "function tokenizeText() {\n registerContextChecker.call(this, 'latinWord');\n registerContextChecker.call(this, 'arabicWord');\n registerContextChecker.call(this, 'arabicSentence');\n return this.tokenizer.tokenize(this.text);\n}", "title": "" }, { "docid": "0fe004a0864149c250f201534ab5bea3", "score": "0.5205905", "text": "function tokenize (emmetString) {\n // Handle text spaces later\n var tokens = emmetString.split(' ');\n for (var i = 0; i < tokens.length; i++) {\n if (tokens[i].includes('{')) {\n // console.log(`Found starting token ${tokens[i]}`);\n while (tokens.length > i + 1 &&\n !tokens[i].includes('}') &&\n !tokens[i+1].includes('}')) {\n // console.log(`Joining next token ${tokens[i+1]}`);\n tokens[i] = `${tokens[i]} ${tokens.splice(i+1, 1)[0].trim()}`;\n // console.log(`Updated text token ${tokens[i]}`);\n }\n if (tokens.length > i + 1 && !tokens[i].includes('}')) {\n // Add the last } token\n // console.log(`Joining last token ${tokens[i+1]}`);\n tokens[i] = `${tokens[i]} ${tokens.splice(i+1, 1)[0].trim()}`;\n }\n tokens[i] = tokens[i].trim();\n }\n }\n return tokens;\n}", "title": "" }, { "docid": "4dedd1b550350ab787d09014418fe6c1", "score": "0.52053", "text": "function fromBuffer(buffer) {\n return new BufferTokenizer_1.BufferTokenizer(buffer);\n}", "title": "" }, { "docid": "e4acb7dac9ab4027525421dd29b5311e", "score": "0.5200908", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n apply.test = reset.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" } ]
fcf851b08dfdb9339ee201b03b66c036
get value from owl namespace
[ { "docid": "377c559fc3f16398281eb3cd1b963406", "score": "0.6386421", "text": "function Get(element, name) {\n\t\treturn (Exists(element, name) ? element.owlP[name] : null);\n\t}", "title": "" } ]
[ { "docid": "3f87dc506e26ead8af687dc4741fe438", "score": "0.64669865", "text": "function getXMPValue(dom, ns, property)\r\n {\r\n var el = dom.getElementsByTagNameNS(ns, property);\r\n if(el.length && el[0].hasChildNodes())\r\n return el[0].firstChild.nodeValue;\r\n\r\n var list = dom.getElementsByTagNameNS(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\", \"Description\");\r\n var val = \"\";\r\n\r\n for(var i = 0; i < list.length; i++)\r\n {\r\n var attr = list[i].getAttributeNS(ns, property);\r\n if(attr)\r\n return attr;\r\n }\r\n }", "title": "" }, { "docid": "b879790ec38548abb1fec1be4b6d5bad", "score": "0.5710782", "text": "function getValue(id) {\r\n return ns4? getElement(id).document : getElement(id).firstChild.nodeValue;\r\n}", "title": "" }, { "docid": "40d81528c20e88c4944aea7591ff3333", "score": "0.56697273", "text": "getValue(o) {\n return _.getValue(this.element, {\n config: this.config,\n attribute: this.attribute,\n datatype: this.datatype\n });\n }", "title": "" }, { "docid": "381acf613ecc2cde9e2cfa736e286a08", "score": "0.55399173", "text": "get terms() { return namespace(this).terms; }", "title": "" }, { "docid": "967cd288c453762b49127a24c6ccb165", "score": "0.54917026", "text": "val(identifier){\n\n return document.get(identifier).value;\n\n }", "title": "" }, { "docid": "b14445554f3408f8046c287c692be7a4", "score": "0.5400662", "text": "get name() { return namespace(this).name; }", "title": "" }, { "docid": "c013b26ef62ed6d3e2c9684899662bfc", "score": "0.5392113", "text": "function value (domObj) {\n return extractValue (domObj);\n}", "title": "" }, { "docid": "cdb38b4827b374bf06ef57cc269671cd", "score": "0.5366421", "text": "function getValue(term) {\n print('getValue:', term)\n var parts = evaluate(term)\n var value\n\n if( typeof parts === 'object' ) {\n value = parts.value\n } else {\n value = context.getVariable(parts)\n }\n print('getValue: extracted value of', term, 'is', value)\n return value\n}", "title": "" }, { "docid": "e075c633f290679b68be94019fce29b4", "score": "0.5353516", "text": "function getXMPAltValue(dom, ns, property, langTest)\r\n {\r\n var val;\r\n\r\n var propertyList = dom.getElementsByTagNameNS(ns, property);\r\n\r\n // go through all the property elements (though there should\r\n // only be one)\r\n for(var i = 0; i < propertyList.length && !val; i++)\r\n {\r\n var entriesList = propertyList[0].getElementsByTagNameNS(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\", \"li\");\r\n\r\n for(var j = 0; j < entriesList.length; j++)\r\n {\r\n // found a non empty entry with fitting language\r\n if(entriesList[j].hasChildNodes() &&\r\n langTest.test(entriesList[j].getAttribute(\"xml:lang\"))) {\r\n val = entriesList[j].firstChild.nodeValue;\r\n break;\r\n }\r\n }\r\n }\r\n // our language wasn't found or its entry was empty\r\n for(var i = 0; i < propertyList.length && !val; i++)\r\n {\r\n var entriesList = propertyList[0].getElementsByTagNameNS(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\", \"li\");\r\n\r\n for(var j = 0; j < entriesList.length; j++)\r\n {\r\n // found a non empty entry with fitting language\r\n if(entriesList[j].hasChildNodes() &&\r\n entriesList[j].getAttribute(\"xml:lang\") == \"x-default\") {\r\n val = entriesList[j].firstChild.nodeValue;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return val;\r\n }", "title": "" }, { "docid": "9cb25ec4febca0f92103764cf7bf7aee", "score": "0.52785236", "text": "get namespace() {\n return this.extractNamespace(this.options);\n }", "title": "" }, { "docid": "549ba777af9918bfa2887935cef71a49", "score": "0.52761334", "text": "function xpathvalue(object,xpath)\r\n{\r\n\t// Remove the \"=\" value before processing the object\r\n\tif (xpath.indexOf(\"=\") >= 0)\r\n\t\tvar xpath = xpath.substring(0,xpath.indexOf(\"=\"));\r\n\t\r\n\tif (xpath.indexOf(\"_\") > 0)\r\n\t{\r\n\t\tvar xpath = xpath.split(\"_\");\r\n\t\tvar selected = object[xpath[0]];\r\n\t\txpath.splice(0,1);\r\n\t\t\r\n\t\t$.each(xpath, function(i) {\r\n\t\t\tif (typeof selected !=\"undefined\")\r\n\t\t\t{\r\n\t\t\t\tselected = selected[xpath[i]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\txpath = \"\";\t\t\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn selected;\r\n\t}\r\n\telse if (xpath != null)\r\n\t{\r\n\t\treturn(object[xpath]);\r\n\t}\t\t\r\n\telse\r\n\t{\r\n\t\treturn(object);\t\r\n\t}\r\n}", "title": "" }, { "docid": "a00bd781f0d9ee4f408208e8f29554ce", "score": "0.5241467", "text": "getValue() {}", "title": "" }, { "docid": "bca869f3f8156ddeba8c1c3b6e105619", "score": "0.52341855", "text": "function getValue(objectStore, namespace) {\n return new Promise(function thenGetValue(resolve, reject) {\n try {\n var request = objectStore.get(\n namespace\n );\n request.onerror = (e) => {\n debugger;\n };\n request.onsuccess = (e) => {\n resolve(request.result);\n };\n }\n catch(ex) {\n reject(ex);\n }\n });\n }", "title": "" }, { "docid": "352c7f22b36dc3cf8910bab18ec4be80", "score": "0.52189726", "text": "function getNodeValue(obj,tag) {\n return obj.getElementsByTagName(tag)[0].firstChild.nodeValue;\n}", "title": "" }, { "docid": "717e378dd159b2af0dfc5b23ed643e31", "score": "0.5157426", "text": "getValue() {\n return this.node.value;\n }", "title": "" }, { "docid": "a496ab3e992fd024d8e9c0f409cc6ed4", "score": "0.5140352", "text": "function getValue(elem) \n{\n if (elem !== null && elem !== undefined && typeof elem === 'object' && elem.get)\n {\n return elem.get();\n }\n else\n {\n return elem;\n }\n}", "title": "" }, { "docid": "e7d01e30e758017f77a9499abe7534ee", "score": "0.5135945", "text": "function SCOGetValue(nam)\t\t\t{return ((APIOK())?g_objAPI.LMSGetValue(nam.toString()):\"\")}", "title": "" }, { "docid": "9f9512a3f159abbfd0fdfa4c8b1c3f89", "score": "0.5125612", "text": "function getNodeValue(obj, tag) {\n return obj.getElementsByTagName(tag)[0].firstChild.nodeValue;\n// }\n }", "title": "" }, { "docid": "ce303116fe02d8ee6e76d553f07c5b5f", "score": "0.5062619", "text": "xpath(xpath, inDocument, inWindow) {\n return inDocument.evaluate(xpath, inDocument, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n }", "title": "" }, { "docid": "af2a9751eb796de72754dbdb2fd8aab2", "score": "0.5055505", "text": "get xMemberPath() {\n return this.i.n4;\n }", "title": "" }, { "docid": "aaf7133d7a0267d9db6e38dc14b14848", "score": "0.50409406", "text": "getValue() {\n const value = this._analyser.getValue();\n\n return value[0];\n }", "title": "" }, { "docid": "60fa7bcf78e9d87d642f012bf001be58", "score": "0.5038038", "text": "function getUSA(){\n let a = document.querySelector(\"span[data-customAttr]\");\n alert(\"Contents of USA: \" + a.innerHTML);\n}", "title": "" }, { "docid": "51c378750279db0f48505768a54d37a8", "score": "0.50164753", "text": "getLocal(name) { return this.get(name); }", "title": "" }, { "docid": "e707cff0aa130aaef77523e01aa73dc9", "score": "0.49897578", "text": "get (name) {\n let map = wm(this)\n name = normalizeName(name)\n\n return map[name] ? map[name][0] : null\n }", "title": "" }, { "docid": "6a11dcdba5ee2df1a4d2d23ead0761a6", "score": "0.4963252", "text": "getValue() {\n const value = this._analyser.getValue();\n return value[0];\n }", "title": "" }, { "docid": "2b135fb39c4b676147470b1cc30b2ec7", "score": "0.49475414", "text": "function parseWord(wordXML, attributeName)\n{\n var wordAttr = wordXML.attributes[attributeName];\n if(wordAttr)\n {\n \treturn wordAttr.value;\n }\n return null;\n}", "title": "" }, { "docid": "de74e67509927e8c3716ca3adb697326", "score": "0.49439085", "text": "function getRestrictionValue(restrictionNode) {\n try {\n var base = getNodeAttributeValue(restrictionNode, 'base');\n var restriction = getName(base, ':');//, null);\n return restriction;\n } catch (e) {\n throw appMessage.allocateError(e, MODULE_TAG, 'getRestrictionValue', false);\n }\n\n }", "title": "" }, { "docid": "3fd26ee1ee6aee16618132c5e432a63f", "score": "0.49127463", "text": "function $X (exp, context, type /* want type */) {\n\t// console.log(String(exp));\n\tif (typeof context == \"function\") {\n\t\ttype = context;\n\t\tcontext = null;\n\t}\n\tif (!context) context = document;\n\tvar exp = (context.ownerDocument || context).createExpression(exp, function (prefix) {\n\t\tvar ns = { \"atom\" : \"http://purl.org/atom/ns#\", \"hatena\" : \"http://www.hatena.ne.jp/info/xmlns#\" };\n\t\treturn document.createNSResolver((context.ownerDocument == null ? context\n\t\t : context.ownerDocument).documentElement)\n\t\t .lookupNamespaceURI(prefix) || ns[prefix] || document.documentElement.namespaceURI;\n\t});\n\n\tswitch (type) {\n\t\tcase String:\n\t\t\treturn exp.evaluate(\n\t\t\t\tcontext,\n\t\t\t\tXPathResult.STRING_TYPE,\n\t\t\t\tnull\n\t\t\t).stringValue;\n\t\tcase Number:\n\t\t\treturn exp.evaluate(\n\t\t\t\tcontext,\n\t\t\t\tXPathResult.NUMBER_TYPE,\n\t\t\t\tnull\n\t\t\t).numberValue;\n\t\tcase Boolean:\n\t\t\treturn exp.evaluate(\n\t\t\t\tcontext,\n\t\t\t\tXPathResult.BOOLEAN_TYPE,\n\t\t\t\tnull\n\t\t\t).booleanValue;\n\t\tcase Array:\n\t\t\tvar result = exp.evaluate(\n\t\t\t\tcontext,\n\t\t\t\tXPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n\t\t\t\tnull\n\t\t\t);\n\t\t\tvar ret = [];\n\t\t\tfor (var i = 0, len = result.snapshotLength; i < len; ret.push(result.snapshotItem(i++)));\n\t\t\treturn ret;\n\t\tcase undefined:\n\t\t\tvar result = exp.evaluate(context, XPathResult.ANY_TYPE, null);\n\t\t\tswitch (result.resultType) {\n\t\t\t\tcase XPathResult.STRING_TYPE : return result.stringValue;\n\t\t\t\tcase XPathResult.NUMBER_TYPE : return result.numberValue;\n\t\t\t\tcase XPathResult.BOOLEAN_TYPE: return result.booleanValue;\n\t\t\t\tcase XPathResult.UNORDERED_NODE_ITERATOR_TYPE: {\n\t\t\t\t\t// not ensure the order.\n\t\t\t\t\tvar ret = [];\n\t\t\t\t\tvar i = null;\n\t\t\t\t\twhile (i = result.iterateNext()) {\n\t\t\t\t\t\tret.push(i);\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\tdefault:\n\t\t\tthrow(TypeError(\"$X: specified type is not valid type.\"));\n\t}\n}", "title": "" }, { "docid": "c5539672db51c823775320db54aa947d", "score": "0.4900454", "text": "function _getData($element) {\n\t\treturn $element.data(namespace);\n\t}", "title": "" }, { "docid": "540822b373c98e5311721b74356de501", "score": "0.48774824", "text": "function SAWSOAP_Variable_getValue() { return this._value;}", "title": "" }, { "docid": "9065866f5bdabfe07b940a6a07282b0e", "score": "0.48761117", "text": "get docElementNS() {\n return this._docElementNS;\n }", "title": "" }, { "docid": "e6d826a03512559a093ebda5bcc9b54f", "score": "0.48730326", "text": "$$get(path) {\n const node = _getSchemaNodeForPath(this.$$schema(), path);\n return node ? node.get() : undefined;\n }", "title": "" }, { "docid": "e35252e85b178c809c7608d0a37b92db", "score": "0.48726276", "text": "get() {\n return GM_getValue(this.name, this.default);\n }", "title": "" }, { "docid": "eb7857495c8b0c2c30e9278af605bce8", "score": "0.48537248", "text": "getAttribute(name) {\n return this.root.getAttribute(name);\n }", "title": "" }, { "docid": "eb7857495c8b0c2c30e9278af605bce8", "score": "0.48537248", "text": "getAttribute(name) {\n return this.root.getAttribute(name);\n }", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.4840039", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "4052a8e634839d672a150071b62f4edd", "score": "0.48376057", "text": "function owlNamespace(element) {\n\t\tif (!element.owlP) {\n\t\t\telement.owlP = {};\n\t\t\telement.owlP.length = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "1c789c2db15834c2bfc36324c6623821", "score": "0.4820426", "text": "get ns() {\n return this._ns;\n }", "title": "" }, { "docid": "4b492564b09d5dad3ffb113538288b30", "score": "0.4799877", "text": "getVal(node, prop) {\n if (!node) {\n return \"\";\n }\n\n let pDocs = this._flavor.getDocs(node.id),\n pRef = pDocs && pDocs[prop];\n\n if (pRef != null && pRef[0] !== \"+\") {\n return pRef;\n }\n\n let ref = node && node[prop] || \"\";\n return pRef != null ? ref + pRef.substr(1) : ref;\n }", "title": "" }, { "docid": "2863b6fca1248fa017f078b671443b40", "score": "0.4798751", "text": "getDomain() {\n return this.getAttr('domain');\n }", "title": "" }, { "docid": "43057a455edcade3e1c085ba228367a7", "score": "0.47950938", "text": "getValue(data) {\n const start = data.indexOf(\"<value>\");\n const end = data.indexOf(\"</value>\");\n return data.substring(start + 7, end);\n }", "title": "" }, { "docid": "ef93566a2c3d3686152ac6586606a6fe", "score": "0.4790587", "text": "value() {\n return this.get('value');\n }", "title": "" }, { "docid": "994f8d8097bcd0b75fd44bee33cb5c9e", "score": "0.47883812", "text": "function getValue(el) {\r\n return '_value' in el ? el._value : el.value;\r\n}", "title": "" }, { "docid": "0af585c493f478185fc7414781752c7f", "score": "0.4787542", "text": "get xMemberPath() {\r\n return this.i.nv;\r\n }", "title": "" }, { "docid": "d176ea6e849ef6960574ae33734c7c42", "score": "0.47739026", "text": "function anno_getElementByXpath(xpath) {\n return document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n}", "title": "" }, { "docid": "c189c8e72aebd4ce7b8ddfb9f91cebd8", "score": "0.477077", "text": "function getValue(attributeName)\r\n{\r\n\t//alert(\"Getting \" + attributeName);\r\n\t//alert(\"Found \" + document.getElementById(attributeName).value);\r\n\treturn document.getElementById(attributeName).value;\r\n}", "title": "" }, { "docid": "81720c5472f2931ccaffed3e3dcd719f", "score": "0.4757811", "text": "function extractValue(attr, intent, session) {\n\n console.log(\"Extracting \" + attr);\n\n if (session.attributes) {\n if (attr in session.attributes) {\n console.log(\"Session attribute \" + attr + \" is \" + session.attributes[attr]);\n return session.attributes[attr];\n }\n }\n\n console.log(\"No session attribute for \" + attr);\n\n if (intent.slots) {\n if (attr in intent.slots && 'value' in intent.slots[attr]) {\n return intent.slots[attr].value;\n }\n };\n return null;\n}", "title": "" }, { "docid": "81720c5472f2931ccaffed3e3dcd719f", "score": "0.4757811", "text": "function extractValue(attr, intent, session) {\n\n console.log(\"Extracting \" + attr);\n\n if (session.attributes) {\n if (attr in session.attributes) {\n console.log(\"Session attribute \" + attr + \" is \" + session.attributes[attr]);\n return session.attributes[attr];\n }\n }\n\n console.log(\"No session attribute for \" + attr);\n\n if (intent.slots) {\n if (attr in intent.slots && 'value' in intent.slots[attr]) {\n return intent.slots[attr].value;\n }\n };\n return null;\n}", "title": "" }, { "docid": "8c0feb443033c2e5f18e0b938c23dc4a", "score": "0.47572842", "text": "function readAttribute(soziElement, attr) {\n return soziElement.getAttributeNS(SOZI_NS, attr) || DEFAULTS[attr];\n }", "title": "" }, { "docid": "a3719bdf70751cc75fdab10fe0f4edc0", "score": "0.47549883", "text": "get valueMemberPath() {\r\n return this.i.oc;\r\n }", "title": "" }, { "docid": "17da500d298e32f37458ffda37076b4b", "score": "0.4736517", "text": "get value() {\n return this.getStringAttribute('value');\n }", "title": "" }, { "docid": "d876dad9a0c186a92c867094c166ae1c", "score": "0.47050488", "text": "function find(xpath, xpres){\r\n\t\tvar ret = document.evaluate(xpath, document, null, xpres, null);\r\n\t\treturn (xpres == XPFirst ? ret.singleNodeValue : ret);\r\n\t}", "title": "" }, { "docid": "3909feb12c271641921d54bc21b007eb", "score": "0.4703496", "text": "getValue() {\n return this.value_;\n }", "title": "" }, { "docid": "53e2270c7b01e4ed5a1f86b96ee29b06", "score": "0.469702", "text": "getXMLValueFromElement(xmlElement, property){\n if (property && xmlElement.getElementsByTagName(property) &&\n xmlElement.getElementsByTagName(property)[0] &&\n xmlElement.getElementsByTagName(property)[0].value) {\n return xmlElement.getElementsByTagName(property)[0].value;\n }\n return ''\n }", "title": "" }, { "docid": "302611300b105f0e4567e01667a75662", "score": "0.46943027", "text": "get() { return this.label[0]; }", "title": "" }, { "docid": "e62083da89d787119874e6bc5b58fc87", "score": "0.46862864", "text": "function node_locateANamespace(node, prefix) {\n if (util_1.Guard.isElementNode(node)) {\n /**\n * 1. If its namespace is not null and its namespace prefix is prefix,\n * then return namespace.\n */\n if (node._namespace !== null && node._namespacePrefix === prefix) {\n return node._namespace;\n }\n /**\n * 2. If it has an attribute whose namespace is the XMLNS namespace,\n * namespace prefix is \"xmlns\", and local name is prefix, or if prefix\n * is null and it has an attribute whose namespace is the XMLNS namespace,\n * namespace prefix is null, and local name is \"xmlns\", then return its\n * value if it is not the empty string, and null otherwise.\n */\n for (var i = 0; i < node._attributeList.length; i++) {\n var attr = node._attributeList[i];\n if (attr._namespace === infra_1.namespace.XMLNS &&\n attr._namespacePrefix === \"xmlns\" &&\n attr._localName === prefix) {\n return attr._value || null;\n }\n if (prefix === null && attr._namespace === infra_1.namespace.XMLNS &&\n attr._namespacePrefix === null && attr._localName === \"xmlns\") {\n return attr._value || null;\n }\n }\n /**\n * 3. If its parent element is null, then return null.\n */\n if (node.parentElement === null)\n return null;\n /**\n * 4. Return the result of running locate a namespace on its parent\n * element using prefix.\n */\n return node_locateANamespace(node.parentElement, prefix);\n }\n else if (util_1.Guard.isDocumentNode(node)) {\n /**\n * 1. If its document element is null, then return null.\n * 2. Return the result of running locate a namespace on its document\n * element using prefix.\n */\n if (node.documentElement === null)\n return null;\n return node_locateANamespace(node.documentElement, prefix);\n }\n else if (util_1.Guard.isDocumentTypeNode(node) || util_1.Guard.isDocumentFragmentNode(node)) {\n return null;\n }\n else if (util_1.Guard.isAttrNode(node)) {\n /**\n * 1. If its element is null, then return null.\n * 2. Return the result of running locate a namespace on its element\n * using prefix.\n */\n if (node._element === null)\n return null;\n return node_locateANamespace(node._element, prefix);\n }\n else {\n /**\n * 1. If its parent element is null, then return null.\n * 2. Return the result of running locate a namespace on its parent\n * element using prefix.\n */\n if (!node._parent || !util_1.Guard.isElementNode(node._parent))\n return null;\n return node_locateANamespace(node._parent, prefix);\n }\n}", "title": "" }, { "docid": "c8c1bd654cfd841b6aadfad58128794d", "score": "0.46858293", "text": "function Get_ElementPropertyValue ({\n $QuerySelector,\n $PropertyName\n}) {\n var $Element = document.querySelector($QuerySelector)\n return $Element ?\n $Element[$PropertyName] :\n undefined\n}", "title": "" }, { "docid": "e399824d5ad032210b62c747fb1aaffd", "score": "0.46788445", "text": "val() {\n return this._node.val();\n }", "title": "" }, { "docid": "e82732c16c7af181ca8e17c5a9ac170f", "score": "0.46754056", "text": "getValue() {\n return this._analyser.getValue();\n }", "title": "" }, { "docid": "71a2656968ea1e9aece6a98a941a0e18", "score": "0.46714687", "text": "function getElementByXpath(path) { //Sales invoice, sales order, delivery note\r\n return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n}", "title": "" }, { "docid": "5ed038df12a7bb9371140f4e6a7d6943", "score": "0.46663404", "text": "function metaValue(name) {\n var metas = document.getElementsByName(name);\n return metas.length > 0 ? metas[0].content : undefined;\n }", "title": "" }, { "docid": "6f621619a0f8673afe6960e123be4834", "score": "0.46568975", "text": "get queryURL() { return namespace(this).queryURL; }", "title": "" }, { "docid": "0afdf633a8e3e47a8337b04c66a9b3ad", "score": "0.46509248", "text": "getResult(namespace, stateKey) {\n const key = this.namespaceToKey.get(namespace);\n if (!this.states[key] || !this.states[key].results || !this.states[key].results[stateKey])\n return null;\n return this.states[key].results[stateKey];\n }", "title": "" }, { "docid": "4cf7194ecfb7ea3b807b9f60d2ea26a4", "score": "0.46479732", "text": "getValue (context) {\n if (!context) {\n throw new Error('You can not grab a value from a Tag without context')\n }\n\n if (!context[this.type]) {\n throw new Error('You can not grab a value from a Tag without its provider')\n }\n\n const source = context[this.type]\n const path = this.getPath(context)\n return get(source, path)\n }", "title": "" }, { "docid": "923a2343e9f9680729d7cca4124d4397", "score": "0.46478754", "text": "termType() {\n return this[$type]\n }", "title": "" }, { "docid": "67e721bf526fc5184b4ef48d1887bf8a", "score": "0.46237677", "text": "namespace(namespace) {\n return this.connectedNamespaces.get(namespace);\n }", "title": "" }, { "docid": "9a81961fb60ca476843e2572daa993dc", "score": "0.46139863", "text": "function getFlashAttribute(obj,name) {\r\n if(!obj) { return null; }\r\n switch(obj.nodeName) {\r\n case 'EMBED':\r\n return obj.getAttribute(name);\r\n case 'OBJECT':\r\n var fp=null; try { fp=document.evaluate('.//param[@name=\"'+name+'\"]',obj,null,XPathResult.ANY_UNORDERED_NODE_TYPE,null).singleNodeValue; } catch(err) { fp=null; }\r\n if(fp) { return fp.getAttribute('value'); }\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "773834cbf121855076189f32e546ec32", "score": "0.46134517", "text": "get nameValue() {\n return this.getAttribute('nameValue');\n }", "title": "" }, { "docid": "19a80479d188c2e32ab7296b75dc0bee", "score": "0.4611973", "text": "getElement(elementOrOid) {\n if (elementOrOid instanceof JSXElement) return elementOrOid;\n return this.oids[elementOrOid];\n }", "title": "" }, { "docid": "2793c26e62e434c9a74339f12fa3c175", "score": "0.46108076", "text": "get(uri) {\r\n return this._documents[uri];\r\n }", "title": "" }, { "docid": "2793c26e62e434c9a74339f12fa3c175", "score": "0.46108076", "text": "get(uri) {\r\n return this._documents[uri];\r\n }", "title": "" }, { "docid": "2793c26e62e434c9a74339f12fa3c175", "score": "0.46108076", "text": "get(uri) {\r\n return this._documents[uri];\r\n }", "title": "" }, { "docid": "f1eaf4de6936bddf4b91eef6a921fe08", "score": "0.46036857", "text": "getValue() {\n return this._analyser.getValue();\n }", "title": "" }, { "docid": "42cd963bd763fec0c442ddbaca0bcb7e", "score": "0.46006766", "text": "function getXMLNS(document) {\n var html = document.head.parentNode;\n for (var i = 0, m = html.attributes.length; i < m; i++) {\n var attr = html.attributes[i];\n if (attr.nodeName.substr(0,6) === \"xmlns:\" &&\n attr.nodeValue === \"http://www.w3.org/1998/Math/MathML\")\n {return attr.nodeName.substr(6)}\n }\n return \"mml\";\n}", "title": "" }, { "docid": "f7b26149649b2aa3dd540ceaa8caf021", "score": "0.45999566", "text": "function getObjectWithGivenNamedPropertySetToGivenValue(propertyName, value) {}", "title": "" }, { "docid": "ef06dd97679f70ba507f900bed9b3c12", "score": "0.45995244", "text": "function getByOperationId(operationId, prefabName) {\n var scope = prefabName || 'APP';\n // Return metadata of the variable\n return _.get(metaInfo[scope], [operationId, 'wmServiceOperationInfo']) || {};\n }", "title": "" }, { "docid": "4312e03fdfb27d5ee6808652162aec32", "score": "0.45966747", "text": "function getConcept(cui) {\n\t \treturn _concepts[cui];\n\t }", "title": "" }, { "docid": "c841b88f18ff1b499cec0866c3ad9ab0", "score": "0.45926878", "text": "getValue() {\n return this.inputNode.value;\n }", "title": "" }, { "docid": "c841b88f18ff1b499cec0866c3ad9ab0", "score": "0.45926878", "text": "getValue() {\n return this.inputNode.value;\n }", "title": "" }, { "docid": "1f87c9ca65edebe0637b89c6ce737e92", "score": "0.45922345", "text": "get label() {\n return this.node.querySelector('label span').textContent;\n }", "title": "" }, { "docid": "f234bd0bbbf11ba3ca7c734e73991244", "score": "0.4586368", "text": "function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {\n var _a;\n // Composite and Sequence schemas already got their root namespace set during serialization\n // We just need to add xmlns to the other schema types\n if (xmlNamespace && ![\"Composite\", \"Sequence\", \"Dictionary\"].includes(typeName)) {\n var result = {};\n result[options.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a);\n return result;\n }\n return serializedValue;\n}", "title": "" }, { "docid": "f234bd0bbbf11ba3ca7c734e73991244", "score": "0.4586368", "text": "function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {\n var _a;\n // Composite and Sequence schemas already got their root namespace set during serialization\n // We just need to add xmlns to the other schema types\n if (xmlNamespace && ![\"Composite\", \"Sequence\", \"Dictionary\"].includes(typeName)) {\n var result = {};\n result[options.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a);\n return result;\n }\n return serializedValue;\n}", "title": "" }, { "docid": "f234bd0bbbf11ba3ca7c734e73991244", "score": "0.4586368", "text": "function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {\n var _a;\n // Composite and Sequence schemas already got their root namespace set during serialization\n // We just need to add xmlns to the other schema types\n if (xmlNamespace && ![\"Composite\", \"Sequence\", \"Dictionary\"].includes(typeName)) {\n var result = {};\n result[options.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a);\n return result;\n }\n return serializedValue;\n}", "title": "" }, { "docid": "d023d41ef184f4e0a791bace7d71801b", "score": "0.4579387", "text": "function getAObj(obj,name) {\n for (e in obj) {\n if (obj[e].name == name)\n return obj[e].value;\n };\n return 0;\n}", "title": "" }, { "docid": "f676c40001e8a5758a9c98419835c493", "score": "0.4576327", "text": "get site() { return namespace(this).site; }", "title": "" }, { "docid": "29467379f8dac6f013b488e42ff25e5c", "score": "0.45712346", "text": "function inputValue(movie){\n return movie.Title;\n}", "title": "" }, { "docid": "f018a0f76503e8fb26f582534d123a46", "score": "0.45677486", "text": "get value() {\n return this.i.aq;\n }", "title": "" }, { "docid": "1df6080afbd2bd1b2128b8b8877fde94", "score": "0.45632362", "text": "function rdflibNamespace(namespaceUri){var namespace=ns(namespaceUri);// Wrap the namespace object to return an rdf.Symbol\nvar wrapper=function wrapper(term){return rdf.sym(namespace(term));};return wrapper;}", "title": "" }, { "docid": "3b2ef83ce944cecad01c8b7f83a38e86", "score": "0.4538292", "text": "function find(xpath, xpres, startnode){\r\n\t\tif (!startnode) {startnode=document;}\r\n\t\tvar ret = document.evaluate(xpath, startnode, null, xpres, null);\r\n\t\treturn xpres == XPFirst ? ret.singleNodeValue : ret;\r\n\t}", "title": "" }, { "docid": "c976e47c01a391114a88b448fba2f258", "score": "0.45372424", "text": "get title () { return $('//*[text()=\"Your Cart\"]') }", "title": "" }, { "docid": "3ec33e8dccdd23c969443fb5c457e4cb", "score": "0.45333856", "text": "function parseSchemQ(res, val) {\n return res.data.hits.hits[val]._source.name;\n}", "title": "" }, { "docid": "8d83fbb603596344ab681968c3da7cdf", "score": "0.45212188", "text": "get nsx() {\n return this._nsx;\n }", "title": "" } ]
b835fcc3e35cd040ba22cbf2edb94e16
Formating the date for life planner
[ { "docid": "3cd0930b36a618a65bef05d0b1db4920", "score": "0.0", "text": "function ChangeFormatofDate(date) {\n\tvar date1 = date;\n\tdate1 = date1.split(\"-\");\n\tcurrdate = date1[1] + \"/\" + date1[0] + \"/\" + date1[2];\n\treturn currdate;\n}", "title": "" } ]
[ { "docid": "1529ab643a144e92d2bf34af0fad0aee", "score": "0.7323226", "text": "format_date_display() {\n let date = this.state.date;\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let dt = date.getDate();\n let return_str = \"\";\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return dt + \"-\" + month + \"-\" + year;\n }", "title": "" }, { "docid": "a346283afd7d24bf08b2b4c55b5647db", "score": "0.72323", "text": "dateFormat () {\n let date = new Date(this.deadline).getDate()\n let month = new Date(this.deadline).getMonth()\n let year = new Date(this.deadline).getFullYear()\n\n if (month < 10) {\n return `${year}-0${month}-${date}` \n }\n return `${year}-${month}-${date}`\n }", "title": "" }, { "docid": "d0df702b22854536628817491872bd80", "score": "0.71498615", "text": "static formatDateForOutput(date) {\n\n const dateObject = this.getDateAsObjectOfStrings(date);\n\n return dateObject.day + \"-\" +\n dateObject.month + \"-\" +\n dateObject.year + \" \" +\n dateObject.hours + \":\" +\n dateObject.minutes;\n }", "title": "" }, { "docid": "ed348a9446516d58a0d6ca589edd4111", "score": "0.70884335", "text": "function format(date) \n {\n date = new Date(date); \n var day = ('0' + date.getDate()).slice(-2);\n var month = ('0' + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear();\n return year + '-' + month + '-' + day;\n }", "title": "" }, { "docid": "d88825407455d59a48d8d1c3ea08701c", "score": "0.70773596", "text": "function formatDate(date){\n\t\t \t\t\t\tvar year = date.getFullYear().toString().slice(-2);\n\t\t \t\t\t\tvar time = date.toTimeString().slice(0,8);\n\t\t \t\t\t\treturn (date.getMonth()+1) + \"/\" + date.getDate() + \"/\" + year + \" \" +time;\n\t\t \t\t\t}", "title": "" }, { "docid": "063752124628e76dbad57b668ce61196", "score": "0.7005597", "text": "function formatDate(date) {\n return date.toLocaleDateString();\n }", "title": "" }, { "docid": "b56467ef15ff3426b93f8d41b43478c0", "score": "0.6978486", "text": "formatDate() {\n let d = new Date(), formatDateVal = [this.formatNumber(d.getFullYear()), this.formatNumber(('' + (d.getMonth() + 1))), this.formatNumber(('' + d.getDate()))], formatTimeval = [this.formatNumber(('' + d.getHours())), this.formatNumber(('' + d.getMinutes())), this.formatNumber(('' + d.getSeconds()))];\n return formatDateVal.join('-') + ' ' + formatTimeval.join('-');\n }", "title": "" }, { "docid": "1fb3c8a9eb185dab5fea01428aa024f4", "score": "0.694032", "text": "static formatDate(date) {\n return moment_1.default(date).format(CLOCKIFY_DATE_FORMAT);\n }", "title": "" }, { "docid": "40e83ade75eacc84c8316387b6c5ef08", "score": "0.6906756", "text": "function formatDate(date) {\n return months[date.getMonth()] + \" \" +\n date.getFullYear();\n }", "title": "" }, { "docid": "643b492b3370374f1c6034381eb0537e", "score": "0.6893163", "text": "function formatDate(date) {\n\t\t\t\treturn new Intl.DateTimeFormat('en-US').format(date)\n\t\t\t}", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6858618", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6858618", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6858618", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "3f54e8f1efb762aaf6a76ba0009e5043", "score": "0.6828172", "text": "_formattedDateForLogging(date) {\n return date.getFullYear() +\n \"/\" +\n ('0' + (date.getMonth() + 1)).slice(-2) +\n \"/\" +\n ('0' + date.getDate()).slice(-2) +\n \" \" +\n ('0' + date.getHours()).slice(-2) +\n ':' +\n ('0' + date.getMinutes()).slice(-2) +\n ':' +\n ('0' + date.getSeconds()).slice(-2);\n }", "title": "" }, { "docid": "e8caa73f6aca1571b48c4bcba35e6e46", "score": "0.6827761", "text": "function formatdate(date) {\n return new Date(date).toLocaleDateString();\n }", "title": "" }, { "docid": "634e575c60bfa12b11ba04fbaa77635f", "score": "0.6817506", "text": "function formatDate(date) {\n return getTwoDigitsDate(date.getDate()) + '.' + getTwoDigitsDate(date.getMonth() + 1) + '.' + date.getFullYear() + ' ' + date.getHours() + ':' + getTwoDigitsDate(date.getMinutes());\n }", "title": "" }, { "docid": "6eba55e654070a28047bd4442b23aa8a", "score": "0.681453", "text": "formatDate(date) {\n const d = new Date(date);\n let dd = d.getDate();\n if (dd < 10) dd = '0' + dd;\n\n let mm = d.getMonth() + 1;\n if (mm < 10) mm = '0' + mm;\n\n let yy = d.getFullYear();\n\n return dd + '.' + mm + '.' + yy;\n }", "title": "" }, { "docid": "53500fea8c55a4a69909b24b3c7df8ae", "score": "0.6808981", "text": "formatDate(datenow){\n var date = new Date(datenow);\n var options = {\n year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric'\n };\n var result = date.toLocaleDateString('en', options);\n return result;\n }", "title": "" }, { "docid": "422de947b689c76d39d2b2539e01c5e8", "score": "0.6808793", "text": "function usFormat() {\n return this.month + \"/\" + this.day + \"/\" + this.year;\n}", "title": "" }, { "docid": "05ed2b7c5db85f2df515f94540b063d4", "score": "0.6795168", "text": "function formatDate(date) {\r\n date = new Date(date);\r\n\r\n let month = '' + (date.getMonth() + 1);\r\n let day = date.getDate() + '';\r\n let year = date.getFullYear();\r\n\r\n month = month.length < 2 ? '0' + month : month;\r\n day = day.length < 2 ? '0' + day : day;\r\n\r\n return `${year}-${month}-${day}`\r\n }", "title": "" }, { "docid": "cb15e277cb3365b812dedea19c0fa935", "score": "0.6793706", "text": "function formatDate(date, format) {\n\t\tvar dd = date.getDate();\n\t\tvar mm = date.getMonth() + 1; //Jan = 0\n\t\tvar yyyy = date.getFullYear();\n\t\t\n\t\tif (dd < 10) {\n\t\t\tdd = '0' + dd;\n\t\t}\n\t\t\n\t\tif (mm < 10) {\n\t\t\tmm = '0' + mm;\n\t\t}\n\t\t\n\t\tif (format === 'display') {\n\t\t\treturn mm + '/' + dd + '/' + yyyy;\n\t\t}\n\t\t\n\t\treturn yyyy + '-' + mm + '-' + dd;\n\t}", "title": "" }, { "docid": "c028cf555074e9c9bc3246c52eda6ee4", "score": "0.679234", "text": "function formatDate ( date ) {\n return weekdays[date.getDay()] + ', ' +\n date.getDate() + nth(date.getDate()) + ' ' +\n months[date.getMonth()] + ' ' +\n date.getFullYear();\n }", "title": "" }, { "docid": "6153f3de18659592df06818e77262cb5", "score": "0.6792195", "text": "formatDate(date) {\n\t\tlet d = new Date(date);\n\n\t\tlet month = '' + (d.getMonth() + 1);\n\t\tlet day = '' + d.getDate();\n\t\tlet year = d.getFullYear();\n\t\tlet hour = d.getHours();\n\t\tlet min = ('0'+d.getMinutes()).slice(-2);\n\n\t\tif (month.length < 2)\n\t\t\tmonth = '0' + month;\n\t\tif (day.length < 2)\n\t\t\tday = '0' + day;\n\n\t\tlet res = [year, month, day].join('-');\n\t\tres = res.concat(' ');\n\t\tres = res.concat(hour.toString());\n\t\tres = res.concat(':');\n\t\tres = res.concat(min.toString());\n\n\t\treturn res;\n\t}", "title": "" }, { "docid": "b219dfded56c28abc91625d76236ab4b", "score": "0.6784287", "text": "function formatDate (date) {\n return date.getDate() + '-' +\n // weekdays[date.getDay()] + \", \" +\n\n months[date.getMonth()] + '-' +\n date.getFullYear()\n}", "title": "" }, { "docid": "28418b290789e666ec075393916e9ccc", "score": "0.67817914", "text": "function formatDate(date) {\n return `Published: ${new Date(date).toLocaleDateString()}`;\n }", "title": "" }, { "docid": "02adc2b66de5ccb6e60cf5c126f7b7df", "score": "0.67786205", "text": "function formatDate(date) {\n\n\n\tif (date.getDate() < 10){\n\t\tvar day = '0'+ date.getDate();\n\t}\n\n\tif(date.getMonth() + 1 < 10){\n\t\tvar month = '0'+ (date.getMonth() +1);\n\t}\n\n return day + \"/\" + month +\n \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "18827140f81fac0682f18132d4011470", "score": "0.67699486", "text": "formatDateToString(date)\n {\n var str = date.getFullYear() + \"-\"\n + this.pad(date.getMonth() + 1) + \"-\"\n + this.pad(date.getDate()) + \" \"\n + this.pad(date.getHours() + \":\" + this.pad(date.getMinutes())\n + \":\" + this.pad(date.getSeconds()));\n\n return str;\n }", "title": "" }, { "docid": "3ad873f353e513baf4483403c468dbf7", "score": "0.6758662", "text": "function formatDate(date) {\n return vreme.format(new Date(date), '3/16/2014 at 14:30');\n}", "title": "" }, { "docid": "3493012255dc7d133178dafc8f7204aa", "score": "0.675652", "text": "function formatDate(date) {\n return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()\n } ${date.getDate()}${months[date.getMonth()]}${date.getFullYear()}`;\n}", "title": "" }, { "docid": "27faff1a9adffa6307b254d882b4e299", "score": "0.675586", "text": "function formatDate(date) {\r\n if (!date) {\r\n return '';\r\n }\r\n var month = date.getMonth() + 1;\r\n var year = date.getFullYear();\r\n var day = date.getDate();\r\n month = (month < 10) ? \"0\" + month : month;\r\n day = (day < 10) ? \"0\" + day : day;\r\n return year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "d0168c7c4d4d98a812743c3d4d88c8d1", "score": "0.6745624", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = '0' + month;\n }\n if (day.length < 2) {\n day = '0' + day;\n }\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "b6ac51595c1762b8dab95308b01a17d0", "score": "0.67434555", "text": "reformatDate(date) {\n\t\tlet date2 = date.split('-');\n\t\tconsole.log(date2[1]);\n\t\treturn `${months[date2[1] - 1]} ${date2[2]}, ${date2[0]} \\n`;\n\t}", "title": "" }, { "docid": "8cc7f01a395b3ad6ac04bab48908df4e", "score": "0.6739643", "text": "formatReleaseDate(date) {\n let releaseDate = new Date(date);\n return `${releaseDate.getDate()}-${(releaseDate.getMonth() + 1)}-${releaseDate.getFullYear()}`\n }", "title": "" }, { "docid": "c15937099b088585098e1c876f85aa01", "score": "0.6729532", "text": "function formatdate(val) {\n\t\tif (!val) \n\t\t\treturn \"\";\n\n\t\telse {\n\t\t\tvar days = val.getDate();\n\t\t\tvar month = val.getMonth() + 1;\n\t \tvar year = val.getFullYear();\n\n\t\t\treturn month + \"/\" + days + \"/\" + year;\n\t\t}\n\t}", "title": "" }, { "docid": "354d89434e4af837a56dbbca387a80be", "score": "0.6727731", "text": "function datePrinter(date) {\n let out = {\n year: date.getYear() - 100,\n month: date.getMonth() + 1,\n day: date.getDate(),\n hours: date.getHours(),\n minutes: date.getMinutes(),\n };\n for (let number in out) {\n if (Number(out[number]) < 10) {\n out[number] = \"0\" + out[number];\n }\n }\n return `${out.day}/${out.month}/${out.year} - ${out.hours}:${out.minutes}`; // DD/MM/YYYY - HH:MM\n }", "title": "" }, { "docid": "10afc74e0960fc419460e42df1c4728c", "score": "0.6714627", "text": "function formatDate(date){\n var dd = date.getDate();\n var mm = date.getMonth()+1;\n var yyyy = date.getFullYear();\n if(dd<10) {dd='0'+dd}\n if(mm<10) {mm='0'+mm}\n date = yyyy + '-' + mm +'-' + dd;\n return date\n }", "title": "" }, { "docid": "0c347eda35973eca9490ebdb45bfed26", "score": "0.6712233", "text": "function displayDate(date) {\r\n\t\tvar d = new Date(date);\r\n\t\treturn((d.getMonth() + 1) + \"/\" + (d.getDate() + 1) + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds());\r\n\t}", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.6707971", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.6707971", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "f403b580e4f61e80e00a268386bd8260", "score": "0.66973734", "text": "function formatDate(d){\n function addZero(n){\n return n < 10 ? '0' + n : '' + n;\n }\n return addZero(d.getMonth()+1)+\"/\"+ addZero(d.getDate()) + \"/\" + d.getFullYear() + \" \" + \n addZero(d.getHours()) + \":\" + addZero(d.getMinutes());\n }", "title": "" }, { "docid": "1722b1fedf4dc3df8bf156363eca33c4", "score": "0.66960335", "text": "formatDate(birthdate) {\n let date = new Date(birthdate);\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n date.toLocaleDateString();\n let dt = date.getDate();\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return year + \"-\" + month + \"-\" + dt;\n }", "title": "" }, { "docid": "4b8dd497bde3c3112b8bc079fa5a4144", "score": "0.6692776", "text": "getFormattedDueDate(){\n var days = [\"Sun\", \"Mon\", \"Tue\", \"Wed\",\"Thu\", \"Fri\", \"Sat\"];\n var months = [\"Jan\", \"Feb\", \"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n var date = this.duedate; \n var day = days[date.getDay()];\n var month = months[date.getMonth()];\n var dayNumber = date.getDate(); \n var year = date.getFullYear();\n var fullDate = day + \" \" + month + \" \"+ dayNumber + \" \"+ year; \n return fullDate; \n }", "title": "" }, { "docid": "56018b2e3a8f6dba86b67c6ee051c1ae", "score": "0.6683795", "text": "static formatDate(date) {\n return moment(date).format('DD/MM/YYYY HH:mm');\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.66650707", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.66650707", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "697e8acf42ca01fb33099aa108ff5ef7", "score": "0.6661767", "text": "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "cf5d1c409c6e476c43e5f2d0aacfc80e", "score": "0.6660841", "text": "function formatDate(d) {\n return (d.getMonth()+1) + '/' +\n d.getDate() + '/' +\n d.getFullYear();\n }", "title": "" }, { "docid": "131becd669c9792993880795fdcf88cf", "score": "0.6650278", "text": "function formatDate(d){\n function addZero(n){\n return n < 10 ? '0' + n : '' + n;\n }\n return addZero(d.getMonth()+1)+\"/\"+ addZero(d.getDate()) + \"/\" + d.getFullYear() + \" \" + \n addZero(d.getHours()) + \":\" + addZero(d.getMinutes());\n }", "title": "" }, { "docid": "f02e189efedccbcc9d72e5b0854f1566", "score": "0.6642968", "text": "function formatDate(date) {\n\t\t \n\t\tvar hours = date.getHours();\n\t\tvar minutes = date.getMinutes();\n\t\tvar ampm = hours >= 12 ? 'pm' : 'am';\n\t\thours = hours % 12;\n\t\thours = hours ? hours : 12; // the hour '0' should be '12'\n\t\tminutes = minutes < 10 ? '0'+minutes : minutes;\n\t\tvar strTime = hours + ':' + minutes + ' ' + ampm;\n\n\t\t return date.getMonth()+1 + \"/\" + date.getDate() + \"/\" + date.getFullYear();\n\t\t}", "title": "" }, { "docid": "f4c9a395cd25cb4e1292ab493cdf75cf", "score": "0.66364044", "text": "function formatDate(date) {\n // Format the date as Month/Day, year is optional, but seems too long for gadget use.\n var columnMonth = date.getMonth() + 1;\n var columnDay = appendZero(date.getDate());\n var ColumnYear = date.getFullYear();\n return columnMonth + \"-\" + columnDay;\n}", "title": "" }, { "docid": "2dab663764d3bbcf88e4264769c74196", "score": "0.66338915", "text": "function formatDate(date) {\n var month = '' + (date.getMonth() + 1),\n day = '' + date.getDate(),\n year = date.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "a09831ec2ffa3c5c3ff47a002c564fea", "score": "0.6626444", "text": "function __formatDate()\n\t\t{\n\t\t\tif (value.valueOf().toString() == 'NaN')\n\t\t\t\treturn 'Invalid Date';\n\t\t\n\t\t\tvar str = ('0'+(value.getMonth()+1).toString()).substr(-2) + '-'\n\t\t\t\t\t+ ('0'+value.getDate()).substr(-2) + '-'\n\t\t\t\t\t+ value.getFullYear()\n\t\t\n\t\t\tvar hours = value.getHours() % 12\n\t\t\tvar minutes = value.getMinutes();\n\t\t\tvar seconds = value.getSeconds();\n\t\t\tvar ms = value.getMilliseconds();\n\t\t\n\t\t\tif (hours > 0 || minutes > 0 || seconds > 0 || ms > 0)\n\t\t\t{\n\t\t\t\tif (maxchars && str.length > (maxchars-10))\n\t\t\t\t\tstr += '...'\n\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (hours === 0) hours = 12\n\t\t\t\t\tstr += ' '\n\t\t\t\t\t\t + ('00'+hours.toString()).substr(-2) + ':'\n\t\t\t\t\t\t + ('00'+minutes).substr(-2);\n\t\t\n\t\t\t\t\tif (seconds > 0)\n\t\t\t\t\t\tstr += ':' + ('00'+seconds).substr(-2);\n\t\t\n\t\t\t\t\tif (ms > 0)\n\t\t\t\t\t\tstr += '.' + ('000'+ms).substr(-3);\n\t\t\n\t\t\t\t\tstr += (value.getHours() < 12 ? ' AM' : ' PM');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (maxchars && str.length > maxchars)\n\t\t\t\tstr = 'Date()';\n\t\t\n\t\t\treturn str;\n\t\t}", "title": "" }, { "docid": "95bd32d5346767dd10b76c9a5ba1ac48", "score": "0.6625697", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n console.log([year, month, day].join('-'))\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "5ac85ae948e78812debc0a7ded190b62", "score": "0.6620099", "text": "format_date_api() {\n let date = this.state.date;\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let dt = date.getDate();\n\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n let changed_date = year + \"-\" + month + \"-\" + dt;\n\n return changed_date;\n }", "title": "" }, { "docid": "c74a23f2f45dc42fafbf56e21456b425", "score": "0.66155607", "text": "function formatDate(date) \r\n{\r\n var d = new Date(date),\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.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 [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "642a81c8c21e3387be9a139f9145813e", "score": "0.6606664", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "149391b3e22fa5d490a882ebf4b2b59d", "score": "0.66061634", "text": "function getFormattedDate(date){\r\n\treturn \"'\"+date.getFullYear()+'-'+ (date.getMonth()+1)+'-'+date.getDate()+\"'\";\r\n}", "title": "" }, { "docid": "b9855dabe71ec1d6f135e44cb7d905bf", "score": "0.66050535", "text": "function formatDate(date) {\r\n\tvar month=date.getMonth()+1;\r\n\tvar year=date.getFullYear();\r\n\tvar day=date.getDate()\r\n\tmonth=(month<10)?\"0\"+month:month;\r\n\tday=(day<10)?\"0\"+day:day;\r\n\treturn year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "01dca1cc17b424c814049b9269028fb8", "score": "0.6596076", "text": "function calendarDateFormatter(date){\n return appendLeadingZeroes(date.getDate()) + \".\" + appendLeadingZeroes(date.getMonth() +1);\n}", "title": "" }, { "docid": "b5cae9e4b39bf4fbe0905f7e4ddae761", "score": "0.65860486", "text": "function formatDate(date) {\n var month = date.getMonth() + 1;\n var day = date.getDate();\n if (month < 10)\n month = \"0\" + month;\n if (day < 10)\n day = \"0\" + day;\n return day + \"/\" + month + \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "b6d14ef1dd2b354629eea0d9d7bde709", "score": "0.65833914", "text": "format(attrs) {\n return this.fixDates(attrs);\n }", "title": "" }, { "docid": "a55a6db6ae9801afb1cc32fc1bc647c5", "score": "0.65787137", "text": "function formatDate(date) {\n function formatNum(num) {\n if (num < 10) return '0' + num;\n return String(num);\n }\n return formatNum(date.getDate()) + '/' + formatNum(date.getMonth() + 1) + '/' + date.getFullYear();\n }", "title": "" }, { "docid": "ab27bc9083b4eaec3a98a858b7d452ca", "score": "0.6562642", "text": "formattedDate() {\n return moment(this.createdAt).format('MM/DD/YYYY');\n }", "title": "" }, { "docid": "153b0e529d033df9cf87c2c7f1bf0a6f", "score": "0.6560306", "text": "function formatDate(date) {\n return date.toLocaleDateString();\n}", "title": "" }, { "docid": "f75d142205a4d12bae592118e90cb8e5", "score": "0.65572995", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "4123eecc9bc6ecf013658277659437f7", "score": "0.65463626", "text": "function formatDate(d) {\n return (d.getMonth()+1) + '/' +\n d.getDate() + '/' +\n d.getFullYear();\n }", "title": "" }, { "docid": "4123eecc9bc6ecf013658277659437f7", "score": "0.65463626", "text": "function formatDate(d) {\n return (d.getMonth()+1) + '/' +\n d.getDate() + '/' +\n d.getFullYear();\n }", "title": "" }, { "docid": "ea03d52358b8fabcf7f2f712c56922c0", "score": "0.65461296", "text": "dateCustomFormat(date) {\n let stringDate = '';\n if (date) {\n stringDate += this.isNumber(date.month) ? this.padNumber(date.month) + '/' : '';\n stringDate += this.isNumber(date.day) ? this.padNumber(date.day) + '/' : '';\n stringDate += date.year;\n }\n return stringDate;\n }", "title": "" }, { "docid": "39f537527c46fdb3d37e1d74e6192adf", "score": "0.6544406", "text": "formatDate(date) {\n const splittedDate = date.split('-')\n\n return `${splittedDate[2]}/${splittedDate[1]}/${splittedDate[0]}`\n }", "title": "" }, { "docid": "c3cb7e4b89a1979f37ec05a0d71e6356", "score": "0.6534534", "text": "function formatDate(date) {\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var seconds = date.getSeconds();\n hours = hours < 10 ? '0'+hours : hours;\n minutes = minutes < 10 ? '0'+minutes : minutes;\n seconds = seconds < 10 ? '0'+seconds : seconds;\n var strTime = hours + ':' + minutes+\":\"+seconds;\n\n return date.getFullYear()+\"/\"+myAlign((date.getMonth())+1) + \"/\" + myAlign(date.getDate()) + \" \" + strTime;\n}", "title": "" }, { "docid": "d1ee90248587e2ca6fa2da196a85d812", "score": "0.65345156", "text": "function formatDate(date) {\n\n var dd = date.getDate(); \n if (dd < 10) dd = '0' + dd;\n\n var mm = date.getMonth() + 1; \n if (mm < 10) mm = '0' + mm;\n\n var yy = date.getFullYear(); \n\n return dd + '.' + mm + '.' + yy;\n}", "title": "" }, { "docid": "6fb72b2b2df39391b28ac74e11292244", "score": "0.6529965", "text": "_turnDateToString(date){\n date = date.toLocaleDateString();\n return date;\n }", "title": "" }, { "docid": "19159e7dcfea4b1d2710321ed4628ad7", "score": "0.6526145", "text": "function formatDate(date) {\n let d = new Date(date),\n minutes = '' + (d.getMinutes()),\n hours = '' + (d.getHours()),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (minutes.length < 2) \n minutes = '0' + minutes;\n if (hours.length < 2) \n hours = '0' + hours;\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-') + ' ' + [hours, minutes].join(':');\n}", "title": "" }, { "docid": "17131cad5cab3a4e748bf12ab4deba16", "score": "0.65246737", "text": "function formatDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n return dd + '/' + mm + '/' + yyyy;\n}", "title": "" }, { "docid": "0cc6558880397340612f8b73550fe566", "score": "0.65241814", "text": "function formatDate(d)\n{\n var day = gsDayNames[d.getDay()].substr(0, 3);\n var month = gsMonthNames[d.getMonth()].substr(0, 3);\n \n var date = d.getDate();\n if (date < 10) {\n date = \"0\" + date;\n }\n \n return day + \", \" + month + \" \" + date + \", \" + d.getFullYear();\n}", "title": "" }, { "docid": "d2fcd85033dbfe1307077b0f97813933", "score": "0.6522516", "text": "static _dateFormatter(date) {\n return moment(date).format(\"LL\");\n }", "title": "" }, { "docid": "c1cdb2d96cce9103ff4a3fb69e104339", "score": "0.65170103", "text": "function formatDate(date) {\n\tvar dd = date.getDate();\n\tvar mm = date.getMonth() + 1;\n\tvar yyyy = date.getFullYear();\n\tif (dd < 10) {\n\t\tdd = '0' + dd;\n\t}\n\tif (mm < 10) {\n\t\tmm = '0' + mm;\n\t}\n\tdate = yyyy + '-' + mm + '-' + dd;\n\n\treturn date;\n}", "title": "" }, { "docid": "b62541929acbd8cdcb0efb5d5512bd00", "score": "0.65144545", "text": "function formatDate(date) {\n const d = new Date(date);\n let month = \"\" + (d.getMonth() + 1);\n let day = \"\" + d.getDate();\n const year = d.getFullYear();\n\n if (month.length < 2) month = \"0\" + month;\n if (day.length < 2) day = \"0\" + day;\n\n return [year, month, day].join(\"-\");\n }", "title": "" }, { "docid": "b36508bc17f397b2eda3fc84dc87b120", "score": "0.6503661", "text": "function formattedDate() {\n\tlet dayString;\n\tlet monthString;\n\tswitch (today.getDay()){\n\t\tcase 0:\n\t\t\tdayString = \"Sunday\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tdayString = \"Monday\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdayString = \"Tuesday\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdayString = \"Wednesday\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tdayString = \"Thursday\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tdayString = \"Friday\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tdayString = \"Saturday\";\n\t\t\tbreak;\n\t}\n\n\tswitch (today.getMonth()){\n\t\tcase 0:\n\t\t\tmonthString = \"Jan\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tmonthString = \"Feb\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tmonthString = \"Mar\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tmonthString = \"Apr\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tmonthString = \"May\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tmonthString = \"June\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tmonthString = \"July\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tmonthString = \"Aug\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tmonthString = \"Sept\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tmonthString = \"Oct\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tmonthString = \"Nov\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tmonthString = \"Dec\";\n\t\t\tbreak;\n\t}\n\n\treturn dayString + \", \" + today.getDate() + \" \" + monthString;\n}", "title": "" }, { "docid": "d668d6abef7c13ccf1260a1b6c9328b4", "score": "0.64968777", "text": "function formatDate(date) {\n const d = new Date(date)\n const options = { year: 'numeric', month: 'long', day: 'numeric' }\n return (\n `${d.toLocaleDateString('en-US', options)}`\n )\n }", "title": "" }, { "docid": "b77d801305ef3151fba5a49e1a0305e5", "score": "0.6487022", "text": "function formatDate ( date ) {\n return weekdays[date.getDay()] + \", \" +\n date.getDate() + nth(date.getDate()) + \" \" +\n months[date.getMonth()] + \" \" +\n date.getFullYear();\n}", "title": "" }, { "docid": "ee152e511cf61b64e166820e6fa9995a", "score": "0.6485999", "text": "function formatDate(arg, f2, f3) {\n if (f2 == \"long\") {\n return devhd.date.formatDate(arg, _L(50))\n }\n if (f2 == \"short\") {\n return devhd.date.formatDate(arg, _L(51))\n }\n // short\n return devhd.date.formatDate(arg, _L(52))\n }", "title": "" }, { "docid": "49741f79a55d46958cd16bf94903d7fd", "score": "0.64840615", "text": "function dateFormatter (date, format) {\n //return moment(new Date(date)).format(format);\n return date; // TODO\n }", "title": "" }, { "docid": "a5b34e67c964428cbecac63d2819fe44", "score": "0.64799803", "text": "formatDate( date ) {\n if ( !date ) { return null; }\n\n return moment( date ).format( this.getConfig( 'date_format' ) );\n }", "title": "" }, { "docid": "4deacab12fd60d846f71070d5dab2eaa", "score": "0.6479869", "text": "function formatDate(date) {\r\n var d = new Date(date),\r\n month = '' + (d.getMonth()),\r\n day = '' + d.getDate(),\r\n year = d.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 [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "c6062016ec116b6075ee361a0a20b27c", "score": "0.64796025", "text": "function formatDate() {\n var d = new Date(),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n hour = d.getHours()\n minutes = d.getMinutes()\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day, hour,minutes ].join('_');\n}", "title": "" }, { "docid": "920140fa55ba2c8b5c985dc6b4ab1719", "score": "0.64787066", "text": "formatDate(created) {\r\n let date = new Date(created);\r\n let month = (\"0\"+ (date.getMonth() + 1)).slice(-2);\r\n let day = (\"0\" + date.getDate()).slice(-2);\r\n let year = date.getFullYear();\r\n let hours = (\"0\" + date.getHours()).slice(-2);\r\n let minutes = (\"0\" + date.getMinutes()).slice(-2);\r\n\r\n return `${day}-${month}-${year} ${hours}:${minutes}`;\r\n }", "title": "" }, { "docid": "30d11387523c95d0f182461e52a38056", "score": "0.6476266", "text": "function dateTask2() {\n let d = new Date('2014-8-3 12:59:59');\n let local = d.toLocaleString();\n let day = d.getDate();\n let month = d.getMonth();\n console.log(local.split(', ').reverse().join(' '));\n\n if (day < 10) {\n day = '0' + day;\n }\n\n if (month < 10) {\n month = '0' + (++month);\n }\n\n return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()} ${day}.${month}.${d.getFullYear()}`;\n}", "title": "" }, { "docid": "454a222039505bbfb42789c07f4917e5", "score": "0.64681095", "text": "function formatDate(date) {\n console.log(date);\n const d = new Date(date);\n console.log(d);\n const formattedDate = `${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear()}`;\n return formattedDate;\n}", "title": "" }, { "docid": "fec8426e78480cd7b8249d49215f4932", "score": "0.64648795", "text": "formatDate(date, format) {\n if (!date) {\n return '';\n }\n\n let iFormat;\n const lookAhead = (match) => {\n const matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n },\n formatNumber = (match, value, len) => {\n let num = '' + value;\n if (lookAhead(match)) {\n while (num.length < len) {\n num = '0' + num;\n }\n }\n return num;\n },\n formatName = (match, value, shortNames, longNames) => {\n return (lookAhead(match) ? longNames[value] : shortNames[value]);\n };\n let output = '';\n let literal = false;\n\n if (date) {\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === '\\'' && !lookAhead('\\'')) {\n literal = false;\n } else {\n output += format.charAt(iFormat);\n }\n } else {\n switch (format.charAt(iFormat)) {\n case 'd':\n output += formatNumber('d', this.props.utc ? date.getUTCDate() : date.getDate(), 2);\n break;\n case 'D':\n output += formatName('D', this.props.utc ? date.getUTCDay() : date.getDay(), this.props.locale.dayNamesShort, this.props.locale.dayNames);\n break;\n case 'o':\n if (this.props.utc) {\n output += formatNumber('o',\n Math.round((\n new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()).getTime() -\n new Date(date.getUTCFullYear(), 0, 0).getTime()) / 86400000), 3);\n } else {\n output += formatNumber('o',\n Math.round((\n new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -\n new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);\n }\n break;\n case 'm':\n output += formatNumber('m', (this.props.utc ? date.getUTCMonth() : date.getMonth()) + 1, 2);\n break;\n case 'M':\n output += formatName('M', this.props.utc ? date.getUTCMonth() : date.getMonth(), this.props.locale.monthNamesShort, this.props.locale.monthNames);\n break;\n case 'y':\n output += (lookAhead('y') ? (this.props.utc ? date.getUTCFullYear() : date.getFullYear()) :\n ((this.props.utc ? date.getUTCFullYear() : date.getFullYear()) % 100 < 10 ? '0' : '') +\n (this.props.utc ? date.getUTCFullYear() : date.getFullYear()) % 100);\n break;\n case '@':\n output += date.getTime();\n break;\n case '!':\n output += date.getTime() * 10000 + this.ticksTo1970;\n break;\n case '\\'':\n if (lookAhead('\\'')) {\n output += '\\'';\n } else {\n literal = true;\n }\n break;\n default:\n output += format.charAt(iFormat);\n }\n }\n }\n }\n return output;\n\t}", "title": "" }, { "docid": "3a1f8d05c55e86173c08b9f9a92a856c", "score": "0.6459893", "text": "formatDate(date) {\n let months = [\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 ];\n\n date = new Date(date.replace(/_/g, \"/\"));\n return `${date.getDate()} ${months[date.getMonth()]} ${date.getYear() + 1900}`\n }", "title": "" }, { "docid": "e5d4afd488237fa466b4930ecc2a55aa", "score": "0.6433514", "text": "function formatDate(date) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = ('0' + date.getDate()).slice(-2);\n let hours = ('0' + date.getHours()).slice(-2);\n let minutes = ('0' + date.getMinutes()).slice(-2);\n return `${year}/${month}/${day} ${hours}:${minutes}`;\n}", "title": "" }, { "docid": "1671345c8ce40d8e6c4fe4b601e14722", "score": "0.6430192", "text": "function formatDate() {\n var date = new Date();\n return date.getFullYear() + (\"0\" + (date.getMonth() + 1)).slice(-2) + (\"0\" + date.getDate()).slice(-2);\n}", "title": "" }, { "docid": "74c2db2aad5020ca25173616f2c45a21", "score": "0.6423602", "text": "function DateFormat(ADtDate,AChrStatus){\n\t\t\treturn ADtDate\n\t}", "title": "" }, { "docid": "b477d5a9409a799424432906be785f94", "score": "0.6423592", "text": "function formatDate(currentTime){\n\tvar month = currentTime.getMonth() + 1;\n\tvar day = currentTime.getDate();\n\tvar year = currentTime.getFullYear();\n\tif (day < 10)\n\t\tday = '0' + day.toString();\n\tif (month < 10)\n\t\tmonth = '0' + month.toString();\n\treturn year.toString()+'-'+ month.toString() +'-' + day.toString();\n\n}", "title": "" }, { "docid": "9a11996e3ef12f22cc409ca98da4128a", "score": "0.64209044", "text": "function formatDate(date) {\n let dateStr = date.getUTCFullYear() + '-' +\n pad(date.getUTCMonth() + 1) + '-' +\n pad(date.getUTCDate() + 1)\n return dateStr;\n }", "title": "" }, { "docid": "3f10da3cbf8b7a19dd4ce884e6b5e528", "score": "0.641938", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "889cef3aeb80bf461c2ff63e635d6a5a", "score": "0.6416129", "text": "function formatFrontendDate(date) {\n let p = new Intl.DateTimeFormat('en',{\n year:'numeric',\n month:'2-digit',\n day:'2-digit',\n }).formatToParts(date).reduce((acc, part) => {\n acc[part.type] = part.value;\n return acc;\n }, {});\n \n return `${p.month}/${p.day}/${p.year}`; \n}", "title": "" }, { "docid": "8c2f00cdf9a2cab460ebcc7095500ef3", "score": "0.6413928", "text": "function formatDate(dateObj){\r\n\tvar months = new Array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\r\n\tvar month = months[dateObj.getMonth()];\r\n\tvar day = padString(dateObj.getDate(),2);\r\n\t\r\n//\treturn hours + \":\" + minutes + \":\" + seconds + meridian;\r\n\treturn month + \". \" + day;\r\n}", "title": "" }, { "docid": "7da4f7157eb99d0ce7b717becb27c78b", "score": "0.641248", "text": "function getFormatedDate() {\n\t\tvar date = new Date();\n\t\tvar printStr = (printDate ? getDate(date) + \" \" : \"\") + getTime(date);\n\n\t\treturn printStr;\n\t}", "title": "" }, { "docid": "138af13957939c1d4f9bc34dd91d26c0", "score": "0.6411939", "text": "formatDate(date) {\n if (!date) {\n date = moment();\n }\n return moment(date).format('D [de] MMMM [às] HH:mm');\n }", "title": "" } ]
1126736253b9a976d2c70d645116c6b2
Sort a header object by its title.
[ { "docid": "fc8ccce082c863bf686b800b8c45fe1e", "score": "0.7680153", "text": "function HeaderSort(headers){\n for(let key in headers){\n if(headers.hasOwnProperty(key)){\n let ordered = headers[key].slice(0);\n ordered.sort((a,b) => {\n const x = a.title.toLowerCase();\n const y = b.title.toLowerCase();\n\n return x < y ? -1 : x > y ? 1 : 0; \n });\n\n headers[key] = ordered;\n }\n }\n return headers;\n }", "title": "" } ]
[ { "docid": "fdf45bc4a9e81b243ef7ae21d0e5d72b", "score": "0.66510046", "text": "sortTitle(a, b) {\n var nameA = a.title.toUpperCase();\n var nameB = b.title.toUpperCase();\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0\n }", "title": "" }, { "docid": "562328a4937d938735fb42bb940ed615", "score": "0.66461855", "text": "function sortResourceByTitle(a, b) {\n var textA = a.Title.toUpperCase();\n var textB = b.Title.toUpperCase();\n return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;\n }", "title": "" }, { "docid": "30093dddeac0c667451e85743ab722a4", "score": "0.6384733", "text": "function titleAsc(a, b) {\n if (a.title<b.title) return -1;\n if (a.title===b.title) return 0;\n return 1;\n}", "title": "" }, { "docid": "d79fbe4164e70c53f76e97beb85b7169", "score": "0.63255686", "text": "handleTitlesSort() {\n this.state.sortTitleOrientation = (this.state.sortTitleOrientation == 1) ? -1 : 1;\n let orientation = this.state.sortTitleOrientation;\n \n this.state.moviesFiltred = this.state.moviesFiltred.sort(function(movieA, movieB) {\n return(movieA.fields.name > movieB.fields.name) ? orientation : (movieA.fields.name < movieB.fields.name) ? - orientation : 0;\n });\n\n this.updateListMovies();\n }", "title": "" }, { "docid": "8f283b9f4984cddccbb0dbc421152775", "score": "0.6310238", "text": "sortByTitle() {\n this.state.movieData.sort(function (a, b) {\n if (a.title > b.title) {\n return 1;\n }\n if (b.title > a.title) {\n return -1;\n }\n return 0;\n });\n\n this.state.filterResult.sort(function (a, b) {\n if (a.title > b.title) {\n return 1;\n }\n if (b.title > a.title) {\n return -1;\n }\n return 0;\n });\n\n this.forceUpdate()\n }", "title": "" }, { "docid": "033f5cb73660c84e51559ebf61d7a6b8", "score": "0.62145734", "text": "function sortByTitle(titleHeading){\n titleHeading.addEventListener(\"click\", function(e){\n e.preventDefault();\n let titleHeadingNum = 2;\n tableSort(titleHeadingNum);\n });\n }", "title": "" }, { "docid": "4e76d4fb25c145f1f650a67d4bf3a3c1", "score": "0.61826587", "text": "function compare(a,b) {\n if (a.Title < b.Title)\n return -1;\n if (a.Title > b.Title)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "17a486507a43c19a1efd852591b98e33", "score": "0.6172681", "text": "function compare(a, b) {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "d728cd52548762f69bfdd27642cccdf2", "score": "0.6146122", "text": "function compare(a, b) {\r\n if (a.title < b.title)\r\n return -1;\r\n if (a.title > b.title)\r\n return 1;\r\n return 0;\r\n }", "title": "" }, { "docid": "83fd9e9b37fb028f00a31293a509b85c", "score": "0.60975266", "text": "function sortByTitle(events) {\n return events.slice().sort((eA, eB) => {\n const titleA = eA.title.toUpperCase();\n const titleB = eB.title.toUpperCase();\n\n let index = 0;\n while (titleA.charCodeAt(index) - titleB.charCodeAt(index) === 0) {\n index++;\n }\n return titleA.charCodeAt(index) - titleB.charCodeAt(index);\n });\n}", "title": "" }, { "docid": "f9eb22ff11ead36703c8282ac5dbe4e0", "score": "0.60714614", "text": "function compare(a,b) {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "5c18e51fdcf397467f5f97747c64cc96", "score": "0.6050209", "text": "function compare(a,b){\n if (a.title > b.title)\n return 1;\n if (a.title < b.title)\n return -1;\n return 0;\n}", "title": "" }, { "docid": "3fabaa71a01f2cfb85557c803d3dda8a", "score": "0.5986569", "text": "function byHeader(a,b) {\n a = a['header'].toLowerCase();\n b = b['header'].toLowerCase();\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "ffc167937cdbefedc8edda0a148c149d", "score": "0.5940128", "text": "function sortTitle() {\n animalObj.sort((a, b) => {\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 removeChilds('#main');\n for (let index = 0; index < animalObj.length; index++) {\n animalObj[index].render();\n }\n}", "title": "" }, { "docid": "5d8bb094dad8b2bc7f803bc06049ccee", "score": "0.589528", "text": "function sortByTitleAZ(sortBooks) { \n sortBooks.sort(function(a, b) {\n let txtA = a.bookTitle.toUpperCase()\n let txtB = b.bookTitle.toUpperCase()\n \n return (txtA < txtB) ? -1 : (txtA > txtB) ? 1 : 0\n })\n \n return sortBooks\n }", "title": "" }, { "docid": "7ad9d9738fa9e588c730a06dfb2619df", "score": "0.58825535", "text": "function SortsHeaders(obj, settings) {\n var _this = this;\n\n this.initOnLoad = function() {\n return settings.features.sort;\n };\n\n this.init = function() {\n this.attach();\n };\n\n this.create = function(cell) {\n var $cell = $(cell),\n $link = $('<a></a>', {\n 'class': 'dynatable-sort-header',\n href: '#',\n html: $cell.html()\n }),\n id = $cell.data('dynatable-column'),\n column = utility.findObjectInArray(settings.table.columns, {id: id});\n\n $link.bind('click', function(e) {\n _this.toggleSort(e, $link, column);\n obj.process();\n\n e.preventDefault();\n });\n\n if (this.sortedByColumn($link, column)) {\n if (this.sortedByColumnValue(column) == 1) {\n this.appendArrowUp($link);\n } else {\n this.appendArrowDown($link);\n }\n }\n\n return $link;\n };\n\n this.removeAll = function() {\n obj.$element.find(settings.table.headRowSelector).children('th,td').each(function(){\n _this.removeAllArrows();\n _this.removeOne(this);\n });\n };\n\n this.removeOne = function(cell) {\n var $cell = $(cell),\n $link = $cell.find('.dynatable-sort-header');\n if ($link.length) {\n var html = $link.html();\n $link.remove();\n $cell.html($cell.html() + html);\n }\n };\n\n this.attach = function() {\n obj.$element.find(settings.table.headRowSelector).children('th,td').each(function(){\n _this.attachOne(this);\n });\n };\n\n this.attachOne = function(cell) {\n var $cell = $(cell);\n if (!$cell.data('dynatable-no-sort')) {\n $cell.html(this.create(cell));\n }\n };\n\n this.appendArrowUp = function($link) {\n this.removeArrow($link);\n $link.append(\"<span class='dynatable-arrow'> &#9650;</span>\");\n };\n\n this.appendArrowDown = function($link) {\n this.removeArrow($link);\n $link.append(\"<span class='dynatable-arrow'> &#9660;</span>\");\n };\n\n this.removeArrow = function($link) {\n // Not sure why `parent()` is needed, the arrow should be inside the link from `append()` above\n $link.find('.dynatable-arrow').remove();\n };\n\n this.removeAllArrows = function() {\n obj.$element.find('.dynatable-arrow').remove();\n };\n\n this.toggleSort = function(e, $link, column) {\n var sortedByColumn = this.sortedByColumn($link, column),\n value = this.sortedByColumnValue(column);\n // Clear existing sorts unless this is a multisort event\n if (!settings.inputs.multisort || !utility.anyMatch(e, settings.inputs.multisort, function(evt, key) { return e[key]; })) {\n this.removeAllArrows();\n obj.sorts.clear();\n }\n\n // If sorts for this column are already set\n if (sortedByColumn) {\n // If ascending, then make descending\n if (value == 1) {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.add(column.sorts[i], -1);\n }\n this.appendArrowDown($link);\n // If descending, remove sort\n } else {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.remove(column.sorts[i]);\n }\n this.removeArrow($link);\n }\n // Otherwise, if not already set, set to ascending\n } else {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.add(column.sorts[i], 1);\n }\n this.appendArrowUp($link);\n }\n };\n\n this.sortedByColumn = function($link, column) {\n return utility.allMatch(settings.dataset.sorts, column.sorts, function(sorts, sort) { return sort in sorts; });\n };\n\n this.sortedByColumnValue = function(column) {\n return settings.dataset.sorts[column.sorts[0]];\n };\n }", "title": "" }, { "docid": "7ad9d9738fa9e588c730a06dfb2619df", "score": "0.58825535", "text": "function SortsHeaders(obj, settings) {\n var _this = this;\n\n this.initOnLoad = function() {\n return settings.features.sort;\n };\n\n this.init = function() {\n this.attach();\n };\n\n this.create = function(cell) {\n var $cell = $(cell),\n $link = $('<a></a>', {\n 'class': 'dynatable-sort-header',\n href: '#',\n html: $cell.html()\n }),\n id = $cell.data('dynatable-column'),\n column = utility.findObjectInArray(settings.table.columns, {id: id});\n\n $link.bind('click', function(e) {\n _this.toggleSort(e, $link, column);\n obj.process();\n\n e.preventDefault();\n });\n\n if (this.sortedByColumn($link, column)) {\n if (this.sortedByColumnValue(column) == 1) {\n this.appendArrowUp($link);\n } else {\n this.appendArrowDown($link);\n }\n }\n\n return $link;\n };\n\n this.removeAll = function() {\n obj.$element.find(settings.table.headRowSelector).children('th,td').each(function(){\n _this.removeAllArrows();\n _this.removeOne(this);\n });\n };\n\n this.removeOne = function(cell) {\n var $cell = $(cell),\n $link = $cell.find('.dynatable-sort-header');\n if ($link.length) {\n var html = $link.html();\n $link.remove();\n $cell.html($cell.html() + html);\n }\n };\n\n this.attach = function() {\n obj.$element.find(settings.table.headRowSelector).children('th,td').each(function(){\n _this.attachOne(this);\n });\n };\n\n this.attachOne = function(cell) {\n var $cell = $(cell);\n if (!$cell.data('dynatable-no-sort')) {\n $cell.html(this.create(cell));\n }\n };\n\n this.appendArrowUp = function($link) {\n this.removeArrow($link);\n $link.append(\"<span class='dynatable-arrow'> &#9650;</span>\");\n };\n\n this.appendArrowDown = function($link) {\n this.removeArrow($link);\n $link.append(\"<span class='dynatable-arrow'> &#9660;</span>\");\n };\n\n this.removeArrow = function($link) {\n // Not sure why `parent()` is needed, the arrow should be inside the link from `append()` above\n $link.find('.dynatable-arrow').remove();\n };\n\n this.removeAllArrows = function() {\n obj.$element.find('.dynatable-arrow').remove();\n };\n\n this.toggleSort = function(e, $link, column) {\n var sortedByColumn = this.sortedByColumn($link, column),\n value = this.sortedByColumnValue(column);\n // Clear existing sorts unless this is a multisort event\n if (!settings.inputs.multisort || !utility.anyMatch(e, settings.inputs.multisort, function(evt, key) { return e[key]; })) {\n this.removeAllArrows();\n obj.sorts.clear();\n }\n\n // If sorts for this column are already set\n if (sortedByColumn) {\n // If ascending, then make descending\n if (value == 1) {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.add(column.sorts[i], -1);\n }\n this.appendArrowDown($link);\n // If descending, remove sort\n } else {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.remove(column.sorts[i]);\n }\n this.removeArrow($link);\n }\n // Otherwise, if not already set, set to ascending\n } else {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.add(column.sorts[i], 1);\n }\n this.appendArrowUp($link);\n }\n };\n\n this.sortedByColumn = function($link, column) {\n return utility.allMatch(settings.dataset.sorts, column.sorts, function(sorts, sort) { return sort in sorts; });\n };\n\n this.sortedByColumnValue = function(column) {\n return settings.dataset.sorts[column.sorts[0]];\n };\n }", "title": "" }, { "docid": "7ad9d9738fa9e588c730a06dfb2619df", "score": "0.58825535", "text": "function SortsHeaders(obj, settings) {\n var _this = this;\n\n this.initOnLoad = function() {\n return settings.features.sort;\n };\n\n this.init = function() {\n this.attach();\n };\n\n this.create = function(cell) {\n var $cell = $(cell),\n $link = $('<a></a>', {\n 'class': 'dynatable-sort-header',\n href: '#',\n html: $cell.html()\n }),\n id = $cell.data('dynatable-column'),\n column = utility.findObjectInArray(settings.table.columns, {id: id});\n\n $link.bind('click', function(e) {\n _this.toggleSort(e, $link, column);\n obj.process();\n\n e.preventDefault();\n });\n\n if (this.sortedByColumn($link, column)) {\n if (this.sortedByColumnValue(column) == 1) {\n this.appendArrowUp($link);\n } else {\n this.appendArrowDown($link);\n }\n }\n\n return $link;\n };\n\n this.removeAll = function() {\n obj.$element.find(settings.table.headRowSelector).children('th,td').each(function(){\n _this.removeAllArrows();\n _this.removeOne(this);\n });\n };\n\n this.removeOne = function(cell) {\n var $cell = $(cell),\n $link = $cell.find('.dynatable-sort-header');\n if ($link.length) {\n var html = $link.html();\n $link.remove();\n $cell.html($cell.html() + html);\n }\n };\n\n this.attach = function() {\n obj.$element.find(settings.table.headRowSelector).children('th,td').each(function(){\n _this.attachOne(this);\n });\n };\n\n this.attachOne = function(cell) {\n var $cell = $(cell);\n if (!$cell.data('dynatable-no-sort')) {\n $cell.html(this.create(cell));\n }\n };\n\n this.appendArrowUp = function($link) {\n this.removeArrow($link);\n $link.append(\"<span class='dynatable-arrow'> &#9650;</span>\");\n };\n\n this.appendArrowDown = function($link) {\n this.removeArrow($link);\n $link.append(\"<span class='dynatable-arrow'> &#9660;</span>\");\n };\n\n this.removeArrow = function($link) {\n // Not sure why `parent()` is needed, the arrow should be inside the link from `append()` above\n $link.find('.dynatable-arrow').remove();\n };\n\n this.removeAllArrows = function() {\n obj.$element.find('.dynatable-arrow').remove();\n };\n\n this.toggleSort = function(e, $link, column) {\n var sortedByColumn = this.sortedByColumn($link, column),\n value = this.sortedByColumnValue(column);\n // Clear existing sorts unless this is a multisort event\n if (!settings.inputs.multisort || !utility.anyMatch(e, settings.inputs.multisort, function(evt, key) { return e[key]; })) {\n this.removeAllArrows();\n obj.sorts.clear();\n }\n\n // If sorts for this column are already set\n if (sortedByColumn) {\n // If ascending, then make descending\n if (value == 1) {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.add(column.sorts[i], -1);\n }\n this.appendArrowDown($link);\n // If descending, remove sort\n } else {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.remove(column.sorts[i]);\n }\n this.removeArrow($link);\n }\n // Otherwise, if not already set, set to ascending\n } else {\n for (var i = 0, len = column.sorts.length; i < len; i++) {\n obj.sorts.add(column.sorts[i], 1);\n }\n this.appendArrowUp($link);\n }\n };\n\n this.sortedByColumn = function($link, column) {\n return utility.allMatch(settings.dataset.sorts, column.sorts, function(sorts, sort) { return sort in sorts; });\n };\n\n this.sortedByColumnValue = function(column) {\n return settings.dataset.sorts[column.sorts[0]];\n };\n }", "title": "" }, { "docid": "7cfa87ddff633f480747608cf8285349", "score": "0.58513165", "text": "function comptitle(a, b) {\n return a.title > b.title;\n}", "title": "" }, { "docid": "d21217ab531f2be297756fe6b8b01c64", "score": "0.58373815", "text": "function sortTitle() {\r\n document.querySelector('#titleH').addEventListener('click', function (e) {\r\n const title = paintings.sort((a, b) => {\r\n return a.Title < b.Title ? -1 : 1;\r\n })\r\n displayPaint(title);\r\n })\r\n }", "title": "" }, { "docid": "386e100fb28e04be983357f58b8825e1", "score": "0.57908535", "text": "function orderAlphabetically(titles) {\n for (let i=0; 1 <21 ; i++) {\n let order = titles.sort (function(a,b){\n if (a.title > b.title){\n return 1;\n }\n else if(a.title < b.title) {\n return -1;\n }\n else {\n return 0;\n }\n })\n }\n}", "title": "" }, { "docid": "70db9dd288f541fcea2d5a9c70d74436", "score": "0.57600296", "text": "function sortByName(headitem) {\n\n\tvar items = $('.listviewer-item');\n\titems.sort(function(a, b){\n\t\tvar name1 = jQuery(a).children().eq(1).text();\n\t\tvar name2 = jQuery(b).children().eq(1).text();\n\t\tif(nameAscending){\n\t\t\treturn name1.localeCompare(name2);\n\t\t}\n\t\telse{\n\t\t\treturn name2.localeCompare(name1);\n\t\t}\n\t})\n \n\tvar indices = new Array();\n\tfor(var i = 0; i<items.length; i++){\n\t\tindices.push(items[i].id);\n\t}\n \n\tvar obj = {\n\t\tid: indices[0],\n\t\tdirection: \"\",\n\t\tindices: indices\n\t}\n \n\tresetListViewerHeadItem();\n\n\tif(nameAscending){\n\t\tnameAscending = false;\n\t\tjQuery(headitem).text(\"Name ▲\");\n\t}\n\telse{\n\t\tnameAscending = true;\n\t\tjQuery(headitem).text(\"Name ▼\");\n\t}\n\n\tjQuery(\".listviewer-item\").remove();\n\tjQuery(items).insertAfter(\".listviewer-head\");\n\n\tsendRequest(\"Order\", obj, \"\", \"nonModalUpdater\", null, null, \"explorer\");\n}", "title": "" }, { "docid": "e78a941cecb8749462ffd528b73879d1", "score": "0.5759882", "text": "function orderAlphabetically(titles) {\n let colone = JSON.parse( JSON.stringify(titles) )\n\n colone.sort ((first, second) =>{\n if (first.title > second.title) {\n return 1\n }\n else if (first.title < second.title) {\n return -1\n }\n else {\n return 0\n }\n \n });\n let moviesTitle = colone.map((movies) => {\n return movies.title;\n }); \n\n if (moviesTitle.length > 20) {\n let first20Titles = moviesTitle.slice(0, 20);\n return first20Titles;\n}\nreturn moviesTitle;\n\n \n\n}", "title": "" }, { "docid": "46f967c910057aae0f11af2f75c8a9d9", "score": "0.572653", "text": "function sortNotes(notes) {\n notes.sort(function(a, b) {\n if( String(a.title).toLowerCase() < String(b.title).toLowerCase()) {\n return -1\n } else if (String(a.title).toLowerCase() > String(b.title).toLowerCase()) {\n return 1\n }\n\n return 0\n })\n}", "title": "" }, { "docid": "dab04477c662b2fd0250d1de6937ca30", "score": "0.5717217", "text": "function sortByTitleZA(sortBooks) { \n sortBooks.sort(function(a, b) {\n let txtA = a.bookTitle.toUpperCase()\n let txtB = b.bookTitle.toUpperCase()\n \n return (txtA < txtB) ? -1 : (txtA > txtB) ? 1 : 0\n })\n\n sortBooks.reverse() \n return sortBooks\n }", "title": "" }, { "docid": "64df8438b40c848a461e92abb49fed06", "score": "0.56786793", "text": "function AlphapeticalSorter(a, b) {\n let textA = a.title.toUpperCase();\n let textB = b.title.toUpperCase();\n return textA.localeCompare(textB);\n}", "title": "" }, { "docid": "746ac8704bea4e352f1cdca2f59c92ae", "score": "0.5673143", "text": "function sortByName(o1, o2) {\n return o1.name > o2.name;\n}", "title": "" }, { "docid": "2291a014484ba18ccac6e80d4e18bc5a", "score": "0.5658745", "text": "function orderAlphabetically(movies) {\n let clone = JSON.parse(JSON.stringify(movies))\n\n clone.sort((first, second) => {\n if (first.title > second.title){\n return 1\n }\n else if (first.title < second.title){\n return -1\n }\n else {\n return 0\n }\n })\n\n let titles = clone.map((element) => {\n return element.title\n })\n\n return titles.slice(0, 20)\n}", "title": "" }, { "docid": "bebfa6c026551e1a1429676cd9efcaab", "score": "0.56206405", "text": "function compareTitles(a, b) {\r\n\tif (a.getTitle().toLowerCase() >= b.getTitle().toLowerCase()) {\r\n\t\treturn 1;\r\n\t}\r\n\telse {\r\n\t\treturn -1;\r\n\t}\r\n}", "title": "" }, { "docid": "3e5de4d4828fb06cf5e447ab0c649201", "score": "0.56127226", "text": "function sortByTitle(projects) {\n projects.sort((a, b) => {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n if (a.title === b.title) {\n if (a.institution < b.institution) {\n return -1;\n }\n if (a.institution > b.institution) {\n return 1;\n }\n }\n });\n}", "title": "" }, { "docid": "83cb9c986d577becb085623e0571b679", "score": "0.5578833", "text": "function orderByYear(movies) {\n return movies.sort(function compare( a, b ) {\n if ( a.year < b.year ){\n return -1;\n } else if ( a.year > b.year ){\n return 1;\n } else if (a.year === b.year){\n if(a.title < b.title){\n return -1;\n } else if(a.title > b.title){\n return 1\n }\n }\n return 0;\n});\n}", "title": "" }, { "docid": "1aca9d2045b2846eae2eb351d81307cb", "score": "0.557231", "text": "function sortByName(obj) {\n return obj.sort(function(a,b){\n return a.name > b.name;\n })\n }", "title": "" }, { "docid": "be4df8be234142dbfa53cf1279cbc1eb", "score": "0.5525456", "text": "function groupByTitle() {\n let sortTitle = _.uniqBy(_.map(users, function (user) {\n return { title: user.title };\n }), \"title\");\n _.each(sortTitle, function (user) {\n return _.assign(user, { users: getTitleUsers(user.title) });\n })\n return sortTitle;\n}", "title": "" }, { "docid": "7bc1212224031582ca9dfcdb1559b1f1", "score": "0.5442179", "text": "function orderByYear(movies) {\n let cloneMovies = [...movies];\n\n cloneMovies.sort(function (a, b) {\n if (a.year === b.year) {\n if (a.title.toUpperCase() < b.title.toUpperCase()) {\n //console.log(-1, a.title.toUpperCase());\n return -1;\n }\n if (a.title.toUpperCase() > b.title.toUpperCase()) {\n //console.log(1);\n return 1;\n }\n if (a.title.toUpperCase() === b.title.toUpperCase()) {\n return 0;\n }\n }\n\n return a.year - b.year;\n });\n\n return cloneMovies;\n}", "title": "" }, { "docid": "cf4ea75debf4e5cbed78738fe62c2109", "score": "0.5420827", "text": "function ossSortByName(a, b)\n{\n\tvar aName = a.name.toLowerCase();\n\tvar bName = b.name.toLowerCase();\n\treturn ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));\n}", "title": "" }, { "docid": "1b3f9709d1d56818dd6be00eead22459", "score": "0.5415769", "text": "intialSortBytitle(storedItemList) {\n storedItemList.sort(function (a, b) {\n if (a.title > b.title) {\n return 1;\n }\n if (b.title > a.title) {\n return -1;\n }\n return 0;\n });\n\n this.setState( {movieData: storedItemList } );\n }", "title": "" }, { "docid": "90b95f82387bdd3d0fcf29e9e81da770", "score": "0.54067916", "text": "function mySortAsc(a, b) {\n if (a.fullName > b.fullName) {\n return 1\n }\n if (a.fullName < b.fullName) {\n return -1\n }\n return 0\n}", "title": "" }, { "docid": "9849c7fd0df278074100b8f21e3705b8", "score": "0.54033536", "text": "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}", "title": "" }, { "docid": "d935f6140d05d95465eb1b6efd96e6f8", "score": "0.5396304", "text": "function orderAlphabetically(array){\n var orderedArray = array.sort(function(a,b){\n if(a.title > b.title) return 1;\n if(a.title < b.title) return -1;\n });\n return orderedArray;\n }", "title": "" }, { "docid": "68c873828e6694853c986e799faf9866", "score": "0.53943384", "text": "function orderAlphabetically(movies) {\n const moviesClone = [...movies];\n\n moviesClone.sort((first, second) => {\n // sort by title\n if(first.title > second.title) { \n return 1;\n }\n else if (first.title < second.title) {\n return -1;\n }\n\n return 0;\n });\n\n return moviesClone.map(movie => movie.title).slice(0, 20);\n}", "title": "" }, { "docid": "93a917595b0ad1b381d9af2ec6c69de8", "score": "0.53778243", "text": "function orderAlphabetically(data){\n var filterAlpha = data.sort(function(a,b){\n if(a.title > b.title){\n return 1;\n }else{\n return -1;\n }\n });\n \n\n var onlyTitle = filterAlpha.map(function(a){\n return a.title;\n });\n\n return onlyTitle.slice(0,20);\n}", "title": "" }, { "docid": "1cbdc98300fce41c22da283b1594af75", "score": "0.53664494", "text": "function sort_by_name(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "1049901abe852a99076cef221a440f97", "score": "0.5358036", "text": "function SortByName(a, b){\n var aName = a.name.toLowerCase();\n var bName = b.name.toLowerCase(); \n return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));\n}", "title": "" }, { "docid": "9f43c063c04506dd85d0006dd5c8c22c", "score": "0.53522533", "text": "function orderAlphabetically(movies) {\n movies.sort(function(objA, objB) {\n if (objA.title < objB.title) {\n return -1;\n }\n if (objA.title > objB.title) {\n return 1;\n }\n if (objA.title === objB.title) {\n return 0;\n }\n });\n\n newList = movies.splice(0, 19);\n console.log(\"newList :\", newList);\n}", "title": "" }, { "docid": "f9849c78c9e7caa806682df1a9dbe545", "score": "0.53467757", "text": "function sort_by_name(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "f9849c78c9e7caa806682df1a9dbe545", "score": "0.53467757", "text": "function sort_by_name(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "f9849c78c9e7caa806682df1a9dbe545", "score": "0.53467757", "text": "function sort_by_name(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "f9849c78c9e7caa806682df1a9dbe545", "score": "0.53467757", "text": "function sort_by_name(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "f9849c78c9e7caa806682df1a9dbe545", "score": "0.53467757", "text": "function sort_by_name(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "bf0970da2a622fdc8d67dbfb688dee66", "score": "0.53445023", "text": "function orderAlphabetically(movies) {\n var sortedArray = movies.sort(function(a, b) {\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 var titlesArray = sortedArray.map(function(movie) {\n return movie.title;\n });\n return titlesArray.splice(0, 20);\n}", "title": "" }, { "docid": "5bd594005a70ecb19c0956752913efd2", "score": "0.53305167", "text": "function compare(a, b) {\n\t\t\t\t const titleA = a.title.rendered.toUpperCase();\n\t\t\t\t const titleB = b.title.rendered.toUpperCase();\n\n\t\t\t\t let comparison = 0;\n\t\t\t\t if (titleA > titleB) {\n\t\t\t\t comparison = 1;\n\t\t\t\t } else if (titleA < titleB) {\n\t\t\t\t comparison = -1;\n\t\t\t\t }\n\t\t\t\t return comparison;\n\t\t\t\t }", "title": "" }, { "docid": "d8bfdfac143d7403014adb50911124ce", "score": "0.5307325", "text": "function sort(obj) {\r\n return obj.sort(function (a, b) { return a.companyName > b.companyName })\r\n}", "title": "" }, { "docid": "a1dc1ca4b11acb0034058f661c5b4064", "score": "0.52975124", "text": "function orderAlphabetically(arr) {\n let arrCopy = JSON.parse(JSON.stringify(arr));\n\n let sortedMovies = arrCopy.sort(function(a, b) {\n if (a.title.localeCompare(b.title) >= 0) {\n return 1;\n }\n return -1;\n\n //return a.title - b.title; (won't work)\n });\n\n let first20 = sortedMovies.filter(function(moviesObj) {\n if (sortedMovies.indexOf(moviesObj) < 20) {\n return true;\n }\n });\n\n let first20title = first20.map(function(moviesObj) {\n return moviesObj.title;\n });\n\n return first20title;\n}", "title": "" }, { "docid": "19d44e91299098dd2968e1c8f8a3b812", "score": "0.52935606", "text": "function sortByName(a, b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n \n}", "title": "" }, { "docid": "fea9f8a3dbc012cdf518bbcd126e6626", "score": "0.52785987", "text": "function orderAlphabetically(movies){\n let clonedArr = JSON.parse(JSON.stringify(movies))\n\n clonedArr.sort((elem1, elem2) => {\n if(elem1.title > elem2.title){\n return 1\n }\n else if(elem1.title < elem2.title){\n return -1\n }else{\n return 0\n }\n })\n let names = clonedArr.map((elem, index) => {\n return elem.title\n })\n return names.splice(0,20)\n}", "title": "" }, { "docid": "c3b57206791b2188759a1639d323d5d5", "score": "0.5269539", "text": "byTaskTitle() {\n return this.sortByColumn(\"title\", \"byTaskTitle\");\n }", "title": "" }, { "docid": "3eb7d6c0b1366e8a64cd6a6630a45ff6", "score": "0.5267693", "text": "function sortByName(a, b) {\n if (a.name > b.name) {\n return 1;\n } else if (a.name < b.name) {\n return -1;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "8a9e9d6d314b9e63b9d71e78795cdf7b", "score": "0.5255667", "text": "function orderAlphabetically(movies) {\n return movies.sort(function (movie1,movie2) {\n if(movie1.title > movie2.title) { \n return -1; }\n if(movie1.title < movie2.title) { \n return 1; }\n return 0;\n }).slice (0,20).map(function(movie) {\n return movie.title;\n })\n}", "title": "" }, { "docid": "57c27a64609e02a551655b87d82617f8", "score": "0.52475286", "text": "function SortByName(a, b){\n var aName = a.name.toLowerCase();\n var bName = b.name.toLowerCase(); \n return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));\n }", "title": "" }, { "docid": "2ecd6f5572062a9fe37860198adc0cc5", "score": "0.5240602", "text": "function sortAsc(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "2f88e0e56286bf5420bb169d9d6bcfea", "score": "0.52353203", "text": "function compareTitles($a, $b) {\n const a = $a.attr('data-title') || '';\n const b = $b.attr('data-title') || '';\n return a.localeCompare(b);\n}", "title": "" }, { "docid": "a874aedb9bfbc0d4c3afdc37286fe551", "score": "0.5233869", "text": "function orderAlphabetically(arrOfMoviesToBeSorted) {\n let titlesAlphabetically = ((arrOfMoviesToBeSorted.sort((a,b)=>{\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n // a must be equal to b\n return 0;\n })).map(item => item.title)).slice(0,20)\n\nreturn titlesAlphabetically\n}", "title": "" }, { "docid": "3610361ea0148a67cde1174cb3979e03", "score": "0.52336085", "text": "function sortByDate(headitem) {\n\n\tvar items = $('.listviewer-item');\n\titems.sort(function(a, b){\n\t\tvar dateString1 = jQuery(a).children().eq(5).text();\n\t\tvar dateString2 = jQuery(b).children().eq(5).text();\n\t\tvar date1 = stringToDate(dateString1);\n\t\tvar date2 = stringToDate(dateString2);\n\n\t\tif(dateAscending){\n\t\t\treturn date2.getTime() - date1.getTime();\n\t\t}\n\t\telse{\n\t\t\treturn date1.getTime() - date2.getTime();\n\t\t}\n\t})\n\n\tvar indices = new Array();\n\tfor(var i = 0; i<items.length; i++){\n\t\tindices.push(items[i].id);\n\t}\n\n\tvar obj = {\n\t\tid: indices[0],\n\t\tdirection: \"\",\n\t\tindices: indices\n\t}\n\n\tresetListViewerHeadItem();\n\n\tif(dateAscending){\n\t\tdateAscending = false;\n\t\tjQuery(headitem).text(\"Änderungsdatum ▼\");\n\t}\n\telse{\n\t\tdateAscending = true;\n\t\tjQuery(headitem).text(\"Änderungsdatum ▲\");\n\t}\n\n\tjQuery(\".listviewer-item\").remove();\n\tjQuery(items).insertAfter(\".listviewer-head\");\n\n\tsendRequest(\"Order\", obj, \"\", \"nonModalUpdater\", null, null, \"explorer\");\n}", "title": "" }, { "docid": "209a727bf165e5d49f91c8740328e189", "score": "0.52298945", "text": "function sortHeaders(headers) {\n syncFinished = false; // prevent an interruption by a new block received\n headCache = {}; // clear the chache ?\n var invs = []; // used in p2p request for data\n bc = 0; // clear the full block counter\n var fork = false;\n headers.forEach( function(header) {\n var prevHash = convHash(header.prevHash);\n if (prevHash === bestHash) {\n bestHash = header.hash;\n bestIndex++;\n headCache[prevHash] = { _id: bestHash, i: bestIndex };\n var copybuf = Buffer.from(bestHash, 'hex').reverse();\n invs.push( {type: 2, hash: copybuf} );\n }\n else {\n fork = true;\n }\n });\n if (!fork)\n askBlocks(invs);\n else\n treatFork();\n}", "title": "" }, { "docid": "1b82ca83fe3fa6d75fc3500bf5d4459e", "score": "0.5229182", "text": "function getSortedMovieList (movieList,sortType,sortBy) {\n\t\tvar movieTitleList = [];\n\t\tmovieList.sort(function(obj1, obj2) {\n\t\t\tvar x = obj1[sortBy]; var y = obj2[sortBy];\n\t\t\tif(sortType === 'descending'){\n\t\t\t\treturn ((y < x) ? -1 : ((y > x) ? 1 : 0));\n\t\t\t}\n\t\t\treturn ((x < y) ? -1 : ((x > y) ? 1 : 0)); \n\t\t});\n\t\tmovieTitleList = fetchMovieTitles(movieList);\n\t\treturn movieTitleList;\n\t}", "title": "" }, { "docid": "af797b25841e99cafedaf4037dc28313", "score": "0.52236074", "text": "function orderByYear(movies) {\n let colone = JSON.parse( JSON.stringify(movies) )\n\n colone.sort ((first, second) =>{\n if (first.year > second.year) {\n return 1\n }\n else if (first.year < second.year) {\n return -1\n }\n else {\n if (first.title > second.title){\n return 1\n }\n else if (first.title < second.title){\n return -1\n }\n else {\n return 0\n }\n \n }\n })\n return colone\n}", "title": "" }, { "docid": "379d7a445e9e961539fe6b7840fa4d2d", "score": "0.5217275", "text": "function sortTitle(){\n books.sort(compare);\n\n function compare(a,b) {\n if(a.title > b.title){\n return 1;\n } else if (a.title < b.title){\n return -1;\n }\n allBooks;\n }\n\n document.getElementById('bookResult').innerHTML = '';\n var i=0\n for (i=0; i < books.length; i++ ){\n displayBooks(i);\n }\n\n}", "title": "" }, { "docid": "de2e5e5705102b31bb52ccfc005201e1", "score": "0.5213498", "text": "function orderAlphabetically(arr) {\n const titles = arr.sort((b, d) => {\n if (b.title > d.title) return 1;\n if (b.title < d.title) return -1;\n return 0;\n });\nreturn titles.slice(0, 20);\n}", "title": "" }, { "docid": "4819216acfea334fb1b1d994be9a4893", "score": "0.5204408", "text": "function orderByYear(movies) {\n const sorted = JSON.parse(JSON.stringify(movies)).sort(function (a, b) {\n if (a.year !== b.year) {\n return a.year - b.year;\n } else {\n return a.title.localeCompare(b.title);\n }\n });\n return sorted;\n}", "title": "" }, { "docid": "cf88dfb6a9815b782717eaad6454f044", "score": "0.5195139", "text": "function sortByText(messageObj){\n messageObj.message.sort(function (a, b) {\n if (a.text > b.text) {\n return 1;\n }\n if (a.text < b.text) {\n return -1;\n }\n // a equal to b\n return 0;\n });\n }", "title": "" }, { "docid": "415217e90c5959170a8aa98f5da6f957", "score": "0.51950413", "text": "function orderAlphabetically(movie){\n return [...movie].sort((a,b)=>{\n return a.title.localeCompare(b.title);\n }).filter((element,index) =>{ return index < 20} ).map(element => element.title)\n}", "title": "" }, { "docid": "6f589478aaccb90d7e3b9b8acf56cb0d", "score": "0.519485", "text": "function orderAlphabetically(movies){ \n const mappedArr = movies.map(function(movie){\n return {\n title: movie.title\n } \n })\n const sortedtitle = mappedArr.sort(function(a,b){\n return a.title.localeCompare(b.title);\n })\n return sortedtitle.slice(0,20);\n}", "title": "" }, { "docid": "218bc784eddcdfd4f7c07cf4ee63bdae", "score": "0.5191923", "text": "function orderAlphabetically (movies) {\n let order = movies.sort(function (firstMovie, secondMovie) {\n if (firstMovie.title > secondMovie.title) {\n return 1;\n } else if (firstMovie.title < secondMovie.title) {\n return -1;\n } else {\n return 0;\n }\n });\n \n return order.map(function (movies) {\n return movies.title\n }).slice(0, 20);\n}", "title": "" }, { "docid": "3146a99712975521688571162de76f7d", "score": "0.5182788", "text": "function sortNotesByTitle() {\n document.querySelector(\"#sort-by-body\").innerHTML = \"Sort A-Z by body: Off\";\n document.querySelector(\"#sort-by-title\").innerHTML = \"Sort A-Z by title: On\";\n document.querySelector(\"#sort-by-body\").classList =\n \"btn btn-secondary\";\n document.querySelector(\"#sort-by-title\").classList =\n \"btn btn-primary\";\n http\n .get(\"http://localhost:3000/notes\")\n .then(notes => notes.sort(sortByProperty(\"title\")))\n .then(data => ui.showNotes(data))\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "518595765bc136db9cb014ae95901707", "score": "0.5180512", "text": "function sortAlphabetically(a, b) {\n // sort the list\n if (a.name > b.name) {\n return 1;\n } else if (b.name > a.name) {\n return -1;\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "e5ddf2680c61fa8c0b785302c461fb00", "score": "0.5175185", "text": "function orderAlphabetically (movies){\n let first = movies.sort(function(movieA,movieB){\n if(movieA.title < movieB.title){\n return -1\n } else if (movieA.duration > movieB.duration) {\n \n \n return +1\n } else {\n if (movieA.title < movieB.title){\n return -1\n } else {\n return +1}\n }\n });var newArray = [];\n first.forEach(function (oneElement) {\n newArray.push(oneElement.title);\n })\n return newArray.splice(0,20)\n }", "title": "" }, { "docid": "9d1302c2696f1cf2170332c11c19efaa", "score": "0.5171384", "text": "function orderByYear(movies) {\n const moviesClone = [...movies]; // JSON.parse(JSON.stringify(movies))\n \n moviesClone.sort((first, second) => {\n // sort by year\n if(first.year > second.year) { \n return 1;\n }\n else if (first.year < second.year) {\n return -1;\n }\n\n // sort by title\n if(first.title > second.title) { \n return 1;\n }\n else if (first.title < second.title) {\n return -1;\n }\n\n return 0;\n });\n\n return moviesClone;\n}", "title": "" }, { "docid": "e5de1b145629040d54eb2ab2005b01ce", "score": "0.5168654", "text": "function orderAlphabetically(arr) {\n let sorted = arr.sort((a, b) => {\n let titleA = a.title.toLowerCase();\n let titleB = b.title.toLowerCase();\n if (titleA < titleB) {\n return -1;\n } else if (titleA > titleB) {\n return 1;\n }\n return 0;\n });\n if (sorted.length < 20) {\n return sorted.slice(0, 20).map(movie => movie.title);\n } else if (sorted.length > 20) {\n return sorted.slice(0, 20).map(movie => movie.title);\n }\n}", "title": "" }, { "docid": "ed93b0fe204855b1bfe51abf7ee0fda9", "score": "0.5165277", "text": "function sortName(a,b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "eb46de9a2629ea764d05c72225bfc205", "score": "0.51601756", "text": "function sortBooks (md, cb){\n var url, id, thisTitle, _cb, _md;\n \n exports.sortedBooks = [ ];\n\n _cb = (typeof md == 'function') ? md : cb;\n _md = (typeof md == 'function') ? null : md;\n \n for (url in exports.Books) {\n for (id in exports.Books[url]) {\n thisTitle = exports.Books[url][id].product + ' - ' + exports.Books[url][id].title;\n exports.sortedBooks.push({ title : thisTitle, url: url, id: id});\n }\n }\n exports.sortedBooks.sort( function (a, b){\n var titleA = a.title.toLowerCase(), titleB = b.title.toLowerCase();\n if (titleA < titleB)\n return -1;\n if (titleA > titleB)\n return 1;\n return 0;\n });\n\n if (_cb) { return _cb(null, _md)};\n}", "title": "" }, { "docid": "ea2dd0230e4d60f73a0ec54defcd127d", "score": "0.5135249", "text": "function SortByNames(a, b, c) {\n var aName = \"x\";\n var bName = \"x\";\n if (aName != undefined)\n {\n aName = a.Kirchkreis.toLowerCase();\n }\n if (bName != undefined) {\n bName = b.Kirchbereich.toLowerCase();\n }\n\n return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));\n}", "title": "" }, { "docid": "4c08066f81d327afcf1d1c454156ecfc", "score": "0.5131069", "text": "changeSortIcon(title, headerId) {\n if (this.state.sortBy === headerId) {\n title += this.state.descending ? '\\u2193' : '\\u2191'\n }\n return title;\n }", "title": "" }, { "docid": "a4db4c34cbacc92cb375258581247da1", "score": "0.51293707", "text": "sortingFirstName(a, b) {\n if (a.name.first < b.name.first) {\n return -1;\n }\n if (a.name.first > b.name.first) {\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "73a6d828e0476e0c89779aa7c46a41da", "score": "0.5128457", "text": "function SortByName(a, b) {\n var aName = a.toLowerCase();\n var bName = b.toLowerCase();\n return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));\n }", "title": "" }, { "docid": "6a58916266eb17755a18d2d5d93ac659", "score": "0.5124722", "text": "function ClusterSort(clusters){\n for(let key in clusters){\n if(clusters.hasOwnProperty(key)){\n let ordered = clusters[key].slice(0);\n\n ordered.sort(function(a,b){\n const x = a.header.title.toLowerCase();\n const y = b.header.title.toLowerCase();\n\n return x < y ? -1 : x > y ? 1 : 0; \n });\n\n clusters[key] = ordered;\n }\n }\n return clusters;\n }", "title": "" }, { "docid": "13b7acde8a88b4a390f6fb78ff417f01", "score": "0.5124016", "text": "sortByName(a, b) {\n if (a.name < b.name)\n return -1;\n if (a.name > b.name)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "10479398e180942528ace851003ef24a", "score": "0.5112324", "text": "function sortTypes(typeA, typeB) {\n const a = typeA.get('title');\n const b = typeB.get('title');\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n return 0;\n}", "title": "" }, { "docid": "a8c5630713123193e976b4726a1a0a11", "score": "0.5110843", "text": "function sortObjectsByKey(objects, key, sortOrder)\n{\n objects.sort(function ()\n {\n return function (a, b)\n {\n var objectIDA = CleanGroupField(a[key].toUpperCase());\n var objectIDB = CleanGroupField(b[key].toUpperCase());\n if (objectIDA === objectIDB)\n return 0;\n if (sortOrder == 'asc')\n return objectIDA > objectIDB ? 1 : -1;\n else\n return objectIDA < objectIDB ? 1 : -1;\n };\n } ()); \n}", "title": "" }, { "docid": "4ed5948ee533b9cebe30c82d341dcca9", "score": "0.51094335", "text": "function getTitle(dump, indexS, gotTitle) {\n var haystackLen = dump.files.st.byteLen / 4;\n var indexR = new Buffer(4), title = new Buffer(256);\n\n if (indexS < 0 || indexS >= haystackLen) {\n if (indexS === -1) {\n gotTitle('** beginning of list **');\n } else if (indexS === haystackLen) {\n gotTitle('** end of list **');\n } else {\n throw 'sorted index ' + indexS + ' out of range';\n }\n } else {\n if (dump.files.sp.eleBitSize) {\n indexR = readPackedItem(dump.files.sp.fd, dump.files.sp.eleBitSize, indexS);\n getTitleByRawIndex(dump, indexR, gotTitle);\n } else {\n // st: sorted titles all-idx.raw\n // TODO support packed versions\n fs.read(dump.files.st.fd, indexR, 0, 4, indexS * 4, (err, bytesRead, data) => {\n if (!err && bytesRead === 4) {\n indexR = data.readUInt32LE(0);\n getTitleByRawIndex(dump, indexR, gotTitle);\n } else { throw ['indexR', err, bytesRead]; }\n });\n }\n }\n}", "title": "" }, { "docid": "5ba1dd6371df35a4d11d1a20fc4a1977", "score": "0.5106655", "text": "formatHeader(column, title, el){\n\t\tvar formatter, params, onRendered, mockCell;\n\t\t\n\t\tif(column.definition.titleFormatter){\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\n\t\t\t\n\t\t\tonRendered = (callback) => {\n\t\t\t\tcolumn.titleFormatterRendered = callback;\n\t\t\t};\n\t\t\t\n\t\t\tmockCell = {\n\t\t\t\tgetValue:function(){\n\t\t\t\t\treturn title;\n\t\t\t\t},\n\t\t\t\tgetElement:function(){\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tgetType:function(){\n\t\t\t\t\treturn \"header\";\n\t\t\t\t},\n\t\t\t\tgetColumn:function(){\n\t\t\t\t\treturn column.getComponent();\n\t\t\t\t},\n\t\t\t\tgetTable:() => {\n\t\t\t\t\treturn this.table;\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tparams = column.definition.titleFormatterParams || {};\n\t\t\t\n\t\t\tparams = typeof params === \"function\" ? params() : params;\n\t\t\t\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\n\t\t}else{\n\t\t\treturn title;\n\t\t}\n\t}", "title": "" }, { "docid": "889654e67dbec9d473c9998453350593", "score": "0.5105639", "text": "function orderByYear(movies) {\n\n const moviesCopy = JSON.parse(JSON.stringify(movies))\n \n const ordered = moviesCopy.sort((a, b) => {\n\n if (a.year !== b.year) {\n return a.year - b.year \n } else {\n return b.title - a.title\n }\n })\n\n return ordered\n\n }", "title": "" }, { "docid": "e7cd0918407bfc21345e5414953e7eb5", "score": "0.51002795", "text": "function sortJSON() {\n\tfilteredObjects.sort( function(a,b) { \n\t\tvar valueA,valueB;\n\n\t\tswitch(sortParam) {\n\t\t\t// ascending by project name\n\t\t\tcase 'asc':\n\t\t\t\tvalueA=a.projectTitle.toLowerCase();\n\t\t\t\tvalueB=b.projectTitle.toLowerCase();\n\t\t\t\tbreak;\n\t\t\t// newest by creation date (b and a is changed on purpose)\n\t\t\tcase 'newest':\n\t\t\t\tvalueA= new Date(b.updatedAt);\n\t\t\t\tvalueB= new Date(a.updatedAt);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t if (valueA < valueB){ \n\t\t return -1; \n\t\t } else if (valueA > valueB){ \n\t\t return 1;\n\t\t } else { \n\t\t return 0;\n\t\t }\n\t});\n\n\t//set the URL accordingly\n\tsetURLParameter();\n}", "title": "" }, { "docid": "5c6451496beb7c5a0bf087048ae1ee43", "score": "0.50947195", "text": "function sort(stuff) {\n return stuff.sort((a, b) => {\n return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;\n });\n }", "title": "" }, { "docid": "30dc02615ddeefebd793fd33661c1bb6", "score": "0.5084526", "text": "function orderAlphabetically(array){\n var newArray=array.sort(function(a,b){\n var nameA = a.title.toUpperCase(); \n var nameB = b.title.toUpperCase(); \n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0;\n })\n \n var titles=newArray.map(function(movie){\n return movie.title;\n })\n var firstTwenty=[];\n for (var i=0; i<20; i++){\n firstTwenty.push(titles[i]);\n }\n return firstTwenty;\n}", "title": "" }, { "docid": "f753272fd54dd1b9a270625e264cb42b", "score": "0.5084044", "text": "function orderAlphabetically(movies) {\n\n const alphabeticallMovies = movies.splice(0, 20) //.sort((a,b) => a.title.localeCompare(b.title) ) NO SÉ SI ES ASÍ PERO BUENO\n return alphabeticallMovies\n\n\n}", "title": "" }, { "docid": "5a0937952c8230e53ed88f4dd12859b0", "score": "0.5082011", "text": "function orderAlphabetically(arr) {\n let arr2 = arr.slice()\n arr2 = arr2.sort(( a, b )=> {\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 return arr2.map((a)=>a.title).splice(0,20)\n \n}", "title": "" }, { "docid": "9786b044d9ba3af6ab7d9e7a8f49c80c", "score": "0.505751", "text": "function orderAlphabetically(movie){\n const sortedAlpha20 = movie.sort(function(a,b){\n if (a.title < b.title) return -1 ;\n if (a.title > b.title) return 1 ; \n }).map(function(movie){\n return movie.title;\n });\n return sortedAlpha20.slice(0,20);\n}", "title": "" }, { "docid": "e4cc514393f4ca1ff5d978fda4795f26", "score": "0.5053494", "text": "function orderByYear (movies) {\n\n const yearOrder = [...movies].sort((a, b) => {\n\n if (a.year > b.year){\n\n return 1\n\n } else if (a.year < b.year) {\n\n return -1\n \n } else {\n \n if (a.title > b.title) {\n\n return 1\n\n } else {\n\n return -1\n }\n }\n })\n\n return yearOrder \n}", "title": "" }, { "docid": "91c82120b90892c26c7c33307212e86b", "score": "0.5053448", "text": "function sortObj(list, key, asc) {\n function compare(a, b) {\n a = a[key];\n b = b[key];\n var type = (typeof(a) === 'string' ||\n typeof(b) === 'string') ? 'string' : 'number';\n var result;\n if (asc === true) {\n if (type === 'string') result = a.localeCompare(b);\n else result = a - b;\n } else {\n if (type === 'string') result = b.localeCompare(a);\n else result = b - a;\n }\n return result;\n }\n return list.sort(compare);\n}", "title": "" }, { "docid": "f4d744d93c10ffa2b749ab6dbc3ffa5f", "score": "0.5050574", "text": "function orderByYear(movies) {\nreturn movies.map(function (movieF) {\n return movieF;\n }).sort(function (a, b) {\n if (a.year === b.year) {\n return a.title.localeCompare(b.title);\n }\n return a.year - b.year;\n });\n}", "title": "" } ]
e4967389f81fb4009f8d28e338f9047d
Assumes there is no parent namespace.
[ { "docid": "16c685ff344287192f7d6cef65d13682", "score": "0.0", "text": "function getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n case 'math':\n return MATH_NAMESPACE;\n default:\n return HTML_NAMESPACE;\n }\n}", "title": "" } ]
[ { "docid": "5d307de95b9f3dd5b5775fa5defc5489", "score": "0.6232153", "text": "static findNamespaceIn(_namespace, _parent) {\n for (let prop in _parent)\n if (_parent[prop] == _namespace)\n return prop;\n return null;\n }", "title": "" }, { "docid": "044244cd55046f866ec9f525fe9b1100", "score": "0.61359507", "text": "function getNamespaceForTag(tag, parent) {\n if (tag === \"svg\") {\n return \"http://www.w3.org/2000/svg\";\n }\n if (tag === \"math\") {\n return \"http://www.w3.org/1998/Math/MathML\";\n }\n if (parent == null) {\n return null;\n }\n if (node_data_1.getData(parent).nameOrCtor === \"foreignObject\") {\n return null;\n }\n return parent.namespaceURI;\n}", "title": "" }, { "docid": "79b334d199cd3fdeada0661a79242fea", "score": "0.61185366", "text": "function namespaceHTMLInternal() {\n _currentNamespace = null;\n}", "title": "" }, { "docid": "c861ac14d4041cc6c0c3e2a76f8cec19", "score": "0.6046644", "text": "function test_tenant_visibility_miq_ae_namespaces_all_parents() {}", "title": "" }, { "docid": "bb8db059d6ec4638359c1348de3262b1", "score": "0.6010865", "text": "static registerNamespace(_namespace) {\n for (let name in Serializer.namespaces)\n if (Serializer.namespaces[name] == _namespace)\n return name;\n let name = Serializer.findNamespaceIn(_namespace, window);\n if (!name)\n for (let parentName in Serializer.namespaces) {\n name = Serializer.findNamespaceIn(_namespace, Serializer.namespaces[parentName]);\n if (name) {\n name = parentName + \".\" + name;\n break;\n }\n }\n if (!name)\n throw new Error(\"Namespace not found. Maybe parent namespace hasn't been registered before?\");\n Serializer.namespaces[name] = _namespace;\n return name;\n }", "title": "" }, { "docid": "7ceccbcf1fbe31efaf6d0d6ca63be79c", "score": "0.58831716", "text": "function namespace(name)\n{\n var parts = name.split('.');\n var parent = null;\n if (typeof(namespaces[parts[0]]) == 'undefined') {\n eval('parent = typeof(' + parts[0] + ') == \"undefined\" ? {} : ' + parts[0]);\n namespaces[parts[0]] = parent;\n } else {\n parent = namespaces[parts[0]];\n }\n parts = parts.slice(1);\n for (var i = 0; i < parts.length; ++i) {\n if (typeof parent[parts[i]] == 'undefined') {\n parent[parts[i]] = {};\n }\n parent = parent[parts[i]];\n }\n return parent;\n}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.58404505", "text": "function Parent() {}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.58404505", "text": "function Parent() {}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.57859004", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "e5756a428abddeb50088f90a38354389", "score": "0.5777519", "text": "visitOracle_namespace(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "cbad063d13bd6521d20b495b89c29543", "score": "0.57495266", "text": "function getNamespace(node) {\n\n\t\t\t\tvar result = NAMESPACE.FLEXIBLE;\n\t\t\t\tif (node.type == \"TextFrame\" || node.type == \"EmbeddedProto\") {\n\t\t\t\t\tresult = NAMESPACE.HTML;\n\t\t\t\t}\n\t\t\t\telse if (node.type == \"PathItem\" || node.type == \"CompoundPathItem\") {\n\t\t\t\t\tresult = NAMESPACE.SVG;\n\t\t\t\t}\n\t\t\t\telse if (node.children) {\n\t\t\t\t\tfor (var i = 0; i < node.children.length; i++) {\n\t\t\t\t\t\tvar sr = getNamespace(node.children[i]);\n\t\t\t\t\t\tif (!result) {\n\t\t\t\t\t\t\tresult = sr;\n\t\t\t\t\t\t} else if (sr && result != sr) {\n\t\t\t\t\t\t\tresult = NAMESPACE.MIXED;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}", "title": "" }, { "docid": "f34aae5a039debd022392cab4d83fcdc", "score": "0.5663015", "text": "function SVGParent() {}", "title": "" }, { "docid": "8c59400b14c72035923eb700fc80d35a", "score": "0.5658271", "text": "function findNamespace(namespaceList, ele){\r\n if(namespaceList['targetNamespace']){\r\n ele['namespace']=namespaceList['targetNamespace'];\r\n }\r\n return;\r\n}", "title": "" }, { "docid": "5f560f6dc62cefc6833d0bacdd52fbf1", "score": "0.56003857", "text": "_hasAncestorOfType() {\n return false;\n }", "title": "" }, { "docid": "27416de427b83ff27dfaf007bad9f608", "score": "0.5488823", "text": "ns(ns) {\n return this.namespace(ns)\n }", "title": "" }, { "docid": "379ccc041912655c65656c2710cba63b", "score": "0.5442094", "text": "function namespaceElementVisitor(node) {\n return saveStateAndInvoke(node, namespaceElementVisitorWorker);\n }", "title": "" }, { "docid": "80fb52a404835456b544d6fe87aa8441", "score": "0.543045", "text": "function ODataParentBinding() {}", "title": "" }, { "docid": "22d5d9689bb1ce2cfc5afdaa3497e074", "score": "0.54291403", "text": "visitXml_namespaces_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a12a539860563b1f7c1f05d110a72538", "score": "0.54212606", "text": "get namespaces () { \n return this._namespaces; \n }", "title": "" }, { "docid": "b66992a018d628fc3bfdb046f44131cd", "score": "0.5413615", "text": "function handleNamespace(model) {\n model.namespaceExpanded = model.namespace;\n model.namespace = model.namespaceExpanded.uid;\n}", "title": "" }, { "docid": "be01e88f5760efc6b6b2798b9ec4c4df", "score": "0.53983927", "text": "static findRelative(startNamespace, qualifiedName) { \n // current is the root at this point\n var tokens = qualifiedName.split('.');\n\n if(tokens.length == 1 && tokens[0] === startNamespace.name) {\n return startNamespace;\n }\n\n var current = startNamespace;\n for(var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n current = current.children.findByName(token);\n\n if(current == null) {\n return null;\n }\n }\n \n return current;\n }", "title": "" }, { "docid": "9a746750480fb7df401985fa39db43f7", "score": "0.5375509", "text": "parentRecalculated() {\n\n }", "title": "" }, { "docid": "a0ed424cb9c015b739ee765d604da93a", "score": "0.53537697", "text": "function Namespace() { }", "title": "" }, { "docid": "bd282be208442ce483e3770aa40dadf1", "score": "0.532924", "text": "parentFunction(){\n return \"This is coming from the parent!\";\n }", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.53163517", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.53163517", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "d08096dd0d86227f688c52c4f9a1506c", "score": "0.5312707", "text": "function ParentThirdPartyInterface() {}", "title": "" }, { "docid": "f1547a07196d06f8f8e345e711aeeb61", "score": "0.5302642", "text": "function SmalltalkRoot() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.5298905", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.5298905", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.5298905", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.5298905", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "7e1c11b5f3780038fa6938e609fb1ca7", "score": "0.5284991", "text": "static cleanNamespace(namespace) {\n this.getNamespace(namespace).__proto__ = null\n }", "title": "" }, { "docid": "c808a4e787b3f6451573506b2f22af33", "score": "0.52762383", "text": "get fullyQualifiedNamespace() {\n return this._context.fullyQualifiedNamespace;\n }", "title": "" }, { "docid": "8dac4cfe43e7370ccde16c8697ce7bf1", "score": "0.5257312", "text": "getParent(){return this.__parent}", "title": "" }, { "docid": "51ca8189e5bfdb1296c4726b65df8b46", "score": "0.52510214", "text": "static getNamespace(_path) {\n let namespaceName = _path.substr(0, _path.lastIndexOf(\".\"));\n return Serializer.namespaces[namespaceName] || FudgeCore;\n }", "title": "" }, { "docid": "489b48cc25e3c6e6da36f6b440f61c6d", "score": "0.5231667", "text": "function namespace( ns, ns_string ) {\n var parts = ns_string.split('.'),\n parent = ns,\n pl, i;\n if (parts[0] == \"ME3D\") {\n parts = parts.slice(1);\n }\n pl = parts.length;\n for (i = 0; i < pl; i++) {\n //create a property if it doesnt exist\n if (typeof parent[parts[i]] == 'undefined') {\n parent[parts[i]] = {};\n }\n parent = parent[parts[i]];\n }\n return parent;\n}", "title": "" }, { "docid": "dd0da844bb1c41da056f97446c22a175", "score": "0.5222708", "text": "registerWithParent() { }", "title": "" }, { "docid": "7327f534052b7110135999dfafba29f8", "score": "0.52012295", "text": "function Parent() {\n}", "title": "" }, { "docid": "cf8d089240e251d04c095ce0957df849", "score": "0.5174269", "text": "function interiorNamespace(element) {\n if (element && element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace && !_domHelperBuildHtmlDom.svgHTMLIntegrationPoints[element.tagName]) {\n return _domHelperBuildHtmlDom.svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "e832c61e18c9ead58a8cdd42d69f6999", "score": "0.5144936", "text": "setParent(data) {\n // experimental WIP\n }", "title": "" }, { "docid": "67b699c7618463fb4506d8f4e52af884", "score": "0.5141264", "text": "function namespace() {\n var namespaceReferences = {},\n namespaceIndex,\n context,\n classIndex;\n \n //go through every namespace given\n for(namespaceIndex in arguments) {\n context = ClassObject.obtainNamespace(arguments[namespaceIndex]);\n \n //grab everything that isn't a namespacce in that namespace and put it in a single variable\n for(classIndex in context) {\n if(!context[classIndex][\"__Namespace__\"] && classIndex !== \"__Namespace__\"){\n namespaceReferences[classIndex] = context[classIndex];\n }\n }\n }\n \n return namespaceReferences;\n }", "title": "" }, { "docid": "eebf43a24f4f2bd73b278fab284ccb97", "score": "0.51332825", "text": "function parent()\n{\n // if any parent\n // ie if loaded as an abstraction,\n // a bpatcher or a subpatch\n if(this.patcher.box)\n {\n parentpatch = this.patcher.parentpatcher;\n if (parentpatch.box)\n outlet(0,parentpatch.box.varname);\n }\n}", "title": "" }, { "docid": "a336631bf758cf8f330e4562777135db", "score": "0.5124039", "text": "function _getOuterContainerOrSelf(node) {\n\t var view = node.view;\n\t while (_isNgContainer(node.parent, view)) {\n\t node = node.parent;\n\t }\n\t return node;\n\t}", "title": "" }, { "docid": "dd2cea29035112b43f65f0f5e40204d5", "score": "0.511612", "text": "initSubElement(parentName, context) {\n let info = this.elementRequestInfo[parentName];\n info.targets[parentName] = this.layoutElements[parentName];\n info.context.base = Object.assign(context, info.context.base);\n this.initElement(info);\n }", "title": "" }, { "docid": "63824d8f4cfdbb7fb710810d2c56b949", "score": "0.5103919", "text": "function namespaceElementVisitorWorker(node) {\n if (node.kind === 244 /* ExportDeclaration */ ||\n node.kind === 238 /* ImportDeclaration */ ||\n node.kind === 239 /* ImportClause */ ||\n (node.kind === 237 /* ImportEqualsDeclaration */ &&\n node.moduleReference.kind === 248 /* ExternalModuleReference */)) {\n // do not emit ES6 imports and exports since they are illegal inside a namespace\n return undefined;\n }\n else if (node.transformFlags & 1 /* TypeScript */ || ts.hasModifier(node, 1 /* Export */)) {\n // This node is explicitly marked as TypeScript, or is exported at the namespace\n // level, so we should transform the node.\n return visitTypeScript(node);\n }\n else if (node.transformFlags & 2 /* ContainsTypeScript */) {\n // This node contains TypeScript, so we should visit its children.\n return ts.visitEachChild(node, visitor, context);\n }\n return node;\n }", "title": "" }, { "docid": "d21ee9e31d5634bae5422a5c5405704d", "score": "0.510344", "text": "function _getOuterContainerOrSelf(node) {\n\t var view = node.view;\n\t while (_isNgContainer(node.parent, view)) {\n\t node = node.parent;\n\t }\n\t return node;\n\t }", "title": "" }, { "docid": "279a63baacd116d52091e594250d3ca5", "score": "0.5095131", "text": "getParent() {\n return null;\n }", "title": "" }, { "docid": "ad2fdca45ad52318c48a2f0aec5b8cb9", "score": "0.5086597", "text": "get parent(){const t=this._path.popLast();return t.isEmpty()?null:new Ec(this.firestore,/* converter= */null,new Rt(t));}", "title": "" }, { "docid": "4c1dfd01cf12a258d03aabc240b6efac", "score": "0.50834477", "text": "get parent() {\n var _a, _b;\n return (_b = (_a = this.parentProviders)[this.parentProviders.length - 1]) === null || _b === void 0 ? void 0 : _b.call(_a);\n }", "title": "" }, { "docid": "10cedd7b0f4ca803ad91b1baa259d4e0", "score": "0.5077619", "text": "function registerNameSpace(ns){\n var nsParts = ns.split(\".\");\n var root = window;\n var n = nsParts.length;\n \n for (var i = 0; i < n; i++) {\n if (typeof root[nsParts[i]] == \"undefined\") \n root[nsParts[i]] = new Object();\n \n root = root[nsParts[i]];\n }\n}", "title": "" }, { "docid": "10cedd7b0f4ca803ad91b1baa259d4e0", "score": "0.5077619", "text": "function registerNameSpace(ns){\n var nsParts = ns.split(\".\");\n var root = window;\n var n = nsParts.length;\n \n for (var i = 0; i < n; i++) {\n if (typeof root[nsParts[i]] == \"undefined\") \n root[nsParts[i]] = new Object();\n \n root = root[nsParts[i]];\n }\n}", "title": "" }, { "docid": "10cedd7b0f4ca803ad91b1baa259d4e0", "score": "0.5077619", "text": "function registerNameSpace(ns){\n var nsParts = ns.split(\".\");\n var root = window;\n var n = nsParts.length;\n \n for (var i = 0; i < n; i++) {\n if (typeof root[nsParts[i]] == \"undefined\") \n root[nsParts[i]] = new Object();\n \n root = root[nsParts[i]];\n }\n}", "title": "" }, { "docid": "8dd553dc1df0f6b6f14b63e3a641d182", "score": "0.5073518", "text": "parentFrame() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "afa2783b0ff1f7eeaf80184cf02942f5", "score": "0.50705916", "text": "constructor(parent1) {\n this.parent = parent1;\n if (this.parent) {\n this.options = this.parent.options;\n this.stringify = this.parent.stringify;\n }\n this.value = null;\n this.children = [];\n this.baseURI = null;\n // first execution, load dependencies that are otherwise\n // circular (so we can't load them at the top)\n if (!XMLElement) {\n XMLElement = require('./XMLElement');\n XMLCData = require('./XMLCData');\n XMLComment = require('./XMLComment');\n XMLDeclaration = require('./XMLDeclaration');\n XMLDocType = require('./XMLDocType');\n XMLRaw = require('./XMLRaw');\n XMLText = require('./XMLText');\n XMLProcessingInstruction = require('./XMLProcessingInstruction');\n XMLDummy = require('./XMLDummy');\n NodeType = require('./NodeType');\n XMLNodeList = require('./XMLNodeList');\n XMLNamedNodeMap = require('./XMLNamedNodeMap');\n DocumentPosition = require('./DocumentPosition');\n }\n }", "title": "" }, { "docid": "afa2783b0ff1f7eeaf80184cf02942f5", "score": "0.50705916", "text": "constructor(parent1) {\n this.parent = parent1;\n if (this.parent) {\n this.options = this.parent.options;\n this.stringify = this.parent.stringify;\n }\n this.value = null;\n this.children = [];\n this.baseURI = null;\n // first execution, load dependencies that are otherwise\n // circular (so we can't load them at the top)\n if (!XMLElement) {\n XMLElement = require('./XMLElement');\n XMLCData = require('./XMLCData');\n XMLComment = require('./XMLComment');\n XMLDeclaration = require('./XMLDeclaration');\n XMLDocType = require('./XMLDocType');\n XMLRaw = require('./XMLRaw');\n XMLText = require('./XMLText');\n XMLProcessingInstruction = require('./XMLProcessingInstruction');\n XMLDummy = require('./XMLDummy');\n NodeType = require('./NodeType');\n XMLNodeList = require('./XMLNodeList');\n XMLNamedNodeMap = require('./XMLNamedNodeMap');\n DocumentPosition = require('./DocumentPosition');\n }\n }", "title": "" }, { "docid": "e2f1ef6ee2c28cddb399ffe4690ac797", "score": "0.5048784", "text": "function ParentThirdPartyClass() {}", "title": "" }, { "docid": "fa3a01d96117938606f53a06bbb37801", "score": "0.5043104", "text": "static IsNamespace(code) {\n if (code === null)\n return false;\n return code.match(/\\bnamespace\\b/) !== null;\n }", "title": "" }, { "docid": "57922e5944dfde9161fed4e8f2ccc1d7", "score": "0.502436", "text": "GetComponentInParent() {}", "title": "" }, { "docid": "57922e5944dfde9161fed4e8f2ccc1d7", "score": "0.502436", "text": "GetComponentInParent() {}", "title": "" }, { "docid": "57922e5944dfde9161fed4e8f2ccc1d7", "score": "0.502436", "text": "GetComponentInParent() {}", "title": "" }, { "docid": "57922e5944dfde9161fed4e8f2ccc1d7", "score": "0.502436", "text": "GetComponentInParent() {}", "title": "" }, { "docid": "c6490bb9fd4c56bd7342baabca168bf1", "score": "0.5020786", "text": "get parent() { return this._parent; }", "title": "" }, { "docid": "44a783a07d1a3d2d347096c897a4d0e5", "score": "0.5009554", "text": "function grandParent(A, B) {\n var _ = Lourah.ai.Monolog.variable();\n parent(_, B)(A, _)(_, B);\n //console.log(\"B::\" + B._());\n //console.log(\"A::\" + A._());\n //console.log(\"_::\" + _._());\n }", "title": "" }, { "docid": "0bc83d1cc38e887ec0580c6e50e2457b", "score": "0.49983427", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "62d7078487a1f95849d458ce5fb8bf19", "score": "0.49943236", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4988213", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4988213", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4988213", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4988213", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4988213", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "ced090079b16ed9d2c1ec10b34ff4c61", "score": "0.4975802", "text": "function reassignParent(document, layer) {\n document.clearParent(layer);\n\n // primary name\n document.addParent(layer, document.getName('default'), document.getId());\n\n // name aliases\n let aliases = document.getNameAliases('default');\n if( aliases.length ){\n aliases.forEach( alias => {\n document.addParent(layer, alias, document.getId());\n });\n }\n}", "title": "" }, { "docid": "9209e1353652824ff787723e12792599", "score": "0.4975716", "text": "_$memberof() {\n super._$memberof();\n\n let memberof;\n let parent = this._node.parent;\n while (parent) {\n if (parent.type === 'ClassDeclaration' || parent.type === 'ClassExpression') {\n memberof = `${this._pathResolver.filePath}~${parent.doc.value.name}`;\n this._value.memberof = memberof;\n return;\n }\n parent = parent.parent;\n }\n }", "title": "" }, { "docid": "d98b6ce79d1b8ffd16da78a0c179f7a1", "score": "0.49753442", "text": "static getSymbolParent(symbol) {\n return symbol.parent;\n }", "title": "" }, { "docid": "be98170ad3f59d9ac76c6f294180c290", "score": "0.4972351", "text": "constructor(parent1) {\n this.parent = parent1;\n if (this.parent) {\n this.options = this.parent.options;\n this.stringify = this.parent.stringify;\n }\n this.value = null;\n this.children = [];\n this.baseURI = null;\n // first execution, load dependencies that are otherwise\n // circular (so we can't load them at the top)\n if (!XMLElement) {\n XMLElement = __webpack_require__(5796);\n XMLCData = __webpack_require__(9657);\n XMLComment = __webpack_require__(7919);\n XMLDeclaration = __webpack_require__(7738);\n XMLDocType = __webpack_require__(5383);\n XMLRaw = __webpack_require__(7660);\n XMLText = __webpack_require__(9708);\n XMLProcessingInstruction = __webpack_require__(2491);\n XMLDummy = __webpack_require__(4956);\n NodeType = __webpack_require__(9683);\n XMLNodeList = __webpack_require__(6683);\n XMLNamedNodeMap = __webpack_require__(5451);\n DocumentPosition = __webpack_require__(7065);\n }\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.49711156", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.49711156", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.49711156", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.49710205", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d6ea679699ca17ceb5800c13964a1fbe", "score": "0.49682167", "text": "static GetPrefabParent() {}", "title": "" }, { "docid": "6af1c8211cf384554dfd5b089ec1b174", "score": "0.496475", "text": "getNamespaceOwnedByAddress(address, parent, pageSize, id) {\n const url = \"namespace/page?address=\" + address.plain() +\n (parent === undefined ? \"\" : \"&parent=\" + parent) +\n (id === undefined ? \"\" : \"&id=\" + id) +\n (pageSize === undefined ? \"\" : \"&pageSize=\" + pageSize);\n return rxjs_1.of(url)\n .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((namespacesData) => {\n return namespacesData.data.map((namespaceDTO) => {\n return Namespace_1.Namespace.createFromNamespaceDTO(namespaceDTO);\n });\n }));\n }", "title": "" }, { "docid": "2cebf521f8d5ef4cae458abcb3254cfb", "score": "0.49635366", "text": "function getNamespaceContainerName(node) {\n return ts.getGeneratedNameForNode(node);\n }", "title": "" }, { "docid": "48ee45f7b3503e4bba010a99186d45d8", "score": "0.4961865", "text": "function extend( ns, ns_string ) {\n var parts = ns_string.split('.'),\n parent = ns,\n pl, i;\n if (parts[0] == \"myApp\") {\n parts = parts.slice(1);\n }\n pl = parts.length;\n for (i = 0; i < pl; i++) {\n //create a property if it doesnt exist\n if (typeof parent[parts[i]] == 'undefined') {\n parent[parts[i]] = {};\n }\n parent = parent[parts[i]];\n }\n return parent;\n}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.4961753", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.4961753", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.4961753", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.4961753", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "a3c344f10f08b77aacf12feb6fd150fc", "score": "0.49596107", "text": "get root() {\n let cx = this;\n while (cx.parent)\n cx = cx.parent;\n return cx;\n }", "title": "" }, { "docid": "ee27a74fc27274fd48c9386267a4a279", "score": "0.49547732", "text": "function r(e){if(!e)throw new TypeError(\"argument namespace is required\");function t(e){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=a,t.property=o,t}", "title": "" } ]
d0032609f31291acc53861cc4bcad8ee
FUNCTIONS FOR VIEWER/CONTROLLER LIFECYCLE INIT
[ { "docid": "5aee5e015fc2806bee1f23482a441e33", "score": "0.0", "text": "function init() {\n logger.info('init called');\n $.pricing.init({\n model : $.currentProduct\n });\n $.product_id.init();\n $.render();\n}", "title": "" } ]
[ { "docid": "d0b47921c10b238e519325056295be0a", "score": "0.7092921", "text": "function init() {\n initView();\n initProgramEnvironment();\n initEvents();\n initProgramForms();\n }", "title": "" }, { "docid": "27045ea0cd4407b56748ce89dde0d063", "score": "0.701549", "text": "@action initialize() {}", "title": "" }, { "docid": "048eddad083043dc71684233893a4484", "score": "0.6991742", "text": "init() {\n\t\tthis.currentController_.init();\n\t}", "title": "" }, { "docid": "7c7cd2808ecab0cbd844549068f1c67e", "score": "0.6952239", "text": "function init() { \n \n }", "title": "" }, { "docid": "3cf2c290823290c6f1d8ec6df7ab5a4d", "score": "0.6946502", "text": "function init(){ // función que se llama así misma para indicar que sea lo primero que se ejecute\n }", "title": "" }, { "docid": "1f76af7061263f2cf96f6d5616d8c585", "score": "0.6938479", "text": "function initControllerViewer() {\n\n\t// if we've already initialized the view but are returning to it again, we should request the list of diagrams again\n\tif (g_controllerViewerInitialized) {\n\t\tsendMessage('list_diagrams');\n\t\t//sendMessage('list_diagrams_names');\n\t\tsendMessage('request_status');\n\t\treturn;\n\t}\n\n\t// subscribe to message for this controller\n\tsubscribeToFolder(g_controller.path);\n\n\t// set outgoing messages to go to this controller\n\tsetTargetFolder(g_controller.path);\n\n\t// open websocket connect to server\n\tconnectWebSocket(function() {\n\t\tsendMessage('list_diagrams');\n\t\t//sendMessage('list_diagrams_names');\n\t\tsendMessage('request_status');\n\t});\n\n\tif (g_useBle) {\n\t\tbleaddMessageHandler('diagram_list', diagram_list_handler);\n\t\tbleaddMessageHandler('status', status_handler);\n\t} else {\n\t\taddMessageHandler('diagram_list', diagram_list_handler);\n\t\taddMessageHandler('status', status_handler);\n\t}\n\n\tg_controllerViewerInitialized = true;\n}", "title": "" }, { "docid": "0186459e4ce622a72f71947a8077227c", "score": "0.6813047", "text": "init() {\n\n\t}", "title": "" }, { "docid": "68696b86cf4922381678ad336febc65a", "score": "0.6798307", "text": "init() { \n \n }", "title": "" }, { "docid": "787eaed348637664430cb0573bbb14d3", "score": "0.67585975", "text": "init() {\r\n this.view.createGameObjects();\r\n this.addListeners();\r\n this.dropParachutists();\r\n }", "title": "" }, { "docid": "6b9696187957940efead8845b2969e36", "score": "0.6750221", "text": "function init() {\n /* Setting the view template */\n $scope.globaleventViewTemplate = 'views/globalevents/globaleventView.html';\n /* Setting up the default template in the list */\n $scope.globaleventTemplate = $scope.globaleventViewTemplate;\n /* Load the progressive service to load list of globalevents */\n $scope.globaleventsLazyloadFactory = new globaleventsLazyloadFactory();\n /* First launch */\n $scope.globaleventsLazyloadFactory.loadMore();\n /* Hide new form */\n $scope.showNewForm = false;\n }", "title": "" }, { "docid": "03a406e3bbfed663ee3f4004f8975554", "score": "0.6742583", "text": "function init(){\n\n\t\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.6734211", "text": "init() {\n\t}", "title": "" }, { "docid": "dae3894c8c7a728f6bc7b7736a3ee7df", "score": "0.671862", "text": "onInit() {}", "title": "" }, { "docid": "c638cb45e55df31eb4dd475d7944bbe8", "score": "0.6714581", "text": "init(){\n\n }", "title": "" }, { "docid": "c638cb45e55df31eb4dd475d7944bbe8", "score": "0.6714581", "text": "init(){\n\n }", "title": "" }, { "docid": "5d4a6b935c4698ff3489936fad9fea75", "score": "0.6713091", "text": "function initView() {\n initDialogs();\n initInputHandlers();\n }", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6706269", "text": "function init() {}", "title": "" }, { "docid": "8102d2ec35df841de78a08aa5eab321e", "score": "0.6697332", "text": "function init () {\n\t\tdisplay = elefart.display;\n\t\tcontroller = elefart.controller;\n\t\tfirstTime = false;\n\t}", "title": "" }, { "docid": "bf4c5fe325c03f8a587f620e55e81fe7", "score": "0.66926414", "text": "function init() {\n model.starterMessage();\n model.fetchSavedData();\n}", "title": "" }, { "docid": "b016de4490d90d8ce92ac37fc0ca2ac8", "score": "0.66841006", "text": "_init() {\n\n }", "title": "" }, { "docid": "8d50e3c1246ad163a497553121a1496e", "score": "0.6656793", "text": "init() {\n\n // pre-process data for this view\n this._game_init();\n }", "title": "" }, { "docid": "4b92ac52cd66371bcc0574f5cde4fdfb", "score": "0.6640856", "text": "function init() {\n common.logger.log(\"controller loaded\", null, controllerId);\n common.activateController([], controllerId);\n }", "title": "" }, { "docid": "b9837f1ad67cff42dbd04f50de2a6dad", "score": "0.66392565", "text": "init(){\n\n\n }", "title": "" }, { "docid": "1130fbfe8de4fecdac8aee86c49c7948", "score": "0.6628122", "text": "onInit() { }", "title": "" }, { "docid": "fa1554020e1f9c918264cc9b69ff7f10", "score": "0.6606807", "text": "init() {\n\n }", "title": "" }, { "docid": "fa1554020e1f9c918264cc9b69ff7f10", "score": "0.6606807", "text": "init() {\n\n }", "title": "" }, { "docid": "2b4764fa0bd0607156fd0df4197814ff", "score": "0.66054356", "text": "_init() {\n this._views = [];\n this._viewsByCid = {};\n this._indexByModel = {};\n this._updateLength();\n }", "title": "" }, { "docid": "2dd0f2815b66cd048eb57a5c095f7a8a", "score": "0.6598102", "text": "init(){\n //Initialize helper object and set debug mode to \"true\"\n this.helper = new Helper(this, true);\n \n //Initialize rendering engine \n this.renderEngine = new RenderEngine(this);;\n \n //Initialize root model\n this.rootModel = new RootModel(this);\n this.rootModel.init();\n \n //Initialize root controller\n this.rootController = new RootController(this);\n \n this.helper.log(\"Root: Initialized helper, rendering engine, root model and root controller.\");\n \n //Set an html root element\n this.helper.log(\"Initialize view via root controller.\");\n this.rootController.init();\n }", "title": "" }, { "docid": "f3ca9675011406f2875e318ba44b1415", "score": "0.6595929", "text": "function init() {\n\t\t\tvm.getCategories(0);\n\t\t\tvm.getUrgency();\n\t\t\tvm.getProjects();\n\t\t}", "title": "" }, { "docid": "1283eba0c58262263ab897b24f0b2385", "score": "0.6594455", "text": "function init() {\n\n }", "title": "" }, { "docid": "0d638e842b4617b91cff3206e0487488", "score": "0.6585132", "text": "function init() {\n \n }", "title": "" }, { "docid": "04eb2bd2769321b4eacfa796a550ffc2", "score": "0.65681833", "text": "function init() {\n\n // Event handlers\n vm.register = register;\n vm.userId = \"\";\n }", "title": "" }, { "docid": "469a1acbe22177a661ce1d43bf68d7f1", "score": "0.65660995", "text": "function initController() {\n\n UserService.GetByUsername($rootScope.globals.currentUser.username)\n .then(function (user) {\n vm.user = user.data;\n loadOperacionesEnviadas(vm.user.id);\n loadOperacionesEntrantes(vm.user.id);\n })\n .catch(function (e) {\n FlashService.Error(e.data.message || e.data.detail);\n });\n }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.6541564", "text": "function init() { }", "title": "" }, { "docid": "809ec23027ece706385efde93cf0aac1", "score": "0.6539204", "text": "function init() {\r\n }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6537658", "text": "init() { }", "title": "" }, { "docid": "fde9f6baa0cb5ed1fb2a1082805fcb92", "score": "0.65371215", "text": "function init() {\n }", "title": "" }, { "docid": "825a6fe62e817d35c25096a16f1766c2", "score": "0.6536001", "text": "init() {\n // Attributes\n const title = document.querySelector('title').innerHTML;\n const view = document.querySelector('[loader-view]');\n const name = view.getAttribute('loader-view');\n\n this.path = window.location.pathname;\n this.stack = {};\n this.stack[this.path] = {\n title: title,\n view : view,\n name : name,\n };\n\n // Load Current \n this.current = new this.views[name](this.stack[this.path]);\n this.current.init();\n\n // Active\n for (let link of this.links) {\n if (link.pathname === this.path) {\n this.active(link);\n }\n }\n }", "title": "" }, { "docid": "3779b528304bad76ad329ae7f0c0e431", "score": "0.6532888", "text": "function init() {\n // Initialize the triage state manager.\n triageStateManager = new TriageStateManager($scope, dataService);\n\n $scope.reloadInterval = 3;\n $scope.allTests = [];\n $scope.allParams = [];\n $scope.crLinks = [];\n $scope.imageSize = 100;\n $scope.loadAllTriageData();\n\n $scope.showUntriagedOnly = true;\n $scope.pageSize = 50;\n $scope.paginator = new Paginator($scope.pageSize, 5, paginateTests, function(page) {\n $scope.allTests = unroll(page);\n });\n\n // Inject the constants into the scope.\n $scope.c = ns.c;\n\n setQuery($location.search());\n }", "title": "" }, { "docid": "7e270995916be49f0546bd1ceda5250b", "score": "0.65292597", "text": "function initController() {\n\n console.log( { compID : $rootScope.company} );\n loadPerCompany( { compID : $rootScope.company} ); //rootSccope sirve para menatener variables\n loadNewCompany( { compID : $rootScope.company} ); //globales\n loadTotCompany( { compID : $rootScope.company} );\n loadGlobalSales();\n }", "title": "" }, { "docid": "b603bee4d34e4d46f2cbe18ce7c78384", "score": "0.6526667", "text": "function initController() {\n // initialize to page 1\n vm.setPage(1);\n }", "title": "" }, { "docid": "6998be5fbbe31104430685070ff2d520", "score": "0.6526011", "text": "function init(){\n notification_handler();\n setup_key_handerls();\n setup_window_listeners(); \n load_tiles();\n populate_hidden_tiles();\n}", "title": "" }, { "docid": "0d9f6f0208fc35b49710a9bdb27c5830", "score": "0.6518749", "text": "init() {\n\n }", "title": "" }, { "docid": "60148fca6ef5c2f8aea4fbea0d244174", "score": "0.65152407", "text": "function init()\n {\n }", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.651453", "text": "initialise () {}", "title": "" }, { "docid": "72ec4f7140f79ac465faafb68466d8fd", "score": "0.6513403", "text": "function startup() {\n if ($scope.vizid) {\n dataviz.loadData($scope.vizid, $scope.cache).then(function (viz) {\n //handle widget num\n if (typeof(widgetnum) != 'undefined') {\n viz.widgets = [viz.widgets[parseInt(widgetnum)]];\n }\n $scope.currentviz = viz;\n }).then(setup);\n } else {\n setup();\n }\n }", "title": "" }, { "docid": "b4c47a8d4e3d20310b2e27593f701d30", "score": "0.6508426", "text": "function _init() {\n\n }", "title": "" }, { "docid": "296f99d8cd82bdb78dd5d7e6b73452b6", "score": "0.6505596", "text": "function init()\n\t {\n\n\t }", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.6503955", "text": "init () {}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.6503955", "text": "init () {}", "title": "" }, { "docid": "0a03c0b6334529115429b3fc5ba1c96f", "score": "0.6503042", "text": "function initController(){\n\n vm.userData = ProfileCourseService.GetProfileData()\n\n\n if (vm.userData.TipoRepositorioArchivos == \"0\"){\n\n vm.userData.TipoRepositorioArchivos = \"Google Drive\"\n }\n if (vm.userData.TipoRepositorioArchivos == \"1\"){\n\n vm.userData.TipoRepositorioArchivos = \"Dropbox\"\n }\n\n loadTechnologies();\n\n vm.photo = \"data:image/jpg;base64,\" + $localStorage.Foto;\n\n vm.toggleEnable;\n if (vm.userData.Active == \"0\"){\n vm.toggleEnable = false;\n }\n if(vm.userData.Active == \"1\"){\n vm.toggleEnable = true;\n }\n\n }", "title": "" }, { "docid": "897ef983aa85c4e301af3442ab6c6e75", "score": "0.6492327", "text": "init () {\n }", "title": "" }, { "docid": "71fbdaccdd6613b8712fba1baa6d57b6", "score": "0.6489203", "text": "init(){\n this.bannerAnimation();\n this.tabSwith();\n this.scrollDownArrow();\n this.checkTsbLabel();\n this.modalInit();\n this.openMobMrnu();\n this.closeMobMenu();\n this.thirdScreenAnimation();\n }", "title": "" }, { "docid": "8134bd4e7e6295e9adec4f09eacdf9f4", "score": "0.64859974", "text": "function initApp() {\n new MartCtrlView();\n new MartCtrl();\n}", "title": "" }, { "docid": "31b50dfc8e8374d9bdf8de0a020401e7", "score": "0.6481416", "text": "function init() {\n\n }", "title": "" }, { "docid": "69e655554c81a4ee9031ea7977db8262", "score": "0.6475612", "text": "function init() {\n\t\t$scope.create = obiee.hasRMRole('create');\n\t\tobiee.getPublishedDBs(function(list) {\n\t\t\t$scope.dbs = list;\n\t\t\t$scope.$apply();\n\t\t\tGlobal.fadeIn();\n\t\t}, true);\n\t}", "title": "" }, { "docid": "1a7b0c964a9109c4665f013a170872bb", "score": "0.6469555", "text": "function init() {\n // init code here\n }", "title": "" }, { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.6467298", "text": "initalizing() {}", "title": "" }, { "docid": "ec2c77594a16a900241858c91063f3b7", "score": "0.6464466", "text": "function init()\n {\n roundCorners();\n hideOptionalElements();\n \n $('body').one('template.loaded', function()\n {\n insertLearnerName();\n app.template.fixImgPaths();\n \n updateLabels([\n 'fromLabel',\n 'subjectLabel',\n 'toLabel'\n ]);\n });\n }", "title": "" }, { "docid": "de58938241555d2fc66b4ec8e0928f02", "score": "0.64628756", "text": "init() {\n }", "title": "" }, { "docid": "8cd6018ece2f2932b392c2b0a5d0e754", "score": "0.6460469", "text": "function init() {\n \n}", "title": "" }, { "docid": "67c6a547e11091cfd94d4aa9a382d86a", "score": "0.6458772", "text": "function init() {\n fetchVenues();\n setEvents();\n }", "title": "" }, { "docid": "3a3345edaf6f7558cf6f9f245c3d48e0", "score": "0.6457765", "text": "initController () {\n this.handler = this.getInst(\"ControlMobileViewHandler\");\n\n // if (this.getService(\"GameSettingsService\").getLocalSettings(\"quick_spin\")) {\n // $_signal.goTo (\"-control.quickMode.enable\");\n // }\n }", "title": "" }, { "docid": "ec740818d2ddcc784a744d88d9103ab4", "score": "0.6457547", "text": "function initializeController() {\n fetchLedgerEntries() ;\n }", "title": "" }, { "docid": "168c79a03e3607c99e04ab31487eecc5", "score": "0.64557815", "text": "Init(){}", "title": "" }, { "docid": "36e9c23a39aa12638d3729ded1040fce", "score": "0.6447083", "text": "function initController(){\n\n vm.comments = [];\n vm.writeReply=false;\n vm.courseData = {};\n\n vm.courseData =ProfileCourseService.GetCourseData();\n vm.courseData.Carnet = ProfileCourseService.GetProfileData.Carnet;\n vm.userData = ProfileCourseService.GetProfileData();\n\n vm.gradeWidth = {'width': vm.courseData.Grade+'%'};\n\n getComments();\n processComments();\n getAllBadges();\n }", "title": "" }, { "docid": "1a1b60eca749c0f30f69387caa23f243", "score": "0.64464974", "text": "function init() {\n $mainTl\n .add(clearStage())\n .add(getIntroTl(), 'scene-intro')\n .add(getIdeaTl(), 'scene-idea')\n .add(getPart2Tl(), 'scene-part2')\n .add(getFillTubesTl(), 'scene-tubes')\n .add(getFinalCTATl(), 'scene-final');\n\n /** Start the animation step by step using labels\n * $mainTl.seek('scene-final');\n */\n }", "title": "" }, { "docid": "e6cb1513ddfa37f95144bd4f7ddc1098", "score": "0.6444219", "text": "function init()\n{\n\tSystem.out.println(\"-------------------------- init --------------------------------\");\n\n\tsetupGUI();\n\t\n\tsetupApparatusPanel();\n\t\n\tinitLogging();\n\n\tsetupMultimeter();\t\n\t\n\tsetupCircuitListener();\n\t\n\tsetupAnswerButton();\n\t\n\tsetupCalculatorListener();\n\t\n\tsetupActivity();\n \n\tsetupAsessmentLogging();\n\n\tinitializationDone = true;\n \n\treturn initializationDone;\n}", "title": "" }, { "docid": "ffb4b997ba345664d05c4e9e9e1cdcda", "score": "0.64436454", "text": "function _init()\n {\n AppService.setTopBarTitle(Translation.translate('NEWS'));\n\n // Example to get items from an API\n Content.inAppFilter({ param1: 'value' }, function success(items)\n {\n // Possible action to do after retrieving items\n }, function error(err)\n {\n // We can't use a LxNotification for now until this feature doesn't need jQuery\n // Utils.displayServerError(err);\n }, vm.listKey);\n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.64435494", "text": "init() {}", "title": "" }, { "docid": "749bea90362b143f4e65e256a2e07f12", "score": "0.64389706", "text": "function _init() {\n }", "title": "" }, { "docid": "ef8fcf9ceae611d9bd7c22ba361ea19d", "score": "0.64350533", "text": "function main() {\n _initEvent();\n // initWorker();\n initScene();\n initCamera();\n initRender();\n initLight();\n initContr();\n initStats();\n initAxesHelper();\n _createModel();\n animate();\n}", "title": "" }, { "docid": "d7a748a04c720d1e1f5e298c11eea0a5", "score": "0.6431495", "text": "function init(){\n // Functions to run on start\n events();\n }", "title": "" }, { "docid": "3c2d1e07c78d2d7731b8fc658d2de4de", "score": "0.6426749", "text": "function init()\n {\n }", "title": "" }, { "docid": "bc18d1691f23c70a1c619a0b7f33660d", "score": "0.6424511", "text": "Initialize() {}", "title": "" }, { "docid": "b57080353bccc1c7a026ba01f6d528dd", "score": "0.6423107", "text": "function init() {\n \n}", "title": "" } ]
fd302fc2eb0a4b767a89d5640696e1f2
delete a poll option
[ { "docid": "96168b21a6d9ad8d0ffcb241e474fce6", "score": "0.6127655", "text": "function delete_option(self) {\n self.parent().parent().fadeOut().remove();\n //renumber the options\n var i = 0;\n $('.option_number').each(function() {\n i++;\n $(this).text(i);\n })\n }", "title": "" } ]
[ { "docid": "6e056559024254eb554e335bc586b93f", "score": "0.7065246", "text": "rmOption() {\n this.options.pop();\n }", "title": "" }, { "docid": "f2e63a8b8fc5ec3abda51acffe49556c", "score": "0.6905668", "text": "removeOption() {\r\n this.options.splice(-1, 1);\r\n --this.count;\r\n }", "title": "" }, { "docid": "0091daa2fc2cc4bf55f25c49e4ea1c30", "score": "0.6822322", "text": "function deleteOption(qNum, oNum) {\n\t$('#q' + qNum + 'o' + oNum + 'div').remove()\n}", "title": "" }, { "docid": "60a63ae7bcc2d571852371695984be0d", "score": "0.65860474", "text": "function optionDelete() {\n\n ajax(\"delete.php?hash=\"+hash);\n reset();\n }", "title": "" }, { "docid": "e5104b6c0443f94b9761654aa171e37a", "score": "0.64882976", "text": "deleteDeliveryOptionAndUpdateSubscriber(e,option) {\n\n\tlet newList = this.props.subscriber.deliveryOptions\n\tlet index = newList.indexOf(option.value)\n\tthis.props.subscriber.deliveryOptions.splice(index,1)\n\tthis.props.sendUpdates(this.props.subscriber)\n\t\n }", "title": "" }, { "docid": "72fc6f28bed78944397ab7c56067f998", "score": "0.648766", "text": "function deleteOption(object,index) {\n object.options[index] = null;\n}", "title": "" }, { "docid": "927ea2a496e974dad96a4e4aed5f0bc2", "score": "0.6239632", "text": "function pollDelete() {\n // eslint-disable-next-line no-alert\n if (confirm('Do you really want to delete the poll?')) {\n $scope.ajaxLoadingSpinner++;\n StoragePoll.delete($scope.poll._id)\n .then(function(res) { // Poll successfully deleted on server\n // return to polls page\n $window.location.href = MyConst.urlPrefix + '/app1/polls';\n })\n .catch(function(err) { MyError.alert(err); })\n .finally(function() {$scope.ajaxLoadingSpinner--;});\n }\n }", "title": "" }, { "docid": "14da19bc022a06a3b7a3a90bbfa3c998", "score": "0.6214762", "text": "function deleteSingleChoiceOption(id) {\n\t$('#singlechoice_'+id).remove();\n}", "title": "" }, { "docid": "aa0620e351139dad1e241e9700ae8fff", "score": "0.608363", "text": "async function deleteTerminationPoll (pollObj, req, res) {\n try {\n const sql = db.sql\n const config = db.config\n const pool = await sql.connect(config)\n await pool.request().query(`DELETE FROM ${pollObj.table} WHERE username = '${pollObj.member}' AND groupname = '${pollObj.groupname}'`)\n } catch (err) {\n }\n}", "title": "" }, { "docid": "507a5595a3c6bca5c51dad0ef0e9780b", "score": "0.5956851", "text": "function deleteTherapeuticOptions() {\n const id = event.target.getAttribute('data-id');\ndb.collection(\"therapeuticOptions\").doc(id).delete().then(function() {\n}).catch(function(error) {\n console.error(\"Error removing document: \", error);\n});\n}", "title": "" }, { "docid": "bea8cf44bf5c6b26b0d33cb86d1131f5", "score": "0.5939687", "text": "function deleteAnswer(id) {\n\n\t\tif(typeof id !== 'string')\n\t\t\treturn Q.reject(new TypeError('The function deleteWatcher expects a string for its parameter.'));\n\n\t\treturn pool(r.table(config.core.table).get(id).delete({returnChanges: true})).then(function(res){ return res.changes[0] ? res.changes[0].old_val : null; });\n\t}", "title": "" }, { "docid": "d84f210d6bb4ba0411d15f97cab4046a", "score": "0.59126395", "text": "removeOption(e) {\n let options = this.state.Options.slice();\n options.splice(parseInt(e.currentTarget.getAttribute('data-key')),1);\n if(options.length >= MIN_OPTIONS_LEN) {\n this.setState({Options: options, timeStamp: new Date().getTime()});\n this.props.update(options);\n }\n }", "title": "" }, { "docid": "7eef3f3a33a60f4a089c40497999091c", "score": "0.5899729", "text": "removeFromOptions(item) {\n // console.log('multi-selector:removeFromOptions', item, this.options);\n let index = this.options.indexOf(item);\n if (index > -1) {\n this.options.splice(index,1);\n }\n }", "title": "" }, { "docid": "3c0b7981c25e8bcf04b262acaa44c651", "score": "0.58165514", "text": "function deleteTendencyOption(id) {\n\t$('#tendency_'+id).remove();\n}", "title": "" }, { "docid": "40e84191f408baa5080c3c502e136c64", "score": "0.58052266", "text": "function deleteMultipleChoiceOption(id) {\n\t$('#multiplechoice_'+id).remove();\n}", "title": "" }, { "docid": "cad2a396e807b93b3c4f60120a05531c", "score": "0.57652134", "text": "function getCleanedElOption(elOption){\nelOption=extend({},elOption);\neach$1(\n['id','parentId','$action','hv','bounding'].concat(LOCATION_PARAMS),\nfunction(name){\ndelete elOption[name];\n});\n\nreturn elOption;\n}", "title": "" }, { "docid": "b048a4fe90396ab59a3e571af85fee6e", "score": "0.5752556", "text": "function ts_reloadoptions() {\n document.getElementById(\"removeOption\").innerHTML = \"\";\n ts_populateoptions(\"removeOption\");\n}", "title": "" }, { "docid": "2fdf5d484521f17e15504e5ae35ed49e", "score": "0.57036096", "text": "updateOptions(data) {\n this.options = data;\n this.remove();\n }", "title": "" }, { "docid": "141c2f79b836fbf8a526450263932a54", "score": "0.5699332", "text": "function deleteOpt(obj){\n\tfor(y=0; y < obj.length; y++){\n\t\tvar optHere = obj.options[y];\n\t\tif(optHere.selected==true){\n\t\t\tobj.options[y] = null;\n\t\t\tdeleteOpt(obj);\n\t\t}\t\t\n\t}\n}", "title": "" }, { "docid": "4099de0dc71fa94e78481f4f29245c25", "score": "0.5694871", "text": "function deleteGradingOption(id) {\n\t$('#grading_'+id).remove();\n}", "title": "" }, { "docid": "7c26fbc0b56f5205a7274d716e08b899", "score": "0.569192", "text": "function newOptionCancel() {\n $scope.newOptionTitle = '';\n $scope.view = 'poll';\n }", "title": "" }, { "docid": "3189b25fdd80d9dd1f72203b784513ed", "score": "0.5644744", "text": "function removeSelectOption(formid, contentid, control, deleteComfirmMsg) {\n var strconfirm = confirm(deleteComfirmMsg);\n if (strconfirm == true) {\n var x = document.getElementById(control);\n var index = x.selectedIndex;\n removeOptn(formid, contentid, x.value);\n x.remove(index);\n }\n}", "title": "" }, { "docid": "8cb43fbcb25098611dc2ae968a209f02", "score": "0.5642976", "text": "function optionDelete(obj) {\n\tvar ev = window.event\n\tif (ev.keyCode == 46) {\n\t\toptionRemoveChildNodes(obj);\n\t\tobj.focus();\n\t}\n}", "title": "" }, { "docid": "99626335fae0f1672354b4d278559777", "score": "0.5597315", "text": "deletePreset() {\n this._presetList.splice(this._selectedIndex, 1);\n this.savePreset();\n this._selectedIndex = 0;\n }", "title": "" }, { "docid": "bfc335fcbcdb1e64181004624affe382", "score": "0.5568337", "text": "handleDeleteOption(optionToRemove) {\n\n //set to old option value\n this.setState((prevState) => ({\n options: prevState.options.filter((option) => {\n //true if keep item in array - false to remove\n // see if option = arg thats passed in\n // if the option we want to remove isnt the same as the current option\n return optionToRemove !== option;\n })\n }));\n }", "title": "" }, { "docid": "07d9fd367517ff0a4a350c5b2154d182", "score": "0.5557511", "text": "function delPick(idx)\n{\n//if (confirm(\"Confirm delete!\"))\n//{\nnewPicks = new Array();\nfor (p in top.ctrl._picks)\n{\nif (p != idx)\n{\nnewPicks.push(top.ctrl._picks[p]);\n}\n}\ntop.ctrl._picks = newPicks;\ntop.ctrl.showPicks();\n//top.ctrl.resetContent();\n}", "title": "" }, { "docid": "dfe7b483e1f131cc2aafe33c6dbd00b2", "score": "0.5556935", "text": "function option_postUnloading(){}", "title": "" }, { "docid": "240130c5b2191154b639e7fc508bf7b9", "score": "0.55472827", "text": "function del_opt() {\r\n if (count_for_del >= 2) {\r\n let elem = document.getElementById(count_for_del - 1)\r\n count_for_del--\r\n count--\r\n elem.remove()\r\n } else {\r\n alert('no item to delete')\r\n }\r\n console.clear()\r\n}", "title": "" }, { "docid": "f989e91ac47157a9fcf9e14bbe0cd1c3", "score": "0.5541385", "text": "_deleteWithOptions(options) {\n return __awaiter(this, void 0, void 0, function* () {\n let url;\n if (options.url) {\n url = options.url;\n }\n else {\n url = UrlUtil.join(this.apiRoot, this._baseEndpoint, options.url);\n }\n if (options.id) {\n url = UrlUtil.join(url, options.id);\n }\n if (options.parameters.hasParameters) {\n url = UrlUtil.join(url, options.parameters.getParamterString());\n }\n const headers = this.getHeader(options.secure);\n const result = yield this.httpClient\n .delete(url, {\n headers\n })\n .toPromise();\n if (Dto.isError(result.status.code, options.suppressedErrors)) {\n yield this.errorDialogService.openErrorDialog(result.status.text, result.status.message);\n return false;\n }\n return true;\n });\n }", "title": "" }, { "docid": "c2e20de7f06ee276e258bb223b5eeb5d", "score": "0.5529011", "text": "deletePreference(id, type) {\n return new Promise((resolve) => {\n const path = `${this.routes.get.preference.path}/${id}`;\n this.srv.request.doDelete(path, null, this.apiVersion, true).pipe().subscribe(() => {\n const defaultPreference = null;\n return resolve(defaultPreference);\n // this.srv.cache.clear([ `${this.params.internal_name}:preference` ]);\n // this.getPreferences(true).subscribe(() => {\n // // ToDo:: Check inside entity models to see if a default table settings exist\n // const defaultPreference = null;\n // return resolve(defaultPreference);\n // });\n }, () => {\n return resolve(false);\n });\n });\n }", "title": "" }, { "docid": "b3c0a44c41193df1009214ab5799714a", "score": "0.5508669", "text": "_handleRequestWorkflowRunDelete(options)\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__MODAL_SHOW_IMPORTANT, {title: 'Deleting Workflow Run', content: 'Please wait...'});\n options.workflowrun.destroy({success: (model) => Radio.channel('rodan').trigger(RODAN_EVENTS.EVENT__WORKFLOWRUN_DELETED, {workflowrun: model})});\n }", "title": "" }, { "docid": "a1740643df42fc5e7fe58e2e5830dd8a", "score": "0.5485907", "text": "function del() {\n inquirer\n .prompt({\n name: \"choice\",\n type: \"list\",\n message: \"Would you like to delete a department, role, or employee?\",\n choices: [\n \"Department\",\n \"Role\",\n \"Employee\"\n ]\n })\n .then(function(answer) {\n switch (answer.choice) {\n case \"Department\":\n deleteDepartment();\n break;\n\n case \"Role\":\n deleteRole();\n break;\n\n case \"Employee\":\n deleteEmployee();\n break;\n }\n })\n\n}", "title": "" }, { "docid": "76cb6ed7c65ede0be8ee6d319fb62b0c", "score": "0.54629403", "text": "function deleteLoction(){\r\n let dropdown = document.getElementById(\"selectCountires\");\r\n dropdown.remove(dropdown.selectedIndex);\r\n}", "title": "" }, { "docid": "7a71d90b0504fa1f1d46f650fdcff78f", "score": "0.5452538", "text": "function removeObjOption(obj){\n\tswitch (obj.name){\n\t\tcase 'spacesuit':\n\t\t\tremoveStar();\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'rubberduck':\n\t\t\tstopSoundLoop('soundDuckLoop');\n\t\t\tif(toySelected!=null){\n\t\t\t\ttoySelected.alpha = 1;\n\t\t\t}\n\t\t\tpukiAction = 'static';\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'bubble':\n\t\t\tremoveAllBubbles();\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'cat':\n\t\t\tpukiActive_arr.walkActive = false;\n\t\t\tpukiActive_arr.sitActive = false;\n\t\t\t\n\t\t\tcheckPukiStat();\n\t\t\t\n\t\t\textraDistance=0;\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\teating = false;\n\t\t\tpukiInteract = true;\n\t\t\tstopSoundLoop('soundChiliRun');\n\t\t\tstopSoundLoop('soundBowlPush');\n\t\t\tstopSoundLoop('soundHairbrush');\n\t\t\t$.itemAnimation['noodle'].gotoAndStop(0);\n\t\t\tanimateNoodle=false;\n\t\t\tcurFoodAnimate='';\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "9d8ee39ff9d5fb167cf83656a6575d38", "score": "0.54385245", "text": "internal_logs_auto_delete(choice) {\n //console.log(\"Deleting log files. filename:\");\n //console.log(filename);\n\n //const choice = document.getElementById('extension-privacy-manager-delete-internal-logs-checkbox').checked;\n //console.log(\"choice:\" + choice);\n\n window.API.postJson(\n `/extensions/${this.id}/api/internal_logs`, {\n 'action': 'auto-delete',\n 'internal_logs_auto_delete': choice\n }\n\n ).then((body) => {\n //console.log(\"choice set: \", body);\n //this.show_internal_logs(body['data']);\n\n }).catch((e) => {\n console.log(\"Privacy manager: error in internal log automatic deletion change handler\");\n });\n\n }", "title": "" }, { "docid": "3fe6a04e5ed686af08e5d0dec6ff9427", "score": "0.5430149", "text": "function _event_for_delete_btn() {\n\t\t\ttry {\n\t\t\t\tvar optionDialog = Ti.UI.createOptionDialog({\n\t\t\t\t\toptions : (self.is_ipad()) ? [ 'YES', 'NO', '' ] : [ 'YES', 'NO' ],\n\t\t\t\t\tbuttonNames : [ 'Cancel' ],\n\t\t\t\t\tdestructive : 0,\n\t\t\t\t\tcancel : 1,\n\t\t\t\t\ttitle : L('message_delete_note_in_job_note')\n\t\t\t\t});\n\t\t\t\toptionDialog.show();\n\t\t\t\toptionDialog.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.index === 0) {\n\t\t\t\t\t\tvar db = Titanium.Database.open(self.get_db_name());\n\t\t\t\t\t\tif (_selected_job_note_id > 1000000000) {\n\t\t\t\t\t\t\tdb.execute('DELETE FROM my_' + _type + '_note WHERE id=?', _selected_job_note_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdb.execute('UPDATE my_' + _type + '_note SET changed=?,status_code=? WHERE id=' + _selected_job_note_id, 1, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.close();\n\t\t\t\t\t\twin.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _event_for_delete_btn');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d58f985384b8ca2edca368ae71c56410", "score": "0.54286546", "text": "function setupDeletePollModal(element) {\n let ara = element.value.split(\"++\");\n document.getElementById('pollTitle2').innerHTML = ara[0];\n document.getElementById('pollDeletionLink').action = ara[1];\n}", "title": "" }, { "docid": "88bf8c258fdac18477178067d5bc23b3", "score": "0.54278356", "text": "delete(id, e) {\n this.props.deleteAutobot(id,e)\n }", "title": "" }, { "docid": "38b883abb7b9b3c2a0547984d9c8316b", "score": "0.5403894", "text": "async delete() {\n\t\t\tthis.client.APIManager.makeRequest('delete', this.client.APIManager.endpoints.ENDPOINTS_GUILDS.delete(this.id))\n\t\t\t\t.catch(e => {return e});\n\t}", "title": "" }, { "docid": "742e85e4706772aa72e0a9723d26f14e", "score": "0.5392119", "text": "function delete_options() {\n var destroy_fields = $(\".destroy_option\");\n for (i=0; i<destroy_fields.length; i++) {\n if (destroy_fields[i].value == 1) {\n $(destroy_fields[i]).parent().parent().remove();\n }\n }\n}", "title": "" }, { "docid": "3c349e43360be0a35f3947cb9e149b90", "score": "0.5391165", "text": "async remove(f) {\n const res = (await this.client.callFunction('input', [\n `Do your want to delete :${f.fullpath} | [y/N] `,\n ]));\n if (res.length === 0) {\n return;\n }\n else if (res === 'y' || res === 'yes') {\n const after = f.after;\n const before = f.before;\n if (before) {\n before.after = after;\n }\n if (after) {\n after.before = before;\n }\n fs_1.FileSystem.delete(f.fullpath);\n }\n else {\n return;\n }\n }", "title": "" }, { "docid": "fa79c2cec79273dc32fc75e703159289", "score": "0.5385015", "text": "function deleteSettings() {\n\tvar aliveRuleId = ruleIdInput.value;\n\tif (confirm(\"Are you sure you want to delete this rule?\")) {\n\t\tbrowser.storage.local.remove(aliveRuleId)\n\t\t.then(removedItem, onError);\n\t}\n}", "title": "" }, { "docid": "15673db0728fd4daac2cac3238b99443", "score": "0.5380715", "text": "function chosen_single_destroy(chosen){\n\t\t$(chosen).val([]).trigger('chosen:updated');\n\t}", "title": "" }, { "docid": "ce9df484d678b40b682da3068ba477ac", "score": "0.5379237", "text": "function removeOption(pSelect)\r\n{\r\n\tif(pSelect.options.length > 0)\r\n\t{\r\n\t\tfor(i=pSelect.options.length-1; i>=0; i--)\r\n\t\t{\r\n\t\t\tif(pSelect.options[i].selected == true)\r\n\t\t\t{\t\t\t\t\t\t\t\r\n\t\t\t\tpSelect.options[i] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "8691dda1eb0fcc22b7f71e6511187eb2", "score": "0.5377344", "text": "delQ() {\n this.numQstn--; //Decrease question count\n this.qstnArr.pop(); //Delete last question in array\n }", "title": "" }, { "docid": "6034673911c7c9e1c86eb5d926641bf6", "score": "0.5372965", "text": "function getCleanedElOption(elOption) {\n elOption = extend({}, elOption);\n each$1(\n ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS),\n function (name) {\n delete elOption[name];\n }\n );\n return elOption;\n}", "title": "" }, { "docid": "6034673911c7c9e1c86eb5d926641bf6", "score": "0.5372965", "text": "function getCleanedElOption(elOption) {\n elOption = extend({}, elOption);\n each$1(\n ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS),\n function (name) {\n delete elOption[name];\n }\n );\n return elOption;\n}", "title": "" }, { "docid": "6034673911c7c9e1c86eb5d926641bf6", "score": "0.5372965", "text": "function getCleanedElOption(elOption) {\n elOption = extend({}, elOption);\n each$1(\n ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS),\n function (name) {\n delete elOption[name];\n }\n );\n return elOption;\n}", "title": "" }, { "docid": "0e736728e436532bc4d22a6348516352", "score": "0.5367097", "text": "function removeChoice(ch) {\n var index = choices.indexOf(ch);\n choices.splice(index, 1);\n}", "title": "" }, { "docid": "2e1796fb5fcf5f550b9b015a8aae2c6d", "score": "0.53578776", "text": "function removeEmployee() {\n\n connection.query(\"SELECT * FROM employee\", function (err, res) {\n if (err) throw err;\n\n inquirer.prompt([\n {\n name: \"id\",\n type: \"list\",\n message: \"Select employee to remove\",\n choices: function () { // retrieve all employees and list them as options\n var choiceArray = [];\n for (var i = 0; i < res.length; i++) {\n choiceArray.push({ name: res[i].first_name + \" \" + res[i].last_name, value: res[i].id });\n }\n return choiceArray;\n }\n }\n ])\n\n .then(function (answer) {\n\n connection.query(\"DELETE FROM employee WHERE id = ?\", answer.id, function (err, res) {\n if (err) throw err;\n console.log('EMPLOYEE SUCCESSFULLY DELETED');\n start();\n });\n })\n\n });\n}", "title": "" }, { "docid": "099d97aa3f4355f8f95522c6993ac4bf", "score": "0.53562343", "text": "function deleteDepartmentPrompt() {\n orm.getDepartments()\n .then(function(depts) {\n const deptArray = [];\n for (let i = 0; i < depts.length; i++) {\n deptArray.push(depts[i].dept_name);\n }\n inq.prompt({\n type: \"list\",\n message: \"Which Department is Being Dissolved?:\",\n choices: deptArray,\n name: \"dept\"\n }).then(function({ dept }) {\n const deptId = depts[deptArray.indexOf(dept)].id;\n orm.deleteRecord(\"Departments\", deptId)\n .then(function() {\n console.log(\"\\n\");\n start();\n });\n });\n });\n}", "title": "" }, { "docid": "69017ecd11134f648225edaa677aebca", "score": "0.53554165", "text": "function removeOptions(lista){\r\n\tif(lista!=null){\r\n\t\twhile(lista.options.length){\r\n\t\t\tlista.remove(lista.options.length-1);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "1fe29ddd5a35e8f78b4600ee54f724d8", "score": "0.5353851", "text": "removeAnswer(inputtedID, index) {\n database.ref('/elaborations/' + this.props.course + '/' + this.props.lecture + '/' + this.props.timestamp + '/' + inputtedID + '/answers/' + index).remove();\n //window.location.reload();\n\n // Firebase query once //\n this.firebaseQuery();\n }", "title": "" }, { "docid": "5242c2384a6f6f1fd8bc00b70bb7f361", "score": "0.5341624", "text": "delete({ facet }, res) {\n\t\tfacets.splice(facets.indexOf(facet), 1);\n\t\tres.sendStatus(204);\n\t}", "title": "" }, { "docid": "72e0cf53b2204d010346ed2031455d4d", "score": "0.5327092", "text": "function getCleanedElOption(elOption) {\n elOption = extend({}, elOption);\n each$1(\n ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS),\n function (name) {\n delete elOption[name];\n }\n );\n return elOption;\n }", "title": "" }, { "docid": "a475ef2bb22a3a51d95349c8b8b10ddd", "score": "0.53201103", "text": "deleteTask(tid) {\n let index = this.tasklist.findIndex(function (elt) { return elt[\"id\"] == tid });\n console.log(\"index \", index);\n this.tasklist[index].delete();\n this.tasklist.splice(index, 1);\n }", "title": "" }, { "docid": "81d0c9586764aa5fccb48af093ac0e0e", "score": "0.531379", "text": "function delQstn() {\n //Only allowed if number of question on survey form exceeds 1\n if (srvy.numQstn > 1) {\n //Get node and destroy\n let node = document.getElementById(\"qstn\" + srvy.numQstn);\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n srvy.delQ(); //Delete question from survey\n }\n}", "title": "" }, { "docid": "3f5756497cebf79f859d0f8bcc3dcde4", "score": "0.53120875", "text": "function clearDd(el, options) {\n return el.all(by.tagName('option')).get(0).click();\n}", "title": "" }, { "docid": "2f56a7d4bea922fe92e71606e8bda5a8", "score": "0.5309565", "text": "removeSelection(element, option) {\n this.checkMultiselect(element);\n this.triggerFocusEvent(element);\n if (option.selected) {\n option.selected = false;\n this.triggerChangeEvent(element);\n }\n }", "title": "" }, { "docid": "36de60beac688993a2ea218bb0e54405", "score": "0.53068805", "text": "function lausiDeleteCircuitFromWorkforceAtCreate(id) {\r\n\r\n\t//eliminamos el elemento del form\r\n\tlausiDeleteCircuitFromForm(id);\r\n\t\r\n\tname = $('circuitName' + id).innerHTML;\r\n\r\n\toption = lausiCreateOptionElement(id,name);\r\n\toptionsList = $('circuitAdder').getElementsByTagName('select');\r\n\toptionsList = elements[0];\r\n\t\r\n\toptionsList.appendChild(option);\r\n\t\r\n\t//eliminamos el elemento grafico\r\n\t$('circuit'+id).remove();\r\n}", "title": "" }, { "docid": "026384d03fbbd6450a8379479c3d69c6", "score": "0.5305964", "text": "deleteAnswer() {\n sendAjax('DELETE', '/deleteAnswer', {\n _csrf: this.props.csrf,\n questionIndex: this.props.questionIndex,\n answerIndex: this.props.index,\n }).then(this.props.onChange);\n }", "title": "" }, { "docid": "f67c09884b01b16f9f7d890c5d1ba5cc", "score": "0.52960885", "text": "function del() {\n transition(DELETING, true);\n // calls delete interview funcntion on specified interview id\n props.deleteInterview(props.id).then(error => {\n if (!error) {\n transition(EMPTY);\n } else {\n transition(ERROR_DELETE, true);\n }\n });\n }", "title": "" }, { "docid": "2e99aefc97ff1998748604c4b22e4fb5", "score": "0.5288583", "text": "function delete_el(el)\n{\n if (confirm(\" demander si oui ou non vous souhaitez supprimer ce to do\"))\n {\n\tel.remove()\n\tsave_list()\n }\n\n}", "title": "" }, { "docid": "c878f32a113c093ff25555925a42d323", "score": "0.5282995", "text": "delete(){\n\t\tthis._enabled = false;\n\t}", "title": "" }, { "docid": "52821ecec2e73d70bd63ccda181bec0a", "score": "0.5282919", "text": "removeOption(option) {\n // This filters out the selected option to remove from the options in the\n // state. It iterates over each option and only returns the element if it\n // is not equal to the option we are trying to remove.\n const newOptions = { ...this.state.options };\n\n delete newOptions[option];\n\n this.setState({\n options: newOptions,\n });\n }", "title": "" }, { "docid": "b036da168b79d2006cfa9e5a701219b8", "score": "0.5272389", "text": "_handleEventWorkflowRunDeleteResponse(options)\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__MODAL_HIDE);\n var project = Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_GET_ACTIVE);\n Radio.channel('rodan').trigger(RODAN_EVENTS.EVENT__WORKFLOWRUN_SELECTED_COLLECTION, {project: project});\n }", "title": "" }, { "docid": "f21f886e3865aa0afb4b4a97e7feab97", "score": "0.52683216", "text": "function deleteLastChoice() {\r\n // récupère dernier élément de la liste\r\n\r\n document.getElementById(\"choiceList\").lastChild.remove();\r\n}", "title": "" }, { "docid": "a5000691225a4c1d014b5500fc56eaf1", "score": "0.52612376", "text": "'response.delete'(responseId) {\n check(responseId, String)\n ResponsesCollection.remove(responseId)\n }", "title": "" }, { "docid": "e23efa9700149716b40ac8948dbfdc3f", "score": "0.5256818", "text": "function deleteDepartment() {\n inquirer\n .prompt({\n name: \"delDepartment\",\n type: \"list\",\n message: \"What is the name of the department you would like to delete?\",\n choices: departments\n })\n .then(function(answer) {\n connection.query(\"DELETE FROM department WHERE ?\", {id:answer.delDepartment}, function(err) {\n if(err) throw err;\n console.log(`\n Department has been deleted from the database.\n `);\n init();\n }); \n });\n}", "title": "" }, { "docid": "263d73bf543b4cbadd80bf55a81df3c1", "score": "0.52555954", "text": "function deleteFromPlaylist(){\n\tconnection.query('SELECT * FROM music ', function(err, res){\n\t\tvar choices = [];\n\t\tres.forEach(function(selection){\n\t\t\tvar selectionObj = {\n\t\t\t\tname: selection.artist.underline.bold + \" - \" + selection.title,\n\t\t\t\tvalue: selection.id,\n\t\t\t\tshort: \"\\n\" + selection.title + \" removed!\"\n\t\t\t}\n\t\t\tchoices.push(selectionObj);\n\t\t});\n\n\t\tvar seperator = new inquirer.Separator();\n\t\tvar goBackChoice = {\n\t\t\tname: \"<- Go Back\".underline.bold,\n\t\t\tvalue: 'cancel',\n\t\t\tshort: 'cancel'\n\t\t};\n\n\t\tchoices.push(seperator);\n\t\tchoices.push(goBackChoice);\n\n\t\tvar questions = [{\n\t\t\ttype: 'list',\n\t\t\tname: \"deleteChoice\",\n\t\t\tmessage: 'Which song do you want to remove?',\n\t\t\tchoices: choices\n\t\t}]\n\n\t\tinquirer.prompt(questions).then(function(userSelection){\n\t\t\tif (userSelection.deleteChoice == \"cancel\") {\n\t\t\t\tmainMenu();\n\t\t\t} else {\n\t\t\t\tconnection.query('DELETE FROM music WHERE ?', {id: userSelection.deleteChoice})\n\t\t\t\tmainMenu();\n\t\t\t}\n\t\t});\n\t})\n}", "title": "" }, { "docid": "b114810e95369bf9af020254d08de6f5", "score": "0.52539784", "text": "deleteSelected() {\n this[selectionSym].forEach(obj=> {\n if(obj.delete) {\n obj.delete();\n }\n });\n }", "title": "" }, { "docid": "c90dc7ded230ff46775ad16375ba3b15", "score": "0.5253305", "text": "function removeDepartments(){\n connection.query(\"SELECT departmentname FROM department\",function(err,results){\n inquirer.prompt([\n {\n name: \"deptname\",\n type: \"rawlist\",\n message: \"Which department you want to remove?\",\n choices:function(){\n var choiceArray = [];\n for (var i = 0; i < results.length; i++) {\n choiceArray.push(results[i].departmentname);\n }\n return choiceArray;\n }\n }\n ]).then(function(data){\n connection.query(\"DELETE FROM department WHERE ?\", {departmentname: data.deptname},function(err){\n if(err) throw err;\n console.log(\"Removed Department Successfully\");\n start();\n })\n })\n })\n}", "title": "" }, { "docid": "bd67ce1a056317be9a61a5514b340157", "score": "0.52494264", "text": "function confirmdeletePromotion(event){\n\n if (confirm(\"Supprimer la promotion : \" + mySelect.value + \" ?\")) {\n \n deletePromotion(mySelect.value);\n // so the value of my select now is related to the promotion.id of the promotion, id whose function deletepromotion ask in parameters to delete the right promotion selected\n }\n\n}", "title": "" }, { "docid": "575dc9d3fe6a54e7670a8636c59b1960", "score": "0.5229097", "text": "async function whatToDelete(){\n const deleteOption = await inquirer\n .prompt([\n {\n type: \"list\",\n name: \"viewList\",\n message: \"Please select the type of iinformation you would like to delete\",\n choices: [\"Employees\", \"Departments\", \"Roles\", \"Go Back\"]\n }\n ])\n deleteSelectedDetails(deleteOption)\n}", "title": "" }, { "docid": "08e5a55acd83e3161f64c7d702a8b7cb", "score": "0.5228685", "text": "function deletion() {\n\n transition(DELETING, true);\n props.cancelInterview(props.id)\n .then(() => transition(EMPTY))\n .catch(error => transition(ERROR_DELETE, true));\n }", "title": "" }, { "docid": "7214db76127d2cda840bdbbc8eca0a11", "score": "0.5224999", "text": "removePropertyOption(propertyName, optionIndex) {\n const state = this.state;\n state.configuration.properties[propertyName].options.splice(optionIndex, 1);\n if (state.configuration.properties[propertyName].options.length === 0) {\n delete state.configuration.properties[propertyName].options;\n }\n this.setState(state);\n this.props.onChange(state.configuration);\n }", "title": "" }, { "docid": "9520869bf97a665f80e27e4e144ca0ab", "score": "0.52177626", "text": "function getCleanedElOption(elOption) {\n\t elOption = zrUtil.extend({}, elOption);\n\t zrUtil.each(\n\t ['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),\n\t function (name) {\n\t delete elOption[name];\n\t }\n\t );\n\t return elOption;\n\t }", "title": "" }, { "docid": "9520869bf97a665f80e27e4e144ca0ab", "score": "0.52177626", "text": "function getCleanedElOption(elOption) {\n\t elOption = zrUtil.extend({}, elOption);\n\t zrUtil.each(\n\t ['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),\n\t function (name) {\n\t delete elOption[name];\n\t }\n\t );\n\t return elOption;\n\t }", "title": "" }, { "docid": "9520869bf97a665f80e27e4e144ca0ab", "score": "0.52177626", "text": "function getCleanedElOption(elOption) {\n\t elOption = zrUtil.extend({}, elOption);\n\t zrUtil.each(\n\t ['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),\n\t function (name) {\n\t delete elOption[name];\n\t }\n\t );\n\t return elOption;\n\t }", "title": "" }, { "docid": "9520869bf97a665f80e27e4e144ca0ab", "score": "0.52177626", "text": "function getCleanedElOption(elOption) {\n\t elOption = zrUtil.extend({}, elOption);\n\t zrUtil.each(\n\t ['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),\n\t function (name) {\n\t delete elOption[name];\n\t }\n\t );\n\t return elOption;\n\t }", "title": "" }, { "docid": "f6e4e72f7c61987f3eff360e2c3f8437", "score": "0.5216363", "text": "function _destroy() {\n selected = null;\n}", "title": "" }, { "docid": "ef4e5142764bbf61069fe1951d7c28c2", "score": "0.52083355", "text": "function delete_price(vyhra_id)\n{\n\n\n\tsetAJAX(url_redir + \"./php/actions.php\", \"type=delete_price&vyhra_id=\" + vyhra_id + \"&session_id=\" + getSession(), \"GET\", \"reloadSliderVyhry\");\n//\treloadSliderVyhry();\n}", "title": "" }, { "docid": "d4e7db8b9d6216daeac83954ee60c780", "score": "0.5206886", "text": "function removeDepartment() {\n inquirer\n .prompt([\n {\n name: \"removeDept\",\n type: \"list\",\n message: \"Which employee doe you want to remove?\",\n choices: function () {\n let choiceArr = [];\n for (let i = 0; i < departments.length; i++) {\n let tempChoice = {\n name: departments[i].name,\n value: departments[i].value,\n };\n choiceArr.push(tempChoice);\n }\n return choiceArr;\n },\n },\n ])\n .then(function (response) {\n let deptID = response.removeDept;\n\n connection.query(\n \"DELETE FROM department WHERE ?\",\n {\n id: deptID,\n },\n function (err, res) {\n if (err) throw err;\n console.log(\"You have removed this department.\");\n\n start();\n }\n );\n });\n}", "title": "" }, { "docid": "244856b669a785610ff8b1c959d354be", "score": "0.51988643", "text": "delete() {\n const message = 'Attention vous allez supprimer définitivement cette planning.';\n const css = '';\n const buttons = [\n {\n text: 'Supprimer',\n handler: () => {\n this.deletePlanning();\n }\n },\n {\n text: 'Annuler',\n handler: () => {\n }\n }\n ];\n this.alert.alertMessage(message, css, buttons);\n }", "title": "" }, { "docid": "244856b669a785610ff8b1c959d354be", "score": "0.51988643", "text": "delete() {\n const message = 'Attention vous allez supprimer définitivement cette planning.';\n const css = '';\n const buttons = [\n {\n text: 'Supprimer',\n handler: () => {\n this.deletePlanning();\n }\n },\n {\n text: 'Annuler',\n handler: () => {\n }\n }\n ];\n this.alert.alertMessage(message, css, buttons);\n }", "title": "" }, { "docid": "064f71f3179998fee3b75b164becd238", "score": "0.5191705", "text": "deleteDepartment(){\n let showText = 'Choose a department to delete.\\n';\n showText += this.showDepartments();\n let deleteDept = prompt(showText);\n if(deleteDept > -1 && deleteDept < this.departments.length){\n this.departments.splice(deleteDept, 1);\n }\n }", "title": "" }, { "docid": "729273bf18e301768015401b9a98c1a0", "score": "0.5191652", "text": "function conf_del(msg){ \n \n if(confirm(msg))\n return true; \n else\n return false;\n }", "title": "" }, { "docid": "982f688e520ffc66d853b619368ed764", "score": "0.51869893", "text": "function delOption(id_select, defaultValue) {\n $(id_select).siblings('.xselect').click(function() {\n $(id_select).val(defaultValue);\n $(id_select).siblings('.xselect').css('visibility', 'hidden');\n $(id_select).siblings('.select-option').children().removeClass('choose-option');\n $(id_select).siblings('.select-option').find('i').css('visibility', 'hidden');\n validateForm();\n })\n}", "title": "" }, { "docid": "f72323ac0305de54361a36ab6bd76c1d", "score": "0.5185763", "text": "function deleteDepartment() {\n const pickDepartment = \"SELECT * FROM department\";\n db.query(pickDepartment, (err, res) => {\n if (err) {\n throw err;\n }\n const department = res.map(({ name, id }) => ({\n name: name,\n value: id,\n }));\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"department\",\n message: \"Which department would you like to delete?\",\n choices: department,\n },\n ])\n .then((response) => {\n const department = response.department;\n const deletedDepartment = \"DELETE FROM department WHERE id = ?\";\n db.query(deletedDepartment, department, (err, res) => {\n if (err) {\n throw err;\n }\n console.log(\"\\n Success! You have deleted the department! \\n\");\n init();\n });\n });\n });\n}", "title": "" }, { "docid": "94d911bb136cc92bf97ee0451f72e23a", "score": "0.5181639", "text": "function deleteOffer(req, res, next) {\n var id = req.params.id;\n DBController.deleteOfferById(id, function(err, result) {\n if (err) {\n throw err;\n } else {\n next();\n }\n });\n}", "title": "" }, { "docid": "c0662a802270d523a9f90d5cd31c59dc", "score": "0.5175323", "text": "function deleteFromDestListPu(destList) {\n\tvar len = destList.options.length;\n\tfor(var i = (len-1); i >= 0; i--) {\n\t\tif ((destList.options[i] != null) && (destList.options[i].selected == true)) {\n\t\t\tdestList.options[i] = null;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "30e23d962bad0edd39694c54bc6b3952", "score": "0.5173089", "text": "cancel() {\n\t\tthis.opts.cancel && this.opts.cancel();\n\t}", "title": "" }, { "docid": "6e64e232ef958c59b1b09bdec2e7312c", "score": "0.5170361", "text": "function clearOption(nodeid, newnumber) { \r\n\tvar node = byIdReq(nodeid);\r\n\twhile (node.hasChildNodes()) {\r\n\t\tnode.removeChild(node.firstChild);\r\n\t}\r\n\tvar opt;\r\n\tfor (var i=0;i<newnumber;i++) {\r\n\t\topt = document.createElement(\"OPTION\");\r\n\t\topt.appendChild(document.createTextNode(\"\"));\r\n\t\topt.id = nodeid + \".o\" + i;\r\n\t\tnode.appendChild(opt);\r\n\t}\r\n\t// determin visibility status... BUG IE6\r\n\t/*\r\n\t * var upperNode = node; var visDis = \"\"; while (upperNode != null &&\r\n\t * upperNode.parentNode != upperNode) { if (upperNode.style &&\r\n\t * upperNode.style.display == \"none\") { visDis = \"none\"; break; } upperNode =\r\n\t * upperNode.parentNode; } node.style.display = visDis;\r\n\t */\r\n}", "title": "" }, { "docid": "1e012ce83c0bf7bcecf306069d7a4063", "score": "0.516989", "text": "function deletePL(event = null){\n var url = new URL(window.location.href);\n var pl_id = url.searchParams.get('list');\n\n //Check if the playlist was saved previously\n if(GM_getValue(pl_id) === undefined){\n window.alert('You haven\\'t saved this playlist yet.');\n return;\n }\n //confirm playlist save deletion\n if(window.confirm(\"Are you sure you want to remove this from your saved playlists?\")){\n GM_deleteValue(pl_id);\n\n //update visible buttons\n document.getElementById('savePL').innerHTML = 'Save Playlist';\n document.getElementById('checkPL').style.visibility = 'hidden';\n document.getElementById('deletePL').style.visibility = 'hidden';\n }\n}", "title": "" }, { "docid": "3c40a1ea2e99c3dbcb034e6b2003bc24", "score": "0.5169678", "text": "function remove(){\t\n\tvar id = $(this).data('id');\n\tvar rev = $(this).data('rev');\n\t//console.log(id);\n\t//console.log(rev);\n\tvar answer = confirm(\"sure?\" + id + rev);\n\tif (answer)\n\t{\n\t\t//console.log(\"ready\");\n\t\t$.couch.db(\"asd_project\").removeDoc({_id:id, _rev:rev});\n\t\t//console.log(\"deleted\");\n\t\twindow.location.reload();\n\t}\n}", "title": "" }, { "docid": "e9cd37a328651269727b2f4b6045dfb0", "score": "0.51688045", "text": "remove(request, reply) {\n let id = request.params.id\n\n this.ToDoList.del(id)\n .then((response) => this.replyOnResponse(response, reply))\n .catch((err) => reply(this.Boom.wrap(err)))\n }", "title": "" }, { "docid": "78144d722a06a12b48290a12f26c4bf4", "score": "0.51660883", "text": "function deleteOption($id_opcion){\n var datos = {\n 'action' : \"delete\",\n 'id_opcion' : $id_opcion\n };\n\n $.ajax({\n url: '/php/abm-preguntas-opciones.php',//# TODO armar url\n type: 'POST',\n data: datos,\n //dataType: 'json',\n success: function(data) {\n alert(\" Eliminado opcion \");\n //var jsonResult = JSON.stringify(data);\n //$(\"#results\").val(unescape(jsonResult));\n tabla_opciones.ajax.reload();\n },\n error: function(data) {\n alert(\" ERROR Eliminando opcion \");\n //var jsonResult = JSON.stringify(data);\n //$(\"#results\").val( \"ERROR \" + unescape(jsonResult));\n\n }\n })\n}", "title": "" }, { "docid": "dc06c0b1ce1cadb58391ed5d3841ab03", "score": "0.5160371", "text": "function deleteall() {\ninquirer.prompt({\n name:'deletor',\n type:'choices',\n message:'operator, would you like to delete from [p]ersonel, [d]epartments, or [r]oles?',\n choices: ['p', 'd', 'r']\n}).then((answer) => {\n if (answer.deletor === 'p') {\n var choice = 'personel';\n }\n if (answer.deletor === 'd') {\n var choice = 'departments'\n }\n if (answer.deletor === 'r') {\n var choice = 'roles';\n }inquirer.prompt({\n name:'delmak',\n type:'input',\n message:'operator, please input id of item to be destroyed.'\n }).then((answer) => {\n let did = answer.delmak;\n console.log(choice);\n let query = `delete from ${choice} where id=${did}`;\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.log(res);\n console.log('operation finished, operator, resuming.');\n start();\n })\n })\n })\n}", "title": "" }, { "docid": "b6037944b7350ad81408d6a4e8b72b24", "score": "0.5155467", "text": "function delOnClick() {\n $.ajax({\n type: 'DELETE',\n url: '/calculator',\n }).then(function (response) {\n console.log(response);\n //deletes the displayed answer\n $('#calcSolution').text('');\n });\n refreshCalculator();\n}", "title": "" }, { "docid": "47a2e298574c604b109c64028337c6a8", "score": "0.5155129", "text": "function removeAPWP() {\n\n // Get the selected APWPs\n var paths = $(\"#plateNames\").val() \n if(paths === null) {\n notify('failure', 'No apparent polar wander paths are selected.');\n return;\n }\n\t\n // Loop over all paths\n for(var i = 0; i < paths.length; i++) {\n\t\n var plateName = paths[i];\n var realPlateName = $(\"#plateNames option[value='\" + plateName + \"']\").text();\t\n var custom = eval($('#plateNames option[value=\"' + plateName + '\"]').attr('custom'));\n\t\n // Only remove custom APWPs\n if(custom) {\n delete APWPs[plateName];\n $('#plateNames option[value=\"' + plateName + '\"]').remove();\n $('#plateNames').multiselect('refresh');\n notify('success', 'APWP for ' + realPlateName + ' has been deleted.');\n } else {\n notify('failure', 'Default APWP for ' + realPlateName + ' cannot be deleted.');\n }\n }\t\n\n setStorage();\n\n}", "title": "" } ]
119620a6bc1415a2baf1ba85c142e97c
Use of this source code is governed by a BSDstyle license that can be found in the LICENSE file. > Original file : MODIFIED by Sarah Marsh Event listner for clicks on the learn button for each word
[ { "docid": "5a74d48cfd47a8ce2972cc1c95e8840c", "score": "0.0", "text": "function clickOpenTab(id) {\n chrome.storage.sync.get('urls', function(items) {\n if(chrome.runtime.lastError) {\n } else {\n urls = items['urls'];\n chrome.tabs.create({\n selected: true,\n url: urls[id]\n });\n }\n });\n return false;\n}", "title": "" } ]
[ { "docid": "1fd9e2a72319c70c32da4a0c11150911", "score": "0.6425657", "text": "function listener() {\n let allSpans = document.querySelectorAll(\".textSpan\")\n for (const span of allSpans) {\n const word = span.innerText\n span.addEventListener(\"click\", () => { clicks(word) })\n }\n}", "title": "" }, { "docid": "6cc6040ad702c7143a0cc2bc5cab3f7d", "score": "0.6411487", "text": "function handler() {\n var text = currentWordElement.innerText;\n if(text && text.includes('_')) {\n matching_words = find_matching_words(text);\n console.log(matching_words.slice(0, 100));\n document.getElementById(\"hints\").innerHTML = \"<b><i><u>Hints (\" + matching_words.length + \"):</u> \" + matching_words.slice(0, 100).toString() + \"</i></b>\";\n }\n}", "title": "" }, { "docid": "f70e64e4096f875b3cab1d1927d36be4", "score": "0.6299578", "text": "function initializeClicked(){\n\tfor(var i = 0; i < sentence.words1.length; ++i)\n\t\tsentence.clicked1[i] = false;\n\tfor(var i = 0; i < sentence.words2.length; ++i)\n\t\tsentence.clicked2[i] = false;\n}", "title": "" }, { "docid": "1fc3deb8eeec79310b524190e2658d3b", "score": "0.62782913", "text": "function learn(){\n\t}", "title": "" }, { "docid": "97a611b616e42142d280ce25575d9dab", "score": "0.6228512", "text": "function prepareTextInteractions() {\n $('.word').each(word_each_do_text_text);\n $('.mword').each(mword_each_do_text_text);\n $('.word').on('click', word_click_event_do_text_text);\n $('#thetext').on('selectstart','span',false).on(\n 'mousedown','.wsty',\n {annotation: ANNOTATIONS_MODE}, \n mword_drag_n_drop_select);\n $('#thetext').on('click', '.mword', mword_click_event_do_text_text);\n $('.word').on('dblclick', word_dblclick_event_do_text_text);\n $('#thetext').on('dblclick', '.mword', word_dblclick_event_do_text_text);\n $(document).on('keydown', keydown_event_do_text_text);\n $('#thetext').hoverIntent(\n {\n over: word_hover_over, \n out: word_hover_out, \n interval: 150, \n selector:\".wsty,.mwsty\"\n }\n );\n}", "title": "" }, { "docid": "4d19eb786bedc42bbf5011c39273883e", "score": "0.6209394", "text": "function extract_words(text) {\n\t\t\t\t\n\t\t\t\tvar textArray = text.split(\" \");\n\t\t\t\tvar i = 0;\n\n\t\t\t\t//var result=[]; uncomment to get words\n\t\t\t\twhile (i <= textArray.length) {\n\t\t\t\t\tif (textArray[i] == \"#_\") {\n\t\t\t\t\t\tvar start = i;\n\t\t\t\t\t\tvar string = \"\";\n\t\t\t\t\t\twhile (textArray[i + 1] != \"_#\") {\n\t\t\t\t\t\t\tvar string = string + \" \" + textArray[i + 1];\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//check if the word is with the user \n\t\t\t\t\t\t//console.log($rootScope.UserVisitedWords);\n\t\t\t\t\t\tif ($rootScope.UserVisitedWords.indexOf(string.trim()) > -1)\n\t\t\t\t\t\t\t$scope['isClicked_' + i] = true;\n\n\t\t\t\t\t\t\ttextArray[start] = \"<a href='javascript::' class='button button-clear clickable-word margin-0 button-small button-balanced' ng-style='isClicked_\" + i + \" && {\\\"color\\\": \\\"red\\\"}' ng-click=\\\"story.showModal('\" + string.trim() + \"',isClicked_\" + i + \");isClicked_\" + i + \" = true;\\\" >\";\n\t\t\t\t\t\t\ttextArray[i + 1] = \"</a>\";\n\t\t\t\t\t\t\t//result.push(string.trim()); uncommient to get array of words\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tvar finalTextToDisplay = textArray.join(\" \");\n\t\t\t\t\t//console.log('textArray', finalTextToDisplay);\n\t\t\t\t\treturn finalTextToDisplay;\n\t\t\t\t}", "title": "" }, { "docid": "75c85b2dc38146cedc05972cd00df5c9", "score": "0.6149079", "text": "function termsWrongToString()\n\t {\n\t let termsWrongString = \"\";\n\t for (let wrongI = 0; wrongI < termsWrong.length; wrongI++)\n\t {\n\t termsWrongString += termsWrong[wrongI] + \"\\n\";\n\t }\n\t if (termsWrongString.length > 0)\n\t {\n\t document.getElementById(\"shouldStudy\").innerText = \"You got the following words wrong: \\n \\n\" + termsWrongString;\n\t \n\t let studyWordsButton = document.getElementById(\"Study these words\");\n\n\t studyWordsButton.style.display = \"initial\";\n\n\t studyWordsButton.onclick = function(){\n\t\t\t\t\t\t let termsWrongCorrectFormat = new Array();\n\n\t\t\t\t\t\t for (let ind = 0; ind < termsWrong.length; ind++){\n\t\t\t\t\t\t let thisWord = new Array();\n\t\t\t\t\t\t thisWord[0] = termsWrong[ind].substring(0, termsWrong[ind].indexOf(\": \"));\n\t\t\t\t\t\t thisWord[1] = termsWrong[ind].substring(termsWrong[ind].indexOf(\": \") + \": \".length);\n\t\t\t\t\t\t termsWrongCorrectFormat.push(thisWord);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t currentStudyList = shuffle(termsWrongCorrectFormat);\n\t\t\t\t\t\t runProgram(currentStudyList);\n\n\t\t\t\t\t\t studyWordsButton.style.display = \"none\";\n\t\t\t\t\t\t document.getElementById(\"reaction\").innerText = \"\";\n\t\t\t\t\t\t document.getElementById(\"shouldStudy\").innerText = \"\";\n\t\t\t\t\t\t document.getElementById(\"study\").innerText = \"\";\n\t\t\t\t\t\t };\n\t }\n\t else\n\t {\n\t document.getElementById(\"shouldStudy\").innerText = \"Well done. You got no words wrong!\"\n\t document.getElementById(\"Study these words\").style.display = \"none\";\n\t }\n\t }", "title": "" }, { "docid": "7fc6f31e5898394531500cbffce63283", "score": "0.6126766", "text": "function checkAnswer() {\n samplesArray[0].onclick = () => {\n if (answersLoaded) {\n instruction.innerHTML = \"This is a text sample generated by the machine learning model GPT-2, which was trained by the OpenAI research company. Click <a href='https://openai.com/blog/better-language-models/' target='blank'>here</a> to learn more about GPT-2, or refresh this page to try again!\";\n }\n }\n\n samplesArray[1].onclick = () => {\n if (answersLoaded) {\n instruction.innerHTML = \"Correct! This is the human-generated text sample; the other two samples were generated by <a href='https://openai.com/blog/better-language-models/' target='blank'>GPT-2</a> and a <a href='https://hjweide.github.io/char-rnn#:~:text=The%20term%20%E2%80%9Cchar%2Drnn%E2%80%9D,rnn%20as%20a%20classification%20model.' target='blank'>charRNN</a>. Refresh this page to try again!\";\n }\n }\n\n samplesArray[2].onclick = () => {\n if (answersLoaded) {\n instruction.innerHTML = \"This is a text sample generated by a charRNN model. CharRNN stands for Character Recurrent Neural Network. Click <a href='https://hjweide.github.io/char-rnn#:~:text=The%20term%20%E2%80%9Cchar%2Drnn%E2%80%9D,rnn%20as%20a%20classification%20model.' target='blank'>here</a> to learn more about charRNN models or refresh this page to try again!\";\n }\n }\n\n}", "title": "" }, { "docid": "129a54ea20bf1049a0e41d18424a8260", "score": "0.61141175", "text": "function runProgram(words)\n\t{\n\t let indexOfCurrentWord = 0;\t//Index of the current word in the study list\n\n\t let termsWrong = new Array();\t//Array of the words the user got wrong\n\n\t removeIWasRightButton();\n\n\t let entered = false;\t//Whether the function useInput has been entered\n\n\t getInput(indexOfCurrentWord);\n\n\t /*\n\t * This function takes the user input from the answer field and evaluates it.\n\t */\n\t function getInput(indexOfCurrentWord)\n\t {\n\t changePrompt(indexOfCurrentWord, true);\n\t answerField.value = \"\";\n\t answerField.onkeydown = function(e){\n\t \tlet key = e.keyCode || e.which;\n\t \tif (key == 13){\n\t \t\tuseInput();\n\t \t}\n\t };\n\n\t /*\n\t * This function evaluates the user input from the answer field.\n\t */\n\t function useInput()\n\t {\n\t if (!entered)\n\t {\n\t let response = answerField.value;\n\t \n\t entered = true;\n\n\t let definitionWords = getDefinitionWords(indexOfCurrentWord);\n\n\t let correctDefinition = false;\n\n\t removeIWasRightButton();\n\n\t for (let ind = 0; ind < definitionWords.length; ind++)\n\t {\n\t if ((response.substring(response.indexOf(\":\") + 1)).indexOf(definitionWords[ind]) != -1)\n\t {\n\t correctDefinition = true;\n\t }\n\t }\n\t \n\t if (response.substring(0, response.indexOf(\":\")) ==\n\t \twords[indexOfCurrentWord][1].substring(0, words[indexOfCurrentWord][1].indexOf(\":\"))\n\t \t&& correctDefinition){\n\n\t document.getElementById(\"reaction\").innerText = \"Good job! \\n You said: \"\n\t + words[indexOfCurrentWord][0] + \": \" + response;\n\n\t document.getElementById(\"reaction\").style.color = \"green\";\n\t }\n\t else{\n\t document.getElementById(\"reaction\").innerText = \"Incorrect. \\n You said: \"\n\t + words[indexOfCurrentWord][0] + \": \"\n\t + response + \"\\nCorrect: \" + words[indexOfCurrentWord][0] + \": \"\n\t + words[indexOfCurrentWord][1];\n\n\t document.getElementById(\"reaction\").style.color = \"#DE0000\";\n\t \n\t termsWrong.push(words[indexOfCurrentWord][0] + \": \"\n\t \t+ words[indexOfCurrentWord][1]);\n\n\t let thisButton = createButton(\"I was actually right\", \"green\", \"2px solid #555\");\n\n\t document.getElementById(\"inputBox\").appendChild(thisButton);\n\t \n\t thisButton.style.marginLeft = \"8px\";\n\t thisButton.style.marginTop = \"0px\";\n\n\t thisButton.onclick = function(){\n\t termsWrong.pop();\n\t document.getElementById(\"reaction\").innerText = \"Good job! \\n You said: \"\n\t + words[indexOfCurrentWord][0] + \": \" + response;\n\n\t document.getElementById(\"reaction\").style.color = \"green\";\n\t inputBox.removeChild(thisButton);\n\t if (document.getElementById(\"shouldStudy\").innerText.length > 0)\n\t \t{\n\t termsWrongToString();\n\t }\n\t else\n\t {\n\t \tdocument.getElementById(\"Study these words\").style.display = \"none\";\n\t }\n\t };\n\t }\n\t \n\t entered = false;\n\t \n\t if (indexOfCurrentWord < words.length - 1)\n\t {\n\t getInput(indexOfCurrentWord + 1);\n\t }\n\t else\n\t {\n\t changePrompt(\"You are done.\", false);\n\t answerField.value = \"\";\n\t entered = true;\n\n\t termsWrongToString();\n\t }\n\n\t /*\n\t * This function creates a single string with all of the study terms the user\n\t * got incorrect, and then displays the string in the field with id\n\t * \"shouldStudy\".\n\t */\n\t function termsWrongToString()\n\t {\n\t let termsWrongString = \"\";\n\t for (let wrongI = 0; wrongI < termsWrong.length; wrongI++)\n\t {\n\t termsWrongString += termsWrong[wrongI] + \"\\n\";\n\t }\n\t if (termsWrongString.length > 0)\n\t {\n\t document.getElementById(\"shouldStudy\").innerText = \"You got the following words wrong: \\n \\n\" + termsWrongString;\n\t \n\t let studyWordsButton = document.getElementById(\"Study these words\");\n\n\t studyWordsButton.style.display = \"initial\";\n\n\t studyWordsButton.onclick = function(){\n\t\t\t\t\t\t let termsWrongCorrectFormat = new Array();\n\n\t\t\t\t\t\t for (let ind = 0; ind < termsWrong.length; ind++){\n\t\t\t\t\t\t let thisWord = new Array();\n\t\t\t\t\t\t thisWord[0] = termsWrong[ind].substring(0, termsWrong[ind].indexOf(\": \"));\n\t\t\t\t\t\t thisWord[1] = termsWrong[ind].substring(termsWrong[ind].indexOf(\": \") + \": \".length);\n\t\t\t\t\t\t termsWrongCorrectFormat.push(thisWord);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t currentStudyList = shuffle(termsWrongCorrectFormat);\n\t\t\t\t\t\t runProgram(currentStudyList);\n\n\t\t\t\t\t\t studyWordsButton.style.display = \"none\";\n\t\t\t\t\t\t document.getElementById(\"reaction\").innerText = \"\";\n\t\t\t\t\t\t document.getElementById(\"shouldStudy\").innerText = \"\";\n\t\t\t\t\t\t document.getElementById(\"study\").innerText = \"\";\n\t\t\t\t\t\t };\n\t }\n\t else\n\t {\n\t document.getElementById(\"shouldStudy\").innerText = \"Well done. You got no words wrong!\"\n\t document.getElementById(\"Study these words\").style.display = \"none\";\n\t }\n\t } \n\t }\n\t };\n\t }\n\n\t /*\n\t * This function removes the \"I was actually right\" button from the DOM\n\t */\n\t function removeIWasRightButton()\n\t {\n\t if (document.getElementById(\"I was actually right\") != null)\n\t {\n\t document.getElementById(\"inputBox\").removeChild(document.getElementById(\"I was actually right\"));\n\t }\n\t }\n\n\t /**\n\t * Parses the English definition of the Latin and inserts each parsed word\n\t * of the English into an array. Returns the array.\n\t *\n\t * parameter i: the index of the current vocab in the 2D array called words\n\t **/\n\t function getDefinitionWords(indexOfCurrentWord)\n\t {\n\t let correctWords = new Array(); //The array to contain the English words\n\t \n\t let correctDef = words[indexOfCurrentWord][1].substring((words[indexOfCurrentWord][1].indexOf(\":\") + 1)); //The full correct English definition\n\n\t //Cuts out words from right to left until the definition has length 0\n\t while (correctDef.length > 0)\n\t {\n\t \tlet currentWord;\n\t //Handles the case where a comma comes after the word or where the current word is the last\n\t if (correctDef.indexOf(\",\") != -1)\n\t {\n\t currentWord = correctDef.substring(0, correctDef.indexOf(\",\")); //The current English word\n\t \n\t //Removes \"to\" from before verbs\n\t if (currentWord.indexOf(\" to\") != -1)\n\t {\n\t currentWord = currentWord.substring(currentWord.indexOf(\" to\") + 3);\n\t }\n\n\t //Removes spaces from before words\n\t while (currentWord.indexOf(\" \") == 0)\n\t {\n\t currentWord = currentWord.substring(1);\n\t }\n\t correctDef = correctDef.substring(correctDef.indexOf(\",\") + 1); //Cuts the current word from the definition\n\t }\n\t else\n\t {\n\t currentWord = correctDef; //This is the last word so no splicing is necessary\n\t correctDef = \"\"; //Makes definition of length 0\n\t if (currentWord.indexOf(\" to\") != -1)\n\t {\n\t currentWord = currentWord.substring(currentWord.indexOf(\" to\") + 3);\n\t }\n\n\t while (currentWord.indexOf(\" \") == 0)\n\t {\n\t currentWord = currentWord.substring(1);\n\t }\n\t } \n\t correctWords.push(currentWord);\n\t }\n\t return correctWords;\n\t }\n\t}", "title": "" }, { "docid": "c96805db403cc72b85efc7bdadc9ff71", "score": "0.6079761", "text": "function nextWord() {\n let commands = {};\n do{newIndex = getRandomInt(0,vocabulary.length-1);}\n while(newIndex==previousIndex)\n previousIndex=newIndex;\n word = vocabulary[newIndex]\n enSound = new Audio(\"https://audio1.spanishdict.com/audio?lang=en&text=\" + word.english);\n enSound.load();\n enSound.play();\n $('#word').text(word.english);\n $('#hint').text(\"(\" + word.spanish + \")\");\n commands[word.spanish] = spanishDetected;\n commands[\"otra vez\"] = repeatDetected;\n commands[\"no sé\"] = nextDetected;\n annyang.removeCommands();\n annyang.addCommands(commands);\n annyang.start({continuous:true});\n\n}", "title": "" }, { "docid": "498d8d5ad28f583e292f1fa2b57586a2", "score": "0.6074572", "text": "function textAnalyze() {\n $('button').click(function(event) {\n event.preventDefault();\n $('dl').removeClass('hidden');\n\n var textArr = textToArr($('textarea').val());\n $('.wordCount').text(wordCount(textArr));\n $('.uniqueWordCount').text(uniqueCount(textArr));\n $('.averageWordLength').text(averageCount(textArr) + \" characters\");\n\n });\n}", "title": "" }, { "docid": "10ca9d8aea2fe01e4624e329ac71a3fd", "score": "0.6073186", "text": "notifyLearnMoreClicked() {}", "title": "" }, { "docid": "03d8ddc099753e2bd100631843a5fdd6", "score": "0.6071806", "text": "function generateWords() {\r\n\r\n count = 0;\r\n //from this array we select any of these...\r\n var lessons=[...combinations];\r\n\r\n\r\n var max = lessons.length;\r\n //we need to get random number from the above array so pass the parameters\r\n var num = getRandomNumber(0 , max);\r\n word = lessons[num];\r\n // here goes the core code for displaying the contents got from the array;\r\n\r\n var tags = document.getElementsByClassName('this')[0];\r\n tags.style.background = 'black';\r\n\r\n\r\n var newDiv = document.createElement('div');\r\n newDiv.setAttribute('id' , 'thisClass');\r\n tags.appendChild(newDiv);\r\n\r\n\r\n var tags = document.getElementsByClassName('this')[0];\r\n\r\n for(var i = 0 ; i < word.length ; i++)\r\n {\tvar spans = document.createElement('span');\r\n spans.setAttribute('id' , 'span'+i);\r\n spans.innerHTML = word[i];\r\n newDiv.appendChild(spans);\r\n\r\n }\r\n\r\n //this piece of code will highlight the first element\r\n var cnt = 0;\r\n highlight(cnt);\r\n\r\n }", "title": "" }, { "docid": "e1ef0c21ca429e9a7655ebdc8ea3e799", "score": "0.6016947", "text": "function labelledbook() {\n chosenbooks = []\n words = {\n 1: 'painting',\n 2: 'knife',\n 3: 'drawer',\n 4: 'book',\n 5: 'chair',\n 6: 'paper',\n 7: 'note',\n 8: 'key',\n 9: 'desk',\n 10: 'clock',\n 11: 'pen',\n 12: 'base'\n }\n for (let i = 0; i < chosenbooks.length; i++) {\n console.log(`You open book ${chosenbooks[i]}. You see one highlighted word that says ${words[i]}.`)\n }\n}", "title": "" }, { "docid": "dc22aaeed865643d28958fc6d0343e84", "score": "0.5982633", "text": "function startListener(){\n var imageSelector = document.querySelector('#image')\n var textSelector = document.querySelector('#text')\n document.querySelector('#facts').setAttribute('visible', false)\n var listen = generateListen(\"listen\");\n imageSelector.setAttribute('src', listen)\n document.querySelector('#facts2').setAttribute('visible', false)\n imageSelector.setAttribute('visible',true)\n textSelector.setAttribute('visible',true)\n textSelector.setAttribute('value','Say where you want to go!')\n // document.getElementById('not-found').style.visibility = 'hidden';\n var recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.msSpeechRecognition)();\n recognition.lang = 'en-US';\n recognition.interimResults = false;\n recognition.maxAlternatives = 5;\n recognition.start();\n\n recognition.onresult = function(event) {\n console.log(event.results[0][0].transcript);\n keyWordsearch(event.results[0][0].transcript);\n };\n}", "title": "" }, { "docid": "cf8c3cc8360285be786813eafe492ded", "score": "0.59761256", "text": "function singleClick(word) {\n // remove list when click on another word\n const list = document.querySelectorAll(\".list\")\n if (list.length > 0) list[0].remove()\n\n // gets clicked word and fetches 7 synonyms \n let text = document.getElementById(\"resultText\")\n const thisWord = document.querySelectorAll('.textSpan[data-word=\"' + word + '\"]')\n fetch(\"https://api.datamuse.com/words?ml=\" + word + \"&max=7\")\n .then(response => response.json())\n .then(data => {\n // create list element\n const list = document.createElement(\"DIV\")\n list.classList.add(\"list\")\n list.dataset.word = word\n\n // create edit text button in list\n const editLink = document.createElement(\"A\")\n editLink.addEventListener(\"click\", () => editText())\n editLink.innerHTML = '<span class=\"icon edit\"></span>Edit text'\n list.append(editLink)\n\n // fill list element with synonyms\n for (const synonym of data) {\n const synEl = document.createElement(\"SPAN\")\n synEl.classList.add(\"listItem\")\n synEl.innerText = synonym.word\n list.append(synEl)\n }\n\n\n // inserts list before chosen word\n for (var i = 0; i < text.childNodes.length; i++) {\n if (text.childNodes[i].dataset !== undefined) {\n if (text.childNodes[i].dataset.word === thisWord[0].innerText) {\n const that = text.childNodes[i]\n\n // position it around the word\n list.style.top = that.offsetTop + \"px\"\n list.style.left = that.offsetLeft + \"px\"\n list.addEventListener(\"mouseleave\", () => {\n document.querySelectorAll(\".list\")[0].remove()\n })\n\n document.getElementsByTagName(\"BODY\")[0].append(list)\n listFn()\n }\n }\n }\n\n })\n}", "title": "" }, { "docid": "aeed91e5b8073740e2b9cefd95772a5f", "score": "0.5938483", "text": "function showContent() {\r\n \r\n words.forEach((word,index)=>{\r\n \r\n task(index);\r\n \r\n });\r\n \r\n }", "title": "" }, { "docid": "b9c6ef40f2d25c87246423e6c0b53f3f", "score": "0.5923769", "text": "function showWord(words) {\n currentWord.textContent = words[Math.floor(Math.random() * words.length + 1)];\n}", "title": "" }, { "docid": "6fb250c8ee1e91c754f5550766aaf574", "score": "0.5916792", "text": "function learn (array){\r\n reloading();\r\n\r\n var temp = 0;\r\n \r\n var item = document.getElementById(\"learnthis\");\r\n\r\n item.textContent = array[temp];\r\n\r\n document.getElementById(\"sound\").addEventListener(\"click\", () => {readOutLoud()}); // when sound button is clicked\r\n\r\n document.getElementById(\"next\").addEventListener(\"click\", () => {nextItem(array)}); //When next button is clicked\r\n \r\n document.getElementById(\"previous\").addEventListener(\"click\", () => {previousItem(array)}); // when previous button is clicked\r\n\r\n// Temp variable is incremented by one whenever next button is clicked\r\n// Then the value of temp index is shown in the page \r\n\r\nfunction nextItem(array){\r\n\r\n temp++;\r\n var item = document.getElementById(\"learnthis\");\r\n if(temp < array.length){\r\n \r\n item.textContent = array[temp];\r\n }\r\n else{\r\n item.textContent = \"Start Over\";\r\n }\r\n}\r\n\r\n// Temp variable is incremented by one whenever previous button is clicked\r\n// Then the value of temp index is shown in the page \r\n\r\nfunction previousItem(array){\r\n temp--;\r\n var item = document.getElementById(\"learnthis\");\r\n if(temp !== 0){\r\n \r\n item.textContent = array[temp];\r\n }\r\n else{\r\n item.textContent = \"Start Over\";\r\n }\r\n}\r\n\r\n// After getting element value by ID numbers are read loud.\r\n// Items in letters array has lowercase letter, uppercase letter, and whitespace \r\n//which are then trimmed using substrin function.\r\n//Finally trimmed value is read out loud with speak function of SpeechSyntesis web api\r\n\r\nfunction readOutLoud(){\r\n var value = document.getElementById(\"learnthis\");\r\n var value2 = value.textContent.substring(0,1);\r\n var utterThis = new SpeechSynthesisUtterance(value2);\r\n synth.speak(utterThis); \r\n console.log(value2);\r\n }\r\n}", "title": "" }, { "docid": "474003520fd3afc31e3599c012f0dbb3", "score": "0.59092724", "text": "static demo() {\n const story = `Мы ждали на автобусном остановке. Мы здесь ждем каждый день, потому что мы ездим на работу на автобусе. Вчера я был на работе, а Лена была дома. Я работал весь день, потом поехал домой. Я всегда езжу на автобусе. Лена иногда ходит пешком на работу или ездит на велосипеде.`;\n const vocab = `ждать ездить быть потом работа пешком`;\n \n document.getElementById(\"storytext_input\").innerText = story.trim();\n document.getElementById(\"storyvocab_input\").value = vocab.trim().split(\" \").join(\"\\n\");\n }", "title": "" }, { "docid": "3268921a51455eb48ccd1efb5931b9c0", "score": "0.5908225", "text": "function populateWord(event){\n time = 45;\n gameStatus = '';\n input.style.border = \"initial\";\n let clickedButton = event.target.innerText;\n switch (clickedButton){\n case \"Noisy\":\n inputWord = (noisyWords[Math.floor(Math.random()*noisyWords.length)]).toUpperCase();\n break;\n \n case \"Colors\":\n inputWord = (colorWords[Math.floor(Math.random()*colorWords.length)]).toUpperCase();\n break;\n \n case \"Computers\":\n inputWord = (computerWords[Math.floor(Math.random()*computerWords.length)]).toUpperCase();\n break;\n \n case \"Robots\":\n inputWord = (robotWords[Math.floor(Math.random()*robotWords.length)]).toUpperCase();\n break;\n \n case \"GO!\":\n if(input.value !== '' && input.value.match(/^[A-Za-z]+$/)){\n inputWord = (input.value).toUpperCase();\n input.value ='';\n }\n else{\n input.style.border = \"solid red\";\n return;\n }\n break;\n }\n if(word.firstChild !== null){\n clearInterval(timerOn);\n }\n timerFunction(time);\n jump.pause();\n clearInterval(loser);\n h3.style.display = \"none\";\n lettersGuessed = 0;\n incorrectLetters = 0;\n lettersGuessedArr = [];\n head.style.display = \"none\";\n torso.style.display = \"none\";\n rightArm.style.display = \"none\";\n leftArm.style.display = \"none\";\n rightLeg.style.display = \"none\";\n leftLeg.style.display = \"none\";\n iframe.style.display = \"none\";\n gameStatus = '';\n while(word.firstChild){\n word.removeChild(word.firstChild);\n }\n for(let i =0; i<inputWord.length; i++){\n newLetter = document.createElement('div');\n newLetter.classList.add(\"letter\");\n newLetter.classList.add((inputWord[i]));\n newLetter.innerText = inputWord[i];\n word.appendChild(newLetter);\n }\n wordLength = inputWord.length;\n}", "title": "" }, { "docid": "ee0d038dc14483b7254e65458f24e234", "score": "0.59078395", "text": "function alertWordmarkClick() { alert(\"You clicked the wordmark.\"); }", "title": "" }, { "docid": "860eaf0a7e153a9e1dfff768e6ccf0df", "score": "0.5880085", "text": "function setNewWord() {\n rand = takeRandomElement(words);\n uniqueLettersInWord = countUnique(rand);\n lives = 10;\n matchedLetters = 0;\n numberOfCanvasStep = 0;\n removeChildren(listWithLetters);\n removeChildren(lettersContainer);\n clearCanvas();\n setColor('#FFFFFF');\n setLineWidth(10);\n letters.map(letter => createButton(letter, lettersContainer));\n createListFromWord(rand);\n livesContainer.innerHTML = 'You have ' + lives + ' lives';\n}", "title": "" }, { "docid": "b30025613168810d7f71ea8601518871", "score": "0.5873306", "text": "function handleClick() {\n setWord(temp);\n }", "title": "" }, { "docid": "b30025613168810d7f71ea8601518871", "score": "0.5873306", "text": "function handleClick() {\n setWord(temp);\n }", "title": "" }, { "docid": "b2a7fb6e246c8747bea516ee32e5a5dd", "score": "0.58639073", "text": "function handleWordsEntered(event) {\n var text = event.currentTarget.value;\n allWords = text.replace(/[!\"#$%&\\\\'()\\*+,\\-\\.\\/:;<=>?@\\[\\\\\\]\\^_'{|}~]/g, '')\n .toLowerCase().split('')\n currentWord = 0\n}", "title": "" }, { "docid": "c78b9c268700a50cde565712db972419", "score": "0.58609265", "text": "function intializeCelebreMeans() {\n var possibleWords = [\"noted\", \"renowned\", \"celebrated\", \"great\"];\n var position = 0;\n var addNewWordInterval;\n setInterval(checkAndUpdatePointer, 500);\n setInterval(cycleToNewWord, 4000);\n\n function checkAndUpdatePointer() {\n var customTextObject = $('custom.celebre-means');\n var currentText = customTextObject.html();\n if(currentText[currentText.length-1] == 'I') {\n customTextObject.html(currentText.substring(0, currentText.length-1));\n } else {\n customTextObject.html(currentText + \"I\");\n }\n }\n function cycleToNewWord() {\n var deleteWordInterval = setInterval(deleteWord, 100);\n\n function deleteWord() {\n var customTextObject = $('custom.celebre-means');\n var currentText = customTextObject.html();\n if(currentText.length > 1) {\n customTextObject.html(currentText.substring(0, currentText.length-1));\n } else {\n customTextObject.html(\" \");\n clearInterval(deleteWordInterval);\n if(!addNewWordInterval) {\n addNextWord();\n }\n }\n }\n function addNextWord() {\n iterateThroughPossibleWords();\n var positionInNewWord = 1;\n addNewWordInterval = setInterval(addNewWord, 200);\n var nextWord = possibleWords[position];\n $('custom.celebre-means').html(nextWord.charAt(0));\n\n function addNewWord(){\n var customTextObject = $('custom.celebre-means');\n var currentText = customTextObject.html();\n if(!nextWord){\n clearInterval(addNewWordInterval);\n addNewWordInterval=null;\n return;\n }\n if(currentText !== nextWord && positionInNewWord <= nextWord.length) {\n customTextObject.html(nextWord.substring(0, positionInNewWord));\n positionInNewWord++;\n } else {\n clearInterval(addNewWordInterval);\n addNewWordInterval=null;\n }\n }\n function iterateThroughPossibleWords() {\n if(position < possibleWords.length) {\n position++;\n } else {\n position=0;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "693f695af02b0eb7ddb5afc44f15c835", "score": "0.5859845", "text": "function newWord()\r\n{\r\n hideRevealedAnswer();\r\n clearAnswer();\r\n advanceToNextWord();\r\n showWordFromBeginning();\r\n}", "title": "" }, { "docid": "8dbe13dee116946712cf3f97e00c3d80", "score": "0.5855672", "text": "function pickWord() {\n \n}", "title": "" }, { "docid": "9df6f3ba4f78ef87c97b21c9b3cc1906", "score": "0.5855533", "text": "function createMLSentance(){\n // 2nd time setting mL text back to original in case of 2nd use of mL fun.\n let mLArray = mLText.split(\" \");\n // set the argument index for input array to \"0\" for start\n let arrIndex = 0;\n // run for loop over each word in story array\n for(i = 0; i < mLArray.length; i++){\n // set the match index of story array to place where are \"~\"\n let matchIndex = mLArray.indexOf(\"~\");\n // substitute \"~\" with input word (use arrIndex)\n mLArray[matchIndex] = inputArray[arrIndex];\n // increment arrIndex\n arrIndex++;\n }\n // write down the story array after update\n document.getElementById(\"output1\").value = mLArray.join(\" \");\n}", "title": "" }, { "docid": "ca8b7ea5c6e678eec5d1cb3d72c73f8c", "score": "0.58125055", "text": "function firsthacks(){\n $byqs(\"#words li a\").forEach(function(c){\n c.evlis(\"click\",function(e){\n e.preventDefault();\n e.stopPropagation();\n page.load(idof(c));\n })\n });\n}", "title": "" }, { "docid": "75415810badee9d15e12c0097c5931a6", "score": "0.5810851", "text": "function setWords() {\n const choice1 = [\n \"cat\",\n \"dog\",\n \"frog\",\n \"rabbit\",\n \"blue\",\n \"polka-dot\",\n \"pink\",\n \"glamourous\",\n \"lazy\",\n \"sleepy\",\n \"yellow\",\n \"sparkly\",\n \"unicorn\",\n \"vibrant\",\n \"electric\",\n \"neon\",\n \"soft\",\n \"glowing\",\n \"delicate\",\n \"galaxy\",\n \"pastel\",\n \"teal\",\n \"lilac\",\n \"striped\",\n \"quick\",\n \"rose\",\n \"bejeweled\",\n \"milky\",\n \"fantastic\",\n \"melty\",\n \"teddy\",\n \"whimsicle\",\n \"sugary\",\n \"dreamy\",\n \"petit\",\n \"mint\",\n \"azure\",\n \"periwinkle\",\n \"aqua\",\n \"radiant\",\n \"fushia\",\n \"petit\",\n \"fancy\",\n \"sweetie\",\n \"magical\",\n \"cosmic\",\n \"crystal\",\n \"lucky\",\n \"luminous\",\n \"sweet\",\n \"lovely\",\n\n ];\n\n const choice2 = [\n \"alien\",\n \"robot\",\n \"humanoid\",\n \"demon\",\n \"blob\",\n \"creature\",\n \"monster\",\n \"isopod\",\n \"plant\",\n \"dessert\",\n \"ufo\",\n \"ghost\",\n \"extraterrestrial\",\n \"martian\",\n \"apparition\",\n \"slime\",\n \"dragon\",\n \"???\",\n \"fruit\",\n \"mystery\",\n \"fey\",\n \"elemental\",\n \"monstrosity\",\n \"ooze\",\n \"undead\",\n \"beast\",\n \"celestial\",\n \"mutant\",\n \"machine\",\n \"cryptid\",\n \"construct\",\n \"sea creature\",\n \"deity\",\n \"cyclops\",\n \"goblin\",\n \"toy\",\n \"critter\",\n\n\n\n\n ];\n\n const choice3 = [\n \"wearing socks\",\n \"with bubbles\",\n \"with a bow\",\n \"magician\",\n \"explorer\",\n \"royalty\",\n \"trouble maker\",\n \"dreamer\",\n \"with a hat\",\n \"snacking\",\n \"artist\",\n \"idol\",\n \"fighter\",\n \"with wings\",\n \"aristocrat\",\n \"that floats\",\n \"with wings\",\n \"baker\",\n \"rogue\",\n \"musician\",\n \"with frills\",\n \"with horns\",\n \"pop star\",\n\n ];\n\n const randomNumber1 = Math.floor(Math.random() * choice1.length);\n const randomNumber2 = Math.floor(Math.random() * choice2.length);\n const randomNumber3 = Math.floor(Math.random() * choice3.length);\n\n document.getElementById(\"choice1\").innerHTML = choice1[randomNumber1];\n document.getElementById(\"choice2\").innerHTML = choice2[randomNumber2];\n document.getElementById(\"choice3\").innerHTML = choice3[randomNumber3];\n\n}", "title": "" }, { "docid": "ff7829731a205a357fa065d5e7e5f5cf", "score": "0.5794334", "text": "function wordBoxResponse() {\n\tvar el = document.querySelector(\".word-box-response.correct\");\n\tif (el && !el.set) {\n\t\tel.set = true;\n\t\tvar textEl = el.querySelectorAll(\"[data-word]\");\n\t\tvar text = \"\";\n\t\tfor (var i=0; i<textEl.length; i++) {\n\t\t\ttext += textEl[i].getAttribute(\"data-word\") + \" \";\n\t\t}\n\t\tif (text) {\n\t\t\tconsole.log(\"Multiple Selection\");\n\t\t\ttts.speak(text);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef4ee9468412b666200230b1af90f748", "score": "0.5790084", "text": "function spell_attack()\r\n{\r\n\tvar input = document.getElementsByTagName('input');\r\n\tvar button = null;\r\n\tfor (var i = 0; i < input.length; ++i) {\r\n\t\tif (input[i].type == 'submit' && input[i].value.match(\"Use a Skill\"))\r\n\t\t{\r\n\t\t\tbutton = input[i];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(button)\r\n\t\tbutton.click();\r\n}", "title": "" }, { "docid": "72ff4ad8dc26b131cc66d7190b04fd63", "score": "0.5787397", "text": "function doneClicked(){\n\tsentence.answerWrong = false;\n\t//nouns\n\tif(sentence.problemCount % 3 == 1){\n\t\tcheckAnswers(sentence.words1.length, sentence.clicked1, answers.nouns.length, sentence.words1, answers.nouns);\n\t\tcheckAnswers(sentence.words2.length, sentence.clicked2, answers.nouns.length, sentence.words2, answers.nouns);\n\t}\n\t//verbs\n\telse if(sentence.problemCount % 3 == 2){\n\t\tcheckAnswers(sentence.words1.length, sentence.clicked1, answers.verbs.length, sentence.words1, answers.verbs);\n\t\tcheckAnswers(sentence.words2.length, sentence.clicked2, answers.verbs.length, sentence.words2, answers.verbs);\n\t}\n\t//adjectives\n\telse{\n\t\tcheckAnswers(sentence.words1.length, sentence.clicked1, answers.adjectives.length, sentence.words1, answers.adjectives);\n\t\tcheckAnswers(sentence.words2.length, sentence.clicked2, answers.adjectives.length, sentence.words2, answers.adjectives);\n\t}\n\n\tcheckIfClicked(sentence.words1.length, sentence.clicked1);\n\tcheckIfClicked(sentence.words2.length, sentence.clicked2);\n\tcontext.font = \"20px Arial\";\n\tcontext.fillStyle = 'darkRed';\n\t//Determines if there are no words clicked, then display try again message\n\tif(sentence.clickCount == 0){\n\t\tcontext.fillText(\"No words selected, try again!\", 351, 580);\n\t\ttryAgain = true;\n\t}\n\t//For adjective problems\n\telse if(sentence.problemCount % 3 == 0){\n\t\tif(!sentence.answerWrong && sentence.correct == 1){\n\t\t\tcontext.fillText(\"Select one more adjective!\", 363.5, 580);\n\t\t\ttryAgain = true;\n\t\t}\n\t\telse if(sentence.answerWrong || sentence.correct < 2)\n\t\t\tincorrect();\n \telse\n \t\tcorrect();\n\t}\n\t//For noun and verb problems\n else if(!sentence.answerWrong && sentence.correct == 1) {\n\t\tcontext.fillText(\"One correct, select two more!\", 351, 580);\n\t\ttryAgain = true;\n }\n else if(!sentence.answerWrong && sentence.correct == 2) {\n\t\tcontext.fillText(\"Two correct, select one more!\", 351, 580);\n\t\ttryAgain = true;\n }\n else if(sentence.answerWrong || sentence.correct < 3)\n \tincorrect();\n else\n \tcorrect();\n sentence.correct = 0;\n sentence.clickCount = 0;\n\n //If user is correct or incorrect then display next problem\n if(!tryAgain)\n \tdisplayNextProblem(); \t\n}", "title": "" }, { "docid": "c1a6e14cb3aa2edb5e0e584f19efa3e7", "score": "0.5784753", "text": "function identifyWords(word, index) {\n // remove anything from the word that isn't purely the text itself - for instance, \"<b>word</b>\" should become \"word\"\n matchInd = word.search(/\\b(\\w+)\\b/g);\n matchData = word.match(/\\b(\\w+)\\b/g);\n if (matchData === null) {\n return word;\n }\n // word is first match in matchData, matchData.length indicates only one result was found\n // risk - in a scenario where matchData[0].length is greater than one, the data isn't handled\n wordToCheck = matchData[0];\n matchLength = matchData[0].length;\n if (wordToCheck.length > 6 && !wordToCheck.includes(\"http\") && matchData.length == 1) {\n let id = \"id\" + index;\n complexText.currTabWords[id] = [wordToCheck];\n complexTagged = \"<button class='link complex-word-button' ><span class='complex-word' id= \" + id + \">\" + wordToCheck + \"</span></button>\";\n freshHTML = word.substring(0, matchInd) + complexTagged + word.substring(matchInd + matchLength, word.length);\n ++idx;\n return freshHTML;\n }\n else {\n return word;\n }\n}", "title": "" }, { "docid": "6efc008a0f74330d79247c351336a45d", "score": "0.578128", "text": "function wordClicked(input) {\n\tvar text = $(input).text()\n postData(text);\n}", "title": "" }, { "docid": "72b631111046b1182fd7706207c76bfb", "score": "0.5774701", "text": "function spellCheck() {\n\n}", "title": "" }, { "docid": "f3a47857efbab67cd4b3e3d264c8380f", "score": "0.5742901", "text": "function addWords() {\r\n // Clear existing word-section\r\n const wordSection = $$(\"#word-section\")[0];\r\n wordSection.innerHTML = \"\";\r\n $$(\"#typebox\")[0].value = \"\";\r\n\r\n for (let index = 0; index < wordList.length; index++) {\r\n const wordSpan = `<span>${wordList[index]}</span>`;\r\n wordSection.innerHTML += wordSpan;\r\n }\r\n\r\n // Mark first word as current-word\r\n wordSection.firstChild.classList.add(\"current-word\");\r\n}", "title": "" }, { "docid": "71188bde83c56b300640ac0e7240018a", "score": "0.5742823", "text": "function AddWord(each){\n const c=AddPosToPreview(each.pos);\n c.innerHTML=each.word+\" \";\n const EDIT=document.querySelector(\".madLibsEdit\");\n const p=document.createElement(\"span\");\n p.innerHTML=each.word+\" \";\n EDIT.appendChild(p);\n}", "title": "" }, { "docid": "3c20918fe18ed8bd0285c24e7598ba05", "score": "0.5738481", "text": "function showWord(words){\r\n//Generate random array index \r\n const randIndex = Math.floor(Math.random() * words.length);\r\n//Output random word\r\n currentWord.innerHTML = words[randIndex];\r\n\r\n}", "title": "" }, { "docid": "2e67b1d47415d9c5543de1312e3a79fa", "score": "0.57267976", "text": "function showWord(words) {\n\t//Generate random array index\n\tconst randIndex = Math.floor(Math.random() * words.length);\n\t//Output a random word\n\tcurrentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "5adc7d410cfc18e7fa20aab16e57580f", "score": "0.5720805", "text": "function eventListener() {\n let selectors = document.querySelectorAll(\".keys\");\n selectors.forEach((selector) => {\n selector.addEventListener(\"click\", function (evt) {\n evt.preventDefault();\n let clicked = evt.target.innerText;\n let disable = evt.target;\n pushClicked(clicked);\n disableKey(disable);\n renderHangmanWord();\n renderHangmanMistakes(clicked);\n });\n });\n}", "title": "" }, { "docid": "b1ac0d78110a57903c16cc35584acfa7", "score": "0.5720139", "text": "function addWord(event) {\r\n // get the text on the button\r\n // innerHTML for \" \" is \" \", innerText for \" \" is \"\"\r\n const wordToAdd = event.target.innerHTML;\r\n\r\n // add the text to the string\r\n poetryString += wordToAdd;\r\n}", "title": "" }, { "docid": "4f79bf7c7867fc6fc1aba8537aec7227", "score": "0.571669", "text": "function showWord(words) {\r\n // Generate random array index\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n // Output random word\r\n currentWord.innerHTML = words[randIndex];\r\n}", "title": "" }, { "docid": "4f79bf7c7867fc6fc1aba8537aec7227", "score": "0.571669", "text": "function showWord(words) {\r\n // Generate random array index\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n // Output random word\r\n currentWord.innerHTML = words[randIndex];\r\n}", "title": "" }, { "docid": "3d25844c0fc442d8937cb633aadd2d90", "score": "0.57148373", "text": "function learn() {\n if (people == 1) {\n wisdom++\n } else {\n wisdom += people;\n }\n draw();\n setMeaning()\n}", "title": "" }, { "docid": "ede4fa983129a3751b945eb661bb989b", "score": "0.5693984", "text": "function VocabClick(info, tab){\n var search_string = info.selectionText;\n // link\n chrome.tabs.create({url: \"https://www.vocabulary.com/dictionary/\" + search_string});\n}", "title": "" }, { "docid": "59c4a0aa79ead18664074ff3c63c3b6e", "score": "0.5691851", "text": "function mildbtn() {\n //selects random word from mildLevel Array\n var mildWord=mildLevel[Math.floor(Math.random()*mildLevel.length)]; \n // create mildAnswer holder & place _ in place of letter in wordchoice area. \n var mildAnswer =[];\n for(var i=0; i < mildWord.length; i++) {\n mildAnswer[i]=\"_\";\n var holder=document.getElementById(\"wordchoice\");\n holder.innerHTML=mildAnswer.join(\" \");\n}\n//place letter guessed in the letter guess box\nvar letterGuess = document.getElementById(\"letterguess\");\ndocument.onkeyup = function(event) {\n letterGuess.textContent = event.key;\n};\n}", "title": "" }, { "docid": "bb3bb8d3d94192b3c9d70cacb93af146", "score": "0.56903183", "text": "function generateNewWord() {\n paraWord.innerHTML = \" \";\n //Selecting where to pick word from, EASY, MED, or HARD\n if (difficultyLevel == 1) {\n //randomly select any word from EASY\n var random = Math.floor(Math.random() * (data.easy.length));\n var selectedWord = data.easy[random].split(\"\");\n //randomly select any sentence from MEDIUM\n } else if (difficultyLevel == 2) {\n var random = Math.floor(Math.random() * (data.medium.length));\n var selectedWord = data.medium[random].split(\"\");\n //randomly select any sentence from HARD\n } else {\n var random = Math.floor(Math.random() * (data.hard.length));\n var selectedWord = data.hard[random].split(\"\");\n }\n //charArray stores the characters that needs to be typed\n charArray = [];\n //iterate through the word/element which is selected\n //display the word on the screen\n for (var i = 0; i < selectedWord.length; i++) {\n //Store each character inside the span\n var char = createSpan(selectedWord[i]);\n //assign class to each character\n char.classList.add(\"char\");\n //add the character to the word paragraph (Where words from array are displayed)\n paraWord.appendChild(char);\n //add the character to the 'charArray' array\n charArray.push(char);\n }\n}", "title": "" }, { "docid": "f555ea74f36649d4d32c162fed8d2eee", "score": "0.56898195", "text": "function showWord(words) {\n //generate array\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n\n}", "title": "" }, { "docid": "1df06b58218ade93e95cd8be6919dd7d", "score": "0.5677477", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "1df06b58218ade93e95cd8be6919dd7d", "score": "0.5677477", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "1df06b58218ade93e95cd8be6919dd7d", "score": "0.5677477", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "1df06b58218ade93e95cd8be6919dd7d", "score": "0.5677477", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "c99ba177a673664240070156ebfb97bf", "score": "0.56730086", "text": "function mousePressed() {\n index = round(random(numSentence));\n\n}", "title": "" }, { "docid": "6e11428535f2333d052d1b2c4931253e", "score": "0.56698257", "text": "function showWord(words){\n //generate random array index\n const randomIndex = Math.floor(Math.random()*words.length)\n //output random word\n currentWord.innerHTML = words[randomIndex]\n}", "title": "" }, { "docid": "e280aba0a4370da5da456fa5b2375066", "score": "0.5669334", "text": "function C011_LiteratureClass_MildredIntro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 5) SetScene(CurrentChapter, \"Mildred\");\n}", "title": "" }, { "docid": "c70355f0ab7f7c1e58c083fc8798b58b", "score": "0.5668951", "text": "function CheatClick()\r\n{\r\n\tif (CrosswordFinished) return;\r\n\tvar OldWord = CurrentWord;\r\n\tdocument.getElementById(\"wordentry\").value = Word[CurrentWord];\r\n\tOKClick();\r\n\tChangeWordStyle(OldWord, \"ecw-box ecw-boxcheated_unsel\");\r\n}", "title": "" }, { "docid": "00415c35cbd9bd5842ee1faaad7d82c6", "score": "0.5667957", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n //output random word\n currentWord.innerHTML = words[randIndex];\n\n}", "title": "" }, { "docid": "e5b3afaadc29cc115ee3d8eb9386b06e", "score": "0.5667733", "text": "function displayWord(){\n\tcurrWord.textContent = words[Math.floor(Math.random()*words.length)];\n}", "title": "" }, { "docid": "856e750b25e575e9ed3cdb78d8d7a53e", "score": "0.5662452", "text": "function showWord(words) {\n\tcurrentWord.innerHTML = words[Math.floor(Math.random() * words.length)];\n}", "title": "" }, { "docid": "2e23d52eddd997cc86be0b46410fc6aa", "score": "0.565766", "text": "function onClickTextEjercise5() {}", "title": "" }, { "docid": "ce3dd3058c1cf8ca89930afadeeac5d1", "score": "0.564874", "text": "function exspicybtn() {\n //selects random word from extraspicyLevel Array\n var exspicyWord=extraSpicyLevel[Math.floor(Math.random()*extraSpicyLevel.length)]; \n // create spicyAnswer holder & place _ in place of letter in wordchoice area. \n var exspicyAnswer =[];\n for(var i=0; i < exspicyWord.length; i++) {\n exspicyAnswer[i]=\"_\";\n var holder=document.getElementById(\"wordchoice\");\n holder.innerHTML=exspicyAnswer.join(\" \");\n};\n//place letter guessed in the letter guess box\nvar letterGuess = document.getElementById(\"letterguess\");\ndocument.onkeyup = function(event) {\n letterGuess.textContent = event.key;\n};\n//Remaining PseudoCode\n// 1. After word is chose, the script matches the Random word to a word in a Category array.\n// 2. Once the word is matched the script then \"activates\" the category on the UI.\n// 3. The words \" Please select a letter \" comes on the screen\n// 4. After letter selection, the script changes the case to Upper case and matches the letter to the Random word. \n //if the letter matches in the Random Word then the letter appears in the correct place in the word box AND\n // it changes the letter in the letters available box to Green. \n// it decreases the guesses left by 1\n// 5. If a letter does not match, then it changes that letter in the letter box red.\n// It decreases the guesses left by 1\n// \n//Total guesses for the word 12\n// If all guesses are used and the word has not been solved by User - the User loses and Losses increase by 1.\n// If all letters are guessed in the word, they win the game. And the Win goes up by 1 \n// ***Need to add: Begin New Game Button \n // When clicked on, it resets the game and the wins and losses\n\n}", "title": "" }, { "docid": "664bbafe859e9bb2689f5e4cdc357473", "score": "0.5644205", "text": "createWords() {\r\n let word = new quickstart.Label.LabelBuilder().build();\r\n /* add */ (this.words.push(word) > 0);\r\n }", "title": "" }, { "docid": "37581697a679e670e741f00b02d232df", "score": "0.5634691", "text": "function fishingGetWord() { API.triggerServerEvent(\"pushWordToPanel\"); }", "title": "" }, { "docid": "5a1f19b138b65af93a1458c605fd45dd", "score": "0.56336194", "text": "function loadNextWord() {\n //ensuring that all the characters are typed\n var allCharTyped = 0;\n for (var i = 0; i < charArray.length; i++) {\n //Does the typed character array has both the classes in it ? (Is it already checked)?\n if (charArray[i].className === \"char checker\") {\n allCharTyped = allCharTyped + 1;\n }\n //When the user has typed the characters CORRECTLY\n if (allCharTyped === charArray.length) {\n score++; // increment the score\n console.log(\"Correct word!\");\n scoreParagraph.innerHTML = score; //add score to the score div\n //remove the event listener to avoid detecting typed keys unnecessarily\n document.removeEventListener(\"keydown\", checkKey, false);\n\n //generate next word now\n setTimeout(function() {\n paraWord.className = \"displayLine\"; // reassign the class\n generateNewWord(); // give another word\n document.addEventListener(\"keydown\", checkKey, false);\n }, 150);\n }\n }\n}", "title": "" }, { "docid": "7e88b59f4eeec620dc73891c716e2099", "score": "0.5624526", "text": "function showWords(words) {\n //create random numb to access words array\n const random = Math.floor(Math.random() * words.length) + 1;\n //output the random word to page\n currentWord.innerHTML = words[random];\n}", "title": "" }, { "docid": "27da0dd734d7d0d7dd0c4fced8e647aa", "score": "0.56123704", "text": "function CreateNewWord () {\n var randomWords = [\n 'the damned united',\n 'horrid henry',\n 'the blade itself',\n 'a song of ice and fire',\n 'harry potter and the deathly hallows',\n 'super mario land',\n 'its always sunny in philadephia',\n 'mr robot',\n 'westworld'\n ]\n self.HiddenWord = randomWords[Math.floor(Math.random() * randomWords.length)];\n self.RevealedWord = '';\n for (var i=0;i<self.HiddenWord.length;i++) {\n self.RevealedWord += '-';\n }\n\n // Replace any spaces with slashes for readability by the user \n FindOccurences(self.HiddenWord, ' ').map(function (i) {\n self.RevealedWord = self.RevealedWord.replaceAt(i, '/'); \n })\n \n document.getElementById('RevealedWord').innerHTML = self.RevealedWord;\n document.getElementById('Answer').innerHTML = self.HiddenWord;\n }", "title": "" }, { "docid": "bfe867538a6be9b5f1f62bb91ef0a65d", "score": "0.56071687", "text": "function insertWords(storyID) {\n // Turns input words into an array\n var nouns = document.getElementById('nounsList').value.split(', ');\n var verbs = document.getElementById('verbsList').value.split(', ');\n var adjectives = document.getElementById('adjectivesList').value.split(', ');\n var adverbs = document.getElementById('adverbsList').value.split(', ');\n\n // Turns the locations where words are inserted into an array\n var insertNouns = document.getElementById(storyID).getElementsByClassName('noun');\n var insertVerbs = document.getElementById(storyID).getElementsByClassName('verb');\n var insertAdjectives = document.getElementById(storyID).getElementsByClassName('adjective');\n var insertAdverbs = document.getElementById(storyID).getElementsByClassName('adverb');\n\n // Selects add-on words if needed\n selectAddOnWords(nouns, autoNouns);\n selectAddOnWords(verbs, autoVerbs);\n selectAddOnWords(adjectives, autoAdjectives);\n selectAddOnWords(adverbs, autoAdverbs);\n\n // Inserts words into their correct locations\n for (var i = 0; i < nouns.length; i++) {\n insertNouns[i].innerHTML = nouns[i];\n insertVerbs[i].innerHTML = verbs[i];\n insertAdjectives[i].innerHTML = adjectives[i];\n insertAdverbs[i].innerHTML = adverbs[i];\n };\n}", "title": "" }, { "docid": "db36611ef720758247aeef160b1946d8", "score": "0.5606467", "text": "function learnLesson() {\n $(\"button.lr-tray-button\").click()\n $(\".button-bar-wrapper button.btn-primary\").click()\n}", "title": "" }, { "docid": "eebe31bd8dd5abad0e23b47b9b974cf2", "score": "0.5606384", "text": "function showWord(words) {\n // make random index to create random word\n const randomIndex = Math.floor(Math.random() * words.length);\n // display random word\n currentWord.innerHTML = words[randomIndex];\n}", "title": "" }, { "docid": "153bf611eafc201f049db030ecfa3885", "score": "0.56033766", "text": "function showWord(words) {\n let randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "d03123c181ed9abb64e1cbe9b9121e99", "score": "0.5601857", "text": "constructor() {\n this.missed = 0;\n // -- Step Four: add 5 new Phrase objects directly in the empty array that was originally set as the value of the `phrases` property. \n this.phrases = [{\n phrase: 'absolute power corrupts absolutely'\n },\n {\n phrase: 'hello world'\n },\n {\n phrase: 'welcome to the terrordome'\n },\n {\n phrase: 'the waves are pumping'\n },\n {\n phrase: 'get up and go'\n },\n {\n phrase: 'sonic the hedgehog'\n }\n\n ]\n this.activePhrase = 'null';\n\n // call click event on keyboard for Step Nine\n const keyboard = document.getElementById('qwerty');\n // const keyboard = document.querySelectorAll('#qwerty button'); \n keyboard.addEventListener('click', (e) => {\n this.handleInteraction(e);\n });\n\n // listen for keyboard events\n document.addEventListener('keydown', (e) => {\n // 1. get the letter that was pressed, console.log to check it's the correct value\n // capture the event\n const key = e.key;\n // find all the keys\n const keys = document.querySelectorAll('.key');\n // loop through the keys\n for (let i = 0; i < keys.length; i += 1) {\n // check if the key is equal to the keyboard clicked\n if (keys[i].innerHTML === key) {\n // if it is, simulate a mouse click on the element\n keys[i].click();\n return;\n }\n }\n });\n }", "title": "" }, { "docid": "45b10347ce7a1ff5adc77a736472b5d3", "score": "0.56011355", "text": "function nextWord(ignoreall, finished) \r\n{\r\n var frm = document.fm1;\r\n var sug = document.fm1.suggestions;\r\n var sugidx = 0;\r\n var newopt;\r\n var isselected = 0;\r\n\t\r\n // push ignored word onto ingoredWords array\r\n if (ignoreall)\r\n ignoredWords[ misps[ wordindex ].word ] = 1;\r\n\r\n // update the index of all words we have processed\r\n // This must be done to accomodate the replaceAll function.\r\n if (wordindex >= 0) \r\n {\r\n misps[ wordindex ].start += offsetindex;\r\n misps[ wordindex ].end += offsetindex;\r\n }\r\n\r\n // increment the counter for the array of misspelled words\r\n wordindex++;\r\n\r\n \r\n\r\n // draw it and quit if there are no more misspelled words to evaluate\r\n if (misps.length <= wordindex || finished)\r\n {\r\n iFrameBody.innerHTML = mispstr;\r\n iFrameBody.innerHTML = iFrameBody.innerHTML.replace(/_\\|_/g, \"<br>\");\r\n \r\n\t \r\n alert('Spell checking complete.');\r\n //frm.change.disabled = true;\r\n //frm.changeall.disabled = true;\r\n //frm.ignore.disabled = true;\r\n //frm.ignoreall.disabled = true;\r\n\t if (sug)\r\n {\r\n\t\t clearBox( sug );\r\n\t\t // put line feeds back\r\n\t\t mispstr = mispstr.replace(/_\\|_/g, \"\\n\");\r\n\t\r\n\t\t // get a handle to the field we need to re-populate\r\n\t\t window.opener.document.forms[spell_formname][spell_fieldname].value = mispstr;\r\n\t }\r\n\t \r\n\t // Call finished funtion\r\n\t window.opener.spell_complete();\r\n\t window.close();\r\n return true;\r\n }\r\n\r\n\r\n // check to see if word is supposed to be ignored\r\n if (ignoredWords[ misps[ wordindex ].word ] == 1) \r\n {\r\n nextWord(false);\r\n return;\r\n }\r\n\r\n // clear out the suggestions box\r\n clearBox( sug );\r\n\r\n // re-populate the suggestions box if there are any suggested spellings for the word\r\n if (misps[ wordindex ].suggestions.length) \r\n {\r\n for (sugidx = 0; sugidx < misps[ wordindex ].suggestions.length; sugidx++) \r\n\t {\r\n if (sugidx == 0)\r\n isselected = 1;\r\n else\r\n isselected = 0;\r\n newopt = new Option(misps[ wordindex ].suggestions[sugidx], misps[ wordindex ].suggestions[sugidx], 0, isselected); \r\n sug.options[ sugidx ] = newopt;\r\n\r\n if (isselected) \r\n\t\t {\r\n frm.changeto.value = misps[ wordindex ].suggestions[sugidx];\r\n frm.changeto.select();\r\n }\r\n }\r\n }\r\n hilightWord();\r\n}", "title": "" }, { "docid": "45b10347ce7a1ff5adc77a736472b5d3", "score": "0.56011355", "text": "function nextWord(ignoreall, finished) \r\n{\r\n var frm = document.fm1;\r\n var sug = document.fm1.suggestions;\r\n var sugidx = 0;\r\n var newopt;\r\n var isselected = 0;\r\n\t\r\n // push ignored word onto ingoredWords array\r\n if (ignoreall)\r\n ignoredWords[ misps[ wordindex ].word ] = 1;\r\n\r\n // update the index of all words we have processed\r\n // This must be done to accomodate the replaceAll function.\r\n if (wordindex >= 0) \r\n {\r\n misps[ wordindex ].start += offsetindex;\r\n misps[ wordindex ].end += offsetindex;\r\n }\r\n\r\n // increment the counter for the array of misspelled words\r\n wordindex++;\r\n\r\n \r\n\r\n // draw it and quit if there are no more misspelled words to evaluate\r\n if (misps.length <= wordindex || finished)\r\n {\r\n iFrameBody.innerHTML = mispstr;\r\n iFrameBody.innerHTML = iFrameBody.innerHTML.replace(/_\\|_/g, \"<br>\");\r\n \r\n\t \r\n alert('Spell checking complete.');\r\n //frm.change.disabled = true;\r\n //frm.changeall.disabled = true;\r\n //frm.ignore.disabled = true;\r\n //frm.ignoreall.disabled = true;\r\n\t if (sug)\r\n {\r\n\t\t clearBox( sug );\r\n\t\t // put line feeds back\r\n\t\t mispstr = mispstr.replace(/_\\|_/g, \"\\n\");\r\n\t\r\n\t\t // get a handle to the field we need to re-populate\r\n\t\t window.opener.document.forms[spell_formname][spell_fieldname].value = mispstr;\r\n\t }\r\n\t \r\n\t // Call finished funtion\r\n\t window.opener.spell_complete();\r\n\t window.close();\r\n return true;\r\n }\r\n\r\n\r\n // check to see if word is supposed to be ignored\r\n if (ignoredWords[ misps[ wordindex ].word ] == 1) \r\n {\r\n nextWord(false);\r\n return;\r\n }\r\n\r\n // clear out the suggestions box\r\n clearBox( sug );\r\n\r\n // re-populate the suggestions box if there are any suggested spellings for the word\r\n if (misps[ wordindex ].suggestions.length) \r\n {\r\n for (sugidx = 0; sugidx < misps[ wordindex ].suggestions.length; sugidx++) \r\n\t {\r\n if (sugidx == 0)\r\n isselected = 1;\r\n else\r\n isselected = 0;\r\n newopt = new Option(misps[ wordindex ].suggestions[sugidx], misps[ wordindex ].suggestions[sugidx], 0, isselected); \r\n sug.options[ sugidx ] = newopt;\r\n\r\n if (isselected) \r\n\t\t {\r\n frm.changeto.value = misps[ wordindex ].suggestions[sugidx];\r\n frm.changeto.select();\r\n }\r\n }\r\n }\r\n hilightWord();\r\n}", "title": "" }, { "docid": "f66c87261b0f79d5fdc5417e5dbd4884", "score": "0.55966526", "text": "function onClickTextEjercise6() {}", "title": "" }, { "docid": "19e98b9fc3ff25c67a87b839da11c537", "score": "0.55957246", "text": "function wordGen() {\n //Array to hold HTML iterations of each letter to be rendered on the page\n var wordDisplay = [];\n\n var dictionary = [\n \"rainfall\",\n \"fragrant\",\n \"petrichor\",\n \"rain\",\n \"winter\",\n \"aqua\",\n \"aqueduct\",\n \"well\",\n \"basin\",\n \"blizzard\",\n \"boil\",\n \"brine\",\n \"canal\",\n \"channel\",\n \"cloudburst\",\n \"condensation\",\n \"damp\",\n \"depth\",\n \"dew\",\n \"downpour\",\n \"drain\",\n \"drenched\",\n \"drinkable\",\n \"drizzle\",\n \"drop\",\n \"evaporation\",\n \"flood\",\n \"flow\",\n \"frost\",\n \"frozen\",\n \"geyser\",\n \"hail\",\n \"headwaters\",\n \"humidity\",\n \"hurricane\",\n \"hydrology\",\n \"hydropower\",\n \"ice\",\n \"crystals\",\n \"irrigation\",\n \"lake\",\n \"moisture\",\n \"monsoon\",\n \"ocean\",\n \"pond\",\n \"pool\",\n \"precipitation\",\n \"puddle\",\n \"runoff\",\n \"river\",\n \"snowfall\",\n \"snow\",\n \"spray\",\n \"sprinkler\",\n \"stream\",\n \"swamp\",\n \"tide\",\n \"typhoon\",\n \"vapor\",\n \"waterfront\",\n \"watershed\",\n \"waves\",\n \"wetlands\",\n ];\n //Stores a random word from our dictionary object inside a variable\n var randWord = dictionary[Math.floor(Math.random() * dictionary.length)];\n //wordStage recieves HTML to render to the page for randomly generated word\n var wordStage = document.getElementById(\"stage\");\n //Loop through the randomly generated word and do two things:\n //1. Push HTML to array wordDisplay for HTML to be rendered on the page\n //2. Convert the randomly chosen word into individual letters and store in an array called \"currentword\"\n for (i = 0; i < randWord.length; i++) {\n\n //If word includes duplicate letters, create a class for it\n //Else, create with a class of letter and unique id\n wordDisplay.push(\"<div class='box'><div class = '\" + randWord.charAt(i).toLowerCase() + \" letters' style='margin: 0 auto; text-align: center; padding-top: 30%;'>\" + randWord.charAt(i) + \"</div></div>\");\n currentword.push(randWord.charAt(i).toLowerCase());\n //could this be achieved with neater code using JS methods like appendChild()? createElement()?\n\n }\n //Removes commas from array and pushes wordDisplay contents to the DOM tree\n wordStage.innerHTML = wordDisplay.join(\"\");\n\n $(\".letters\").hide();\n $(\".box\").hide();\n\n}", "title": "" }, { "docid": "c0dad036571b801fd416b0e01628bf12", "score": "0.5594646", "text": "function onMousedownLink(ev, ths) {\n ev.stopPropagation();\n var lnk = decodeURIComponent(ths.dataset.lnk);\n var noq = ths.dataset.noq;\n if (noq) noq = decodeURIComponent(noq);\n var mod = ths.dataset.mod;\n if (mod) mod = decodeURIComponent(mod);\n var theWordsElt = document.getElementById(\"theWords-\"+myNamespace);\n var words = theWordsElt.textContent;\n if (\"TEXTAREA\" == theWordsElt.nodeName || \"INPUT\" == theWordsElt.nodeName) {\n words = theWordsElt.value;\n }\n console.log(\"onMousedownLink, mod\", mod);\n if (mod.length > 0) lnk = window[myNamespace+mod](lnk);\n var addQuotes = (undefined == noq || null == noq || 0 == noq.length || \"true\" == noq)\n && document.getElementById(\"quoteBx-\"+myNamespace).checked;\n if (addQuotes) {\n var hasQuotes = /\"THEWORDS\"/.exec(lnk) || /%22THEWORDS%22/.exec(lnk);\n if (!hasQuotes) words = '\"'+words+'\"';\n }\n lnk = lnk.replace(/THEWORDS/g, encodeURIComponent(words));\n ths.setAttribute(\"href\", lnk);\n }", "title": "" }, { "docid": "ff787b9033aff0d4e44229fcfbb24311", "score": "0.5592105", "text": "function requestNewWord()\n{\n\tif(answerIndex < answers.length) // Player needs one of the non-special words\n\t{\n\t\tcurrentAnswer = answers[answerIndex];\n\t\tcurrentLetter = letters[answerIndex];\n\t\tvar scrambledWord = scrambleWord(currentAnswer);\n\t\t\n\t\tdocument.getElementById(\"real_word\").innerHTML = currentAnswer;\n\t\tvar canvas = document.getElementById(\"scrambled_word_canvas\");\n\t\tdrawWord(scrambledWord,canvas,currentLetter);\n\t}\n\telse // The player has guessed all the correct words, time for the special word\n\t{\n\t\tcurrentAnswer = specialWord;\n\t\t\n\t\tdocument.getElementById(\"real_word\").innerHTML = currentAnswer;\n\t\tvar canvas = document.getElementById(\"scrambled_word_canvas\");\n\t\tclearCanvas(canvas);\n\t\tlevel = \"Final Word\";\n\t\tsetScore();\n\t}\n}", "title": "" }, { "docid": "a157682d4a4f48b782ac8b9cc2de059e", "score": "0.55916363", "text": "function new_text(text){\n\n\tvar t = new Text(text);\n\tt.setup();\n sentence = new Sentence(t.get_words(), text);\n\n autotag(t, sentence);\n\n el(\"box\").innerHTML = \"\";\n word_selector = new WordSelector(\"box\", t);\n word_selector.setup();\n show_untagged_words();\n\n update_region_list();\n el(\"allregions\").addEventListener(\"change\", function(x){\n update_subregions();\n });\n //M: Master flow logged below\n //console.log(\"M: Sentence after autotagging: \", JSON.stringify(sentence));\n}", "title": "" }, { "docid": "4b594a63c13f156f3eeb82fc788855dd", "score": "0.55891865", "text": "function play_word(word) {\n\n}", "title": "" }, { "docid": "beb0145394887576b4524a37102058f6", "score": "0.55886763", "text": "function newGame() {\n var s = '<div class=\"h5p-hangman-feedback\">'\n + '<button class=\"h5p-hangman-neword\" type=\"button\">'\n + _ui.tryAgainButton + '</button>';\n s += '<div>' + _ui.wordCount + ' : '\n + (gameState.loss + gameState.win) + '</div>';\n s += '<div>' + _ui.correctCount + ' : ' + gameState.win + '</div>';\n s += '<div>' + _ui.errorCount + ' : ' + gameState.loss + '</div>';\n s += '</div>';\n gameState.divAlphabeth.innerHTML = s;\n document.querySelector(gameState.qsAlphabeth + ' .h5p-hangman-neword')\n .addEventListener('click', newWord);\n }", "title": "" }, { "docid": "6af510fce7f973e8ccdc1cba130b64fb", "score": "0.55885106", "text": "function runGame() {\n\tchooseWord();\n\tsetWordDisplay(currentHiddenWord);\n}", "title": "" }, { "docid": "c53d4386e818b2e03bd855544f9caef4", "score": "0.55848306", "text": "function handleWordClick(descrip){\n if (document.getElementsByClassName(\"visibleDescription\").length === 0){\n showDescription(descrip)\n } else if (descrip.classList.contains(\"visibleDescription\")){\n hideDescription(descrip)\n } else if (document.getElementsByClassName(\"hiddenWord\").length > 0){\n hideDescription(document.getElementsByClassName(\"visibleDescription\")[0])\n } else {\n let previouslyVisibleDescription = document.getElementsByClassName(\"visibleDescription\")[0]\n previouslyVisibleDescription.classList.remove(\"visibleDescription\");\n previouslyVisibleDescription.classList.add(\"hiddenDescription\")\n showDescription(descrip)\n }\n }", "title": "" }, { "docid": "31ed81f312e9ba8b23d7aae2f2a14186", "score": "0.5574295", "text": "makeText(numWords = 100) {\n const keys = Array.from(this.markovMap.keys()); //makes arr of keys from markov Map\n let word = MarkovMachine.chooseWord(keys);\n let str = word;\n\n for(let i = 1; i < numWords; i++){//we start @ i = 1 b/c str already has 1 word in it\n word = MarkovMachine.chooseWord(this.markovMap.get(word));//chose next word to add to the str\n \n if(word === null) break;\n\n str+=` ${word}`;\n }\n\n return str;\n }", "title": "" }, { "docid": "3a544bec673fd6112bfbc0f7894ac611", "score": "0.5571521", "text": "function tutorial_click_handler(e) {\n\tlet idx = -1;\n\t// find the current tutorial item that is clicked on\n\tfor(let i = 0; i < TUTORIAL_ITEMS.length; i++) {\n\t\tif (TUTORIAL_ITEMS[i] == this) {\n\t\t\tidx = i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t// activate tools if no more tutorial available\n\tif (idx >= TUTORIAL_ITEMS.length) {\n\t\tstart_tool();\n\t}\n\t// otherwise retrieve next tutorial item\n\telse if (idx > 0) {\n\t\tTUTORIAL_ITEMS[idx - 1].style.display = \"none\";\n\t\tTUTORIAL_ITEMS[idx].style.display = \"block\";\n\t}\n}", "title": "" }, { "docid": "6984863cab2762746493cee4b0125341", "score": "0.5565847", "text": "function onClickTextEjercise3() {}", "title": "" }, { "docid": "d981321d1b363f4d3710e4c79fb16b4b", "score": "0.5565521", "text": "function start() {\r\n $(\".err\").hide();\r\n $('input[name=\"paraphrase\"]').attr('checked', false);\r\n\r\n // Display the context sentence.\r\n // exp.pronoun = 0;\r\n // if((exp.examples[i].context.search(\"their\") != -1) || (exp.examples[i].context.search(\"they\") != -1) ||\r\n // exp.examples[i][exp.condition].search(\"them\") != -1 || exp.examples[i][exp.condition].search(\"They\") != -1) {\r\n\r\n // // if \"They\" is used, we randomly select a pronoun for the other person and record it\r\n // if (exp.examples[i][exp.condition].search(\"They\") != -1) {\r\n // exp.pronoun = getPronoun(exp.examples[i][exp.condition], exp.names[i]);\r\n // $(\".display_context\").html(exp.names[i] + exp.pronoun);\r\n // }\r\n // else {\r\n // $(\".display_context\").html(exp.names[i] + getPronoun(exp.examples[i][exp.condition], exp.names[i]));\r\n // }\r\n // }\r\n // else {\r\n // $(\".display_context\").html(exp.names[i] + exp.examples[i][exp.condition]);\r\n // }\r\n\r\n exp.supercategory = exp.examples[i].supercategory;\r\n if ((exp.examples[i].supercategory == \"cars\") && (exp.examples[i].degree == \"size\")) {\r\n exp.supercategory = \"cars1\";\r\n }\r\n else if ((exp.examples[i].supercategory == \"cars\") && (exp.examples[i].degree == \"sound\")) {\r\n exp.supercategory = \"cars2\";\r\n }\r\n\r\n if (exp.examples[i].phrase.slice(-1) == \"s\") {\r\n exp.examples[i].phrase = exp.examples[i].phrase.slice(0, -1);\r\n }\r\n\r\n first_letter = exp.examples[i].phrase.slice(0, 1);\r\n if (first_letter == \"a\" || first_letter == \"e\" || first_letter == \"i\" || first_letter == \"o\" || first_letter == \"u\") {\r\n $(\".display_context\").html(exp.contexts[exp.supercategory].replace(\r\n \"PERSON\", exp.names[i]).replace(\r\n \"PHRASE\", exp.examples[i].phrase).replace(\r\n \"PRE\", \"an\"));\r\n }\r\n else {\r\n $(\".display_context\").html(exp.contexts[exp.supercategory].replace(\r\n \"PERSON\", exp.names[i]).replace(\r\n \"PHRASE\", exp.examples[i].phrase).replace(\r\n \"PRE\", \"a\"));\r\n }\r\n\r\n // Display the question.\r\n $(\".display_question\").html(\"Would you expect the \" + exp.examples[i].phrase + \" to be <b>\" + exp.examples[i].target +\r\n \" in comparison to other \" + exp.examples[i].supercategory + \"</b>?\");\r\n\r\n // Display the radio buttons.\r\n $(\".display_buttons\").html(\"<div>\" +\r\n \"<label><input type=\\\"radio\\\" name=\\\"paraphrase\\\" value=\\\"0\\\"/>\" + exp.responseOrder[0] + \"</label>\" +\r\n \"<label><input type=\\\"radio\\\" name=\\\"paraphrase\\\" value=\\\"1\\\"/>\" + exp.responseOrder[1] + \"</label>\" +\r\n \"<label><input type=\\\"radio\\\" name=\\\"paraphrase\\\" value=\\\"1\\\"/>\" + exp.responseOrder[2] + \"</label>\" +\r\n \"<br><br></div>\");\r\n // $('label[for=0]').html(exp.responseOrder[0]);\r\n // $('label[for=1]').html(exp.responseOrder[1]);\r\n }", "title": "" }, { "docid": "63636de366b278791b8644efb73286d1", "score": "0.55628526", "text": "function next(){\r\n\tconsole.log(\"Next was clicked\");\r\n\tcurrentWord += 1;\r\n\tif (currentWord>(totalWords-1)){\r\n\t\tcurrentWord = 0;\r\n\t}\r\n\tupdateCurrentWord();\r\n\trefreshDisplay();\r\n}", "title": "" }, { "docid": "0cbc41626bb9e188f6d88cb719d7b294", "score": "0.5561259", "text": "function rendreCaseCliquableDocument(){\n for(let i=0;i<8;i++) { \n for (let j=0;j<8;j++) {\n document.getElementById(`pion${i}${j}`).addEventListener('click', jouerCase, false);\n }\n }\n}", "title": "" }, { "docid": "d40bdb4eefd51b9381f3fe21e1a4c8b8", "score": "0.5558872", "text": "function loadWords() {\r\n $.get(FILE_PATH+files['valid_3.txt'], function(data) {\r\n legalWords = data.split('\\n');\r\n \r\n for(var i = 0; i < legalWords.length; i++) {\r\n suggestions[legalWords[i]] = [];\r\n }\r\n \r\n for(var i = 0; i < legalWords.length; i++) {\r\n for(var j = i+1; j < legalWords.length; j++) {\r\n if (link(legalWords[i], legalWords[j])) {\r\n suggestions[legalWords[i]].push(legalWords[j]);\r\n suggestions[legalWords[j]].push(legalWords[i]);\r\n }\r\n }\r\n }\r\n \r\n loadPuzzles();\r\n// alert(suggestions[\"fit\"]);\r\n });\r\n}", "title": "" }, { "docid": "998308a7803a2a2f9526ed7cda79204b", "score": "0.5551879", "text": "function handleWordSelect() {\n let word = this.innerText;\n lookWord(word);\n }", "title": "" }, { "docid": "0db568e0e335620770febb23118b8b91", "score": "0.5550982", "text": "function setHandler() {\r\n var annotatedWords = document.querySelectorAll(\".annotation\");\r\n [].forEach.call(annotatedWords, function(obj){\r\n obj.addEventListener('click', function() {\r\n activeAnnotation = this.textContent;\r\n var annLang = language;\r\n Object.keys(manifest).forEach(function(key){\r\n if (manifest[key].hasOwnProperty(activeAnnotation)) {\r\n annLang = key;\r\n return;\r\n }\r\n });\r\n args.popupEditor.annotation = {\"manifest\" : manifest[annLang], \"word\" : this.textContent};\r\n args.popupEditor.show();\r\n });\r\n });\r\n }", "title": "" }, { "docid": "8f12fa1035aa82a5cb1ad98cf56d8e4f", "score": "0.5547032", "text": "function showWord(words) {\n\tconst randIndex = Math.floor(Math.random() * words.length);\n\n\tcurrentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "247918de783fc768b74bdb587671f1d7", "score": "0.5542234", "text": "function C006_Isolation_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 4) SetScene(CurrentChapter, C006_Isolation_Intro_Teacher);\n}", "title": "" }, { "docid": "fe3c1a9f23b365e0759db09f7dfca0e5", "score": "0.553201", "text": "function showWord(words) {\n //random index of array\n const randIndex = Math.floor(Math.random() * words.length);\n\n //output random word to dom\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "e6bd43a92e57ef4534816b7474463141", "score": "0.5529126", "text": "function showWord ()\r\n{\r\n const wordsOnScreen =document.querySelector('#word-container h1');\r\n let index = Math.floor(Math.random() * wordsArray.length);\r\n if (currentLevel === levels.hard)\r\n {\r\n wordsOnScreen.innerHTML = changeCase(wordsArray[index]);\r\n }\r\n else\r\n {\r\n wordsOnScreen.innerHTML = wordsArray[index];\r\n }\r\n \r\n let index1 = Math.floor(Math.random() * colors.length);\r\n wordsOnScreen.style.color = colors[index1];\r\n \r\n \r\n\r\n}", "title": "" }, { "docid": "a48b4fdfeef2e1ae2ec85d6054d0987b", "score": "0.5528434", "text": "function display() {\n for (var j = 0; j < wordChosen.length; j++) {\n if (keyPressed === wordChosen[j]) {\n word.children[j].innerText = wordChosen[j];\n tmp++;\n }\n }\n}", "title": "" }, { "docid": "5009ee8ea41b6a571dbe6678972454a8", "score": "0.5525598", "text": "analyzeSentenceLocations(){\r\n\r\n }", "title": "" }, { "docid": "f30b8e172a487e2969b7be0d73eef945", "score": "0.5525188", "text": "function findAndHighlightKeywords(){\n $('p', '#theoryInfoMore').each(function() {\n var current = $(this);\n selectedKeywords.forEach(function(keywordphrase){\n current.mark(keywordphrase, {\"each\": function(node){\n var button = $(node).parent().parent().prev();\n if(!button.hasClass(\"active\")){\n button.trigger(\"click\");\n }\n }});\n });\n });\n}", "title": "" } ]
7da6e36fae0d585f30a5298b864f68f5
Adds or removes an outline on the event target
[ { "docid": "edc962f000c6f7f2022eee854e85790e", "score": "0.0", "text": "static formClick(event, color = \"red\") {\n var component = event.target;\n\n if (event.metaKey && event.shiftKey==false) {\n component = event.target;\n\n if (\"style\" in component && \"border\" in component.style) {\n var style = component.style;\n var isString = typeof style.border==\"string\"; \n var borderWidth = 0;\n\n if (isString) {\n borderWidth = parseInt(style.border);\n }\n else {\n borderWidth = style.border && style.border.width && style.border.width.top ? style.border.width.top.value : 0 ;\n }\n\n if (borderWidth==0 || isNaN(borderWidth)) {\n style.border = \"1px dashed \" + color;\n }\n else {\n style.border = \"0px dashed \" + color;\n }\n }\n } \n\n if (event.shiftKey) {\n component = event.target;\n\n if (DebugSettings.form==null) {\n var group = document.createElement(\"div\");\n var inputName = document.createElement(\"input\");\n var inputValue = document.createElement(\"input\");\n var nameError = document.createElement(\"span\");\n var valueError = document.createElement(\"span\");\n var span = document.createElement(\"span\");\n \n inputName.type = \"text\";\n inputValue.type = \"text\";\n //inputName.style.width = \"120px\";\n inputName.style.flex = \"1\";\n inputName.style.height = \"20px\";\n inputName.style.margin = \"0\";\n inputName.style.marginRight = \"0\";\n //inputValue.style.width = \"100px\";\n inputValue.style.flex = \"1\";\n inputValue.style.height = \"20px\";\n //inputValue.style.padding = \"0\";\n inputValue.style.margin = \"0\";\n inputName.placeholder = \"name\";\n inputValue.placeholder = \"value\";\n inputValue.placeholder = \"value\";\n span.innerHTML = \"X\";\n nameError.innerHTML = \"!\";\n nameError.style.color = \"red\";\n nameError.title = \"Property not found\";\n valueError.title = \"Value not found\";\n nameError.style.display = \"none\";\n valueError.style.display = \"none\";\n span.style.paddingLeft = \"2px\";\n span.style.marginRight = \"10px\";\n span.style.cursor = \"pointer\";\n group.style.backgroundColor = \"rgba(255, 255, 255, .85)\";\n\n span.addEventListener(\"click\", function(e) {\n group.remove();\n DebugSettings.form = null;\n })\n\n inputName.addEventListener(\"change\", DebugSettings.inputNameHandler)\n inputName.addEventListener(\"input\", DebugSettings.inputNameHandler)\n inputValue.addEventListener(\"change\", DebugSettings.inputValueHandler)\n\n group.appendChild(inputName);\n group.appendChild(nameError);\n group.appendChild(inputValue);\n group.appendChild(valueError);\n group.appendChild(span);\n group.style.position = \"absolute\";\n group.style.top = \"0px\";\n group.style.gap = \"0px\";\n group.style.left = \"0px\";\n group.className = \"row\";\n\n component.ownerDocument.body.firstChild.appendChild(group);\n\n DebugSettings.form = group;\n DebugSettings.form.component = component;\n DebugSettings.form.inputName = inputName;\n DebugSettings.form.inputValue = inputValue;\n DebugSettings.form.nameError = nameError;\n DebugSettings.form.valueError = valueError;\n }\n }\n }", "title": "" } ]
[ { "docid": "ea764d3d1fcba93aee3453e4846049db", "score": "0.6855625", "text": "function outlineElement(event) {\r\n\tvar elem;\r\n\tif($type(event) == 'element') {\r\n\t\telem = event;\r\n\t} else {\r\n\t\tvar e = new Event(event).stop();\r\n\t\telem = new Element(e.target);\r\n\t\tif(elem.className && elem.className.match('dung')) {return;}\r\n\r\n\t\tif(dung_status.indung_lock != true) {\r\n\t\t\tif(current_dom_node) {\r\n\t\t\t\tcurrent_dom_node.removeClass('dung_dom_selected');\r\n\t\t\t}\r\n\t\t\thighlightInDOMView(e.target);\r\n\t\t\tinspectElement(event);\r\n\t\t}\r\n\t}\r\n\r\n\tif(!elem.className.match('dung') && elem != body) {\r\n\t\tvar pos = elem.getPosition();\r\n\t\tvar size = elem.getSize();\r\n\r\n\t\toutline_top.setStyles({'top':pos.y, 'left':pos.x, 'width':size.x});\r\n\t\toutline_bottom.setStyles({'top':pos.y+size.y, 'left':pos.x, 'width':(parseInt(size.x)+2)+'px'});\r\n\t\toutline_right.setStyles({'top':pos.y, 'left':pos.x+size.x, 'height':size.y});\r\n\t\toutline_left.setStyles({'top':pos.y, 'left':pos.x, 'height':size.y});\r\n\t}\r\n}", "title": "" }, { "docid": "c56a15213e30b49b3a80a61118ac1e96", "score": "0.6805903", "text": "function inspectorMouseOver(e) {\n // NB: this doesn't work in IE (needs fix):\n var element = e.target;\n\n // Set outline:\n element.style.outline = '3px solid #563d7c';\n\n // Set last selected element so it can be 'deselected' on cancel.\n last = element;\n}", "title": "" }, { "docid": "5ab259e617cde4423c91344104b74d74", "score": "0.65636593", "text": "function release(e, x, y) {\n curr.style.borderStyle = \"outset\";\n curr.style.background = \"lightgreen\";\n }", "title": "" }, { "docid": "af4ae5b99d557ad947aeeb75f1012989", "score": "0.6478931", "text": "function inspectorMouseOut(e) {\n // Remove outline from element:\n e.stopImmediatePropagation()\n e.target.style.outline = '';\n}", "title": "" }, { "docid": "71988bbbd5999807f4a09f9b4ed49cd7", "score": "0.6387872", "text": "function restoreOutline() {\n if (!_outlineElement) {\n return;\n }\n\n _outlineElement.style.outline = _outlineStyle;\n _outlineElement = undefined;\n _outlineStyle = undefined;\n _DomEvent__WEBPACK_IMPORTED_MODULE_0__.off(window, 'keydown', restoreOutline);\n}", "title": "" }, { "docid": "1904323e6922bf8c25f84aa46b3fa4ca", "score": "0.63543874", "text": "[symbols.outline](context) {\n context.strokeRect(0, 0, this.width, this.height);\n }", "title": "" }, { "docid": "a851f7f1ba2d03eb78ce5041506a0a91", "score": "0.63017654", "text": "function restoreOutline() {\n if (!_outlineElement) {\n return;\n }\n\n _outlineElement.style.outline = _outlineStyle;\n _outlineElement = undefined;\n _outlineStyle = undefined;\n off(window, 'keydown', restoreOutline);\n }", "title": "" }, { "docid": "c02f0651259b86b251d6a98082ebdecd", "score": "0.62843436", "text": "function inspectorMouseOut(e) {\n\t\t// Remove outline from element:\n\t\te.target.style.outline = '';\n\t}", "title": "" }, { "docid": "dc2f6aa8e6965ad5c9f4249b7e3cb04d", "score": "0.6172819", "text": "function outlineOne() {\n outlinesNo = 0;\n\n icons[outlinesNo].classList.toggle(\"icon-yonetim-active\");\n\n\n\n showOutlines(outlinesNo);\n }", "title": "" }, { "docid": "fbb123dc61119281ef35826a9f34899f", "score": "0.61521465", "text": "static outlineOnClick (element) {\n \n if (\"_outlineOnClick\" in DebugSettings===false) {\n DebugSettings._outlineOnClick = element; // save element to remove listeners \n }\n\n if (\"_outlineOnClick\" in DebugSettings && element==null) {\n \n if (DebugSettings._outlineOnClick) {\n DebugSettings._outlineOnClick.addEventListener(\"click\", DebugSettings.formClick);\n }\n\n DebugSettings._outlineOnClick = null;\n return;\n }\n\n if (element) {\n element.addEventListener(\"click\", DebugSettings.formClick);\n }\n\n }", "title": "" }, { "docid": "96c8fe662b54646b52e01b2f3d210c6f", "score": "0.61352617", "text": "function inspectorMouseOver(e) {\n\t\t// NB: this doesn't work in IE (needs fix):\n\t\tvar element = e.target;\n\n\t\t// Set outline:\n\t\telement.style.outline = '2px solid #f00';\n\t\tif (report) report.text( \" Label: \" + getLabel(e.target) + ' / ' + cssPath(e.target));\n\n\t\t// Set last selected element so it can be 'deselected' on cancel.\n\t\tlast = element;\n\t}", "title": "" }, { "docid": "a8852d424103bb9c0bbffc57c1a914c0", "score": "0.6107146", "text": "function addBlackBorder(event) {\n event.target.style.border= \"5px dashed black\";\n}", "title": "" }, { "docid": "d6dee456bc20d49d619394ed83aba2b5", "score": "0.6066413", "text": "function setBorder(event){\n event.target.style.border=\"3px solid red\";\n}", "title": "" }, { "docid": "c328e9e3123403eacc1521555ab22ec2", "score": "0.6015408", "text": "static outlineOnClick (element) {\n const _outlineOnClick = \"_outlineOnClick\";\n \n if (\"_outlineOnClick\" in DebugSettings===false) {\n DebugSettings._outlineOnClick = element; // save element to remove listeners \n }\n\n if (\"_outlineOnClick\" in DebugSettings && element==null) {\n \n if (DebugSettings._outlineOnClick) {\n DebugSettings._outlineOnClick.addEventListener(\"click\", DebugSettings.outlineOnFormClickHandler);\n }\n\n DebugSettings._outlineOnClick = null;\n return;\n }\n\n if (element) {\n element.addEventListener(\"click\", DebugSettings.outlineOnFormClickHandler);\n }\n\n }", "title": "" }, { "docid": "8134b1c540bd21f1c923265e9b64c00e", "score": "0.597906", "text": "function markBorders(event) {\n var clickedElement = event.target;\n $(clickedElement).toggleClass('markedBorder');\n}", "title": "" }, { "docid": "c43aa2d446c549dd0b9e63a180eccf89", "score": "0.5963714", "text": "function change_border(event) {\n console.log(event);\n event.target.style.border = \"15px solid red\";\n}", "title": "" }, { "docid": "fbf28fbe2afbc3d6538d0db9cea67954", "score": "0.5934826", "text": "function eraser(e){\n e.target.style.backgroundColor='#FFFFFF';\n }", "title": "" }, { "docid": "ca582ddad13ed0956960537ec6ff8cb2", "score": "0.591669", "text": "function highlightShape(obj) {\r\n obj.style.outline = \"2px dotted rgb(0, 78, 171)\";\r\n }", "title": "" }, { "docid": "398a8694816236c2ce98ec5d44de5203", "score": "0.5904958", "text": "function map_on_drag_outline(){\n if (this.callDragstartOnNextDrag){\n this.callDragstartOnNextDrag = false;\n this.fire('dragstart');\n }\n\n\n if (this._mapSync_showOutline()){\n var bounds = this.getBounds();\n for(var i=0; i<this.rectangleList.length; i++)\n this.rectangleList[i].setBounds(bounds);\n }\n }", "title": "" }, { "docid": "88e67cb7ba6c5b2a881e730c38d2f2f6", "score": "0.5849597", "text": "function selectEvent(event) {\n\t$(pastSelectedEvent).css('border-color', '');\n\t$(event).css('border-color', 'red');\n}", "title": "" }, { "docid": "1b02c78371acc21ab4827c07a1215342", "score": "0.58179355", "text": "function highlight() {\n\n if (clickedElement) {\n context.fillStyle = 'blue';\n context.strokeRect(drawingCanvas.width + 100, drawingCanvas.height + 100, clickedElement.width, clickedElement.height);\n\n canvasRects.push(new CanvasRectangle(this.x, this.y, this.width, this.height, this.targetCanvas, 'blue', 'stroke'));\n this.highlightRect = canvasRects.length - 1;\n\n }\n\n}", "title": "" }, { "docid": "eb5531329860a0c6e31d6afd47e8b4ed", "score": "0.5748716", "text": "function drawOnMe(event)\n {\n event.target.style.backgroundColor = color;\n event.stopPropagation();\n }", "title": "" }, { "docid": "b7cd497b5f31d9c266836cd3963e13c5", "score": "0.5669541", "text": "function mouseLeave(e, obj) {\n var shape = obj.findObject(\"SHAPE\");\n // Return the Shape's fill and stroke to the defaults\n shape.fill = obj.data.color;\n shape.stroke = \"#4d6d9a\";\n // Return the TextBlock's stroke to its default\n var text = obj.findObject(\"TEXT\");\n text.stroke = \"#5f6366\";\n }", "title": "" }, { "docid": "7f156a91e0d5332a99ee615589b4ddc4", "score": "0.5665278", "text": "function toggleOutlines() {\r\n\tif(outline_top.getStyle('display') == 'none') {\r\n\t\toutline_top.setStyle('display', 'block');\r\n\t\toutline_bottom.setStyle('display', 'block');\r\n\t\toutline_right.setStyle('display', 'block');\r\n\t\toutline_left.setStyle('display', 'block');\r\n\t} else {\r\n\t\toutline_top.setStyle('display', 'none');\r\n\t\toutline_bottom.setStyle('display', 'none');\r\n\t\toutline_right.setStyle('display', 'none');\r\n\t\toutline_left.setStyle('display', 'none');\r\n\t}\r\n}", "title": "" }, { "docid": "fb1f859090d44ecb666fdadc72905a0c", "score": "0.5640955", "text": "function svgCanvasOutline() {\r\n svg = d3.select(\"#content\")\r\n .append(\"svg\")\r\n .attr(\"width\", \"100%\")\r\n .attr(\"height\", \"100%\")\r\n .on(\"click\", function(d,i) {\r\n if (globalIsLinePlusClick && globalIdsToConnect.length === 2) {\r\n connectNodes()\r\n linePlusClick()\r\n } else if (globalIsBlockEdit && !globalEditFirstTouch && globalEditId > -1) {\r\n blockInfoUpdate()\r\n } else if (globalEditFirstTouch) {\r\n globalEditFirstTouch = false\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a806ccc95eba2d79735bc6b815ed9cdb", "score": "0.5635299", "text": "function highlightPoint(e) {\n e.target.setStyle({\n stroke: true,\n color: highlightColour\n });\n }", "title": "" }, { "docid": "6cd9618f542860552e699aab200df22b", "score": "0.56262046", "text": "function inspectorMouseOut(e) {\n // Remove outline from element:\n e.target.style.outline = '';\n jq('.ATOMSpyToolTip').remove();\n}", "title": "" }, { "docid": "9fad8b72a86bbaf7415a532058b8a958", "score": "0.5618049", "text": "function paintSquare( e ) {\n e.target.style.backgroundColor = currentColor\n}", "title": "" }, { "docid": "3b8896e6cbd26ac28cd1278ffeee4ca3", "score": "0.5616418", "text": "function remove(e) {\n e.target.style.backgroundColor = 'rgba(0,0,0,1)';\n e.target.removeEventListener('mouseover', paint);\n}", "title": "" }, { "docid": "79f7e64016205a7b927467cb6a651264", "score": "0.5598234", "text": "function clickEdge(){\n\t\tresetColors();\n\t\tselectElement(this);\t\t\n\t\tthis.stroke=\"2px #F00\";\n\t\tcanvas.redraw();\n\t}", "title": "" }, { "docid": "e44a2b6fdbabd067f52e7433ed830852", "score": "0.55777454", "text": "function removeBorder(e) {\n if (e.propertyName !== \"border-bottom-color\") return;\n this.classList.remove(\"keyHit\");\n}", "title": "" }, { "docid": "a78c64c83a0f109887143afaf9699639", "score": "0.55616176", "text": "function porFueraBorde(ev){\n document.getElementById(ev.target.id).style.border=\"\";\n}", "title": "" }, { "docid": "4900c53df1d1afb38f980be4f2e31664", "score": "0.5484708", "text": "function borde(e) {\n\tvar layers = e.target;\n\n\tlayers.setStyle({\n\t\tweight: 3,\n\t\tcolor: 'cyan',\n\t\tdashArray: '3',\n\t\tfillOpacity: 0\n\t});\n\n\tif (!L.Browser.ie && !L.Browser.opera) {\n\t\tlayers.bringToFront();\n\t}\t\t\t\n}", "title": "" }, { "docid": "0acf55a157f95642413f0fb2b7bd5068", "score": "0.5454908", "text": "highlightFeature(e) {\n var layer = e.target;\n layer.bringToFront()\n layer.setStyle({\n weight: 3,\n color: '#666',\n dashArray: '',\n fillOpacity: 0.7\n });\n }", "title": "" }, { "docid": "8f6b9198a1cd79afb36e5fe3cd3c1ac0", "score": "0.544184", "text": "function highlight(e) {\n var layer = e.target;\n layer.setStyle({\n weight: 3,\n color: '#ffd32a',\n });\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n }", "title": "" }, { "docid": "4829c4c2dd6c6238754401722d8fb827", "score": "0.54298586", "text": "function _addBorderAroundTarget() {\n if (Utils.isValid(Components.rect)) {\n var borderOverlay = $(Constants.DIV_COMP, {\n \"class\": Constants.TARGET_BORDER\n });\n borderOverlay.css({\n width: Components.rect.width + Constants.PX,\n height: Components.rect.height + Constants.PX,\n top: Components.rect.top + Constants.PX,\n left: Components.rect.left + Constants.PX\n });\n\n if (Components.stepDescription[Constants.CAN_INTERACT]) {\n borderOverlay.addClass(Constants.TARGET_INTERACTABLE);\n }\n\n Components.ui.append(borderOverlay);\n }\n}", "title": "" }, { "docid": "0dcf4f06ab68c0466b0e701751888d05", "score": "0.54218644", "text": "_styleTargetElementForStep(e){const t=ho(e);t&&(co(t),e.options.highlightClass&&t.classList.add(e.options.highlightClass),!1===e.options.canClickTarget&&(t.style.pointerEvents=\"none\"))}", "title": "" }, { "docid": "27d024563255c63d40807768b61ae7b7", "score": "0.5412315", "text": "drawOutline(color) {\n\t\tcolor = color || \"black\";\n\n\t\tcontext.strokeStyle = color;\n\t\tcontext.rect(this.position.x, this.position.y, this.width, this.height);\n\t\tcontext.stroke();\n\t}", "title": "" }, { "docid": "eb5eeb2ecb5369ba83cd72f06fdbfef6", "score": "0.5397385", "text": "function _modifyBorderAroundTarget() {\n if (Utils.isValid(Components.rect)) {\n var borderOverlay = Utils.getEleFromClassName(Constants.TARGET_BORDER, true);\n borderOverlay.css({\n width: Components.rect.width + Constants.PX,\n height: Components.rect.height + Constants.PX,\n top: Components.rect.top + Constants.PX,\n left: Components.rect.left + Constants.PX\n });\n\n if (Components.stepDescription[Constants.CAN_INTERACT]) {\n borderOverlay.addClass(Constants.TARGET_INTERACTABLE);\n } else {\n borderOverlay.removeClass(Constants.TARGET_INTERACTABLE);\n }\n }\n}", "title": "" }, { "docid": "3144bb685b088a88124237240d243b92", "score": "0.53935283", "text": "function outline(obj) {\n rect(leftSide(obj), upSide(obj), rightSide(obj) - leftSide(obj), downSide(obj) - upSide(obj));\n}", "title": "" }, { "docid": "44e0c133ca623cd73ad7717eedeec901", "score": "0.53921473", "text": "function mouseOut(e) {\r\n\t\t\tvar layer_marker = e.target;\r\n\t\t\tlayer_marker.setStyle({\r\n\t\t\t\tcolor: border_color,\r\n\t\t\t\tfillOpacity: 1\r\n\t });\r\n\t // layer_marker.closePopup();\r\n\t }", "title": "" }, { "docid": "d0e65ea9a8fba9cf75732dd2f1053354", "score": "0.53851044", "text": "function activeDecoration(e) {\n deleteAllId()\n e.target.previousElementSibling.setAttribute(\"id\", \"close_decoration\")\n e.target.parentNode.setAttribute(\"id\", \"active_decoration_div\")\n e.target.setAttribute(\"id\", \"active_decoration\")\n }", "title": "" }, { "docid": "a813a60508c37caa0aa54e39652e20a2", "score": "0.5382954", "text": "offHighlight(){\n this.rect.setAttributeNS(null,\"stroke\", \"#707070\");\n this.rect.setAttributeNS(null,\"stroke-width\", \"0.5\");\n }", "title": "" }, { "docid": "7ff4625c47c63df5a2d882c5ecbc23e9", "score": "0.53770596", "text": "get outlineColor(){ return this.__shp.outlineColor; }", "title": "" }, { "docid": "bfed3499c909ed646555599d4fe8cced", "score": "0.53755504", "text": "function fHandleEnter(e) {\n\te.target.style.backgroundColor = 'yellow';\n}", "title": "" }, { "docid": "92a3937c6dd8e3fb6771240cdb269693", "score": "0.5374829", "text": "function fillColor(e) {\n\tvar box = e.target;\n\tbox.style.backgroundColor = selectedColor;\n}", "title": "" }, { "docid": "386cea657d317e5fe655ca12b2fa6bf6", "score": "0.5363978", "text": "function highlightNavItem(ev) {\n ev.target.style.borderBottom = '3px solid hsl(136, 65%, 51%)';\n ev.target.style.cursor = 'pointer';\n}", "title": "" }, { "docid": "5c61bfb798d78719f492c6033f984b8a", "score": "0.5350649", "text": "function dragEnter(ev) \n {\n const target = ev.target;\n if ( target ) \n {\n ev.stopPropagation();\n ev.preventDefault();\n //target.style.background = '#ADD8E6';\n //target.style.border-color = black;\n }\n\n return false;\n }", "title": "" }, { "docid": "f6f4329219b8eae8fd8f15318536154f", "score": "0.53488684", "text": "function highlightFeature(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 5,\n color: 'black',\n dashArray: '',\n fillOpacity: 0.3\n });\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n }", "title": "" }, { "docid": "5499aebfe9e076dc8d9720133c6763d5", "score": "0.5344995", "text": "handleFocusOut(e) {\n\t\tthis.computeAttended();\n\t}", "title": "" }, { "docid": "c9be1ad537eb97cef4ef719e5081c947", "score": "0.53253883", "text": "function mouseEnter(e, obj) {\n var shape = obj.findObject(\"SHAPE\");\n shape.fill = \"#C1D5E3\";\n shape.stroke = \"#4d6d9a\";\n var text = obj.findObject(\"TEXT\");\n text.stroke = \"white\";\n }", "title": "" }, { "docid": "4509398409b2f6104f7ba96613d87350", "score": "0.531646", "text": "clickedOutside(event) {\n if (!this.hasFocus && this.whiteList.indexOf(event.target) < 0) {\n if (this.keepFirst && this.hovered && this.selectOnClickOutside) {\n this.setSelected(this.hovered, true);\n } else {\n this.isActive = false;\n }\n }\n }", "title": "" }, { "docid": "ffa9d5a316fcb6a31e03170225e52266", "score": "0.5305077", "text": "function OnClick(e) \n{\n \n if (event.target === tx) //if textarea was clicked, expand new black border-bottom from center by changing attr of pseudo elmnt\n {\n txContainer.classList.toggle('commentSlide');\n document.styleSheets[1].addRule('#commentContainerEdit::after', 'transform:scaleX(1);'); //stylesheets[0] is bootstrap link\n \n }\n else //(event.target !== tx )\n {\n document.styleSheets[1].addRule('#commentContainerEdit::after', 'transform:scaleX(0);'); //user clicked outside txarea, so collapse bottom border\n \n \n \n \n }\n}", "title": "" }, { "docid": "53ac0e1853d1e838b80992b53b114629", "score": "0.5303533", "text": "function boxSelector(event) {\r\n if (event.target.classList.contains('selectable')) {\r\n src.style.borderWidth = '1px';\r\n src = event.target; \r\n src.style.borderWidth = '4px';\r\n }\r\n}", "title": "" }, { "docid": "317a8a15d341f2ea382b76c35ec46bb7", "score": "0.5297333", "text": "function highlightFeature(e) {\n var layer = e.target;\n layer.setStyle({\n weight: 1,\n fillOpacity: 1\n });\n\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n}", "title": "" }, { "docid": "92f9d59bd2b2da71f8f0bf1f3a09e592", "score": "0.528572", "text": "static outlineOnFormClickHandler(event, color = null) {\n var component = event.target;\n if (color==null) {\n color = DebugSettings.highlightColor;\n }\n\n if (((event.ctrlKey || event.metaKey) && event.shiftKey==false)) {\n\n if (DebugSettings.form && DebugSettings.form.component) {\n DebugSettings.highlight(DebugSettings.form.component, false);\n }\n\n component = event.target;\n \n if (component.style) {\n DebugSettings.toggleHighlight(component, color);\n }\n }\n\n if ((event.ctrlKey || event.metaKey) && event.shiftKey) {\n component = event.target;\n \n if (DebugSettings.form && DebugSettings.excludeForm) {\n DebugSettings.form.remove();\n }\n\n var group = document.createElement(\"form\");\n var inputName = document.createElement(\"input\");\n var inputValue = document.createElement(\"input\");\n var parent = document.createElement(\"span\");\n var descendants = document.createElement(\"div\");\n var prevSibling = document.createElement(\"span\");\n var nextSibling = document.createElement(\"span\");\n var nameError = document.createElement(\"span\");\n var valueError = document.createElement(\"span\");\n var close = document.createElement(\"span\");\n var elementIndex = document.createElement(\"span\");\n var nameLabel = document.createElement(\"span\");\n var index = 0;\n\n\n group.style.position = \"absolute\";\n group.style.top = \"0px\";\n group.style.gap = \"0px\";\n group.style.left = \"0px\";\n group.style.right = \"20px\";\n group.style.zIndex = \"100\";\n group.style.padding = \"6px\";\n group.style.margin = \"8px\";\n group.style.border = \"1px solid rgba(0, 0, 0, .25)\";\n group.style.filter = \"drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.161));\";\n group.style.backgroundColor = \"rgba(255, 255, 255, .85)\";\n group.style.alignItems = \"center\";\n group.style.display = \"flex\";\n group.style.fontWeight = \"bold\";\n group.style.fontSize = \"13px\";\n group.style.flex = \"1\";\n group.style.minHeight = \"40px\";\n group.className = \"row\";\n\n inputName.type = \"text\";\n inputValue.type = \"text\";\n inputName.style.flex = \"1\";\n inputName.style.margin = \"0\";\n inputName.style.marginRight = \"0\";\n inputName.style.width = \"80px\";\n inputName.uxpQuiet = true;\n inputValue.uxpQuiet = true;\n inputValue.style.flex = \"1\";\n inputValue.style.margin = \"0\";\n inputName.placeholder = \"name\";\n inputValue.placeholder = \"value\";\n inputValue.placeholder = \"value\";\n inputValue.style.width = \"80px\";\n\n parent.innerHTML = \"&#8593;\";\n descendants.innerHTML = \"&#8595;\";\n close.innerHTML = \"X\";\n prevSibling.innerHTML = \"<\";\n nextSibling.innerHTML = \">\";\n nameError.innerHTML = \"!\";\n\n parent.title = \"Parent element\";\n descendants.title = \"Descendant elements\";\n prevSibling.title = \"Previous element\";\n nextSibling.title = \"Next element\";\n \n nameError.style.color = \"red\";\n nameError.title = \"Property not found\";\n valueError.title = \"Value not found\";\n nameError.style.display = \"none\";\n valueError.style.display = \"none\";\n close.style.margin = \"0\";\n \n parent.style.padding = \"0px 4px\";\n descendants.style.padding = \"0px 4px\";\n prevSibling.style.padding = \"0px 4px\";\n nextSibling.style.padding = \"0px 4px\";\n elementIndex.style.padding = \"0px 6px\";\n close.style.padding = \"0px 4px\";\n\n parent.style.cursor = \"pointer\";\n prevSibling.style.cursor = \"pointer\";\n elementIndex.style.cursor = \"pointer\";\n nextSibling.style.cursor = \"pointer\";\n descendants.style.cursor = \"pointer\";\n close.style.cursor = \"pointer\";\n\n nameLabel.style.position = \"absolute\";\n nameLabel.style.left = \"2px\";\n nameLabel.style.top = \"1px\";\n nameLabel.style.fontSize = \"8px\";\n nameLabel.style.textTransform = \"uppercase\";\n nameLabel.style.display = \"inline-block\";\n\n elementIndex.style.fontSize = \"9px\";\n elementIndex.style.textTransform = \"uppercase\";\n elementIndex.style.display = \"inline-block\";\n \n elementIndex.innerHTML = DebugSettings.getPositionOfElement(component);\n nameLabel.innerText = component.nodeName;\n\n close.addEventListener(\"click\", function(e) {\n if (DebugSettings.form) {\n DebugSettings.highlight(DebugSettings.form.component, false);\n }\n group.remove();\n DebugSettings.form = null;\n })\n\n parent.addEventListener(\"click\", function(e) {\n var element = DebugSettings.form.component;\n if (element.parentNode) {\n DebugSettings.updateComponent(element.parentNode, element);\n }\n })\n\n descendants.addEventListener(\"click\", function(e) {\n var element = DebugSettings.form.component;\n if (element.children.length) {\n DebugSettings.updateComponent(element.children[0], element);\n }\n })\n\n prevSibling.addEventListener(\"click\", function(e) {\n var element = DebugSettings.form.component;\n if (element.previousElementSibling) {\n DebugSettings.updateComponent(element.previousElementSibling, element);\n }\n })\n\n nextSibling.addEventListener(\"click\", function(e) {\n var element = DebugSettings.form.component;\n if (element.nextElementSibling && element.nextElementSibling!=DebugSettings.form) {\n DebugSettings.updateComponent(element.nextElementSibling, element);\n }\n })\n\n elementIndex.addEventListener(\"click\", function(e) {\n var element = DebugSettings.form.component;\n if (element) {\n //DebugSettings.form.inputName.value = \"nodeName\";\n //DebugSettings.inputNameHandler(e, true);\n }\n })\n\n group.addEventListener(\"click\", function(e) {\n \n })\n\n group.onsubmit = function(e) {\n e.preventDefault();\n return false\n };\n\n inputName.addEventListener(\"change\", DebugSettings.inputNameHandler);\n inputName.addEventListener(\"input\", DebugSettings.inputNameHandler);\n inputName.addEventListener(\"keyup\", DebugSettings.inputNameHandler);\n inputName.addEventListener(\"keydown\", DebugSettings.inputNameHandler);\n inputName.addEventListener(\"keypress\", DebugSettings.inputNameHandler);\n inputName.addEventListener(\"blur\", DebugSettings.inputNameHandler);\n inputValue.addEventListener(\"change\", DebugSettings.inputValueHandler);\n\n group.appendChild(parent);\n group.appendChild(prevSibling);\n group.appendChild(elementIndex);\n group.appendChild(nextSibling);\n group.appendChild(descendants);\n group.appendChild(inputName);\n group.appendChild(nameError);\n group.appendChild(inputValue);\n group.appendChild(valueError);\n group.appendChild(close);\n group.appendChild(nameLabel);\n\n component.parentNode.appendChild(group);\n\n DebugSettings.form = group;\n DebugSettings.form.component = component;\n DebugSettings.form.inputName = inputName;\n DebugSettings.form.inputValue = inputValue;\n DebugSettings.form.nameError = nameError;\n DebugSettings.form.nameLabel = nameLabel;\n DebugSettings.form.valueError = valueError;\n DebugSettings.form.elementIndex = elementIndex;\n\n DebugSettings.updateComponent(component);\n }\n }", "title": "" }, { "docid": "e33df3f8dc16615be45a10ba414d1ad1", "score": "0.5282964", "text": "function resetHighlightedPoint(e) {\n e.target.setStyle({\n stroke: false,\n color: defaultColour\n });\n }", "title": "" }, { "docid": "7beadf14741a1e9fd664a6c42f542953", "score": "0.52797675", "text": "function highlightFeature(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 5,\n color: '#34ebc0',\n dashArray: '',\n fillOpacity: 0.7\n });\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n}", "title": "" }, { "docid": "b085d95da7248efe2c2df0c8077a68ae", "score": "0.52749836", "text": "get outline() {\r\n return brushToString(this.i.outline);\r\n }", "title": "" }, { "docid": "b085d95da7248efe2c2df0c8077a68ae", "score": "0.52749836", "text": "get outline() {\r\n return brushToString(this.i.outline);\r\n }", "title": "" }, { "docid": "746f55d7bf1617a0dd777145dcabcdb2", "score": "0.52743083", "text": "function strikethrough(){\r\n event.target.style.textDecoration = \"line-through\";\r\n}", "title": "" }, { "docid": "7a90746092598d0b28ab8699b049a5cf", "score": "0.5264739", "text": "function out(e){\n\n // Remove the move cursor and green box-shadow\n e.target.style.cursor=e.target.style.boxShadow=''\n}", "title": "" }, { "docid": "4615f6e07d7b4c92692f4d3b4d8da8d7", "score": "0.52353483", "text": "function featureMouseout(e) {\r\n //geojson.resetStyle(e.target);\r\n var layer = e.target;\r\n \r\n layer.setStyle({\r\n weight: 1,\r\n color: 'black'\r\n });\r\n }", "title": "" }, { "docid": "590ee0f44ffdd1e613258e29f09b3a74", "score": "0.52329844", "text": "resetHighlight(e) {\n var layer = e.target;\n layer.setStyle({\n color: 'white',\n weight: 1,\n fillOpacity: 0.5,\n });\n }", "title": "" }, { "docid": "7f0d29f03d858a2793c9c468fe00142d", "score": "0.5232752", "text": "function highlight(event)\r\n\t\t{\r\n\t\t\tif(currentlySelectedButtonAction != 'highlight' || !down)\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\tgraphics.clear();\r\n\r\n\t\t\twidth = mouseData.x - initialXMousePosition;\r\n\t\t\theight = mouseData.y - initialYMousePosition;\r\n\r\n\t\t\tgraphics.lineStyle(5, 0xFFFB33, 1);\r\n\t\t\tgraphics.drawRect(initialXMousePosition, initialYMousePosition, width, height);\r\n\t\t\tgraphics.interactive = true;\r\n\r\n // draws it on the main stage, doesnt matter because it gets erased anyways\r\n\t\t\tMBContainer.addChild(graphics);\r\n }", "title": "" }, { "docid": "9eb30f5bbacee4f15be52a917419a07a", "score": "0.52322596", "text": "function dragLeave(ev) {\n ev.target.style.background = \"\";\n}", "title": "" }, { "docid": "0a56d96c03f38183b67b0e35c007bdf7", "score": "0.52287954", "text": "function highlightShade(obj) {\r\n obj.style.outline = \"2px dotted rgb(0, 78, 171)\";\r\n }", "title": "" }, { "docid": "32ccffdfa4f5883162bcfe1ded0c3714", "score": "0.52276516", "text": "function changeColor(e) {\n e.target.classList.add('draw');\n}", "title": "" }, { "docid": "352c62255075838ae361858fac30231d", "score": "0.5214269", "text": "function highlightSize(obj) {\r\n obj.style.outline = \"2px dotted rgb(0, 78, 171)\";\r\n }", "title": "" }, { "docid": "2284384cff65d3c65c3e7c17ca156e4c", "score": "0.52132154", "text": "function unpaint(e) {\n e.style.backgroundColor = 'black';\n}", "title": "" }, { "docid": "146ca0cb029af392dac9973dd6610ff0", "score": "0.51722085", "text": "handleMouseOver(e) {\n\t\tlet layer = this.getLayer();\n document.body.style.cursor = 'pointer';\n this.setStrokeWidth(4);\n layer.draw();\n\t}", "title": "" }, { "docid": "84fd259d4da9885eacd988eabeb5ccc3", "score": "0.51676184", "text": "function fHandleExit(e) {\n\te.target.style.backgroundColor = '';\t\n}", "title": "" }, { "docid": "219629b4e2460ec48b36ee4e3fb05832", "score": "0.5166217", "text": "static eraseOutline(context,style) {\n $(context.svg).find('g.vf-' + style).remove();\n }", "title": "" }, { "docid": "ca72bf899702ec167b4fc43c4481f452", "score": "0.5162358", "text": "function resetHighlight(e) {\n\tvar layer=e.target;\n\tlayer.setStyle({\n\t\tcolor: 'white',\n dashArray: '',\n fillOpacity: 0.9,\n\t}); \n\tinfo.update();\n}", "title": "" }, { "docid": "f9c37984be346bec252788c679137566", "score": "0.5151835", "text": "function onMSGestureEnd(e) {\n if (e.target === this) {\n this.style.borderStyle = \"solid\";\n }\n eventLog.innerText = \"Gesture end\";\n }", "title": "" }, { "docid": "93559b870840f83b0248a877bc218f63", "score": "0.5148144", "text": "function drawline(elemTarget, eraser) {\r\n\t\tvar draw = false;\r\n\t\tvar started = false;\r\n\r\n\t\tclassActive(elemTarget);\r\n\r\n\t\t$('#canvas').css('cursor', 'crosshair');\r\n\r\n\t\t$('#canvas').mousedown(function(event) {\r\n\t\t\tif($(elemTarget).hasClass('active')) {\r\n\t\t\t\tvar position = {};\r\n\t\t\t\tposition.x = event.pageX - left;\r\n\t\t\t\tposition.y = event.pageY - top;\r\n\t\t\t\tdraw = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\t$('#canvas').mouseup(function(event) {\r\n\t\t\tdraw = false;\r\n\t\t\tstarted = false;\r\n\t\t});\r\n\r\n\t\t$('#canvas').mousemove(function(event){\r\n\t\t\tif(draw == true) {\r\n\t\t\t\tvar position = {};\r\n\t\t\t\tposition.x = event.pageX - left;\r\n\t\t\t\tposition.y = event.pageY - top;\r\n\r\n\t\t\t\tif(started == false) {\r\n\t\t\t\t\tcontext.beginPath();\r\n\t\t\t\t\tcontext.moveTo(position.x, position.y);\r\n\t\t\t\t\tstarted = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcontext.lineTo(position.x, position.y);\r\n\r\n\t\t\t\t\tif(eraser == false) {\r\n\t\t\t\t\t\tcontext.strokeStyle = $('#color').val();\r\n\t\t\t\t\t\tcontext.lineWidth = $('#thickness option:selected').text();\r\n\t\t\t\t\t\tcontext.stroke();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(eraser == true) {\r\n\t\t\t\t\t\tvar thickness = parseInt($('#thickness option:selected').text());\r\n\r\n\t\t\t\t\t\tif(thickness > 10) {\r\n\t\t\t\t\t\t\tcontext.clearRect((position.x - thickness), \r\n\t\t\t\t\t\t\t\t(position.y - thickness),\r\n\t\t\t\t\t\t\t\t(thickness*2), \r\n\t\t\t\t\t\t\t\t(thickness*2));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcontext.clearRect((position.x - thickness), \r\n\t\t\t\t\t\t\t\t(position.y - thickness),\r\n\t\t\t\t\t\t\t\t(thickness*2), \r\n\t\t\t\t\t\t\t\t(thickness*2));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "3ffc95aba2f8671c2165743c97dca436", "score": "0.5133687", "text": "get outline() {\r\n return brushToString(this.i.ba);\r\n }", "title": "" }, { "docid": "a2d6f1226fb126f234421d13bab142f1", "score": "0.51315874", "text": "function outline(x, y, w, h) {\n noFill(); // does not fill rectangle\n strokeWeight(3); // stroke weight set to three\n stroke(0); // stroke color set to black\n rect(x, y, w, h); // draws rectangle of size and position passed\n noStroke(); // removes stroke \n}", "title": "" }, { "docid": "29045a6d4f74786be79e5108a5876999", "score": "0.5130583", "text": "function highlightFeature(e) {\n var activefeature = e.target;\n activefeature.setStyle({\n weight: 5,\n color: '#F0F92B',\n\n dashArray: '',\n fillOpacity: 0.3\n });\n if (!L.Browser.ie && !L.Browser.opera) {\n activefeature.bringToFront();\n } info.update(activefeature.feature.properties);\n }", "title": "" }, { "docid": "57579ff779bda1c56cdfe450aee6e5f0", "score": "0.512842", "text": "function highlightFeature(event) {\n layer = event.target;\n layer.setStyle({\n fillOpacity: 0.6,\n color: '#ffffff',\n dashArray: ''\n });\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n}", "title": "" }, { "docid": "5e35fed92cd93b9025cf1366f116270f", "score": "0.5126784", "text": "highlight(){\n this.rect.setAttributeNS(null,\"stroke\", \"blue\");\n this.rect.setAttributeNS(null,\"stroke-width\", \"3\");\n }", "title": "" }, { "docid": "5104b5d2eb5bcd77fa3e1f40c130d3d3", "score": "0.511876", "text": "function handleDrawingLayerMouseOut(e) {\n svl.tracker.push('LabelingCanvas_MouseOut');\n if (!svl.isOnboarding())\n ribbon.backToWalk();\n }", "title": "" }, { "docid": "d44abe0ed74bf0d753dc03ecc751ba86", "score": "0.51186854", "text": "function highlightTarget() {\n let rect = targetElement.getBoundingClientRect();\n let overlay = document.getElementById('autofocus-extension-target-overlay'); \n if (overlay != null) {\n overlay.style.display = 'block';\n } else {\n overlay = document.createElement('div');\n overlay.style.backgroundColor = 'rgba(255, 227, 105,0.5)';\n overlay.style.pointerEvents = 'none';\n overlay.style.zIndex = 9999;\n overlay.style.position ='absolute';\n overlay.id = 'autofocus-extension-target-overlay'\n document.body.appendChild(overlay);\n }\n // Position and size attributes needs to be updated when targetElement changes\n overlay.style.left = rect.left+'px';\n overlay.style.top = rect.top+'px';\n overlay.style.width = rect.width+'px';\n overlay.style.height = rect.height+'px';\n\n setTimeout(() => overlay.style.display = 'none',1500);\n}", "title": "" }, { "docid": "a9c815de376ae985b69ad77766ce21ab", "score": "0.51101166", "text": "function featureMouseover(e) {\r\n var layer = e.target;\r\n \r\n layer.setStyle({\r\n weight: 3,\r\n color: 'white'\r\n });\r\n \r\n layer.bringToFront();\r\n }", "title": "" }, { "docid": "786edc043987a9e093e450d1674b4d34", "score": "0.5105492", "text": "function closeLine(e){\n\t\tcontext.closePath();\n\t}", "title": "" }, { "docid": "7a8198a20d2e8a48e07d7af0cabc9527", "score": "0.50976515", "text": "function lineClicked() {\n if (\n event.target === LINE_1P ||\n event.target === LINE_2P ||\n event.target === LINE_3P ||\n event.target === TITLE_H1\n ) {\n event.target.style.transition = \"none\";\n fadeOut(event.target, 1);\n }\n}", "title": "" }, { "docid": "9d73559536fbf8a3cae4452e688e846d", "score": "0.5079179", "text": "function addGridCellEvent(targetCell) {\n targetCell.addEventListener('click', function () {\n if (targetCell.bgColor == brushColour) {\n targetCell.bgColor = '';\n } else {\n targetCell.bgColor = brushColour;\n }\n })\n}", "title": "" }, { "docid": "db52877d38c9ed9fa2c4bfd1f3ac2849", "score": "0.5074903", "text": "function mousedown(event) {\r\n\t\t\t\tactiveElement = event.target;\r\n\t\t\t}", "title": "" }, { "docid": "8337d7ce6ac1f9d98991bad27e353ec9", "score": "0.50690174", "text": "function mousedown(event) {\n\t\tactiveElement = event.target;\n\t}", "title": "" }, { "docid": "c63d149a662950d281137cde2c1704c9", "score": "0.5067781", "text": "function func(e) {\n e.target.parentNode.style.border = \"2px solid green\";\n e.target.parentNode.style.borderRadius = \"4px\";\n e.target.parentNode.style.padding = \"2px\"\n var change = e.target.getAttribute('src');\n changePreview(change)\n removeBorder(e.target);\n}", "title": "" }, { "docid": "7cb24d502ade19aa4afc0431c89a2dd0", "score": "0.50638986", "text": "function mouseOver(event) {\n event.target.style.backgroundColor = 'red';\n }", "title": "" }, { "docid": "c50e5ca610530f0678e7edf52f416a9f", "score": "0.50637865", "text": "function setPalette(e){\n //ID which colorFrame is being clicked\n var swatch = e.target;\n //Set the fill/strokeStyle to the background color of the colorFrame that has been clicked\n setColor(swatch.style.backgroundColor);\n //Change the class of the colorFrame that has been clicked to colorFrame active\n swatch.className += ' active'\n}", "title": "" }, { "docid": "acfc6e172315e616d04f798f1dce6431", "score": "0.50460434", "text": "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}", "title": "" }, { "docid": "17032c4fe433882ede1cf360ccfa7579", "score": "0.5041721", "text": "function changeLine(event) {\n fadeOut(event.target, 1);\n}", "title": "" }, { "docid": "b696191c0818932d913cf82e61c8353b", "score": "0.50347984", "text": "function resethighlightFeature(event) {\n layer = event.target;\n layer.setStyle({\n fillOpacity: 0.8,\n dashArray: '3'\n });\n}", "title": "" }, { "docid": "a48e532b8ee89bd59c3359b79dee0c62", "score": "0.50318074", "text": "function highlightElement(e) {\n var t = e.target,\n offset = getOffset(t);\n\n highlighter.style.top = offset.top + \"px\";\n highlighter.style.left = offset.left + \"px\";\n highlighter.style.width = t.clientWidth + \"px\";\n highlighter.style.height = t.clientHeight + \"px\";\n\n e.preventDefault();\n e.stopPropagation();\n\n }", "title": "" }, { "docid": "b8fbd03df895d7183f2b029ea2ca05de", "score": "0.50217044", "text": "function dragenter(e) {\n e.stopPropagation();\n e.preventDefault();\n dropbox.style.borderColor = '#0076C6';\n}", "title": "" }, { "docid": "5f5b1d61ffbaa8429af63a2db1946179", "score": "0.5020986", "text": "_dragLeave(e) {\n if (this._targetDrop !== e.target.closest(\"[data-item-id]\")) {\n e.target\n .closest(\"[data-item-id]\")\n .classList.remove(\"outline-designer-hovered\");\n }\n }", "title": "" }, { "docid": "d922530f01ff616df01db5cfc74d22a1", "score": "0.5018702", "text": "function deleteRect(event){\n if($('#canvas').hasClass('deleting')){\n $rect = $(event.target);\n $rect.remove();\n }\n }", "title": "" }, { "docid": "623093c6af99ca7666efe32bc7104289", "score": "0.5017729", "text": "function highlight(e){ addOverlay(this); }", "title": "" }, { "docid": "b56dbd6c771e3128435abc804f2dd20e", "score": "0.5000992", "text": "function removeFocus(elem) {\n elem.style.backgroundColor = \"white\";\n}", "title": "" } ]
4cdc39b3b94a6477009d0759e46cf88c
Stop the game, broadcast the result
[ { "docid": "cc617f95def3ab998bef33414151b1f4", "score": "0.6118654", "text": "function stop(user){\n if (timer) {\n clearInterval(timer);\n ingame = false;\n user = user || { name: \"nobody\" }\n broadcastStop(user);\n \n // start new game\n setTimeout(function(){\n if (users.length >= 2) {\n start();\n }\n }, 4000)\n\n }\n}", "title": "" } ]
[ { "docid": "2942a70551680d0910c3348c676757a7", "score": "0.7000893", "text": "Stop() {}", "title": "" }, { "docid": "768c27ca3975021ad92f412d7f416f8b", "score": "0.6998168", "text": "function broadcastStop(user){\n server.broadcast('stop', {\n winner: user\n });\n}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.68191403", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.68191403", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.68191403", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.68191403", "text": "stop() {}", "title": "" }, { "docid": "35b9eb08b9d55dec3da7fd41adb6f9fe", "score": "0.68015665", "text": "async stop() { }", "title": "" }, { "docid": "d2d48694c62b6b8dd3703dd83c069fd2", "score": "0.67895615", "text": "function stopTheGame(){\n if (stopFlag == 1){ //Checking whether user is stopping the running game.\n clearTimeout(time);\n gameResult();\n stopFlag = 0; //Setting stop flag to 0 to indicate that user has\n //stoped the game.\n }\n}", "title": "" }, { "docid": "4cab4046fa6924407d1d36f15f5a6d4a", "score": "0.6788483", "text": "function handleStopGame() {\n isGameStopped = true;\n}", "title": "" }, { "docid": "478c37d81d2687f07eca304a58502e82", "score": "0.6766187", "text": "stop(){\n clearInterval(this.gameInterval);\n }", "title": "" }, { "docid": "cc7637f2fc7fb0e313e972c0c6877fe5", "score": "0.67077404", "text": "function stop() {\r\n\r\n }", "title": "" }, { "docid": "39b833e5129c4be6fffff246741d9a61", "score": "0.66882044", "text": "function stopPlaying() {\r\n gameBoard.usersTurn = gameBoard.computersTurn = false;\r\n }", "title": "" }, { "docid": "f8f83ebbbc53576c77539bed584fedd0", "score": "0.66797394", "text": "function stop() {\n\n gameRunning = false;\n clearInterval(intervalId);\n\n }", "title": "" }, { "docid": "d96ab415952d53083975d67cabc3aeae", "score": "0.6587537", "text": "function stop() {\n stopTimerAndResetCounters();\n dispatchEvent('stopped', eventData);\n }", "title": "" }, { "docid": "e9d4ce711ccc10739e24bf193296c504", "score": "0.65770537", "text": "function clickStopGame () {\n\n\tif(!stop) {\n\t\tif (num_stop>0) {\n\t\t\tstop = true;\n\t\t\tnum_stop--;\n\t\t}\n\t}\n\telse {\n\t\tmyReq = reqAnimation(runGame);\n\t\tstop = false;\n\t}\n\tloadInfoGame();\n}", "title": "" }, { "docid": "8d13761a011b083c91106aadc1e3f3e2", "score": "0.65595764", "text": "stop () {\n const _ = this[_private];\n _.play = false;\n }", "title": "" }, { "docid": "6c49dcdf3622b4ad6624ed75bbbb4253", "score": "0.655916", "text": "stop() {\n }", "title": "" }, { "docid": "1950eb0e936610464e18201cd3967bab", "score": "0.6539089", "text": "stop() {\n this._stopped = true;\n this._reset();\n }", "title": "" }, { "docid": "65850ea03db620450dc5cf34951837fe", "score": "0.6523411", "text": "stop() {\n\n }", "title": "" }, { "docid": "ed8ed9915fd98dade91fa9b6f3400695", "score": "0.65146667", "text": "function stop() {\n internal.stop.apply(null, utils.toArray(arguments));\n }", "title": "" }, { "docid": "2f4be1a108833b9586f572a2cfc0bcc3", "score": "0.6489277", "text": "stop() {\n this._status = 0;\n }", "title": "" }, { "docid": "64a9d21b4a48287119c03840c3dbe81c", "score": "0.6488456", "text": "quit() {\n //@author Dion: complete sound start, music stop - also want this only once\n this.stopMusic();\n { this.props.streakCallbackFromParent(this.streakKeeper) } //similarly check the state of the streakkeeper bonus\n }", "title": "" }, { "docid": "2d34fd6519674ba0e6b77ccde12af3c4", "score": "0.6457976", "text": "function stopSim() {\n \tconn.send(\"controlMessage; stopSimulator\");\n}", "title": "" }, { "docid": "f8d26c631119c83c69db0ccce55277e4", "score": "0.64336246", "text": "_onStop() {\n\t\tthis._clearEvents();\n\t\tgame.audio.playing.delete(this.id);\n\t\tthis.emit(\"stop\");\n\t}", "title": "" }, { "docid": "5bd258336a2d83809c51f41c9fd2200c", "score": "0.64179784", "text": "async stop() {\n if (this.state !== WATCHER_STATE.RUNNING) {\n return;\n }\n this.state = WATCHER_STATE.STOPPING;\n this.emitter.emit('will-stop');\n\n await this.doStop();\n\n this.state = WATCHER_STATE.STOPPED;\n\n this.emitter.emit('did-stop');\n }", "title": "" }, { "docid": "1c00f8462a82eaf478f3e1a117a62e96", "score": "0.6388675", "text": "stop() {\n\t\tthis._reset()\n\t\tthis._isFinished = true\n\t\tthis._count = 0\n\t\t// Back the init and final values at their original state\n\t\tif(this._pingpong) {\n\t\t\tthis._swapValues()\n\t\t}\n\n\t\tif(this._isFinished && typeof this._onFinish === 'function') {\n\t\t\tthis._onFinish.call(null)\n\t\t}\n\t}", "title": "" }, { "docid": "72bd6958c22bf0992a7c6ac2ea13549c", "score": "0.63724583", "text": "function stopGame(){\n\tTweenMax.killAll();\n\t\n\tslotData.resultArray.length = 0;\n\tslotData.winSlotArray.length = 0;\n\tslotData.linesArray.length = 0;\n\tslotWinContainer.removeAllChildren();\n}", "title": "" }, { "docid": "7067a0aa3c7db0866b514a3ef5f25309", "score": "0.63352144", "text": "function stopClicked(data) {\n //console.log(\"stop\");\n omx.stop();\n //console.log(data);\n}", "title": "" }, { "docid": "3bfcc4775cf3e0730473476f716b7abb", "score": "0.633519", "text": "endGame() {\n dispatchEndGame()\n clearInterval(this.gameInterval)\n }", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.6332243", "text": "async stopped() {}", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.6332243", "text": "async stopped() {}", "title": "" }, { "docid": "9041b6789a034e343f8131706fd8936d", "score": "0.63253474", "text": "function stop() {\r\n //stop the simulation\r\n clearTimeout(timeout);\r\n}", "title": "" }, { "docid": "a19d1e5073d92c1edcb5ae286eb42045", "score": "0.63226265", "text": "function abort() {\r\n clearInterval(gameLoop)\r\n}", "title": "" }, { "docid": "7458831f05df839424c59429bcaa780a", "score": "0.63192874", "text": "function runStop() {\r\n status = STOPPED;\r\n PlayerPlugin.Stop();\r\n \r\n //send state for Progressbar component to update the button displayed\r\n //the values of changeButton accept are: stop, pause, play\r\n if(objVideo2_controller != undefined) {\r\n objVideo2_controller.changeButton('stop');\r\n }\r\n //locked the video controls(pause, forward, backward)\r\n boolBeginVideo = false;\r\n }", "title": "" }, { "docid": "d041f3f54118d877516aec30ddbd06cc", "score": "0.6315542", "text": "function stop() {\n remoteIPC.server.stop();\n}", "title": "" }, { "docid": "612a76c737523b197197401fd562b6af", "score": "0.62963945", "text": "function stopGame(){\n\ttoggleGameTimer(false);\n}", "title": "" }, { "docid": "a2d47a8c2f00457b9e8cd237c9e2e956", "score": "0.6265431", "text": "function endGame() {}", "title": "" }, { "docid": "2c144fe14efba110a80c51f3b53a683e", "score": "0.62563056", "text": "stopLoop(){\n this.midiSounds.stopPlayLoop();\n }", "title": "" }, { "docid": "313b623786243c2d2d73d3bd1548ff0f", "score": "0.62535304", "text": "stop() {\n this.isStopped = true;\n }", "title": "" }, { "docid": "8b327467d46d9a33fcb3fc1f1c08a385", "score": "0.624649", "text": "onStop(){}", "title": "" }, { "docid": "2e2ed2c9c7cafa27e1c8d22097688dd4", "score": "0.62464243", "text": "async _onStop() {}", "title": "" }, { "docid": "446292cef43b4947da764e4f71277dcd", "score": "0.62417805", "text": "stopUse() {}", "title": "" }, { "docid": "6a9e05c6e76ea1a5d42d2ae129fbe3c6", "score": "0.6233575", "text": "function stopBroadcast () {\n send('toggleLive', false)\n\n // clear share input\n $('share').value = ''\n\n // close the stream\n mediaStream.destroy()\n stream.end()\n feed.close()\n swarm.close()\n }", "title": "" }, { "docid": "e76c07ef4c5d184fd59bbeb25634df83", "score": "0.62319154", "text": "stop() {\n this.isRunning = false;\n }", "title": "" }, { "docid": "f643d817f8c59f02b122b28f53a8138e", "score": "0.62197524", "text": "stop() {\n // scheduling ticker will stop itself setting this flag\n this.isPlaying = false;\n }", "title": "" }, { "docid": "f6781d9a8a40592d26cf85b2da212c69", "score": "0.6216472", "text": "function stop_game() {\n\t// show the form for submitting results\n\t$('#endform').fadeToggle();\n\t$('#duckies').val($('#ducks_left').val());\n\t$('#game_board').css(\"opacity\", \"0.6\");\n\t$('#start_timer').css('box-shadow', '0px 0px 0px');\n\t$('#restart').css({\"opacity\":\"1\", \"box-shadow\": \"0px 0px 10px #FFAA11\"});\n\n\t//turn off the timers\n\tduck_timer.stop();\n\tchange_timer.stop();\n\tpend_post = \"TRUE\";\n}", "title": "" }, { "docid": "ed352e9453219c1abd2a32a6e1ca8f77", "score": "0.6212458", "text": "async stop() {\n const response = await timeApi.stop();\n if (!response) {\n process.stdout.write('Nothing to stop.');\n } else {\n process.stdout.write(`Stopped ${response}.`);\n }\n }", "title": "" }, { "docid": "6ce40bfc993865ac3147f9253593c3ad", "score": "0.6192975", "text": "StopPump(){\n\t\tthis.OP.StopMsg()\n\n\t\tthis.mda.changeState(7)\n\t}", "title": "" }, { "docid": "57aeb5bb6a9577d0c0a091eebf5d906e", "score": "0.6189646", "text": "async function stop () {\n ABORTED = true\n // persist the remaining buffer\n await _persistBuffer()\n}", "title": "" }, { "docid": "1767fe4cc6d78e082973c1d84d7e6730", "score": "0.6186391", "text": "stop() {\n\t\tif (this.timer) {\n\t\t\tclearInterval(this.timer);\n\t\t}\n\t\tthis.queue.pause();\n\t}", "title": "" }, { "docid": "da3ecac1ecce637191488ef4adef35d4", "score": "0.61834854", "text": "stop()\n {\n this.flush();\n this.vao.unbind();\n }", "title": "" }, { "docid": "aa5e2d76031033618818bc7adb5fafd4", "score": "0.6178808", "text": "static stop() {\n this.run = false\n }", "title": "" }, { "docid": "c584f1279621f88f0bdda29b065a404b", "score": "0.6167526", "text": "stopped() {\n this.clearStats();\n\n }", "title": "" }, { "docid": "5e9e112c8ef4ddd31fe5fda310cab31a", "score": "0.6156401", "text": "function endgame(){\n\twindow.clearInterval(myTimerStartStop)\n\tdisableButtons()\n\tdocument.getElementById(\"result\").style.display = \"block\"\n}", "title": "" }, { "docid": "d9c3e0e05b7a7173a254ddcf69fa2f82", "score": "0.6154264", "text": "endGame() {\n let game = this.get('model');\n game.set('status', 'ended');\n this.send('updateGame');\n }", "title": "" }, { "docid": "8a6a12f13a5ddf4c8382f70100b5e5a9", "score": "0.614717", "text": "function endTurn() {\n\n stompClient.send(\"/app/endturn\",{}, {});\n\n disableMyButtons();\n\n}", "title": "" }, { "docid": "b994c79b0cb6fd52cf667bdf33aa2a16", "score": "0.61467683", "text": "function stopGame() {\r\n clearInterval(countTimeInterval);\r\n clearInterval(competitorInterval);\r\n var speed = Math.floor(checkedParagraph.length / (durationTime / 10) * 60);\r\n $(\"#speed\").val(speed);\r\n sendResult();\r\n $(\"#you-progress label\").text(\"You - \" + speed);\r\n $(\"#new-match\").removeClass(\"hidden\");\r\n $(\"#quit-button\").addClass(\"hidden\");\r\n}", "title": "" }, { "docid": "4b4f26a931524d1df7b9d5f2e2007dc3", "score": "0.6139221", "text": "stopped () {\n\n }", "title": "" }, { "docid": "7679e348ab03d2bf49209c00dfd1c050", "score": "0.61308", "text": "stop() {\n clearInterval(this.clock);\n }", "title": "" }, { "docid": "6de2e78cffff6afa5efd7bd9ecfb0715", "score": "0.61286664", "text": "stop() {\n\t\tif (this.audioWorkletNode !== undefined) {\n\t\t\tthis.audioContext.suspend();\n\t\t}\n\t}", "title": "" }, { "docid": "890b7ebc8bd87046e442cc98389071a7", "score": "0.61256176", "text": "stop() {\n this.stopped = true;\n this.paused = false;\n this.progressMs = 0;\n this.startTime = null;\n this.endTime = null;\n }", "title": "" }, { "docid": "86682a46a62adb09c421213f1b224778", "score": "0.61176205", "text": "function _stop(){\r\n\trecording = false;\r\n\tif (speechCount > 0){\r\n\t\t_sendMessage(SILENCE);\r\n\t\tspeechCount = 0;\r\n\t\tsilenceCount = 0;\r\n\t\tlastInput = 0;\r\n\t\tblobSizeCount = 0;\r\n\t}\r\n\t_sendMessage(STOPPED);\r\n}", "title": "" }, { "docid": "0779f285dda05fe4a69e64ca9a71965c", "score": "0.61106557", "text": "_concludeGame() {\n\t\tconst resultsMessage = this._generateResultsMessage()\n\t\tthis._emitGameOverResults();\n\t\tthis.session.broadcastSystemMessage(resultsMessage);\n\t\tthis.session.resetSessionStatusAfterGame();\n\t}", "title": "" }, { "docid": "7bcc13ca0396cd0f65bfdc06844aae74", "score": "0.6103624", "text": "async stop() {\n this.events.push(`${new Date()}: hello-stop`);\n }", "title": "" }, { "docid": "aef833b1447d9cc43fc72637748014d6", "score": "0.60925806", "text": "stop() {\n this._client.end();\n }", "title": "" }, { "docid": "91a730eae0fd076a041658cb8bc25876", "score": "0.60923547", "text": "stop() {\n this.finishAll();\n }", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.6090875", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.6090875", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.6090875", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.6090875", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "234612bcf28667b27355bb926975f2af", "score": "0.60900265", "text": "function shutdownReceiver() {\n if (!window.currentStream) {\n return;\n }\n\n var player = document.getElementById('player');\n player.srcObject = null;\n var tracks = window.currentStream.getTracks();\n for (var i = 0; i < tracks.length; ++i) {\n tracks[i].stop();\n }\n window.currentStream = null;\n\n document.body.className = 'shutdown';\n}", "title": "" }, { "docid": "411ead52f8ec669cb485ed1d75ec041e", "score": "0.60877895", "text": "stop(){\n this.websocket.close();\n clearInterval(this.timerID);\n clearInterval(this.updateTimerId);\n clearInterval(this.drawTimerId);\n }", "title": "" }, { "docid": "f83a94ad38313fc583c477ab36d997e5", "score": "0.6084501", "text": "stop() {\n if (this.status == 'testing') this.status = 'idle';\n }", "title": "" }, { "docid": "eb849d034bbc2bea119428d407950e97", "score": "0.6083294", "text": "endTurn(){\n Notifier.notifyEnd()\n }", "title": "" }, { "docid": "e08911d723ae2bec7e21b04c43c9c99d", "score": "0.60792285", "text": "function stop() {\n // Example inspired by elasticsearch output to make sure any buffered events\n // have a chance to get shipped before shutting down the pipeline.\n //\n // return new Promise((resolve) => {\n // if (!inflight) {\n // ship() // flush buffered events\n // }\n // const wait = () => {\n // if (inflight) {\n // logbus.log.debug('waiting for inflight requests')\n // setTimeout(wait, 100)\n // }\n // else {\n // resolve()\n // }\n // }\n // wait()\n // })\n }", "title": "" }, { "docid": "2ad6aed8af4b9083844240c60e27d982", "score": "0.6078157", "text": "stop(){\n this.setVelocityX(0);\n this.anims.play('turn');\n if (this.socket) {\n this.movementState.x = this.x\n this.movementState.y = this.y\n this.movementState.currentAnim = 'turn';\n this.socket.emit('updatePlayer', this.movementState);\n }\n }", "title": "" }, { "docid": "8e967c33f90bc03cb77208753578a42f", "score": "0.6074308", "text": "stop() {\n this.resource.pause();\n this.resource.currentTime = 0;\n }", "title": "" }, { "docid": "3b8f223fdebe09df78ded3f082a946be", "score": "0.6073997", "text": "function stopGame() {\n alert(`Your final score is ${score}`);\n console.log(players);\n if(players.length > 0) {\n players[0].gone = true;\n players[0].playerscore = score;\n updatePlayerText(players);\n playerCycle(players);\n\n } else {\n return location.reload();\n }\n // flagButtonPatrent.removeEventListener('click', function(evt) {console.log('over')});\n // return location.reload();\n}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "1ac33223186152583468c1e6263e7f6b", "score": "0.60703915", "text": "stopped() {}", "title": "" }, { "docid": "a2a46eaa4d8b9d35780351d3ee984a05", "score": "0.60679734", "text": "stop() {\n this.isPlaying = false;\n this.curTime = 0;\n this.prevTime = 0;\n }", "title": "" }, { "docid": "0e79341910e9c28f4ff4271f9c4df874", "score": "0.6067113", "text": "function stop() {\n\tpause();\n\tcounter.reset();\n\tpaintSquaresAtZero();\n}", "title": "" }, { "docid": "3aef39a10c36e72acda23c15fda97723", "score": "0.60640025", "text": "stop() {\n if (this.cancelPending_) {\n this.cancelPending_();\n this.cancelPending_ = null;\n }\n }", "title": "" }, { "docid": "1f333102856aeaac59b0a60268776192", "score": "0.6058131", "text": "async stop() {\n this.removeSocketListeners(this.socket);\n this.removeRoomListeners(this.room);\n this.socket.emit('server-action', {\n type: 'ROOM_DISCONNECTED',\n payload: {\n userProfile: this.userProfile\n }\n });\n }", "title": "" }, { "docid": "3bbe79a97478d866da12ef2ae26e2141", "score": "0.60558116", "text": "stop() {\n this.__playing = false;\n }", "title": "" }, { "docid": "ce403fcf9d6e278609d3f29ee66315d2", "score": "0.6054085", "text": "function endGame() {\n chat.debug(\"endGame called\");\n // unlock chat, reset back to where we were\n pluginGlue.unlock();\n chat.messagePollInterval = 3000;\n chat.resetTimers();\n }", "title": "" }, { "docid": "337daeb3154f74b138d9b4610a17d19b", "score": "0.60530293", "text": "stop() {\n\t\tif ( this.playing === false ) return;\n\t\tthis.pausedTime = undefined;\n\t\tthis.startTime = undefined;\n\t\tthis.container.stop();\n\t\tthis._onStop();\n\t}", "title": "" }, { "docid": "b837ad252c37d72855cee83d89cef695", "score": "0.60522544", "text": "function stopGame(){\n updateCounter(0);\n score = 0;\n window.clearInterval(intervalTimerRectangle);\n stopScheduledRectangles();\n clearAllRectangles();\n window.clearInterval(intervalTimerGame);\n draw();\n initializeButtons(\"stop\");\n}", "title": "" }, { "docid": "f916ef64d9d71c5e1957efec384208e1", "score": "0.6051533", "text": "doStop () {\n this._sensor.unexport()\n eventChannel.emit('ledStateChange', {state: false})\n }", "title": "" }, { "docid": "76b59d4805c901fa0a5ce487d32beb5a", "score": "0.60502094", "text": "function stopGame()\n{\n clearTimeout(timerIdGame);\n flag=1;\n}", "title": "" }, { "docid": "3c0ed93c0043989967dd965b0d6ff4d4", "score": "0.60496235", "text": "kill() {\r\n this.restart();\r\n playState = 5;\r\n }", "title": "" }, { "docid": "ee36898bef33cc507a154404cc6623d1", "score": "0.6046115", "text": "function stop(){\r\n if (name != \"\") {\r\n var askStop = confirm(\"Parar el juego y acabar la partida \" + name + \"?\");\r\n if (askStop) {\r\n resetGame();\r\n startGame();\r\n } else {\r\n \r\n }\r\n } else {\r\n\r\n }\r\n}", "title": "" }, { "docid": "ed25795eeb8f7dd94093454aa9d94c65", "score": "0.60420376", "text": "function stop() \n {\n clockRunning=false;\n clearInterval(intervalId);\n }", "title": "" }, { "docid": "14f4609aebae97a95fa2324cf6124bd0", "score": "0.60345125", "text": "endGame() {\n\n }", "title": "" } ]
090b33ef076ed1661b87afc84e69eb8c
Switches display of comparison blocks to visible from hidden for a second
[ { "docid": "3225d0800fb2727f487cd475ceed7aa4", "score": "0.6680848", "text": "function showComparisonDataBrief() {\n \n // Show the comparison data\n showComparisonData();\n\n // Show the comparison data for a period of time, then hide it\n setTimeout(hideComparisonData, 1000);\n\n}", "title": "" } ]
[ { "docid": "c117a5fc4a1d32e325c1d9cfb2fbd2e4", "score": "0.6853482", "text": "function displaySwitching(diff){\n\tif(diff === 3){\n\t\tfor(i = 3; i < 6; i++){\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t\treturn;\n\t}\n\tif(diff === 6){\n\t\tfor(i = 3; i < 6; i++){\n\t\t\tsquares[i].style.display = \"block\";\n\t\t}\n\t\treturn;\n\t}\n\tconsole.log(\"DISPLAY SWITCHING FAILED!!!\");\n}", "title": "" }, { "docid": "eaf7dd7aea967e3761c415553fb67486", "score": "0.682301", "text": "function toggle() {\r\n //if the object is current hidden\r\n if (hidden) {\r\n //set display to be on in block form\r\n document.getElementById('output').style.display = 'block';\r\n //and set the status to currently visible\r\n hidden = false;\r\n }\r\n //otherwise it is implied that it is visible\r\n else {\r\n //set the status to hidden\r\n hidden = true;\r\n //set the objects display to be off\r\n document.getElementById('output').style.display = 'none';\r\n }\r\n }", "title": "" }, { "docid": "a0c86ef4dd7f4e43ad392955dbed514d", "score": "0.6694149", "text": "function toggleVisible() {\n setVisible(false)\n\n }", "title": "" }, { "docid": "8ea8a44e46ef2f603ca3a42070351008", "score": "0.6685477", "text": "static set visible(value) {}", "title": "" }, { "docid": "1f3a9597b77934ffc915c6b4ff9eb348", "score": "0.66786987", "text": "function _sh_overview_hidden(){\n\tin_overview = false;\n\twrap_plane_clone.visible = false;\n\tif( paused_preserve ) pause();\n}", "title": "" }, { "docid": "40825abb88067b041f497bc7ad9973fb", "score": "0.6638853", "text": "function animOnVisibility() {\n checkVisible(demos, dist);\n}", "title": "" }, { "docid": "405650171f03816bbef6edf936e02f46", "score": "0.66100967", "text": "function toggleVisibleBlocksWhenBlueDetached( parameters ) {\n\t\t\tvar $banner = parameters.$banner;\n\t\t\tvar detach = parameters.detach;\n\t\t\tvar hiddenOnBlueDetach = $banner.find( '.hidden-on-blue-detached' );\n\t\t\tvar showOnBlueDetach = $banner.find( '.show-on-blue-detached' );\n\t\t\tvar overflowCover = $banner.find( '.overflow-toggle-area-cover' );\n\t\t\tvar filterBar = $banner.find( '.n-banner-3rd-filler-dark' );\n\t\t\tif ( detach ) {\n\t\t\t\thiddenOnBlueDetach.hide();\n\t\t\t\tshowOnBlueDetach.show();\n\t\t\t\toverflowCover.show();\n\t\t\t\tfilterBar.hide();\n\t\t\t} else {\n\t\t\t\thiddenOnBlueDetach.show();\n\t\t\t\tshowOnBlueDetach.hide();\n\t\t\t\toverflowCover.hide();\n\t\t\t\tif ( $banner.find( '.filter-bar' ).css( \"display\" ) !== \"none\" ) {\n\t\t\t\t\tfilterBar.show();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "13952c2fa0443bccdb4568ef1bf0e695", "score": "0.65776724", "text": "function setVisibility(){\n $jQ(':visible').each(function(){\n $jQ(this).attr(vars.visible, \"true\");\n });\n $jQ(':hidden').each(function(){\n $jQ(this).attr(vars.visible, \"false\");\n });\n}", "title": "" }, { "docid": "66ce017108356965162e27962d970cfa", "score": "0.657014", "text": "function showHidden(node) {\n toggleCard(node);//muestra\n if (memoryGame.selectedCards.length == 2 && !memoryGame.checkPairs()) {\n setTimeout(function () {\n toggleCard(node);//esconde_carta\n toggleCard(firstCard);//esconde_carta\n }, 1000);\n }\n else {\n firstCard = node;\n }\n }", "title": "" }, { "docid": "2710bde0a5f6d500ece28955cd5bf48a", "score": "0.6551221", "text": "function toggleMovementDisplay() {\n\tisHidden.style.display = 'block';\n}", "title": "" }, { "docid": "ec2e9d961522bf134f77751eea492c7b", "score": "0.65502745", "text": "function showComparisonData() {\n \n // Check for updated observation data from bom. \n checkBomUpdates();\n\n // Show the comparison remote station elements\n let lCompDataElements = document.getElementsByClassName(\"CompObs\"); \n for (let lElement of lCompDataElements) {lElement.style.display = \"inline\";}\n\n // Hide the local station data elements\n let lOrigDataElements = document.getElementsByClassName(\"CompOrig\"); \n for (let lElement of lOrigDataElements) {lElement.style.display = \"none\";}\n\n // Remove the data from all the other observation blocks, to avoid confusion\n let lLeftOverBlocks = document.getElementsByClassName(\"obsblock\");\n \n}", "title": "" }, { "docid": "a3ddd86d3032d5092c4bde184cbdf363", "score": "0.6538394", "text": "function toggleFieldsDisplay(display){\n timeCount.hidden = display;\n relToCount.hidden = display;\n sameOptions.hidden = !display;\n}", "title": "" }, { "docid": "2fc05f8958e205fd2e0ff7044ff7e84c", "score": "0.6537155", "text": "function computeVisibility(){var computedVisibility=(_audioOnly&&_displayMode==='auto'||_displayMode==='on')&&_displayAroundLoading;if(_lastComputedVisibility!==computedVisibility){_lastComputedVisibility=computedVisibility;_eventEmitter.emit('visibilityChanged',computedVisibility);}}", "title": "" }, { "docid": "ec6a5ff31877f5d433e9f9c126b31256", "score": "0.6530337", "text": "function changeVisibility() {\n magic.style.visibility = 'hidden';\n magic.style.display = 'block;';\n}", "title": "" }, { "docid": "61bb50b0bf4d543059f6342961f763ed", "score": "0.6507317", "text": "function hideComparisonData() {\n\n // Hide the comparison remote station elements\n lCompDataElements = document.getElementsByClassName(\"CompObs\"); \n for (let lElement of lCompDataElements) {lElement.style.display = \"none\";}\n\n // Show the local station data elements\n lOrigDataElements = document.getElementsByClassName(\"CompOrig\"); \n for (let lElement of lOrigDataElements) {lElement.style.display = \"inline\";}\n\n}", "title": "" }, { "docid": "a33498183f0ad930bc7ae9f8d6639366", "score": "0.64879566", "text": "function swap_show_hide()\n{\n if (showhide_status) \n {\n showhide_status = false;\n } \n else \n {\n showhide_status = true;\n }\n this.refresh_show_hide();\n}", "title": "" }, { "docid": "d983d606d6bdbf4ad337bd633e07c4f2", "score": "0.64519954", "text": "show() {\n this.updateObject();\n if (this.needsElemUpdate) this.setKVPairElems();\n this.elem.classList.remove(\"hiding\");\n this.elem.classList.remove(\"noDisplay\");\n this.isHidden = false;\n }", "title": "" }, { "docid": "442a50e30bb664e4df8a9d69c152e2d8", "score": "0.64239925", "text": "show() {\n if (!this[$visible]) {\n this[$visible] = true;\n this[$updateVisibility]({ notify: true });\n }\n }", "title": "" }, { "docid": "d13046c949562eed3c90375b18c3ea4f", "score": "0.64031696", "text": "function toggle_visbility(make_visible, currently_visible) {\n\tdocument.getElementById(currently_visible).style.display = \"none\";\n\tdocument.getElementById(make_visible).style.display = \"initial\";\n\t\n\t// Update counter\n\tif (make_visible in found_objects_map){\n\t\tfound_objects_map[make_visible]=1;\n\t}\n\tcounter_update();\n\t\n\t// Set left pane scroll bar to top\n\tdocument.getElementById(\"myleftcol\").scrollTop = 0;\n\t\n\t// Return id of content that is now visible\n\treturn make_visible;\n}", "title": "" }, { "docid": "cf0ff802ddd8a9f1b0bfbe14ad610946", "score": "0.63824725", "text": "toggleVisibility() {\n this.setVisible(!this.visible);\n }", "title": "" }, { "docid": "024d3f8d0c0665cef7728b01129260de", "score": "0.63799125", "text": "function setVisibility() {\n\n self.element.querySelector( '.captions_start' ).style.display = getInputElementByName( 'start_button' ).checked ? 'block' : 'none';\n self.element.querySelector( '.captions_submit' ).style.display = getInputElementByName( 'feedback' ).value !== 'none' ? 'block' : 'none';\n self.element.querySelector( '.captions_finish' ).style.display = getInputElementByName( 'onfinish.restart' ).checked ? 'block' : 'none';\n getInputElementByName( 'manually' ).style.display = getInputElementByName( 'keywords' ).value === 'manually' ? 'block' : 'none';\n function getInputElementByName( name ) { return self.element.querySelector( '[name=\"' + name + '\"]' ); }\n\n }", "title": "" }, { "docid": "5f4845d229b483a133fe4402d12689a9", "score": "0.6373154", "text": "function unHideComponents(){\r\n tank.style.visibility = \"visible\";\r\n missile.style.visibility = \"visible\";\r\n score.style.visibility = \"visible\";\r\n}", "title": "" }, { "docid": "c0178cdd0e8739d15e1da59e2a778e0c", "score": "0.63729006", "text": "function SetVisible(n,t){WDAnimSurImage.prototype.SetVisibilite(n,t?\"visible\":\"hidden\")}", "title": "" }, { "docid": "fba3acfd5d1039427bba65d4d1fde32c", "score": "0.6370953", "text": "function showOvlay(){\n ovlay1.css('display', 'block');\n ovlay2.css('display', 'block');\n }", "title": "" }, { "docid": "a7c67de1a0aebc0905fdfbc5ea32399e", "score": "0.6343661", "text": "function setVisibility() {\n\n self.element.querySelector( '.captions_start' ).style.display = getInputElementByName( 'start_button' ).checked ? 'block' : 'none';\n self.element.querySelector( '.captions_submit' ).style.display = getInputElementByName( 'feedback' ).value !== 'none' ? 'block' : 'none';\n // self.element.querySelector( '.captions_cancel' ).style.display = getInputElementByName( 'cancel_button' ).checked ? 'block' : 'none';\n self.element.querySelector( '.captions_finish' ).style.display = getInputElementByName( 'onfinish.restart' ).checked ? 'block' : 'none';\n getInputElementByName( 'manually' ).style.display = getInputElementByName( 'keywords' ).value === 'manually' ? 'block' : 'none';\n function getInputElementByName( name ) { return self.element.querySelector( '[name=\"' + name + '\"]' ); }\n\n }", "title": "" }, { "docid": "a9b9ff36dcf54526b8adf83e83441529", "score": "0.63311094", "text": "function toggle_stats_box(show) {\r\n // Does nothing if current display status already matches desired status\r\n if (stats_visible == show) {\r\n return\r\n }\r\n\r\n // Converts to int to get the desired grid layout from the array\r\n var i = show ? 1 : 0;\r\n\r\n // Changes the 'grid-template-rows' css property of the Preview div\r\n $('.preview').css('grid-template-rows', grid_layouts[i]);\r\n // Toggles the visibility of the stats-box\r\n $('.stats-box').css('visibility', visibility[i]);\r\n\r\n // Inverts the value of the bool\r\n stats_visible = !stats_visible;\r\n}", "title": "" }, { "docid": "0916a7c04af81956af69ae861635e679", "score": "0.6330111", "text": "function shouldBeVisible() {\n return visibleValues > 1;\n}", "title": "" }, { "docid": "e9b1b638deaf2f9afee6806d0165f2f2", "score": "0.6293723", "text": "function showHideAll(showOrHide, labels, updateHiddenTraces) {\n if (showOrHide === 'show') {\n updateHiddenTraces(labels, false, true)\n } else {\n updateHiddenTraces(labels, true, true)\n }\n}", "title": "" }, { "docid": "2ec52d06aeea014c56012cda17d809f0", "score": "0.62860423", "text": "showTileBeforeHiding() {\n const openTiles = this.getNumberOfOpenTiles();\n if (openTiles == 2) {\n setTimeout(() => {\n this.channel.push(\"hide\", {}).receive(\"ok\", response => {\n this.setState(response.game);\n });\n }, 1000);\n }\n this.hasGameEnded();\n }", "title": "" }, { "docid": "147e34cb285ea7c0c52a2791de1bb04c", "score": "0.62857616", "text": "function switchVisibleStatistics(emotionInteger) {\n switch (emotionInteger) {\n case 1:\n document.getElementById('anxiousDisplay').style.display = 'block';\n document.getElementById('sadDisplay').style.display = 'none';\n document.getElementById('isolatedDisplay').style.display = 'none';\n document.getElementById('unsafeDisplay').style.display = 'none';\n break;\n case 2:\n document.getElementById('anxiousDisplay').style.display = 'none';\n document.getElementById('sadDisplay').style.display = 'block';\n document.getElementById('isolatedDisplay').style.display = 'none';\n document.getElementById('unsafeDisplay').style.display = 'none';\n break;\n case 3:\n document.getElementById('anxiousDisplay').style.display = 'none';\n document.getElementById('sadDisplay').style.display = 'none';\n document.getElementById('isolatedDisplay').style.display = 'block';\n document.getElementById('unsafeDisplay').style.display = 'none';\n break;\n case 4:\n document.getElementById('anxiousDisplay').style.display = 'none';\n document.getElementById('sadDisplay').style.display = 'none';\n document.getElementById('isolatedDisplay').style.display = 'none';\n document.getElementById('unsafeDisplay').style.display = 'block';\n }\n}", "title": "" }, { "docid": "43fabe85facaacadac55fa1d9688c3e9", "score": "0.62818193", "text": "hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }", "title": "" }, { "docid": "ab03e03dac92bcb86688cd42f541dc44", "score": "0.6269135", "text": "function showHideColorBlocks(){\n if(document.getElementById('color').checked){\n $('.colorBlock').show();\n }else{\n $('.colorBlock').hide();\n }\n update();\n}", "title": "" }, { "docid": "1e02c1abe2d3343b0f329aad262e6bc8", "score": "0.62685734", "text": "function visibility(){\n\t\tvar window_top = $(window).scrollTop();\n\t\tvar window_height = $(window).height();\n\t\tvar start_visibility = window_top + window_height;\n\t\t\n\t\t$(\".visibility\").each(function(){\n\t\t\t\n\t\t\tvar block_position = $(this).offset().top;\n\t\t\t\n\t\t\tif(start_visibility >= block_position){\n\t\t\t\t$(this).addClass('is-visible');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f44f72bdd373799efb3d00c7606ce308", "score": "0.6267691", "text": "toggleVisible() {\n if (this.visible) {\n this.visible = false;\n // this.element.setAttribute('style', 'display: none;');\n this.element.style.display = 'none';\n } else {\n this.visible = true;\n this.element.style.display = 'block';\n }\n }", "title": "" }, { "docid": "d78cf9c4a3354f9796c45c29400a3d34", "score": "0.6262636", "text": "render_toggle() {\n if (this.visible) {\n this.render_hide();\n\n } else {\n this.render_display();\n\n }\n }", "title": "" }, { "docid": "5cea8e36a787846f06888f5fcd519f49", "score": "0.6243144", "text": "function toggleVisibility() {\r\n\t\tif (designImage.style.display == '') {\r\n\t\t\tdesignImage.style.display = 'block';\r\n\t\t\tmeasurement.box.style.display = 'block';\r\n\t\t\tpositionDesignImage()\r\n\t\t\tEstate.Develop.CheckImage.Run( requestURL )\r\n\t\t} else {\r\n\t\t\tdesignImage.style.display = '';\r\n\t\t\tmeasurement.box.style.display = '';\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6dabafbff1daf523187e82b66431c2c8", "score": "0.6219769", "text": "toggle() {\n\t\tif (this.isVisible) {\n\t\t\tthis.display();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}", "title": "" }, { "docid": "78d32087d6fcd29ac6e2829be5611225", "score": "0.62126005", "text": "function compare(arr1, arr2) {\r\n arr1.forEach(function (a1) {\r\n a1.style.display = 'none';\r\n arr2.forEach(function (a2) {\r\n if (a1 === a2) {\r\n a1.style.display = '';\r\n }\r\n })\r\n })\r\n }", "title": "" }, { "docid": "af8d568c1c5e0e9ff68b97912047dab1", "score": "0.62091804", "text": "function unitListVisible() {\n setVisible(!visible);\n }", "title": "" }, { "docid": "5535810e76c2e75c14a28a86cc736350", "score": "0.620833", "text": "function visibilityMoney() {\n setVisible((prevState) => !prevState);\n }", "title": "" }, { "docid": "99f5e028f420bd36353f2fce98afcbd9", "score": "0.6203275", "text": "function myDelayDisplay(a, b) {\r\n setTimeout(function () { steen[a].style.display = \"inline\"; }, 500 * b);\r\n }", "title": "" }, { "docid": "af1ea7e12c821ed8c04f541d1a56d098", "score": "0.61932194", "text": "function updateWhatToShow() {\n\tvar whatToShow = getValue(\"whatToShow\");\n\tvar showSinglePeriod = false;\n\tvar showCompare2periods = false;\n\tvar showThroughTime = false;\n\tvar showDistribution = false;\n\tvar showAllNoneGraphsTD = true;\n\tswitch (whatToShow) {\n\t\tcase \"SINGLE_PERIOD\":\n\t\t\tshowSinglePeriod = true;\n\t\t\tshowAllNoneGraphsTD = false;\n\t\t\tbreak;\n\t\tcase \"COMPARE_PERIODS\":\n\t\t\tshowCompare2periods = true;\n\t\t\tbreak;\n\t\tcase \"THROUGH_TIME\":\n\t\t\tshowThroughTime = true;\n\t\t\tswitchThroughTimeRange();\n\t\t\tbreak;\n\t\tcase \"DISTRIBUTION\":\n\t\t\tshowDistribution = true;\n\t\t\tshowAllNoneGraphsTD = false;\n\t\t\tbreak;\n\t}\n\t$$('td.singlePeriod').each(function(td) {td[showSinglePeriod ? 'show' : 'hide']()});\n\t$$('td.compare2periods').each(function(td) {td[showCompare2periods ? 'show' : 'hide']()});\n\t$$('td.throughTime').each(function(td) {td[showThroughTime ? 'show' : 'hide']()});\n\t$$('td.distribution').each(function(td) {td[showDistribution ? 'show' : 'hide']()});\n\t$('selectAllNoneGraphsTD')[showAllNoneGraphsTD ? 'show' : 'hide']();\n\tswitchAllItemCheckboxes(false);\n}", "title": "" }, { "docid": "05bf0b64e8c03dcc3fa1a2caf018a940", "score": "0.6192368", "text": "function less(){\n if(selector[1].checked){\n selector[0].checked = false;\n }\n\n for(let i = 0; i < showLess.length; i++){\n let current = showLess[i];\n for(let j = 1; j < current.childNodes.length; j++){\n current.childNodes[j].style.display = 'none';\n }\n }\n\n for(let i = 0; i < showLess2.length; i++){\n let current = showLess2[i];\n for(let j = 1; j < current.childNodes.length; j++){\n current.childNodes[j].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "e9a136043d6dc058d00fba66a1d70dcd", "score": "0.6181929", "text": "function changeDisplay(){\n magicElement.style.display = \"none\";\n}", "title": "" }, { "docid": "60d8c4d60f839db8fd5685dfb3c817ca", "score": "0.6177869", "text": "'visible'(callback) {\n\n\t\t//console.log('vis');\n\n\t\t//return this.style('display', 'block', callback);\n\t\tthis.style('display', 'block', callback);\n\t}", "title": "" }, { "docid": "c402cbbbf399d8e6c954f2e875a2220e", "score": "0.61623526", "text": "hide() {\n this.elem.classList.add(\"hiding\");\n setTimeout(() => this.elem.classList.add(\"noDisplay\"), 184);\n this.isHidden = true;\n }", "title": "" }, { "docid": "9b8084fb71b7f99103ff96ae9b0922cb", "score": "0.61534214", "text": "function ui_switchVisibility(arr_hides, arr_displays){\n\n\t //hide objects\n\t if (arr_hides.length > 0){\n\t\t for (var i = 0; i < arr_hides.length; i++){\n\t\t\t var _obj = ui_getObjById( ui_trim(arr_hides[i]) );\n\n\t\t\t _obj.style.display = 'none';\n\t\t }\n\t }\n\n\t //display objects\n\t if (arr_displays.length > 0){\n\t\t for (var i = 0;i < arr_displays.length; i++){\n\t\t\t var _obj = ui_getObjById( ui_trim(arr_displays[i]) );\n\t\t\t _obj.style.display = '';\n\n\t\t }\n\t }\n}", "title": "" }, { "docid": "e5975bfd2ac14225302df5bf2e19a923", "score": "0.61471254", "text": "function change_l3_div_visibility()\n{\n var status = document.getElementById(\"hidden_program_list_level3_div\").style.visibility;\n if(status == \"visible\")\n {\n status = document.getElementById(\"hidden_program_list_level3_div\").style.visibility = \"hidden\";\n document.getElementById(\"level3_bad_programslist\").innerHTML = \"<img src ='/images/bullet_arrow_up_level3.png'</img>\";\n }\n}", "title": "" }, { "docid": "47119f3e34b8881f6f1c7d7fe87be2c6", "score": "0.6140163", "text": "show() {\n\n for (let i = 0; i < this.frameCount; i++) {\n this[`frame${i}`].style.display = \"\";\n }\n this.isVisible = true;\n\n }", "title": "" }, { "docid": "a8b127d64a362b5efef960ccc2f9809b", "score": "0.6120393", "text": "function show_hideAction(){\r\n let DataBlock = document.getElementById(\"DataBlock\");\r\n let BasketBlock = document.getElementById(\"BasketBlock\");\r\n let PicsBlock = document.getElementById(\"PicsBlock\");\r\n let mainBlockHeight = document.getElementById(\"mainBlock\").clientHeight;\r\n let ButtonText = document.getElementById(\"show_hideButton\");\r\n\r\n let FiltersBlock = document.getElementById(\"FiltersBlock\");\r\n if(FiltersBlock.clientHeight == 0){\r\n ButtonText.textContent = \"HIDE FILTERS\";\r\n FiltersBlock.style.display = \"block\";\r\n BasketBlock.style.height = (mainBlockHeight*0.8)+'px';\r\n DataBlock.style.height = (mainBlockHeight*0.8)+'px';\r\n PicsBlock.style.height = (mainBlockHeight*0.8)+'px';\r\n }else{\r\n ButtonText.textContent = \"SHOW FILTERS\";\r\n FiltersBlock.style.display = \"none\";\r\n BasketBlock.style.height = (mainBlockHeight-6)+'px'; //largeur bordures = 6px\r\n DataBlock.style.height = (mainBlockHeight-6)+'px';\r\n PicsBlock.style.height = (mainBlockHeight-6)+'px';\r\n }\r\n}", "title": "" }, { "docid": "6fe47c1d3e6f2d68d9025ac34f28abe2", "score": "0.6115569", "text": "function func() {\r\n if (elems.style.display == 'none') {\r\n elems.style.display = 'inline-block';\r\n } else {\r\n elems.style.display = 'none'\r\n }\r\n }", "title": "" }, { "docid": "d6c4fb7edebf3493f10f677d2d44d81a", "score": "0.610367", "text": "function displayBox() {\n conversorBox.style.display = \"inline-block\";\n setTimeout(hideBox, 2000);\n}", "title": "" }, { "docid": "3dc745f95ce0fae2ca705e23813f2b92", "score": "0.610115", "text": "function makeVisible () {\n var elem = document.getElementsByClassName('invisible')[0];\n elem.classList.remove('invisible');\n elem.classList.add('visible');\n}", "title": "" }, { "docid": "2f13b79badd1b7637b1dbc00058536c3", "score": "0.6099407", "text": "function changeHandVisibility() {\n // set variables to some HTML elements\n var dHand = document.getElementById(\"house\")\n var pHand = document.getElementById(\"player\")\n\n // if the hands are hidden, reveal\n // if the hands are revealed, hide them\n if (dHand.style.display === \"none\")\n dHand.style.display = \"block\";\n else\n dHand.style.display = \"none\";\n\n if (pHand.style.display === \"none\")\n pHand.style.display = \"block\";\n else\n pHand.style.display = \"none\";\n }", "title": "" }, { "docid": "8ca6e149f033f84845648e7b55fa0cf7", "score": "0.6092648", "text": "function toggleHideFilter() {\n STORE.hideCompleted = !STORE.hideCompleted;\n}", "title": "" }, { "docid": "73ec136834dc8f32a35b7a315e3555cc", "score": "0.6090592", "text": "function checkVisible() {\r\n var $items = ['registration', 'messages', 'sponsors'];\r\n $('.ipWidget').find('.myl-module-game').each(function(){\r\n var $name = $(this).attr('data-module-name');\r\n var $active = $(this).children('div').data('module-visible');\r\n\r\n if(($.inArray($name, $items) !== -1) && $active == 'no') {\r\n $(this).parent().css('display', 'none');\r\n }\r\n });\r\n }", "title": "" }, { "docid": "3243a4d39aa4ce97b11a5a1b1b665107", "score": "0.60836643", "text": "function hideStartingInfo() {\r\n // Hides savings/checking info and transaction info.\r\n hideToggle(checking_info); \r\n hideToggle(savings_info); \r\n hideToggle(transactions); \r\n}", "title": "" }, { "docid": "c88b46e18ee4a1ce7f19787c95b17f5e", "score": "0.60799515", "text": "function setVisibles() {\n $scope.show_feeding_curves = false; //Wenn Daten vorhanden und nicht Objekt nicht leer, dann auf true\n $scope.show_error_text = false; //Wenn keine Daten vorhanden sind, dann auf true\n //$scope.selectedIndex = -1; //setzt die Klasse \"active\" auf die ausgewaehlte Tabellenzeile\n $scope.leftYLabel = '';\n }", "title": "" }, { "docid": "814524ae4279061c4483684e298ed15d", "score": "0.60764635", "text": "function displayBlocks(c, e, t)\n{\n\tvar s = (e.checked == true) ? 1 : -1;\n\n\tif (t)\n\t{\n\t\ts *= -1;\n\t}\n\n\tvar divs = document.getElementsByTagName(\"DIV\");\n\n\tfor (var d = 0; d < divs.length; d++)\n\t{\n\t\tif (divs[d].className.indexOf(c) == 0)\n\t\t{\n\t\t\tdivs[d].style.display = (s == 1) ? 'none' : 'block';\n\t\t}\n\t}\n}", "title": "" }, { "docid": "486081f6dc2ba2c24e493dac3b82b800", "score": "0.60749364", "text": "function showElemnt(){\n articleElem.classList.remove(\"elementIsNotVisible\")\n articleElem2.classList.remove(\"elementIsNotVisible\")\n console.log(\"visible\");\n}", "title": "" }, { "docid": "9644102fcba4d1309018b9346a93244f", "score": "0.6074174", "text": "function hideUnmatchedCards(){\n //If the two cards doesnot match , both the cards disappears\n setTimeout(function() {\n openedCards.forEach(function(card) {\n card.classList.remove('open', 'show');\n });\n openedCards = [];\n },200);\n }", "title": "" }, { "docid": "4b92e256ab1f9661b0daedfe0cf4f658", "score": "0.6069282", "text": "function madeVisible() {\n if (codeMirrorDirty) {\n codeMirrorDirty = false;\n // important we do it a bit later so things have had time to lay out\n setTimeout(function () {\n codeMirror.refresh();\n }, 1);\n }\n }", "title": "" }, { "docid": "c3e4e4039bda379cecf854e83ec52866", "score": "0.6067955", "text": "function showInfo() {\n var display = document.getElementById(\"idScenarios\").style.display;\n if (display == \"block\") {\n document.getElementById(\"idScenarios\").style.display = \"none\";\n }\n else {\n document.getElementById(\"idScenarios\").style.display = \"block\";\n }\n}", "title": "" }, { "docid": "6b1a3e46a443c1c92c9f34996e024969", "score": "0.60607696", "text": "function invisible(){\n feedback.style.visibility = 'hidden';\n}", "title": "" }, { "docid": "be7d4f883888a4a9afc59439aed84419", "score": "0.60584193", "text": "function displayMajority(){\n const container = document.querySelector(\".container\");\n if (container.style.display === \"none\") {\n container.style.display = \"block\";\n } else {\n setTimeout(delayPageChange = () => { container.style.display = \"none\";}, 600);\n }\n}", "title": "" }, { "docid": "9eec6de9964dc2b1b4ffe0879054b580", "score": "0.60482174", "text": "function toggleLog(){ \n var op, visi;\n if(Boolean(hidden)){\n visi=\"visible\";\n op = \"100\";\n }\n else{\n visi =\"hidden\";\n op=\"0\";\n }\n document.getElementsByTagName(\"button\")[0].style.opacity=op;\n document.getElementById(\"log\").style.visibility=visi;\n hidden =!hidden;\n}", "title": "" }, { "docid": "194f9ca8302a2a4a806f617bad3591a4", "score": "0.6035409", "text": "changeDisplay() {\n this.displayMarkup = !this.displayMarkup;\n }", "title": "" }, { "docid": "5fc6899dba9ba846ef25e415a55968ac", "score": "0.60344034", "text": "function hideShow(action) {\n if(action == 'show'){\n results.classList.add('show');\n } else if (action == 'hide'){\n results.classList.remove('show');\n }\n\n }//end hide or show results for top section", "title": "" }, { "docid": "209d9d71d3e2c2f29f607399fa2288bc", "score": "0.6033309", "text": "hideLower() {\n const filteredTiles = this._filterForLower();\n if (!filteredTiles || !filteredTiles.length) {\n this._error(`No islands found buying for below ${this.minimumBells}.`);\n return;\n }\n\n filteredTiles.forEach((tag) => {\n const parent = tag.parentElement.parentElement.parentElement;\n if (parent) parent.setAttribute('style', 'display: none;'); \n });\n this._info(`Hidden islands lower than ${this.minimumBells}.`);\n }", "title": "" }, { "docid": "3a823ff0c534c283c2bb79875f572bf6", "score": "0.60319424", "text": "function currentBlockIsChanged () {\n //Changes tools display on toolbar\n //Depens on the type of the current block\n toggleControlModule();\n \n //Update which blocks should be displayed on canvas\n //All blocks be of desination positon of bookmark should be hidden\n //Only one of them can be shown on page, which is the child of selected block\n updateBlocks();\n}", "title": "" }, { "docid": "80760bcd9747cf7c9c86056cc2d7d6a4", "score": "0.602521", "text": "checkVisible() {\r\n let squares = this.state.squares;\r\n let mapLevel = this.state.mapLevel;\r\n let p = this.state.playerIndex;\r\n let n = 20;\r\n let visible = [];\r\n const aura = [p, p-2, p-1, p+1, p+2, p+3, p-3,\r\n p-n, p-n-2, p-n-1, p-n+1, p-n+2,\r\n p+n, p+n-2, p+n-1, p+n+1, p+n+2,\r\n p-n*2, p-n*2-1, p-n*2+1,\r\n p+n*2, p+n*2-1, p+n*2+1,\r\n p-4, p+4];\r\n\r\n //only set visible what is on grid and eliminate overflow to other rows\r\n for (let i=0; i<aura.length; i++) {\r\n if (Math.abs(aura[i] % n - p % n) < 4 && aura[i] >= 0 && aura[i] < squares[mapLevel].length) {\r\n visible.push(aura[i]);\r\n }\r\n }\r\n let hidden = [];\r\n for (let i=0; i<squares[mapLevel].length; i++) {\r\n if (!visible.includes(i)) {\r\n hidden.push(i);\r\n }\r\n }\r\n this.setHidden(hidden);\r\n this.setVisible(visible);\r\n }", "title": "" }, { "docid": "01a1a013e34db0ecce72a978bc7aa924", "score": "0.6020968", "text": "function showGrid() {\n setTimeout(() => {\n grid.classList.remove('hidden')\n intro.classList.add('hidden')\n liveDIV.classList.remove('hidden')\n highScoreDIVPM.classList.remove('hidden')\n scroreDiv.classList.remove('hidden')\n scoreSpan.classList.remove('hidden')\n liveLost.classList.add('hidden')\n pacmanHeader.classList.remove('hidden')\n }, 1500)\n}", "title": "" }, { "docid": "c6e4ce2069ad1e924a9a514c4d92f44c", "score": "0.60196906", "text": "function go_black() { \n var s2=gl.GetMidLay();\n var sh=s2.GetVisibility().toLowerCase();\n //alert(sh);\n if (sh=='show') {\n s2.SetVisibility('hide');\n gl.LinkBtn('screen',go_black,'SCRN ON');\n }\n else {\n s2.SetVisibility('show');\n gl.LinkBtn('screen',go_black,'SCRN OFF');\n }\n}", "title": "" }, { "docid": "9f3aff98bded4cd8f136d5813889f681", "score": "0.60180646", "text": "set visible(value) {\n this._planeHelper.visible = value;\n }", "title": "" }, { "docid": "c175ace220323917823040013b273523", "score": "0.60174453", "text": "function toggleView(visible, hidden){\r\n //Toggle the whiteboard\r\n $(\"#whiteboard_form\").toggle();\r\n \r\n //Toggle the grid\r\n $(\".report-result\").toggle();\r\n $(\".tickets\").toggle();\r\n \r\n //Toggle the view list styles.\r\n visible.addClass(\"not_current\");\r\n hidden.removeClass(\"not_current\");\r\n }", "title": "" }, { "docid": "c7345c7fdfc8b5a6dcdbc6785e775e3f", "score": "0.6016268", "text": "function makeVisible() {\n\tfor (image of images) {\n\t\timage.style.opacity=\"1\";\n\t}\n\tstartMove();\n}", "title": "" }, { "docid": "96ca818a72caa3ce2b8055ecbdc15cf1", "score": "0.6001904", "text": "function displayNone(whichBlock) {\r\n\tdocument.getElementById(whichBlock).style.display='none';\r\n}", "title": "" }, { "docid": "dcacfa7becaadbe5708ad13cc825aa31", "score": "0.59987354", "text": "showHideTrace(station){\n\t\t\tstation[\"visible\"]=!station[\"visible\"];\n\t\t\tvar container = this.container;\n\t\t\tvar data = container.data;\n\t\t\tvar trace_index = station[\"trace_index\"];\n\t\t\tvar trace = data[trace_index];\n\t\t\ttrace.visible = station[\"visible\"];\n\t\t\tPlotly.redraw(container);\n\t\t}", "title": "" }, { "docid": "7c6e034538229b41e7dbd95dcd2abdf3", "score": "0.5996735", "text": "setLockVisibility(visible){\n var count;\n for(count = 0; count < this.locks.length; count++){\n this.locks[count].setVisible(visible);\n }\n }", "title": "" }, { "docid": "5b0e821121b1701d93f073b559e64ac8", "score": "0.5994923", "text": "function setVisible(b) {\n visible = b;\n utils.showElement(methodsElement, b);\n }", "title": "" }, { "docid": "9e7f3c545caeb032f2d433c1ef2ef51a", "score": "0.59933835", "text": "toggleNodes() {\n\t\tif (this.toggleVisibility) {\n\t\t\tthis.hideNodes();\n\t\t\tthis.toggleVisibility = false;\n\t\t} else {\n\t\t\tthis.showNodes();\n\t\t\tthis.toggleVisibility = true;\n\t\t}\n\t}", "title": "" }, { "docid": "c6bda5a7a8a300bdfbeaf315a92e3b25", "score": "0.5983684", "text": "function toggleStats() {\n if (statsContainer.style.display == 'none') {\n statsContainer.style.display = 'block';\n } else {\n statsContainer.style.display = 'none';\n }\n }", "title": "" }, { "docid": "15034b52eb88f6cdddbf1d5ea8eae50e", "score": "0.59833884", "text": "function toggleElementVis (node) {\n if(node.style.display) {\n node.style.display = '';\n } else {\n node.style.display = 'none';\n }\n}", "title": "" }, { "docid": "469a18972abb02664d18b0a75462f3df", "score": "0.5982934", "text": "function showElements() {\n $(\"#collapse_icon\").html(\"hide\");\n $(\".sidebar_elements\").removeClass(\"hidden\").fadeTo(600, 1);\n $(\".range_options\").css('display', 'flex');\n $(\"#cross\").addClass(\"hidden\").fadeTo(600, 0);\n}", "title": "" }, { "docid": "e8367c0a08a01b4215aeb7c36751069d", "score": "0.5982128", "text": "function ShowBlockElement(el, show) {\n el.style.display = show ? \"block\" : \"none\";\n}", "title": "" }, { "docid": "428bca7f25c2afcdea0bd525f3b1535d", "score": "0.59807086", "text": "setVisible() {\n this.visible = true;\n this.getNumber();\n }", "title": "" }, { "docid": "55ea118e1b1ff7166437e70269eb95e5", "score": "0.5980056", "text": "function show() {\n const toShow = document.querySelector(\".show\");\n const showBlock = document.querySelector(\".currentDisplay\");\n showBlock.innerHTML = (toShow.innerHTML)\n}", "title": "" }, { "docid": "a489ed8340b3410b9b12490335c39362", "score": "0.5975847", "text": "setVisible(status) {\n if (status)\n this.cont.style.display = \"block\";\n else\n this.cont.style.display = \"none\";\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.5970166", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.5970166", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "2fa98430b533ed2706ab7db4c85266f2", "score": "0.5961758", "text": "setLandingInfoDisplayed(value) {\n this.landingInfoDisplayed = value;\n this.box2.visible = value;\n _.each(_.filter(this.nodes, (node) => node.showCloseToPlanet), (node) => {\n node.shape.visible = value;\n });\n }", "title": "" }, { "docid": "ca576a6540c794552c898acbf1d7a0d9", "score": "0.595995", "text": "function showAndHideStuff() {\n viewtopScores.classList.add(\"hide\");\n instructionsEl.classList.add(\"hide\");\n gameOverEl.classList.add(\"hide\");\n scoresEl.classList.remove(\"hide\");\n tryAgainEl.classList.remove(\"hide\");\n}", "title": "" }, { "docid": "1111ae536c1cd5b396a65058cfa24627", "score": "0.59576434", "text": "_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }", "title": "" }, { "docid": "780dd3b38aad28c9803db7e330058c88", "score": "0.59569436", "text": "function toggleVisibility() {\n setVisibility(isVisible => !isVisible);\n }", "title": "" }, { "docid": "780dd3b38aad28c9803db7e330058c88", "score": "0.59569436", "text": "function toggleVisibility() {\n setVisibility(isVisible => !isVisible);\n }", "title": "" }, { "docid": "e3322e4920c458bd550219b19d3c75ba", "score": "0.5948567", "text": "function shown (el) {\n // console.log(el)\n setTimeout(function () {\n el.className += ' shown';\n }, 75 * index);\n }", "title": "" }, { "docid": "27ef33637725ba329de3eea5b9a94b77", "score": "0.59434843", "text": "function _sh_overview_showing(){\n\tin_overview = true;\n\twrap_plane_clone.visible = true;\n\tpaused_preserve = (paused == undefined) ? false : paused;\n\tresume();\n}", "title": "" }, { "docid": "32bb022026f11465d051e64c9cf2b1f2", "score": "0.5943131", "text": "function fnshowHideGraph(){\r\n\tvar graphObj=getElement(\"population\");\r\n\t\r\n\tif (graphObj.style.visibility!=\"visible\")\r\n\t{\r\n\t\tgraphObj.style.visibility=\"visible\";\r\n\t\t\r\n\t}else{\r\n\t\tgraphObj.style.visibility=\"hidden\";\r\n\t}\r\n}", "title": "" }, { "docid": "1c850302a01d949017ab0a4206807414", "score": "0.59413856", "text": "function toggleResults() {\n var tableVisibility = document.getElementById(\"dataTable\");\n if (tableVisibility.style.display === \"block\") {\n tableVisibility.style.display = \"none\";\n document.getElementById(\"btnDisplayResults\").innerText=\"View Race Results\";\n } else {\n tableVisibility.style.display = \"block\";\n document.getElementById(\"btnDisplayResults\").innerText=\"Hide Race Results\";\n }\n }", "title": "" }, { "docid": "907d1ddff3b8b0f03df2ca10ac8283d7", "score": "0.5939965", "text": "function\nShowBlocker\n()\n{\n var blocker;\n\n blocker = document.getElementById(\"MainBlocker\");\n blocker.style.visibility = \"visible\";\n}", "title": "" } ]
3937afb8117ac219cb11b24d61946091
A shortcut action creator for clearing out the whole collection and clearing load state.
[ { "docid": "7b8acbb1564bcf4f4089dd1f3baee81e", "score": "0.6593827", "text": "resetAll() {\n return (dispatch) => {\n dispatch(this.loadState('new'))\n dispatch(this.replaceCollection(this.opts.defaultState))\n }\n }", "title": "" } ]
[ { "docid": "cf9f42c8806ab21d793b393cd45b154a", "score": "0.69514", "text": "clear()\n {\n this.store.clear();\n }", "title": "" }, { "docid": "2c8f9adf248a3155ba2035446fc5f3c3", "score": "0.69139785", "text": "clear() {\n this.sortKey = null;\n this.data = [];\n this.collection.reset(null);\n }", "title": "" }, { "docid": "da1ef2e1a586bc220a98b3f6801944ea", "score": "0.67553467", "text": "clear() {\n this.props.dispatch(resetStock()) // adjust products back to original stock\n this.props.dispatch(clearBasket()) // empty basket\n this.props.dispatch(calcTotal()) // re-calculate total\n this.props.dispatch(applyDiscount()) // re-apply discounts\n }", "title": "" }, { "docid": "f7b1d9a5e52dd7ae4c9fe84b7700bb0b", "score": "0.66767746", "text": "clear() {\n this.store = [];\n }", "title": "" }, { "docid": "5d95d5d40f32ba86e7e26d7907a3196e", "score": "0.6615115", "text": "flush() {\n this.collection = [];\n }", "title": "" }, { "docid": "8936f0661d96fde175fa0024c16cd64d", "score": "0.6595408", "text": "clearAll() {\r\n /* clear */ (this.actionQueue.length = 0);\r\n /* clear */ (this.actionListFull.length = 0);\r\n if (this.currentAction != null)\r\n this.currentAction.reset();\r\n this.currentAction = null;\r\n this.__isEmpty = true;\r\n }", "title": "" }, { "docid": "95b0a980c15a45e8383b4fc8921979de", "score": "0.6514464", "text": "clear(collection) {\n if (!assert.isDefined(collection, \"spellCore.clear(collection)\")) return\n if (typeof collection.clear === \"function\") {\n collection.clear()\n return\n }\n const keys = spellCore.keysOf(collection).reverse()\n keys.forEach((key) => spellCore.removeItemOf(collection, key))\n\n // For arrays, try to set the `length` to 0\n // Might fail on a read-only object.\n if (typeof collection.length === \"number\") {\n try {\n collection.length = 0\n } catch (e) {\n // TODO???\n }\n }\n }", "title": "" }, { "docid": "bcb79625dff0ebc2c5155bfeb2f8f885", "score": "0.6510949", "text": "clear() {\n this.store = [];\n this.length = 0;\n }", "title": "" }, { "docid": "7fb88b20482d5fb5b260c34344161829", "score": "0.65084195", "text": "clear() {\n this._count = 0;\n this._items = [];\n }", "title": "" }, { "docid": "de2baab4197d7457cec855dbad141f91", "score": "0.649344", "text": "function clear() {\n delete this.dataStore;\n this.dataStore = [];\n this.listSize = this.pos = 0;\n}", "title": "" }, { "docid": "4659f241edb47e94d14704c2489e1b6f", "score": "0.6484911", "text": "clear () {\n this.state.clear();\n }", "title": "" }, { "docid": "8400ee7095a3a5a8b7ab6734696ec98f", "score": "0.6475434", "text": "function clear() {\n\tdelete this.dataStore;\n\tthis.dataStore = [];\n\tthis.listSize = this.pos = 0;\n}", "title": "" }, { "docid": "7d605451ba249426abd51e22361dd34b", "score": "0.64705455", "text": "clear() {\n\t\tthis.$$().removeAllModels();\n\t}", "title": "" }, { "docid": "726726d6fd7a6c202c964eb7998885ac", "score": "0.646427", "text": "clear() {\n\t\tthis.currentStore.clear();\n\t\tthis.nextStore.clear();\n\t}", "title": "" }, { "docid": "f056b93ffb3a3ebd5f3ff856b02bbbb5", "score": "0.64504755", "text": "clearItems() {\n const state$ = this.rxdux.dispatch({\n type: CLEAR_ITEMS\n }, 'state')\n .pipe(\n first(),\n tap(state => {\n this.hooks.onLoadingChange$.next({loading: false, state});\n this.hooks.onItemsCleared$.next({items: state.items, state});\n }),\n mergeMap(() => this.getItems())\n );\n\n state$.subscribe(()=>{});\n return state$\n }", "title": "" }, { "docid": "8fab77b3479384d9213068c9c82502f0", "score": "0.6423732", "text": "function _clear()\n{\n\tswitch(inlet)\n\t{\n\t\tcase 3:\n\t\t\tbatch('grid', 0);\n\t\tcase 4:\n\t\t\tbatch('key', 0);\n\t}\n}", "title": "" }, { "docid": "de60f669e1964a1901eb3de5d23f190f", "score": "0.64108735", "text": "function clear(){\n\tdelete this.dataStore;\n\tthis.dataStore = [];\n\tthis.listSize = this.pos = 0;\n}", "title": "" }, { "docid": "15a5c72f5471c0071cba04e36c2aee87", "score": "0.6401356", "text": "function clearAction() {\n debug$3('clearAction');\n last.diff = null;\n last.domNode = null;\n }", "title": "" }, { "docid": "fe674fddd88586caf82509cc1a0a00ca", "score": "0.6386999", "text": "async clear() {\n //@TODO\n\tlet collections = [\"courseId\", \"studentId\", \"assgnId\", \"grade\"];\n\tfor(var collection of collections) {\n\t\tlet temp = this.db.collection(collection);\n\t\tawait temp.deleteMany({});\n\t}\n }", "title": "" }, { "docid": "c13d2bfc243f54871f73320396c27f63", "score": "0.6385901", "text": "clearItems() {\n\t\tthis.items.clear();\n\t}", "title": "" }, { "docid": "4d98a87280742317e6a0294753e0c208", "score": "0.63831264", "text": "clear() {\n helpers.clear(this.obj)\n }", "title": "" }, { "docid": "4d98a87280742317e6a0294753e0c208", "score": "0.63831264", "text": "clear() {\n helpers.clear(this.obj)\n }", "title": "" }, { "docid": "d97aa40f7d782de517f0bdbcc8c83fa3", "score": "0.63749", "text": "clear() {\n this.model.destroy();\n }", "title": "" }, { "docid": "f89e9e863578b023877886fe9f76f96c", "score": "0.6366579", "text": "clear() {\n this.dataStore = [];\n }", "title": "" }, { "docid": "e4f4f61f7995bc72fa9d42d87b9a5094", "score": "0.6365554", "text": "clearAll() {\n this.clearListings();\n this.clearMarkers();\n }", "title": "" }, { "docid": "cc9ab74fecd4ee8405e9ea73aa21425c", "score": "0.6363418", "text": "emptyData() {\n this._collections.forEach((c) => c.remove());\n }", "title": "" }, { "docid": "bd39905ebe4146bbb79f8c1895da69f4", "score": "0.63412374", "text": "clear () {\n this.all = []\n this.current = null\n }", "title": "" }, { "docid": "a23d45ac73d05b610ed8d3bc5e2b6bf0", "score": "0.63338315", "text": "clear() {\n this._eventActions = {};\n }", "title": "" }, { "docid": "bf1c96a5b9df49e05dcbbc331115c8f1", "score": "0.6322575", "text": "clearTodo(){\n \tthis.dispatch();\n }", "title": "" }, { "docid": "f1d6388ad942c538aff13ee72d2d9fd9", "score": "0.63162565", "text": "clearStore() {\n this.tasks = {} // to get accurate and immediate feedback\n config.clear();\n // config.all();\n }", "title": "" }, { "docid": "f652bb73b9f709b6db8d9c878d7d8591", "score": "0.63135433", "text": "clear() {\n\t\t\tthis.model.destroy();\n\t\t}", "title": "" }, { "docid": "e9010d8510f645232e2e2f86410e4818", "score": "0.631158", "text": "function clear () {\n delete this.datastore;\n this.datastore = [];\n this.listSize = this.pos = 0;\n}", "title": "" }, { "docid": "7900ba6b9b018bb15b583af29bda71eb", "score": "0.6311388", "text": "clear() {\n this.items = {};\n }", "title": "" }, { "docid": "99176d86f350eb3b5075a5a2831eb860", "score": "0.63007677", "text": "async clear() {\n console.log(\"clear\");\n await this.collection1.deleteMany({});\n await this.collection2.deleteMany({});\n await this.collection3.deleteMany({});\n //@TODO\n }", "title": "" }, { "docid": "0f04879002dcffb1af5fbab37b7e552f", "score": "0.62962574", "text": "clear() {\r\n\t\t\tthis.items = [];\r\n\t\t\tthis.saveToLocalStorage();\r\n\t\t}", "title": "" }, { "docid": "7d990d477dca67b1049baa6f9ecb1344", "score": "0.628481", "text": "reset() {\n this._clear();\n }", "title": "" }, { "docid": "4f1821f07b9b606fbc2e79841c235a6a", "score": "0.62703633", "text": "clear() {\n this._.list.clearItems();\n LayoutMng.singleton.screen.render();\n }", "title": "" }, { "docid": "14ef07e67f5e41d6e42774acd8009d1d", "score": "0.62657154", "text": "function clear() {\n items = {};\n }", "title": "" }, { "docid": "6b07198af0af94a7313924eaac9e3d5d", "score": "0.62452346", "text": "clear() {\n \n }", "title": "" }, { "docid": "180903636691af3a94fe8f2a57492ac1", "score": "0.62251717", "text": "clear()\n {\n this._items = {};\n }", "title": "" }, { "docid": "98beb5fe8ff3a87e40a85e6122f8a17a", "score": "0.6224481", "text": "async clear() {\n //@TODO\n\tawait this.db.collection(\"users\").deleteMany({});\n\tawait this.db.collection(\"articles\").deleteMany({});\n\tawait this.db.collection(\"comments\").deleteMany({});\n }", "title": "" }, { "docid": "452c406999d8dfa714a7f424e67848f8", "score": "0.61973023", "text": "function clearStatus(resource){\n return (action) => {\n return (dispatch) => {\n (action ? [action] : ['fetch', 'create', 'update', 'destroy'])\n .forEach(a => dispatch({type: actionFor(resource, a, 'clear')}))\n }\n }\n}", "title": "" }, { "docid": "2c964d29f72e59b32430f39af52895a6", "score": "0.61919224", "text": "clear() {\n this.entries = {};\n queue.push({ action: 'clearMenu' });\n }", "title": "" }, { "docid": "d5ecd88c94fff772e783b208af511a09", "score": "0.6190728", "text": "clear() {}", "title": "" }, { "docid": "d5ecd88c94fff772e783b208af511a09", "score": "0.6190728", "text": "clear() {}", "title": "" }, { "docid": "d5ecd88c94fff772e783b208af511a09", "score": "0.6190728", "text": "clear() {}", "title": "" }, { "docid": "7df8a496cf6381feb465967c731d1eae", "score": "0.61745054", "text": "_cleanup(collection) {\n var name = this.name();\n\n if (this.isMany()) {\n collection.forEach(function(entity) {\n if (entity instanceof Model) {\n entity.set(name, []);\n } else {\n entity[name] = [];\n }\n });\n return;\n }\n\n collection.forEach(function(entity) {\n if (entity instanceof Model) {\n entity.unset(name);\n } else {\n delete entity[name];\n }\n });\n }", "title": "" }, { "docid": "fe8784a7db44a5b93d3cff6efeda4114", "score": "0.6162099", "text": "clear() {\n\n }", "title": "" }, { "docid": "83304f588558a5cd08085c3a37934229", "score": "0.6161552", "text": "function clear() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}", "title": "" }, { "docid": "ef598700185c915817b430d94dee29e9", "score": "0.61608136", "text": "function clear(modelToClear) {\n unfinishedCount++;\n modelToClear\n .find()\n .remove()\n .exec(onceClear);\n}", "title": "" }, { "docid": "b6ddd4bc5d0a78d091645b40f1e122cd", "score": "0.615472", "text": "clear() {\n clear(this)\n }", "title": "" }, { "docid": "db013c9068c84711971e5aefe5196bfd", "score": "0.61389464", "text": "empty() {\n this.items.clear()\n }", "title": "" }, { "docid": "4d1cb15eed1cc8b1ebb2a45d88acdd8e", "score": "0.613863", "text": "function clear() {\n cards.clear();\n}", "title": "" }, { "docid": "b745ccddfc6c3230902683a2d531cc38", "score": "0.613693", "text": "clear() {\n\n\t}", "title": "" }, { "docid": "25017dc10ff06c002ffb4e20ed69c7da", "score": "0.6115875", "text": "function clearAll() {\n \tcurrentFilter = '*';\n \tsetPagination();\n \tgoToPage(1);\n }", "title": "" }, { "docid": "78a8151b2f75eb1612123454266e6c0c", "score": "0.610688", "text": "clear(){\n dataStore = [];\n listSize = 0;\n pos = 0;\n\n }", "title": "" }, { "docid": "13fd1a1939ca489d1c8ea0dc358b7f5a", "score": "0.60966355", "text": "clearState() {\n super.clearState();\n this._currentList = null;\n this._lists = [];\n this._tasks = [];\n this._loadingTasks = [];\n this._isLoadingTasks = false;\n }", "title": "" }, { "docid": "33b0c962450cdaa9f540fed1e7b5ed21", "score": "0.60961163", "text": "function clear() {\r\n\t\tcontext.clear();\r\n\t}", "title": "" }, { "docid": "b4f670f38457acf8f22550ba196b6921", "score": "0.6095546", "text": "clear() {\n\t\tthis._inProgress = false;\n\t\tthis.setState({\n\t\t\tresult: \"\",\n\t\t\toperation: \"\",\n\t\t\tactionArr: [],\n\t\t\treset: true\n\t\t});\n\t}", "title": "" }, { "docid": "f7caea5fbc13173bf0d2c0aefd26230d", "score": "0.6082769", "text": "clearData() {\n let items = this.getDropdownItems();\n [].forEach.call(items, (item, i) => {\n this.dataStore.remove(items[i]);\n });\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.60766816", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.60766816", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.60766816", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.60766816", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "e5972940d25d2f59c0e800554adba4e5", "score": "0.6076632", "text": "function clearCollections() {\n var addColletionSnipp = $(\"#create_collection_card\").detach();\n $('#nth-column-1').empty();\n $('#nth-column-2').empty();\n $('#nth-column-3').empty();\n\n $('#nth-column-1').append(addColletionSnipp);\n $('#formCreateCollectionName').val(\"\");\n $('#formCreateCollectionDescription').val(\"\");\n}", "title": "" }, { "docid": "73fac3ccae26f820edc007fcc459a5e8", "score": "0.6070162", "text": "clearList() {\n\t\tlet { filteredDataSets, DataSets} = this.state\n\t\tfilteredDataSets = DataSets\n\t\tthis.setState({ filteredDataSets })\n\t\tthis.props.clearSelected()\n\t}", "title": "" }, { "docid": "13f69b586a075987b8f3cdeed84fd4f3", "score": "0.6060439", "text": "function clear() {\n var newJobs = {};\n for (let id of Object.keys(jobs)) {\n if(jobs[id].state == 'completed' || jobs[id].state == 'failed'){\n // ignore\n }else{\n newJobs[id] = { id, state: jobs[id].state };\n }\n }\n jobs = newJobs;\n //jobs = {};\n render();\n}", "title": "" }, { "docid": "97fb703404bc012a06128c190475d42f", "score": "0.60570705", "text": "function clearAll() {\n if (busy) return;\n\t\tsetSearchTerm('');\n\t\tsetSortBy('best match');\n\t\tsetActiveFilter('any');\n\t\tdispatch({ type: 'SET_REPOSITORY_SEARCH_RESULTS', results: {} });\n\t}", "title": "" }, { "docid": "2d86035fc16bba5b98b4c5c40a001235", "score": "0.60491514", "text": "clearAll() {\n this._operation = [];\n this.displayCalc = 0;\n }", "title": "" }, { "docid": "b8f8290eb929df1c67bbcb707a9b227f", "score": "0.6045731", "text": "function onClearClick() {\n if (!utils.store().length) { return; }\n // Ask the user if she really wants to continue.\n showConfirm(app.confirmAll, function () {\n location.hash = 'timeline';\n utils.store(null);\n resetEntries();\n });\n }", "title": "" }, { "docid": "ff0bc0fc6daa238dc5771c82dc88beb8", "score": "0.60435903", "text": "function clear() {\n context.clear();\n }", "title": "" }, { "docid": "ff0bc0fc6daa238dc5771c82dc88beb8", "score": "0.60435903", "text": "function clear() {\n context.clear();\n }", "title": "" }, { "docid": "958778934507b1736e2e3244a658fbd0", "score": "0.60355264", "text": "clear(){\n this.list = [];\n this.cardinality = 0;\n }", "title": "" }, { "docid": "9a750854727cc615c47d3d8dfc0935a7", "score": "0.6027747", "text": "function clear() {\n for(var key in this.datastore) {\n delete this.datastore[key];\n }\n}", "title": "" }, { "docid": "31af19cfd34619aac34e956b0b97f755", "score": "0.6016963", "text": "function clear() {\r\n context.clear();\r\n }", "title": "" }, { "docid": "3150eebc1c952a65eb26db6eff09bac5", "score": "0.5993373", "text": "clearTags(){\n\t\tthis.props.dispatch(clearTags());\n\t}", "title": "" }, { "docid": "5edb2386f9d1e5ac92815d8ed20da86b", "score": "0.5992242", "text": "clear() {\n this.packs = [];\n this.refresh();\n }", "title": "" }, { "docid": "35a81a4208b325f7805ab5f8f3771342", "score": "0.5988478", "text": "async clear() {\n\t\tif (this.useLocalCache) {\n\t\t\tthis._localCache('', CLEAR);\n\t\t}\n\t\tif (this.useRedisCache) {\n\t\t\tawait this._clear();\n\t\t}\n\t}", "title": "" }, { "docid": "07063be56abb1458949d89939d0d41de", "score": "0.59877807", "text": "destroy ({ state, commit }, model) {\n let collection = state.collection.filter(m => m._id !== model._id)\n commit('collection', collection)\n }", "title": "" }, { "docid": "a9cf7779aed7810d406e08ac2b366395", "score": "0.5987692", "text": "clear() {\n\t\t\tconsole.log(\"clear() at View: not implemented\");\n\t\t}", "title": "" }, { "docid": "c92e2b31ed1a9fd27864401a6428ae66", "score": "0.59654576", "text": "clear() {\n this._a.aa();\n this._u.clear();\n this._as();\n }", "title": "" }, { "docid": "04e15e9dd1354de51c9db92870b3010b", "score": "0.59619105", "text": "clear()\n {\n this._filters.clear();\n }", "title": "" }, { "docid": "574d77f7913e6848e941f6545f0cc50c", "score": "0.5959648", "text": "clear() {\n\t\tthis.keys().forEach((key) => {\n\t\t\tkey = this.serializeKey(key);\n\t\t\tthis._delete(key);\n\t\t});\n\t}", "title": "" }, { "docid": "95ec97d085d6bc5b50bb63ee44ec32b2", "score": "0.5940818", "text": "clear() {\r\n try {\r\n dispose(this._toDispose.values());\r\n } finally {\r\n this._toDispose.clear();\r\n }\r\n }", "title": "" }, { "docid": "df3ae9048f21c0328c2a5438b3c95cd0", "score": "0.5933488", "text": "_modeClear () {\n this.$controlsButtonsTiles.removeAttr(this.attr.buttonActive)\n this.$viewTiles.removeAttr(this.attr.viewActive)\n\n this.$controlsButtonsList.removeAttr(this.attr.buttonActive)\n this.$viewList.removeAttr(this.attr.viewActive)\n }", "title": "" }, { "docid": "24bf3bace7dd1a670bfcf2f629a19374", "score": "0.5932909", "text": "clearAll() {\n if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.listParent) && !(this.isBlazorSaveUrl || this.isBlazorTemplate)) {\n if (this.browserName !== 'msie') {\n this.element.value = '';\n }\n this.filesData = [];\n return;\n }\n let eventArgs = {\n cancel: false,\n filesData: this.filesData\n };\n this.trigger('clearing', eventArgs, (eventArgs) => {\n if (!eventArgs.cancel) {\n this.clearData();\n this.actionCompleteCount = 0;\n this.count = -1;\n }\n });\n }", "title": "" }, { "docid": "c868029676208e69ef0ed8a450147bee", "score": "0.593273", "text": "function removeAll() {\n\t\tthis.length = 0;\n\t\tthis.publish('removeAll', arguments);\n\t}", "title": "" }, { "docid": "ac7bc800952bbbbd9db7f116c1765dc9", "score": "0.5932204", "text": "clearState() {\n utils.log('v2/Store:clearState');\n this.events.forEach((event) => (event.value = null));\n }", "title": "" }, { "docid": "6ef6007c6b7c675ca269f6002e90c0c8", "score": "0.59268236", "text": "clearActions(){\n\t\tinputQueue = [];\n\t\tactionQueue = [];\n\t}", "title": "" }, { "docid": "605261e37074a5fb651a0bd639f3cfc7", "score": "0.591667", "text": "clearFilter() {\r\n this.refs.companyGrid.onSelectAll(false, []);\r\n this.stateSet({ clearKey: new Date(), filterObj: {}, selectedData: [], selectAll: false });\r\n }", "title": "" }, { "docid": "68d1d77ccf82c564bc841c6408b9a3af", "score": "0.59166604", "text": "clearModel(state) {\n Vue.set(state, \"model\", []);\n this.commit(\"clearLocations\");\n }", "title": "" }, { "docid": "d9b9a8fb3fa7328698813829aab782bd", "score": "0.5911836", "text": "clear() {\n this.observer.takeRecords();\n this.queue.length = 0;\n this.clearSelection();\n }", "title": "" }, { "docid": "b072ace2d3879ba23020f95032fa82f7", "score": "0.5910133", "text": "function reset_all_action() {\n return function (dispatch) {\n var action = { type: '', payload: {} };\n dispatch({ type: _Constants.RESET_ALL_ACTION, action: action });\n };\n}", "title": "" }, { "docid": "f26524f4b4e3f9fc7befcc96aef07091", "score": "0.590678", "text": "function clearAll() {\n\tvar i, fig, entities = vdcanvas.GetActiveLayout().Entities.Items;\n\tfor (i = 0; i < entities.length; i+=1) {\n\t\tfig = vdcanvas.GetEntityItem(entities[i]);\n\t\tfig.Deleted = true;\n\t\tvdcanvas.UpdateFig(fig);\n\t}\n\tvdcanvas.redraw();\n}", "title": "" }, { "docid": "f41319b3f8f62660046dbc6a62f460b4", "score": "0.59064263", "text": "clear() {\n this._ag(0);\n }", "title": "" }, { "docid": "c844ad220291ba25633956a64972ad33", "score": "0.5906261", "text": "clear() {\n super.clear();\n }", "title": "" }, { "docid": "4f8ac419c186c8b9436dd9e9e0a394be", "score": "0.5898406", "text": "clear() {\n\t\tthis._filter.clear();\n\t}", "title": "" }, { "docid": "912beb8da92f9d7be3d9580bd866adf5", "score": "0.589823", "text": "clear() {\n this._cache = {};\n this._persist();\n }", "title": "" }, { "docid": "eac17ab04c6b8d6d6bf20c73e5b1e309", "score": "0.5895957", "text": "clear() {\n this._c.o();\n }", "title": "" } ]
77045fe040e46f7ace1b860c0a5ee5b3
check if an integer array is arithmetic sequence 1,2,3,4,5,6,7,8 => true 1,3,5,7,9 => false array may not be sorted
[ { "docid": "ce67c4a6d8f3f6b83c0fa473eac873b8", "score": "0.7425606", "text": "function isArithmetic(arr) {\n \n // Notes:\n // in a for loop, we can check every single iteration\n // array[i] === i\n // - what if there are 100 items in array?\n // - what if we are given 5,6,7,8,9? => true\n // - what about 7,5,6,8,9 => false\n \n // dont like\n // maybe we could multiply all values of the array\n // - this still means we to iterate over each index\n // start with the first value and divide, increment divider\n \n // what we know:\n // array length\n // always difference of 1\n \n // assumptions\n // array has a length of 3 or more\n \n // iterative solution\n // starting at 1 so we can check the value behind it to start\n for (var i = 1; i < arr.length; i++){\n /*\n var diff = arr[i + 1] - arr[i];\n if ( diff !== 1 ) {\n console.log(arr[i]);\n return false;\n }\n */\n var diff = arr[i] - arr[i - 1];\n if (diff !== 1){\n return false;\n }\n \n }\n \n return true;\n}", "title": "" } ]
[ { "docid": "32a8dd243cf83e46c8b366a24ae66cf9", "score": "0.7059439", "text": "function includes1to9(array) {\n // SH: Just a reminder that .sort() is a mutative method. I would use slice to make a copy first, just in case you want to use the inputted array for something after. Ie:\n // let sortedArray = array.slice().sort();\n let sortedArray = array.sort();\n for (let i = 0; i < 9; i++) {\n if (sortedArray[i] !== i+1) {\n return false;\n } \n };\n return true;\n }", "title": "" }, { "docid": "4e54aeb3e89d8bb2e98c8c3655c49fb2", "score": "0.67597526", "text": "function checkArit(arr){\n \n let aritDiff = arr[1] - arr[0];\n \n for (i = 0;i<arr.length-1;i++)\n {\n if(arr[i+1] - arr[i] !== aritDiff) return false;\n }\n \n return true;\n}", "title": "" }, { "docid": "6c526e2e9ba01c0ced3a611d2a63f6b6", "score": "0.6681142", "text": "function checkOrder(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i+1] && (arr[i+1] < arr[i])){\n return false;\n \n }\n\n }\n return true;\n }", "title": "" }, { "docid": "8ad16ff9e6aa57e3804e0f554b13483e", "score": "0.66629785", "text": "function isIntArray(arr) {\n var result = true;\n if (!arr){\n return false;\n }\n arr.forEach(function(item){\n if (isNaN(item) || !Number.isInteger(item)){\n result = false;\n }\n });\n return result;\n}", "title": "" }, { "docid": "a5c7b4c0fc2c121a9c5690d532261cfd", "score": "0.65349686", "text": "function ordenar(arr){\n\tfor(var i=0;i<arr.length;i++){\n\t\tif(arr[i]< arr[i+1]){\n\t\t\n\t\treturn false;\n\n\t\t\t}\n\t\n\t}\n\treturn true;\n\t\n}", "title": "" }, { "docid": "aa6915c3d5f57e16ea1b44d17b6dc149", "score": "0.6507856", "text": "function checkIncrement(sortedArray){\n let isIncrementingSequence = true;\n\n for(let i = 0; i < sortedArray.length -1; i++){\n if(sortedArray[i] + 1 !== sortedArray[i + 1]){\n return false;\n }\n }\n\n return isIncrementingSequence;\n}", "title": "" }, { "docid": "b1a43712bf63f744271ab384fb88634b", "score": "0.6452547", "text": "function check1(arr) {\n for (let i = 0; i < arr.length - 1; i++) {\n if (arr[i] > arr[i + 1]) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "adb0960c00885f8844a0fdf63f0f1a42", "score": "0.6435865", "text": "function check(arr) {\n for (let i = 0; i <= arr.length - 1; i++) {\n if (arr[i] > arr[i + 1]) return false\n }\n return true\n}", "title": "" }, { "docid": "f08e6b93ffaf3ad48f04bd1a48e8ba5c", "score": "0.63898456", "text": "function CheckArithmetic(userArray){\n const d = userArray[0] - userArray[1];\n let result = '';\n let i =2;\n \n if(userArray.length === 0){\n result = 0;\n }\n\n for(; i<userArray.length-1; i++){\n \n if(userArray[i] - userArray[i+1] == d){\n //i++;\n result = true;\n }else{\n result = false;\n }\n \n }\n return result;\n}", "title": "" }, { "docid": "48776fc6b336e382ae2fcbd833a14a7e", "score": "0.63608545", "text": "function isInorder(arr) {\n for(let i = 0; i < arr.length-1; i++) {\n if(arr[i] > arr[i+1]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "00500bc1f6e710a57721f1fdfb578ab8", "score": "0.6315319", "text": "function test(arr) {\n let len = arr.length;\n for (let i = 0; i <= len - 2; i++) {\n if (arr[i] + 1 !== arr[i + 1]) {\n return false;\n } \n }\n return true;\n}", "title": "" }, { "docid": "1e72ac20d54c7a0caa2e51c149214fee", "score": "0.62902075", "text": "function isValidSubsequence(array, sequence) {\n // Write your code here.\n if(sequence.length > array.length) return false\n\tlet arr = [];\n\tlet index;\n\tfor(let i = 0; i < sequence.length; i++) {\n\t\tindex = array.indexOf(sequence[i])\n\t\tif(index === -1) return false \n\t\tarr.push(index);\n\t\tarray.splice(index, 1);\n };\n\n\tif(arr.length){\n for (let i = 0; i < arr.length - 1; i++){\n if(arr[i] > arr[i+1]) {\n return false\n }\n }\n return true;\n\t}\n\treturn false\n}", "title": "" }, { "docid": "aeeedbbceceb2ca75bccd3e9f6aa6bea", "score": "0.62507874", "text": "function checkSort(arr) {\n for (var i = 1; i < arr.length-1-count; i++) {\n if (arr[i] < arr[i-1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "e1b62165df9fa5fc00ac1a0d13927c5f", "score": "0.6247406", "text": "function compareNumbers(arrayData){\n if(arrayData[index+1] === arrayData[index] + 1){\n return true;\n }else {\n return false;\n }\n}", "title": "" }, { "docid": "04ba2f842d7138fe14a1a10c00da316b", "score": "0.62346286", "text": "function check(arr){\n\n let status = 0;\n\n for ( let i = 0; i < arr.length -1 ; i++ ) {\n if(arr[i] > arr[i+1]) status++;\n }\n\n return status < 2;\n\n}", "title": "" }, { "docid": "cff88fc324125dbc3a93faba6a17af84", "score": "0.6231615", "text": "function inAscOrder(arr) {\n for(let i = 0; i < arr.length; i++) {\n if(arr[i] >= arr[i+1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a1402bed8a59a74147f98b25b7a6c4ac", "score": "0.6229466", "text": "function ValidSubsequence(array, seq) {\n\t// starting index\n\tlet arrIdx = 0;\n\tlet seqIdx = 0;\n\twhile (arrIdx < array.length && seqIdx < seq.length) {\n\t\t//compare array and sequence\n\t\tif (array[arrIdx] === seq[seqIdx]) {\n\t\t\tseqIdx++;\n\t\t}\n\t\t//regardless of if statement 0 1 move on\n\t\tarrIdx++;\n\t}\n\n\treturn seqIdx === seq.length;\n}", "title": "" }, { "docid": "37810bb5c9c30b03f9da8a396c3c8942", "score": "0.6174926", "text": "function linearOK(array) {\n if(!array) return false;\n\n for(var i = 0; i < array.length; i++) {\n if(isNumeric(array[i])) return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "f842160a42223beb670acc37b8ba234b", "score": "0.61727303", "text": "function isSorted (array) {\n // loop through all of the numbers in an array\n for (let i = 0; i < array.length; i++) {\n // if number - 1 is greater than number then the array is not sorted\n if (array[i - 1] > array[i]) {\n return false;\n }\n }\n // else, the array is sorted.\n return true;\n}", "title": "" }, { "docid": "5db7de5c7ca7f96dafc2c4faec5cbd18", "score": "0.6154645", "text": "function ArrayAdditionI(arr){\n\n arr.sort(function(a,b){return a-b});\n var max = arr.pop();\n \n for (var j = 1; j < arr.length; j++){\n var new_arr = arr.slice(j).concat(arr.slice(0,j));\n var sum =0;\n for (var i = 0; i < new_arr.length; i++){\n sum += new_arr[i];\n if (sum == max){\n return true;\n }\n }\n }\n return false; \n}", "title": "" }, { "docid": "4bd15cc5508f5962c1914b63d2b4f2b6", "score": "0.61476415", "text": "function isSorted(array) {\n for (let i = 0; i < array.length - 1; i++) {\n if (array[i] > array[i + 1]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "badcad32f17f743dd97e78d2eef17c7f", "score": "0.6117102", "text": "function containsOneThruNine(arr){\n return arr.length == 9 && arr.sort()\n .every((num, i) => num == i+1);\n}", "title": "" }, { "docid": "1ecef9b2457301596b9d3bdbaa530c0c", "score": "0.6113492", "text": "function arrayAddition(arr) {\n arr.sort(function(a, b) {\n return a - b\n });\n let largest = arr.pop();\n let counter = 0;\n\n for (let i = 0; i < arr.length; i++) {\n counter += arr[i];\n for (let j = 0; j < arr.length; j++) {\n if (i != j) {\n counter += arr[j];\n if (counter == largest) {\n return true;\n }\n }\n }\n for (let k = 0; k < arr.length; k++) {\n if (i != k) {\n counter -= arr[k];\n if (counter == largest) {\n return true;\n }\n }\n }\n counter = 0;\n }\n return false;\n}", "title": "" }, { "docid": "f71cc7d6d14ed2a1f8bac2469256a87a", "score": "0.6108454", "text": "function isArrayOfNumbersValid(array) {\n\n var isValid = true;\n\n if (array === null)\n isValid = false;\n else {\n\n if (array.length > 100)\n isValid = false;\n else {\n $.each(array, function (index, value) {\n if (value > 50000 || value < 1 || !Number.isInteger(parseInt(value))) {\n isValid = false;\n\n return isValid;\n }\n });\n }\n }\n\n return isValid;\n}", "title": "" }, { "docid": "467cb9af28d8ac6ffcde91dfd0c48911", "score": "0.60714537", "text": "function isSorted(a) {\n for(var i = 1; i < a.length; i++) {\n if(a[i - 1] > a[i]) {\n console.log(\"Permutated, but not sorted array:\");\n console.log(a);\n return false;\n }\n }\n console.log(\"Permutated, and correctly sorted array:\")\n console.log(a);\n return true;\n }", "title": "" }, { "docid": "0633eba94494048a83fbd04ada2ce754", "score": "0.6047271", "text": "function almostIncreasingSequence(sequence) {\n let invalidItemsCount = 0;\n \n for (let i = 1; i < sequence.length; i++) {\n if (sequence[i] <= sequence[i-1]) {\n invalidItemsCount++;\n if (invalidItemsCount > 1) return false;\n if (sequence[i] <= sequence[i-2] && sequence[i+1] <= sequence[i-1]) return false;\n }\n }\n \n return true;\n}", "title": "" }, { "docid": "e8d0a480f68b809ee306ea455d02f9ad", "score": "0.6043925", "text": "function isMonotonic(array){\n let isNonDec = true;\n\tlet isNonInc = true;\n\t\n\tfor(let i = 1; i < array.length; i++){\n\t\tif (array[i] < array[i - 1]) isNonDec = false;\n\t\tif (array[i] > array[i - 1]) isNonInc = false;\n\t}\n\t\n\treturn isNonDec || isNonInc;\n}", "title": "" }, { "docid": "6c4229c605391e2732513bf434aaaff1", "score": "0.6038504", "text": "function check2(arr) {\n for (let i = 0; i < arr.length - 1; i++) {\n if (arr[i] % 2 != 0 || arr[i] > arr[i + 1]) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "9c6b24a934092478d425faa2851d8b0b", "score": "0.60305625", "text": "function ArrayAddition(arr) {\n let target = arr.reduce((acc, item) => (acc < item ? item : acc), 0);\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] !== target) sum += arr[i];\n }\n return sum >= target ? \"true\" : \"false\";\n}", "title": "" }, { "docid": "bd7198c6db4bf958b067cdd5b91bfbd5", "score": "0.60057503", "text": "function isAscending(arr) {\n return arr.every(function (x, i) {\n return i === 0 || x > arr[i - 1];\n });\n}", "title": "" }, { "docid": "fe665b9b706bcba842f552e153b8dcbd", "score": "0.6000349", "text": "function inAscOrder(arr) {\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] <= arr[i-1]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "b52908e8bf1757d8b3c5934db944713d", "score": "0.5990436", "text": "function Superincreasing(arr) { \n var sum = 0;\n //loop through each number in array\n for(var i = 0; i < arr.length; i++){\n \t//if anytime the number is less than current sum, return false\n \tif(arr[i] <= sum){\n \treturn false;\n }\n //add current number to sum\n sum += arr[i];\n }\n return true; \n}", "title": "" }, { "docid": "e8ec31803f71e0d67840663f6cc3b5ba", "score": "0.5981461", "text": "function ArrayAdditionI(arr) {\n arr = arr.sort(function(a,b) {return a-b;});\n var max = arr.pop();\n\n function findSolution() {\n function search(sum, i) {\n if(sum == max) {\n return true;\n } else if (sum > max || i === arr.length) {\n return false;\n } else {\n return search(sum + arr[i], i+1) || search(sum, i+1);\n }\n\n }\n return search(0,0);\n }\n return findSolution() || false;\n}", "title": "" }, { "docid": "fe85d54d0cd5fdb47e860613a366329e", "score": "0.59418476", "text": "function isSorted(arr) {\n if(arr.length !== ARRAY_SIZE){\n return false\n }\n for (let idx = 0; idx < arr.length - 1; idx++) {\n if (arr[idx] > arr[idx + 1]) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "5212432d3231507b49cb19e48188c925", "score": "0.59385246", "text": "function isNice(arr){\n if (arr.length === 0) return false;\n return arr.every(item => arr.includes(item - 1) || arr.includes(item + 1))\n}", "title": "" }, { "docid": "4ac6250c8ccbeee0f564ae17cb360f33", "score": "0.5935593", "text": "function isValidSubsequence(array, sequence) {\n\tif (sequence.length > array.length) return false;\n\tlet counter = 0;\n\tfor (let i = 0; i < array.length; i++) {\n if (counter === array.length) break;\n\t\tif (array[i] === sequence[counter]) counter++;\n\t}\n\treturn counter === sequence.length;\n}", "title": "" }, { "docid": "5b6b83b2b05c41cddcd648ce5b33eb9b", "score": "0.59273857", "text": "function isSorted(arr) {\n for (let i = 1; i < arr.length; i++){\n if (arr[i - 1] > arr[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "7da88e2e556655f8ad5f527cdaac49f5", "score": "0.5927226", "text": "function almostIncreasingSequence(sequence)\n{\n var count = 0;\n\n for(var i = 0; i < sequence.length; i++)\n {\n if(sequence[i] <= sequence[i - 1])\n {\n count++;\n if(sequence[i] <= sequence[i-2] && sequence[i+1] <= sequence[i-1])\n {\n return false;\n }\n }\n }\n return count <= 1;\n}", "title": "" }, { "docid": "f0e2e714c9dbb3180a2184c13d4cf33c", "score": "0.5913127", "text": "function checkMyArr(a,b){\r\n if (a>b) {\r\n return 1;\r\n } else if (a<b) {\r\n return -1;\r\n } else{\r\n return 0;\r\n }\r\n}", "title": "" }, { "docid": "d2c150c9b4320983e58b92a90c4425d7", "score": "0.58989114", "text": "function isValidSubsequence(array, sequence) {\n\t// Write your code here.\n\t let sequenceIterator = 0;\n\t \n\t for (const num of array) {\n\t\t //Stop searching through the array\n\t\t if (sequenceIterator === sequence.length) {\n\t\t\t break;\n\t\t }\n\t\t \n\t\t if (num === sequence[sequenceIterator]) {\n\t\t\t sequenceIterator++;\n\t\t }\n\t }\n\t \n\t return sequenceIterator === sequence.length;\n }", "title": "" }, { "docid": "c9d133418560c5cb987baad03ac28fb0", "score": "0.58929265", "text": "function isInertial(arr) {\n arr = arr.sort((a,b) => b - a);\n if(Math.abs(arr[0]) % 2 === 1 || arr.length <= 1) { return false; }\n let temp = [], idx = 0;\n for(let i = 1; i < arr.length; i++) {\n if(Math.abs(arr[i]) % 2 === 0) {\n temp = arr.slice(1, i);\n idx = i;\n break;\n }\n }\n if(idx === 0) { return true; }\n if(!temp.length) { return false;}\n for(let i = idx; i < arr.length; i++)\n if(Math.abs(arr[i]) % 2 === 1)\n return false;\n return true;\n}", "title": "" }, { "docid": "3b1b7c29ac39f315180c6122d5d98bb8", "score": "0.5890378", "text": "function check(array, num){\r\n var i = 0;\r\n while (i < array.length){\r\n if (num == array[i]){\r\n return true;\r\n }\r\n i++;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "f2cbdd0edcd5ba47ac59b3f3ffbedda5", "score": "0.5870254", "text": "function almostIncreasingSequence(arr){\n\n}", "title": "" }, { "docid": "d26fbc04b658e539188101c7a612e711", "score": "0.5869001", "text": "function isValidSubsequence(array,sequence) {\n let sequenceIndex = 0; \n for (const value of array) {\n if (sequenceIndex === sequence.length) break;\n if (sequence[sequenceIndex] === value) sequenceIndex++;\n }\n return sequenceIndex === sequence.length;\n}", "title": "" }, { "docid": "0683cb4b271e332441a286dab5f32461", "score": "0.58648163", "text": "function isNumbersOnly(array) {\n if(array.every((element) => element >= 0 && element < 9)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "4c2f3cd83d7c66932d8e15711e18049e", "score": "0.5864672", "text": "function isSorted (array) {\n for (let i = 0; i < array.length; i++) {\n if (array[i - 1] > array[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "22c21b600cce2ba8509dc25cc8698f61", "score": "0.5861684", "text": "function isMonotonic(array) {\n\t// Write your code here.\n\tvar inc = 0;\n\tvar dec = 0;\n\tfor (var i = 0; i < array.length - 1; i++) {\n\t\tif (array[i] < array[i + 1]) {\n\t\t\tinc++;\n\t\t} else if (array[i] === array[i + 1]) {\n\t\t\tinc++;\n\t\t\tdec++;\n\t\t} else if (array[i] > array[i + 1]) {\n\t\t\tdec++;\n\t\t}\n\t}\n\tif (dec >= array.length - 1 || inc >= array.length - 1) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "9bce444e301de6b08263f518953f5956", "score": "0.58591557", "text": "function isValidSubsequence(array, sequence) { \n let arrayIndex = 0; \n let sequenceIndex = 0; \n while (arrayIndex < array.length && sequenceIndex < sequence.length) {\n if(array[arrayIndex] === sequence[sequenceIndex]) \n sequenceIndex++;\n arrayIndex++;\n }\n return sequenceIndex === sequence.length;\n }", "title": "" }, { "docid": "fba92ac67dff4f2d9aa1b793fa66ad45", "score": "0.5857998", "text": "function isUniform(arr) {\n var start = arr[0];\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] !== start) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5918d1daf1180ec6541c61456df127da", "score": "0.5851936", "text": "function isSorted(arr) {\n if (arr.length < 2){ return true; }\n for (let i = 1; i < arr.length; i++){\n if (arr[i-1] > arr[i]) { return false; }\n }\n return true;\n}", "title": "" }, { "docid": "e490277c5438543accc3ddd0ba7bd24a", "score": "0.5850608", "text": "function isInorder(arr) {\n function loop(head, tail) {\n if (!tail.length) return true\n if (tail[0] <= head) return false\n return loop(tail[0], tail.slice(1))\n }\n return loop(arr[0], arr.slice(1))\n}", "title": "" }, { "docid": "156bd05f958ff8b2cf5d0a10b25eb578", "score": "0.584316", "text": "function almostIncreasingSequence(seq) {\n var bad = 0\n for(var i=0;i<seq.length;i++) if(seq[i]<=seq[i-1]) {\n bad++\n if(bad>1) return false\n if(seq[i]<=seq[i-2]&&seq[i+1]<=seq[i-1]) return false\n }\n\n return bad\n}", "title": "" }, { "docid": "1e96f1a36d0ad549134f9bac181a0567", "score": "0.5837343", "text": "function nextBiggerNumber(arr) {\n const arrOp = [];\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n let foundVal = false;\n if (arr[j] > arr[i]) {\n foundVal = true;\n arrOp.push(j - i);\n break;\n }\n if (!foundVal && j === arr.length - 1) arrOp.push(0);\n }\n }\n arrOp.push(0);\n return arrOp;\n}", "title": "" }, { "docid": "ea39acd1fa7f29af38c4eb1ecd5fa967", "score": "0.58351636", "text": "function allNumbersShouldBeinRange(arr){\n // console.log(array.flattenDepth(arr))\n var checkArray=array.flattenDepth(arr);\n for(var i=0;i<checkArray.length;i++){\n if(checkArray[i]>0 && checkArray[i]<10)\n isValid=true;\n else{\n console.log(\"Numbers is not in range\")\n return false;\n }\n }\n return isValid\n}", "title": "" }, { "docid": "23f8f2323a43bbf8ff1949979c190629", "score": "0.5828911", "text": "function tentukanDeretAritmatika(arr) {\n// return arr.length\nvar selisih=arr[1]-arr[0]\n\nfor (var i=0; i < arr.length-1;i++){\n\n if (arr[i+1]-arr[i]!==selisih){\n return false\n } \n else { \n } \n }\n return true\n}", "title": "" }, { "docid": "0dae1188af71b615e47fbacd007e7d63", "score": "0.5828414", "text": "function isPermutation(arr) {\n return arr\n .sort((a,b) => b < a)\n .every((v,i) => v === i + 1);\n}", "title": "" }, { "docid": "dac1cc966650818c776b7509985b4436", "score": "0.58186686", "text": "function isSorted (array) {\n // declare a for loop\n for (let i = 0; i < array.length; i++) {\n // if an iteration minus 1 is greater than the iteration return false\n // if this is sorted than it cannot happen\n // however, if it is sorted then it can happen\n if (array[i - 1] > array[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "ff5ded7a84cb750e66be88958c76395a", "score": "0.5815809", "text": "function checkPositive(arr) {\n\nreturn arr.every(function(curr) {\n return curr >= 0; \n});\n\n}", "title": "" }, { "docid": "a87231500582ff8bfd6165c45e63677d", "score": "0.5812283", "text": "function isValidSubsequence(array, sequence) {\n\tlet validator = 0;\n\tfor(let i = 0; i<array.length;i++) {\n\t\tif(array[i]===sequence[validator])\n\t\t\tvalidator ++;\n\t\tif(validator >= sequence.length)\n\t\t\treturn true;\n\t\t\t\n\t}\n\treturn false;\n // Write your code here.\n}", "title": "" }, { "docid": "b45877f2a8f7f423574ea25e87653883", "score": "0.58027095", "text": "function compare(int){\n\t\t//console.log(int);\n\t\tif(int === arr.length-1){\n\t\t\tfor(var i = 0; i < arr.length; i++){\n\t\t\t\tif(i !== int){\n\t\t\t\t\tcheck( i, int);\n\t\t\t\t}\n\t\t\t}\n\t\t}else {\n\t\t\tfor(var o = 0; o < arr.length; o++){\n\t\t\t\tif(o !== int){\n\t\t\t\t\tcheck( o, int);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcompare(int+1);\n\t\t}\n\n\t}", "title": "" }, { "docid": "bdcf95e3bcd7b64817467c577c4592fe", "score": "0.58013195", "text": "function divisibleBy10(array) {\n return array.some(number => number % 10 === 0)\n}", "title": "" }, { "docid": "c0a37beaa10e5823bff4fea2e2bd329c", "score": "0.5780801", "text": "function isNice(arr) {\n return arr.filter(e => arr.includes(e - 1) || arr.includes(e + 1))\n .length === arr.length && arr.length !== 0;\n}", "title": "" }, { "docid": "3df484a043c5ea64a9aedad479c43cda", "score": "0.57788163", "text": "function checkArrayRhythms(array, minDuration) {\n\t\tfor(var i=0; i<array.length; i++) {\n\t\t\tif( array[i] % minDuration !== 0)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "4b4b568723ec3e0765ae6216f25703a9", "score": "0.5775993", "text": "function isValidSubsequence(array, sequence) {\n let pointer = 0;\n for(let i=0; i<array.length; i++) {\n if(array[i] === sequence[pointer]) pointer++;\n }\n return pointer === sequence.length;\n }", "title": "" }, { "docid": "d293faa98593c84abf6860b47baace4b", "score": "0.5757476", "text": "function check(arr, number) {\n // Ja koristam prethodnata funkcija kade sto go naogjame indeksot na koj sto se naogja elementot ili ako ne go najdeme -1\n return search(arr, number) !== -1;\n}", "title": "" }, { "docid": "7476226be7dd9311227ab37a348a08da", "score": "0.5755608", "text": "function has23(array){\n if((array[0]==2)||(array[1]==2)||(array[0]==3)||(array[1]==3)){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "7155bd9837a63d600e6e8c53e0340b64", "score": "0.57526684", "text": "function has23(array){\n console.log(array);\n var two = array.indexOf(2);\n var three = array.indexOf(3);\n if(two === 0 || two === 1 || three === 0 || three === 1){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "50c0dff84353d5944487b9f1f727a13f", "score": "0.57396346", "text": "function arrayAddition(arr) {\n var largestNum = Math.max.apply(Math, arr);\n var indexOfLargest = arr.indexOf(largestNum);\n console.log('largest ', largestNum);\n console.log('index ', indexOfLargest);\n arr.splice(indexOfLargest,1);\n console.log('arr after splice ', arr);\n var total = 0;\n for (var i = 0; i < arr.length; i++) {\n total += arr[i];\n for (var j = 0; j < arr.length; j++) {\n if (j !== i) {\n total += arr[j];\n if (total === largestNum) return true; \n }\n }\n for (var k = 0; k < arr.length; k++) {\n if (k !== i) {\n total -= arr[k];\n if (total === largestNum) return true;\n }\n }\n total = 0;\n }\n return false;\n}", "title": "" }, { "docid": "78aae0171700f1a372f5a4b256bb0807", "score": "0.5732825", "text": "function isValidSubsequence(array, sequence) {\n // if the sequence is is longer than the array, return false\n\tif (sequence.length > array.length)\n\t\treturn false\n\t// loop through array and increment sequence pointer if element matches\n\tlet seqPointer = 0\n\tfor (let i = 0; i <= array.length; i++) {\n\t\tif (seqPointer === sequence.length)\n\t\t\treturn true\n\t\tif (sequence[seqPointer] === array[i])\n\t\t\tseqPointer++\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5a46f9a62419f3e766b559dc55233081", "score": "0.57276833", "text": "function ArrayAddition(arr) { \n\n var largest = arr.sort(function(a,b){return a-b}).pop();\n var sum = 0;\n \n for (i=0;i<arr.length;i++) {\n sum += arr[i];\n if (sum===largest) {\n return true;\n }\n \n for (j=0;j<arr.length;j++) {\n if (j!==i) {\n sum += arr[j];\n }\n if (sum===largest) {\n return true;\n }\n }\n for (k=0;k<arr.length;k++) {\n if (k!==i) {\n sum -= arr[k];\n }\n if (sum===largest) {\n return true;\n }\n }\n sum = 0;\n }\n \n return false; \n}", "title": "" }, { "docid": "5249a29d040d00591e24877f2780e9c8", "score": "0.57192594", "text": "function isSortedInAscendingOrder(array) {\n for (var i = 1; i < array.length; i++) {\n if (array[i] < array[i - 1])\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "4f4a5ce2b9e7d82715adcc8336f2868c", "score": "0.5716964", "text": "function isToeplitz(arr) {\n\t/**\n\t@param arr: integer[][]\n\t@return: boolean\n\t*/\n\n for (let i = 1; i < arr.length; i++) {\n for (let j = 1; j < arr[i].length; j++) {\n let idxDiff = j-i, currVal = arr[i][j];\n\n if (arr[i-1][j-1] !== arr[i][j]) return false\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "ee7dee5a79202cb1a61c03709494f1f9", "score": "0.5698213", "text": "function isValidSubsequence(array, sequence){\n let arrayIdx = 0;\n let sequenceIdx = 0;\n while((arrayIdx < array.length) && (sequenceIdx < sequence.length)){\n if(array[arrayIdx] == sequence[sequenceIdx]) sequenceIdx++;\n arrayIdx++;\n }\n return sequenceIdx == sequence.length;\n}", "title": "" }, { "docid": "b356c855121f7144383f4847407140e4", "score": "0.5689162", "text": "function isValidSubsequence(array, sequence) {\r\n let seqIdx = 0; // índice da sequencia\r\n // varro o array de entrada\r\n for (const a of array) {\r\n // se avacei na sequencia até o fim, saio do loop, pois a sequencia foi encontrada\r\n if (seqIdx === sequence.length) break;\r\n else { // senão, continuo procurando\r\n // se encontrei, avanço para procurar o próximo na sequencia\r\n if (a === sequence[seqIdx]) seqIdx++;\r\n }\r\n }\r\n return (seqIdx === sequence.length);\r\n}", "title": "" }, { "docid": "3fd08e4dbfad727d7225ded5194478a4", "score": "0.5678078", "text": "function missingInteger(arr){\n\n\tvar count=0;\n\n\tfor(i=0;i<arr.length-1;i++){\n\n\t\tif(arr[i+1]-arr[i]!==1){\n\n\t\t\tcount++;\n\t\t}\n\t}\n\n\treturn count;\n}", "title": "" }, { "docid": "9240be21c68b71789bd0d0a866aa93ef", "score": "0.5674168", "text": "function isIncluded(arr, val) {\n var i;\n for (i = 0; i < arr.length; i += 1) {\n if (arr[i] > val) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "7456d1f20fff3bdefb3aeba75438fc0f", "score": "0.56727165", "text": "function checkArrayType (arg) {\r\n var result = true;\r\n arg.forEach(function(element) {\r\n if (typeof element !== \"number\" ) {\r\n console.log(\"This not a numbers array\");\r\n result = false;\r\n return result;\r\n }\r\n }\r\n )\r\n return result;\r\n}", "title": "" }, { "docid": "e74b325255a1c3cba38dce6589be7322", "score": "0.56715614", "text": "function checkPositive(arr) {\n // Add your code below this line\n\n return arr.every(n => n > 0);\n // Add your code above this line\n}", "title": "" }, { "docid": "9ba4c3de5a4e89e6cf720cd87998d5b6", "score": "0.5671179", "text": "function has23(array){\n if(array[0]==2 || array[0]==3){\n return true;\n }\n if(array[1]==2 || array[1]==3){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "aa3ff8449f52e14032253620a4767ff1", "score": "0.5658972", "text": "function isValidSubsequence(array, sequence) {\n let arrIdx = 0;\n let seqIdx = 0;\n\n const arrLen = array.length;\n const seqLen = sequence.length;\n\n while (arrIdx < arrLen && seqIdx < seqLen) {\n if (array[arrIdx] === sequence[seqIdx]) seqIdx++;\n arrIdx++;\n }\n return seqIdx === seqLen;\n}", "title": "" }, { "docid": "225bc12101f440fe88cc5c7bd2cc659d", "score": "0.5657582", "text": "function isValidSubsequenceA(array, sequence) {\n let aIdx = 0;\n let sIdx = 0;\n\n while (aIdx < array.length && sIdx < sequence.length) {\n let arrVal = array[aIdx];\n let seqVal = sequence[sIdx];\n if (arrVal === seqVal) sIdx++;\n aIdx++;\n }\n if (sIdx === sequence.length) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "a5f0850713614a1972a84ee7c4ce2e9e", "score": "0.56446797", "text": "function isUniform(array) {\n let comp = array[0];\n for (i = 1; i < array.length; i++) {\n if (array[i] !== comp) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "4eb995638f33e36cb49e2f4d1e0b417c", "score": "0.56443954", "text": "function checkPositive(arr) {\n return arr.every(value => value > 0) \n \n}", "title": "" }, { "docid": "34397bb923bddd0d3fee4a2e71b49968", "score": "0.5641057", "text": "function isSumBiggerThan16(array){\n let sum=0;\n array.forEach(element => {\n sum+=element;\n });\n return sum > 16;\n}", "title": "" }, { "docid": "bcff71271fb0b9ad43091f878db019ab", "score": "0.56229955", "text": "function almostIncreasingSequence(sequence) {\n let found = false;\n for (let i = 0; i < sequence.length; i++) {\n if (sequence[i] <= sequence[i - 1]) {\n if (found) {\n return false;\n }\n found = true;\n\n if (i === 1 || i + 1 === sequence.length) {\n continue;\n }\n else if (sequence[i] > sequence[i - 2]) {\n sequence[i - 1] = sequence[i - 2];\n }\n else if (sequence[i - 1] >= sequence[i + 1]) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "69bed175ae789fdac23296249de02cee", "score": "0.5621021", "text": "function checkPositive(arr) {\n return arr.every(x => x > 0);\n}", "title": "" }, { "docid": "f0ac0025308bba96a1fbded1f0e25859", "score": "0.5620091", "text": "function tentukanDeretAritmatika(arr) {\n // you can only write your code here!\n for (var i=0; i<arr.length; i++){\n return arr[i+1] - arr[i] === arr[arr.length-1] - arr[arr.length-2];\n }\n}", "title": "" }, { "docid": "f0ac0025308bba96a1fbded1f0e25859", "score": "0.5620091", "text": "function tentukanDeretAritmatika(arr) {\n // you can only write your code here!\n for (var i=0; i<arr.length; i++){\n return arr[i+1] - arr[i] === arr[arr.length-1] - arr[arr.length-2];\n }\n}", "title": "" }, { "docid": "d634a17235e43086222409df596e1528", "score": "0.56196815", "text": "function almostIncreasingSequence(sequence) {\n if(sequence.length<=2)\n return true;\n var i=0;\n var removed=false;\n do{\n if(sequence[i+1]<=sequence[i]){\n if(removed)\n return false;\n if(i===0){\n sequence.splice(0,1);\n removed=true;\n i--;\n } \n else if (sequence[i-1]<sequence[i+1] && i!==0){\n sequence.splice(i,1);\n removed=true; \n i--;\n }\n else{\n sequence.splice(i+1,1);\n removed=true;\n i--;\n }\n }\n i++;\n } while(i<sequence.length-1);\n return true;\n}", "title": "" }, { "docid": "3d5e623008bf77eda47751cac669b8ab", "score": "0.5613889", "text": "function inputIsValid(input, i) {\n var positionsValid = true;\n if (input[i + 1] > input.length || input[i + 2] > input.length || input[i + 3] > input.length) {\n console.log(\"Error: illegal arrayposition\");\n positionsValid = false;\n }\n return positionsValid;\n}", "title": "" }, { "docid": "b274adb28ff6914304b29174c86f5c49", "score": "0.56127775", "text": "function hasTriangle(arr) {\n const arrLen = arr.length;\n if (arrLen < 3) return 0;\n\n // sorted array in increasing order\n // that means arr[i+2] > arr[i+1] and arr[i+2] > arr[i]\n // that means arr[i + 1] + arr[i + 2] > arr[i] is always true\n // that means arr[i] + arr[i + 2] > arr[i + 1] is always true\n arr = arr.sort((x, y) => x - y);\n for (let i = 0; i < arrLen - 2; i++) {\n if (arr[i] + arr[i + 1] > arr[i + 2]) return 1;\n }\n return 0;\n}", "title": "" }, { "docid": "fb4a74947f34245abdef10db056724bd", "score": "0.5602598", "text": "function oneIsLessThan(array, n){\n\t\tfor(var i = 0; i < array.length; i++){\n\t\t\tif(array[i] < n){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "cb29651c3f6e74354e1d25e383bc0519", "score": "0.5593202", "text": "function integers(array){\n return array.filter(function(element){\n return element % 1 == 0;\n });\n}", "title": "" }, { "docid": "86c3ece8fd3eb3f62c444c301cc753a8", "score": "0.55931294", "text": "function isUniform(arr){\nvar first=arr[0];\nfor(i=1;i<arr.length;i++){\n if(arr[i] !==first){\n return false;\n}\n} \nreturn true; \n}", "title": "" }, { "docid": "c6bdcf11695f9b62ec6fc2476284ce40", "score": "0.55913895", "text": "function checkSadNumber(sequenceArray){\n let isSadNumber = false;\n for (var i = 0; i < sequenceArray.length; i++) {\n if(i === sequenceArray.length-1){\n break;\n }\n if(sequenceArray[i] === sequenceArray[sequenceArray.length-1] && sequenceArray.length > 2){\n isSadNumber = true;\n break;\n }\n }\n return isSadNumber;\n}", "title": "" }, { "docid": "697180afe0a6212eb1dba6e3c18d1b7e", "score": "0.55899423", "text": "missing(arr) {\n\t\t\tvar arrOfNums = [];\n\t\t\tfor (var i = 1; i <= Math.max(...arr); i++) {\n\t\t\t\tarrOfNums.push(i);\n\t\t\t}\n\t\t\tvar missing = [];\n\t\t\tarr.sort((a, b) => a > b);\n\t\t\tfor (var i = 0; i < Math.max(...arr); i++) {\n\t\t\t\tif (!arr.includes(arrOfNums[i])) {\n\t\t\t\t\tmissing.push(arrOfNums[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (missing.length === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn missing;\n\t\t}", "title": "" }, { "docid": "4b8cbf068d921f3fb9676f471643bbb5", "score": "0.5589673", "text": "function isValidArrayIndex(val){var n=parseFloat(String(val));return n >= 0 && Math.floor(n) === n && isFinite(val);}", "title": "" }, { "docid": "679e7146f328616c75b907a66e6f7426", "score": "0.5582862", "text": "function testit(arr){\n let sequence = [arr];\n while (arr.some(Boolean)) {\n arr = arr.map(x => x < 3 ? 0 : x & 1 ? 3*x + 1 : x >> 1);\n sequence.push(arr);\n }\n return sequence.map(n => n.map(v => v ? v % 10 : '.').join`|`).join`\\n`;\n}", "title": "" }, { "docid": "3993882d381f5701d4b1b5f95e3735ee", "score": "0.5577827", "text": "function isInvalid(ary) {\n return ary.slice().sort().join('').match(/([1-9])\\1+/g);\n }", "title": "" }, { "docid": "611eb43d1ef31abb6965b72670a52792", "score": "0.55677205", "text": "function sumGreaterThan16(array) {\n const length = 16;\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n return array.reduce(reducer) > length;\n}", "title": "" } ]
317241fd7bae5dfb389fe2884731399c
this comment is to test git on new hp laptop
[ { "docid": "c85ac0c160f60841444e3e15fa4a7a84", "score": "0.0", "text": "function App() {\n return (\n <Router>\n <div className=\"App\">\n <Navbarr />\n <Switch> \n <Route path=\"/\" exact component={About} />\n <Route path=\"/projects/new\" component={Projects} />\n <Route path=\"/bugs/new\" component={Bugs} />\n <Route path=\"/users/new\" component={Users} />\n <Route path =\"/projectreports/new\" component={ProjectsReports} />\n <Route path=\"/bugreports/new\" component ={BugReports} />\n <Route path=\"/userreports/new\" component={UserReports} />\n <Route path='/editprojects/:id' component={ EditProjects } />\n\n </Switch>\n\n\n \n \n </div>\n </Router>\n );\n}", "title": "" } ]
[ { "docid": "7fbecb55120e96ccdec7a4b68d4681d0", "score": "0.6565653", "text": "function checkForGit(url) {\n\turl = stripTrailingSlash(url);\n\t\n\t//big ole list\n\tvar gitURL = url + \"/.git\";\n var headURL = url + \"/.git/HEAD\";\n var configURL = url + \"/.git/config\";\n\tvar ignoreURL = url + \"/.gitignore\";\n\tvar excludeURL = url + \"/.git/info/exclude\";\n\tvar descriptionURL = url + \"/.git/description\";\n\tvar commitMsgURL = url + \"/.git/COMMIT_EDITMSG\";\n \n\n //check that we got both a HTTP200 and something that looks like a HEAD file.\n if (upAndHas(headURL, \"ref: \")) {\n //heyyyy we found a git repo (probably). Let's test config file sanity\n //I hate these nested ifs but it's good not to run more requests than we have to\n if (upAndHas(configURL, \"[core]\")) {\n //now we're talking. This is highly likely to be a repo\n\t\t\t//add the repo, and us upAndHas to tell us whether it's publically browsable\n addSite(gitURL, upAndHas(gitURL, \"\"), getOrNone(ignoreURL), getOrNone(commitMsgURL), getOrNone(configURL), getOrNone(descriptionURL), getOrNone(excludeURL));\n }\n }\n}", "title": "" }, { "docid": "23491db71854150f3b2d0cfccf6bd60b", "score": "0.6247741", "text": "function checkGit() {\n return new Promise((resolve, reject) => {\n const child = spawn(\"git\", [\"status\"]);\n\n child.stdout.on(\"data\", data => {\n if (!~data.toString().indexOf(\"working tree clean\")) {\n throw new Error(\"请先提交尚未提交的修改\");\n }\n });\n\n child.stderr.on(\"data\", data => {\n console.error(data);\n });\n\n child.on(\"close\", code => {\n resolve();\n });\n });\n }", "title": "" }, { "docid": "f1e120bbdb4fabacde872a801cc7cbaa", "score": "0.6136018", "text": "function openGit() {\n\t\twindow.open(info[profileInformation[3]]);\n\t}", "title": "" }, { "docid": "fe2eecd9127973e75928fdcac13e646a", "score": "0.5954664", "text": "function initRepository() {\n pushd(BUILD_DIR);\n rm('-rf', './.git');\n exec('git init');\n exec('git remote add origin git@github.com:SchizoDuckie/DuckieTV-Cordova.git');\n exec('git remote add duckietv git@github.com:DuckieTV/DuckieTV.git');\n exec('git add .');\n exec('git commit -m \"Android deployment.\"');\n popd();\n}", "title": "" }, { "docid": "1cc1d1bc95c0983b868ec5930904b713", "score": "0.59545845", "text": "gitInit() {\n log(`⌛️ initialize git repository in ${this.path}`) \n return new Promise((resolve, reject) => {\n cmd({\n script: `\n cd ${this.path}\n git init\n git add .\n git commit -m \"First 🚀 of ${this.name}\"\n git remote add clever git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/${this.id}.git\n `,\n failure: error => reject(error),\n success: out => {\n log(`🙂 git repository initialized`)\n resolve(out)\n }\n })\n })\n }", "title": "" }, { "docid": "bf387958df9be9dc510fedfe04c1697a", "score": "0.5940589", "text": "function cloneRepo(name,git){\n command= `git clone ${site}${name}/${git} students/${name}/${git}`;\n exec(command, function (err, stdout, stderr) {\n console.log(stdout);\n console.log(stderr);\n });\n }", "title": "" }, { "docid": "be3559a010478c4edde615c9845dca15", "score": "0.5923479", "text": "function fetch_git_branches() {\n\n }", "title": "" }, { "docid": "75f028fd1836df450a58fa4a9c369904", "score": "0.589977", "text": "function testClone(){\n reponames.forEach(function(repo) {\n var list = studentList.map(function(student) {\n return `git clone ${site}${student}/${repo} ${session}/${student}/${repo}` \n })\n urlList = urlList.concat(list);\n command = urlList.join(' && ');\n })\n\n exec(command, function (err, stdout, stderr) {\n console.log(stdout);\n console.log(stderr);\n });\n }", "title": "" }, { "docid": "6b9d47d691f8711344e9c917107f3137", "score": "0.5858665", "text": "isNeedToInitGit() {\n return hasGit() && !isGitProject(this.context);\n }", "title": "" }, { "docid": "b99ebde0a477605ae4bc322a8f2c4c0f", "score": "0.579372", "text": "function git (rawGitArgs, environment) {\n if (environment.debug === true) {\n console.error('COMMITIZEN DEBUG: No cz friendly config was detected. I looked for .czrc, .cz.json, or czConfig in package.json.');\n } else {\n var vanillaGitArgs = [\"commit\"].concat(rawGitArgs);\n\n var child = childProcess.spawn('git', vanillaGitArgs, {\n stdio: 'inherit'\n });\n\n child.on('error', function (e, code) {\n console.error(e);\n throw e;\n });\n }\n}", "title": "" }, { "docid": "a7fb06d69e5ee0a70b317d338af823a2", "score": "0.57375765", "text": "validate(cb){\n run('git --version', (results) => {\n if(results.success && results.stdout.match(/git version \\d+\\.\\d+\\.\\d+/i)){\n this.hasGit = true;\n return cb(true);\n }else{\n this.hasGit = false;\n return cb(false);\n }\n })\n }", "title": "" }, { "docid": "b051802bf3500e1e8357bc56600b681c", "score": "0.56758094", "text": "async function detectGit(url) {\n let location = urlJoin(url, '/info/refs?service=git-upload-pack');\n\n // XXX: get is used so we correctly follow redirects...\n let req = request.get(location);\n\n // Trick github/etc... Into thinking we are are a git client.\n req.set('User-Agent', 'git/2.0.1');\n req.buffer(false);\n\n let res = await req.end();\n if (res.error) throw res.error;\n if (\n res.headers['content-type'] &&\n res.headers['content-type'].indexOf('x-git') !== -1\n ) {\n // XXX: Because this is a \"get\" request we abort here to ensure we only\n // fetch the data we needed then stop closely after...\n res.req.abort();\n return { type: 'git', url: location };\n }\n throw new Error(url + ' is not a git url');\n}", "title": "" }, { "docid": "4b830115d47d6894ac359e4ed45ba34e", "score": "0.5670741", "text": "function gitTrack () {\n var remoteBranch = options.remoteBranch || options.branch;\n if (shelljs.exec('git config branch.' + options.branch + '.remote', {silent: true}).output.replace(/\\n/g, '') !== remoteName) {\n execWrap('git branch --set-upstream-to=' + remoteName + '/' + remoteBranch + ' ' + options.branch);\n }\n }", "title": "" }, { "docid": "bb164c4d8ae116e960c87145b8e0a2d3", "score": "0.566311", "text": "getGitInfo() {\n\t\treturn \"git rev-parse --abbrev-ref HEAD && git log -1 --pretty=\\\"format:%h %ci\\\" --no-merges\";\n }", "title": "" }, { "docid": "61d315a6e8541a0a84042c788e116fc1", "score": "0.5634308", "text": "function safeCheckout () {\n execWrap('git symbolic-ref HEAD refs/heads/' + options.branch);\n }", "title": "" }, { "docid": "bd1bba9f2296a4a7b882f7f589adc8ee", "score": "0.56317174", "text": "function gitInit(cb){\n git.init({cwd: 'dist'}, cb);\n}", "title": "" }, { "docid": "7b62638d9fdbfe1766c7e4d266f3379d", "score": "0.5588114", "text": "function gitUrl (thing) {\n return unemptyString(thing) && /^git\\+(ssh|https?):\\/\\/.+/.test(thing);\n }", "title": "" }, { "docid": "b89e83be2cf323138645d01b14565744", "score": "0.55651605", "text": "function gitReset () {\n execWrap('git reset', false);\n }", "title": "" }, { "docid": "e003c3d80e4a749ca0897bc296ffdf5c", "score": "0.5488168", "text": "function gitcomit(cb) {\n run('git commit -m \"apply latest changes\"', function (err, stdout, stderr) {\n console.log(stdout);\n console.log(stderr);\n cb(err);\n });\n}", "title": "" }, { "docid": "1a375623364c0b16d8ad6454b323f1ee", "score": "0.54545367", "text": "showCommit() {\n return __awaiter(this, void 0, void 0, function* () {\n let { nvim } = this;\n let bufnr = yield nvim.call('bufnr', '%');\n let root = yield this.resolveGitRoot(bufnr);\n if (!root) {\n coc_nvim_1.workspace.showMessage(`not a git repository.`, 'warning');\n return;\n }\n let fullpath = yield nvim.eval('expand(\"%:p\")');\n let relpath = path_1.default.relative(root, fullpath);\n let res = yield this.safeRun(['ls-files', '--', relpath], root);\n if (!res.length) {\n coc_nvim_1.workspace.showMessage(`\"${relpath}\" not indexed.`, 'warning');\n return;\n }\n let line = yield nvim.eval('line(\".\")');\n let args = ['--no-pager', 'blame', '-l', '--root', '-t', `-L${line},${line}`, relpath];\n let output = yield util_1.spawnCommand('git', args, root);\n output = output.trim();\n if (!output.length)\n return;\n let commit = output.match(/^\\S+/)[0];\n if (/^0+$/.test(commit)) {\n coc_nvim_1.workspace.showMessage('not committed yet!', 'warning');\n return;\n }\n yield nvim.command('keepalt above sp');\n let hasFugitive = yield nvim.getVar('loaded_fugitive');\n if (hasFugitive) {\n yield nvim.command(`Gedit ${commit}`);\n }\n else {\n let content = yield this.safeRun(['--no-pager', 'show', commit], root);\n if (content == null)\n return;\n let lines = content.trim().split('\\n');\n nvim.pauseNotification();\n nvim.command(`edit +setl\\\\ buftype=nofile [commit ${commit}]`, true);\n nvim.command('setl foldmethod=syntax nobuflisted bufhidden=wipe', true);\n nvim.command('setf git', true);\n nvim.call('append', [0, lines], true);\n nvim.command('normal! Gdd', true);\n nvim.command(`exe 1`, true);\n yield nvim.resumeNotification(false, true);\n }\n });\n }", "title": "" }, { "docid": "73f78f4ad60cb81f92e4ec2914429d06", "score": "0.5433711", "text": "function initGit () {\n if (!fs.existsSync(path.join(gruntDir, options.dir, '.git'))) {\n log.subhead('Creating git repository in \"' + options.dir + '\".');\n\n execWrap('git init');\n }\n }", "title": "" }, { "docid": "fbba87c86fb361b783b723e7a1b83b0e", "score": "0.54178077", "text": "get gitUrl() {\n return 'https://github.com/' + this.gitRemote;\n }", "title": "" }, { "docid": "a56f546afc1ac4d93a1e70e5e8ac02c5", "score": "0.5414316", "text": "function setupLocalRemoteGit() {\n const localRemoteGit = getLocalRemoteGitDirName();\n log({\n setupLocalRemoteGit: {\n data: localRemoteGit,\n status: 'begin',\n },\n });\n return ensureDir(localRemoteGit)\n .then(data => Promise.all([\n data,\n git(['init', '--bare'], { cwd: data })\n .then(gitData =>\n assert(/Initialized empty Git repository/.test(gitData.stdout),\n `Could not initialise a bare git repository: ${gitData.stderr}`)\n )\n ]))\n .then(res => res[0])\n .then(data => Promise.all([\n data,\n setupLocalRemoteGitWorkTree(data),\n ]))\n .then(res => ({\n localBareRepo: res[0],\n localClonedRepo: res[1],\n }))\n .then(data => Promise.all([\n data,\n log({\n data,\n status: 'complete',\n }),\n ]))\n .then(res => res[0]);\n}", "title": "" }, { "docid": "bc2cf5fb17044e52abe4d41b5270986d", "score": "0.53978574", "text": "changes(cb){\n if(!this.hasGit) return cb(null);\n run('git status --porcelain=1 --ignored', (results) => {\n if(!results.success) return cb(null);\n var status = results.stdout;\n var list = (status.trim()).split(\"\\n\");\n var untracked = [];\n var ignored = [];\n list.forEach((change) => {\n var changeParts = (change.trim()).split(\" \");\n if(changeParts && changeParts.length){\n if(changeParts[0] === '!!') ignored.push(changeParts[1]);\n else untracked.push(changeParts[1]);\n }\n })\n return cb({untracked: untracked.length? untracked : false, ignored: ignored.length? ignored : false});\n })\n }", "title": "" }, { "docid": "a4844aa865beb90d7d2767b2c9d5c9b8", "score": "0.5393891", "text": "async function init (url) {\n // continue only if git is installed\n log.o('verifing if git is installed')\n const out1 = await git.installed()\n log.d(out1)\n\n // clone a gist\n log.o(`cloning the gist in ${dataDir}`)\n const out2 = await git.clone(url, dataDir)\n log.d(out2)\n\n // create files\n log.o('creating todo files')\n const out3 = await Promise.all([createFile(todoFile), createFile(doneFile)])\n log.d(out3)\n\n // commit and push\n log.o('pushing updates to remote')\n const out4 = await git.update(dataDir, 'initial commit')\n log.d(out4)\n}", "title": "" }, { "docid": "1723ef463f54bc39532703ff641f3fb8", "score": "0.53657174", "text": "function gitAddAndCommit () {\n try {\n execSync('git add .', {cwd: projectPath}, () => { console.log('git added') })\n execSync('git commit -m \\\"' + commitMsg + '\\\"', {cwd: projectPath}, () => { console.log('git committed') })\n execSync('git status', {cwd: projectPath}, (stdout) => { console.log('\\n\\n\\n\\n\\n\\n\\n' + stdout) })\n } catch (e) {\n console.error(e.toString())\n }\n}", "title": "" }, { "docid": "5528200116fafbf35b2d0531a281be49", "score": "0.53297955", "text": "function startViCoWaGit()\r\n\t\t\t{\r\n\t\t\t\trequire([\"vicowagit\"], function(ViCoWaGit)\r\n\t\t\t\t{\r\n\t\t\t\t\tViCoWaGit.startDialog(ViCowaEditorBasePath);\r\n\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "f0d1ba80ee3d6a8f7e53757842f97f8e", "score": "0.5318579", "text": "getAllGitReposFromAPI({ commit }) {\n console.log('action getAllGitReposFromAPI is processing')\n if(isAvailableServerAPI) {\n let API_URL = 'git/repos'; // if you build a third-party server between git and this app\n if(isGitHubServer) {\n API_URL = HARD_CODE_API_URL_ROOT; // use github api directly\n }\n Vue.http.get(API_URL).then(response => {\n commit('setGitRepos', response.data);\n });\n } else {\n //test without server API\n commit('setGitRepos', getGitReposHardCode(22, 1));\n }\n }", "title": "" }, { "docid": "63b947cd265a4960af4782aeebf87f07", "score": "0.53016996", "text": "constructor(options = {}) {\n /** Check if `git status` is clean. */\n this.checkClean = async () => {\n const status = await exec_promise_1.default(\"git\", [\"status\", \"--porcelain\"]);\n if (!status) {\n return;\n }\n this.logger.log.error(\"Changed Files:\\n\", status);\n throw new Error(\"Working directory is not clean, make sure all files are committed\");\n };\n /** Prefix a version with a \"v\" if needed */\n this.prefixRelease = (release) => {\n var _a;\n if (!this.release) {\n throw this.createErrorMessage();\n }\n return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.noVersionPrefix) || release.startsWith(\"v\")\n ? release\n : `v${release}`;\n };\n this.options = options;\n this.baseBranch = options.baseBranch || \"master\";\n logger_1.setLogLevel(\"quiet\" in options && options.quiet\n ? \"quiet\"\n : Array.isArray(options.verbose) && options.verbose.length > 1\n ? \"veryVerbose\"\n : options.verbose\n ? \"verbose\"\n : undefined);\n this.logger = logger_1.default();\n this.hooks = make_hooks_1.makeHooks();\n this.hooks.getRepository.tapPromise(\"Get repo info from origin\", get_repository_1.default);\n this.hooks.onCreateRelease.tap(\"Link onCreateChangelog\", (release) => {\n release.hooks.onCreateChangelog.tap(\"Link onCreateChangelog\", (changelog, version) => {\n this.hooks.onCreateChangelog.call(changelog, version);\n });\n });\n this.hooks.onCreateRelease.tap(\"Link onCreateLogParse\", (release) => {\n release.hooks.onCreateLogParse.tap(\"Link onCreateLogParse\", (logParse) => {\n this.hooks.onCreateLogParse.call(logParse);\n });\n });\n this.hooks.beforeCommitChangelog.tapPromise(\"Old Version Branches\", async ({ bump }) => {\n var _a;\n if (bump === semver_2.default.major && ((_a = this.config) === null || _a === void 0 ? void 0 : _a.versionBranches)) {\n const branch = `${this.config.versionBranches}${semver_1.major(await this.hooks.getPreviousVersion.promise())}`;\n await exec_promise_1.default(\"git\", [\"branch\", branch]);\n this.logger.log.success(`Created old version branch: ${branch}`);\n await exec_promise_1.default(\"git\", [\"push\", this.remote, branch]);\n }\n });\n /**\n * Determine if repo is behind HEAD of current branch. We do this in\n * the \"afterVersion\" hook so the check happens as late as possible.\n */\n this.hooks.afterVersion.tapPromise(\"Check remote for commits\", async () => {\n // Credit from https://github.com/semantic-release/semantic-release/blob/b2b7b57fbd51af3fe25accdd6cd8499beb9005e5/lib/git.js#L179\n // `true` is the HEAD of the current local branch is the same as the HEAD of the remote branch, falsy otherwise.\n try {\n const currentBranch = get_current_branch_1.getCurrentBranch();\n const heads = await exec_promise_1.default(\"git\", [\n \"ls-remote\",\n \"--heads\",\n this.remote,\n currentBranch,\n ]);\n this.logger.verbose.info(\"Branch:\", currentBranch);\n this.logger.verbose.info(\"HEADs:\", heads);\n const baseBranchHeadRef = new RegExp(`^(\\\\w+)\\\\s+refs/heads/${this.baseBranch}$`);\n const [, remoteHead] = heads.match(baseBranchHeadRef) || [];\n if (remoteHead) {\n // This will throw if the branch is ahead of the current branch\n child_process_1.execSync(`git merge-base --is-ancestor ${remoteHead} HEAD`, {\n stdio: \"ignore\",\n });\n }\n this.logger.verbose.info(\"Current branch is up to date, proceeding with release\");\n }\n catch (error) {\n // If we are behind or there is no match, exit and skip the release\n this.logger.log.warn(\"Current commit is behind, skipping the release to avoid collisions.\");\n this.logger.verbose.warn(error);\n process.exit(0);\n }\n });\n loadEnv();\n this.logger.verbose.info(\"ENV:\", env);\n }", "title": "" }, { "docid": "f0dda954eb3b685745a288c0481f72cf", "score": "0.52932996", "text": "function commit() {\n _spork('git', ['commit', '-m', 'Bumping to version ' + require(pkg).version], push,\n _.partial(fulfill, 'Could not commit \\'' + chalk.cyan('package.json') + '\\''));\n }", "title": "" }, { "docid": "6ac72f62182378f423ce62b5da7afa9f", "score": "0.5287252", "text": "function shouldUpdate() {\n // Make sure you understand what this does.\n // With force, we're not even going to attempt to check out\n // We're just going to push the repo and override EVERYTHING in the remote\n if (options.force === true) return false;\n\n var status = shelljs.exec('git status -sb --porcelain', {silent: true});\n var ahead = false;\n var behind = false;\n\n if (status.code === 0) {\n ahead = status.output.indexOf('ahead') === -1 ? false : true;\n behind = status.output.indexOf('behind') === -1 ? false : true;\n\n if (ahead && behind) {\n throw('The remote and local branches have diverged; please\\n' +\n 'resolve manually. Deleting the local **built code**\\n' +\n '.git directory will usually fix things up.');\n }\n else if (ahead) {\n return false;\n }\n else if (behind) {\n return true;\n }\n }\n }", "title": "" }, { "docid": "045c7d502f7ef32b7ad90e21fb3f5ccb", "score": "0.5283819", "text": "async init () {\n await GitRepo.init(this.dir)\n }", "title": "" }, { "docid": "daf481c7c22ce892e06cc778307733a9", "score": "0.52722704", "text": "function forkRepo() {\n const repo = 'learn-co-curriculum/javascript-fetch-lab'\n //use fetch to fork it!\n console.log('fork repo');\n\n fetch('https://api.github.com/repos/learn-co-curriculum/javascript-fetch-lab', {\n method: 'post',\n headers: {\n Authorization: `token ${getToken()}`\n }\n }).then(res => res.json())\n .then(json => showResults(json));\n}", "title": "" }, { "docid": "025682c92ae039b85f77fa6c0c7996a5", "score": "0.52578807", "text": "status(cb){\n if(!this.hasGit) return cb(null);\n this.remoteUpdate(() => {\n run('git rev-parse @{0}', (localResults) => {\n run('git rev-parse @{u}', (remoteResults) => {\n run('git merge-base @ @{u}', (baseResults) => {\n if(!localResults.success || !remoteResults.success || !baseResults.success)\n return cb(null);\n var LOCAL_HASH = localResults.stdout.trim();\n var REMOTE_HASH = remoteResults.stdout.trim();\n var BASE_HASH = baseResults.stdout.trim();\n var clean = false, pull = false, push = false, other = false;\n if(LOCAL_HASH === REMOTE_HASH) clean = true;\n else if(LOCAL_HASH === BASE_HASH) pull = true;\n else if(REMOTE_HASH === BASE_HASH) push = true;\n else other = true;\n return cb({clean: clean, pull: pull, push: push, other: other});\n })\n })\n })\n })\n }", "title": "" }, { "docid": "ccfb0cd5167da155506e9f80ab29b0a6", "score": "0.5257598", "text": "getRepositoryDetails({user, project, host, branch, path}) {\n const {readme, changelogFilename} = this.state;\n const hasReadme =\n readme && readme.length > 0 && readme !== readmeErrorMessage;\n\n if (host === `github.com`) {\n if (changelogFilename) {\n get({\n url: changelogFilename,\n type: `text`,\n }).then(res => {\n this.setState({changelog: res});\n });\n }\n\n if (!hasReadme) {\n this.setState({readmeLoading: true});\n get({\n url: prefixURL(`README.md`, {\n base: `https://raw.githubusercontent.com`,\n user,\n project,\n head: branch,\n path: path.replace(/\\/tree\\//, ``),\n }),\n type: `text`,\n })\n .then(res => this.setState({readme: res}))\n .catch(() => this.setState({readmeLoading: false}));\n }\n\n this.getGithub({\n url: `repos/${user}/${project}/stats/commit_activity`,\n state: `activity`,\n });\n\n this.getGithub({\n url: `repos/${user}/${project}`,\n state: `github`,\n });\n } else if (host === `gitlab.com`) {\n const getGitlabFile = ({user, project, branch, filePath}) => {\n // We need to use the GitLab API because the raw url does not support cors\n // https://gitlab.com/gitlab-org/gitlab-ce/issues/25736\n // So we need to 'translate' raw urls to api urls.\n // E.g (https://gitlab.com/janslow/gitlab-fetch/raw/master/CHANGELOG.md) -> (https://gitlab.com/api/v4/projects/janslow%2Fgitlab-fetch/repository/files/CHANGELOG.md?ref=master)\n // Once gitlab adds support, we can get rid of this workaround.\n const apiUrl = `https://gitlab.com/api/v4/projects/${user}%2F${project}/repository/files/${encodeURIComponent(\n filePath,\n )}?ref=${branch}`;\n return get({\n url: apiUrl,\n type: `json`,\n }).then(res => res.encoding === `base64` && atob(res.content));\n };\n\n get({\n url: `https://gitlab.com/api/v4/projects/${user}%2F${project}`,\n type: `json`,\n }).then(res => this.setState({gitlab: res}));\n\n // Fetch last commit\n get({\n url: `https://gitlab.com/api/v4/projects/${user}%2F${project}/repository/commits?per_page=1`,\n type: `json`,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n }).then(([{committed_date}]) => {\n const timeDistance = formatDistance(new Date(committed_date), new Date());\n this.setState({\n activity: {\n lastCommit: `${timeDistance} ago`,\n },\n });\n });\n\n if (!hasReadme) {\n this.setState({readmeLoading: true});\n\n getGitlabFile({\n user,\n project,\n branch,\n filePath: `${path}/README.md`,\n })\n .then(res => this.setState({readme: res}))\n .catch(() => this.setState({readmeLoading: false}));\n }\n\n if (changelogFilename) {\n // Extract information from raw url\n // See comment in getGitlabFile\n const [, user, project, branch, filePath] = changelogFilename.match(\n /^https?:\\/\\/gitlab.com\\/([^/]+)\\/([^/]+)\\/raw\\/([^/]+)\\/(.*)$/i,\n );\n\n getGitlabFile({user, project, branch, filePath}).then(res =>\n this.setState({changelog: res}),\n );\n }\n } else if (host === `bitbucket.org`) {\n if (!hasReadme) {\n this.setState({readmeLoading: true});\n\n get({\n url: `https://bitbucket.org/${user}/${project}${\n path ? path.replace(`src`, `raw`) : `/raw/${branch}`\n }/README.md`,\n type: `text`,\n redirect: `error`, // Prevent being redirected to login page\n })\n .then(res => this.setState({changelog: res}))\n .catch(() => this.setState({readmeLoading: false}));\n }\n\n // Fetch last commit\n get({\n url: `https://api.bitbucket.org/2.0/repositories/${user}/${project}/commits?pagelen=1`,\n type: `json`,\n }).then(({values: [{date}]}) => {\n const timeDistance = formatDistance(new Date(date), new Date());\n this.setState({\n activity: {\n lastCommit: `${timeDistance} ago`,\n },\n });\n });\n\n if (changelogFilename) {\n get({\n url: changelogFilename,\n type: `text`,\n redirect: `error`, // Prevent being redirected to login page\n }).then(res => this.setState({changelog: res}));\n }\n }\n }", "title": "" }, { "docid": "b3d65b8f6f6697fe859bf734bbe80cc5", "score": "0.5217504", "text": "checkout(branchName, cb){\n if(!this.hasGit || typeof branchName !== 'string' || branchName === '') return cb(false);\n branchName = branchName.replace(/\\s/g, '');\n this.hasBranch(branchName, (hasBranch) => {\n if(!hasBranch) branchName = \"-b \" + branchName;\n run('git checkout ' + branchName, (results) => {\n if(!results.success) return cb(false);\n return cb(true);\n })\n })\n }", "title": "" }, { "docid": "db5d615286c24066dbcac29d83dba742", "score": "0.52005154", "text": "async init(): Promise<string> {\n this.gitUrl = await Git.secureGitUrl(this.gitUrl, this.hash, this.reporter);\n\n await this.setRefRemote();\n\n // check capabilities\n if (this.ref !== '' && (await Git.hasArchiveCapability(this.gitUrl))) {\n this.supportsArchive = true;\n } else {\n await this.fetch();\n }\n\n return this.hash;\n }", "title": "" }, { "docid": "3d0470f0bc26143926a884a0e1935329", "score": "0.51836735", "text": "function create_branch(next_ver) {\n var git_flags;\n var out;\n\n git_flags = 'pull';\n out = child_proc.execSync(cd_command + git_command + git_flags);\n process.stdout.write(out);\n\n git_flags = 'checkout -b build_release_v' + next_ver + ' ' + current_hash;\n out = child_proc.execSync(cd_command + git_command + git_flags);\n process.stdout.write(out);\n}", "title": "" }, { "docid": "d038c70b2aa11eb5f7b822bf5a60b1ef", "score": "0.5176409", "text": "function convertToGitUrl(url) {\n buildmessage.assertInJob();\n\n // Matches GitHub tarball URLs, like:\n // https://github.com/meteor/com.meteor.cordova-update/tarball/92fe99b7248075318f6446b288995d4381d24cd2\n var match = url.match(/^https?:\\/\\/github.com\\/(.+?)\\/(.+?)\\/tarball\\/([0-9a-f]{40})/);\n if (match) {\n var _match = _slicedToArray(match, 4);\n\n var organization = _match[1];\n var repository = _match[2];\n var sha = _match[3];\n // Convert them to a Git URL\n\n return 'https://github.com/' + organization + '/' + repository + '.git#' + sha;\n // We only support Git URLs with a SHA reference to guarantee repeatability\n // of builds\n } else if (/\\.git#[0-9a-f]{40}/.test(url)) {\n return url;\n } else {\n buildmessage.error('Meteor no longer supports installing Cordova plugins from arbitrary tarball URLs. You can either add a plugin from a Git URL with a SHA reference, or from a local path. (Attempting to install from ' + url + '.)');\n return null;\n }\n}", "title": "" }, { "docid": "8d821fa2bd9e46c8a68d4dd415aca7d2", "score": "0.5172854", "text": "function gitProfille() {\n\tfollowersList.innerHTML = \"\";\n\trName.innerHTML = \"\";\n\t//alert(\"New requst\");\n\tvar link = 'https://api.github.com/users/' + srcEntry.value;\n//\t\tmainRequest(link, 1);\n\tvar promise = mainRequest(link, 1);\n\tpromise.then(function (test) {\n\t\tconsole.log(test);\n\t}).catch(Error);\n\n}", "title": "" }, { "docid": "681f107c17fe248ea869192fbd6ecf6e", "score": "0.5149672", "text": "get repositoryURL() { return JSON.parse(fs.readFileSync(\"./package.json\")).repository + \"/tree/master\" }", "title": "" }, { "docid": "13e7b713ba6bae1974dcde894dfc7d05", "score": "0.51473", "text": "function handleGitHubUrl() {\n\tlet gitVersion = docVersion;\n\tif (gitVersion == \"latest\") {\n\t\tgitVersion = \"master\";\n\t} else if (gitVersion.startsWith(\"hotfix-\")) {\n\t\tgitVersion = gitVersion.replace(\"-\", \"/\");\n\t}\n\tif ($(\"#objclass\")[0]) {\n\t\tlet objclass = $(\"#objclass\")[0].value;\n\t\tlet newurl = $(\"#ghlink\")[0].href;\n\t\t // Build the url properly to match the repository\n\t\tnewurl = newurl.replace(\"convertigo-doc\",\"convertigo\");\n\n\t\tif (location.href.includes(\"mobile-application/components\")) {\n\t\t\tif (objclass == \"ion_objects.json\") {\n\t\t\t\tnewurl += \"/\" + gitVersion + \"/engine/src/com/twinsoft/convertigo/beans/mobile/components/dynamic/ion_objects.json\";\n\t\t\t} else {\n\t\t\t\tobjclass = objclass.replace(new RegExp(/[^a-zA-Z]/g),\"/\");\n\t\t\t\tnewurl += \"/\" + gitVersion + \"/engine/src/\" + objclass + \".properties\";\n\t\t\t}\n\t\t\t$(\"#ghlink\")[0].href = newurl;\n\t\t} else {\n\t\t\tobjclass = objclass.replace(new RegExp(/[^a-zA-Z]/g),\"/\");\n\t\t\tobjclass = objclass.replace(new RegExp(/(.*?\\/beans\\/(.*)\\/)/gi),\"$1res/\");\n\t\t\tnewurl += \"/\" + gitVersion + \"/engine/src/\" + objclass + \".properties\";\n\t\t\t$(\"#ghlink\")[0].href = newurl;\n\t\t}\n\t} else {\n\t\t$(\"#ghlink\")[0].href += location.pathname.replace(new RegExp(\".*/\" + docVersion), \"/\" + gitVersion);\n\t\tif (location.pathname.includes(\"index.html\")) {\n\t\t\t$(\"#ghlink\")[0].href += $(\"#ghlink\")[0].href.replace(\"index.html\",\"index.md\");\n\t\t} else {\n\t\t\t$(\"#ghlink\")[0].href += \"index.md\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d484405e4ce921b8236d925d9420a93d", "score": "0.514634", "text": "async function run() {\n const context = github.context;\n try {\n // Get info of the fork PR\n const prNumber = context.issue.number;\n const {data} = await octokit.pulls.get({\n ...context.repo,\n pull_number: prNumber\n });\n\n // Only create/update a branch if the PR from a fork\n if (data.head.repo.full_name !== context.payload.repository.full_name) {\n const branch = `${data.user.login}-${data.head.ref}`;\n const ref = `refs/heads/${branch}`;\n const sha = data.merge_commit_sha;\n\n let res;\n // Look up if branch for fork PR exists in base repo\n try {\n res = await octokit.repos.getBranch({\n ...context.repo,\n branch\n });\n } catch (error) {\n if (!(error.name === 'HttpError' && error.status === 404)) {\n throw error;\n } else {\n // If branch doesn't exist for the forked PR, create one so we can get a\n // build for it and return\n await octokit.git.createRef({\n ...context.repo,\n ref,\n sha\n });\n return;\n }\n }\n\n // If branch already exists update it to match fork PR state.\n if (res.status === 200) {\n await octokit.git.updateRef({\n ...context.repo,\n sha,\n ref: `heads/${branch}`,\n force: true\n })\n }\n }\n } catch (error) {\n core.setFailed(error.message);\n }\n}", "title": "" }, { "docid": "864d27ffc43ef16590c101842df26ff5", "score": "0.51408154", "text": "function startProcess() {\n\tnextStep = gitCheckout;\n\t\n\tcallNextStep();\n} // end startProcess()", "title": "" }, { "docid": "a854153babd4a9dab909dde3b9ef79a1", "score": "0.5137435", "text": "function github_url() {\n var baseURL = window.location.origin;\n if (\n location.href == baseURL + \"/book-of-open-source/\" ||\n location.href == baseURL + \"/code-of-conduct/\" ||\n window.location.hash\n ) {\n $('a[href^=\"./\"]').each(function () {\n var oldURL = $(this).attr(\"href\");\n var newURL = oldURL.replace(\n /(\\.\\/)*/,\n \"https://github.com/chef/chef-oss-practices/blob/master/\"\n );\n $(this).attr(\"href\", newURL);\n // console.log($(this).attr(\"href\"));\n });\n }\n }", "title": "" }, { "docid": "f0ad13970569a731a142cd21d09e19a6", "score": "0.5121081", "text": "function isCherryPicking() {\n return Utils.exists(Paths.git.heads.cherryPick) || Utils.exists(Paths.git.heads.revert);\n}", "title": "" }, { "docid": "2c26526bf3f2fed7caa498b5ec048784", "score": "0.51149", "text": "function crGitCheckoutPatchsetRef(config, callback)\n{\n\tvar argv;\n\n\tconsole.error('Checking out patchset reference %s.',\n\t config.cur_patchset_ref);\n\n\targv = [ 'git', 'checkout',\n\t config.cur_changeinfo.currentPatchSet.revision ];\n\tmod_forkexec.forkExecWait({\n\t 'argv': argv,\n\t 'cwd': config.cur_tmpdir,\n\t 'includeStderr': true\n\t}, callback);\n}", "title": "" }, { "docid": "54a097d3710645af583a6c9f42876548", "score": "0.5112193", "text": "async function initGit(target) {\n const git = (0, _.hasCommand)('git');\n\n if (git) {\n const cwd = target;\n await (0, _child_process.spawn)('git', ['init'], {\n cwd\n });\n await (0, _child_process.spawn)('git', ['add', '-A'], {\n cwd\n });\n const defaultGitUser = 'skpm-bot';\n const defaultGitEmail = 'bot@skpm.io';\n const gitUser = await (0, _getGitUser.default)(defaultGitEmail, defaultGitUser);\n await (0, _child_process.spawn)('git', ['commit', '-m', 'initial commit from skpm'], {\n cwd,\n env: {\n GIT_COMMITTER_NAME: gitUser.username,\n GIT_COMMITTER_EMAIL: gitUser.email,\n GIT_AUTHOR_NAME: defaultGitUser,\n GIT_AUTHOR_EMAIL: defaultGitEmail\n }\n });\n } else {\n (0, _.warn)('Could not locate `git` binary in `$PATH`. Skipping!');\n }\n} // Formulate Questions if `create` args are missing", "title": "" }, { "docid": "03930fe56282fca279d40b1745b8dcf5", "score": "0.5095265", "text": "async info(args) {\n var _a, _b, _c;\n if (!this.git) {\n return { hasError: false };\n }\n const [, gitVersion = \"\"] = await await_to_js_1.default(exec_promise_1.default(\"git\", [\"--version\"]));\n const [noProject, project] = await await_to_js_1.default(this.git.getProject());\n const repo = (await this.getRepo(this.config)) || {};\n const repoLink = terminal_link_1.default(`${repo.owner}/${repo.repo}`, (_a = project === null || project === void 0 ? void 0 : project.html_url) !== null && _a !== void 0 ? _a : \"\");\n const author = (await this.getGitUser()) || {};\n const [, lastRelease = \"0.0.0\"] = await await_to_js_1.default(this.git.getLatestRelease());\n const version = await this.getCurrentVersion(lastRelease);\n const [err, latestRelease] = await await_to_js_1.default(this.git.getLatestReleaseInfo());\n const latestReleaseLink = latestRelease\n ? terminal_link_1.default(latestRelease.tag_name, latestRelease.html_url)\n : \"\";\n const { headers } = await this.git.github.request(\"HEAD /\");\n const access = headers;\n const rateLimitRefresh = new Date(Number(access[\"x-ratelimit-reset\"]) * 1000);\n const token = this.git.options.token || \"\";\n const tokenRefresh = `${rateLimitRefresh.toLocaleTimeString()} ${rateLimitRefresh.toLocaleDateString(\"en-us\")}`;\n const projectLabels = await this.git.getProjectLabels();\n const hasLabels = (_b = this.config) === null || _b === void 0 ? void 0 : _b.labels.reduce((acc, label) => {\n var _a, _b;\n if (label.name === \"release\" &&\n !((_a = this.config) === null || _a === void 0 ? void 0 : _a.onlyPublishWithReleaseLabel)) {\n return acc;\n }\n if (label.name === \"skip-release\" && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.onlyPublishWithReleaseLabel)) {\n return acc;\n }\n return acc && projectLabels.includes(label.name);\n }, true);\n const { permission, user } = (await this.git.getTokenPermissionLevel()) || {};\n let hasError = false;\n /** Log if a configuration is correct. */\n const logSuccess = (err) => {\n if (err) {\n hasError = true;\n return log_symbols_1.default.error;\n }\n return log_symbols_1.default.success;\n };\n console.log(\"\");\n // prettier-ignore\n console.log(endent_1.default `\n ${chalk_1.default.underline.white('Environment Information:')}\n\n \"auto\" version: v${getAutoVersion()}\n \"git\" version: v${gitVersion.replace('git version ', '')}\n \"node\" version: ${process.version.trim()}${access['x-github-enterprise-version']\n ? `\\nGHE version: v${access['x-github-enterprise-version']}\\n`\n : '\\n'}\n ${chalk_1.default.underline.white('Project Information:')}\n\n ${logSuccess(noProject)} Repository: ${repoLink}\n ${logSuccess(!author.name)} Author Name: ${author.name}\n ${logSuccess(!author.email)} Author Email: ${author.email}\n ${logSuccess(!version)} Current Version: ${this.prefixRelease(version)}\n ${logSuccess(err)} Latest Release: ${latestReleaseLink}\n\n ${logSuccess(!hasLabels)} Labels configured on GitHub project ${hasLabels ? '' : '(Try running \"auto create-labels\")'}\n\n ${chalk_1.default.underline.white('GitHub Token Information:')}\n\n ${logSuccess(!token)} Token: ${`[Token starting with ${token.substring(0, 4)}]`}\n ${logSuccess(!(permission === 'admin' || permission === 'write'))} Repo Permission: ${permission}\n ${logSuccess(!(user === null || user === void 0 ? void 0 : user.login))} User: ${user === null || user === void 0 ? void 0 : user.login}\n ${logSuccess()} API: ${terminal_link_1.default(this.git.options.baseUrl, this.git.options.baseUrl)}\n ${logSuccess(!((_c = access['x-oauth-scopes']) === null || _c === void 0 ? void 0 : _c.includes('repo')))} Enabled Scopes: ${access['x-oauth-scopes']}\n ${logSuccess(Number(access['x-ratelimit-remaining']) === 0)} Rate Limit: ${access['x-ratelimit-remaining'] || '∞'}/${access['x-ratelimit-limit'] || '∞'} ${access['ratelimit-reset'] ? `(Renews @ ${tokenRefresh})` : ''}\n `);\n console.log(\"\");\n if (args.listPlugins) {\n await this.listPlugins();\n }\n return { hasError };\n }", "title": "" }, { "docid": "ac1d97d19205c4f4eb66b0fc0bfb945e", "score": "0.5087101", "text": "async function git_show(commit_sha) {\n \n const search_by_message = `git show -U1000 ${commit_sha}`\n const access_repo = `cd ${local}`\n\n const show_command = await exec(access_repo + \" && \" + search_by_message)\n const all_changes = show_command.stdout\n\n let file_array = all_changes.split(/diff --git[\\S\\s]*?\\+\\+\\+ .?\\//) //split by the whole hunk header\n file_array = file_array.slice(1, file_array.length)\n\n file_array.forEach(function(file) {\n file = file.replace(/@@ .* @@\\n/, \"\") //get rid of lines added, lines removed headers in code\n file = file.replace(/\\\\ No newline at end of file/, \"\") //get rid of this weird info at the end of files\n let tokens = file.split('\\n')\n let file_name = tokens[0];\n console.log(`============================= NEW FILE: ${file_name} =============================`)\n let contents = tokens.slice(1, tokens.length).join('\\n')\n console.log(contents)\n })\n\n}", "title": "" }, { "docid": "d5c1f8a17045512a1d201291968a2afb", "score": "0.5085832", "text": "getCurrentCommitHash () {\n return new Promise((resolve, reject) => {\n this.gitInterface.revparse(['HEAD'], (error, data) => {\n if (error) reject(new Error(error));\n else resolve(data);\n });\n });\n }", "title": "" }, { "docid": "539226117edac42f6c46c93a8e12ed98", "score": "0.5078298", "text": "function gitFetch (dest) {\n var branch = (options.remoteBranch || options.branch) + (dest ? ':' + options.branch : '');\n log.subhead('Fetching \"' + options.branch + '\" ' + (options.shallowFetch ? 'files' : 'history') + ' from ' + options.remote + '.');\n\n // `--update-head-ok` allows fetch on a branch with uncommited changes\n execWrap('git fetch --update-head-ok ' + progress + depth + remoteName + ' ' + branch, false, true);\n }", "title": "" }, { "docid": "6bdf42d2ea03dafe367161778f94cbab", "score": "0.5073537", "text": "checkout(repo, branch = 'master', folder = '') {\n this.sh('git clone -b ' + branch + ' ' + repo + ' ' + folder);\n }", "title": "" }, { "docid": "bc59fab3012122d5df9ac184196caa9f", "score": "0.5071831", "text": "function git_post_can_commit (post_path) {\n var diffStatus = spawn_sync('git', ['diff', '--name-only', '--', post_path])\n var diffOutput = diffStatus.stdout.toString();\n\n return ( diffOutput.length !== 0 );\n}", "title": "" }, { "docid": "8a5e30ba0b1a1f88da0e0e433a503eba", "score": "0.50638926", "text": "startGit(gitOptions) {\n if (!gitOptions.owner || !gitOptions.repo || !gitOptions.token) {\n throw new Error(\"Must set owner, repo, and GitHub token.\");\n }\n this.logger.verbose.info(\"Options contain repo information.\");\n // So that --verbose can be used on public CIs\n const tokenlessArgs = Object.assign(Object.assign({}, gitOptions), { token: `[Token starting with ${gitOptions.token.substring(0, 4)}]` });\n this.logger.verbose.info(\"Initializing GitHub API with:\\n\", tokenlessArgs);\n return new git_1.default({\n owner: gitOptions.owner,\n repo: gitOptions.repo,\n token: gitOptions.token,\n baseUrl: gitOptions.baseUrl,\n baseBranch: this.baseBranch,\n graphqlBaseUrl: gitOptions.graphqlBaseUrl,\n agent: gitOptions.agent,\n }, this.logger);\n }", "title": "" }, { "docid": "41d81889bc537a4dcd697d79764c66fd", "score": "0.5054361", "text": "parseRepoUrl(){\n let goodUrl = this._repo\n if (goodUrl.startsWith(`http://`)){\n goodUrl = goodUrl.substr(7)\n this._protocol = `http`\n }else if (goodUrl.startsWith(`https://`)){\n goodUrl = goodUrl.substr(8)\n }else if (goodUrl.startsWith(`ssh://`) || goodUrl.startsWith(`git://`)){\n goodUrl = goodUrl.substr(6)\n }\n if (goodUrl.endsWith(`.git`)){\n goodUrl = goodUrl.substr(0, goodUrl.length-4)\n }\n const firstIndex = goodUrl.indexOf(`@`)\n if (firstIndex > -1){\n goodUrl = goodUrl.substr(firstIndex+1)\n goodUrl = goodUrl.replace(`:`, `/`)\n }\n this._repo = goodUrl\n }", "title": "" }, { "docid": "2e31fbbeb752ebdb3d820811cf0dbd44", "score": "0.50501937", "text": "function isGitUrl(url) {\r\n\t\t\t\treturn url\r\n\t\t\t\t\t? gitPatterns.some(pattern => !!url.match(pattern))\r\n\t\t\t\t\t: false;\r\n\t\t\t}", "title": "" }, { "docid": "18d956a4fe922569d837fae0f11701fb", "score": "0.50495857", "text": "function crGitCloneProject(config, callback)\n{\n\tvar argv;\n\n\tif (!config.cur_changeinfo.open) {\n\t\tsetImmediate(callback, new VError('change is not still open'));\n\t\treturn;\n\t}\n\n\tconsole.error('Cloning %s to %s.', config.cur_project,\n\t config.cur_tmpdir);\n\n\targv = [ 'git', 'clone',\n\t sprintf('git+ssh://%s/%s.git', config.cur_hostpart,\n\t config.cur_project), config.cur_tmpdir ];\n\tmod_forkexec.forkExecWait({\n\t 'argv': argv,\n\t 'includeStderr': true\n\t}, callback);\n}", "title": "" }, { "docid": "8bde00a37058f35427de8a75f448d503", "score": "0.50495434", "text": "static async secureGitUrl(ref: GitUrl, hash: string, reporter: Reporter): Promise<GitUrl> {\n if (isCommitSha(hash)) {\n // this is cryptographically secure\n return ref;\n }\n\n if (ref.protocol === 'git:') {\n const secureUrl = Git.replaceProtocol(ref, 'https:');\n if (await Git.repoExists(secureUrl)) {\n return secureUrl;\n } else {\n reporter.warn(reporter.lang('downloadGitWithoutCommit', ref.repository));\n return ref;\n }\n }\n\n if (ref.protocol === 'http:') {\n const secureRef = Git.replaceProtocol(ref, 'https:');\n if (await Git.repoExists(secureRef)) {\n return secureRef;\n } else {\n reporter.warn(reporter.lang('downloadHTTPWithoutCommit', ref.repository));\n return ref;\n }\n }\n\n return ref;\n }", "title": "" }, { "docid": "69e558ca87b5899eed49d832b2130ed1", "score": "0.5048201", "text": "function verifyRepo(repo)\n{\n // TODO check that directory exists, and has a \".git\" subdir\n return true;\n}", "title": "" }, { "docid": "cbf642e7af3849c5b7e98c9302190ed3", "score": "0.50480616", "text": "async setGitUser() {\n const user = await this.getGitUser();\n if (user && !user.system) {\n if (!env.isCi) {\n this.logger.log.note(endent_1.default `\n Detected local environment, will not set git user. This happens automatically in a CI environment.\n\n If a command fails manually run:\n\n - git config user.email your@email.com\n - git config user.name \"Your Name\"\n `);\n return;\n }\n if (user.email) {\n await exec_promise_1.default(\"git\", [\"config\", \"user.email\", `\"${user.email}\"`]);\n this.logger.verbose.warn(`Set git email to ${user.email}`);\n }\n if (user.name) {\n await exec_promise_1.default(\"git\", [\"config\", \"user.name\", `\"${user.name}\"`]);\n this.logger.verbose.warn(`Set git name to ${user.name}`);\n }\n if (!user.name && !user.email) {\n this.logger.log.error(endent_1.default `\n Could find a git name and email to commit with!\n\n Name: ${user.name}\n Email: ${user.email}\n \n You must do one of the following: \n \n - configure the author for your package manager (ex: set \"author\" in package.json)\n - Set \"name\" and \"email in your .autorc\n `, \"\");\n process.exit(1);\n }\n }\n }", "title": "" }, { "docid": "6ae14fc705c6db5db5764e62966b4487", "score": "0.50341445", "text": "async getVersion() {\n let gitStatus = await Process.run('git status --porcelain', { path: this.path, debug: false });\n const gitHash = (await Process.run('git rev-parse --verify HEAD', { path: this.path, debug: false })).trim();\n\n gitStatus = gitStatus.split('\\n')\n .filter(l => !ignoredFilesForVersion.some(r => r.test(l)))\n .join('\\n')\n .trim();\n\n if (gitStatus.length === 0) {\n return `app-${gitHash}`;\n }\n\n const diff = await Process.run('git diff', { path: this.path, debug: false });\n const hash = sh.unique(gitHash + diff);\n\n return `app-local-${hash}`;\n }", "title": "" }, { "docid": "94dc6b9f9ae71bd2eb9eb5e8e239438a", "score": "0.5019301", "text": "function gitStatus() {\n\t\tvar promise = $q.defer();\n\n\t\t$http({\n\t\t\tmethod: 'GET',\n\t\t\turl: '/api/git'\n\t\t}).then(function(response, status, headers) {\n\t\t\tpromise.resolve(response.data);\n\t\t}).catch(function(err) {\n\t\t\tpromise.reject(err.data);\n\t\t});\n\n\t\treturn promise.promise;\n\t}", "title": "" }, { "docid": "7671142101b14ad758fd262e4e416a50", "score": "0.5015718", "text": "function gitpush(cb) {\n run('git push\"', function (err, stdout, stderr) {\n console.log(stdout);\n console.log(stderr);\n cb(err);\n });\n}", "title": "" }, { "docid": "34d45b7a0aea6c6c6aaaa458cdf6fdad", "score": "0.5010394", "text": "function findPreviousCommits (cb) {\n var child = exec('git rev-parse --verify HEAD', { encoding: 'utf8' }, function (err, stdout, stderr) { // eslint-disable-line no-unused-vars\n if (err) return cb(buildError(err, child.exitCode));\n else return cb(null, child.exitCode === 0);\n });\n}", "title": "" }, { "docid": "ae92c68063992289d716f92bfa88269c", "score": "0.50032634", "text": "async remoteDetect () {\n const result = {\n success: true,\n message: ''\n }\n try {\n const { setting } = this.db\n const isRepo = await this.git.checkIsRepo()\n if (!setting.username || !setting.repository || !setting.token) {\n return {\n success: false,\n message: 'Username、repository、token is required'\n }\n }\n if (!isRepo) {\n await this.git.init()\n await this.git.addConfig('user.name', setting.username)\n await this.git.addConfig('user.email', setting.email)\n await this.git.add('./*')\n await this.git.commit('first commit')\n await this.git.addRemote('origin', this.remoteUrl)\n }\n\n await this.git.raw(['remote', 'set-url', 'origin', this.remoteUrl])\n await this.git.listRemote([])\n } catch (e) {\n console.log('Test Remote Error: ', e.message)\n result.success = false\n result.message = e.message\n }\n // console.log('检测结果: ', result)\n return result\n }", "title": "" }, { "docid": "153b03871115e7fd2574dedba96ceca0", "score": "0.49913958", "text": "function openGithub() {\n\tconst url = \"https://github.com/Ryan-Thomas/Game-Of-Life\";\n\twindow.open(url, \"_blank\");\n}", "title": "" }, { "docid": "8555961d26acddc39e28a90784ac4ae7", "score": "0.49897143", "text": "function pushToCordovaGithub() {\n pushd(BUILD_DIR);\n echo('pushing to SchizoDuckie/DuckieTV-Cordova:master');\n exec('git push --force origin master');\n popd()\n}", "title": "" }, { "docid": "01057595a04786c30b6a6e06a5238ff5", "score": "0.4989152", "text": "function checkout(next) {\n console.log(colors.info('🚀 switching to master and pulling latest...'));\n execSync('git checkout master && git pull');\n console.log(colors.info(`⬇️ cloning ${CHECKOUT_BRANCH} branch`));\n execSync(`git clone -b ${CHECKOUT_BRANCH} --single-branch ${REPO_URL} ${TEMP_DIR}`);\n next();\n}", "title": "" }, { "docid": "18efbc4ad7684c1d35dd1797a029971b", "score": "0.4989038", "text": "function bareClone(dir, url, cb) {\n console.log('Cloning ' + url + ' into ' + dir);\n console.log('Cloning into ', process.cwd());\n var child = exec('git clone --bare --mirror ' + url + ' ' + dir, function(code, output) {\n console.log('Git bare clone is done for ' + url + ' (code '+ code +')', output);\n if (cb) cb();\n });\n}", "title": "" }, { "docid": "3899e671ba2974c697c09e415bd7a547", "score": "0.4987038", "text": "async function setupRepositoryAndTeam() {\n if (await doesRepoExist()) {\n logger.warn('Repo exists already.');\n return;\n }\n\n logger.debug('Creating new repo in GitHub...');\n await octokit.repos.createInOrg({\n org: owner,\n name: newRepoName,\n // TODO generalize this (maybe get from the head repo?)\n description: `(Work in progress) React documentation website in ${langName}`,\n });\n logger.info('Finished creating repo!');\n\n // Create the progress-tracking issue from the template\n await Promise.all([\n createProgressIssue(),\n createTeam(),\n pushOriginalContents(),\n ]);\n}", "title": "" }, { "docid": "f934cc8392830265d66219c8a71caf5a", "score": "0.49795577", "text": "pull(cb){\n if(!this.hasGit) return cb(false);\n run('git pull', (results) => {\n if(!results.success) return cb(false);\n return cb(true);\n })\n }", "title": "" }, { "docid": "e29bfbef13f831040a7e90a7b580b57e", "score": "0.49768022", "text": "function pushToGithub() {\n pushd(BUILD_DIR);\n echo('pushing to DuckieTV/DuckieTV:gh-pages');\n exec('git push --force duckietv master:gh-pages');\n popd();\n}", "title": "" }, { "docid": "8bf53abf77b9b68dbfb823729a5e0478", "score": "0.49747258", "text": "function setupLocalRemoteGitWorkTree(bareRepo) {\n const localRemoteGitWorkTree = getLocalGitWorkTreeDirName();\n log({\n setupLocalRemoteGitWorkTree: {\n data: localRemoteGitWorkTree,\n status: 'begin',\n },\n });\n return ensureDir(localRemoteGitWorkTree)\n .then(data =>\n git('init', { cwd: data })\n .then(() => git(['remote', 'add', 'origin', bareRepo], { cwd: data }))\n .then(() => data)\n )\n .then(data => Promise.all([\n data,\n log({\n setupLocalRemoteGitWorkTree,\n status: 'end',\n }),\n ]))\n .then(res => res[0]);\n}", "title": "" }, { "docid": "16e11f710aba07ae522ff40b59daa483", "score": "0.49717474", "text": "function gitPush () {\n var branch = options.branch;\n var withForce = options.force ? ' --force ' : '';\n\n if (options.remoteBranch) branch += ':' + options.remoteBranch;\n\n log.subhead('Pushing ' + options.branch + ' to ' + options.remote + withForce);\n execWrap('git push ' + withForce + remoteName + ' ' + branch, false, true);\n\n if (options.tag) {\n execWrap('git push ' + remoteName + ' ' + options.tag);\n }\n }", "title": "" }, { "docid": "3472b22775cab609e88c5db4291a49a8", "score": "0.49673668", "text": "async getHeadCommitShaFromPullRequest(branch) {\n try {\n let sourceBranch = await this.octokit.request(\"GET /repos/{owner}/{repo}/branches/{branch}\", {\n owner: this.owner,\n repo: this.repository,\n branch: branch\n });\n\n console.log('Head commit sha : ' + sourceBranch.data.commit.sha);\n return sourceBranch.data.commit.sha;\n\n } catch (error) {\n core.setFailed(error.message);\n }\n }", "title": "" }, { "docid": "8c6a3788f0a0bb5824cab4228365cc79", "score": "0.49572957", "text": "function checkOutBranch(answer) {\n\texec(\"git checkout \" + answer),\n\t(error, stdout, stderr) => {\n\t\tif (error) {\n\t\t\tconsole.log(`Checkout error: ${error.message}`);\n\t\t\treturn;\n\t\t}\n\t\tif (stderr) {\n\t\t\tconsole.log(`Checkout stderr: ${stderr}`);\n\t\t\treturn;\n\t\t}\n\t}\n\tprocess.stdout.write('\\x1Bc');\n}", "title": "" }, { "docid": "52317061a377addb0a45a4a58dd9317e", "score": "0.4951241", "text": "static get tag(){return\"git-corner\"}", "title": "" }, { "docid": "6273e0b1d082dd474d153d34b89dfcde", "score": "0.49481001", "text": "async push () {\n const repo = new GitRepo(this.dir, this.credentials)\n try {\n await repo.open()\n await repo.push()\n } finally {\n repo.free()\n }\n }", "title": "" }, { "docid": "74800462626ffaec6224e02df03afbcb", "score": "0.49423853", "text": "function github(req, res) {\n\n var github = new githubApi({\"version\":\"3.0.0\"});\n github.authenticate({\n type: \"basic\",\n username: process.env.GITHUB_USERNAME,\n password: process.env.GITHUB_PASSWORD\n });\n /*\n github.authorization.create({\n scopes: [\"user\", \"public_repo\", \"repo\", \"repo:status\", \"gist\"],\n note: \"a test4\"\n }, function(err, e) {\n //console.error(err);\n //console.log(e);\n });\n */\n /*\n github.user.get({}, function(err, data) {\n console.log(err);\n console.log(data);\n });\n */\n var options = {\n user: \"bathtimefish\",\n repo: \"test-app\",\n };\n github.repos.getBranches(options, function(err, e) {\n console.error(err);\n console.log(e[0].commit.sha);\n var options = {\n user: \"bathtimefish\",\n repo: \"test-app\",\n sha: e[0].commit.sha\n }\n github.gitdata.getTree(options, function(err, e) {\n console.error(err);\n console.log(e);\n });\n });\n /*\n var options = {\n user: \"bathtimefish\",\n repo: \"test-app\",\n path: \"hello.txt\",\n message: \"add hoge.md\",\n content: \"bXkgbmV3IGZpbGUgY29udGVudHM=\",\n };\n github.repos.createFile(options, function(err, e) {\n console.error(err);\n console.log(e);\n });\n */\n\n res.json({\"hoge\":\"fuga\"});\n}", "title": "" }, { "docid": "ebb2f9907cb6847d6ee7c87f0c051f76", "score": "0.49249494", "text": "function useSsh2MasterFiles() {\n if (fs.existsSync(__dirname + '/ssh2-master')) {\n console.log(clc.yellowBright(\"\\nNOTICE:\"));\n console.log(clc.yellowBright(\"This is the first execution of deploy-meteor-ssh npm module\"));\n console.log(clc.yellowBright(\"as reported in the readme file, this script needs the latest master-branch of ssh2 library by mscdex\"));\n console.log(clc.yellowBright(\"since the current npm version (0.3.6) of ssh2 is not up to date with master-branch, this script will copy the latest files needed automatically\"));\n console.log(clc.blueBright(\"this is why you are going to be prompted for your sudo password\\n\"));\n\n console.log(clc.yellowBright(\"will now copy latest ssh2 master-branch files in ssh2 module subfolder...\\n\"));\n execSync('sudo -- sh -c \\'rsync -a ' + __dirname + '/ssh2-master/lib/* ' + __dirname + '/../node_modules/ssh2/lib/ ; rm -Rf ' + __dirname + '/ssh2-master\\'');\n console.log(clc.greenBright('done\\n'));\n\n console.log(clc.greenBright(\"now all the needed files are up-to-date;\\n\"));\n }\n}", "title": "" }, { "docid": "4f8388bf3b02210f285e84e0de512ddb", "score": "0.49179965", "text": "function gitCommit () {\n var message = options.message\n .replace(/%sourceName%/g, tokens.name)\n .replace(/%sourceCommit%/g, tokens.commit)\n .replace(/%sourceBranch%/g, tokens.branch);\n\n // If there are no changes, skip commit\n if (shelljs.exec('git status --porcelain', {silent: true}).output === '') {\n log.subhead('No changes to your branch. Skipping commit.');\n return;\n }\n\n log.subhead('Committing changes to \"' + options.branch + '\".');\n execWrap('git add -A .');\n\n // generate commit message\n var commitFile = 'commitFile-' + crypto.createHash('md5').update(message).digest('hex').substring(0, 6);\n fs.writeFileSync(commitFile, message);\n\n execWrap('git commit --file=' + commitFile);\n\n fs.unlinkSync(commitFile);\n }", "title": "" }, { "docid": "85117ab0c29cbbad44cfc46b818e557a", "score": "0.49110645", "text": "function gitadd(cb) {\n run('git add -A', function (err, stdout, stderr) {\n console.log(stdout);\n console.log(stderr);\n cb(err);\n });\n}", "title": "" }, { "docid": "cb0360eaff74b7e8bb7d49f347f08bcd", "score": "0.49085605", "text": "function Git(opts) {\n\n /*\n Constructor, generates the Git object.\n */\n if (typeof opts !== \"object\") {\n opts = {};\n }\n this.autoCreate = !!opts.autoCreate;\n this.repopath = typeof opts.repopath === \"string\" ? opts.repopath : \"./gitrepos\";\n this.authCreate = typeof opts.authCreate === \"function\" ? opts.authCreate : function(rq, rs, p, r, cb) {\n return cb(true);\n };\n this.authRead = typeof opts.authRead === \"function\" ? opts.authRead : function(rq, rs, p, r, cb) {\n return cb(true);\n };\n this.authWrite = typeof opts.authWrite === \"function\" ? opts.authWrite : function(rq, rs, p, r, cb) {\n return cb(true);\n };\n }", "title": "" }, { "docid": "b489c5c450447f1b74944d3ce8200bf5", "score": "0.49084336", "text": "function versionCheck() {\n var versionEndpoint = 'https://raw.githubusercontent.com/nuadi/googlecrestscript/master/version';\n var newVersion = fetchUrl(versionEndpoint);\n\n if (newVersion != null) {\n newVersion = newVersion.getContentText().trim();\n Logger.log('Current version from Github: ' + newVersion);\n\n var message = 'You are using the latest version of GCS. Fly safe. o7';\n var title = 'No updates found';\n if (newVersion > version) {\n message = 'A new version of GCS is available on GitHub.';\n title = 'GCS version ' + newVersion + ' available!';\n }\n SpreadsheetApp.getActiveSpreadsheet().toast(message, title, 120);\n }\n}", "title": "" }, { "docid": "5cff260dcc78d7395a65871852c0467d", "score": "0.4881636", "text": "function forkRepo() {\n const repo = 'learn-co-curriculum/javascript-fetch-lab'\n\n fetch(`${baseApi}repos/${repo}/forks`, {\n method: 'post',\n headers: {\n 'Authorization': `token ${getToken()}`\n }\n }).then(resp => {\n let repo = new Repo(resp);\n showForkedRepo(repo);\n })\n}", "title": "" }, { "docid": "267ac0f6a995007db54f652b50be9c56", "score": "0.48764345", "text": "stash(cb){\n if(!this.hasGit) return cb(false);\n run('git stash', (results) => {\n if(!results.success) return cb(false);\n return cb(true);\n })\n }", "title": "" }, { "docid": "fb55e82175bd11237ce5a3dcbe39f3a0", "score": "0.4869711", "text": "function syncDevelop() {\n return syncBranch('develop');\n}", "title": "" }, { "docid": "6ee7b89f6976d7c6ad201cd132378d4c", "score": "0.4857227", "text": "hasBranch(branchName, cb){\n if(!this.hasGit) return cb(false);\n run('git branch', (results) => {\n if(!results.success) return cb(false);\n var branches = results.stdout.trim();\n var branchList = branches.split(\"\\n\");\n branchList = branchList.map((branch) => {return (branch.replace(/[*]/,'')).trim()}); //Remove star for current branch item\n if(branchList.indexOf(branchName) !== -1) return cb(true);\n return cb(false);\n })\n }", "title": "" }, { "docid": "2698ec3de8b913472e873c7f8d986d66", "score": "0.4854547", "text": "function pushCommit(gitRepo, jsonid, res, callNumber){\n\t//make Directory\n\t\t//cd into it\n\n\t\tif(process.cwd().substring(process.cwd().length-13, process.cwd().length)!=='DMVHelperTest'){\n\t\t\tprocess.chdir('pushFolder/DMVHelperTest');\n\t\t}\n\n\t\t//write a file\n\t\tfs.readFile('src/main.lua', function read(err, data) {\n\t\t if (err) {\n\t\t throw err;\n\t\t }\n\t\t \n\t\t fs.writeFile(\"src/main.lua\", (\"\"+data).replace(/myJsonId = \\\"\\w*\\\"/g, \"myJsonId = \\\"\"+jsonid +\"\\\"\"), function(err) {\n\t\t\t if(err) {\n\t\t\t return console.log(err);\n\t\t\t }\n\t\t\t\tconsole.log(\"wrote\");\n\t\t\t\t//commit the file\n\t\t\t\t\n\t\t\t\trequire('simple-git')()\n\t\t\t\t.add('./*')\n\t\t\t\t.commit(\"first commit!\")\n\t\t\t\t.removeRemote('origin')\n\t\t \t .addRemote('origin', gitRepo, function(err, update){\n\t\t\t\t\t if(err){\n\t\t\t\t\t\t console.log(err);\n\t\t\t\t\t\t return;\n\t\t\t\t\t }\n\t\t\t\t\t require('child_process').exec('git push -f origin master');\n\t\t\t\t\t console.log(\"remote added!\");\n\t\t\t\t });\n\t\t\t\n\n\t\t\t\t\n\t\t\t\tres.send(callNumber);\n\t\t\t\t\n\t\t\t}); \n\t\t});\n}", "title": "" }, { "docid": "c2b0ecd02bd84d8e5afbe8ed1718e91e", "score": "0.48528138", "text": "function addFile(sh, repoPath, filename) {\n cov_v1ucos01h.f[1]++;\n cov_v1ucos01h.s[2]++;\n sh.cd(repoPath);\n cov_v1ucos01h.s[3]++;\n sh.exec('git add ' + filename);\n}", "title": "" }, { "docid": "e51ef178b2b0641f7c4be71d125bc073", "score": "0.48425812", "text": "function getGitVersion() {\n return execSync(\"git describe --tags HEAD\", { encoding: 'utf-8' }).trim();\n}", "title": "" }, { "docid": "565eda7ca8e991b673d1a9fd1de45bdd", "score": "0.48376724", "text": "function printChangeSummary() {\n let sha;\n if (isCiBuild()) {\n log(\n `Latest commit from ${cyan('main')} included in this build:`,\n cyan(shortSha(gitMergeBaseMain()))\n );\n sha = ciPullRequestSha();\n } else {\n sha = gitCommitHash();\n }\n log(`Testing the following changes at commit ${cyan(shortSha(sha))}:\\n`);\n logWithoutTimestamp(gitDiffStatMain());\n\n const branchCreationPoint = gitBranchCreationPoint();\n if (branchCreationPoint) {\n log(\n `Commit log since branch ${cyan(gitBranchName())} was forked from`,\n `${cyan('main')} at ${cyan(shortSha(branchCreationPoint))}:\\n`\n );\n logWithoutTimestamp(gitDiffCommitLog() + '\\n');\n }\n}", "title": "" }, { "docid": "5658d1a156aa80ba782020efe07ea404", "score": "0.4825297", "text": "function my_release() {\n check_release(\"my_release\", \"https://github.com/kimh/release_note/releases\", github_release);\n}", "title": "" }, { "docid": "4ba00e248ded63769d15dc1c46281ba8", "score": "0.4822409", "text": "async function _gitTargetSyncVerify() {\n const git = new Git(config.options.git)\n if (await git.isTargetBranchOutofSync()) {\n console.log('Successfully Verified that branch is not out of sync with target')\n }\n}", "title": "" }, { "docid": "4e4057cecd91a7ae37e045c2454cea78", "score": "0.4820371", "text": "function findGit(filename) {\n var paths = filename.split(path.sep);\n for (var i = paths.length; i > 0; i--) {\n var p = path.resolve(paths.slice(0, i).join(path.sep) + path.sep + '.git');\n if (fs.existsSync(p)) {\n return p;\n }\n }\n}", "title": "" }, { "docid": "6b404272575276ee53e7aa8f7d71f82a", "score": "0.4819172", "text": "function openHashedRepo() {\n let currentRoute = getCurrentPath();\n\n if (!currentRoute.length) return;\n\n org.repos.some((repo) => {\n if (repo.name === currentRoute) {\n showOverview(repo);\n }\n });\n}", "title": "" }, { "docid": "d0173e59bc34ea5f1527547390746b9b", "score": "0.48107162", "text": "function gitCommit(username) {\n let req = fetch(`https://api.github.com/users/${username}/events`, {headers: {'Authorization': apiKeys.GITHUB}});\n req.then(response => {\n response.json().then( data => {\n let pushEvent = data.filter((n) => n.type == \"PushEvent\")[0];\n console.log(pushEvent.created_at);\n });\n });\n req.catch( response => console.log(response));\n}", "title": "" }, { "docid": "541045e13e3f913335098f55a17146e6", "score": "0.47973496", "text": "function subirImagenGithub(img64) {\n\t\tfileName = 'pano_'+ Date.now() +'.jpg';\n\t\tfileNameFull = 'photos/'+fileName;\n\t\trepo.write('master', fileNameFull , img64, 'Added new pano photo', function(err) {});\n\t\t// guardar nombre del fichero en una caja oculta para recuperarla luego $('#formLat').text(lat);\n\t\t$('#formFileImageGithub').val(fileName);\n\t\t// mostrar boton guardar\n\t\t$('#botonAddFeature').removeClass().addClass(\"show\");\n\t\t// ocultar sidebar\n\t\tsidebar.hide();\n\t}", "title": "" }, { "docid": "b8027a189c3f1077d5c95db717a2bb92", "score": "0.47917697", "text": "function getGithash () {\n let hash\n\n try {\n hash = childProcess.execSync('/usr/local/bin/git rev-parse --short=7 HEAD', { encoding: 'utf8' })\n hash.trim()\n } catch (e) {\n console.warn('Could not retrieve git hash, skipping')\n hash = false\n }\n\n return hash\n}", "title": "" }, { "docid": "2f8a3e56e7d786d5c879628d76ffb60e", "score": "0.47891736", "text": "function setupGitSymlink (rootPath, packagePath, shell) {\n var rootPathGit = path.join(rootPath, '.git');\n var packagePathGit = path.join(packagePath, '.git');\n shell.lnSync(rootPathGit, packagePathGit);\n}", "title": "" } ]
41f5d2fc03d115b14f2cb6943939cc7c
FUNCION PARA DEVOLVER CARRITO LIMPIO SIN REPETIDOS
[ { "docid": "7e9c931a61b370fc7098016f518da765", "score": "0.0", "text": "function devolverCarritoLimpio(){\n let carritoSinRepetidos = [];\n \n for(item of mangas){\n let x = carrito.find(el => el.id === item.id)\n if(typeof x == \"undefined\"){\n }else{\n carritoSinRepetidos.push(x);\n }\n }\n return carritoSinRepetidos;\n}", "title": "" } ]
[ { "docid": "831f83ba890518744c75c72bd688f34f", "score": "0.65211457", "text": "unir(listaDeParticulas) {\n let distanciaVecindario = 50;\n let sum = createVector(0, 0);\n let count = 0;\n for (let i = 0; i < listaDeParticulas.length; i++) {\n let d = p5.Vector.dist(this.pos,listaDeParticulas[i].pos);\n if ((d > 0) && (d < distanciaVecindario)) {\n sum.add(listaDeParticulas[i].pos);\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return this.buscar(sum);\n } else {\n return createVector(0, 0);\n }\n }", "title": "" }, { "docid": "36369c14f6a9142a4fbcb302b0543630", "score": "0.64270556", "text": "function reducir_vida_rival(a) {\n var enemigo = enemigos_en_tablero.find(enemigo => enemigo.id === a);\n if (enemigo.puntos_de_vida > 0) {\n\n\n\n enemigo.puntos_de_vida = enemigo.puntos_de_vida - 1;\n\n\n var cositas= enemigo.id +\"_puntos_vida\";\n document.getElementById(cositas).innerHTML = enemigo.puntos_de_vida;\n\n var porcentaje_pdv= parseInt(enemigo.puntos_de_vida)/parseInt(enemigo.puntos_de_vida_game)*100;\n\n console.log( \"enemigo.puntos_de_vida: \" + enemigo.puntos_de_vida );\n console.log( \"enemigo.puntos_de_vida_game: \" + enemigo.puntos_de_vida_game );\n console.log( \"porcentaje_pdv: \" +porcentaje_pdv );\n\n document.getElementById( enemigo.id + \"_vida_barra\").style.width = porcentaje_pdv +\"%\"; \n\n\n\n\n\n event_target.remove();\n /* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */\n\n\n if (enemigo.puntos_de_vida == 0){\n //document.getElementById(enemigo.id).style.backgroundColor=\"#282930\";\n\n document.getElementById(enemigo.id).classList.add(\"muerto\");\n // document.getElementById(enemigo.id).style.backgroundBlendMode=\"saturation\";\n enemigo.status= \"muerto\";\n // document.getElementById(enemigo.id).remove();\n }\n /* console.log(enemigos_en_tablero) */\n var enemigos_vivos = enemigos_en_tablero.filter(enemigo => enemigo.status === \"vivo\");\n \n //console.log(enemigos_vivos.length) ; \n if( enemigos_vivos.length == 0){ setTimeout(function(){ \n document.getElementById('modal_victoria').style.display =\"flex\";\n \n }, 300);}\n }\n }", "title": "" }, { "docid": "048291b4c779cf7b4bb6263eac9b969f", "score": "0.6355655", "text": "function calcularResistenciaCompressiva(){\n let vf = props.vf.valor;\n (naoNulos([vf])) && (vf=vf/100);\n\n let vm = props.vm.valor;\n (naoNulos([vm])) && (vm=vm/100);\n\n let d_s = (4*(vf)/Math.PI)**(1/2);\n\n let sigmaMult = props.sigmaMTult.valor;\n (naoNulos([sigmaMult])) && (sigmaMult=sigmaMult*1e6);\n\n let sigmaMCult = props.sigmaMCult.valor;\n (naoNulos([sigmaMCult])) && (sigmaMCult=sigmaMCult*1e6);\n\n let Em = props.Em.valor;\n (naoNulos([Em])) && (Em=Em*1e9);\n\n let Ef = props.Ef.valor;\n (naoNulos([Ef])) && (Ef=Ef*1e9);\n\n let E1 = props.E1.valor;\n (naoNulos([E1])) && (E1=E1*1e9);\n\n let E2 = props.E2.valor;\n (naoNulos([E2])) && (E2=E2*1e9);\n\n let nu12 = props.nu12.valor;\n let Gm = props.Gm.valor;\n (naoNulos([Gm])) && (Gm=Gm*1e9);\n\n let G12 = props.G12.valor;\n (naoNulos([G12])) && (G12=G12*1e9);\n\n let Gf = props.Gf.valor; \n (naoNulos([Gf])) && (Gf=Gf*1e9);\n\n let tauFult = props.tauFult.valor;\n (naoNulos([tauFult])) && (tauFult=tauFult*1e6);\n\n let tauMult = props.tauMult.valor;\n (naoNulos([tauMult])) && (tauMult=tauMult*1e6);\n\n\n let epsilonMult = \"\";\n let menorEpsilon2Tult = \"\";\n let S1C=\"\";\n let S2C=\"\";\n let epsilonC_m=\"\";\n\n\n if(naoNulos([sigmaMult,Em])){\n epsilonMult = sigmaMult/Em; \n armazenarEmProps(\"epsilonMult\",epsilonMult);\n };\n\n if(naoNulos([epsilonMult, d_s, Em,Ef,vf])){\n let epsilon2Tult = [epsilonMult*(d_s*(Em/Ef-1)+1),epsilonMult*(1-vf**(1/3))];\n \n menorEpsilon2Tult = math.min(epsilon2Tult);\n armazenarEmProps(\"menorEpsilonTransvUlt\",menorEpsilon2Tult);\n }\n \n let sigma1Cult=\"\";\n if(naoNulos([E1,menorEpsilon2Tult,nu12])){\n sigma1Cult= E1*menorEpsilon2Tult/nu12; //RESULTADO SIGMA1CULT\n }\n\n if(naoNulos([vf,Em,Ef])){\n S1C = 2*(vf+(1-vf)*Em/Ef)*(vf*Em*Ef/(3*(1-vf)))**(1/2); //resultado S1C\n }\n\n if(naoNulos([sigma1Cult,S1C])){\n armazenarEmProps(\"modo1\",math.min(sigma1Cult,S1C)*1e-6);\n }\n \n if(naoNulos([Gm,Vf])){\n S2C = Gm/(1-vf);\n armazenarEmProps(\"modo2\",S2C*1e-6);\n }\n if(naoNulos([tauFult,vf,tauMult,vm])){\n let sigma1Cult_2 = 2*(tauFult*vf+tauMult*vm); // Resultado levemente diferente do exemplo usado no livro, mas os calculos indicam estar corretos.\n armazenarEmProps(\"modo3\",sigma1Cult_2*1e-6);\n }\n\n if(naoNulos([sigmaMCult,Em])){\n epsilonC_m=sigmaMCult/Em;\n armazenarEmProps(\"epsilonMC\",epsilonC_m);\n\n }\n\n if(naoNulos([d_s,Em,Ef,E2,epsilonC_m])){\n \n let epsilon2C = (d_s*Em/Ef + (1-d_s))*epsilonC_m;\n let sigma2Cult=E2*epsilon2C;\n armazenarEmProps(\"sigma2Cult\",sigma2Cult*1e-6);\n }\n\n if(naoNulos([G12,d_s,Gm,Gf,tauMult])){\n \n let gama12Ult = tauMult/Gm;\n let tau12Ult = G12*(d_s*Gm/Gf+(1-d_s))*gama12Ult; \n armazenarEmProps(\"tau12ult\", tau12Ult*1e-6);\n };\n \n \n\n\n\n}", "title": "" }, { "docid": "ef140c43d60f4784fd97b076b3609d34", "score": "0.63460076", "text": "computeClasse(dto) {\n let classesFinal;\n classesFinal = new Array();\n let classes;\n classes = new Array();\n // Compte Classes without Groupe/SousGroupe/Compte\n dto.forEach(item => {\n if (classes == null || !classes.find(x => x.noClasse == item.noClasse)) {\n let newClasse = {\n noClasse: item.noClasse,\n texte: item.nomClasse,\n groupes: [],\n debit: 0,\n credit: 0,\n solde: 0,\n debitString: '',\n creditString: '',\n soldeString: ''\n };\n classes.push(newClasse);\n }\n });\n classes.forEach(classe => {\n let groupes;\n groupes = new Array();\n dto.forEach(item => {\n if (classe.noClasse == item.noClasse) {\n if (!groupes.find(x => x.noGroupe == item.noGroupe)) {\n let newGroupe = {\n noGroupe: item.noGroupe,\n texte: item.nomGroupe,\n sousGroupes: [],\n debit: 0,\n credit: 0,\n solde: 0,\n debitString: '',\n creditString: '',\n soldeString: ''\n };\n groupes.push(newGroupe);\n }\n }\n });\n let newClasse = {\n noClasse: classe.noClasse,\n texte: classe.texte,\n groupes: groupes.slice(),\n debit: classe.debit,\n credit: classe.credit,\n solde: classe.solde,\n debitString: classe.debitString,\n creditString: classe.creditString,\n soldeString: classe.soldeString\n };\n classesFinal.push(newClasse);\n });\n // Il manque sous-groupe\n classes = new Array();\n classes = classesFinal.slice();\n classesFinal = new Array(); // reset\n classes.forEach(classe => {\n let groupes;\n groupes = new Array();\n classe.groupes.forEach(groupe => {\n let sousGroupes;\n sousGroupes = new Array();\n dto.forEach(item => {\n if (classe.noClasse == item.noClasse && groupe.noGroupe == item.noGroupe) {\n if (!sousGroupes.find(x => x.noSousGroupe == item.noSousGroupe)) {\n let newSousGroupe = {\n noSousGroupe: item.noSousGroupe,\n texte: item.nomSousGroupe,\n comptes: [],\n debit: 0,\n credit: 0,\n solde: 0,\n debitString: '',\n creditString: '',\n soldeString: ''\n };\n sousGroupes.push(newSousGroupe);\n }\n }\n });\n let newGroupe = {\n noGroupe: groupe.noGroupe,\n texte: groupe.texte,\n sousGroupes: sousGroupes.slice(),\n debit: groupe.debit,\n credit: groupe.credit,\n solde: groupe.solde,\n debitString: groupe.debitString,\n creditString: groupe.creditString,\n soldeString: groupe.soldeString\n };\n groupes.push(newGroupe);\n });\n let newClasse = {\n noClasse: classe.noClasse,\n texte: classe.texte,\n groupes: groupes.slice(),\n debit: classe.debit,\n credit: classe.credit,\n solde: classe.solde,\n debitString: classe.debitString,\n creditString: classe.creditString,\n soldeString: classe.soldeString\n };\n classesFinal.push(newClasse);\n });\n // Il manque les comptes desormais\n classes = new Array();\n classes = classesFinal.slice();\n classesFinal = new Array(); // reset\n classes.forEach(classe => {\n let groupes;\n groupes = new Array();\n classe.groupes.forEach(groupe => {\n let sousGroupes;\n sousGroupes = new Array();\n groupe.sousGroupes.forEach(sousGroupe => {\n let comptes;\n comptes = new Array();\n dto.forEach(item => {\n if (classe.noClasse == item.noClasse && groupe.noGroupe == item.noGroupe && sousGroupe.noSousGroupe == item.noSousGroupe) {\n if (!comptes.find(x => x.noCompte == item.noCompte)) {\n let newCompte = {\n noCompte: item.noCompte,\n texte: item.texte,\n debit: item.solde1 >= 0 ? item.solde1 : 0,\n credit: item.solde1 >= 0 ? 0 : (item.solde1 * -1),\n solde: item.solde1,\n debitString: numeral(item.solde1 >= 0 ? item.solde1 : 0).format('0,0.00 $'),\n creditString: numeral(item.solde1 >= 0 ? 0 : (item.solde1 * -1)).format('0,0.00 $'),\n soldeString: numeral(item.solde1).format('0,0.00 $'),\n };\n comptes.push(newCompte);\n }\n ;\n }\n });\n // foreach monétaire ici\n let debitComptesTotal = 0.0;\n let creditComptesTotal = 0.0;\n let soldeComptesTotal = 0.0;\n comptes.forEach(compte => {\n debitComptesTotal += compte.debit;\n creditComptesTotal += compte.credit;\n soldeComptesTotal += compte.solde;\n });\n let newSousGroupe = {\n noSousGroupe: sousGroupe.noSousGroupe,\n texte: sousGroupe.texte,\n comptes: comptes.slice(),\n debit: debitComptesTotal,\n credit: creditComptesTotal,\n solde: soldeComptesTotal,\n debitString: numeral(debitComptesTotal).format('0,0.00 $'),\n creditString: numeral(creditComptesTotal).format('0,0.00 $'),\n soldeString: numeral(soldeComptesTotal).format('0,0.00 $')\n };\n sousGroupes.push(newSousGroupe);\n });\n // foreach monétaire ici\n let debitSousGroupesTotal = 0.0;\n let creditSousGroupesTotal = 0.0;\n let soldeSousGroupesTotal = 0.0;\n sousGroupes.forEach(sousGroupe => {\n debitSousGroupesTotal += sousGroupe.debit;\n creditSousGroupesTotal += sousGroupe.credit;\n soldeSousGroupesTotal += sousGroupe.solde;\n });\n let newGroupe = {\n noGroupe: groupe.noGroupe,\n texte: groupe.texte,\n sousGroupes: sousGroupes.slice(),\n debit: debitSousGroupesTotal,\n credit: creditSousGroupesTotal,\n solde: soldeSousGroupesTotal,\n debitString: numeral(debitSousGroupesTotal).format('0,0.00 $'),\n creditString: numeral(creditSousGroupesTotal).format('0,0.00 $'),\n soldeString: numeral(soldeSousGroupesTotal).format('0,0.00 $') // ici changer\n };\n groupes.push(newGroupe);\n });\n // foreach monétaire ici\n let debitGroupesTotal = 0.0;\n let creditGroupesTotal = 0.0;\n let soldeGroupesTotal = 0.0;\n groupes.forEach(groupe => {\n debitGroupesTotal += groupe.debit;\n creditGroupesTotal += groupe.credit;\n soldeGroupesTotal += groupe.solde;\n });\n let newClasse = {\n noClasse: classe.noClasse,\n texte: classe.texte,\n groupes: groupes.slice(),\n debit: debitGroupesTotal,\n credit: creditGroupesTotal,\n solde: soldeGroupesTotal,\n debitString: numeral(debitGroupesTotal).format('0,0.00 $'),\n creditString: numeral(creditGroupesTotal).format('0,0.00 $'),\n soldeString: numeral(soldeGroupesTotal).format('0,0.00 $') // ici changer\n };\n classesFinal.push(newClasse);\n });\n // Set currency from dto\n // numeral(CURRENCY HERE).format('0,0[.]00 $')\n return classesFinal;\n }", "title": "" }, { "docid": "9d251bf5d6b3009fc20c9a881a525ec3", "score": "0.6316454", "text": "function calcula() {\r\n let porcentagem = medias_moveis_valores.value\r\n let resultado = mediana_movel(vetor_final2, total, tipo_variavel.selectedIndex, porcentagem)\r\n\r\n const exibir = document.getElementById('media_movel_resultado')\r\n exibir.innerHTML = resultado\r\n\r\n function mediana_movel(vetordados, total, tipo_variavel, porcentagem) {\r\n let mediana = []\r\n let stringmediana = \"\"\r\n let porcentagem_decimal = porcentagem / 100\r\n let possivel_mediana1 = total * porcentagem_decimal\r\n for (let i = 0; i < vetordados.length; i++) {\r\n if (possivel_mediana1 <= vetordados[i]['Frequencia acumulada'] && vetordados[i]['intervalo inferior frequencia acumulada'] < possivel_mediana1) {\r\n mediana.push(vetordados[i]['nome'])\r\n\r\n }\r\n }\r\n if (tipo_variavel == 1 || tipo_variavel == 2 || tipo_variavel == 3) {\r\n\r\n stringmediana = mediana[0]\r\n\r\n return stringmediana\r\n } else if (tipo_variavel == 4) {\r\n let fac\r\n for (a = 0; a < vetor_final2.length; a++) {\r\n let nome1 = vetor_final2[a]['nome']\r\n if (mediana[0] == nome1) {\r\n if (a == 0) {\r\n fac = 0\r\n } else {\r\n fac = vetor_final2[a - 1]['Frequencia acumulada']\r\n }\r\n let posicao = possivel_mediana1\r\n let h = vetor_final2[a]['limite_superior'] - vetor_final2[a]['limite_inferior']\r\n let i = vetor_final2[a]['limite_inferior']\r\n let fi = vetor_final2[a]['valor']\r\n let fracao = (posicao - fac) / fi\r\n let md = (h * fracao) + i\r\n stringmediana = md\r\n\r\n }\r\n }\r\n return stringmediana\r\n }\r\n }\r\n }", "title": "" }, { "docid": "371c4de56ed9e2ab7c834f89b1bb45a9", "score": "0.6314526", "text": "function crearCola(procesos) {\r\n\tcontenido = new Array;\r\n\tfor (i = 0; i < procesos; i++) {\r\n\r\n\r\n\t\tvar id = [i + 1];//se llama proceso en el nodo\r\n\t\tvar nombre = nombrepro[i];//recoge los valores del arreglo nombrepro creado antes al leer el xml\r\n\t\tvar tiempo = rafag[i];//recoge los valores del arreglo rafag creado antes al leer el xml\r\n\t\tvar raf = rafag[i];//obtine los valores del vector ragag\r\n\t\tvar quantum = cQuan; // ya esta definida de manera global\r\n\t\tvar tll = tilleg[i];//recoge los valores del arreglo tilleg creado antes al leer el xml\r\n\t\tvar tf = Tfinalizacion;//se envia en 0\r\n\t\tvar tr = Turnarround;//se envia en 0\r\n\t\tvar pr = prioridad[i];//recoge los valores del arreglo tilleg creado antes al leer el xml\r\n\t\tvar ne = numEjecucion;\r\n var prId=idPro[i];\r\n\t\tcontenido = Array.from(nombre);\r\n\t\tmcontenido.push([i, contenido,nombre,prId]);\r\n\t\tcopiados.push([i]);\r\n\r\n\t\tcolaestable.insertarUltimo(id, nombre, tiempo, quantum, tll, tf, tr, pr, raf, ne, prId);\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "50ea89c7bf990b3fcc4e5d23313fd67e", "score": "0.62884563", "text": "function calcularValores() {\n let newArr = [...props.tablaAnalisisRepago];\n var costeTotal = 0;\n var beneficioTotal = 0;\n newArr.map((columna) => {\n // Calculos\n const ajusteCosto = newArr[columna.id].valores[2];\n const ajusteBeneficio = newArr[columna.id].valores[6];\n if (\n ajusteCosto >= 0 &&\n ajusteCosto <= 100 &&\n ajusteBeneficio >= 0 &&\n ajusteBeneficio <= 100\n ) {\n var costo =\n parseInt(newArr[columna.id].valores[1]) +\n parseInt(newArr[columna.id].valores[0]);\n var costoAño = costo * (ajusteCosto / 100) + costo;\n var beneficio = parseInt(newArr[columna.id].valores[5]);\n var beneficioAño =\n parseInt(beneficio) - parseInt(beneficio) * (ajusteBeneficio / 100);\n costeTotal += costoAño;\n beneficioTotal += parseInt(beneficioAño);\n //Verificar que sean valores validos para hacer los cambios en la tabla\n if (\n !isNaN(costeTotal) &&\n !isNaN(costoAño) &&\n !isNaN(beneficioTotal) &&\n !isNaN(beneficioAño)\n ) {\n newArr[columna.id].valores[3] = costoAño;\n newArr[columna.id].valores[4] = costeTotal;\n newArr[columna.id].valores[7] = beneficioAño;\n newArr[columna.id].valores[8] = beneficioTotal;\n newArr[columna.id].valores[9] = beneficioTotal - costeTotal;\n props.actualizar(newArr);\n } else {\n console.log(\"Hubo un error, posiblemente no hayan valores en las celdas de las columnas anteriores o ingresaste un valor invalido\");\n }\n } else {\n console.log(\"Ingresaste un porcentaje invalido\");\n }\n return null;\n });\n }", "title": "" }, { "docid": "402787186c98de093ee9ff70ae8d8343", "score": "0.62716216", "text": "function filtrarCondicion(aux, entorno, listainstrucciones) {\n console.log(\"metodo condicion\");\n console.log(aux);\n if (listainstrucciones.mostrar != \"\") {\n var entornofiltrado = [];\n var expresion = listainstrucciones.mostrar.exp;\n var rutaOperar = void 0;\n var lado = void 0;\n if (expresion.operandoIzq != false) {\n rutaOperar = expresion.operandoIzq.dato.valor;\n lado = true;\n }\n else if (expresion.operandoDer != false) {\n rutaOperar = expresion.operandoDer.dato.valor;\n lado = false;\n }\n for (var _i = 0, aux_1 = aux; _i < aux_1.length; _i++) {\n var prueba = aux_1[_i];\n for (var _a = 0, prueba_1 = prueba; _a < prueba_1.length; _a++) {\n var actual = prueba_1[_a];\n if (actual.identificador == rutaOperar) {\n var nuevaEXP = void 0, nuevaOP = void 0;\n if (!isNaN(actual.valor)) {\n nuevaEXP = nodoDato(actual.valor, TIPO_PRIMITIVO.NUMERICO);\n }\n else {\n nuevaEXP = nodoDato(actual.valor, TIPO_PRIMITIVO.CADENA);\n }\n if (lado) {\n nuevaOP = nodoOperacionBinaria(nuevaEXP, expresion.operandoDer, expresion.tipo_operacion, expresion.clase, expresion.fila, expresion.columna);\n }\n else {\n nuevaOP = nodoOperacionBinaria(expresion.operandoIzq, nuevaEXP, expresion.tipo_operacion, expresion.clase, expresion.fila, expresion.columna);\n }\n var resultado = getValor(nuevaOP, entorno);\n if (resultado) {\n entornofiltrado.push(prueba);\n }\n }\n }\n }\n if (entornofiltrado.length > 0) {\n if (listainstrucciones.mostrar.mostrar != \"\") {\n entornofiltrado = filtrarCondicion(entornofiltrado, entorno, listainstrucciones.mostrar);\n }\n return entornofiltrado;\n }\n return;\n }\n}", "title": "" }, { "docid": "2da1aa1db6dd2dd8179a4cf18ae58181", "score": "0.62399143", "text": "function scegliCarta1 (){\n\t\"use strict\";\n\tvar costoProdotto=1000; // Costo della carta nell'area occupata dal prodotto\n\tvar tipoCarta=\"\";\n\tfor (var nomeCarta in carte) {\n\t\tvar carta= carte[nomeCarta]; \n\t\tvar costoFoglio= carta.costoFoglio;\n\t\tvar wFoglio= carta.width; // dimensioni della carta in cm\n\t\tvar hFoglio= carta.height; // dimensioni della carta in cm\n\t\tfor (var nomeStampante in stampanti) {\n\t\t\tvar stampante= stampanti[nomeStampante];\n\t\t\tvar wStampante = stampante.width;\n\t\t\tvar hStampante = stampante.height;\n\t\t\twStampa=21;\n\t\t\thStampa=29.7;\n\t\t\t\n\t\t\tvar copie=contaCopie(wStampante,hStampante,wStampa,hStampa);\n\t\t\tvar maxCopie= Math.max(copie.WwHh,copie.WhHw); // Massimo numero di copie che possono uscire dal foglio\n\t\t\tvar dimMinTagliato=[];\n\t\t\tif (copie.WwHh>=copie.WhHw){\n\t\t\t\tdimMinTagliato.w=copie.ww*wStampa;\n\t\t\t\tdimMinTagliato.h=copie.hh*hStampa;\n\t\t\t}else{\n\t\t\t\tdimMinTagliato.w=copie.wh*hStampa;\n\t\t\t\tdimMinTagliato.h=copie.hw*wStampa;\n\t\t\t}\n\t\t\tcopie=contaCopie(wFoglio,hFoglio,dimMinTagliato.w,dimMinTagliato.h);\n\t\t\tvar dimMaxTagliato=[];\n\t\t\tif (copie.WwHh>=copie.WhHw){\n\t\t\t\tdimMaxTagliato.w=wFoglio/copie.ww;\n\t\t\t\tdimMaxTagliato.h=hFoglio/copie.hh;\n\t\t\t}else{\n\t\t\t\tdimMaxTagliato.w=wFoglio/copie.wh;\n\t\t\t\tdimMaxTagliato.h=hFoglio/copie.hw;\n\t\t\t}\n\t\t}\n\t};\n\treturn [tipoCarta,costoProdotto * qtaProdotti];\n}", "title": "" }, { "docid": "eb5a055da8dff59751c7e5e589b0a21d", "score": "0.61810637", "text": "function separateCOMA(vetbase){\r\n\r\n //Pega os itens enviados por args[2] agora em vb e separa num vetor auxiliar \r\n let conteudoaux = [0,0,0,0,0,0,0,0,0,0];\r\n let conteudo = vetbase;\r\n let i = i1 = i2 = 0;\r\n let cont=0;\r\n\r\n for(i=0;i<conteudo.length;i++){\r\n if(conteudo[i] === ','){\r\n conteudoaux[i1]= conteudo.substring(i2,i); //salva o campo que deseja alterar no vet aux\r\n i1++; //proxima possicao do vetor auxilar \r\n i2=(i+1); //k precisa ser a possicao depois da virgula \r\n }else if(i===(conteudo.length-1)){ //pq a ultima palavra nao acaba em virgula e se chegou ate o fim nao rolou problema entao salva a ultima palavra\r\n conteudoaux[i1]= conteudo.substring(i2,(i+1)); \r\n }\r\n }\r\n conteudo = conteudoaux;\r\n \r\n i=0;\r\n do{\r\n cont++;\r\n i++;\r\n }while(conteudo[i]!=0);\r\n if(cont<=conteudo.length){\r\n conteudo.length = cont;\r\n }\r\n\r\n return conteudo;\r\n}", "title": "" }, { "docid": "7adf22f3ebd72ced98c8c61097e0b0f3", "score": "0.6175051", "text": "function exibirCompra(dataCompra){\n conteudo('fragments/lista',function() {\n \n //Esconde o cadastro do novo produto\n $('#linhanovoproduto').hide();\n \n $('#btn-fechar').on('click',function(ev){\n initViewCompras();\n });\n \n var compra = buscarCompra(dataCompra);\n var itens = compra.produtos;\n var item;\n var total = 0;\n //var cont = -1;\n for(item in itens){\n \n var produto = buscarProduto(item);\n var itemDados = itens[item].split('|');\n var index = 0;\n var marcado = JSON.parse(itemDados[index++]);\n var nome = produto.nome;\n var qtd = JSON.parse(itemDados[index++]);\n var unit = JSON.parse(itemDados[index++]);\n var subt = qtd*unit;\n total += subt;\n\n var itemCompra = new ItemCompra(++codigoItemCompra,marcado,nome,qtd,unit,subt);\n \n lista.push(itemCompra);\n addItemView(itemCompra);\n }\n \n //atualizaTotal();\n \n var prod;\n var opcoes = '<option>Adicionar</option>';\n for(prod in produtos){\n var pro = produtos[prod];\n opcoes += '<option>'+pro.nome+'</option>';\n }\n \n $('#selecao').append(opcoes);\n \n $('#btn-adicionar').on('click',function(ev) {\n var selecionado = $('#selecao').val();\n if(selecionado=='Adicionar'){\n $('#linhaselecao').hide();\n $('#linhanovoproduto').show();\n \n }else{\n var produto = buscarProduto(selecionado);\n var itemCompra = new ItemCompra(++codigoItemCompra,false,produto.nome,1,0,0);\n lista.push(itemCompra);\n addItemView(itemCompra); \n }\n });\n \n $('#btn-addprod').on('click',function(ev) {\n $('#linhaselecao').show();\n $('#linhanovoproduto').hide();\n });\n \n });\n}", "title": "" }, { "docid": "e25ae8d4dfd44acc795a23d8e563c6b8", "score": "0.6170929", "text": "function comprobarRecorridos() {\n\n if ((columnasRecorridas) && (filasRecorridas)) {\n cambiarFichasIguales();\n actualizarPuntuacion();\n actualizarMovimientos();\n }\n else {\n columnasRecorridas = false;\n filasRecorridas = false;\n fichasIguales = new Array(cantidadColumnas * cantidadFilas);\n }\n\n}", "title": "" }, { "docid": "7a01edfbcbd69db3c2e831bb75714264", "score": "0.6132004", "text": "function cosechar() {\n angular.forEach($scope.registros, function(value, key) {\n if(value.paso != -1) {\n value.paso = parseInt(value.paso) - 1;\n if(value.paso === 0) {\n $scope.totalAlmacen = parseInt($scope.totalAlmacen) + parseInt(value.producir);\n $scope.cultivando -= parseInt(value.producir);\n value.paso = -1;\n }\n }\n });\n }", "title": "" }, { "docid": "f4c98f4cc0d2aa03ea5527df63f06ac6", "score": "0.6127605", "text": "function scontrino_v() {\n $('#area_sub_tot').hide();\n $('#area_resto').hide();\n var a_comp = compattaArray();\n //$('#scontrino').removeClass('barra_y');\n $('#area_sub_tot').hide();\n $('#area_resto').hide();\n var tot = 0;\n $('#area_ordine').empty();\n for (i = 0; i < a_comp.length; i++) {\n var codice = \"<div class=\\\"row\\\">\"\n + \"<div class=\\\"col-lg-4 col-md-5 col-sm-4 col-xs-4 text-left\\\">\" + a_comp[i][1] + \"</div>\";\n var arr_num = a_comp[i][3].toString().split('.');\n //console.log(arr_num.length);\n if (a_comp[i][3].toString().indexOf(\".\") != (-1)) {\n if (arr_num[1] < 10) {\n codice += \"<div class=\\\"col-lg-4 col-md-3 col-sm-4 col-xs-4 text-center\\\">\" + a_comp[i][2] + \"X\" + a_comp[i][3] + \"0 &euro;</div>\";\n } else {\n codice += \"<div class=\\\"col-lg-4 col-md-3 col-sm-4 col-xs-4 text-center\\\">\" + a_comp[i][2] + \"X\" + a_comp[i][3] + \" &euro;</div>\";\n }\n } else {\n //console.log(\"va\");\n codice += \"<div class=\\\"col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center\\\">\" + a_comp[i][2] + \"X\" + a_comp[i][3] + \".00 &euro;</div>\";\n }\n var prezzo = parseInt(a_comp[i][2]) * parseFloat(a_comp[i][3]);\n prezzo = arrotonda(prezzo, 2);\n codice += \"<div class=\\\"col-lg-3 col-md-4 col-sm-3 col-xs-4 text-right\\\">\" + prezzo + \" &euro;</div>\"\n + \"<div class=\\\"col-lg-12\\\"><hr></div>\"\n + \"</div>\";\n $('#area_ordine').append(codice);\n tot = tot + parseFloat(prezzo);\n tot = arrotonda(tot, 2);\n }\n $('#tot').empty();\n var cod = \"<h3><b>\" + tot + \" &euro;</b></h3>\"\n $('#tot').append(cod);\n}", "title": "" }, { "docid": "d3f30ede32cb94324917c2634709f13f", "score": "0.6097402", "text": "function recorrer (){\n var tableroTemp = {} //Almacena temporalmente el tablero completo para ir marcando los dulces visitados\n var tableroTemp = tablero;\n var x=0, y=0;\n for (x=0; x<7; x++){\n for (y=0; y<7; y++){\n xIni = x + 1, yIni = y + 1;\n var dulce = tablero[x][y];\n if (dulce != -1)\n compararRecursivo ({'tableroTemp': tableroTemp, 'dulce': dulce, 'x': x , 'y':y});\n if (tableroEliminar[xIni + '_' + yIni] != undefined){\n if ((Object.keys(tableroEliminar[xIni + '_' + yIni]).length) >= 3){\n }else delete tableroEliminar[xIni + '_' + yIni];\n }\n }\n }\n //Se eliminan los dulces visualmente\n eliminarDivs();\n }", "title": "" }, { "docid": "116d2ae4addb6da2e0ebad193a10f4f4", "score": "0.6096155", "text": "function recolectarAtrClaseArreglo(nodoArreglo){\r\n \r\n try{\r\n var objeto = false;\r\n var crearVar = true;\r\n\r\n //Visibilidad \r\n var visibilidad = nodoArreglo.getHijos()[0].getHijos()[0].getEtiqueta();\r\n //Tipo de nodoArreglo, si lo que viene es \"id\", entonces obtener su valor. \r\n var tipo = nodoArreglo.getHijos()[1].getHijos()[0].getEtiqueta();\r\n tipo = '('+tipo+')';\r\n if(tipo == \"(id)\"){\r\n objeto = true;\r\n tipo = nodoArreglo.getHijos()[1].getHijos()[0].getValor();\r\n }\r\n \r\n //nombre de ID\r\n var nombreArreglo = nodoArreglo.getHijos()[2].getValor();\r\n //Lista de dimensiones del lado izquierdo\r\n var Dimensiones = nodoArreglo.getHijos()[3];\r\n\r\n var tamTotalIzq = Auxiliar.getTemp();\r\n var listaDimensionesIzq = [];\r\n var listaDimensionesDer = [];\r\n var numDimensiones = 1;\r\n var isCadena = false;\r\n \r\n Auxiliar.agregarCuadruplo(tamTotalIzq + ' = ' + '1; //inicializamos contador de tamanio total de arreglo \\n');\r\n \r\n //Fase 1 --> lado izquierd: tamanioTotal, listaDimensionesIzq, numDimensiones.\r\n //Generacion de expresiones en dimensiones.\r\n for(var i = 0; i < Dimensiones.getHijos().length; i++)\r\n {\r\n var [Valor,TipoValor] = generarExpresion(Dimensiones.getHijos()[i]);\r\n if(TipoValor == \"(entero)\")\r\n {\r\n listaDimensionesIzq.push(Valor);\r\n Auxiliar.agregarCuadruplo(tamTotalIzq + ' = ' + tamTotalIzq + ' * ' + Valor + '; //fin de dimension '+ (i + 1) + ' ');\r\n Auxiliar.agregarCuadruplo('//---------')\r\n }\r\n else\r\n {\r\n tab_error.push(new Error(0,'Semántico','Las dimensiones debe de ser numéricas'));\r\n Auxiliar.agregarCuadruplo(tamTotalIzq + ' = ' + '1;')\r\n listaDimensionesIzq = [];\r\n crearVar = false;\r\n }\r\n }\r\n //Asiganamos cantidad de dimensiones.\r\n numDimensiones = listaDimensionesIzq.length;\r\n\r\n //--------------------------------------------------------------------------------------------------\r\n //Validadciones del lado derecho \r\n\r\n var ValorSimbolo = null;\r\n\r\n //Trae vaalor asignado\r\n if(nodoArreglo.getHijos().length == 5){\r\n ValorSimbolo = nodoArreglo.getHijos()[4];\r\n }else{\r\n ValorSimbolo = agregarInicializacion(tipo,true);\r\n }\r\n\r\n \r\n var tamTotalDer = ValorSimbolo.getHijos().length;\r\n \r\n //Verificando que los valores a asignar sean del mismo tipo \r\n for(var i = 0; i < tamTotalDer; i++)\r\n {\r\n var tipo_asig = ValorSimbolo.getHijos()[i].getEtiqueta();\r\n if(tipo_asig == 'instancia'){\r\n var [Valor, TipoValor] = obtenerInstancia(ValorSimbolo.getHijos()[i],tipo);\r\n }\r\n else if(tipo_asig == 'string_cad'){\r\n isCadena = true;\r\n var cadena = ValorSimbolo.getHijos()[0].getValor().replace(/\\\"/g,\"\").replace(/\\'/g,\"\");\r\n var posicion = 0;\r\n var escape = false;\r\n\r\n Auxiliar.agregarCuadruplo('//Inicio de asignacion a arreglo de la cadena: \\\"' + cadena + '\\\"' );\r\n\r\n for(var i = 0; i < cadena.length; i++){\r\n \r\n if(cadena[i] == '\\\\' && !escape)\r\n {\r\n escape = true;\r\n posicion = i;\r\n }\r\n else if(escape)\r\n {\r\n var TipoCaracterEspecial = cadena[i];\r\n switch(TipoCaracterEspecial)\r\n {\r\n case 'n': \r\n listaDimensionesDer.push(10);\r\n Auxiliar.agregarCuadruplo('//Codigo ascii de caracter \\\\n ');\r\n break;\r\n case '\\\\':\r\n listaDimensionesDer.push(92);\r\n Auxiliar.agregarCuadruplo('//Codigo ascii de caracter \\ ');\r\n break;\r\n case 't':\r\n listaDimensionesDer.push(9);\r\n Auxiliar.agregarCuadruplo('//Codigo ascii de caracter \\\\t ');\r\n break;\r\n }\r\n posicion = i;\r\n escape = false;\r\n }\r\n else\r\n {\r\n listaDimensionesDer.push(cadena.charCodeAt(i));\r\n Auxiliar.agregarCuadruplo('//Codigo ascii de caracter ' + cadena.charAt(i) + '');\r\n posicion = i;\r\n }\r\n }\r\n Auxiliar.agregarCuadruplo('//***************************************\\n');\r\n tamTotalDer = cadena.length;\r\n }\r\n else{\r\n var [Valor,TipoValor] = generarExpresion(ValorSimbolo.getHijos()[i]);\r\n }\r\n \r\n if(!isCadena){\r\n if(TipoValor == tipo)\r\n {\r\n listaDimensionesDer.push(Valor);\r\n }\r\n else if(TipoValor == \"(null)\"){\r\n TipoValor = \"(cadena)\"\r\n listaDimensionesDer = [];\r\n }\r\n else\r\n {\r\n tab_error.push(new Error(0,'Semántico','Los valores a asignar al arreglo \\''+ nombreArreglo+'\\' deben ser del mismo tipo'));\r\n listaDimensionesDer = [];\r\n crearVar = false;\r\n }\r\n }\r\n }\r\n\r\n if(crearVar)\r\n {\r\n //Verificamos si no existe la arreglo (atributo) en dentro de la clase.\r\n if(!existeStack(nombreArreglo))\r\n { \r\n var posicion2 = obtenerPosicion2(true) + 1;\r\n if(listaDimensionesDer.length==0){\r\n for(var i = 0; i < ValorSimbolo.getHijos().length; i++) listaDimensionesDer.push(valNulo);\r\n } \r\n \r\n if(tamTotalDer > 0){\r\n var et_v = Auxiliar.getEtq();\r\n var et_f = Auxiliar.getEtq();\r\n var salida = Auxiliar.getEtq();\r\n var ini = Auxiliar.getTemp();\r\n var temporal = Auxiliar.getTemp();\r\n \r\n Auxiliar.agregarCuadruplo(ini +' = H; //Inicia arreglo ' + nombreArreglo +'\\n');\r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = ' + tamTotalIzq +'; //Guardamos tamanio del arreglo');\r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n \r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = ' + numDimensiones +'; //Guardamos la cantidad de dimensiones');\r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n \r\n for(i = 0; i<numDimensiones; i++){\r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = ' + listaDimensionesIzq[i] +'; //Guardamos el tamanio de cada dimension');\r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n }\r\n \r\n //VALIDACION\r\n \r\n if(!isCadena){\r\n Auxiliar.agregarCuadruplo('if ('+ tamTotalIzq + ' == '+tamTotalDer+') goto '+et_v+';\\n'+'goto ' + et_f +';\\n');\r\n Auxiliar.agregarCuadruplo(et_v + ':');\r\n \r\n for(i = 0; i<tamTotalDer; i++){\r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = ' + listaDimensionesDer[i] +'; //Guardamos el tamanio de cada dimension');\r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n }\r\n }else{\r\n Auxiliar.agregarCuadruplo('if ('+ tamTotalIzq + ' >= '+tamTotalDer+') goto '+et_v+';\\n'+'goto ' + et_f +';\\n');\r\n Auxiliar.agregarCuadruplo(et_v + ':');\r\n \r\n var cont1 = Auxiliar.getTemp();\r\n var for_ini1 = Auxiliar.getEtq();\r\n var for_v1 = Auxiliar.getEtq();\r\n var for_f1 = Auxiliar.getEtq();\r\n var auxPrimeraPos = Auxiliar.getTemp();\r\n \r\n Auxiliar.agregarCuadruplo(cont1 + ' = 0; //inicializando contador');\r\n Auxiliar.agregarCuadruplo(auxPrimeraPos + ' = H;');\r\n Auxiliar.agregarCuadruplo(for_ini1 + ':');\r\n \r\n Auxiliar.agregarCuadruplo('if ('+ cont1 + ' < '+tamTotalIzq+') goto '+for_v1+';\\n'+'goto ' + for_f1 +';\\n');\r\n Auxiliar.agregarCuadruplo(for_v1 + ':');\r\n \r\n \r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n \r\n Auxiliar.agregarCuadruplo(cont1 + ' = ' + cont1 +' + 1;' );\r\n Auxiliar.agregarCuadruplo('goto ' + for_ini1+ ';\\n');\r\n Auxiliar.agregarCuadruplo(for_f1 + ':');\r\n \r\n for(i = 0; i<tamTotalDer; i++){\r\n Auxiliar.agregarCuadruplo(temporal + ' = '+auxPrimeraPos+' + '+i+';');\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = ' + listaDimensionesDer[i] +'; //Guardamos el tamanio de cada dimension');\r\n }\r\n \r\n }\r\n \r\n Auxiliar.agregarCuadruplo('goto ' + salida + ';');\r\n Auxiliar.agregarCuadruplo(et_f +':');\r\n \r\n var cont = Auxiliar.getTemp();\r\n var for_ini = Auxiliar.getEtq();\r\n var for_v = Auxiliar.getEtq();\r\n var for_f = Auxiliar.getEtq();\r\n \r\n Auxiliar.agregarCuadruplo(cont + ' = 0; //inicializando contador');\r\n Auxiliar.agregarCuadruplo(for_ini + ':');\r\n \r\n Auxiliar.agregarCuadruplo('if ('+ cont + ' < '+tamTotalIzq+') goto '+for_v+';\\n'+'goto ' + for_f +';\\n');\r\n Auxiliar.agregarCuadruplo(for_v + ':');\r\n \r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n if(tipo == '(entero)' || tipo == '(bool)' || tipo == '(decimal)'){\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = 0; //Guardamos el tamanio de cada dimension');\r\n }\r\n else if(tipo == '(caracter)'){\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = 666; //Guardamos el tamanio de cada dimension');\r\n } \r\n \r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n \r\n Auxiliar.agregarCuadruplo(cont + ' = ' + cont +' + 1;' );\r\n Auxiliar.agregarCuadruplo('goto ' + for_ini+ ';\\n');\r\n Auxiliar.agregarCuadruplo(for_f + ':');\r\n Auxiliar.agregarCuadruplo(salida + ':');\r\n Auxiliar.agregarCuadruplo(temporal + ' = H;');\r\n Auxiliar.agregarCuadruplo('heap['+temporal+'] = 0 ; //Posicion final');\r\n Auxiliar.agregarCuadruplo('H = H + 1; \\n');\r\n \r\n var tempo1 = Auxiliar.getTemp();\r\n \r\n Auxiliar.agregarCuadruplo(tempo1 + ' = S + ' + posicion2 + '; //pos relativa de \\\"'+nombreArreglo+'\\\"'); \r\n Auxiliar.agregarCuadruplo('stack[' + tempo1 + '] = ' + ini + '; //Se crea la variable global ' + nombreArreglo + '\\n'); \r\n \r\n }\r\n var cont = new Contenido(nombreArreglo,tipo,true,tamTotalIzq,true,null,null,null,listaDimensionesIzq,listaDimensionesDer,true,null,objeto,posicion2,false,false,false);\r\n agregarSimbolo(nombreArreglo,tipo,funcionActual,'variable',posicion2);\r\n listaActual.ListaObjetos[listaActual.ListaObjetos.length - 1].listContenido.push(cont);\r\n posAtr++;\r\n }\r\n else{\r\n var error = new Error(0,'Semántico','La variable \\'' + nombreArreglo + '\\' ya existe en la funcion \\\"'+funcionActual+'\\\"');\r\n agregarError(error);\r\n }\r\n }\r\n \r\n }\r\n catch(err)\r\n {\r\n console.log('Error en la parte de asignacion a los arreglos.');\r\n tab_error.push(new Error(0,'Semántico',err));\r\n }\r\n}", "title": "" }, { "docid": "07995303e3371114b40535c950951942", "score": "0.6068262", "text": "function encuentro_mruv1(){\r\n var posicion_final_mruv_1;\r\n var posicion_mruv_1 = pasaje_uni_pos(get_pos1(), get_sel_pos1())\r\n var velocidad_mruv_1 = pasaje_uni_vel(get_vel1(), get_sel_vel1())\r\n var tiempo_mruv_1 = pasaje_uni_ti(get_tiem1(), get_sel_tiem1())\r\n var aceleracion_mruv_1 = pasaje_uni_acel(get_acel1(), get_sel_acel1())\r\n posicion_final_mruv_1 = posicion_mruv_1 + (velocidad_mruv_1*tiempo_mruv_1) + ((1/2*aceleracion_mruv_1)*(tiempo_mruv_1*tiempo_mruv_1));\r\n return posicion_final_mruv_1;\r\n}", "title": "" }, { "docid": "f78537eb17b969ab9fbedec016e07615", "score": "0.60674834", "text": "function dameDinero(){ \n \nvar entregadoFake= 0;\n \nvar available= document.getElementById(\"disponible\"); \n/* Se vuelve a hacer la misma operacion para guardar la \ncantidad de dinero disponible! */ \n \nvar papeles; \n\nvar entregado=[];\n\nvar devolver= [];\n \ncontador++; /* El contador empieza a incrementar por\n cada transaccion! */ \n \nentregados.innerHTML= \"\"; /* Cada vez que se hace click \npara solicitar un nuevo monto, la pantalla que guarda \nlos billetes se resetea y coloca la nueva solicitud! */ \n\nvar cifra= document.getElementById(\"cifra\"); /* Cuanto pido! */ \n \ncifra = parseInt(cifra.value); \n \nif(cifra>disponibleCaja){\n\n transaccion.innerHTML+=\"Transacción # \" + contador + \"= <strong>\" + \"Fallida\" + \"<strong><br>\";\n entregados.innerHTML= \"<strong>No hay dinero suficiente en el cajero</strong>\";\n\n}else if(cifra<=disponibleCaja){\n\n var nuevoMonto= 0;/* El mismo procedimiento, la variable \n que guarda la sumatoria de lo disponible en caja debe \n empezar en cero! */ \n\n for(var bi of caja){ \n \n if(cifra > 0){\n \n div= Math.floor(cifra/bi.valor);\n \n if(div > bi.cantidad){\n \n papeles = bi.cantidad; \n \n }//cierra if div>bi.cantidad!\n \n else if(div <= bi.cantidad){\n \n papeles= div; \n \n } //else if! \n \n entregado.push(new billete(bi.valor, papeles));\n\n devolver.push(new billete(bi.valor, bi.cantidad));/* \n En el caso de que al final la cifra > 0 se debe garantizar \n que la caja quede intacta ya que papeles siempre se descuenta */\n \n cifra= cifra - papeles*bi.valor;\n /* A cifra se le va restando lo extraído por \n cada billete puesto en evaluación! */ \n\n bi.cantidad= bi.cantidad - papeles;\n /* La nueva cantidad de billetes en caja! */\n\n \n }// Cierra el if cifra > 0 \n\n nuevoMonto+= bi.cantidad*bi.valor; \n /* Se calcula lo que queda en caja una vez se haga \n la transaccion! */ \n \n } //cierra el for (var bi of caja)! \n\n if(cifra>0){\n\n caja= devolver; /* En el caso de que la transacción sea fallida\n el dinero descontado debe ser devuelto */\n \n console.log(devolver);\n \n transaccion.innerHTML+=\"Transacción # \" + contador + \"= <strong>\" + \"Fallida\" + \"<strong><br>\";\n entregados.innerHTML= \"<strong>No existe ese tipo de billetes para darte esa cantidad</strong>\"; \n \n }// Cierra el cifra > 0!\n\n else if(cifra==0){\n\n disponibleCaja= nuevoMonto;\n \n for(var e of entregado){\n \n if(e.cantidad > 0){\n \n transaccion.innerHTML+=\"Transacción # \" + contador + \"= <strong>\" + e.cantidad + \"</strong>\" + \" billetes de $ <strong>\" + e.valor + \"</strong><br>\"; \n \n }// Cierra el if e.cantidad > 0!\n \n for(var i= 0; i< e.cantidad; i++){\n \n e.mostrar();//el mostrar se ejecutará tantas veces se piden billetes! Si no se colocara dentro del for solo aparecería un billete sin importar cuantos pidas!\n \n }//cierra el for var i= 0; i< e.cantidad; i++! \n \n }// Cierra el var e of entregado! \n \n }//Cierra el else!\n \n available.innerHTML= \"Disponible en caja: \" + disponibleCaja; //Se resetea lo disponible en caja y se coloca el nuevo monto! \n cifra= \"\"; //Para que se pueda volver a ejecutar el click sin necesidad de terminar! \n\n}\n\n}//Cierra el dameDinero!", "title": "" }, { "docid": "6fa3ec4c5a135df11248d3c120521fe8", "score": "0.6064781", "text": "function totalCompra(){\n\t\n\t//Obter os valores de composição do valor total da compra\n\tvar totalProdutoTxt = document.getElementsByClassName(\"totalProdutos\");\n\tvar totalProduto = textToFloat(totalProdutoTxt[0].innerHTML);\n\tvar totalFreteTxt = document.getElementsByClassName(\"frete\");\n\tvar totalFrete = textToFloat(totalFreteTxt[0].innerHTML);\n\tvar totalDescontoTxt = document.getElementsByClassName(\"desconto\");\n\tvar totalDesconto = textToFloat(totalDescontoTxt[0].innerHTML);\n\tvar totalCompraTxt = document.getElementsByClassName(\"totalVenda\");\n\t//Total da compra\n\tvar totalCompra = 0.0;\n\t\n\t//Validações\n\tif(totalProduto > margemFrete){\n\t\ttotalFrete = 0.0;\n\t\ttotalFreteTxt[0].innerHTML = \"R$ 0.00\";\n\t}\n\t//calculando valor total da compra\n\ttotalCompra = ((totalProduto + totalFrete) - totalDesconto);\n\t\n\t//Cupom de desconto cobre o valor da venda?\n\tif(totalCompra < 0){\n\t\t//Converter o resíduo da venda em cupom de desconto\n\t\tvar residuo = totalCompra * -1;\n\t\tresiduo = floatToText(residuo);\n\t\talert(\"A compra vai gerar um cupom de desconto no valor de: \" + residuo);\n\t\t//Inserir valor zerado neste caso\n\t\ttotalCompraTxt[0].innerHTML = \"R$ 0.00\";\n\t}else{\n\t\t//Inserir valor total da compra\n\t\ttotalCompraTxt[0].innerHTML = floatToText(totalCompra);\n\t}\n\t//valor ainda está zerado ?\n\tif(totalCompra == 0){\n\t\ttotalCompraTxt[0].innerHTML = \"R$ 0.00\";\n\t}\n}", "title": "" }, { "docid": "bc6e47615e0f09a7fbf8132f4e765a96", "score": "0.605973", "text": "function pegaValores(valoresEscolhidos) {\n\n // esse -2 são elementos dentro de Object desnecessários\n let tamanho = Object.values(valoresEscolhidos).length - 2\n let valoresX = []\n\n for (let i = 1; tamanho / 2 >= i; i++) {\n valoresX.push(valoresEscolhidos[`A${i}`].v)\n }\n \n\n let valoresY = []\n\n for (let i = 1; tamanho / 2 >= i; i++) {\n valoresY.push(valoresEscolhidos[`B${i}`].v)\n }\n \n\n // removendo primeiro elem. do array (é o nome da coluna na planilha)\n valoresX.shift()\n valoresY.shift()\n\n \n\n // ao final os inputs recebem o que foi processado na planilha\n document.getElementById('varXImport').value = valoresX.join(';')\n document.getElementById('varYImport').value = valoresY.join(';')\n \n}", "title": "" }, { "docid": "3acebd5b52b26effd63f168ed23a6d33", "score": "0.6054216", "text": "function lista_reproduccion_comerciales(){\r\n\t\t\t// Añandiendo a lista de reproduccion los comerciales\r\n\t\t\tvar i=0; j=0, k=0; \r\n\t\t\tvar inicio=0;\r\n\t\t\tfor(i=0; i< comerciales.length ; i++){\r\n\t\t\t\tinicio=\t parseInt(comerciales[i].contador);\r\n\t\t\t\tif(parseInt(comerciales[i].tipo) != 2){\r\n\t\t\t\t\tif((inicio+parseInt(comerciales[i].Ntracks))<=comerciales[i].lista.length){\r\n\t\t\t\t\t\tfor(j=inicio,k=0; j< parseInt(comerciales[i].Ntracks)+inicio; j++,k++){\r\n\t\t\t\t\t\t\tcomerciales[i].reproduccion[k]=comerciales[i].lista[j];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t// aqui va ultima posicion y audio\t\r\n\t\t\t\t\t}else if(j<comerciales[i].lista.length){\r\n\t\t\t\t\t\tfor(j=inicio,k=0; j<comerciales[i].lista.length; j++,k++){\r\n\t\t\t\t\t\t\tcomerciales[i].reproduccion[k]=comerciales[i].lista[j];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(k < parseInt(comerciales[i].Ntracks)){\r\n\t\t\t\t\t\t\tmezclar(comerciales[i].lista,i,comerciales[i]);\r\n\t\t\t\t\t\t\tvar tope=parseInt(comerciales[i].Ntracks)-k;\t\r\n\t\t\t\t\t\t\tfor(var w=0; w < tope; w++,k++){\r\n\t\t\t\t\t\t\t\tcomerciales[i].reproduccion[k]=comerciales[i].lista[w];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tj=w;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcomerciales[i].contador=j; // ultima posicion de la lista genero de reproduccion\r\n\t\t\t\t\tcomerciales[i].ultima= comerciales[i].lista[j]; // ultimo audio de la lista de reproduccion\r\n\t\t\t\t\tif(comerciales[i].lista.length==j){\r\n\t\t\t\t\t\tmezclar(comerciales[i].lista,i,comerciales[i]);\r\n\t\t\t\t\t\tcomerciales[i].contador=0; // ultima posicion de la lista genero de reproduccion\r\n\t\t\t\t\t\tcomerciales[i].ultima= \"\";\r\n\t\t\t\t\t\tj=0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//console.log(comerciales);\r\n//\t\t\tmostrarListaComerciales();\r\n\t\t}", "title": "" }, { "docid": "3f3fcd54f84a7c919b56ce4a446d69cb", "score": "0.6052693", "text": "indietro(){ \r\n (this.contatore1 == 0) ? this.contatore1 = this.immagini.length -1 : this.contatore1--\r\n (this.contatore2 == 0) ? this.contatore2 = this.immagini.length -1 : this.contatore2--\r\n (this.contatore3 == 0) ? this.contatore3 = this.immagini.length -1 : this.contatore3--\r\n (this.contatore4 == 0) ? this.contatore4 = this.immagini.length -1 : this.contatore4--\r\n (this.contatore5 == 0) ? this.contatore5 = this.immagini.length -1 : this.contatore5--\r\n }", "title": "" }, { "docid": "9f3effddc63a1b1a03426f482f9e81d9", "score": "0.6044469", "text": "function iniciaConvoy() {\n \n enemigos = enemigos.filter(function(enemigo) {\n return false;\n })\n \n for (fila = 0; fila < 5; fila++) {\n for (columna = 0; columna < 11; columna++) {\n x = (columna*50)+75;\n y= (fila*35)+75;\n switch (fila) {\n case 0: tipoEnemigo = tipo1;\n break;\n case 1:\n case 2: tipoEnemigo = tipo2;\n break;\n case 3:\n case 4: tipoEnemigo = tipo3;\n }\n enemigos.push({\n x: x,\n y: y,\n tipo: tipoEnemigo,\n sprite: 0,\n estado: VIVO\n });\n }\n }\n \n }", "title": "" }, { "docid": "10159ccb3d882dec14170101e6653291", "score": "0.60440224", "text": "function evoluciona(){\n $('.loading').removeClass('hide');\n poblacionInicial \t= $('#poblacion').val();\n pc \t\t\t\t\t= $('#cruzamiento').val();\n pm \t\t\t\t\t= $('#mutacion').val();\n generaciones \t\t= $('#generaciones').val();\n iniciaPoblacion();\n evaluaPoblacion();\n datosGeneraciones \t= [];\n console.table(poblacionAlInicio);\n $('.res-ag').removeClass('toHide');\n graficaPastel('#genoma-inicio', poblacionAlInicio, 'Distribución al inicio');\n imprimeTablaInicial();\n for(var k=0;k<generaciones;k++){\n evaluaPoblacion();\n var padre = {};\n padre.A = seleccionPadres();\n padre.B = seleccionPadres();\n console.log('Padres:');\n console.log(padre);\n var hijos = cruzamiento(padre);\n var mutados = mutacion(hijos);\n sustituyePoblacion(mutados);\n evaluaPoblacion();\n datosGeneraciones.push(obtieneDatosGeneracion());\n }\n console.table(poblacion);\n imprimeTablaFinal();\n graficaGenoma(datosGeneraciones);\n graficaPastel('#genoma-final', poblacion, 'Distribución al final');\n}", "title": "" }, { "docid": "dc56efcf2f4023bfb6de3e41b1aba2f7", "score": "0.60413426", "text": "async function cargarPantallaInvertirEnProyectos(){\n\n\t// Consultar addres de promotores\n\tawait desbloqueaCuenta(cuentaPlataforma);\n\tawait desbloqueaCuenta(ctaPromotor);\n\n\tconst listaDePromotores = await instPlatPromoInver.methods.listarPromotoress().call( {from: cuentaPlataforma, gas: 300000});\n\n\tfor (let ctaPromotor of listaDePromotores) {\n\n\t\t// Consultar datos de cada promotor\t\t\n\t\tconst promotor = await instPlatPromoInver.methods.consultarPromotor(ctaPromotor).call( {from: ctaPromotor, gas: 300000});\n\n\t\tplantillaPromotoresParaInvertir(ctaPromotor,\n\t\t\tpromotor.nombre,\n\t\t\tpromotor.cif);\n\n\t\tfor (let idProyecto of promotor.listadoProyectos) {\t\t\n\n\t\t\t// Consultar datos de cada proyecto\n\t\t\tconst proyecto = await instPlatPromoInver.methods.consultarProyecto(idProyecto).call( {from: ctaPromotor, gas: 300000});\n\n\t\t\tconst balanceProyecto = await instPlatPromoInver.methods.consultarTokensInvertidosEnProyecto(idProyecto).call( {from: ctaPromotor, gas: 300000});\n\n\t\t\tplantillaAddProyecto(ctaPromotor, \n\t\t\t\tidProyecto,\n\t\t\t\tproyecto.nombre,\n\t\t\t\tproyecto.tokensGoal,\n\t\t\t\tproyecto.rentabilidad,\n\t\t\t\ttraduceEstado(proyecto.estadoProyecto), \n\t\t\t\tproyecto.fechaInicioFinanciacion, \n\t\t\t\tproyecto.fechaFinFinanciacion,\n\t\t\t\tproyecto.fechaInicioEjecucion,\n\t\t\t\tproyecto.fechaFinEjecucion,\n\t\t\t\tbalanceProyecto);\t\t\t\n\n\t\t}\t\t\t\n\t}\t\n}", "title": "" }, { "docid": "f64a7836080c6909dc82d49f129f00c6", "score": "0.602466", "text": "function tendencia_central(vetordados, tipo_variavel, total) {\r\n let vetor_aux2 = vetordados.slice(0, vetordados.length)\r\n let stringmediana = \"\"\r\n let stringmoda = \"\"\r\n let stringmedia = \"\"\r\n if (tipo_variavel == 1 || tipo_variavel == 2) {\r\n\r\n stringmediana = achando_mediana(vetordados, total, tipo_variavel)\r\n stringmoda = achando_moda(vetordados, vetor_aux2, tipo_variavel)\r\n\r\n stringmedia = \"Não possui média\"\r\n\r\n } // tipo de variavel nominal e ordinal fim\r\n else if (tipo_variavel == 3) {\r\n //média \r\n let soma = 0\r\n for (let i = 0; i < vetor_aux2.length; i++) {\r\n soma += Number(vetor_aux2[i]['nome'] * vetor_aux2[i]['valor'])\r\n }\r\n stringmedia = soma / total\r\n stringmediana = achando_mediana(vetordados, total, tipo_variavel)\r\n stringmoda = achando_moda(vetordados, vetor_aux2, tipo_variavel)\r\n } else if (tipo_variavel == 4) {\r\n let soma = 0\r\n\r\n for (let i = 0; i < vetor_aux2.length; i++) {\r\n let media_simples = 0\r\n media_simples = Number((vetor_aux2[i]['limite_inferior'] + vetor_aux2[i]['limite_superior']) / 2)\r\n soma += Number(vetor_aux2[i]['valor'] * media_simples)\r\n\r\n }\r\n stringmedia = soma / total\r\n stringmoda = achando_moda(vetordados, vetor_aux2, tipo_variavel)\r\n\r\n\r\n let possiveis_medianas_continua = achando_mediana(vetordados, total, tipo_variavel)\r\n\r\n for (a = 0; a < vetordados.length; a++) {\r\n let nome1 = vetordados[a]['nome']\r\n if (possiveis_medianas_continua[0] == nome1) {\r\n let somatoria = Math.ceil(total / 2)\r\n let fant = vetordados[a - 1]['Frequencia acumulada']\r\n let fimd = vetordados[a][\"valor\"]\r\n let h = vetordados[a]['limite_superior'] - vetordados[a]['limite_inferior']\r\n let i = vetordados[a]['limite_inferior']\r\n let fracao = (somatoria - fant) / fimd\r\n let md = (fracao * h) + i\r\n stringmediana = md\r\n }\r\n }\r\n }\r\n\r\n // criando a tabela dos pontos mediais \r\n // cria o cabeçalho da tabela\r\n let linha_nomes = document.createElement('tr')\r\n linha_nomes.id = 'cabecalho'\r\n pontos_centrais.appendChild(linha_nomes)\r\n //média\r\n let media = document.createElement('td')\r\n media.id = 'media'\r\n media.innerText = \"Média\"\r\n linha_nomes.appendChild(media)\r\n //Mediana\r\n let mediana_tabela = document.createElement('td')\r\n mediana_tabela.id = 'mediana_tabela'\r\n mediana_tabela.innerText = \"Mediana\"\r\n linha_nomes.appendChild(mediana_tabela)\r\n //Moda\r\n let moda_tabela = document.createElement('td')\r\n moda_tabela.id = 'moda_tabela'\r\n moda_tabela.innerText = \"Moda\"\r\n linha_nomes.appendChild(moda_tabela)\r\n //inserindo os valores \r\n //CRIAR LINHA NA TABELA\r\n let linha = document.createElement('tr')\r\n pontos_centrais.appendChild(linha)\r\n //valor da média\r\n let cel1 = document.createElement('td')\r\n cel1.id = 'media_valor'\r\n cel1.innerText = stringmedia\r\n linha.appendChild(cel1)\r\n //valor da mediana\r\n let cel2 = document.createElement('td')\r\n cel2.id = 'mediana_valor'\r\n cel2.innerText = stringmediana\r\n linha.appendChild(cel2)\r\n //valor da moda\r\n let cel3 = document.createElement('td')\r\n cel3.id = 'moda_valor'\r\n cel3.innerText = stringmoda\r\n linha.appendChild(cel3)\r\n\r\n desvio_padrão(vetor_final2, tipo_variavel, total, stringmedia)\r\n}", "title": "" }, { "docid": "aa1e7e20f9abf751d24e6e9fc60079d5", "score": "0.6022318", "text": "function MeucaninoPorcentagem(){\n //para cães grandes\n let calculo = MeuCaninoFeliz.valores.semanal.grandes * 20/100\n\n calculo = calculo + MeuCaninoFeliz.valores.semanal.grandes\n\n MeuCaninoFeliz.valores.fimDeSemana.grandes = calculo\n \n\n //para cães pequenos\n calculo = MeuCaninoFeliz.valores.semanal.pequenos * 20/100\n\n calculo = calculo + MeuCaninoFeliz.valores.semanal.pequenos\n\n MeuCaninoFeliz.valores.fimDeSemana.pequenos = calculo\n\n }", "title": "" }, { "docid": "9deb2a2af9f40d002fd5a21b874654ea", "score": "0.6021322", "text": "function aumentarVelocidad() {\n multiplicadorVelocidad *= 1.62;\n}", "title": "" }, { "docid": "091971c555c5d64a945e89bb4012e5c6", "score": "0.6016438", "text": "function datos_tier(){\n var cantidad_puertos=[];\n var cant_embar_puerto=[];\n var contador=0;\n var cantidad_unit=0;\n var cantidad_lingas=0;\n var primero=0;\n var puerto=0;\n var padre=$(\"#tabla_datos\");\n var id_tier= $(\".lienzo:visible\").attr(\"id\");\n // Para obtener la cantidad de puertos a los que van las lingas de respectivo\n // TIER guardandolas en un JSON (cantidad_puertos)\n for(i=0;i<Linga.length;i++){\n if(id_tier == Linga[i].tier){\n if(puerto==0) {\n puerto=Linga[i].id_puerto;\n cantidad_puertos.push({id_puerto:puerto});\n }else{\n if(puerto!=Linga[i].id_puerto){\n puerto=Linga[i].id_puerto;\n cantidad_puertos.push({id_puerto:puerto});\n }\n }\n cant_embar_puerto.push({id_puerto:Linga[i].id_puerto,id_unit:Linga[i].id_unit });\n }\n }\n\n puerto=0;// inicializo variable puerto para ocuparla nuevamente\n\n $(\"#tabla_datos\").empty(); // Borro todos los datos que existan en la tabla para reescribirlos nuevamente\n\n cant_embar_puerto=removeDuplicates( cant_embar_puerto);\n var id_de_puerto=0;\n\nvar lingas_t=0,unit_t=0,peso_t=0;\nvar lingas_total_tier=0,unit_total_tier=0,peso_total_tier=0;\n for(j=0;j<cant_embar_puerto.length;j++){\n if(j==0){\n id_de_puerto=cant_embar_puerto[j].id_puerto;\n for(i=0;i<Linga.length;i++){\n if(id_tier == Linga[i].tier && cant_embar_puerto[j].id_puerto==Linga[i].id_puerto && cant_embar_puerto[j].id_unit==Linga[i].id_unit){\n puerto=Linga[i].id_puerto;\n cantidad_unit=parseInt(cantidad_unit)+parseInt(Linga[i].cantidad);\n cantidad_lingas++;\n embarcador=Linga[i].id_unit;\n nombre_del_puerto=Linga[i].nombre_puerto;\n peso_t=parseFloat(peso_t)+parseFloat(Linga[i].peso);\n }\n }\n var datos=$(\"<tr><td>\"+bodega+\"</td><td>\"+tier_seleccion+\"</td><td>\"+nombre_del_puerto+\"</td><td >\"+NameEmb(embarcador)+\"</td><td>\"+cantidad_unit+\"</td><td>\"+cantidad_lingas+\"</td><td>\"+parseFloat(peso_t.toFixed(3))+\" Tn</td></tr>\")\n padre.append(datos);\n lingas_total_tier= lingas_total_tier+cantidad_lingas;\n unit_total_tier=unit_total_tier+cantidad_unit;\n peso_total_tier=peso_total_tier+peso_t;\n embarcador=0;\n cantidad_unit=0;\n cantidad_lingas=0;\n peso_t=0;\n\n\n }else{\n for(i=0;i<Linga.length;i++){\n if(id_tier == Linga[i].tier && cant_embar_puerto[j].id_puerto==Linga[i].id_puerto && cant_embar_puerto[j].id_unit==Linga[i].id_unit){\n puerto=Linga[i].id_puerto;\n cantidad_unit=parseInt(cantidad_unit)+parseInt(Linga[i].cantidad);\n cantidad_lingas++;\n embarcador=Linga[i].id_unit;\n nombre_del_puerto=Linga[i].nombre_puerto;\n peso_t=parseFloat(peso_t)+parseFloat(Linga[i].peso);\n\n }\n }\n\n var datos=$(\"<tr><td>\"+bodega+\"</td><td>\"+tier_seleccion+\"</td><td>\"+nombre_del_puerto+\"</td><td>\"+NameEmb(embarcador)+\"</td><td>\"+cantidad_unit+\"</td><td>\"+cantidad_lingas+\"</td><td>\"+parseFloat(peso_t.toFixed(3))+\" Tn</td></tr>\")\n padre.append(datos);\n lingas_total_tier= lingas_total_tier+cantidad_lingas;\n unit_total_tier=unit_total_tier+cantidad_unit;\n peso_total_tier=peso_total_tier+peso_t;\n\n embarcador=0;\n cantidad_unit=0;\n cantidad_lingas=0;\n\n }\n\n }\n var datos=$(\"<tr class='total_tier'><td>Bod\"+bodega+\"</td><td colspan='3' class='centrado' > Tier \"+tier_seleccion+\"</td><td>\"+unit_total_tier+\"</td><td>\"+lingas_total_tier+\"</td><td>\"+parseFloat(peso_total_tier.toFixed(3))+\" Tn</td></tr>\")\n padre.append(datos);\n}", "title": "" }, { "docid": "15514d75cc99dfeba31bfe3daf17e264", "score": "0.60068136", "text": "volverInicio(){\n this.limpiarRestos();\n this.add(this.nave);\n this.nave.setVidas(5);\n this.nave.setDisparoDoble(false);\n\n for(let i=0;i<this.enemigos.length;i++){\n this.remove(this.enemigos[i]);\n }\n\n this.enemigos=[];\n this.enemigosCargados = false;\n this.oleada = 1;\n this.juegoEmpezado = false;\n this.finJuego = false;\n }", "title": "" }, { "docid": "751a90f5d19c0f076456a3e337a38de4", "score": "0.5999406", "text": "function voltea(idCarta){\n partida.cartas[idCarta].voltea();\n document.getElementById(idCarta).src=partida.cartas[idCarta].imagen;\n partida.pareja.push(partida.cartas[idCarta]);\n if(partida.cartas[idCarta].volteada){\n partida.contador++;\n } else {\n partida.contador--;\n } \n}", "title": "" }, { "docid": "06548186540864e5e74fc08ed3f5df28", "score": "0.5993342", "text": "function ipotecaTerreno(){\n\n //verifico che il terreno esista e salvo il risultato in proprietà\n var n = EsisteTerreno(props.terreni, terreno);\n \n if(n === -1){\n setTestoIpoteche('Controlla che il nome del terreno sia scritto in modo corretto');\n setOpenIpoteche(true); \n return;\n }\n var proprietà = props.terreni[n];\n \n \n //verifico che sul terreno non ci siano ne case ne alberghi\n if(proprietà.case > 0 || proprietà.alberghi > 0){\n setTestoIpoteche('Non puoi ipotecare un terreno con case o alberghi');\n setOpenIpoteche(true); \n return;\n }\n //verifico che il turnoGiocatore sia proprietario di proprietà\n if((proprietà.proprietario !== props.turnoGiocatore)){\n setTestoIpoteche('Non puoi ipotecare una proprietà che non ti appartiene');\n setOpenIpoteche(true);\n return;\n }\n\n //verifico che il terreno non si già ipotecato\n if (proprietà.ipotecato === true) {\n setTestoIpoteche('Non puoi ipotecare una proprietà già ipotecata');\n setOpenIpoteche(true);\n return;\n }\n \n //modifico l'array terreni e l'array giocatori\n proprietà.ipotecato = true;\n var nuoviTerreni = props.terreni;\n nuoviTerreni[n] = proprietà;\n props.setTerreni(nuoviTerreni);\n\n var nuoviGiocatori = props.giocatori;\n var guadagno = proprietà.valore/2;\n nuoviGiocatori[props.turnoGiocatore].capitale = nuoviGiocatori[props.turnoGiocatore].capitale + guadagno;\n props.setGiocatori(nuoviGiocatori);\n\n setTestoIpoteche('Questa proprietà è stata ipotecata. Hai guadagnato:'+guadagno);\n setOpenIpoteche(true); \n }", "title": "" }, { "docid": "61e1ed459a271df8fd0cccbb610d899d", "score": "0.5986158", "text": "function movimentaCarro(){\n for(let i = 0; i < 3; i++){ \n xCarros[i] -= velocidadeCarros [i];\n if (xCarros[i] <= -50){\n xCarros[i] = 600;\n }\n }\n for(let i = 3; i < 6; i++){ \n xCarros[i] += velocidadeCarros [i];\n if (xCarros[i] >= 650){\n xCarros[i] = 0;\n }\n }\n}", "title": "" }, { "docid": "feadab0da0852b1f7475aa47031bdd9a", "score": "0.59791076", "text": "function fnc_cb_calcular_importes() {\n\n\t// ::::::::::::: Calculando Totales del Documento - Inicio :::::::::::::\n\tvar pl_ccod_mon = '';\n\tvar pl_ncam = 0;\n\tvar pl_nimp_n = 0;\n\tvar pl_nimp_i = 0;\n\tvar pl_nimp_d = 0;\n\tvar pl_nimp_t = 0;\n\t\n\tfa_fa_fa_tt = [];\n\t\n\t// Obtenemos lista de monedas\n\tvar da_fa_fa_ln_cod_mon = fnc_Array_EliminarDuplicados(fa_fa_fa_it, \"ccod_mon_lt\");\n\tfor (var i = 0; i < da_fa_fa_ln_cod_mon.length; i++) {\n\t\t\n\t\tpl_ccod_mon = da_fa_fa_ln_cod_mon[i].ccod_mon_lt;\n\t\tpl_ncam = da_fa_fa_ln_cod_mon[i].ncam;\n\t\t\n\t\t// Limpiamos valores para cada Tipo de Moneda\n\t\tpl_nimp_n = 0;\n\t\tpl_nimp_i = 0;\n\t\tpl_nimp_d = 0;\n\t\tpl_nimp_t = 0;\n\t\t\n\t\t// Filtramos items por Tipo de Moneda\n\t\tvar fa_fa_fa_it_x_ccod_mon = fa_fa_fa_it.filter(function (row) {return row.ccod_mon_lt === pl_ccod_mon;});\n\t\tfor (var i2 = 0; i2 < fa_fa_fa_it_x_ccod_mon.length; i2++) {\t\t\n\t\t\t// Sumanos valores por Tipo de Moneda\n\t\t\tpl_nimp_n = pl_nimp_n + parseFloat(fa_fa_fa_it_x_ccod_mon[i2].nimp_n);\n\t\t\tpl_nimp_i = pl_nimp_i + parseFloat(fa_fa_fa_it_x_ccod_mon[i2].nimp_i);\n\t\t\tpl_nimp_d = pl_nimp_d + parseFloat(fa_fa_fa_it_x_ccod_mon[i2].nimp_d);\n\t\t\tpl_nimp_t = pl_nimp_t + parseFloat(fa_fa_fa_it_x_ccod_mon[i2].nimp_t);\n\t\t}\n\t\t\n\t\t// Agregamos registro Total Proceso por Tipo de Moneda\n\t\tfa_fa_fa_tt.push(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"ccod_mon\": pl_ccod_mon,\n\t\t\t\t\t\t\t\t\"ncam\": pl_ncam,\n\t\t\t\t\t\t\t\t\"nimp_n\": pl_nimp_n,\n\t\t\t\t\t\t\t\t\"nimp_i\": pl_nimp_i,\n\t\t\t\t\t\t\t\t\"nimp_d\": pl_nimp_d,\n\t\t\t\t\t\t\t\t\"nimp_t\": pl_nimp_t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t}\n\t// ::::::::::::: Calculando Totales del Documento - Fin :::::::::::::\n\n\t// ::::::::::::: Calculando Totales de Impuestos del Documento - Inicio :::::::::::::\n\tvar pc_ccod_mon = '';\n\tvar pn_ncam = 0;\n\t\n\tvar pn_nimp_imp = 0;\n\n\tfa_fa_fa_imp_tt = [];\n\t\n\t// Obtenemos lista de impuestos\n\tvar pc_ccod_imp = '';\n\tvar pn_ntasa_imp = 0;\n\tvar pc_cdsc_imp = '';\n\t\n\tvar pa_fa_fa_it_imp_x_ccod_imp = fnc_Array_EliminarDuplicados(fa_fa_fa_it_imp_tt, \"ccod_imp\");\n\tfor (var i0 = 0; i0 < pa_fa_fa_it_imp_x_ccod_imp.length; i0++) {\t\n\n\t\t// Valores del Impuesto\n\t\tpc_ccod_imp = pa_fa_fa_it_imp_x_ccod_imp[i0].ccod_imp;\n\t\tpn_ntasa_imp = pa_fa_fa_it_imp_x_ccod_imp[i0].ntasa_imp;\n\t\tpc_cdsc_imp = pa_fa_fa_it_imp_x_ccod_imp[i0].cdsc_imp;\n\n\t\tpn_nid_imp = i0 + 1;\n\t\t\n\t\t// Obtenemos lista de monedas\n\t\tvar fa_fa_fa_it_imp_cod_mon = fnc_Array_EliminarDuplicados(fa_fa_fa_it_imp_tt, \"ccod_mon\");\n\t\tfor (var i = 0; i < fa_fa_fa_it_imp_cod_mon.length; i++) {\n\t\t\t\n\t\t\tpc_ccod_mon = fa_fa_fa_it_imp_cod_mon[i].ccod_mon;\n\t\t\tpn_ncam = fa_fa_fa_it_imp_cod_mon[i].ncam;\n\t\t\t\n\t\t\t// Limpiamos valores para cada Tipo de Moneda\n\t\t\tpn_nimp_imp = 0;\n\t\t\t\n\t\t\t// Filtramos items por Tipo de Moneda y Tipo de Impuesto\n\t\t\tvar pa_fa_fa_it_imp_result = fa_fa_fa_it_imp_tt.filter(function (row) {return row.ccod_mon === pc_ccod_mon && row.ccod_imp === pc_ccod_imp;});\n\t\t\tfor (var i2 = 0; i2 < pa_fa_fa_it_imp_result.length; i2++) {\t\t\n\t\t\t\t// Sumanos valores por Tipo de Moneda\n\t\t\t\tpn_nimp_imp = pn_nimp_imp + fnc_obtener_numero(pa_fa_fa_it_imp_result[i2].nimp_imp);\n\t\t\t}\n\t\t\t\n\t\t\t// Agregamos Totales de Impuestos de Proceso por Tipo de Moneda\n\t\t\tfa_fa_fa_imp_tt.push(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'ccod_doc': '',\n\t\t\t\t\t\t\t\t\t'ccod_ser': '',\n\t\t\t\t\t\t\t\t\t'cdoc_nro': '',\n\t\t\t\t\t\t\t\t\t'ccod_it': '',\n\t\t\t\t\t\t\t\t\t'nid_it': '',\n\t\t\t\t\t\t\t\t\t'nid_imp': fnc_formatear_enumerador(pn_nid_imp),\n\t\t\t\t\t\t\t\t\t'ccod_imp': pc_ccod_imp,\n\t\t\t\t\t\t\t\t\t'cdsc_imp': pc_cdsc_imp,\n\t\t\t\t\t\t\t\t\t'ntasa_imp': fnc_formatear_importe(pn_ntasa_imp),\n\t\t\t\t\t\t\t\t\t'ccod_mon': pc_ccod_mon,\n\t\t\t\t\t\t\t\t\t'ncam': pn_ncam,\n\t\t\t\t\t\t\t\t\t'cdsc_mon': '',\n\t\t\t\t\t\t\t\t\t'cabr_mon': '',\n\t\t\t\t\t\t\t\t\t'csim_mon': '',\n\t\t\t\t\t\t\t\t\t'nimp_imp': fnc_formatear_importe(pn_nimp_imp),\n\t\t\t\t\t\t\t\t\t'ctip': 'Impuestos'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t}\n\t}\n\t// ::::::::::::: Calculando Totales de Impuestos del Documento - Fin :::::::::::::\n\n\tfnc_cb_tt_view();\n}", "title": "" }, { "docid": "79d6ee23622fe7ca2703d1d0b504c90f", "score": "0.59783655", "text": "function renderizarCarrito() {\n // Vaciamos todo el html\n DOMcarrito.textContent = '';\n // Quitamos los duplicados\n const carritoSinDuplicados = [...new Set(carrito)];\n // Generamos los Nodos a partir de carrito\n carritoSinDuplicados.forEach((item) => {\n // Obtenemos el item que necesitamos de la variable base de datos\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n // ¿Coincide las id? Solo puede existir un caso\n return itemBaseDatos.id === parseInt(item);\n });\n // Cuenta el número de veces que se repite el producto\n const numeroUnidadesItem = carrito.reduce((total, itemId) => {\n // ¿Coincide las id? Incremento el contador, en caso contrario no mantengo\n return itemId === item ? total += 1 : total;\n }, 0);\n // Creamos el nodo del item del carrito\n const miNodo = domConstruct.create('li');\n miNodo.classList.add('list-group-item', 'text-left', 'mx-2');\n miNodo.textContent = `${numeroUnidadesItem} x ${miItem[0].nombre} - ${miItem[0].precio}$`;\n // Boton de borrar\n const miBoton = domConstruct.create('button');\n miBoton.classList.add('btn', 'btn-danger', 'mx-2');\n miBoton.textContent = 'X';\n miBoton.style.marginLeft = '1rem';\n miBoton.dataset.item = item;\n on(miBoton, \"mousedown\", function(event) {\n borrarItemCarrito(event);\n })\n // Mezclamos nodos\n miNodo.appendChild(miBoton);\n DOMcarrito.appendChild(miNodo);\n });\n }", "title": "" }, { "docid": "35be5bcba0094b227638bee803548b37", "score": "0.5975957", "text": "function aux_borrar(){\n\t\t\t\n\t\t\tvar id_Producto=$(\".button_carrito\");//caputuramos todos el boton\n\t\t\t/*console.log(id_Producto);*/\n\t\t\t\n\t\t\tvar nombre_cancion=$(\".class_nombre_cancion\");//todos los nodos\n\t\t\t/*console.log(nombre_cancion);*/\n\t\t\t\n\t\t\t////si ahun quedan productos volverlos agregar al carrito (LOCALSTORE)\n\t\t\tlistaCarrito=[]; //vacio el array para volver a cargar el array\n\t\t\t\n\t\t\tif(id_Producto.length!=0){// si su lonitud es difernete de cero\n\t\t\t\t\n\t\t\t\tvar contar=0;\n\t\t\t\tvar precio=0;\n\t\t\t\t\n\t\t\t\twhile(contar<id_Producto.length){\n\t\t\t\t\t\n\t\t\t\t\t/*console.log(\"conbtar es \"+contar)*/;\n\t\t\t\t\t\n\t\t\t\t\tvar id_ProductoArray=$(id_Producto[contar]).attr(\"id_Producto\");\n\t\t\t\t\tvar nombre_ProductoArray=$(nombre_cancion[contar]).text();//obtengo nombre cancion\n\t\t\t\t\tvar precio_ProductoArray=$(id_Producto[contar]).attr(\"precio_cancion\");\n\t\t\t\t\tlistaCarrito.push({\"idProducto\":id_ProductoArray,\n\t\t\t\t\t\"nombre_producto\":nombre_ProductoArray,\n\t\t\t\t\t\"precio\":precio_ProductoArray\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tcontar++;\n\t\t\t\t\n\t\t\t} //end while\n\t\t\t\n\t\t\tlocalStorage.setItem(\"listaProductos\",JSON.stringify(listaCarrito));//actualizo el localstore\n\t\t\t\n\t\t\t\t//================cesta funcion======================================================//\n\t\t\t\t//6.1\n\t\t\t\tcestaCarrito(id_Producto.length);\n\t\t\n\t\t\t\t//=======================ACTULIZAR EL PRECIO EN LA REAL===============//\n\t\t\t\t\n\t\t\t\tvar subtotales_canciion=$('.class_precio_cancion p span');\n\t\t\t\t\n\t\t\t\n\t\t\t\tvar array_suma_subtotal=[];\n\t\t\t\t\n\t\t\t\tfor(var i=0;i<subtotales_canciion.length;i++){\n\t\t\t\t\t\n\t\t\t\t\tvar suma_array=$(subtotales_canciion[i]).html();\n\t\t\t\t\tarray_suma_subtotal.push(Number(suma_array));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconsole.log(array_suma_subtotal);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//6.3\n\t\t\t\tfunction sumaArraySubtotal(total,numero){\n\t\t\t\t\treturn total+numero;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar sumato_toal_funcion=array_suma_subtotal.reduce(sumaArraySubtotal);//ete metodo sirve suma los valores entre sii\n\t\t\t\tconsole.log(sumato_toal_funcion.toFixed(2));\n\t\t\t\t\n\t\t\t\t//actualizo el locla tore y el hatml\n\t\t\t\t\n\t\t\t\t$(\".total-amount\").html('<strong><span class=\"total_span\">'+sumato_toal_funcion.toFixed(2)+'</span></strong>');\n\t\t\t\t\n\t\t\t} // end if\n\t\t\t\n\t\t\telse{\n\t\t\t\t////si ya no qquedan productos hay q remover todo \n\t\t\t\tlocalStorage.removeItem(\"listaProductos\");\n\t\t\t\tlocalStorage.setItem(\"cantidadCesta\",\"0\");\n\t\t\t\t//despues en el html\n\t\t\t\t$(\".cantidad_cesta\").html(\"0\");\n\t\t\t\t$(\".tablita\").html('<div class=\"well\"><a style=\"cursor: pointer\" href=\"../index.php\">NO EXISTE PRODUCTOS EN TU CARRITO IR A COMPRAR</a></div>');\n\t\t\t\t$(\".cart-calculator-wrapper\").hide();\n\t\t\t\t$(\".opciones_pago\").hide();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //en function borrar_aux()", "title": "" }, { "docid": "16d196f53231787411a60bc7e6da5fb7", "score": "0.59636736", "text": "function cerca() {\n\n var para = document.querySelector('.result');\n\n\n var para1 = document.querySelector('.resultFarmacoa');\n var para2 = document.querySelector('.resultFarmacob');\n var para3 = document.querySelector('.conservareAlRiparoDallaLuce');\n var para4 = document.querySelector('.conservareESomministrareAlRiparoDellaLuce');\n var para5 = document.querySelector('.viaCentraleOPeriferica');\n \n\n /* \n Prende il farmaco dai campi testuali \n */\n var inp_1 = document.querySelector('.farmacoA');\n var inp_2 = document.querySelector('.farmacoB');\n var farmacoa = inp_1.value;\n var farmacob = inp_2.value;\n\n\n //Dichiarazione array di oggetti medicine\n var medicine = [ //Apertura parentesi oggetto medicine\n\n { //riga [0] , colonna [0] \n riga: 'abiciximab',\n colonna: ['abiciximab'],\n \n valore: ['']\n },\n { //riga [1] , colonna [1]\n riga: 'acetilcisteina',\n colonna: ['abiciximab', 'acetilcisteina'],\n \n valore: ['I']\n },\n { //riga [2] , colonna [2]\n riga: 'aciclovir',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir'],\n \n valore: ['I', ' '],\n viaCentraleOPeriferica: '>= 10mg/ml, >= 25 CVC'\n \n },\n { //riga [3] , colonna [3]\n riga: 'acido ascorbico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico'],\n \n valore: ['I', ' ', '', '']\n },\n { //riga [4] , colonna [4]\n riga: 'acido etacrinico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico'],\n \n valore: ['I', ' ', ' ', 'Y']\n },\n {\n riga: 'acido folico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico'],\n \n valore: ['I', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'acido tranexamico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'adrenalina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina'],\n \n valore: ['I', ' C', 'I', 'Y', ' ', 'I', ' '],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'albumina umana',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana'],\n \n valore: ['I', ' ', 'I', ' ', 'I', ' ', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'aloperidolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'alteplase',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'amfotericina b',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', ' ', ' C', ' '],\n conservareESomministrareAlRiparoDellaLuce: 'Si',\n viaCentraleOPeriferica: '>= 0.4mg/ml CVC'\n },\n {\n riga: 'amikacina solfato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato'],\n \n valore: ['I', ' C', 'Y', ' C', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'I']\n },\n {\n riga: 'aminofillina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina'],\n \n valore: ['I', ' C', ' C', 'Y', ' ', 'Y', ' ', 'I', ' ', 'I', ' ', 'Y', ' C'],\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'amiodarone cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato'],\n \n valore: ['I', ' C', ' ', ' ', ' ', 'I', ' ', 'C', ' ', 'C', ' ', 'Y', 'Y', 'I'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: '>= 2mg/ml CVC o'\n },\n {\n riga: 'amoxicillina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ']\n },\n {\n riga: 'amoxicillina/acido clavulanico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'I', ' ']\n },\n {\n riga: 'ampicillina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina'],\n \n valore: ['I', ' ', 'Y', 'Y', ' ', ' ', 'I', 'I', ' ', 'I', ' ', 'I', 'I', '!', ' ', ' ', ' ']\n },\n {\n riga: 'ampicillina/sulbactam',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', 'I', 'I', ' ', 'I', ' ', 'I', 'I', 'I', 'I', ' ', ' ', 'I']\n },\n {\n riga: 'anidulafungina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', 'Y', 'Y', ' ', ' ', ' ', 'Y', 'Y']\n },\n {\n riga: 'antitrombina ||| umana',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana'],\n \n valore: ['I', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'argatroban anidro',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro'],\n \n valore: ['I', ' C', ' C', 'I', 'I', 'I', 'I', ' C', 'I', ' C', 'I', ' C', ' C', ' C', 'I', 'I', 'I', ' C', ' C', 'I', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'atenololo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I']\n },\n {\n riga: 'atracurium',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium'],\n \n valore: ['I', ' C', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' ', ' C', 'I', ' C', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ']\n },\n {\n riga: 'atropina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina'],\n \n valore: ['I', ' ', ' ', 'Y', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', 'I', 'Y', 'Y', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'azitromicina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina'],\n \n valore: ['I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', ' C', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', ' C', 'I', 'I', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'aztreonam',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', 'Y', 'Y', ' ', ' ', ' ', 'Y', ' C', ' ', ' ', 'I', ' ', ' ', ' ', 'I']\n },\n {\n riga: 'betametasone',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone'],\n \n valore: ['I', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ']\n },\n {\n riga: 'calcio clororo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo'],\n \n valore: ['I', ' C', ' C', ' ', ' ', 'I', ' ', ' C', ' ', 'I', ' ', 'I', ' C', ' C', ' C', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', 'Y', 'I', ' ', ' '],\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'calcio gluconato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato'],\n \n valore: ['I', ' C', ' C', ' ', ' ', 'I', ' ', ' C', ' ', 'I', ' ', 'I', ' C', ' C', ' C', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', 'Y', ' ', ' C'],\n viaCentraleOPeriferica: '>= 19.4mg/ml CVC o'\n },\n {\n riga: 'caspofungin',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin'],\n \n valore: ['I', 'I', 'I', 'I', 'I', 'I', 'I', ' C', 'I', ' C', 'I', 'I', ' C', ' C', ' C', 'I', 'I', 'I', 'I', 'I', 'I', ' C', 'I', 'I', 'I', 'I', 'I', 'I', ' C', ' C'],\n viaCentraleOPeriferica: '>= 5mg/ml CVC'\n },\n {\n riga: 'cefazolina sodica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica'],\n \n valore: ['I', ' ', 'Y', 'Y', ' ', ' ', ' ', ' C', ' ', 'I', ' ', ' C', ' C', 'Y', 'I', ' ', ' ', 'I', 'I', 'Y', ' ', ' C', ' ', 'Y', ' C', 'I', ' C', ' ', 'I', 'I', 'I'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: '>= 13.8mg/ml CVC'\n },\n {\n riga: 'cefepime dicloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato'],\n \n valore: ['I', 'I', 'I', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' C', 'I', ' ', ' ', ' ', 'I', 'Y', 'Y', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', 'Y', 'Y', 'I', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'cefoxitina sodica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica'],\n \n valore: ['I', ' ', 'Y', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', '!', '!', 'I', ' ', ' ', 'I', 'I', 'Y', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', ' ', 'I', ' ', ' ']\n },\n {\n riga: 'ceftazidima pentaidrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato'],\n \n valore: ['I', 'I', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', 'I', '!', 'Y', 'I', ' ', ' ', 'I', 'I', 'Y', ' ', ' C', ' ', 'I', ' C', 'I', 'Y', ' ', 'I', ' C', 'I', ' C', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'ceftizixima sodica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '!', '!', 'Y', '!', ' ', ' ', 'I', 'I', 'Y', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'ceftriaxone disodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico'],\n \n valore: ['I', ' ', '!', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', 'I', '!', ' C', 'Y', ' ', ' ', 'I', 'I', '!', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', 'I', 'I', 'I', ' ', ' ', ' ', ' C', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n\n {\n riga: 'complesso vitaminico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' ', 'I', ' ', ' C', ' C', 'I', ' ', ' ', 'Y', 'Y', 'I', 'Y', ' ', ' C', ' C', ' ', 'Y'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'Se diluito in NPT, CVC'\n },\n {\n riga: 'cianocobalamina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina'],\n \n valore: ['I', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'ciclofosfamide',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', ' ', 'I', 'Y', 'Y', 'Y', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'ciclosporina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'I', 'Y', 'Y', ' ', ' ', ' ', 'I', 'I', 'Y', ' ', ' C', ' ', ' C', ' C', 'I', ' ', ' ', ' C', ' C', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'ciprofloxacina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina'],\n \n valore: ['I', ' ', 'I', ' ', ' ', 'I', ' ', 'Y', ' ', ' ', ' ', 'I', ' C', 'I', 'Y', ' ', 'I', 'I', 'I', 'Y', ' ', ' C', ' ', ' ', ' ', 'I', ' C', ' ', 'Y', 'Y', '!', 'I', 'I', ' ', '!', ' ', ' ', ' C', ' ', ' ', ' C'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC o'\n },\n\n {\n riga: 'cisatracurio besilato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato'],\n \n valore: ['I', ' C', 'I', ' ', ' ', ' ', ' ', ' C', ' ', 'Y', ' ', 'I', 'Y', 'I', ' C', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' ', ' ', 'I', 'Y', ' ', ' C', ' C', ' C', 'I', ' ', '!', 'I', '!', 'Y', ' ', ' ', ' ', ' ', 'Y'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'claritromicina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'Y', ' ', 'Y', 'Y', ' ', ' ', ' ', 'I', ' ', 'Y', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' C', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' '],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'clindamicina fosfato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato'],\n \n valore: ['I', ' ', 'Y', ' C', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'Y', ' C', '!', 'Y', ' ', ' ', 'I', 'I', 'Y', ' ', ' C', ' ', ' C', ' C', 'I', ' C', ' ', 'I', '!', 'I', ' C', ' C', ' C', ' C', ' C', 'I', 'Y', ' ', 'Y', ' C', 'I', 'Y', ' ']\n },\n {\n riga: 'clonidina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina'],\n \n valore: ['I', ' C', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'clorfenamina maleato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'colistina solfato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato'],\n \n valore: ['I', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'daptomicina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'desametasone fosfato disodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico'],\n \n valore: ['I', ' ', 'Y', ' C', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'Y', 'Y', ' C', ' ', ' ', 'I', 'I', 'I', 'Y', ' ', ' C', ' ', ' C', ' C', 'I', 'Y', ' ', 'I', 'I', 'I', ' C', 'Y', ' ', ' C', ' ', ' ', ' C', ' ', 'Y', ' C', 'I', 'Y', ' ', ' C', ' ', ' ', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'diazepam',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam'],\n \n valore: ['I', ' ', 'I', 'I', ' ', ' ', ' ', 'I', ' ', 'I', ' ', 'I', 'I', 'I', ' ', ' ', ' ', 'I', 'I', ' ', ' ', 'I', ' ', 'I', 'I', 'I', ' ', ' ', 'I', 'I', 'I', 'I', 'I', ' ', 'I', ' ', ' ', 'I', ' ', ' ', 'I', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'diclofenac',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'digossina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina'],\n \n valore: ['I', ' ', ' C', 'Y', ' ', '!', ' ', 'Y', ' ', 'I', ' ', 'I', 'Y', ' C', 'I', ' ', ' ', 'I', 'I', 'Y', ' ', ' C', ' ', 'Y', 'Y', 'I', ' ', ' ', 'Y', 'Y', 'I', 'Y', ' ', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', 'Y', 'Y', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', 'I', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'diltiazem cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato'],\n \n valore: ['I', ' C', 'I', ' ', ' ', ' ', ' ', 'Y', 'Y', ' C', ' ', 'I', 'Y', 'I', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', ' ', 'I', 'Y', ' ', 'Y', ' C', 'Y', 'Y', 'I', 'Y', 'Y', ' ', 'Y', 'Y', ' ', ' ', ' C', 'Y', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'dobutamina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina'],\n \n valore: ['I', ' C', 'I', ' ', ' ', 'I', ' ', ' C', ' C', 'I', 'I', 'I', 'Y', 'I', ' C', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', ' C', 'I', 'Y', ' ', 'I', 'I', ' C', 'I', 'I', ' ', 'I', ' ', 'I', 'Y', ' ', ' ', ' C', 'Y', 'Y', 'Y', 'I', ' C', ' ', ' ', ' ', 'I', '!', ' ', '!', 'Y'],\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'dopamina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina'],\n \n valore: ['I', ' C', 'I', 'Y', ' ', 'I', ' ', 'Y', ' C', 'I', 'I', 'I', 'Y', ' C', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', 'Y', 'I', 'Y', ' ', ' C', 'Y', ' C', 'I', 'I', ' ', ' C', ' ', 'Y', 'Y', ' ', ' ', ' C', 'Y', 'Y', 'Y', ' C', ' C', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', ' C'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'drotrecogin alfa attivato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', '!', 'I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', 'Y', ' ', ' ', ' ', 'I', 'I', 'Y', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I']\n },\n {\n riga: 'eparina sodica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica'],\n \n valore: ['I', ' C', 'Y', ' C', 'Y', 'I', ' C', ' C', ' ', 'I', 'I', ' C', 'I', ' C', 'I', ' ', ' ', '!', '!', ' ', ' ', 'I', ' ', 'I', ' C', 'I', 'Y', 'Y', 'I', '!', 'I', ' C', ' C', ' C', 'Y', ' ', 'Y', 'Y', 'Y', ' C', ' C', 'I', 'I', 'I', ' C', ' C', ' ', ' C', 'Y', 'Y', 'I', ' ', ' C', 'I', 'I', '!', 'I']\n },\n {\n riga: 'epoprostenolo sodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico'],\n \n valore: ['I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I']\n },\n {\n riga: 'eritromicina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina'],\n \n valore: ['I', 'I', 'Y', 'Y', ' ', 'I', ' ', ' C', ' ', 'I', ' ', 'I', ' C', ' C', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' ', ' C', 'I', ' ', ' ', ' C', ' C', ' C', 'I', 'I', ' ', 'I', ' ', ' ', 'Y', ' ', 'Y', ' C', 'Y', ' ', ' ', 'I', ' ', ' ', 'I', ' ', 'I', 'I', ' ', 'Y', 'Y', ' C', ' C', ' ', '!', 'I'],\n viaCentraleOPeriferica: '>= 10ml/ml CVC o'\n },\n {\n riga: 'esmololo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo '],\n \n valore: ['I', ' C', 'I', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' C', 'Y', ' C', ' C', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', 'Y', 'I', ' ', ' ', ' C', 'Y', ' C', 'Y', ' ', ' ', 'Y', 'Y', 'Y', 'Y', ' ', ' ', ' C', ' ', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', 'I', 'I', ' ', ' C', 'Y', 'Y', '!', ' ', '!', 'I', 'Y'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'Non diluito (10mg/ml)CVC'\n },\n {\n riga: 'fenitoina sodica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica'],\n \n valore: ['I', ' ', 'I', 'I', ' ', ' ', ' ', 'I', ' ', 'I', ' ', 'I', 'I', 'I', ' ', ' ', ' ', 'I', 'I', ' ', ' ', 'I', ' ', 'I', 'I', 'I', ' ', ' ', 'I', 'I', 'I', 'I', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'I', 'I', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'I', 'I', 'I', 'I', ' ', 'I', 'I', 'I', 'I'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'fenobarbital',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' C', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' C', ' C', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' ', 'I']\n },\n {\n riga: 'fenoldopam mesilato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', ' ', ' C', ' C', 'I', ' C', ' ', ' ', 'I', ' C', ' ', ' ', ' C', ' ', ' C', ' C', ' C', ' ', ' ', ' C', ' C', ' C', ' C', 'Y', ' ', ' C', ' ', 'Y', ' ', ' ', ' ', ' C', ' C', ' C', ' ', 'Y', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'Y', 'Y', ' C', ' C', ' ', 'Y', 'I', ' C', ' C', 'I', ' ']\n },\n {\n riga: 'fentanil citrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato'],\n \n valore: ['I', ' C', ' C', 'Y', ' ', 'Y', ' ', ' C', ' ', 'I', ' ', 'Y', 'Y', 'Y', ' C', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', ' C', 'I', ' ', ' ', 'Y', 'I', ' C', ' C', ' ', ' ', ' C', ' ', 'Y', 'Y', ' ', ' ', ' C', 'Y', ' C', ' ', ' C', ' C', ' ', ' ', ' ', ' C', '!', ' ', 'Y', 'Y', 'Y', 'Y', ' ', ' C', 'I', ' C', ' C', 'I', ' ', ' C']\n },\n {\n riga: 'fisostigmina salicilato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato'],\n \n valore: ['I', ' ', ' ', 'Y', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', 'Y', 'I', ' ', ' ', 'I', ' ', ' ', ' ']\n },\n {\n riga: 'fitomenadione(vit.k)',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' ', 'Y', 'I', ' ', ' ', 'I', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'fluconazolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo'],\n \n valore: ['I', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', 'I', ' C', 'Y', 'Y', ' ', ' ', 'I', '!', ' ', ' ', ' C', ' ', ' C', ' C', 'I', 'Y', ' ', ' C', 'I', ' C', ' C', 'Y', 'Y', 'I', ' ', 'I', 'Y', ' ', ' ', ' C', ' C', 'Y', ' ', 'I', ' ', ' ', ' ', ' ', 'Y', 'I', ' ', 'I', 'Y', 'Y', 'Y', 'Y', ' C', 'I', '!', 'Y', 'I', ' ', ' C', 'Y', ' ', ' ']\n },\n {\n riga: 'flumazenil',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '!', ' ', ' ', ' ', ' C', ' C', ' ', ' C', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'foscarnet sodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', 'Y', 'Y', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', 'I', 'I', 'I', 'Y', ' ', 'Y', 'Y', 'Y', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', 'I', ' ', 'I', ' ', 'I', 'Y', ' ', 'Y', 'I', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', 'Y', ' ']\n },\n {\n riga: 'furosemide',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide'],\n \n valore: ['I', ' C', ' C', 'Y', ' ', 'I', ' ', ' C', 'Y', 'I', ' ', 'Y', ' C', ' C', 'I', ' ', ' ', 'I', 'I', 'Y', ' ', 'Y', ' ', 'I', ' C', 'I', 'Y', ' ', ' C', ' C', 'I', ' C', 'Y', ' ', 'Y', ' ', 'Y', 'Y', ' ', ' C', ' C', 'I', 'I', 'I', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' C', 'I', 'I', 'I', 'I', '!', 'I', 'I', 'I', 'I', ' ', 'I', ' C', ' ', ' ', 'I', ' ', 'Y'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'Non diluito 10mg/ml CVC'\n },\n {\n riga: 'ganciclovir',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', 'Y', 'I', 'I', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', 'I', ' C', 'I', 'I', ' ', 'I', ' C', ' C', 'I', 'I', ' ', 'I', ' ', ' ', 'I', ' ', 'Y', ' C', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'I', 'I', 'I', ' ', ' C', 'I', 'I', 'I', 'I', ' ', 'I', ' C', ' ', ' ', 'Y', ' ', 'I', ' C'],\n viaCentraleOPeriferica: 'CVC o'\n \n },\n {\n riga: 'gentamicina solfato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato'],\n \n valore: ['I', 'I', 'I', 'Y', ' ', 'I', ' ', ' C', ' ', 'I', ' ', 'I', 'Y', ' C', 'Y', ' ', 'I', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', ' C', ' ', ' C', ' C', ' C', ' C', ' C', ' C', '!', ' ', 'I', 'Y', ' ', 'Y', ' C', ' C', ' C', 'Y', ' C', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'Y', 'Y', ' C', ' C', 'I', 'I', 'I', ' C', 'Y', 'I', ' ', ' C', ' C', ' ', ' ', ' C', ' ', 'Y', 'I', 'I']\n },\n {\n riga: 'idrocortisone emis. sodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico'],\n \n valore: ['I', ' ', 'Y', ' C', 'Y', ' ', ' ', 'Y', ' ', 'I', ' ', 'Y', ' C', 'Y', ' ', ' ', 'I', 'I', 'I', ' ', ' ', 'Y', ' ', 'Y', 'Y', 'I', 'Y', 'Y', '!', 'I', ' C', ' C', 'Y', ' ', ' C', ' ', ' ', ' ', 'Y', ' ', ' C', 'I', 'Y', ' ', ' C', ' ', ' ', 'I', ' ', 'Y', 'I', ' ', 'Y', 'I', 'I', ' C', ' ', ' C', 'I', ' C', 'I', 'I', 'I', ' C', 'Y', 'Y', 'Y', 'Y', ' ', 'Y', ' C', 'I', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'idroxizina dicloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' C', 'I', 'Y', ' ', ' ', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', 'I', 'I', ' ', ' C', ' ', ' ', 'I', ' ', 'Y', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'imipenem/cilastatina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', 'I', 'I', 'I', ' ', 'Y', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', 'Y', 'I', 'Y', 'I', 'Y', 'I', ' ', 'Y', ' ', ' ', ' ', 'Y', ' ', ' ', 'I', ' ', 'Y', 'Y', ' ', 'I', ' ', ' ']\n },\n {\n riga: 'insulina umana',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana'],\n \n valore: ['I', ' ', ' C', ' ', ' ', ' C', ' ', 'I', ' ', 'I', ' ', ' ', 'I', ' C', 'I', ' ', ' ', 'I', '!', ' ', ' ', ' C', ' ', 'I', 'Y', 'I', 'Y', ' ', 'Y', 'Y', ' C', 'Y', 'Y', ' ', 'Y', ' ', 'Y', 'I', ' ', ' ', 'I', 'Y', ' C', 'Y', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'Y', ' C', 'I', 'I', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', 'I', ' C', 'I', 'Y', ' ', 'Y'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'isoprenalina cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato'],\n \n valore: ['I', ' ', ' ', ' C', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', 'Y', 'I', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' C', 'Y', 'I', ' ', ' ', ' C', 'Y', 'I', ' ', ' ', ' ', ' ', ' ', 'Y', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', 'Y', ' C', 'Y', ' ', ' C', 'I', ' ', 'Y', 'I', '!', 'Y', 'Y', ' ', ' ', 'Y', ' ', ' ', 'I', ' ', 'Y', 'Y', ' ', 'Y', 'I']\n },\n {\n riga: 'ketamina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina'],\n \n valore: ['I', ' C', 'I', ' ', ' ', ' ', ' ', ' C', ' C', ' C', ' ', ' ', ' C', 'I', ' C', ' ', ' ', 'I', ' ', ' ', ' ', ' C', ' ', ' ', ' C', 'I', ' ', ' ', ' ', ' C', 'I', ' C', 'Y', ' ', ' C', ' ', ' ', ' C', ' ', ' ', 'I', ' ', ' C', ' ', ' C', 'Y', ' ', ' ', ' ', 'I', 'I', ' ', ' C', ' C', ' C', ' C', ' ', 'I', 'I', ' ', ' C', 'I', 'I', ' ', ' C', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' C', ' C', ' ', ' ', 'I', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'ketorolac trometamina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' C', ' ', 'I', ' ', ' C', ' C', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', ' ', ' ', 'I', ' ', 'I', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' ', '!', ' ', ' C', ' C', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'I', 'I', ' C', ' ', ' C', 'I', 'I', 'I', 'I', ' ', 'I', 'Y', ' ', ' ', ' C', ' ', ' ', ' C', 'I', ' C', ' C', 'I', ' ', ' C', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'labetalolo cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato'],\n \n valore: ['I', ' C', 'I', ' ', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'I', 'Y', 'Y', ' C', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', ' ', ' ', 'Y', ' C', ' C', 'I', ' ', ' ', 'Y', 'Y', 'I', 'Y', ' ', ' ', ' C', ' ', ' C', ' ', '!', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' C', 'Y', 'Y', 'Y', ' ', 'I', 'I', 'Y', ' C', 'I', ' ', ' C', ' C', ' ', ' ', 'Y', ' ', ' ', 'I', ' C', 'Y', 'I', ' ', 'Y', 'I', 'Y', ' C', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'levofloxacina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', ' ', 'I', 'Y', 'Y', 'I', ' ', ' ', 'Y', ' C', ' ', ' ', ' C', ' ', ' C', ' ', 'I', ' ', ' ', ' ', ' C', ' C', 'I', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' C', ' ', 'Y', ' ', ' ', ' ', 'Y', 'Y', 'I', ' ', ' C', ' C', 'Y', 'Y', 'I', 'I', 'I', ' C', ' C', 'I', 'Y', 'Y', 'Y', ' ', ' ', ' C', ' ', ' ', 'I', 'I', 'Y', ' C', ' ', ' ', '!', 'Y', ' ', 'I', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'lidocaina cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato'],\n \n valore: ['I', ' C', 'I', ' C', ' ', 'Y', ' ', ' C', ' ', 'I', ' C', '!', 'Y', ' C', ' C', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', 'Y', 'I', ' ', ' ', ' C', ' C', 'I', '!', ' ', ' ', ' C', ' ', '!', 'Y', ' ', ' ', ' C', 'Y', 'Y', 'Y', ' C', ' C', ' ', ' ', ' ', ' C', 'I', ' ', ' C', 'Y', ' C', ' C', ' ', ' C', 'I', ' C', ' C', 'I', ' ', ' C', ' C', ' ', ' ', 'Y', ' C', ' ', ' C', 'I', ' C', ' C', ' C', 'Y', ' C', '!', ' C', ' C', 'Y', 'Y']\n },\n {\n riga: 'linezolid',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', ' ', 'Y', ' ', ' C', 'Y', 'Y', ' C', ' ', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', ' C', ' ', 'I', ' C', ' ', ' C', 'Y', ' C', ' C', ' C', 'Y', ' C', 'Y', '!', ' ', ' ', 'Y', 'Y', 'Y', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', 'I', ' ', 'Y', ' C', 'Y', 'Y', ' ', 'Y', 'I', 'I', 'Y', 'I', 'Y', 'Y', 'Y', ' ', ' ', 'Y', ' ', ' ', 'Y', 'Y', ' C', 'Y', 'Y', 'Y', ' C', ' ', ' ', ' C', 'Y', ' C', 'Y'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'lorazepam',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam'],\n \n valore: ['I', ' C', 'Y', ' ', ' ', ' ', ' ', ' C', 'Y', 'Y', ' ', 'I', 'Y', 'Y', ' C', ' ', ' C', 'I', 'I', ' ', ' ', ' C', ' ', 'Y', ' ', 'I', 'I', ' ', ' C', ' C', 'I', ' C', 'Y', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' C', 'Y', ' C', ' ', ' C', 'Y', ' ', ' ', ' ', 'Y', ' ', ' ', ' C', 'Y', 'Y', 'Y', ' ', 'Y', 'I', 'Y', ' C', 'I', ' ', ' C', ' C', ' ', ' ', 'Y', 'I', '!', ' C', ' C', 'Y', 'Y', ' ', 'I', ' C', ' ', 'I', ' C', ' C', 'I', ' C', 'Y'],\n viaCentraleOPeriferica: 'CVC'\n },\n {\n riga: 'magnesio solfato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato'],\n \n valore: ['I', ' C', 'Y', 'Y', ' ', 'I', ' ', 'Y', ' ', 'I', ' ', 'I', 'Y', 'I', 'I', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', 'Y', 'I', 'Y', ' ', 'I', ' C', ' C', 'I', 'I', 'Y', ' C', ' ', 'I', 'Y', ' ', ' ', 'I', 'I', ' C', ' ', '!', ' C', ' ', ' ', ' ', 'I', 'I', ' ', 'Y', 'Y', '!', 'Y', 'I', ' C', 'I', 'I', ' C', 'I', ' ', ' C', 'Y', ' ', ' ', 'Y', ' ', 'I', 'I', 'I', 'Y', 'I', ' ', 'Y', ' C', ' C', ' C', ' C', ' C', 'I', 'Y', 'Y', ' C']\n },\n {\n riga: 'meropenem',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I', ' C', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' C', 'Y', ' ', ' C', 'I', ' ', ' ', ' ', 'I', ' C', ' ', ' ', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', ' C', ' C', ' C', ' ', ' C', 'I', ' ', ' ', ' ', ' C', 'I', ' ', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' C', ' ', ' ', ' ', ' C', ' ', 'I', ' ', ' ', ' ', ' ', 'Y', ' C', ' C']\n },\n {\n riga: 'metilprednisolone',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone'],\n \n valore: ['I', ' ', 'Y', '!', ' ', ' C', ' ', ' C', ' ', 'I', ' ', 'Y', ' C', ' C', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', 'Y', ' ', 'I', 'I', 'I', ' C', 'Y', ' ', ' C', ' ', ' ', ' C', ' ', 'Y', ' C', 'I', 'I', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'I', ' C', ' C', ' ', 'I', 'I', ' C', 'I', 'I', ' ', 'I', 'Y', ' ', ' ', ' C', ' ', ' ', ' C', 'I', ' C', 'I', ' ', ' ', ' C', ' ', 'I', ' C', ' C', ' C', ' C', 'Y', ' C', 'I', ' ']\n },\n {\n riga: 'metoclopramide cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato'],\n \n valore: ['I', ' ', 'I', ' C', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'I', ' C', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', 'Y', ' ', ' C', ' C', ' C', '!', 'I', ' ', ' C', ' ', ' ', ' C', ' ', ' C', ' C', 'Y', 'Y', ' C', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', ' C', ' C', ' ', ' C', 'I', ' C', ' C', 'I', ' ', ' C', ' C', ' ', ' ', 'Y', ' ', 'Y', 'I', 'I', ' C', ' C', ' C', ' ', ' C', ' ', ' C', ' C', ' C', 'Y', ' C', 'Y', '!', ' C', ' C', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'metoprololo tartrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato'],\n \n valore: ['I', ' C', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', 'Y', ' C', 'Y', ' C', ' C', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', 'Y', 'I', ' ', ' ', 'I', 'I', ' C', ' C', ' ', ' ', ' C', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', 'Y', 'Y', ' ', ' C', 'I', 'I', 'Y', 'I', ' ', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', ' C', ' C', 'Y', ' C', ' ', 'Y', 'Y', 'Y', ' C', ' C', 'Y', ' ', 'I', ' C', ' C', 'Y', ' ', ' C', ' C']\n },\n {\n riga: 'metronidazolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', ' ', 'I', ' C', ' C', 'Y', ' ', 'I', ' C', ' C', 'Y', ' ', ' C', ' ', ' C', ' ', 'I', 'I', ' ', ' C', 'Y', 'I', ' C', 'Y', ' C', ' C', ' C', '!', 'I', ' ', 'Y', ' C', 'I', 'Y', 'Y', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', ' C', 'Y', 'I', 'Y', 'I', ' C', 'Y', 'I', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', 'Y', 'Y', 'I', ' C', ' C', ' ', 'Y', 'Y', 'Y', ' C', ' C', 'Y', ' C', 'Y', 'Y', 'Y', 'Y', '!', 'Y', ' C', 'Y'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'midazolam',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam'],\n \n valore: ['I', ' C', 'I', ' ', ' ', ' ', ' ', 'Y', 'I', '!', ' ', 'I', 'Y', 'I', 'Y', ' ', 'I', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', ' C', 'I', ' ', ' ', 'Y', 'Y', ' C', 'Y', 'I', ' ', 'I', ' ', 'Y', 'Y', ' ', ' ', ' C', 'Y', 'Y', ' ', '!', 'I', ' ', ' ', ' ', 'I', 'I', ' ', 'Y', 'Y', 'I', 'Y', 'I', 'Y', 'I', 'Y', 'Y', 'I', ' ', ' C', ' C', ' ', ' ', 'Y', 'I', 'I', 'I', 'I', 'Y', 'I', ' C', 'I', '!', 'Y', ' C', 'I', 'Y', ' C', 'Y', 'Y', 'Y', 'Y', ' ', 'I', ' C', 'Y', 'Y'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'Non diluito 5mg/ml CVC o'\n },\n {\n riga: 'morfina cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato'],\n \n valore: ['I', ' ', '!', 'Y', ' ', 'Y', ' ', 'Y', ' ', '!', 'I', 'I', 'Y', 'Y', 'Y', ' ', ' ', 'Y', 'Y', ' ', ' ', 'Y', 'Y', ' C', ' C', 'I', 'Y', ' ', 'Y', 'Y', 'I', 'Y', 'I', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', 'Y', ' ', 'Y', 'Y', ' ', 'Y', ' C', ' ', ' ', ' ', 'I', 'Y', ' ', 'Y', 'Y', ' C', 'Y', ' ', 'Y', 'I', 'Y', 'Y', 'I', 'I', ' ', ' C', ' ', ' ', ' C', ' ', 'Y', 'I', ' ', 'Y', 'Y', ' C', 'Y', 'Y', 'Y', ' C', 'I', 'Y', 'Y', ' C', 'Y', 'Y', 'Y', ' C', 'I', ' C', 'Y', 'Y', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'naloxone cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato'],\n \n valore: ['I', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', 'I', 'Y', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', ' ', ' ', 'Y', 'Y', ' C', ' C', ' ', ' ', ' C', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', ' C', 'Y', 'Y', ' ', ' C', 'I', ' C', 'Y', 'I', ' ', ' C', 'I', ' ', ' ', 'Y', ' ', ' ', ' C', ' C', 'Y', ' C', ' ', 'Y', 'Y', 'Y', ' C', ' C', 'Y', ' C', 'Y', 'Y', ' C', 'I', ' ', ' C', ' C', 'Y', 'Y', 'Y', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'na nitroprussiato anidro',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro'],\n \n valore: ['I', '!', 'I', ' ', ' ', ' ', ' ', ' C', ' ', '!', ' ', ' C', 'Y', ' C', 'I', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', 'I', 'Y', 'I', ' ', ' ', ' C', 'Y', 'I', ' C', ' ', ' ', 'I', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', 'I', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', '!', '!', 'I', ' C', 'I', 'I', 'Y', 'I', ' ', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', ' C', ' C', 'Y', ' C', ' ', 'I', 'Y', 'Y', ' C', ' C', 'Y', 'I', 'Y', ' C', ' C', ' C', ' ', ' C', ' C', ' C', 'Y', 'Y', 'Y', 'Y'],\n conservareESomministrareAlRiparoDellaLuce: 'Si'\n },\n {\n riga: 'neostigmina metilsolfato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato'],\n \n valore: ['I', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I',\n ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', '', '', '', '', '']\n },\n {\n riga: 'nimodipina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', '',\n '', '', '', '', ''],\n conservareESomministrareAlRiparoDellaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC o'\n },\n {\n riga: 'nitroglicerina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina'],\n \n valore: ['I', '!', ' C', ' ', ' ', 'I', ' ', 'Y', ' ', 'I', 'I', 'Y', 'Y', ' C', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', 'Y', ' C', 'I', ' ', ' ', ' C', ' C', ' C', ' C', ' ', ' ', ' C', ' ', 'Y', 'I', ' ', ' ', ' C', 'Y', 'Y', ' ', ' C', ' C', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', ' C', ' C', 'Y', ' C', 'I', ' C', 'Y', 'I', ' ', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', 'I', ' C', ' C', ' C', ' ', 'Y', 'Y', 'Y', 'I', ' C', 'Y', 'I', 'Y', 'Y', 'Y', ' C', ' ', ' C', ' C', 'I', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', ' C']\n },\n {\n riga: 'noradrenalina tartrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato'],\n \n valore: ['I', ' C', ' ', ' C', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' ', ' C', 'I', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', 'Y', ' ', ' C', ' C', 'I', ' ', ' ', 'I', 'I', ' C', ' C', ' ', ' ', ' C', ' ', 'Y', ' C', ' ', ' ', ' C', ' ', 'Y', ' ', ' C', ' C', 'I', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', ' C', 'Y', 'I', ' C', 'I', ' C', 'Y', 'I', 'I', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', 'I', 'I', 'Y', 'I', ' ', 'Y', 'I', 'Y', ' C', ' C', 'Y', ' ', '!', ' C', 'Y', ' C', ' C', ' C', ' C', 'Y', 'Y', 'Y', 'Y', 'Y', ' C', ' ', ' C', 'Y'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC'\n },\n {\n riga: 'octreotide',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide'],\n \n valore: ['I', ' C', ' C', ' ', ' ', ' ', ' ', ' C', ' ', ' C', ' ', ' C', ' C', ' C', ' C', ' ', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' C', ' ', ' C', ' ', ' ', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' C', ' C', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' C', ' C', ' C', ' C', ' ', ' C', 'I', ' C', ' C', 'I', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' C', ' C', ' C', ' ', ' ', ' C', ' ', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' ', ' ', ' C', ' C']\n },\n {\n riga: 'omeprazolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo'],\n \n valore: ['I', ' C', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', 'I', ' ', ' ', 'I', 'I', ' ']\n },\n {\n riga: 'ondansetrone cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'I', 'Y', 'I', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', ' C', 'Y', ' ', ' C', ' C', ' C', 'Y', 'I', 'Y', 'I', 'Y', ' ', ' C', ' ', 'Y', ' C', ' C', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', ' C', ' C', 'Y', ' ', '!', 'I', ' C', ' C', 'I', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' ', 'I', 'I', 'Y', 'Y', 'Y', 'Y', 'I', ' ', ' ', ' C', ' C', ' C', ' C', 'Y', 'I', 'Y', 'I', 'I', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' C', ' ']\n },\n {\n riga: 'oxacillina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina'],\n \n valore: ['I', ' ', 'Y', 'Y', ' ', ' ', 'I', ' C', ' ', 'I', ' ', ' ', 'I', ' C', ' ', ' ', ' ', ' C', 'I', ' ', ' ', 'I', ' ', ' C', ' C', 'I', ' ', ' ', 'I', 'I', 'I', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' ', 'Y', ' C', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', 'I', ' C', ' ', 'Y', 'I', ' C', 'I', 'I', ' ', ' ', ' C', ' ', ' ', 'Y', ' ', 'Y', ' C', 'I', 'I', 'Y', ' ', ' ', ' C', ' ', ' ', ' C', 'Y', 'Y', ' C', ' ', ' ', 'I', ' ', ' ', ' C', ' C', ' ', ' C', 'Y', ' C', ' C', ' ', ' ', ' C', ' C', ' ', ' ', ' C']\n },\n {\n riga: 'pancuronio bromuro',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro'],\n \n valore: ['I', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', ' ', ' C', ' C', 'Y', ' C', ' ', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' ', 'I', ' ', ' ', ' C', ' C', 'I', 'Y', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' C', 'Y', 'Y', 'Y', ' ', ' C', 'I', ' C', 'Y', 'I', 'I', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', 'I', ' C', 'Y', ' C', ' ', ' ', ' C', 'Y', ' C', ' C', ' C', 'Y', ' C', ' C', 'Y', ' C', ' C', ' C', ' C', ' C', ' C', 'Y', 'Y', ' C', 'Y', ' C', ' ', 'Y', ' ', ' C', ' ', ' C', ' ']\n },\n {\n riga: 'pantoprazolo sodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico'],\n \n valore: ['I', 'C', '!', '', '', '', '', '!', '', 'I', '', '', '!', 'C', 'I', '', 'C', 'C', 'C', '', '', 'C', '', 'I', 'I', 'C', '', '', 'I', '!', 'I', '!', 'I', '', '!', '', 'Y', '', '', '', '!', 'I', 'I', '', '!', '', '', '', '', 'I', 'I', '', '!', 'I', 'I', '!', '', '!', 'I', '', 'I', 'I', '', 'I', 'I', '', '', 'I', '', '', '!', 'C', '!', '!', '', '', '!', '!', 'C', 'I', 'I', 'I', 'I', 'I', 'I', '!', 'I', 'I', '!', 'I', 'I', 'I', '!', 'I', '!', '', '', '!', 'I', 'I', '', 'I', '', 'I'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'penicillina g potassica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica'],\n \n valore: ['I', ' ', 'Y', '!', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', '!', 'I', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' C', ' C', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', 'Y', 'I', 'I', ' ', '!', 'I', ' C', 'Y', 'I', 'I', ' ', ' ', ' ', ' ', 'Y', ' ', 'Y', ' C', ' ', ' ', ' C', 'I', ' ', 'I', ' ', ' ', ' ', 'Y', 'Y', ' C', ' ', ' ', ' C', ' ', ' C', 'I', ' ', ' C', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'pentoxifillina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'piperacillina sodica',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', 'I', ' C', ' ', 'I', ' ', ' C', '!', 'Y', 'I', ' ', ' ', 'I', 'I', ' ', ' ', 'I', ' ', ' C', ' C', 'I', 'Y', ' ', 'Y', 'Y', 'I', ' C', 'Y', ' ', ' C', ' ', ' ', ' C', ' ', 'Y', ' C', '!', 'I', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', 'I', ' ', 'Y', 'Y', 'I', 'Y', ' ', ' C', 'I', ' C', 'Y', 'I', ' ', ' C', ' C', ' ', ' ', 'I', ' ', 'Y', 'Y', 'I', '!', ' C', ' ', ' ', ' C', ' ', '!', ' C', 'I', 'I', ' C', ' C', 'Y', 'Y', ' ', 'Y', 'Y', ' C', 'Y', 'Y', 'Y', ' C', ' C', ' ', ' ', ' C', ' C', ' C', ' ', 'I', ' C', ' C', ' C', ' ', ' ']\n },\n {\n riga: 'piperacillina/tazobactam',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam'],\n \n valore: ['I', 'I', 'I', ' ', ' ', ' ', 'I', ' C', ' ', 'I', ' ', ' C', '!', 'Y', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ', 'I', 'Y', ' ', 'Y', 'Y', 'I', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' C', '!', 'I', ' ', 'Y', ' ', ' ', ' ', ' ', 'Y', ' C', ' ', ' C', 'I', 'I', 'Y', 'I', 'Y', 'I', ' C', ' C', 'I', ' ', ' C', ' C', ' ', ' ', 'Y', ' ', ' ', 'Y', 'I', '!', 'Y', 'I', ' ', 'I', ' ', ' C', ' C', 'I', 'I', ' C', 'Y', 'Y', 'Y', ' ', 'Y', 'Y', ' C', 'Y', 'I', 'Y', ' C', ' C', ' ', ' ', ' C', ' C', ' C', ' ', 'Y', ' ', ' C', '!', ' ', ' ', ' C']\n },\n {\n riga: 'potassio cloruro',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro'],\n \n valore: ['I', '!', 'Y', ' C', 'Y', ' C', ' ', 'Y', 'Y', 'I', ' ', ' C', ' C', ' C', ' C', ' ', 'Y', 'I', 'I', ' ', ' ', ' C', ' ', ' C', 'Y', 'I', 'Y', 'Y', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' ', 'Y', 'Y', 'Y', ' ', ' C', ' C', 'Y', 'Y', ' C', ' C', ' ', ' ', ' ', 'Y', 'I', ' ', 'Y', 'Y', '!', ' C', 'Y', ' C', 'I', 'I', 'Y', 'I', ' ', ' C', 'Y', 'Y', 'Y', ' C', ' ', ' C', ' C', 'I', ' C', 'I', ' ', 'Y', 'Y', ' C', ' C', ' C', 'Y', ' C', ' C', 'Y', 'Y', 'Y', 'Y', 'I', ' C', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', ' C', ' C', ' C', ' ', 'Y', ' C', ' C', 'Y', ' C', ' ', ' C', 'Y'],\n viaCentraleOPeriferica: '>= 0.5mmol/ml CVC o'\n },\n {\n riga: 'propofol',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol'],\n \n valore: ['I', 'I', 'Y', '!', 'I', 'I', 'I', '!', 'I', 'Y', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'Y', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'Y', 'I', 'I', '!', 'I', '!', 'I', 'Y', 'I', 'Y', 'Y', 'I', 'I', 'Y', 'Y', 'I', 'I', 'I', '!', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', '!', '!', 'I', '!', 'I', ' C', '!', 'I', 'Y', 'Y', '!', 'I', 'I', '!', 'I', 'I', '!', 'Y', 'I', '!', 'Y', 'Y', 'Y', 'Y', '!', 'I', '!', 'I', '!', 'I', '!', 'Y', 'I', 'I', 'I', 'I', 'I', '!', '!', '!', 'I', 'I', 'I', '!', '!', 'I', 'I', ' C', 'I', 'I', 'I', 'I', 'I', 'Y', 'I', '!'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: '1% PVC/CVC 2% CVC'\n },\n {\n riga: 'protamina cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I', 'I', 'I', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', 'I', 'I', 'I', 'I', 'I', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', 'I', ' ', 'I', 'I', ' ', 'I']\n },\n {\n riga: 'ranitidina cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato'],\n \n valore: ['I', ' ', 'Y', ' ', 'I', ' C', ' ', ' C', ' ', 'I', ' ', ' C', ' C', ' C', 'Y', ' ', ' ', 'I', 'I', 'Y', ' ', ' C', ' ', 'Y', ' C', 'I', 'Y', ' ', ' C', ' C', 'I', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', 'Y', ' C', ' C', 'Y', 'Y', ' C', ' ', ' ', ' C', ' ', ' C', 'I', ' ', ' C', 'Y', ' C', ' C', 'I', ' C', 'I', ' C', 'Y', 'I', 'I', 'Y', ' C', 'I', 'I', ' C', ' C', 'Y', ' C', ' C', ' C', ' C', 'I', 'Y', 'I', ' C', ' C', ' C', 'Y', ' C', ' C', 'Y', 'Y', ' C', ' C', ' C', ' C', 'Y', 'Y', '!', ' C', 'Y', ' C', ' ', ' ', 'Y', 'Y', 'Y', ' ', ' C', ' C', 'Y', 'I', ' C', ' ', 'Y', 'Y', ' C', '!', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'remifentanil cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato'],\n \n valore: ['I', ' C', 'Y', ' ', ' ', ' ', ' ', 'Y', ' ', 'Y', ' ', 'I', 'Y', 'Y', ' ', ' ', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', 'Y', ' C', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', ' ', ' ', ' ', 'Y', ' C', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', '!', ' ', 'Y', ' C', 'Y', 'Y', ' ', 'Y', 'I', ' ', 'Y', ' ', ' ', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', '!', 'Y', 'Y', 'Y', ' ', 'Y', ' C', 'Y', ' ', 'Y', ' C', ' C', 'Y', 'Y', 'Y', 'Y', ' C', 'Y', 'Y', ' ', 'Y', 'Y', 'Y', 'I', ' C', ' ', ' ', 'Y', 'Y', ' C', 'I', 'Y', ' ', ' C', 'I', ' ', ' ', 'Y', 'Y', 'Y', '!', ' ', 'Y']\n },\n {\n riga: 'rifampicina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ']\n },\n {\n riga: 'rocuronio bromuro',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro'],\n \n valore: ['I', ' C', ' C', ' ', ' ', ' ', ' ', ' C', ' ', ' C', ' ', 'I', ' C', ' C', ' C', 'I', 'I', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' ', ' C', ' ', ' ', ' C', ' C', ' C', 'I', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' ', ' ', ' ', 'I', 'I', ' ', ' C', ' C', ' C', ' C', ' ', ' C', 'I', 'I', ' C', 'I', 'I', 'Y', ' C', ' ', ' ', ' C', ' ', ' ', 'I', ' C', ' C', 'I', ' ', ' ', 'I', ' ', ' ', 'I', ' C', ' C', ' C', ' C', 'I', ' C', ' C', 'I', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' ', ' ', ' C', ' C', ' C', 'I', ' C', ' ', ' ', 'I', ' ', ' ', 'I', 'I', ' C', ' C', ' ', ' C', ' C', ' '],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'salbutamolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo'],\n \n valore: ['I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' ', 'I', ' ', 'I', ' ', ' ', ' ', 'I', 'I', ' ', ' ', 'I', 'I', 'Y', 'I', ' ', ' ', ' ', ' ', ' C'],\n viaCentraleOPeriferica: '>= 0.5mg/ml CVC'\n },\n {\n riga: 'sodio bicarbonato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato'],\n \n valore: ['I', ' C', 'Y', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', 'I', ' C', ' C', 'I', ' ', 'I', 'I', 'I', ' ', ' ', ' C', ' ', 'I', ' C', 'I', 'Y', ' ', 'I', 'I', 'I', ' C', ' C', ' C', '!', ' C', 'Y', 'Y', ' ', 'Y', ' C', 'I', 'I', ' ', ' C', ' C', ' ', ' ', ' ', 'Y', 'I', ' ', 'Y', '!', 'I', 'I', ' ', ' C', 'I', ' C', 'I', 'I', ' C', 'I', ' C', ' C', ' ', 'Y', ' ', ' ', ' C', 'I', ' C', ' C', ' ', 'I', 'Y', 'I', 'I', ' C', 'I', 'Y', ' C', 'Y', ' C', ' C', '!', 'Y', ' C', 'Y', 'Y', 'I', 'I', 'Y', 'Y', ' ', ' ', 'Y', 'I', ' C', ' ', 'I', 'I', ' C', '!', '!', ' ', '!', '!', ' C', '!', ' ', 'Y', 'Y', ' ', ' C', ' '],\n viaCentraleOPeriferica: '1.4 - 4.2%CVP,8.4% CVC'\n },\n {\n riga: 'sodio cloruro 0.9%',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%'],\n \n valore: ['I', ' ', '!', ' ', ' C', ' C', ' C', ' C', ' C', '!', ' C', 'I', ' C', ' C', 'I', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' ', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' C', ' ', ' C', ' C', ' C', 'I', ' ', ' C', ' C', ' C', ' C', ' C', ' C', 'I', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' ', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', '!', ' C', ' C', ' C', ' C', ' C', ' C', '!', ' C', ' C', '!', '!', ' C', ' C', ' C', '!', ' C', ' C', ' C', ' ', ' C', ' C', ' C', ' C', ' C', ' C', ' C', '!', ' C', ' C', ' C']\n },\n {\n riga: 'sodio valproato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C']\n },\n {\n riga: 'succinilcolina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina'],\n \n valore: ['I', ' ', ' C', 'Y', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' ', ' C', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', 'Y', 'I', ' ', ' ', 'Y', ' C', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' ', ' ', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', 'Y', 'Y', ' ', ' C', 'I', ' C', 'Y', 'I', 'I', ' C', 'Y', ' ', ' ', ' C', ' ', ' ', 'Y', 'I', ' C', 'Y', ' ', ' ', 'I', ' C', ' ', ' C', ' C', ' C', 'Y', ' C', ' C', 'Y', ' ', ' C', ' C', 'Y', ' C', ' C', ' C', ' C', 'Y', ' ', ' ', ' C', ' C', ' C', ' ', ' C', 'I', ' C', ' C', ' ', ' ', ' C', ' C', 'Y', 'Y', ' ', ' C', ' ', ' ', ' ', ' ', 'I', '!', ' ']\n },\n {\n riga: 'sufentanil',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil'],\n \n valore: ['I', ' ', ' C', ' ', ' ', ' ', ' ', ' C', ' ', 'I', ' ', 'Y', 'Y', ' C', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', ' C', 'I', ' ', ' ', 'Y', 'I', ' C', ' C', 'Y', ' ', ' C', ' ', 'Y', 'Y', ' ', ' ', ' C', ' ', 'Y', ' ', ' C', ' C', ' ', ' ', ' ', ' C', '!', ' ', 'Y', ' C', 'Y', 'Y', ' ', 'Y', 'I', ' C', 'Y', 'I', 'Y', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', 'Y', ' C', 'Y', ' C', 'Y', 'Y', 'Y', 'Y', ' C', ' C', ' C', ' C', 'Y', 'Y', 'I', 'Y', ' ', ' C', ' C', 'Y', 'Y', ' C', ' C', '!', 'Y', ' ', ' ', 'Y', 'Y', 'Y', ' ', ' C', ' C', ' C', ' C', ' ', ' ', ' C', ' C', 'Y', '!', ' ', 'Y', 'Y', ' ', ' C', ' ', 'Y', '!', ' ', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n },\n {\n riga: 'ticarcillina/acido clavulanico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', 'Y', ' ', ' ', ' ', 'I', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', 'Y', ' ', ' ', 'I', 'Y', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'Y', ' ', ' ', 'I', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', 'Y', ' ', '!', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', 'I', ' C', 'Y', ' ', ' ', ' ', ' ', ' C', ' ', ' ', ' ']\n },\n {\n riga: 'tigeciclina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina'],\n \n valore: ['I', ' ', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', ' ', ' C', ' C', ' C', 'I', ' ', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' C', ' ', ' C', ' ', ' ', ' C', ' C', ' C', ' C', 'Y', ' ', ' C', ' ', ' ', ' ', ' ', ' ', ' C', ' C', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' C', ' C', '!', '!', ' ', 'Y', 'I', ' C', ' C', 'I', ' ', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' C', ' C', ' C', ' ', ' ', ' C', ' ', ' ', ' C', ' C', ' C', ' C', ' C', ' C', ' C', ' C', 'I', ' C', ' C', ' C', ' C', ' ', ' C', ' ', ' ', ' ', ' C', ' C', ' C', 'I', ' C', ' ', ' C', ' C', ' ', ' ', ' ', ' C', ' C', ' C', ' ', 'Y', ' C', ' ', ' C', ' ', ' C', ' ', ' ', ' C', ' C', ' ']\n },\n {\n riga: 'tiopental sodico',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico'],\n \n valore: ['I', 'I', ' C', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' C', 'I', 'I', 'I', ' ', ' ', 'I', ' ', ' ', ' ', ' C', ' ', 'I', 'I', 'I', ' ', ' ', 'I', 'I', ' C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I', 'I', ' ', 'Y', 'I', 'I', 'I', 'I', ' C', 'I', 'I', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', 'I', ' ', ' ', 'I', ' ', 'I', ' ', 'I', 'I', 'I', 'I', 'I', ' ', ' ', 'I', ' ', ' C', ' C', 'I', 'I', ' ', 'I', ' C', ' ', 'Y', 'I', ' C', ' ', 'I', 'I', 'I', '!', 'I', ' ', ' ', 'I', 'I', ' C', ' ', 'Y', 'Y', ' ', 'I', ' ', 'I', ' C', ' ', 'I', 'I', ' ', ' C'],\n viaCentraleOPeriferica: 'CVC'\n },\n {\n riga: 'tobramicina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', 'Y', ' ', ' ', ' ', 'I', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' C', ' ', ' ', ' C', 'I', ' ', 'I', ' C', 'I', ' ', ' ', ' ', ' ', 'Y', ' ', ' C', 'Y', ' ', '!', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', 'Y', ' ', ' ', 'I', 'I', 'I', ' ', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', 'Y', ' C', ' ', ' ', ' ', ' ', ' ', 'Y', ' ', ' ', ' ', 'Y', ' ', ' ', 'Y', ' ', 'Y', ' ', ' ', ' ', ' ', ' C', 'Y', 'Y', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'I', ' ', ' C', 'Y', ' ', ' ', ' ', ' C', ' C', ' ', ' ', ' ', 'I', ' ', ' ']\n },\n {\n riga: 'tramadolo cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' C', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'trimetroprim/sulfametoxazolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato', 'trimetroprim/sulfametoxazolo'],\n \n valore: ['I', ' ', 'Y', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', 'Y', 'I', 'I', ' ', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', 'I', 'I', 'I', 'Y', ' ', ' C', 'I', 'I', 'I', 'Y', ' ', 'I', ' ', ' ', 'I', ' ', 'Y', 'I', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', 'I', 'I', ' ', 'I', 'Y', 'I', 'I', ' ', 'I', 'I', 'I', 'I', 'I', ' ', 'Y', 'I', ' ', ' ', 'I', ' ', '!', 'I', 'I', 'I', 'I', ' ', ' ', 'I', ' ', 'I', 'I', 'I', ' C', 'I', 'Y', 'Y', 'I', ' ', 'I', 'I', 'I', ' C', 'I', 'Y', 'I', 'I', ' ', ' ', 'I', 'I', ' C', ' ', 'I', 'I', 'Y', ' C', ' ', ' ', 'I', 'Y', 'I', 'I', ' ', 'I', 'Y', ' ', 'I', ' ', 'I', '!', ' ', 'I', 'I', ' ', ' C', ' ', ' ', ' '],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'Non diluito (400+80mg/ml)CVC'\n },\n {\n riga: 'urochinasi',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato', 'trimetroprim/sulfametoxazolo', 'urochinasi'],\n \n valore: ['I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '',\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', 'I', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' ', 'I', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']\n },\n {\n riga: 'vancomicina cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato', 'trimetroprim/sulfametoxazolo', 'urochinasi', 'vancomicina cloridrato'],\n \n valore: ['I', 'I', 'Y', ' C', ' ', ' ', ' ', 'Y', 'I', 'I', ' ', ' ', ' C', 'I', 'Y', ' ', ' C', 'I', '!', 'Y', ' ', ' C', ' ', ' C', ' C', 'I', '!', ' ', 'Y', ' C', ' C', 'I', 'I', '!', 'I', '!', '!', 'Y', ' ', 'Y', ' C', 'I', 'Y', 'Y', ' C', ' ', ' ', ' ', ' ', '!', 'I', ' ', 'Y', 'Y', 'Y', 'Y', 'I', 'I', 'I', ' C', 'Y', 'I', 'I', 'Y', 'Y', ' ', ' ', 'Y', ' ', '!', 'I', 'I', 'Y', 'I', ' ', 'Y', 'Y', 'Y', ' C', 'I', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' C', ' C', ' C', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', ' ', 'Y', 'Y', ' C', 'I', 'Y', ' C', 'Y', 'I', 'I', ' ', 'I', 'I', ' C', 'I', ' ', ' C', 'Y', ' ', 'I', 'I', 'Y', ' C', ' ', ' C', 'Y', '!', 'Y', 'I', ' ', ' ', 'I', ' '],\n viaCentraleOPeriferica: '>= 5mg/ml, CVC'\n },\n {\n riga: 'vasopressina',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato', 'trimetroprim/sulfametoxazolo', 'urochinasi', 'vancomicina cloridrato', 'vasopressina'],\n \n valore: ['I', ' C', ' C', ' ', ' ', ' ', ' ', 'Y', ' ', 'I', ' ', ' C', 'Y', ' C', 'Y', ' ', ' ', 'I', 'I', ' ', ' ', ' C', ' ', ' C', 'Y', ' C', ' ', ' ', 'Y', 'Y', ' C', ' C', ' C', ' ', ' C', ' ', 'Y', 'Y', ' ', ' ', ' C', 'Y', ' C', ' ', ' C', ' ', ' ', ' ', ' ', ' C', 'I', ' ', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'I', ' C', 'Y', 'I', ' ', ' C', 'Y', ' ', ' ', 'Y', ' ', ' ', 'I', ' C', 'Y', ' C', ' ', 'Y', 'I', 'Y', ' C', ' C', 'Y', ' C', 'Y', 'Y', ' C', 'Y', 'Y', ' C', ' C', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', ' ', ' ', 'Y', 'Y', ' C', ' ', ' C', ' C', ' ', 'Y', ' ', ' ', ' C', ' C', 'Y', 'I', ' ', 'Y', ' C', ' ', ' C', ' ', 'Y', ' C', ' ', 'Y', 'Y', ' ', ' C', ' C', ' ', ' ', 'I', ' ', 'Y'],\n conservareAlRiparoDallaLuce: 'Si',\n viaCentraleOPeriferica: 'CVC'\n },\n {\n riga: 'verapamil cloridrato',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato', 'trimetroprim/sulfametoxazolo', 'urochinasi', 'vancomicina cloridrato', 'vasopressina', 'verapamil cloridrato'],\n \n valore: ['I', ' C', 'I', ' C', ' ', 'I', '', 'C', 'I', 'I', ' ', 'I', ' C', 'I', ' C', '', '', 'I', 'I', ' ', ' ', 'Y',\n ' ', 'Y', ' C', 'I', 'Y', ' ', ' C', ' C', ' C', ' C', ' ', ' C', 'I', 'Y', 'Y', ' C', 'Y', ' ', 'Y', 'Y', ' C', 'Y', ' C', 'Y', ' ', ' ', ' ', ' C', 'I', ' ', ' C', 'I', '!', ' C', ' C', ' C', 'I', ' C', 'Y', 'I', 'I', 'Y', 'Y', ' ', 'Y', 'Y', ' ', ' ', 'I', 'I', ' C', ' C', 'Y', 'Y', ' C', ' C', ' C', 'Y', 'Y', ' C', ' C', 'Y', ' C', ' C', ' C', ' C', ' C', 'Y', ' C', 'Y', ' C', ' C', ' C', ' ', ' ', ' C', ' C', ' C', ' ', 'Y', 'I', ' C', 'I', ' C', ' ', ' C', 'I', ' C', 'I', ' C', 'Y', ' ', ' ', ' C', ' ', 'I', ' C', ' ', 'Y', 'Y', ' C', 'I', 'I', ' C', ' ', 'I', 'Y', ' C', ' C'],\n conservareAlRiparoDallaLuce: 'Si'\n},\n {\n riga: 'voriconazolo',\n colonna: ['abiciximab', 'acetilcisteina', 'aciclovir', 'acido ascorbico', 'acido etacrinico', 'acido folico', 'acido tranexamico', 'adrenalina', 'albumina umana', 'aloperidolo', 'alteplase', 'amfotericina b', 'amikacina solfato', 'aminofillina', 'amiodarone cloridrato', 'amoxicillina', 'amoxicillina/acido clavulanico', 'ampicillina', 'ampicillina/sulbactam', 'anidulafungina', 'antitrombina ||| umana', 'argatroban anidro', 'atenololo', 'atracurium', 'atropina', 'azitromicina', 'aztreonam', 'betametasone', 'calcio clororo', 'calcio gluconato', 'caspofungin', 'cefazolina sodica', 'cefepime dicloridrato', 'cefoxitina sodica', 'ceftazidima pentaidrato', 'ceftizixima sodica', 'ceftriaxone disodico', 'complesso vitaminico', 'cianocobalamina', 'ciclofosfamide', 'ciclosporina', 'ciprofloxacina', 'cisatracurio besilato', 'claritromicina', 'clindamicina fosfato', 'clonidina', 'clorfenamina maleato', 'colistina solfato', 'daptomicina', 'desametasone fosfato disodico', 'diazepam', 'diclofenac', 'digossina', 'diltiazem cloridrato', 'dobutamina', 'dopamina', 'drotrecogin alfa attivato', 'eparina sodica', 'epoprostenolo sodico', 'eritromicina', 'esmololo ', 'fenitoina sodica', 'fenobarbital', 'fenoldopam mesilato', 'fentanil citrato', 'fisostigmina salicilato', 'fitomenadione(vit.k)', 'fluconazolo', 'flumazenil', 'foscarnet sodico', 'furosemide', 'ganciclovir', 'gentamicina solfato', 'idrocortisone emis. sodico', 'idroxizina dicloridrato', 'imipenem/cilastatina', 'insulina umana', 'isoprenalina cloridrato', 'ketamina', 'ketorolac trometamina', 'labetalolo cloridrato', 'levofloxacina', 'lidocaina cloridrato', 'linezolid', 'lorazepam', 'magnesio solfato', 'meropenem', 'metilprednisolone', 'metoclopramide cloridrato', 'metoprololo tartrato', 'metronidazolo', 'midazolam', 'morfina cloridrato', 'naloxone cloridrato', 'na nitroprussiato anidro', 'neostigmina metilsolfato', 'nimodipina', 'nitroglicerina', 'noradrenalina tartrato', 'octreotide', 'omeprazolo', 'ondansetrone cloridrato', 'oxacillina', 'pancuronio bromuro', 'pantoprazolo sodico', 'penicillina g potassica', 'pentoxifillina', 'piperacillina sodica', 'piperacillina/tazobactam', 'potassio cloruro', 'propofol', 'protamina cloridrato', 'ranitidina cloridrato', 'remifentanil cloridrato', 'rifampicina', 'rocuronio bromuro', 'salbutamolo', 'sodio bicarbonato', 'sodio cloruro 0.9%', 'sodio valproato', 'succinilcolina', 'sufentanil', 'ticarcillina/acido clavulanico', 'tigeciclina', 'tiopental sodico', 'tobramicina', 'tramadolo cloridrato', 'trimetroprim/sulfametoxazolo', 'urochinasi', 'vancomicina cloridrato', 'vasopressina', 'verapamil cloridrato', 'voriconazolo'],\n \n valore: ['I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', '!', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', ' C', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', '!', 'I']\n\n\n }] //Chiusura array oggetto medicine\n\n\n\n /*\n Cerca i farmaci nell' oggetto medicine\n Il primo cilco scandisce le righe il sedondo le colonne\n */\n for (var i = 0; i < medicine.length; i++) { // Scandisce le righe\n if (medicine[i].riga.trim() == farmacoa.trim()) {\n \n para1.textContent = 'Farmaco A Trovato = ' + ' ' + medicine[i].riga.trim();\n\n /*\n Scandisce le colonne\n */\n for (var j = 0; j < medicine[i].colonna.length; j++) {\n if (medicine[i].colonna[j].trim() == farmacob.trim()) { /*Il farmaco e stato trovato */\n\n para2.textContent = 'Farmaco B Trovato = ' + ' ' + medicine[i].colonna[j].trim();\n\n /*\n Controlllo propietà viaCentraleOPeriferica se esiste, ed se e si \n Setta lo stile.\n */\n if (medicine[i].hasOwnProperty(\"viaCentraleOPeriferica\")) {\n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 10mg/ml, >= 25 CVC'){\n para5.textContent = \">= 10mg/ml, >= 25 CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'CVC o'){\n para5.textContent = \"CVC o\";\n para5.style.backgroundColor = \"#94d04c\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 0.4mg/ml CVC'){\n para5.textContent = \">= 0.4mg/ml CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 2mg/ml CVC o'){\n para5.textContent = \">= 2mg/ml CVC o\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 19.4mg/ml CVC o'){\n para5.textContent = \">= 19.4mg/ml CVC o\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 5mg/ml CVC'){\n para5.textContent = \">= 5mg/ml CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 13.8mg/ml CVC'){\n para5.textContent = \">= 13.8mg/ml CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'Se diluito in NPT, CVC'){\n para5.textContent = \"Se diluito in NPT, CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 10ml/ml CVC o'){\n para5.textContent = \">= 10ml/ml CVC o\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'Non diluito (10mg/ml)CVC'){\n para5.textContent = \"Non diluito (10mg/ml)CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'Non diluito 10mg/ml CVC'){\n para5.textContent = \"Non diluito 10mg/ml CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'CVC'){\n para5.textContent = \"CVC\";\n para5.style.backgroundColor = \"#94d04c\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'Non diluito 5mg/ml CVC o'){\n para5.textContent = \"Non diluito 5mg/ml CVC o\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 0.5mmol/ml CVC o'){\n para5.textContent = \">= 0.5mmol/ml CVC o\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '1% PVC/CVC 2% CVC'){\n para5.textContent = \"1% PVC/CVC 2% CVC\";\n para5.style.backgroundColor = \"#94d04c\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 0.5mg/ml CVC'){\n para5.textContent = \">= 0.5mg/ml CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '1.4 - 4.2%CVP,8.4% CVC'){\n para5.textContent = \"1.4 - 4.2%CVP,8.4% CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == 'Non diluito (400+80mg/ml)CVC'){\n para5.textContent = \"Non diluito (400+80mg/ml)CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n if(medicine[i].viaCentraleOPeriferica.trim() == '>= 5mg/ml CVC'){\n para5.textContent = \">= 5mg/ml CVC\";\n para5.style.backgroundColor = \"#c0d499\"; //#94d04c Colore verde scuro //#c0d499 verde chiaro\n para5.style.border = '2px solid black';\n }\n \n /*Non esistse la propietà viaCentraleOPeriferica e viene azzerato il contenuto*/\n }else{\n \n para5.textContent = \"\";\n para5.style.border = '';\n }\n \n \n \n /*\n Controlla se ha la propietà conservareAlRiparoDallaLuce, conservareESomministrareAlRiparoDellaLuce,\n il metodo hasOwnProperty ritorna un valore booleano che indica se la propietà \n dell'oggetto array medicine esiste o no colori: \n */\n if (medicine[i].hasOwnProperty(\"conservareAlRiparoDallaLuce\")) {\n para3.textContent = 'SI';\n para3.style.backgroundColor = \"#f7eade\"; //#f7eade rosa chiaro #db9493 rosa scuro\n para3.style.border = '2px solid black';\n } else {\n para3.textContent = ' ';\n para3.style.border = ' ';\n }\n if (medicine[i].hasOwnProperty(\"conservareESomministrareAlRiparoDellaLuce\")) {\n para4.textContent = 'SI';\n para4.style.backgroundColor = \"#db9493\"; //#f7eade rosa chiaro #db9493 rosa scuro\n para4.style.border = '2px solid black';\n } else {\n para4.textContent = ' ';\n para4.style.border = ' ';\n }\n\n /*\n Valori del farmaco se uguale a una delle lettere allplica lo stile\n Altrimenti lo elemina mettendo il colore al valore black\n */\n if (medicine[i].valore[j] == ' ') {\n\n para.textContent = 'O'; //il colore della o e bianco non si vede serve per creare un quadrato solo con il bianco\n para.style.backgroundColor = '#ffffff'; //#ffffff bianco\n para.style.color = '#ffffff';\n para.style.border = '2px solid black';\n }\n if (medicine[i].valore[j].trim() == 'I') {\n\n para.textContent = medicine[i].valore[j];\n para.style.backgroundColor = '#f70000'; //#f70000 rosso\n para.style.color = '#0f0e0e'; // 0f0e0e nero\n para.style.border = '2px solid black';\n }\n if (medicine[i].valore[j].trim() == 'Y') {\n\n para.textContent = medicine[i].valore[j];\n para.style.backgroundColor = '#fff910'; //#fff910 giallo\n para.style.color = '#0f0e0e'; // 0f0e0e nero\n para.style.border = '2px solid black';\n }\n if (medicine[i].valore[j].trim() == 'C') {\n\n para.textContent = medicine[i].valore[j];\n para.style.backgroundColor = '#00b050'; //#00b050 verde\n para.style.color = '#0f0e0e'; // 0f0e0e nero\n para.style.border = '2px solid black';\n }\n if (medicine[i].valore[j].trim() == '!') {\n\n para.textContent = medicine[i].valore[j];\n para.style.backgroundColor = '#c0c0bf'; //#c0c0bf grigio\n para.style.color = '#df1211'; //#df1211 rosso\n para.style.border = '2px solid black';\n }\n break; /*Esci dal ciclo quando ha trovato il farmaco*/\n }//Chiue if nel secondo ciclo for\n \n /*Azzera tutto se non trova il farmaco solla colonna nell array medicine*/\n para2.textContent = \"\";\n \n \n para3.textContent = \"\";\n para3.style.border = 'none';\n \n para4.textContent = \"\";\n para4.style.border = 'none';\n \n para5.textContent = \"\";\n para5.style.border = 'none';\n \n para.textContent = \"\";\n para.style.border = 'none';\n \n }// Chiude secondo ciclo for\n\n }//Chiue primo if nel primo cliclo for\n\n }// Chiude primo ciclo for\n}", "title": "" }, { "docid": "2f82182a514c2eeeab5c1d0811fc616f", "score": "0.5961952", "text": "function calcularRequerimientosMasPedidos() {\n\t\n\tif(listaVacantes.length > 0){\n\t\t\n\t\t$(\"#divRequerimientosMasPedidos h3\").text(\"Los requerimientos mas solicitados son los siguientes: \");\n\t\tvar conocimientosMasSolicitados = [0, 0, 0, 0, 0, 0];\n\t\tfor(var i = 0; i < listaVacantes.length; i++){\n\t\t\tfor(var j = 0; j < listaVacantes[i][\"conocimientosInformaticos\"].length; j++){\n\t\t\t\t\n\t\t\t\tif(listaVacantes[i][\"conocimientosInformaticos\"][j]){\n\t\t\t\t\tconocimientosMasSolicitados[j] += 3;\n\t\t\t\t} else {\n\t\t\t\t\tconocimientosMasSolicitados[j] += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var i = 0; i < conocimientosMasSolicitados.length; i++){\n\t\t\tvar h2Element = document.createElement(\"h2\");\n\t\t\tswitch(i){\n\t\t\t\tcase 0:\n\t\t\t\t\th2Element.innerHTML = \"Word - \" + conocimientosMasSolicitados[i] + \" puntos.\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\th2Element.innerHTML = \"Excel - \" + conocimientosMasSolicitados[i] + \" puntos.\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\th2Element.innerHTML = \"Power Point - \" + conocimientosMasSolicitados[i] + \" puntos.\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\th2Element.innerHTML = \"Access - \" + conocimientosMasSolicitados[i] + \" puntos.\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\th2Element.innerHTML = \"Correo electrónico - \" + conocimientosMasSolicitados[i] + \" puntos.\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\th2Element.innerHTML = \"Navegadores de Internet - \" + conocimientosMasSolicitados[i] + \" puntos.\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$(h2Element).css(\"fontFamily\", \"Open Sans,Arial,sans-serif\")\n\t\t\t$(\"#divRequerimientosMasPedidos blockquote\").append(h2Element);\n\t\t}\t\t\n\t} else {\n\t\t$(\"#divRequerimientosMasPedidos h3\").text(\"No existen registros de vacantes para obtener estadísticas sobre los requerimientos mas pedidos.\");\n\t}\n}", "title": "" }, { "docid": "11f308353c28d434336b754e7197de62", "score": "0.5937675", "text": "function encuentro_mru1(){\r\n var posicion_final_mru_1;\r\n var posicion_mru_1 = pasaje_uni_pos(get_pos1(), get_sel_pos1());\r\n var velocidad_mru_1 = pasaje_uni_vel(get_vel1(), get_sel_vel1());\r\n var tiempo_mru_1 = pasaje_uni_ti(get_tiem1(), get_sel_tiem1());\r\n posicion_final_mru_1 = (velocidad_mru_1*tiempo_mru_1) + posicion_mru_1;\r\n return posicion_final_mru_1;\r\n}", "title": "" }, { "docid": "ae4f48ffd07d9a9f7d36cba56df26d7b", "score": "0.5937466", "text": "function comprar() {\n for (var i = 0; i < carrinho.length; i++)\n removeQntProd(carrinho[i].qnt, carrinho[i].produto);\n carrinho = [];\n emptyCart();\n}", "title": "" }, { "docid": "8d889add06465476391ba01ac7054f66", "score": "0.5932867", "text": "function dibujar() {\n if (fondo.cargaOK == true) {\n papel.drawImage(fondo.imagen, 0, 0);\n }\n if (vaca.cargaOK == true) {\n for (let v = 0; v < 1; v++) {\n x = redondear(0, vp.width - vaca.imagen.width);\n y = redondear(0, vp.height - vaca.imagen.height);\n papel.drawImage(vaca.imagen, x, y);\n console.log(\"🚀 ~ vaca.imagen\", vaca.imagen);\n console.log(\"🚀 ~ x\", x);\n console.log(\"🚀 ~ y\", y);\n }\n }\n}", "title": "" }, { "docid": "73fa93d73568a0a7210c2e71610131c6", "score": "0.59289175", "text": "deleteAllchanges(primerakey,segundakey){\n \n var content = `<h5>¿Esta seguro de querer remover todos los cambios echos de esta imagen?</h5>\n <button type=\"button\" id=\"yesremove\"><i class=\"fas fa-thumbs-up\"></i> Si</button><button id=\"noderemove\" type=\"button\"><i class=\"far fa-thumbs-down\"></i> No</button>\n <img src=${document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).src} style=\"widt:100%;margin:20px;\">\n `;\n this.showModal(content);\n\n document.getElementById(\"noderemove\").addEventListener(\"click\",()=>{\n document.getElementById(\"emerg\").style.display=\"none\";\n return;\n })\n document.getElementById(\"yesremove\").addEventListener(\"click\",()=>{\n let img = document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).src;\n for(i=1;i<=1;i++){\n this.values[primerakey][segundakey][this.keyimages[primerakey][segundakey]]= [{\"valuetext\":\"\",\"valuesize\":\"\",\"valuecolor\":\"\",\"valueheight\":\"\",\"valueposition\":\"\",\"valueangletext\":\"\",\"valueleftright\":\"\",\"valueupdown\":\"\"}]\n var arrayValuesStandar = [\n {key: `text${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:\"\"},\n {key: `color${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:\"#000000\"},\n {key: `align${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:\"\"},\n {key: `position${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`,value:\"\"},\n {key: `angle${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:\"\"},\n {key: `select-font${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:\"\"},\n {key: `up${i}img${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:\"\"},\n {key: `filterimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `opacityimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:100},\n {key: `blurimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `brilloimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `rojoimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `azulimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `verdeimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `contrastimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `flipimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `invertimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `pixelarimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `rotateimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0},\n {key: `afinarimg${this.keyimages[primerakey][segundakey]}-${primerakey}-${segundakey}`, value:0}\n ]\n }\n for(var v in arrayValuesStandar ){\n document.getElementById(arrayValuesStandar[v].key).value = arrayValuesStandar[v].value;\n }\n\n for(var i=this.moretextCount[primerakey][segundakey][this.keyimages[primerakey][segundakey]];i>1;i--){\n this.removeNodetext(i,primerakey,segundakey);\n }\n if(img.search(\"id\")!=-1){\n img = img.split(\"?\")[0];\n }\n let idimage = Math.round(Math.random()*100000000);\n document.getElementById(\"emerg\").style.display=\"none\";\n fetch(`${this.url}ScrapperImg/removeAllchangesDialy`,{\n method:\"POST\",\n body:\"image=\"+img+\"&primerakey=\"+primerakey+\"&segundakey=\"+segundakey,\n headers:{\n 'Accept':'application/JSON',\n 'Content-Type':'application/x-www-form-urlencoded' \n }\n }).then(data=>{\n data.json().then(images=>{\n document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).src=`http://localhost/scrapperTrooll/application/controllers/${images}?id=${idimage}`;\n })\n })\n })\n }", "title": "" }, { "docid": "6758f925c20cd1f9e2fcc1d77f663ef5", "score": "0.59255683", "text": "function actualizarDatos() {\n // Calculos\n const HORA = new Date();\n const DIFERENCIA = Math.abs(SIETE_AGOSTO - HORA);\n\n if (SIETE_AGOSTO > HORA) {\n // console.log('no se ha ido');\n }else {\n SPAN_SUCESO.textContent = 'Han pasado';\n SPAN_SUCESO_DOS.textContent = 'Desde que Duque se fue de la Casa de Nariño';\n // console.log('ya se fue');\n }\n\n const ANIOS_RESTANTES = Math.floor(DIFERENCIA / MILISEGUNDOS_ANIO);\n const MESES_RESTANTES = Math.floor((DIFERENCIA % MILISEGUNDOS_ANIO) / MILISEGUNDOS_MES);\n // const DIAS_RESTANTES = Math.floor(DIFERENCIA / MILISEGUNDOS_DIA);\n const DIAS_RESTANTES = Math.floor((DIFERENCIA % MILISEGUNDOS_MES) / MILISEGUNDOS_DIA);\n const HORAS_RESTANTES = Math.floor((DIFERENCIA % MILISEGUNDOS_DIA) / MILISEGUNDOS_HORA);\n const MINUTOS_RESTANTES = Math.floor((DIFERENCIA % MILISEGUNDOS_HORA) / MILISEGUNDOS_MINUTO);\n const SEGUNDOS_RESTANTES = Math.floor((DIFERENCIA % MILISEGUNDOS_MINUTO) / MILISEGUNDOS_SEGUNDO);\n // Gracias a Pablo Monteserín (https://pablomonteserin.com/cuenta-regresiva/)\n\n // Render\n SPAN_ANIOS.textContent = ANIOS_RESTANTES;\n SPAN_MESES.textContent = MESES_RESTANTES;\n SPAN_DIAS.textContent = DIAS_RESTANTES;\n SPAN_HORAS.textContent = HORAS_RESTANTES;\n SPAN_MINUTOS.textContent = MINUTOS_RESTANTES;\n SPAN_SEGUNDOS.textContent = SEGUNDOS_RESTANTES;\n}", "title": "" }, { "docid": "59b93318461273d24aecd41e25741bf7", "score": "0.5924437", "text": "function dodaj() {\n console.log(\"Pokupi\");\n let nizRezervacija = [];\n for (let j = 0; j < nizPrebroj.length; j++) {\n let novaRezervacija = document.getElementById('rezervacija' + j).innerHTML;\n //let novaRezervacija = parseInt(novaRezervacija);\n //DODALA USLOV DA NE MOZE DA ODE U MINUS\n if (novaRezervacija > 0) {\n //nizFiltriranihDogadjaja[j].kolicina = parseInt(nizFiltriranihDogadjaja[j].kolicina);\n if (novaRezervacija > parseInt(nizFiltriranihDogadjaja[j].kolicina)) {\n //treba da izbaci gresku za kolicinu \n alert(\n \"lager ne moze da ide u minus. Rezervisete vise ulaznica nego sto ima na lageru.Mozete da kupite maksimalno \" +\n nizFiltriranihDogadjaja[j].kolicina + \" ulaznica\");\n console.log(nizFiltriranihDogadjaja[j].kolicina);\n console.log(novaRezervacija);\n\n novaRezervacija = 0;\n\n }\n\n nizFiltriranihDogadjaja[j].rezervacija = novaRezervacija;\n nizRezervacija.push(nizFiltriranihDogadjaja[j]);\n }\n\n }\n console.log(nizRezervacija);\n\n //vadi niz iz local S 'korpa' i parsira u JavaScript, smesta u promenljivu korpaIzStoridza\n var korpaIzStoridza = JSON.parse(localStorage.getItem('korpa')) || [];\n //merdzujemo niz korpaIzStoridza i nizRezervacija i smestamo u niz novaKorpa\n var novaKorpa = korpaIzStoridza.concat(nizRezervacija);\n console.log(novaKorpa);\n //smesta niz novaKorpa u localStoride\n localStorage.setItem('korpa', JSON.stringify(novaKorpa));\n }", "title": "" }, { "docid": "b36e2aa4ec94ff1eac7b3d1cbc43fd1c", "score": "0.59241784", "text": "function carregaVaca( ){\r\n\tlet numeroVaca = numeroAleatorio(2, 10);\r\n\t\r\n\tfor(let i=0; i<numeroVaca; i++){\r\n\t\t\r\n\t\tlet xA = numeroAleatorio(100, 400);\r\n\t\tlet yA = numeroAleatorio(100, 400);\r\n\t\tpapel.drawImage(vaca.imagem, xA, yA);\r\n\t}\r\n}", "title": "" }, { "docid": "8c0448c4852de478252d9186490786ff", "score": "0.59236807", "text": "fotoPrecedente() {\r\n ( this.contatore == 0 ) ? this.contatore = this.immagini.length - 1 : this.contatore--;\r\n\r\n }", "title": "" }, { "docid": "63dfd1d70de9c11f3c6382baec55c636", "score": "0.59195614", "text": "filhos(jogador) \n {\n let filhos = []; // array de filhos\n \n //Percorre todo o tabuleiro\n for(let i = 0; i < this.tamLinha; i++) \n {\n for(let j =0; j < this.tamColuna; j++) \n {\n let e = this.clonar(); // clona o estado pai\n\n //tenta realizar a jogada\n //se for possivel guarda esse estado no array de filhos \n //senao nao faz nada\n if(e.realizarJogada(jogador, i, j)) \n {\n filhos.push(e);\n //e.acao = [i,j];\n }\n }\n }\n return filhos; //retorna o vetor de filhos\n }", "title": "" }, { "docid": "f2c6d76284e4662b353faaa8d733e316", "score": "0.5908376", "text": "mostrarClima(data) {\n const { name, main: { temp, temp_max, temp_min } } = data;\n\n const centigrados = kelvinACentigrados(temp);\n const max = kelvinACentigrados(temp_max);\n const min = kelvinACentigrados(temp_min);\n\n const actual = document.createElement(\"p\");\n actual.innerHTML = `${centigrados} &#8451;`\n actual.classList.add(\"font-bold\", \"text-6xl\");\n\n const temperaturaMax = document.createElement(\"p\");\n temperaturaMax.innerHTML = `Max: ${max} &#8451;`\n temperaturaMax.classList.add(\"text-xl\")\n\n const temperaturaMin = document.createElement(\"p\");\n temperaturaMin.innerHTML = `Min: ${min} &#8451;`\n temperaturaMin.classList.add(\"text-xl\")\n\n const ubicacion = document.createElement(\"p\");\n ubicacion.textContent = name;\n ubicacion.classList.add(\"font-bold\", \"text2xl\");\n\n const resultadoDiv = document.createElement(\"div\");\n resultadoDiv.classList.add(\"text-center\", \"text-white\")\n resultadoDiv.appendChild(ubicacion)\n resultadoDiv.appendChild(actual)\n resultadoDiv.appendChild(temperaturaMax)\n resultadoDiv.appendChild(temperaturaMin)\n\n resultado.appendChild(resultadoDiv)\n }", "title": "" }, { "docid": "585c97ea9faa26ebf2c9314f8c741ca6", "score": "0.5907649", "text": "function enregis_liste_valeurs() {\n remplaceValeurParDefaut(document.getElementById(\"Omcalc\"), serieBDD[0]);\n remplaceValeurParDefaut(document.getElementById(\"Orcalc\"), serieBDD[1]);\n remplaceValeurParDefaut(document.getElementById(\"Olcalc\"), serieBDD[2]);\n remplaceValeurParDefaut(document.getElementById(\"Okcalc\"), serieBDD[3]);\n}", "title": "" }, { "docid": "4e3871bd0294ecc502ebf4f0d82f8d6c", "score": "0.590537", "text": "function euristicaCostruttiva(){\n\n\t//ad ogni cliente assegno un magazzino, in base alle richieste crescenti\n\tvar req=new Array(GAP.m);\n\tvar ind=new Array(GAP.m);\n\tGAP.sol=new Array(GAP.n);\n\tGAP.solbest=new Array(GAP.n);\n\tcapleft=GAP.cap.slice();\n\t\n\tzub = 0;\n\t// per ogni cliente\n\tfor (j = 0; j < GAP.n; j++) {\n\t\t// per ogni magazzino\n\t\tvar cli_requests = [];\n\t\tfor (i = 0; i < GAP.m; i++) {\n\t\t\treq[i] = GAP.req[i][j];\n\t\t\tind[i] = i; // array di supporto per l'ordinamento\n\t\t\tcli_requests.push({'req':req[i],'ind':ind[i]});\n\t\t}\n\t\t// ordina in base alle richieste crescenti\n\t\tind.sort(function(a,b){return req[a]-req[b]});\n\t\tii = 0;\n\t\twhile (ii < GAP.m) {\n\t\t\ti = ind[ii];\n\t\t\tif (capleft[i] >= GAP.req[i][j]) {\n\t\t\t\tGAP.sol[j] = i; // soluzione: a sol[j] Ŕ associato il cliente j\n\t\t\t\tGAP.solbest[j] = i; // soluzione migliore\n\t\t\t\tcapleft[i] -= GAP.req[i][j]; // riduco la capacitÓ\n\t\t\t\tzub += GAP.c[i][j]; // aumento zub per incrementare il costo totale\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//se questo magazzino non ha abbastanza capacitÓ, allora provo col successivo\n\t\t\tii++;\n\t\t}\n\t\tif (ii == GAP.m)\n\t\t\talert(\"Errore nella creazione della soluzione iniziale\");\n\t}\n\t\n\tif(Math.abs(zub - checkSolution(GAP.sol)) > EPS){\n\t\tconsole.log(\"ERRORE: soluzione non ammissibile\");\n\t\tprintln(\"ERRORE: soluzione non ammissibile\");\n\t\tzub = Number.MAX_VALUE;\n\t}\n\telse{\n\t\tconsole.log(\"Terminata la costruzione della soluzione iniziale, costo \" + zub);\n\t\tprintln(\"Terminata la costruzione della soluzione iniziale, costo \" + zub);\n\t\tprintln(\"----------\");\n\t\tconsole.log(GAP.sol);\n\t\tconsole.log(\"---------------------\");\n\t}\n\n\treturn zub;\n}", "title": "" }, { "docid": "4455cac395021961b13707ded2cb1ead", "score": "0.5904774", "text": "function calcularLucroDeTodosProdutos(produtos) {\n return produtos.map(produto => {\n return calcularLucro(produto)\n })\n}", "title": "" }, { "docid": "5a4e9d645ea4a32c7f4da017cb108390", "score": "0.5900776", "text": "function plantila_General_curso(p) {\n let numero = p.id;\n //div pedido nuevo\n let divPedido = document.createElement(\"div\");\n divPedido.className = \"pedidoNuevo\";\n\n // contendor de clase pedido\n let pedido = document.createElement(\"div\");\n pedido.className = \"pedido\";\n divPedido.appendChild(pedido);\n\n //fila 1 de clase parte\n let parte1 = document.createElement(\"div\");\n parte1.className = \"parte\";\n pedido.appendChild(parte1);\n\n //se gregan las dos columanas de la fila 1\n //columa 1\n let colum1 = document.createElement(\"div\");\n colum1.className = \"columna\";\n colum1.style.fontSize = \"medium\";\n parte1.appendChild(colum1);\n //numero del pedido\n let numeroPed = document.createElement(\"p\");\n numeroPed.style.justifyContent = \"center\";\n numeroPed.innerHTML = \"Pedido #\" + numero;\n colum1.appendChild(numeroPed);\n\n //boton azul ver detalles\n let botonAzul = document.createElement(\"button\");\n botonAzul.className = \"botonAzul\";\n botonAzul.innerHTML = \"Ver detalles\";\n colum1.appendChild(botonAzul);\n botonAzul.addEventListener(\"click\", () => {\n if (botonAzul.innerHTML == \"Ver detalles\") {\n verDetalles(pedido, numero);\n botonAzul.innerHTML = \"Menos detalles\";\n botonAzul.style = \"font-size:small;\";\n setTimeout(() => {\n let l = pedido.lastChild;\n l.className = \"detalles activo\";\n }, 200)\n }\n else {\n let det = pedido.lastChild;\n removeAllChildNodes(det);\n det.remove(det);\n botonAzul.innerHTML = \"Ver detalles\";\n botonAzul.style = \"font-size:medium;\";\n }\n });\n\n //columna 2\n let colum2 = document.createElement(\"div\");\n colum2.className = \"columna\";\n parte1.appendChild(colum2);\n\n //boton verde aceptar\n let botonVerde = document.createElement(\"button\");\n botonVerde.className = \"botonVerde\";\n botonVerde.innerHTML = \"Listo para entregar\";\n colum2.appendChild(botonVerde);\n\n botonVerde.addEventListener(\"click\", () => {\n\n pedidoListo(p);\n removeAllChildNodes(divPedido);\n divPedido.remove(divPedido);\n cambiarEstadoPedido(idPedido = p.id, nuevoEstado = \"Listo\", razonRechazo = \"\");\n });\n //fila 3\n let parte3 = document.createElement(\"div\");\n parte3.className = \"parte\";\n pedido.append(parte3);\n let colum31 = document.createElement(\"div\");\n parte3.appendChild(colum31);\n let par = document.createElement(\"p\");\n par.innerHTML = \"Hora de entrega\";\n colum31.appendChild(par);\n\n let colum32 = document.createElement(\"div\");\n parte3.appendChild(colum32);\n let par2 = document.createElement(\"p\");\n let fecha = p.horaEntrega;\n par2.innerHTML = fecha;\n colum32.appendChild(par2);\n\n return divPedido;\n\n}", "title": "" }, { "docid": "27accd0f733712813e6b0ae826dc50d0", "score": "0.5892879", "text": "function limpiarDulces(){\n\tcdulcesH=verifHorizontal()\n\tcdulcesV=verifVertical()\n\n\tif(cdulcesH == 0 && cdulcesV == 0){\n\t\t$(\"#score-text\").text(puntos)\n\t\tclearInterval(eliminar)\n\t\tbnewd=0\n\t\tnewdulces = setInterval(function(){nuevosdulces()}, 600)\n\t}\n\n\t$(\"div[class*='col-'\").css(\"justify-content\", \"flex-end\")\n\t$(\".borrar\").hide(\"pulsate\", 1000, function(){\n\t\tpuntos = puntos + ($(\".borrar\").length * 10)\n\t\t$(\".borrar\").remove(\"img\")\n\t})\n\n\t$(\".elemento\").draggable({\n\t\tcontainment: \".panel-tablero\",\n\t\trevert: true,\n\t\treverDuration: 0,\n\t\tsnap: true,\n\t\tsnapMode: \"inner\",\n\t\tsnapTolerance: 40,\n\t})\n\n\t$(\".elemento\").droppable({\n\t\tdrop: function(event, ui){\n\t\t\tvar dropped = ui.draggable;\n\t\t\tvar droppedOn = this;\n\t\t\tprueba=0;\n\t\t\tdo{\n\t\t\t\tprueba = dropped.swap($(droppedOn));\n\t\t\t}while(prueba==0)\n\t\t\tcdulcesH=verifHorizontal()\n\t\t\tcdulcesV=verifVertical()\n\t\t\tmove++\n\t\t\t$(\"#movimientos-text\").text(move)\n\t\t\tif(cdulcesV==0 && cdulcesH==0){\n\t\t\t\tdropped.swap($(droppedOn));\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "091cab64748e6449df08a6505f19e4d1", "score": "0.5892109", "text": "async function deletarCarrinho (req, res){\n const {produtos, carrinho} = await lerArquivo();\n \n for(i =0; i < carrinho.produtos.length; i++){\n const procurarLista = produtos.find(x => x.id === carrinho.produtos[i].id)\n\n if(procurarLista){\n procurarLista.estoque += carrinho.produtos[i].quantidade;\n }\n }\n\n carrinho.produtos.splice(0)\n\n atualizarCarrinho(carrinho)\n \n await escreverNoArquivo( { produtos, carrinho })\n res.json({\"mensagem\": \"Operação realizada com sucesso!\"})\n}", "title": "" }, { "docid": "369b1e0d4183ce2f3e70a48966cd82f5", "score": "0.5890001", "text": "buscarCantidades(r, tipoConcreto) {\n\t\tfor (let c in ctds) {\n\n\t\t\tvar simbolo = ctds[c][\"simbolo\"]\n\t\t\tvar valor = ctds[c][\"valor\"]\n\t\t\tvar palabras = ctds[c][\"palabras\"]\n\t\t\tvar tipo = ctds[c][\"tipo\"]\n\n\t\t\t// var re = new RegExp(palabras,'i');\n\t\t\t// let s = r.replace(re, simbolo);\n\n\t\t\tlet todo = palabras.replace(\" \", \"\", \"g\")//me salto los espacios\n\n\t\t\t// console.log(s);\n\n\t\t\t// let s=r.replace(/(kilogramos|kilos|kilogramo|kilo|kg)/gi, \"KG\");\n\t\t\tvar n = new RegExp(\"(\\\\d+[,\\\\d+]*)\\\\s*\" + todo, \"i\")\n\t\t\tlet encontrado = r.match(n);\n\n\t\t\tif (encontrado) {\n\t\t\t\tconsole.log(encontrado);\n\t\t\t\tlet numero = encontrado[1].replace(',', '.');\n\t\t\t\tr = r.replace(encontrado[0], \"\"); //borramos lo que ya hemos hecho\n\t\t\t\tconsole.log(numero);\n\t\t\t\tvar cifra = parseFloat(numero) * valor;\n\t\t\t\t// console.log(r);\n\n\t\t\t\tconsole.log(cifra + tipo);\n\t\t\t\tif (tipoConcreto) if (tipoConcreto.lastIndexOf(tipo) < 0) return;\n\n\t\t\t\tswitch (tipo) {//TODO: mirar si debo sumar cantidades del mismo tipo\n\t\t\t\t\tcase TipoCantidad.MASA: this.cantidad = cifra;\n\t\t\t\t\tcase TipoCantidad.VOLUMEN: this.cantidad = cifra;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TipoCantidad.PRECIO: this.precio = cifra;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//TODO: unidades\n\t\t\t\t\tcase TipoCantidad.UNIDADES: this.unidades = cifra;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: console.log(\"What magnitude is it?\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if(s!=r) \n\t\t\t// console.log(\"REPLACE: \"+s);\n\n\n\n\t\t\t//(\"(\\\\d+([,\\\\s]*\\\\d+)*\\\\s*\" + simbolo + \")\");\n\n\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "133f0c81fb64ed19b4dac82b3d41a216", "score": "0.58899134", "text": "function cargarReglasDeNegocio(){\n\t \n var cargos = JSON.parse(sessionStorage.jsonReglasNegocio).aplicaciones.entreMiscuentas.operacion.cargo;\n \n reglasDeNegocio = [];\n var cuentasDeAbonoAux2;\n var operaMismoDia;\n\tvar operaProgramadas;\n\tvar maximoDiasDeProgramacion;\n\tvar operaEnSabado;\n var operaEnDomingo;\n var operaEnDiasNoHabiles;\n\n for ( var i = 0; i < cargos.length; i++) {\n var cuentasDeAbono = [];\n // Se leen las cuentas permitidas como cuenta origen\n \n if(cargos[i].moneda == DIVISA_MXP){\n var cuentasDeCargo = cargos[i].cuentas.cuenta;\n \n // Se leen las cuentas permitidas como cuenta destino\n var cuentasDeabonoAux = cargos[i].abono;\n \n if(Object.prototype.toString.call(cuentasDeabonoAux) === '[object Array]'){\n \n for(var l = 0; l < cuentasDeabonoAux.length;l++){\n \n operaMismoDia = cuentasDeabonoAux[l].operaMismoDia;\n operaProgramadas = cuentasDeabonoAux[l].operaProgramadas;\n maximoDiasDeProgramacion = cuentasDeabonoAux[l].maximoDiasDeProgramacion;\n operaEnSabado = cuentasDeabonoAux[l].operaEnSabado;\n operaEnDomingo = cuentasDeabonoAux[l].operaEnDomingo\n operaEnDiasNoHabiles = cuentasDeabonoAux[l].operaEnDiasNohabiles;\n\n \n cuentasDeAbonoAux2 = cuentasDeabonoAux[l].cuentas;\n \n if(Object.prototype.toString.call(cuentasDeAbonoAux2.cuenta) === '[object Array]' ){\n \n for(var m = 0; m < cuentasDeAbonoAux2.cuenta.length;m++){\n \n if(cuentasDeAbonoAux2.cuenta[m] == TIPO_TC || cuentasDeAbonoAux2.cuenta[m] == TIPO_AH|| cuentasDeAbonoAux2.cuenta[m] == TIPO_LI || cuentasDeAbonoAux2.cuenta[m] == TIPO_CH){\n \n cuentasDeAbono.push(cuentasDeAbonoAux2.cuenta[m]);\n }\n }\n }else{\n if(cuentasDeAbonoAux2.cuenta == TIPO_TC || cuentasDeAbonoAux2.cuenta == TIPO_AH || cuentasDeAbonoAux2.cuenta == TIPO_LI || cuentasDeAbonoAux2.cuenta == TIPO_CH){\n cuentasDeAbono.push(cuentasDeAbonoAux2.cuenta);\n }\n }\n \n }\n }else if(Object.prototype.toString.call(cuentasDeabonoAux.cuentas.cuenta) === '[object Array]'){\n \n operaMismoDia = cuentasDeabonoAux.operaMismoDia;\n operaProgramadas = cuentasDeabonoAux.operaProgramadas;\n maximoDiasDeProgramacion = cuentasDeabonoAux.maximoDiasDeProgramacion;\n operaEnSabado = cuentasDeabonoAux.operaEnSabado;\n operaEnDomingo = cuentasDeabonoAux.operaEnDomingo\n operaEnDiasNoHabiles = cuentasDeabonoAux.operaEnDiasNohabiles;\n \n for(var n = 0; n < cuentasDeabonoAux.cuentas.cuenta.length;n++){\n \n if(cuentasDeabonoAux.cuentas.cuenta[n] == TIPO_TC || cuentasDeabonoAux.cuentas.cuenta[n] == TIPO_AH || cuentasDeabonoAux.cuentas.cuenta[n] == TIPO_LI || cuentasDeabonoAux.cuentas.cuenta[n] == TIPO_CH){\n cuentasDeAbono.push(cuentasDeabonoAux.cuentas.cuenta[n]);\n }\n }\n \n }else{\n if(cuentasDeabonoAux.cuentas.cuenta == TIPO_TC || cuentasDeabonoAux.cuentas.cuenta == TIPO_AH || cuentasDeabonoAux.cuentas.cuenta == TIPO_LI || cuentasDeabonoAux.cuentas.cuenta == TIPO_CH){\n cuentasDeAbono.push(cuentasDeabonoAux.cuentas.cuenta);\n }\n }\n \n // Se generan las nuevas reglas de negocio de esta iteración\n if ((typeof cuentasDeCargo == 'string') && (typeof cuentasDeAbono == 'string')) {\n var nuevaRN = new ReglaNegocio(cuentasDeCargo, cuentasDeAbono);\n reglasDeNegocio.push(nuevaRN);\n \n } else if ((typeof cuentasDeCargo == 'string') && (Object.prototype.toString.call(cuentasDeAbono) === '[object Array]')) {\n for ( var k = 0; k < cuentasDeAbono.length; k++) {\n if(cuentasDeCargo == TIPO_TC || cuentasDeCargo == TIPO_AH || cuentasDeCargo == TIPO_CH || cuentasDeCargo == TIPO_LI){\n var nuevaRN = new ReglaNegocio(cuentasDeCargo, cuentasDeAbono[k], operaMismoDia,operaProgramadas,maximoDiasDeProgramacion,operaEnSabado,operaEnDomingo,operaEnDiasNoHabiles);\n reglasDeNegocio.push(nuevaRN);\n }\n }\n \n } else if ((Object.prototype.toString.call(cuentasDeCargo) === '[object Array]') && (typeof cuentasDeAbono == 'string')) {\n for ( var j = 0; j < cuentasDeCargo.length; j++) {\n var nuevaRN = new ReglaNegocio(cuentasDeCargo[j], cuentasDeAbono);\n reglasDeNegocio.push(nuevaRN);\n }\n \n } else {\n for ( var j = 0; j < cuentasDeCargo.length; j++) {\n if(cuentasDeCargo[j] == TIPO_TC || cuentasDeCargo[j] == TIPO_AH || cuentasDeCargo[j] == TIPO_CH || cuentasDeCargo[j] == TIPO_LI){\n for ( var k = 0; k < cuentasDeAbono.length; k++) {\n var nuevaRN = new ReglaNegocio(cuentasDeCargo[j], cuentasDeAbono[k],operaMismoDia,operaProgramadas,maximoDiasDeProgramacion,operaEnSabado,operaEnDomingo,operaEnDiasNoHabiles);\n reglasDeNegocio.push(nuevaRN);\n }\n }\n }\n }\n }\n }\n \n console.log(reglasDeNegocio);\n sessionStorage.reglasCalendario = JSON.stringify(reglasDeNegocio);\n\t\n sessionStorage.operacion=\"G\";\n sessionStorage.bandRegresar=\"false\";\n}", "title": "" }, { "docid": "b74f2d43805c6f35be111df2bc68b175", "score": "0.5881416", "text": "reparteCartas() {\n // facil\n if(options.dificultad === 'facil') {\n this.parejas = 4;\n this.barajaCartas();\n this.tablero = [\n // ARRIBA\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n // ABAJO\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height - 25,\n 'bck-card-1')\n ];\n }\n\n // medio\n if(options.dificultad === 'medio') {\n this.parejas = 6;\n this.barajaCartas();\n this.tablero = [\n // ARRIBA\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n // MEDIO\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n // ABAJO\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height + 100,\n 'bck-card-1')\n ];\n }\n\n // dificil\n if(options.dificultad === 'dificil') {\n this.parejas = 8;\n this.barajaCartas();\n this.tablero = [\n // PRIMERA\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height - 150,\n 'bck-card-1'),\n // SEGUNDA\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height - 25,\n 'bck-card-1'),\n // TERCERA\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height + 100,\n 'bck-card-1'),\n // CUARTA\n this.add.image(this.centroCanvas.width - 150,\n this.centroCanvas.height + 225,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width - 50,\n this.centroCanvas.height + 225,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 50,\n this.centroCanvas.height + 225,\n 'bck-card-1'),\n this.add.image(this.centroCanvas.width + 150,\n this.centroCanvas.height + 225,\n 'bck-card-1')\n ];\n }\n }", "title": "" }, { "docid": "5d49a9573fb6fd9e228fe114df54b51c", "score": "0.5875688", "text": "function superposicion_vertical(){\r\n for (n=0; n<casillas.length; n++){\r\n coordenadas_ocupadas(casillas[n]);\r\n coordenadas_pieza(pieza_movida);\r\n \r\n if ( \r\n ((casilla_ocupada_x==pieza_movida_x))\r\n &&\r\n (casillas[n].getAttribute(\"ocupada\")==\"true\")\r\n && \r\n (casillas[n] != casilla_anterior)\r\n )\r\n { \r\n // EVITAR SUPERPOSICIÓN VERTICAL\r\n\r\n \r\n // SE HACE UN NUEVO FOR PARA CARGAR TODAS LAS CASILLAS ALINEADAS\r\n //CON LA TORRE Y UNA PIEZA OCUPADA\r\n for (i=0; i<casillas.length; i++){\r\n coordenadas_genericas(casillas[i]);\r\n // CONDICIÓN PARA QUE UNA CASILLA QUEDE \"iNTERPUESTA\"\r\n if(\r\n (casilla_ocupada_x==casilla_generica_x)\r\n &&\r\n (Math.sign(casilla_ocupada_y-pieza_movida_y)\r\n ==\r\n Math.sign(casilla_generica_y-casilla_ocupada_y))\r\n ) \r\n { \r\n // SE AGREGA ESTE ATRIBUTO A LAS CASILLAS BLOQUEADAS POR OTRA PIEZA\r\n casillas[i].setAttribute('imposible','true');\r\n }\r\n \r\n }\r\n \r\n }\r\n // EVITAR SUPERPOSICIÓN HORIZONTAL\r\n if ( \r\n ((casilla_ocupada_y==pieza_movida_y))\r\n &&\r\n (casillas[n].getAttribute(\"ocupada\")==\"true\")\r\n && \r\n (casillas[n] != casilla_anterior)\r\n )\r\n { \r\n \r\n \r\n for (i=0; i<casillas.length; i++){\r\n coordenadas_genericas(casillas[i]);\r\n if(\r\n (casilla_ocupada_y==casilla_generica_y)\r\n &&\r\n (Math.sign(casilla_ocupada_x-pieza_movida_x)\r\n ==\r\n Math.sign(casilla_generica_x-casilla_ocupada_x))\r\n )\r\n\r\n \r\n // Excluir a la pieza del mismo color como casilla destino\r\n \r\n {\r\n casillas[i].setAttribute('imposible','true');\r\n }\r\n \r\n \r\n \r\n }\r\n\r\n \r\n }\r\n }\r\n }", "title": "" }, { "docid": "70dae5085d8800202a9e7615b1a1edd2", "score": "0.58741367", "text": "function restarProd(articulo) {\n\tlet acum = 0,\n\t\ttotCont = 0;\n\t//\t\t\tconsole.log(articulo.cod,articulo.descripcion);\n\n\tlet indC = carrito.id.indexOf(articulo.cod);\n\t//\tconsole.log(articulo.cod);\n\n\tif (indC != -1) {\n\n\t\t//\t\tcarrito.cantidad[indC]++;\n\t\tif (carrito.cantidad[indC] > 1) {\n\n\t\t\t//\t\t console.log(carrito.cantidad[indC]++);\n\t\t\tcarrito.cantidad[indC]--;\n\n\t\t\tcarrito.total = carrito.total - parseInt(articulo.precio);\n\t\t}\n\n\t}\n\n\t//muestro el precio y la cantidad de productos al agregar al carrito.\n\n\tactInicio();\n\n\n\t// guardo nuevamente los datos en localstorage\n\tlocalStorage.carrito = JSON.stringify(carrito);\n}", "title": "" }, { "docid": "cdd89b39b24c33bc8730c4fdb0118aa9", "score": "0.587151", "text": "function leerDatosCurso(curso){\n\n //crear un obejto con el contenido del curso actual\n const infoCurso={\n imagen : curso.querySelector('img').src, //seleccionar el curso\n titulo : curso.querySelector('h4').textContent,\n precio : curso.querySelector('.precio span').textContent,\n id : curso.querySelector('a').getAttribute('data-id'), //obtener el atributo data\n cantidad : 1\n\n }\n\n //revisa si un elemento existe en el carrito\n const existe= articulosCarritos.some( curso => curso.id=== infoCurso.id);\n if(existe){\n\n //actualizar la cantidad\n const cursos= articulosCarritos.map(curso =>{\n if( curso.id=== infoCurso.id){\n curso.cantidad++;\n return curso;//retorna el objeto actualizado\n }\n else{\n return curso; //retorna los objetos que no son duplicados\n }\n\n });\n articulosCarritos=[...cursos];\n\n }\n else{\n //Agrega elementos al arreglo carrito\n articulosCarritos= [...articulosCarritos, infoCurso];\n\n }\n\n\n\n console.log(articulosCarritos);\n\n carritoHtml();\n\n}", "title": "" }, { "docid": "e41d7c70e93f7077faf51354d1f8aae8", "score": "0.58658344", "text": "function leercontenido(curso){\n\n const infocurso = {\n imagen: curso.querySelector('img').src,\n info: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id'),\n cantidad : 1,\n\n}\n\n\n\n//REVISAR SI ESTA S IESTA SUMA 1\n\nconst existe = carritodecompras.some(curso => curso.id === infocurso.id);\nif (existe){\n const cursos = carritodecompras.map(curso =>{\n if (curso.id === infocurso.id){\n\n curso.cantidad++;\n return curso; //retorna el objeto actualizado\n\n }\n else{\n return curso; //objetos no duplicados\n }\n });\n\n carritodecompras = [...cursos];\n\n}\nelse{\n carritodecompras = [...carritodecompras, infocurso];\n \n};\n\n\n\n\ncarritoHTML();\n}", "title": "" }, { "docid": "75db9fdb2d070b8da118bcb089ed5b42", "score": "0.5864086", "text": "function jouer_carte_ordinateur(){\n\n\tvar nombreAleatoire = nombre_aleatoire(0, 4);\n\n\twhile(cartesJoueesOrdinateur.indexOf(nombreAleatoire) !== -1){ // tant qu'on n'a pas choisit une cart qui n'a pas encore été jouée\n\n\t\tnombreAleatoire = nombre_aleatoire(0, 4);\n\t}\n\n\tcartesJoueesOrdinateur.push(nombreAleatoire);\n\n\t// On change la carte de gauche dans la zone neutre par la carte aléatoire qu'on vient de choisir\n\n\tcartesSelectionnees[0] = cartesJoueurDeux[nombreAleatoire];\n\t\t\n\tswitch(cartesJoueurDeux[nombreAleatoire]){\n\n\t\tcase 1:\n\t\t\tcartesSelectionneesElt[0].src = \"img/esclave.jpg\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcartesSelectionneesElt[0].src = \"img/citoyen.jpg\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcartesSelectionneesElt[0].src = \"img/empereur.jpg\";\n\t\tbreak;\n\t}\n\n\tzoneJoueurDeuxElt.removeChild(document.getElementById(\"carte_j2_\" + ( nombreAleatoire + 1 ) )); // On supprime la carte choisit des cartes de l'ordinateur\n}", "title": "" }, { "docid": "804d338cdfb289c69afabccfdc5bd4b0", "score": "0.5859443", "text": "function encuentro_mruv2(){\r\n var posicion_final_mruv_2;\r\n var posicion_mruv_2 = pasaje_uni_pos(get_pos2(), get_sel_pos2())\r\n var velocidad_mruv_2 = pasaje_uni_vel(get_vel2(), get_sel_vel2())\r\n var tiempo_mruv_2 = pasaje_uni_ti(get_tiem2(), get_sel_tiem2())\r\n var aceleracion_mruv_2 = pasaje_uni_acel(get_acel2(), get_sel_acel2())\r\n posicion_final_mruv_2 = posicion_mruv_2 + (velocidad_mruv_2*tiempo_mruv_2) + ((1/2*aceleracion_mruv_2)*(tiempo_mruv_2*tiempo_mruv_2));\r\n return posicion_final_mruv_2;\r\n}", "title": "" }, { "docid": "51bcc66daba5a8f9cbb682ba7d07885b", "score": "0.5855746", "text": "function equiposEnComp(competencia)\n{\n var listaEquiposEnComp = filtrarLista(listInscripciones, \"competencia\", competencia, false);\n\n listaEquiposEnComp = eliminarDuplicado(listaEquiposEnComp, \"equipo\");\n\n return listaEquiposEnComp;\n\n}", "title": "" }, { "docid": "61e1f30ee7d12fb8395b2789320d2cd4", "score": "0.5847802", "text": "function maisVendidosAcima(produtos){\n result = produtos.sort((produtoA, produtoB)=> {\n return (produtoB.preco*produtoB.numVendas)-(produtoA.preco*produtoA.numVendas)\n });\n\n result.forEach(produto => produto.precoTotal = produto.preco*produto.numVendas);\n return result\n}", "title": "" }, { "docid": "e6cbb66a1dafda49f8d90c84a5ac03c1", "score": "0.58475375", "text": "function renderizaMunicoes(){\n\tmunicoes.forEach(desenhaMunicao);\n\tmunicoesAndam();\n}", "title": "" }, { "docid": "f34bcdae263356976712ce0afa04f59f", "score": "0.58384717", "text": "function principio(){\r\n\t\t//console.log(comerciales);\r\n\t\t//if(RANDOM!=3){\r\n\t\t\tmezclarComercialesLista(); // MEZCLA LA LISTA DE LOS COMERCIALES POR FISHER YATES Y SATTOLO \r\n\t\t\tmezclarGenerosLista(); // MEZCLA LA LISTA DE LOS GENEROS POR FISHER YATES Y SATTOLO \r\n\t\t//}\r\n\t\t\tcrear_listas();\r\n\t\r\n\t\t\t//mezclar_generos_RANDOM(); // MEZCLA LOS GENEROS POR EL RANDOM CORRESPONDIENTE\r\n\t\t\t//reproducir(generos_A_P); // CREA LA LISTA DE REPRODUCCION\r\n\t\t\t//guardar_variables_lista();\r\n\t\t//\tsetTimeout( inicio(), 3000);\r\n\r\n\t\t}", "title": "" }, { "docid": "48eda8f3cb535c23a3a21fff523acb45", "score": "0.5837764", "text": "function obtemAlturaRelativa() {\n \tremoverForma();\n \tvar picos = [20,20,20,20,20,20,20,20,20,20];\n \tfor (var linha = 0; linha < gradeDoJogo.length; linha++) {\n \t\tfor (var coluna = 0; coluna < gradeDoJogo[linha].length; coluna++) {\n \t\t\tif (gradeDoJogo[linha][coluna] !== 0 && picos[coluna] === 20) {\n \t\t\t\tpicos[coluna] = linha;\n \t\t\t}\n \t\t}\n \t}\n \taplicaForma();\n \treturn Math.max.apply(Math, picos) - Math.min.apply(Math, picos);\n }", "title": "" }, { "docid": "0de32767e6e911e1e5090380bd42fa69", "score": "0.58360666", "text": "function equiposEnCompSinDatos(competencia)\n{\n //Guardamos en una variable la lista de registros por equipo, que estan inscriptos en la competencia especificada \n var listaEquiposEnComp = equiposEnComp(competencia);\n var listaFinal = [];\n \n // si la lista esta vacia devolvemos la misma \n if (listaEquiposEnComp.length === 0)\n {\n return listaEquiposEnComp;\n } else\n { \n //En caso de que la lista de equipos inscriptos no sea vacia recorremos la misma y comparamos para ver si los metros aun no fueron\n //ingresados en caso de que no se hayan ingresado los agregamos a la lista y devolvemos la lista luego de recorrer todos los equipos.\n \n for (var i = 0; i < listaEquiposEnComp.length; i++)\n {\n if (listaEquiposEnComp[i].metros === 0)\n {\n listaFinal.push(listaEquiposEnComp[i]);\n }\n }\n return listaFinal;\n }\n}", "title": "" }, { "docid": "bf95bff0f2fe9842f0d4ea8e580c152a", "score": "0.5831227", "text": "function contarVocales(cancion){\n //creo un objeto dentro de mi funcion donde voy a almacenar la cantidad de veces que una letra se repite en la cancion (string)\n let contador ={\n a:0,\n e:0,\n i:0,\n o:0,\n u:0,\n otros:0, \n };\n//un inderadot que contiene una variable que inicializará en cero y que tiene una condicion que dice: mientras esta variable creada\n // del for sea menor a la longitud de mi cancion(array/string) y voy aumentar estar variable en 1 cada vez , hasta que esa\n // condicion deje de ser verdadera\n\n\nfor (let i=0; i < cancion.length; i++){\n//voy a evaluar cada caracter en mi cancion y compararlo con lo que quiero buscar que en este caso es \"a\"(convertida a minuscula por lowercase)\n if (cancion[i].toLowerCase() === \"a\"){\n // voy a amuentar en 1 el contador para a si esta condicion se cumnple\n contador.a += 1;\n }else if (cancion[i].toLowerCase() === \"e\"){\n contador.e += 1;\n }else if (cancion[i].toLowerCase() === \"i\"){\n contador.i += 1;\n }else if (cancion[i].toLowerCase() === \"o\"){\n contador.o += 1;\n }else if (cancion[i].toLowerCase() === \"u\"){\n contador.u += 1;\n }else {\n contador.otros += 1;\n }\n }\n//y termino mi funcion dandole un valor que en este caso es todo mi objeto contador, que a su vez contiene \n return contador;\n}", "title": "" }, { "docid": "fae1187e139f8233a3e8321fc98ae1b9", "score": "0.58298296", "text": "function pretragaRezultat(rez,div){\n let ispis = \"\";\n rez.forEach(p => {\n ispis +=`<div class='col-lg-4 col-md-6 col-sm-6 rounded-lg m-auto'>\n <div class='item-logo'>\n <img src=\"${p.SlikaProizvodjaca}\" alt=\"${p.Naziv}\"/>\n </div>\n <div class=\"product-item\">\n <img src=\"${p.Slika}\" alt=\"${p.Opis}\"/>\n </div>\n <div class=\"item-title text-center\">\n <h3>${p.Naziv}</h3>\n <p>${p.Opis}`\n if(p.Sezona == \"leto\"){\n ispis +=`<span><i class='fas fa-sun text-warning'></i></span>`;\n }else{\n ispis +=`<span><i class=\"fas fa-snowflake text-white\"></i></span>`;\n }\n ispis +=`\n </p>\n </div>\n <div class=\"item-desc text-center\">\n <h4>${p.Sirina}/${p.Visina} R${p.Precnik}</h4>\n <div class='d-flex justify-content-center'>\n <p class='text-success font-weight-bold h4'>${p.Cena} din</p>\n </div>\n <a href='#'><button class='mb-3 dodajUkorpu' data-id=\"${p.ID}\"><i class=\"fas fa-shopping-cart pr-1\"></i>Dodaj u korpu</button></a>\n </div>\n </div>`\n })\n return div.html(ispis);\n \n}", "title": "" }, { "docid": "7086a70daeec77b9057211db320d2ba0", "score": "0.5828556", "text": "function riscattaTerreno(){\n\n //verifico che il terreno esista e salvo il risultato in proprietà\n var n = EsisteTerreno(props.terreni, terreno);\n \n if(n === -1){\n setTestoIpoteche('Controlla che il nome del terreno sia scritto in modo corretto');\n setOpenIpoteche(true); \n return;\n }\n var proprietà = props.terreni[n];\n \n //verifico il terreno sia ipotecato\n if(proprietà.ipotecato === false){\n setTestoIpoteche('Non puoi riscattare un terreno che non è ipotecato');\n setOpenIpoteche(true); \n return;\n }\n //verifico che il turnoGiocatore sia proprietario di proprietà\n if((proprietà.proprietario !== props.turnoGiocatore)){\n setTestoIpoteche('Non puoi Ipotecare una proprietà che non ti appartiene');\n setOpenIpoteche(true); \n return;\n }\n \n //modifico l'array terreni e l'array giocatori\n proprietà.ipotecato = false;\n var nuoviTerreni = props.terreni;\n nuoviTerreni[n] = proprietà;\n props.setTerreni(nuoviTerreni);\n \n var nuoviGiocatori = props.giocatori;\n var spesa = (proprietà.valore/2) +(proprietà.valore/10);\n nuoviGiocatori[props.turnoGiocatore].capitale = nuoviGiocatori[props.turnoGiocatore].capitale - spesa;\n props.setGiocatori(nuoviGiocatori);\n \n setTestoIpoteche(\"L'ipoteca su questa proprietà è stata riscattata con successo. Hai speso:\"+spesa);\n setOpenIpoteche(true); \n }", "title": "" }, { "docid": "251ddfe7f4d64ec3213c1c9455273878", "score": "0.58172065", "text": "function plantilla_nuevo_producto(p) {\n\n /*--------------\n esta funcion se encarga de crear la ventana para el pedido nuevo(p) y luego lo retorna para\n ser insertado en la pantalla\n ----------------*/\n let numero = p.id;\n\n //div pedido nuevo\n let divPedido = document.createElement(\"div\");\n divPedido.className = \"pedidoNuevo\";\n\n // contendor de clase pedido\n let pedido = document.createElement(\"div\");\n pedido.className = \"pedido\";\n divPedido.appendChild(pedido);\n\n //fila 1 de clase parte\n let parte1 = document.createElement(\"div\");\n parte1.className = \"parte\";\n pedido.appendChild(parte1);\n\n //se gregan las dos columanas de la fila 1\n //columa 1\n let colum1 = document.createElement(\"div\");\n colum1.className = \"columna\";\n colum1.style.fontSize = \"medium\";\n parte1.appendChild(colum1);\n //numero del pedido\n let numeroPed = document.createElement(\"p\");\n numeroPed.style.justifyContent = \"center\";\n numeroPed.innerHTML = \"Pedido #\" + numero;\n colum1.appendChild(numeroPed);\n\n //columna 2\n let colum2 = document.createElement(\"div\");\n colum2.className = \"columna\";\n parte1.appendChild(colum2);\n\n /*-------------------\n boton verde aceptar\n aca es el boton donde se genera la opcion de aceptar pedido\n ------------------*/\n let botonVerde = document.createElement(\"button\");\n botonVerde.className = \"botonVerde\";\n botonVerde.innerHTML = \"Aceptar\";\n colum2.appendChild(botonVerde);\n //evento del boton de aceptar\n botonVerde.addEventListener(\"click\", () => {\n // Validar unidades ----> TO DO: Realizar funci'on que valide las cantidades reales \n p.productos.forEach((producto) => {\n if (producto.cantidad > 10) {\n unidadesDisponibles = false;\n }\n });\n if (!unidadesDisponibles) {\n alert('No hay unidades suficientes en el inventario para aceptar el pedido');\n return;\n }\n\n nuevoPedidoCurso(p);\n removeAllChildNodes(divPedido);\n divPedido.remove(divPedido);\n cambiarEstadoPedido(idPedido = p.id, nuevoEstado = \"Aceptado\", razonRechazo = \"\");\n /* generar codigo para la notifiacion */\n });\n\n //fila 2 de clase parte\n let parte2 = document.createElement(\"div\");\n parte2.className = \"parte\";\n pedido.append(parte2);\n\n //columna 1 fila 2\n let colum12 = document.createElement(\"div\");\n colum12.className = \"columna\";\n parte2.appendChild(colum12);\n\n /*--------------------\n boton azul ver detalles\n eboton para observar los detalles de los productos que obtine el pedido\n */\n let botonAzul = document.createElement(\"button\");\n botonAzul.className = \"botonAzul\";\n botonAzul.innerHTML = \"Ver detalles\";\n colum12.appendChild(botonAzul);\n botonAzul.addEventListener(\"click\", () => {\n if (botonAzul.innerHTML == \"Ver detalles\") {\n verDetalles(pedido, numero);\n botonAzul.innerHTML = \"Menos detalles\";\n botonAzul.style = \"font-size:small;\";\n setTimeout(() => {\n let l = pedido.lastChild;\n l.className = \"detalles activo\";\n }, 200)\n }\n else {\n let det = pedido.lastChild;\n removeAllChildNodes(det);\n det.remove(det);\n botonAzul.innerHTML = \"Ver detalles\";\n botonAzul.style = \"font-size:medium;\";\n }\n });\n\n //columna 2\n let colum22 = document.createElement(\"div\");\n colum22.className = \"columna\";\n parte2.appendChild(colum22);\n\n /*------------------\n boton rojo rechazar\n Boton que se encarga de ar la opcion de rezahar el pedido mostrando\n el formulario de razon de rechazo\n -------------------*/\n let botonRojo = document.createElement(\"button\");\n botonRojo.className = \"botonRojo\";\n botonRojo.innerHTML = \"Rechazar\";\n colum22.appendChild(botonRojo);\n botonRojo.addEventListener(\"click\", () => {\n if (botonRojo.innerHTML == \"Rechazar\") {\n //funcion para hacer el formularo de rechazo\n formRechazar(pedido, divPedido, p);\n botonRojo.innerHTML = \"Cancelar\";\n } else {\n botonRojo.innerHTML = \"Rechazar\";\n let det = pedido.lastChild;\n removeAllChildNodes(det);\n det.remove(det);\n }\n\n });\n //fila 3\n let parte3 = document.createElement(\"div\");\n parte3.className = \"parte\";\n pedido.append(parte3);\n let colum31 = document.createElement(\"div\");\n parte3.appendChild(colum31);\n let par = document.createElement(\"p\");\n par.innerHTML = \"Hora de entrega\";\n colum31.appendChild(par);\n\n let colum32 = document.createElement(\"div\");\n parte3.appendChild(colum32);\n let par2 = document.createElement(\"p\");\n let fecha = p.horaEntrega;\n par2.innerHTML = p.horaEntrega;\n colum32.appendChild(par2);\n\n return divPedido;\n\n}", "title": "" }, { "docid": "61f0d0fa9509749ec81d68bd567c815f", "score": "0.58141565", "text": "function proposition(effectif, selection) { // propose des formules\n\tlet id = selection.split(\" .formule\")[0].split(\"#\")[1];\n\teffectif = parseInt(effectif);\n\tlet recap = resume(effectif);\n\tlet taille = recap.length;\n\tlet tmp = 0;\n\tlet formuleCree = new Array();\n\t$(selection).append(\"<span class='media text-muted small'>Choisir une formule <em>(nombre de poules x nombre d'équipes)</em></span><br>\");\n\tfor (let i = /*Math.trunc(taille/2)*/ 0; i < taille; i++) { // effectuer la proposition à partir du milieu du tableau récapitulatif de l'arbre généré\n\t\tlet dico = new Map(); // exemple {'a':7, 'z':3, 'o':5} comme un dictionnaire en python...\n\t\t\n\t\tfor(x of recap[i]) { // recap[i] stock les données d'un certains niveau\n\t\t\t/*si une valeur du tableau actuellement lu (noeud à un niveau de l'arbre) est présente dans le dictionnaire, \n\t\t\ton l'incrémente ;\n\t\t\tsinon on l'initialise à 1.*/\n\t\t\tdico.set(x, (dico.has(x) ? dico.get(x)+1 : 1)); /*equipe, poule*/\n\t\t}\n\n\t\tlet val = \"\";\n\t\tlet tailleDico = dico.size;\n\t\tfor (let [key, value] of dico) { // pour le dictionnaire obtenu de taille 1 ou deux, \n\t\t\tif(tailleDico === 1) {\n\t\t\t\tif (value === 1 || value === key) {\n\t\t\t\t\tval = value+\" x \"+key;\n\t\t\t\t\tif (formuleCree.indexOf(val) === -1) {\n\t\t\t\t\t\t$(selection).append(\"<button type='button' id='bouton_\"+id+\"_\"+tmp+\"' onclick='choix($(this))' class='btn btn-warning'>\"+val+\"</button> \");\n\t\t\t\t\t\ttmp++;\n\t\t\t\t\t\tformuleCree.push(val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tval = value+\" x \"+key;\n\t\t\t\t\tif (formuleCree.indexOf(val) === -1) {\n\t\t\t\t\t\t$(selection).append(\"<button type='button' id='bouton_\"+id+\"_\"+tmp+\"' onclick='choix($(this))' class='btn btn-warning'>\"+val+\"</button> \");\n\t\t\t\t\t\ttmp++;\n\t\t\t\t\t\tformuleCree.push(val);\n\t\t\t\t\t}\n\t\t\t\t\tval = key+\" x \"+value;\n\t\t\t\t\tif (formuleCree.indexOf(val) === -1) {\n\t\t\t\t\t\t$(selection).append(\"<button type='button' id='bouton_\"+id+\"_\"+tmp+\"' onclick='choix($(this))' class='btn btn-warning'>\"+val+\"</button> \");\n\t\t\t\t\t\ttmp++;\n\t\t\t\t\t\tformuleCree.push(val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tval += (val!==\"\" ? \" + \" : \"\")+value+\" x \"+key;\n\t\t\t}\n\t\t}\n\t\tif (tailleDico !== 1) {\n\t\t\tif (formuleCree.indexOf(val) === -1) {\n\t\t\t\t$(selection).append(\"<button type='button' id='bouton_\"+id+\"_\"+tmp+\"' onclick='choix($(this))' class='btn btn-warning'>\"+val+\"</button> \");\n\t\t\t\ttmp++;\n\t\t\t\tformuleCree.push(val);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4578818766ccf80cad7d1bdc52496922", "score": "0.5811038", "text": "function calculaVotos() {\r\n // Array para los votos con todos y los votos sin los baneados\r\n var votoCalculado = [];\r\n var votoCalculadoBaneados = [];\r\n\r\n // recorremos los votos\r\n for (var i = 0; i < votos.length; i++) {\r\n // Si nuestro array de votos ya tiene la clave con el nombre de restaurante, sumamos.\r\n // en caso contrario, iniciamos a 1\r\n if (votoCalculado.hasOwnProperty(votos[i].restaurante)) {\r\n votoCalculado[votos[i].restaurante]++;\r\n } else {\r\n votoCalculado[votos[i].restaurante] = 1;\r\n\r\n }\r\n // Si nuestro array de votos ya tiene la clave con el nombre de restaurante, sumamos.\r\n // en caso contrario, iniciamos a 1\r\n if (votoCalculadoBaneados.hasOwnProperty(votos[i].restaurante)) {\r\n // Solo lo contamos si no esta en la lista de baneados\r\n if (baneados.indexOf(votos[i].usuario)==-1) {\r\n votoCalculadoBaneados[votos[i].restaurante]++;\r\n }\r\n } else {\r\n // Solo lo contamos si no esta en la lista de baneados\r\n if (baneados.indexOf(votos[i].usuario)==-1) {\r\n votoCalculadoBaneados[votos[i].restaurante]=1;\r\n }\r\n }\r\n }\r\n // Generamos el HTML con todos los tipos de votos\r\n var miHTML=\"<p style='border: 1px solid red; display:inline-block'>Votos sin baneados</p>\";\r\n for (var k in votoCalculado) {\r\n miHTML+=\"<p>\"+k+\" \"+votoCalculado[k]+\"</p>\";\r\n }\r\n miHTML+=\"<p style='border:1px solid red; display:inline-block'>Votos quitando baneados</p>\";\r\n for (var k in votoCalculadoBaneados) {\r\n miHTML+=\"<p>\"+k+\" \"+votoCalculadoBaneados[k]+\"</p>\";\r\n }\r\n // Establecemos ese HTML en el DIV\r\n $(\"#votosHTML\").html(miHTML);\r\n\r\n}", "title": "" }, { "docid": "9c0f3f4d7c4ef36fe8f6b4af9a0b0779", "score": "0.5809565", "text": "function recorrerFila(){\n t_fila = $(\"#fila-\"+(n_fila+ \" .white\"));\n disponible1 = t_fila.filter(\"[data-columna='\"+ (j_col+1)+\"']\");\n disponible2 = t_fila.filter(\"[data-columna='\"+ (j_col-1)+\"']\");\n //obtener los elementos hijos de las filas\n disponible1_mov = disponible1.children();\n disponible2_mov = disponible2.children();\n\n var siguiente1 = mostrarDisponibles(disponible1 ,disponible1_mov);\n var siguiente2 = mostrarDisponibles(disponible2, disponible2_mov);\n\n if (!siguiente1){\n var salto_fila = $(\"#fila-\"+(sig_fila+ \" .white\"));\n disponible1_salto = salto_fila.filter(\"[data-columna='\"+ (j_col+2)+\"']\");\n disponible1_salto_mov = disponible1_salto.children();\n mostrarDisponibles(disponible1_salto ,disponible1_salto_mov, true);\n }\n if (!siguiente2){\n var salto_fila = $(\"#fila-\"+(sig_fila+ \" .white\"));\n disponible2_salto = salto_fila.filter(\"[data-columna='\"+ (j_col-2)+\"']\");\n disponible2_salto_mov = disponible2_salto.children();\n mostrarDisponibles(disponible2_salto, disponible2_salto_mov, true);\n }\n }", "title": "" }, { "docid": "8f1b17532181e3c2b0f3305ed4764ff0", "score": "0.5807892", "text": "function utilidad(campo1,campo2,campo1fr,campo2fr,totalfr)\n { \n \n var campo_val1= document.getElementById(\"detcapitulo-rpta\" + campo1fr).value;\n var campo_val2= document.getElementById(\"detcapitulo-rpta\" + campo2fr).value;\n if(campo_val1.indexOf(\",\")>0){ \n campo_val1 = campo_val1.replace(new RegExp(',', 'g'), '');}\n if(campo_val2.indexOf(\",\")>0){\n campo_val2 = campo_val2.replace(new RegExp(',', 'g'), '');}\n var resta = parseFloat(campo_val1)-parseFloat(campo_val2);\n var mensaje =''; \n if (isNaN(resta) == false)\n {\n if(resta==0){mensaje='No ha generado pérdida/utilidad';}\n else if(resta>0) { \n mensaje='Está seguro que su utlidad es de $'+resta;}\n else{ \n mensaje='Está seguro que su pérdida es de $'+resta;} \n Confirmacion(mensaje,resta,totalfr,campo1fr,campo2fr); \n } \n }", "title": "" }, { "docid": "dfba7b4ca742b8686045b53b030a3b04", "score": "0.58034337", "text": "function actualizarCarrito() {\n contadorCarrito.innerText = carritoDeCompras.reduce(function (acc, el) {\n return acc + el.cantidad;\n }, 0);\n precioTotal.innerText = carritoDeCompras.reduce(function (acc, el) {\n return acc + el.precio * el.cantidad;\n }, 0);\n} // //______________________ FILRO productos.html/header___________________-", "title": "" }, { "docid": "7de09d006d93accc91c657384a60fae0", "score": "0.5802614", "text": "function cambiarCantidad(id, op, opDos, opTres) {\n let existeProducto = carrito.find((element) => element.id === id);\n if (existeProducto) {\n carrito = carrito.map((element) => {\n if (element.id === id) {\n element.cantidad = op(element.cantidad, 1);\n element.precio = opDos(\n element.precioUnidad,\n element.cantidad,\n element.precio\n );\n element.precio = opTres(element.precio, element.precioUnidad);\n return element;\n }\n return element;\n });\n } else {\n let nuevoProducto = productos.find((element) => element.id === id);\n nuevoProducto.cantidad = 1;\n nuevoProducto.precio = nuevoProducto.precioUnidad;\n carrito.push(nuevoProducto);\n }\n carrito = carrito.filter((element) => element.cantidad > 0);\n localStorage.setItem(\"carrito\", JSON.stringify(carrito));\n carritoHTML.text(\" \");\n }", "title": "" }, { "docid": "b08eae9fe3106475cf3bb8c0fdfc8732", "score": "0.5795536", "text": "async function medirEnVivo(){\n let historialesRecolectados = await obtenerHistorialesAtleta(mainApp.datosDePerfilEnSesion.username);\n //buscamos la medición mas reciente o en vivo(la última)\n let medicionActual = historialesRecolectados[historialesRecolectados.length-1];\n let pruebasRecolectadas = await obtenerPruebasNaveteeAtleta(mainApp.datosDePerfilEnSesion.username);\n let medicionNaveteeActual = pruebasRecolectadas[pruebasRecolectadas.length-1];\n let repeticionActual = medicionNaveteeActual.repeticiones[medicionNaveteeActual.repeticiones.length-1]\n /*Puede ser cualquier medicion ya que siempre se envia la misma cantidad para las 3, \n se escogio´temperatura ya que su sensor es más estable:*/\n try{\n //Ritmo Cardiaco\n let ritmoMax = 160;\n mainApp.indicadoresDeSaludVariables.pulsoActual = medicionActual.pulso[medicionActual.pulso.length-1];\n if(mainApp.indicadoresDeSaludVariables.pulsoActual > ritmoMax){\n notificarAumentoCardiaco();\n }\n mainApp.indicadoresDeSaludVariables.pulsoPromedio = medicionActual.pulsoPromedio;\n dataRitmoGrafico.push(medicionActual.pulso[medicionActual.pulso.length-1]);\n labelsRitmoGrafico.push(medicionActual.pulso[medicionActual.pulso.length-1]);\n graficoRitmoCardiaco.update();\n //Temperatura\n mainApp.indicadoresDeSaludVariables.temperaturaActual = medicionActual.temperatura[medicionActual.temperatura.length-1];\n mainApp.indicadoresDeSaludVariables.temperaturaMaxima = medicionActual.tempMaxima;\n mainApp.indicadoresDeSaludVariables.temperaturaMinima = medicionActual.tempMinima;\n mainApp.indicadoresDeSaludVariables.temperaturaPromedio = medicionActual.tempPromedio;\n dataTemperaturaGrafico.push(medicionActual.temperatura[medicionActual.temperatura.length-1]);\n labelsTemperaturaGrafico.push(medicionActual.temperatura[medicionActual.temperatura.length-1]);\n graficoTemperatura.update();\n //Oxigeno\n mainApp.indicadoresDeSaludVariables.oxigenoActual = medicionActual.oxigeno[medicionActual.oxigeno.length-1];\n mainApp.indicadoresDeSaludVariables.oxigenoPromedio = medicionActual.oxigenoPromedio;\n dataOxigenoGrafico.push(medicionActual.oxigeno[medicionActual.oxigeno.length-1]);\n labelsOxigenoGrafico.push(medicionActual.oxigeno[medicionActual.oxigeno.length-1]);\n graficoOxigeno.update();\n //Velocidad\n mainApp.indicadoresDeSaludVariables.velocidadActual = repeticionActual.velocidad[repeticionActual.velocidad.length-1];\n mainApp.indicadoresDeSaludVariables.velocidadMaxima = repeticionActual.velMax;\n mainApp.indicadoresDeSaludVariables.velocidadMinima = repeticionActual.velMin;\n mainApp.indicadoresDeSaludVariables.velocidadPromedio = repeticionActual.velPromedio;\n componentesNaveteeLive.dataVelocidadGrafico.push(mainApp.indicadoresDeSaludVariables.velocidadActual);\n componentesNaveteeLive.labelsVelocidadGrafico.push(mainApp.indicadoresDeSaludVariables.velocidadActual);\n componentesNaveteeLive.graficoVelocidad.update();\n //Distancia\n mainApp.indicadoresDeSaludVariables.distanciaActual = repeticionActual.distanciaR;\n mainApp.indicadoresDeSaludVariables.distanciaTotal = medicionNaveteeActual.distancia;\n componentesNaveteeLive.dataDistanciaGrafico.push(mainApp.indicadoresDeSaludVariables.distanciaActual);\n componentesNaveteeLive.labelsDistanciaGrafico.push(mainApp.indicadoresDeSaludVariables.distanciaActual);\n componentesNaveteeLive.graficoDistancia.update();\n }catch(exception){\n console.log(\"hubo un fallo al obtener los datos\");\n }\n}", "title": "" }, { "docid": "85531a9ee7b820b03fb583c662f7ba43", "score": "0.57944983", "text": "function costoByTotalContratista(target) {\r\n var str = target.id;\r\n var strId = \"SubItemPresupuesto_\";\r\n var identificador = str.split(strId, 2);\r\n var indice = identificador[1].charAt(0);\r\n //si es actualizar \r\n if (indice == 'u') {\r\n var strId = \"SubItemPresupuesto_u___\";\r\n var identificador = str.split(strId, 2);\r\n identificador = identificador[1].split(\"_TOTAL_CONTRATISTA\", 2);\r\n var total_contratista = parseInt(target.value);\r\n var total_materiales = parseInt(document.getElementById('SubItemPresupuesto_u___' + identificador[0] + '_TOTAL_MATERIALES').value);\r\n var costo_unitario_astillero = parseInt(document.getElementById('SubItemPresupuesto_u___' + identificador[0] + '_ASTILLERO_GG').value);\r\n var cantidad = parseInt(document.getElementById('SubItemPresupuesto_u___' + identificador[0] + '_CANTIDAD').value);\r\n if (isNaN(total_contratista))\r\n total_contratista = 0;\r\n if (isNaN(total_materiales))\r\n total_materiales = 0;\r\n if (isNaN(costo_unitario_astillero))\r\n costo_unitario_astillero = 0;\r\n if (isNaN(cantidad))\r\n cantidad = 1;\r\n var total = (total_contratista + total_materiales + (costo_unitario_astillero * cantidad));\r\n total = total.toFixed()\r\n document.getElementById('SubItemPresupuesto_u___' + identificador[0] + '_COSTO_TOTAL').value = total + \"\";\r\n //this.costoAstilleroUpdate(identificador[0]);\r\n } //si es crear\r\n\r\n else {\r\n var strId = \"SubItemPresupuesto_TOTAL_CONTRATISTA\";\r\n var identificador = str.split(strId, 2);\r\n if (identificador[1] > 1) {\r\n var total_contratista = parseInt(target.value);\r\n var total_materiales = parseInt(document.getElementById('SubItemPresupuesto_TOTAL_MATERIALES' + identificador[1]).value);\r\n var costo_unitario_astillero = parseInt(document.getElementById('SubItemPresupuesto_ASTILLERO_GG' + identificador[1]).value);\r\n var cantidad = parseInt(document.getElementById('SubItemPresupuesto_CANTIDAD' + identificador[1]).value);\r\n if (isNaN(total_contratista))\r\n total_contratista = 0;\r\n if (isNaN(total_materiales))\r\n total_materiales = 0;\r\n if (isNaN(costo_unitario_astillero))\r\n costo_unitario_astillero = 0;\r\n if (isNaN(cantidad))\r\n cantidad = 1;\r\n var total = (total_contratista + total_materiales + (costo_unitario_astillero * cantidad));\r\n total = total.toFixed()\r\n document.getElementById('SubItemPresupuesto_COSTO_TOTAL' + identificador[1]).value = total + \"\";\r\n //this.costoAstillero(identificador[1]);\r\n } else\r\n {\r\n var total_contratista = parseInt(target.value);\r\n var total_materiales = parseInt(document.getElementById('SubItemPresupuesto_TOTAL_MATERIALES').value);\r\n var costo_unitario_astillero = parseInt(document.getElementById('SubItemPresupuesto_ASTILLERO_GG').value);\r\n var cantidad = parseInt(document.getElementById('SubItemPresupuesto_CANTIDAD').value);\r\n if (isNaN(total_contratista))\r\n total_contratista = 0;\r\n if (isNaN(total_materiales))\r\n total_materiales = 0;\r\n if (isNaN(costo_unitario_astillero))\r\n costo_unitario_astillero = 0;\r\n if (isNaN(cantidad))\r\n cantidad = 1;\r\n var total = (total_contratista + total_materiales + (costo_unitario_astillero * cantidad));\r\n total = total.toFixed()\r\n document.getElementById('SubItemPresupuesto_COSTO_TOTAL').value = total + \"\";\r\n // this.costoAstillero(identificador[1]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d7c13f305521bfcb1a6f378d5174d576", "score": "0.5794356", "text": "function carga() {\n TrabajadoresCompleto();\n Cuerpos();\n fechaActual();\n}", "title": "" }, { "docid": "a3dffcda827af8120056310ce43786eb", "score": "0.57888806", "text": "function eliminarhorver(){\n\tmatriz=0;\n\tbusquedaHorizontal=horizontal();\n\tbusquedaVertical=vertical();\n\tfor(var j=1;j<8;j++){\n\t\tmatriz=matriz+$(\".col-\"+j).children().length;}\n\t//Condicional si no encuentra 3 dulces o más, llamamos a la función para volver a completar el juego\n\tif(busquedaHorizontal==0 && busquedaVertical==0 && matriz!=49){\n\t\tclearInterval(eliminar);\n\t\tbuscarNuevosDulces=0;\n\t\tnuevosDulces=setInterval(function(){\n\t\t\tnuevosdulces()\n\t\t},80);}\n\n\tif(busquedaHorizontal==1||busquedaVertical==1){\n\t\t$(\".elemento\").draggable({disabled:true});\n\t\t$(\"div[class^='col']\").css(\"justify-content\",\"flex-end\");\n\t\t$(\".activo\").hide(\"pulsate\",600,function(){\n\t\t\tvar scoretmp=$(\".activo\").length;\n\t\t\t$(\".activo\").remove(\"img\");\n\t\t\tscore=score+scoretmp*15;\n\t\t\t$(\"#score-text\").html(score); //Cambiamos la puntuación\n\t\t});\n\t}\n\tif(busquedaHorizontal==0 && busquedaVertical==0 && matriz==49){\n\t\t$(\".elemento\").draggable({\n\t\t\tdisabled:false,\n\t\t\tcontainment:\".panel-tablero\",\n\t\t\trevert:true,\n\t\t\trevertDuration:0,\n\t\t\tsnap:\".elemento\",\n\t\t\tsnapMode:\"inner\",\n\t\t\tsnapTolerance:40,\n\t\t\tstart:function(event,ui){\n movTotal = movTotal + 1\n\t\t\t\t$(\"#movimientos-text\").html(movTotal);}\n\t\t});\n\t}\n\n\t$(\".elemento\").droppable({\n\t\tdrop:function (event,ui){\n\t\t\tvar dropped=ui.draggable;\n\t\t\tvar droppedOn=this;\n\t\t\tespera=0;\n\t\t\tdo{\n\t\t\t\tespera=dropped.swap($(droppedOn));}\n\t\t\twhile(espera==0);\n\t\t\tbusquedaHorizontal=horizontal();\n\t\t\tbusquedaVertical=vertical();\n\t\t\tif(busquedaHorizontal==0 && busquedaVertical==0){\n\t\t\t\tdropped.swap($(droppedOn));}\n\t\t\tif(busquedaHorizontal==1 || busquedaVertical==1){\n\t\t\t\tclearInterval(nuevosDulces);\n\t\t\t\tclearInterval(eliminar);\n\t\t\t\teliminar=setInterval(function(){\n\t\t\t\t\teliminarhorver()\n\t\t\t\t},100);}},\n\t});\n}", "title": "" }, { "docid": "37742c91ee45a81c80b7e9ff23e99b85", "score": "0.57874894", "text": "function GraficosVentas(){\n document.getElementById(\"containerBienvenida\").innerHTML = '';\n document.getElementById(\"containerBienvenida\").innerHTML += \n `<h1 class=\"display-3\">Bienvenido a ${empresas[parametro1].Empresa}!</h1>\n <h3>Graficos de Ventas<h3>\n `;\n document.getElementById(\"ProductosContenedor\").innerHTML = '';\n document.getElementById(\"ProductosContenedor\").innerHTML += \n `<div class=\"container\">\n <hr>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <h2>Datos mostrados en Año-Meses</h2>\n <hr>\n <div id=\"misProductos\"></div>\n </div>\n </div>\n </div>\n `;\n \n var pro = empresas[parametro1].Productos;\n var produ = [];\n var keyY = []\n for(let i=0; i<pro.length; i++){\n produ.push(pro[i].NombreProducto);\n keyY.push(pro[i].NombreProducto);\n }\n\n var mesesData = [\n {\"periodo\": \"2020-01\", \"Producto1\": 2, \"Producto2\": 8, \"Producto3\": 7},\n {\"periodo\": \"2020-02\", \"Producto1\": 5, \"Producto2\": 9, \"Producto3\": 8},\n {\"periodo\": \"2020-03\", \"Producto1\": 2, \"Producto2\": 5, \"Producto3\": 4},\n {\"periodo\": \"2020-04\", \"Producto1\": 3, \"Producto2\": 4, \"Producto3\": 3},\n {\"periodo\": \"2020-05\", \"Producto1\": 1, \"Producto2\": 2, \"Producto3\": 1},\n {\"periodo\": \"2020-06\", \"Producto1\": 0, \"Producto2\": 3, \"Producto3\": 2},\n {\"periodo\": \"2020-07\", \"Producto1\": 5, \"Producto2\": 1, \"Producto3\": 0},\n {\"periodo\": \"2020-08\", \"Producto1\": 4, \"Producto2\": 5, \"Producto3\": 4},\n {\"periodo\": \"2020-09\", \"Producto1\": 2, \"Producto2\": 4, \"Producto3\": 3},\n {\"periodo\": \"2020-10\", \"Producto1\": 3, \"Producto2\": 6, \"Producto3\": 7},\n {\"periodo\": \"2020-11\", \"Producto1\": 5, \"Producto2\": 7, \"Producto3\": 6},\n {\"periodo\": \"2020-12\", \"Producto1\": 8, \"Producto2\": 3, \"Producto3\": 2}\n ];\n\n var mesesData2 = [\n {\"periodo\": \"2020-01\"},\n {\"periodo\": \"2020-02\"},\n {\"periodo\": \"2020-03\"},\n {\"periodo\": \"2020-04\"},\n {\"periodo\": \"2020-05\"},\n {\"periodo\": \"2020-06\"},\n {\"periodo\": \"2020-07\"},\n {\"periodo\": \"2020-08\"},\n {\"periodo\": \"2020-09\"},\n {\"periodo\": \"2020-10\"},\n {\"periodo\": \"2020-11\"},\n {\"periodo\": \"2020-12\"}\n ];\n \n \n for(let i=0;i<12;i++){\n for(let j=0;j<pro.length;j++){\n let historialProductos = proCompra.filter(item=>{\n return item.codigoProducto == empresas[parametro1].Productos[j].codigoProducto && item.fecha == mesesData2[i].periodo && item.codigoEmpresa == empresas[parametro1].Productos[j].codigoEmpresa;\n });\n for(let k=0;k<historialProductos.length;k++){\n const histo = historialProductos[k];\n if(mesesData2[i].periodo == histo.fecha){\n var variable1 = pro[j].NombreProducto;\n var variable2 = historialProductos.length;\n mesesData2[i][variable1] = variable2;\n }\n }\n }\n }\n console.log(mesesData2);\n \n Morris.Line({\n element: 'misProductos',\n data: mesesData2,\n xkey: 'periodo',\n ykeys: keyY,\n labels: produ,\n smooth: false\n });\n}", "title": "" }, { "docid": "e23899cc017a9d2bf47f6c8c9b175942", "score": "0.5786799", "text": "function avanca(){\n\tlet slide = document.querySelector(\"#cont-slide\");\n\tlet cont = parseInt(slide.getAttribute(\"cont\"));\n\tlet last = parseInt(document.querySelectorAll(\".cont-item\").length);\n\n\tif(cont >= 0 && cont < (last -1)){\n\t\tcont += 1;\n\t\tvar move = cont * xDesktop;\n\t\tslide.setAttribute(\"cont\",cont);\n\t\tslide.style.left = move+'px';\n\n\t\t\n\t\t/* peega aa soma dos 3 itens da largurraa e define\n\t\t comoo a largura da janela-desktop */\n\t\tlet len = document.querySelectorAll('.cont-item').length;\n\t\tlet width_itens3_total = 0;\n\t\tfor (var i = (2*cont); i < len; i++) {\n\t\t\twidth_itens3_total += document.querySelectorAll('.cont-item')[i].clientWidth; \n\t\t}\n\t\tdocument.querySelector(\".janela-desktop\").style.width = (width_itens3_total)+\"px\";\n\t\t\n\t\t/* fim */\n\t\t\n\t}\n\n\t\n\tbts(cont);\n}", "title": "" }, { "docid": "aea0067eb484c68b9e2d431f6e14cbb3", "score": "0.57791704", "text": "async function deletarProdutoCarrinho (req, res) {\n const {produtos, carrinho} = await lerArquivo();\n const idSolicitado = Number(req.params.idProduto);\n\n const idSolicitadoCarrinho = carrinho.produtos.find(x => x.id === idSolicitado);\n const idSolicitadoProdutos = produtos.find(x => x.id === idSolicitado);\n\n if(idSolicitadoCarrinho){ // se o item a ser deletado consta no carrinho, deletamos e retornamos a quantidade para o estoque\n \n const indiceProdutoCarrinho = carrinho.produtos.indexOf(idSolicitadoCarrinho);\n \n carrinho.produtos.splice(indiceProdutoCarrinho, 1);\n idSolicitadoProdutos.estoque += idSolicitadoCarrinho.quantidade;\n \n atualizarCarrinho(carrinho)\n \n await escreverNoArquivo( { produtos, carrinho })\n res.json(carrinho)\n\n } else { // se o item a ser deletado NÃO consta no carrinho\n res.status(404)\n res.json({\"mensagem\":\"Este item não se encontra no carrinho!\"});\n return\n }\n}", "title": "" }, { "docid": "cb86d8b36179a318bfff0de4be67a856", "score": "0.5771698", "text": "function procesar_datos(filas, variable) {\n\n var contenedorFiltros = document.querySelector('.filtros'),\n selectorCategoria= contenedorFiltros.querySelector('#presponsable'),\n campoFechaini = contenedorFiltros.querySelector('#fechaini'),\n campoFechafin = contenedorFiltros.querySelector('#fechafin')\n ;\n\n var dicEtiquetas = {}\n filas.forEach(function(r) {\n dicEtiquetas[r[variable]] = 0\n if (typeof datosr[r.fecha] == 'undefined') {\n datosr[r.fecha] = {}\n if (typeof datosrFechamin == 'undefined' || r.fecha < datosrFechamin) {\n datosrFechamin = r.fecha\n }\n if (typeof datosrFechamax == 'undefined' || r.fecha > datosrFechamax) {\n datosrFechamax = r.fecha\n }\n }\n if (typeof datosr[r.fecha][r[variable]] == 'undefined') {\n datosr[r.fecha][r[variable]] = +r.cuenta\n } else {\n datosr[r.fecha][r[variable]] += +r.cuenta\n }\n })\n\n datosrEtiquetas = Object.keys(dicEtiquetas)\n\n seleccionmAsignarOpciones(selectorCategoria, datosrEtiquetas, true);\n var fechaminLoc = msip_retorna_fecha_localizada(datosrFechamin, 'yyyy-mm-dd')\n\n campoFechaini.value = msip_retorna_fecha_localizada(datosrFechamin, 'yyyy-mm-dd')\n\n campoFechafin.value = msip_retorna_fecha_localizada(datosrFechamax, 'yyyy-mm-dd')\n\n\n /*var colores = {\n 'F': 'rgb(219, 64, 82)',\n 'M': 'rgb(64, 219, 82)',\n 'S': 'rgb(64, 82, 219)'\n } */\n\n function actualizarGraficaFechas() {\n var opelegidas = seleccionmOpcionesElegidas(selectorCategoria)\n var fechaini = msip_partes_fecha_localizada(campoFechaini.value, \"dd/M/yyyy\").join('-')\n var fechafin = msip_partes_fecha_localizada(campoFechafin.value, \"dd/M/yyyy\").join('-')\n recalcularSeriesPresentadas(fechaini, fechafin, opelegidas);\n }\n\n\n function actualizarGraficaEtiquetas(){\n var opelegidas = seleccionmOpcionesElegidas(selectorCategoria)\n actualizarTrazosPresentados(opelegidas);\n }\n\n\n actualizarGraficaFechas()\n\n\n $(selectorCategoria).chosen().change(actualizarGraficaEtiquetas)\n $(campoFechaini).datepicker({ \n format: window.formato_fecha, \n autoclose: true, \n todayHighlight: true, \n language: 'es' \n }).on('changeDate', (ev) => actualizarGraficaFechas())\n $(campoFechafin).datepicker({ \n format: window.formato_fecha, \n autoclose: true, \n todayHighlight: true, \n language: 'es' \n }).on('changeDate', (ev) => actualizarGraficaFechas())\n\n\n}", "title": "" }, { "docid": "40659cbe741a9f872c0c84f2246fc93f", "score": "0.5766607", "text": "function potvrda() {\n //Prvi dio metode porvjerava da li su zadovoljeni uslovi za nastavak izvrsavanja\n //Potrebno je da igra vec nije rijesena (rejeseno==false)\n //Potrebno je da je svaki elemenat niza popunjenost jednak true\n if (rijeseno) {\n return;\n }\n var provjeraDozvoljena = true;\n for (var k = 0; k < 4; k++) {\n if (popunjenost[k] == false)\n provjeraDozvoljena = false;\n }\n if (provjeraDozvoljena == false) {\n return;\n }\n\n var podudaranja = prebrojavanje();\n var indikatori = redovi[aktivniRed].children[1].children;\n for (var i = 0; i < podudaranja[0]; i++) {\n indikatori[i].style.backgroundColor = \"red\";\n }\n for (var j = podudaranja[0]; j < podudaranja[0] + podudaranja[1]; j++) {\n indikatori[j].style.backgroundColor = \"yellow\";\n }\n aktivniRed++;\n if (podudaranja[0] == 4) {\n rijeseno = true;\n // alert(\"Cestitamo! Pronasli ste kombinaciju\");\n }else if(aktivniRed > 5){\n prikaziRjesenje();\n }\n popunjenost = [false, false, false, false]\n}", "title": "" }, { "docid": "9ab76198d76d200639f46635813bc4f1", "score": "0.57646066", "text": "function limpiar_tier(){\n\n if(confirm(\"'¿Seguro desea eliminar todos las Lingas de este TIER?\")){\n var tier=$(tier_pinchado).data(\"tier\");\n var bod=bodega;\n var tier_linga;\n var tam=Linga.length;\n for(i=0;i<tam;i++){\n tier_linga=(Linga[i].tier).split(\"-\");\n if(tier==tier_linga[2] && bod==tier_linga[1] ){ // BUSCA TODAS LAS LINGAS DEL TIER SELECCIONADO\n\n eliminar_linga_bd(Linga[i].id_linga); // ELIMINAR LINGA DE LA BASE DE DATOS\n var linga_Del= document.getElementById(Linga[i].id);\n linga_Del.parentNode.removeChild(linga_Del); // ELIMINAR DIV DEL LIENZO\n Linga.splice(i,1); // ELIMINAR LINGA DEL ARRAY GLOBAL\n i=i-1;\n }\n }\n }\n}", "title": "" }, { "docid": "6609fe83331b54dd5a8d5bb402f1e979", "score": "0.5762161", "text": "function mejorPromAsignatura(asignaturaDeseada) {\n let estudianteMejorProm = {\n nombre: '',\n grado: '',\n curso: '',\n promedio: 0\n };\n\n let sumaNotas = 0;\n let conteoNotas = 0;\n \n for (let nivel in datosColegio1) {\n let grados = datosColegio1[nivel][0];\n for (let grado in grados) {\n let cursos = grados[grado];\n for (let curso in cursos) {\n let estudiantes = cursos[curso].estudiantes;\n for (let estudiante in estudiantes) {\n let asignaturas = estudiantes[estudiante].asignaturas;\n for (let asignatura in asignaturas) {\n let cortes = asignaturas[asignatura];\n for (let corte in cortes) {\n if (corte === asignaturaDeseada) {\n let notas = cortes[corte];\n for (let nota in notas) {\n sumaNotas += notas[nota];\n conteoNotas += 1;\n }\n let promedio = sumaNotas / conteoNotas;\n if (promedio > estudianteMejorProm.promedio) {\n estudianteMejorProm.nombre = estudiantes[estudiante].nombre;\n estudianteMejorProm.grado = grado;\n estudianteMejorProm.curso = cursos[curso].curso;\n estudianteMejorProm.promedio = promedio;\n }\n sumaNotas = 0;\n conteoNotas = 0;\n }\n }\n }\n }\n }\n }\n }\n console.log(`El estudiante con mejor promedio en ${asignaturaDeseada} es: ${estudianteMejorProm.nombre}, grado: ${estudianteMejorProm.grado}, curso: ${estudianteMejorProm.curso}, con un promedio de ${estudianteMejorProm.promedio}`);\n}", "title": "" }, { "docid": "97e35a9170d91b461025ef60cc862528", "score": "0.57574034", "text": "function hacerclick(ev){\n if (partida.contador<1){\n voltea(ev.target.id);\n partida.volteada=ev.target.id;\n // No permito que se le vuelva a hacer click\n document.getElementById(ev.target.id).removeEventListener(\"click\",hacerclick,false);\n // Si ya estan las 2 cartas, compruebo el resultado\n } else if(partida.contador<2){\n let idCarta=ev.target.id;\n voltea(idCarta);\n if(partida.compruebaPareja()){\n // Si es correcto, pongo borde y reseteo contadores\n acierto(idCarta,partida.volteada)\n } else {\n // Si no son iguales espero 3 segundos y ejecuto error cartas\n setTimeout(\"errorCartas(partida.volteada,\"+idCarta+\");\",3000);\n }\n } \n}", "title": "" }, { "docid": "219921d2048513bd7aad428781d0d218", "score": "0.5756787", "text": "function arregloComponentes() {\n\n var arregloComponentes = new Array();\n var posicion = 0;\n\n //Propiedades\n this.obtenerPosicion = function () {\n return posicion;\n }\n\n //Métodos\n this.agregarComponente = function (nom, mar, model,ser, pre) {\n var componente = new Componente();\n componente.Nombre = nom;\n componente.Marca = mar;\n componente.Modelo = model;\n componente.Serie = ser;\n componente.Precio = pre;\n\n arregloComponentes[posicion] = componente;\n\n posicion++;\n }\n\n this.obtenerMasCaro = function () {\n var caro = -1;\n var cadena = '';\n\n if (arregloComponentes.length === 0)\n return '-';\n\n arregloComponentes.forEach(componente => {\n if (Number(componente.Precio) > caro) {\n caro = componente.Precio;\n cadena = componente.MuestraDatos(); \n }\n });\n return cadena;\n }\n \n function precioMayor() {\n var mayor = -1;\n\n arregloComponentes.forEach(componente => {\n if (Number(componente.Precio) > mayor)\n mayor = componente.Precio;\n });\n \n return mayor\n }\n\n this.obtenerMasBarato = function () {\n var barato = precioMayor() + 1;\n var cadena = '';\n\n if (arregloComponentes.length === 0)\n return '-';\n\n arregloComponentes.forEach(componente => {\n if (Number(componente.Precio) < barato) {\n barato = componente.Precio;\n cadena = componente.MuestraDatos();\n }\n });\n return cadena;\n }\n\n this.obtenerSumaTotal = function () {\n var suma = 0;\n arregloComponentes.forEach(componente => {\n suma += Number(componente.Precio);\n });\n return suma;\n }\n\n function obtenerCadenaHTML(componente, posicion) {\n return `\n <div class=\"card mb-3\">\n <div class=\"card-header\">\n <strong> ${componente.Nombre} </strong>\n <input id=${posicion} name=\"eliminar\" type=\"button\" value=\"Eliminar\" class=\"btn btn-danger float-right\">\n\n </div>\n <div class=\"card-body\">\n Marca: ${componente.Marca}\n <br>\n Modelo: ${componente.Modelo}\n <br>\n No. de serie: ${componente.Serie}\n <br>\n Precio: $ ${componente.Precio}\n <br>\n </div>\n </div>\n `;\n }\n\n this.obtenerTodos = function () {\n\n var cadena = '';\n\n if (arregloComponentes.length > 0)\n arregloComponentes.forEach(function (componente, index) {\n cadena = cadena + obtenerCadenaHTML(componente, index);\n });\n else\n cadena = '<h5>No hay componentes registrados.</h5>';\n\n return cadena;\n }\n\n function obtenerValorComponente(tipo, componente) {\n\n var valor = '';\n\n switch (tipo) {\n case 'nombre':\n valor = componente.Nombre;\n break;\n case 'marca':\n valor = componente.Marca;\n break;\n case 'serie':\n valor = componente.Serie;\n break;\n case 'precio':\n valor = componente.Precio;\n break;\n default:\n break;\n }\n\n return valor;\n }\n\n this.obtenerPorFiltro = function (tipo, valorFiltro) {\n var coincidencias = 0;\n var cadena = '';\n\n arregloComponentes.forEach(function (componente, index) {\n if (obtenerValorComponente(tipo, componente).toLowerCase() === valorFiltro.toLowerCase()) {\n cadena = cadena + obtenerCadenaHTML(componente, index);\n coincidencias++;\n }\n });\n\n if (coincidencias === 0)\n cadena = '<h5>No se encontraron coincidencias</h5>';\n\n return cadena;\n }\n\n this.eliminarObjeto = function (pos) {\n var nuevoTam = arregloComponentes.length - 1;\n\n for (var i = pos; i < nuevoTam; i++)\n arregloComponentes[i] = arregloComponentes[Number(i) + Number(1)];\n\n arregloComponentes.length = nuevoTam;\n posicion = arregloComponentes.length;\n }\n\n}", "title": "" }, { "docid": "d2bf2c235a9e577f23cb8ca21eb20b24", "score": "0.5755699", "text": "function mezclarComercialesLista(){\r\n\t\t\t// mezclar con fisher y sattolo\r\n\t\t\t\r\n\t\t\tfor(let i=0; i<comerciales.length; i++){ // controla los comerciales \r\n\t\t\t\tif(comerciales[i].lista.length>=4){\r\n\t\t\t\t\tif(parseInt(comerciales[i].Ntracks)!=0)\r\n\t\t\t\t\t\tmezclar(comerciales[i].lista,i,comerciales[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\talert(\"La lista del comercial posicion \"+i+\" debe poseer 4 o mas audios\");\r\n\t\t\t\t\tcomerciales[i].Ntracks=0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "5cded6075943676686a639fb1c2d4009", "score": "0.5754165", "text": "function plusCompteurLarmes() {\r\n\t\tVCompteurLarmes++;\r\n\t\t$AfficheCompteurLarmes.innerHTML = Math.trunc(VCompteurLarmes);\r\n\t}", "title": "" }, { "docid": "0ba9cf775caecf603ccde677ff8976ab", "score": "0.57536817", "text": "function calcular(){\n\tvar pessoa = new Object();\n\tpessoa=obterDados();\n\tvar imc = calcularIMC(pessoa);\n\tatualizarInterface(imc, obterClassificacao(imc));\n}", "title": "" }, { "docid": "8b383cfefc8ea71bf69586971fe31025", "score": "0.575005", "text": "function comprobacion () {\n\n\tconsole.log('Llamado ------------------------------------------')\n\n\trango = Rango.getRango()\n\n\tvar filtros = {}\n\tfiltros['IdUsuario'] = {}\n\tfiltros['IdUsuario']['$gt'] = rango[0]\n\tfiltros['IdUsuario']['$lt'] = rango[1]\n\n\tconsole.log('Filtros ', filtros)\n\tvar query = inversionesModel.find(filtros).exists('IdCompra').lean()\n\tquery.exec(function(error,docs){\n\n\t\tif (error){throw error}\n\n\t\telse {\n\n\t\t\tif (docs.length > 0){\n\n\t\t\t\tcomprobarEstado(docs)\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f63f076321e8bb16eedfeed5bbf576b5", "score": "0.5746383", "text": "function prikaziRezultat() {\n // na samom pocetku nije imao tacnih odgovora\n let brTacnih = 0;\n\n // prolazimo kroz globalni niz svih pitanja\n // tu poredimo odgovor koji je igrac dao na to pitanja sa tacnim odgovorom pitanja \n pitanja.forEach(function (trenutnoPitanje, pitanjeInd) {\n // selektor koji trazi cekirani input na trenutno pitanje\n const selektor = `input[name=odgovor${pitanjeInd}]:checked`;\n // igrac je odgovorio ono sto je vrijednost cekiranog input-a (radio button-a)\n const odgovoreno = (document.querySelector(selektor) || {}).value;\n\n // ako je ono sto je igrac odgovorio jednako tacnom odgovoru na trenutno pitanje\n // to znaci da je igrac tacno odgovorio i povecavamo ukupan broj tacnih odgovora\n if (odgovoreno === trenutnoPitanje.tacanOdgovor) {\n brTacnih++;\n document.querySelector(`.pitanje${pitanjeInd}`).style.color = \"green\";\n } else {\n document.querySelector(`.pitanje${pitanjeInd}`).style.color = \"red\";\n }\n });\n // na kraju samo popunjavamo div za prikaz rezultata\n\n rezultatDiv.innerHTML = `rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`;\n}", "title": "" }, { "docid": "681e7ae142aaf9434ca4838d2d60ef25", "score": "0.5741208", "text": "filtrarSugerencias(resultados,busqueda) {\n //filtrar con .filter\n //Con indexOf recorremos todo lo que hay en la propiedad calle del objeto y \n //y lo que concuerda con la búsqueda (!== -1), lo filtra y lo retorna con filter.\n //ya que indexOf retona -1 cuando algo no concuerda con la búsqueda.\n const filtro = resultados.filter(filtro => filtro.calle.indexOf(busqueda) !== -1 );\n //console.log(filtro);\n \n //mostrar los pines\n this.mostrarPines(filtro);\n }", "title": "" }, { "docid": "bc4546e4d3175b6df63ffb9695ca8887", "score": "0.57401687", "text": "function calcularRutasConClic () {\n $('#comoIr').change(function () {\n if($('#desde').val() != '' && $('#hasta').val() != '') {\n direccionesModulo.calcularYMostrarRutas()\n }\n })\n\n $('#calcularMuchos').click(function () {\n direccionesModulo.calcularYMostrarRutas();\n })\n\n $('#ocultarRuta').click(function () {\n direccionesModulo.ocultarRutas();\n })\n\n let listasLugares = $('.lugares')\n for (let j = 0; j < listasLugares.length; j++) {\n listasLugares[j].addEventListener('change', function () {\n if(direccionesModulo.rutaActiva() && $('#desde').val() != '' && $('#hasta').val() != '') {\n direccionesModulo.calcularYMostrarRutas()\n }\n })\n }\n\n $('#optimizarRuta').change(function() {\n if($('#desde').val() != '' && $('#hasta').val() != '') {\n direccionesModulo.calcularYMostrarRutas()\n }\n })\n }", "title": "" }, { "docid": "dabafbf8190880d5357e09f28eb057e6", "score": "0.57368857", "text": "function leerDatosCurso(curso) {\n // console.log(curso);\n\n // objeto con los datos que se necesitan\n const infoCurso ={\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id'),\n cantidad:1\n\n }\n //revisa si un elemento ya existe\n const existe= articulosCarrito.some(curso=>curso.id===infoCurso.id); \n // console.log(existe);\n if (existe) {\n //Actualizamos la cantidad\n const cursos= articulosCarrito.map(curso=>{\n if (curso.id===infoCurso.id) {\n curso.cantidad++\n return curso; //retorna el objeto actualizado\n } else {\n return curso;// retorna los objetos que no son duplicados\n }\n });\n articulosCarrito=[...cursos]\n } else {\n //agrega articulos al carrito\n articulosCarrito=[...articulosCarrito,infoCurso];\n }\n \n \n \n console.log(articulosCarrito);\n\n carritoHTML();\n}", "title": "" }, { "docid": "93c5076e334b3e112314c1bf40cd4231", "score": "0.57344985", "text": "function clic(cellule)\n{\n /* if (playpause ==0 ) // A mettre que quand mode pause et car la fonctionne quand quand start marche et on peux pas faire avant le jeu\n {*/\n var idCellule = cellule.id;\n var indexTiret = idCellule.indexOf(\"_\");\n var i = parseInt(idCellule.substring(0, indexTiret));\n var j = parseInt(idCellule.substring(indexTiret+1));\n if (cellule.className==\"mort\")\n {\n cellule.className=\"vivant\" + (Math.round(Math.random()*3)+palette);\n etat1[i][j]=1;\n \n if (typejeu == 1 || typejeu == 2)\n {\n compteurscore = compteurscore - 1;\n prog();\n /*document.getElementById(\"scorejeu\").innerHTML = compteurscore ;*/\n }\n }\n else\n {\n cellule.className=\"mort\";\n etat1[i][j]=0;\n \n // IF Jeu mange scor, compteur ++ \n if (typejeu == 1 || typejeu == 2)\n {\n compteurscore = compteurscore + 2;\n prog();\n console.log(compteurscore);\n /*document.getElementById(\"scorejeu\").innerHTML = compteurscore ;*/\n }\n }\n /* }*/\n}", "title": "" } ]
9ab3afa6e74f2fdf07f54b93dfe74968
define checkAllFields(); all fields are not empty & all format are correct then valid
[ { "docid": "a93ac6c68a2e8f3c73fe8bc25dafeef3", "score": "0.0", "text": "function checkAllFields() { \n validateInput_name();\n\n let inputIsValid_carYear = validateInput_carYear();\n\n //car make\n let inputIsValid_carMake = validateInput_carMake();\n\n //car model\n let inputIsValid_carModel = validateInput_carModel();\n\n //date parking\n let inputIsValid_dateParking = validateInput_dateParking();\n\n // num of days\n let inputIsValid_numOfDays = validateInput_numOfDays();\n\n //credit card \n let inputIsValid_creditCard = validateInput_creditCard();\n\n //cvv\n let inputIsValid_cvv = validateInput_cvv();\n\n //Expiration\n let inputIsValid_exp = validateInput_exp();\n\n\n\n\n if((inputIsValid_carMake) && (inputIsValid_carYear)){\n // above if inputIsValid_name and inputIsValid_carYear both true...\n allFormsAreValid = true;\n console.log ('submitted!')\n // why this does not work? \n\n // show the cost is 5 dollar\n document.querySelector('#total').innerHTML = \"the cost is\" + 5 * document.querySelector('#days').value ; \n \n }\n }", "title": "" } ]
[ { "docid": "4dea082b7229acf96ed779cccbb8c29b", "score": "0.7403847", "text": "validateFields() {\n const { description, amount, date } = Form.getValues() //salvando os valores dos inputs em uma variável\n\n if (description.trim() === \"\" ||\n amount.trim() === \"\" ||\n date.trim() === \"\") //ta verificando se algum campo não ta preenchido, se não tiver vai dar um erro\n {\n\n throw new Error(\"Por favor, preencha todos os campos\")\n }\n }", "title": "" }, { "docid": "ed1e7729afa64af588ef79df0b933e22", "score": "0.71193516", "text": "function checkEmptyFields(fields) {\n\tfields.forEach(field => {\n\t\tcheckField(field);\n\t});\n}", "title": "" }, { "docid": "87527c93e2807616fcac42bc3a9e82e1", "score": "0.701091", "text": "function isFieldValid(data){\n\tlet isValid = true;\n let validationRulesLenghtMoreThan0 = ['name', 'log', 'quantity', 'unit', 'crop', 'variety', 'weight', 'product', 'store', 'price'];\n validationRulesLenghtMoreThan0.forEach((rule) =>{\n if(data[rule] && !data[rule].toString().length){\n \tisValid = isValid && false\n }\n });\n return isValid;\n}", "title": "" }, { "docid": "269dfa364d8afbd1f19160483dca190e", "score": "0.7008705", "text": "function checkAllFields() {\n // all boxes filled in\n if($('#fName').val() && $('#lName').val() && $('#number').val() && \n $('#title').val() && $('#salary').val()) {\n return true;\n }\n else { // any boxes empty\n return false;\n }\n} // end checkAllFields fn", "title": "" }, { "docid": "2afae58ef922754edfa9cff8d454b064", "score": "0.6976526", "text": "function checkFormFields(form, title, allDay, date, start, end, type, description) { \r\n let bool = true;\r\n let emptyFieldsAmount = 0;\r\n let message;\r\n let fieldsToCheck = [ title, date, type, description ];\r\n if (!allDay.checked) { fieldsToCheck.push(start, end); }\r\n fieldsToCheck.forEach(field => {\r\n if(field.value == \"\") {\r\n emptyFieldsAmount ++;\r\n message = \"Please fill in a \" + field.name + \".\";\r\n }\r\n })\r\n if(emptyFieldsAmount > 0) { bool = false; }\r\n if(emptyFieldsAmount > 1) { message = \"Multiple fields need to be filled in.\"; }\r\n updateFormMessage(form, message);\r\n return bool;\r\n }", "title": "" }, { "docid": "a01b6f16fcf9f708aa48e9fbede5b881", "score": "0.6944566", "text": "function validateAll(){\n\tvar firstName = wordCheck('#firstName','#error_firstname');\n\tvar lastName = wordCheck('#lastName','#error_lastname');\n\tvar phoneNumber = numberCheck('#contactNumber','#error_contactnumber');\n\tif (firstName && lastName && phoneNumber)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "a66eae0147ddcefaa5281f8136919b43", "score": "0.6895237", "text": "validate() {\n const fields = ['name', 'gender', 'birthday', 'age', 'city']\n\n fields.forEach(field => {\n const value = this[field]\n\n if (typeof value !== 'string' && typeof value !== 'number' || value.length === 0 || value === null) {\n throw new InvalidField(field)\n }\n })\n\n return true\n }", "title": "" }, { "docid": "0ac457098d8fc0fc4f8c445119f3a3a0", "score": "0.688716", "text": "checkReqFields() {\n // Check the generic name field\n if (this.state.genericName == DEFAULT_GENERIC_NAME) {\n Alert.alert(\"Please enter a value for the generic name.\");\n return (false);\n }\n\n // Check the store name field\n if (this.state.storeName == DEFAULT_STORE_NAME) {\n Alert.alert(\"Please enter a value for the store name.\");\n return (false);\n }\n\n // Check the address field\n if (this.state.address == DEFAULT_ADDRESS) {\n Alert.alert(\"Please enter a value for the address.\");\n return (false);\n }\n\n // Check the department field\n if (this.state.itemDepartment == DEFAULT_ITEM_DEPARTMENT) {\n Alert.alert(\"Please enter a value for the department.\");\n return (false);\n }\n\n // Check the aisle number field\n if (this.state.aisleNum == DEFAULT_AISLE_NUM) {\n Alert.alert(\"Please enter a value for the aisle number.\");\n return (false);\n }\n\n return (true);\n }", "title": "" }, { "docid": "1c03245004bb28097aa9e73dd8b2d103", "score": "0.68259263", "text": "function fieldChecker() {\n let counter = 0;\n allFields.forEach((field) => {\n let fieldName = field.name.charAt(0).toUpperCase() + field.name.slice(1);\n if (field.value.length >= 1) {\n counter++;\n } else {\n field.style.border = \"3px solid #cb69c1\";\n field.placeholder = `${fieldName} is required.`;\n }\n });\n if (counter === 4) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "fc8a2b5a4cc6cf4c54ceb2c6395e7f1e", "score": "0.6799444", "text": "function validateFields() {\n setUserIdErrorMessage('');\n setUserIdErrorType(false);\n setPasswordErrorMessage('');\n setPasswordErrorType(false);\n // setValidUser(null);\n }", "title": "" }, { "docid": "f3d64c0950cc7cb7b14762e58ef5371b", "score": "0.67609686", "text": "function validFields(t) {\n if (!isEmpty('#name')\n & !isEmpty('#login')\n & isEmailValid('#email')\n & isPasswordValid('#password')\n & !isEmpty('#states')) {\n t.submit();\n }\n}", "title": "" }, { "docid": "fe1acbb450a8880d6defb326dc88acd9", "score": "0.67368394", "text": "function validateFields() {\r\n\treturn fields.validateUntil();\r\n}", "title": "" }, { "docid": "ed5a2558b8f28b070e25d1b0b8344fcd", "score": "0.6713425", "text": "function validate_MandatoryFields(){\r\n\r\n}", "title": "" }, { "docid": "c2cdf414c9b957ca93db22f49bd649f2", "score": "0.67091376", "text": "function checkFields(first, last, phone, hState, gen, hob1, hob2, hob3) {\n var firstFormat = new RegExp(/^(?=.{1,50}$)[a-z]+(?:['_.\\s][a-z]+)*$/i);\n var lastFormat = new RegExp(/^[a-z ,.'-]+$/i);\n if (first.match(lastFormat) && last.match(lastFormat) && hState != \"none\" && gen != \"none\" && hob1 != \"none\" && hob2 != \"none\") {\n // if (phone[0] != \"(\" && phone.length == 10) {\n // return true;\n // }\n // else if (phone[0] == \"(\" && phone.length == 13) {\n // return true;\n // }\n // else {\n // window.alert(\"Please input a proper phone number\");\n // return false;\n // }\n if (hob2 == \"Other\" && (hobbyIn2Other.value == null || hobbyIn2Other.value == \"\")) {\n window.alert(\"Incomplete: Please fill in the field for your other hobby\");\n return false;\n }\n if (hob3 == \"Other\" && (hobbyIn3Other.value == null || hobbyIn3Other.value == \"\")) {\n window.alert(\"Incomplete: Please fill in the field for your other hobby\");\n return false;\n }\n return true;\n }\n else {\n window.alert(\"Incomplete: Fill in all fields with proper inputs\");\n return false;\n }\n}", "title": "" }, { "docid": "3ea72388c5ab5a4f45bad20e270ce7d5", "score": "0.66895765", "text": "function Validate_new_task() {\n var name = $('#taskname').val();\n var desc = $('#taskdesc').val();\n var pub = $('#datepublish').val();\n var selecteam = $('#slc_teams option:selected').text();\n var eachperiod = $('#eachperiod').val();\n \n if (check_spaces(name) || check_spaces(desc) || check_spaces(pub) || check_spaces(eachperiod) || check_spaces(selecteam)) {\n alert(\"Fill all fields!!\");\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "08848c7ddb4bcd10df864a87e42b9060", "score": "0.6689384", "text": "function validFields() {\n let marca = document.getElementById(\"updMarca\").value;\n let modelo = document.getElementById(\"updModelo\").value;\n let tipo = document.getElementById(\"updTipo\").value;\n let modelo_impresora = document.getElementById(\"updImpresora\").value;\n let minima = document.getElementById(\"cantMinima\").value;\n let maxima = document.getElementById(\"cantMaxima\").value;\n\n validClass([\n \"#updMarca\",\n \"#updModelo\",\n \"#updTipo\",\n \"#updImpresora\",\n \"#cantMinima\",\n \"#cantMaxima\"\n ]);\n\n if (\n marca != \"\" &&\n modelo != \"\" &&\n tipo != \"\" &&\n modelo_impresora != \"\" &&\n isNaN(parseInt(minima)) === false &&\n isNaN(parseInt(maxima)) === false\n ) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "5c8eb62e8e43f347582e43b1d81b918c", "score": "0.6655007", "text": "function checkMandatoryFields(frm) {\r\n return true;\r\n}", "title": "" }, { "docid": "12cb0ff8080117df25ccc17f193521ed", "score": "0.6645361", "text": "function validateAll () {\n var args = slice.call(arguments);\n var a = args.filter(function (obj) {\n if ( isValidatorObj(obj) && !obj.validate(true) ) {\n return true;\n }\n return false;\n })\n return a.length === 0 ? { fail: false, success: true, fields: args }\n : { fail: true, success: false, fields: args, failedFields: a };\n }", "title": "" }, { "docid": "b43024a079ad1dcf8a324a2a36b0fad6", "score": "0.66342145", "text": "function validatePresenceOfAllOrNoPayerAddressFields(addressFields) {\r\n var resultOfValidation = true;\r\n if(addressFields != null) {\r\n var blankAddressFields = [];\r\n var blankAddressFieldNames = [];\r\n var lengthOfAddressFields = addressFields.length;\r\n for(i = 0; i < lengthOfAddressFields; i++) {\r\n if($(addressFields[i]) != null) {\r\n if($F(addressFields[i]).strip() == '' && $(addressFields[i]).readOnly != true) {\r\n var splits = addressFields[i].split('_');\r\n splits[0] = \"\";\r\n blankAddressFieldNames.push(splits.join(' '));\r\n blankAddressFields.push(addressFields[i]);\r\n }\r\n }\r\n }\r\n var lengthOfBlankAddressFields = blankAddressFields.length;\r\n if(lengthOfBlankAddressFields > 0 && lengthOfBlankAddressFields != lengthOfAddressFields) {\r\n resultOfValidation = false;\r\n alert(\"Please enter the full address or leave all the address fields blank: \" +\r\n blankAddressFieldNames);\r\n $(blankAddressFields.first()).focus();\r\n }\r\n }\r\n return resultOfValidation;\r\n}", "title": "" }, { "docid": "32b37ade33210d9b7657de92a14c7318", "score": "0.66182977", "text": "isDataValid(){\n return this.invalidFields.length == 0;\n }", "title": "" }, { "docid": "09695c5481868d6e45ad3b88bf1f353a", "score": "0.66012603", "text": "function checkFields() {\n var flag = true;\n if (select_input.value != \"1\" && select_input.value != \"2\" && select_input.value != \"3\") {\n flag = false;\n }\n\n if (title_input.value.length < 3 || des_input.value.length < 3 || (lonlat_input.value.length < 7 || lonlat_input.value.indexOf(',') < 0))\n flag = false;\n\n\n return flag;\n}", "title": "" }, { "docid": "83bbbbd7e52bbdf748723042524ee864", "score": "0.65733206", "text": "function validateFields(data) {\n \n //TODO: Actually validate\n let result = [];\n \n for(var key in data) {\n if(data.hasOwnProperty(key)) {\n \n }\n }\n \n return true;\n \n return result;\n}", "title": "" }, { "docid": "4c6cf9401ec25762b058613e359bca45", "score": "0.65582097", "text": "validateInputs(item) {\n const name = item.fullName.toString();\n const email = item.emailAddress.toString();\n const phone = item.phoneNumber.toString();\n\n /* regular expression to test for name, name can only contain letters, numbers\n spaces and period\n */\n const fullNamePattern = /^[a-zA-Z0-9.\\s]{5,30}$/;\n \n /* email address test pattern, email must be in the format <3 to 15 characters, numbers, . or ->@<3 to 10 characters, . or ->.<2 to 5 characters> */\n const emailAddPattern = /^[a-zA-Z0-9.-]{3,15}@[a-zA-Z0-9-]{3,10}.[a-zA-Z]{2,5}$/;\n\n /* phone number test pattern, phone number must be 10 digits only, no more no less*/\n const phoneNumPattern = /^\\d{10}$/;\n\n let errorString = \"\";\n\n /* check if name field is empty or if it meets the criterias for name */\n if (name === \"\") {\n errorString += \"\\t- Name cannot be empty\\n\";\n } else if (fullNamePattern.test(name) === false) {\n errorString +=\n \"\\t- Name can only contain letters, numbers and space and must be 5-20 characters.\\n\";\n }\n\n /* check if email address is empty or is not proper format */\n if (email === \"\") {\n errorString += \"\\t- Email address cannot be empty\\n\";\n } else if (emailAddPattern.test(email) === false) {\n errorString += \"\\t- Please enter a valid email address\\n\";\n }\n\n /* check if phone number is empty or if it is not a string of 10 digits */\n if (phone === \"\") {\n errorString += \"\\t- Phone number cannot be empty\\n\";\n } else if (phoneNumPattern.test(phone) === false) {\n errorString +=\n \"\\t- Phone number can only contain numbers and must have 10 digits\\n\";\n }\n\n if (errorString === \"\") {\n return true;\n }\n\n return errorString;\n }", "title": "" }, { "docid": "2047cfbf471a7be12555173744b1dc83", "score": "0.65210605", "text": "function validateMandatoryFields(){\r\n var allDataFieldsValid = true;\r\n var emptyField = null;\r\n\r\n for (i = 0; i < mandatoryFields.length; i++) {\r\n var field = mandatoryFields[i];\r\n console.log(field.value);\r\n var inputData = field.value;\r\n var dataExists = validateDataExists(inputData);\r\n // console.log(dataExists);\r\n if (!dataExists) {\r\n emptyField = mandatoryFields[i];\r\n allDataFieldsValid = false;\r\n alert(\"Please make sure you have provided information for all required fields.\")\r\n console.log(emptyField);\r\n emptyField.focus();\r\n break;\r\n }\r\n }\r\n // console.log(allDataFieldsValid);\r\n\r\n // return whether all fields contained data\r\n return allDataFieldsValid;\r\n}", "title": "" }, { "docid": "899eefea9b24ce35869c2b24f2f28191", "score": "0.65138996", "text": "function validateFields() {\n const validators = {\n \"#txtEpisode\": hasValidEpisodeNumber,\n \"#txtTitle\": hasNonEmptyString,\n \"#txtCrawl\": hasNonEmptyString\n };\n Object.entries(validators).forEach(([sel, fn]) => {\n const fld = document.querySelector(sel);\n if (fn(fld.value)) {\n fld.parentNode.classList.remove(\"error\");\n } else {\n fld.parentNode.classList.add(\"error\");\n }\n });\n}", "title": "" }, { "docid": "2bfd9aa20ae5b60e793c619bfba56359", "score": "0.6500139", "text": "function validateFields() {\n console.log(\"validateFields called\");\n var allFieldsValid = true;\n\n var requiredList = document.getElementsByClassName(\"required\");\n\n for (field of requiredList) {\n\n if (field.value == \"\") {\n allFieldsValid = false;\n alert(\"Please fill all required fields.\");\n break;\n }\n }\n\n console.log(\"all fields valid:\" + allFieldsValid);\n return allFieldsValid;\n}", "title": "" }, { "docid": "70aeb26f1a23617a0996618e3cb87ec3", "score": "0.64989793", "text": "function checkField(fields) {\n return _.isUndefined(fields) || _.isEmpty(fields)\n}", "title": "" }, { "docid": "8aaab6816d6d4deb06724ffde746a7da", "score": "0.6491351", "text": "function validateFields() {\n return (validateEmailSignup() && checkPassword() && validateNameSignup()) && matchingPasswords();\n}", "title": "" }, { "docid": "8b26f0a335d7faa4fdd9c2d56f49d3c9", "score": "0.6490846", "text": "function validateInput() {\n\n if (userSubmittedDrink.userName != \"\" &&\n userSubmittedDrink.nameOfDrink != \"\" &&\n userSubmittedDrink.numberOfIngredients != 0 &&\n userSubmittedDrink.instructions != \"\" ) {\n\n // All fields have been populated, proceed\n return true;\n\n } else {\n\n // All fields have not been populated, do not proceed\n return false;\n }\n\n }", "title": "" }, { "docid": "c862ccad7ff6357a6b20dfe19b2985f5", "score": "0.64820343", "text": "function checkAllFieldsSupplied(form) {\n \n // Defaulting all fields supplied to true, until proven otherwise below\n var allRequiredFieldsSupplied = true;\n\n console.log(\"About to check this form - \" + $(form).attr(\"id\"));\n\n // Checking all input fields within this form, to ensure that none are left empty.\n // Excluding the submit input from this search, as this cannot take a user defined\n // value.\n $(form).find(\"input\").not(\"[type='submit']\").each(function (index, element) {\n \n // If this input value is empty\n if ($(element).val() == \"\") {\n \n // All required fields is now false\n allRequiredFieldsSupplied = false;\n \n // Adding a warning class to any fields that are empty\n $(element).addClass(\"formWarning\");\n } else {\n \n // This input has a value. Removing the form warnin class (if it exists on the element)\n $(element).removeClass(\"formWarning\");\n }\n });\n\n console.log(\"allRequiredFieldsSupplied = \" + allRequiredFieldsSupplied);\n \n // Returning the boolean value which represents whether or not all form fields contained a value\n return allRequiredFieldsSupplied;\n}", "title": "" }, { "docid": "6f05df3e2221e27020718b643906679b", "score": "0.64682704", "text": "function prospectFieldCheck(){\n\n var err = false;\n var numeric_err = false;\n\n $(':input.required').each(function(){\n if($(this).val()==\"\"){\n $(this).addClass(\"error\");\n err = true;\n } else {\n $(this).removeClass(\"error\");\n }\n });\n \n $(':input.num').each(function(){\n if(isNaN($(this).val())){\n $(this).addClass(\"error\");\n numeric_err = err = true;\n } else {\n $(this).removeClass(\"error\");\n }\n });\n\n if(err){\n alert(\"Error: Required fields found empty\");\n if(numeric_err){\n alert(\"Error: Check highlighted fields for non numeric characters.\");\n }\n return false;\n } else {\n \n html.hidden(\"go\", \"edit_prospect_submit\");\n return true;\n }\n\n\n}", "title": "" }, { "docid": "c71f5645d598c1ea29c6e5d4552131c6", "score": "0.6460097", "text": "function validate(fields, setFields) {\n const errorArray = [];\n const fieldsWithError = {};\n Object.keys(fields).forEach((field) => {\n const currentfield = fields[field];\n const { isError, message } = checkValidation(currentfield.value, currentfield.validations);\n const fieldIndex = errorArray.findIndex(f => f === field);\n if (isError) {\n currentfield[\"hasError\"] = true;\n currentfield[\"validateMessage\"] = message;\n fieldIndex < 0 && errorArray.push(field);\n } else {\n currentfield[\"hasError\"] = false;\n currentfield[\"validateMessage\"] = \"\";\n fieldIndex >= 0 && errorArray.splice(fieldIndex, 1);\n }\n\n fieldsWithError[field] = currentfield;\n });\n\n setFields(fieldsWithError);\n \n return errorArray.length === 0;\n}", "title": "" }, { "docid": "b115657dfc8e4a9083a9ad86a158ef20", "score": "0.6443546", "text": "function validateEntry(){\n debugger\n if(name == \"\" || email == \"\" || subject == \"\"|| message== \"\"|| file== \"\" || date == \"\"){\n alert(\"All fields must be filled\")\n return false;\n }\n else{\n return true ;\n }\n}", "title": "" }, { "docid": "0b6710f049b0e2958eba21520459cab9", "score": "0.64432704", "text": "validateAllFileds(fieldName, value) {\n switch (fieldName) {\n case 'loginId':\n if (value !== undefined && value !== '' && value !== null) {\n if (!value.match(/^[a-zA-Z0-9.!@#$%&_*\\s,^()+=:;'-]+$/)) {\n this.setState({ loginId: undefined, errorLoginId: 'Please enter valid Username' });\n }\n else {\n this.setState({ errorLoginId: '' });\n }\n }\n else {\n this.setState({ loginId: '', errorLoginId: 'Required' });\n }\n break;\n case 'loginPwd':\n if (value !== undefined && value !== '' && value !== null) {\n if (!value.match(/^[a-zA-Z0-9.!@#$%&_*\\s,^()+=:;'-]+$/)) {\n this.setState({ loginPwd: undefined, errorLoginPwd: 'Password should be alphanumeric and Special Character' });\n }\n else {\n this.setState({ errorLoginPwd: '' })\n }\n }\n else {\n this.setState({ loginPwd: '', errorLoginPwd: 'Required' });\n }\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "19735aae93d6db0a8dca8f019c9c0048", "score": "0.64357495", "text": "function isValidatedFields() {\n if (!txtNombre.val()) {\n return { isValidate: false, message: \"Nombre no puede estar vacío\" };\n } else if (!txtCedula.val()) {\n return { isValidate: false, message: \"Cédula no puede estar vacío\" };\n } else if (!txtEmail.val()) {\n return { isValidate: false, message: \"Correo no puede estar vacío\" };\n } else if (!txtTelefono.val()) {\n return { isValidate: false, message: \"Teléfono no puede estar vacío\" };\n } else if (!txtPassword.val()) {\n return { isValidate: false, message: \"Contraseña no puede estar vacío\" };\n }\n return { isValidate: true, message: \"\" };\n}", "title": "" }, { "docid": "ed244523410401cb55b7f3825b04e345", "score": "0.6431402", "text": "FieldValidation(key, value) {\n switch (key) {\n case 'firstName':\n if (value.length > 15) {\n return 'error';\n }\n break;\n case 'lastName':\n if (value.length > 15) {\n return 'error';\n }\n break;\n case 'email':\n if (!value.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i)) {\n return 'error';\n }\n break;\n case 'pec':\n if (value.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i)) {\n return 'error';\n }\n break;\n case 'role':\n if (value.length > 15) {\n return 'error';\n }\n case 'Passwd':\n if (value.length > 15) {\n return 'error';\n }\n break;\n case 'password2':\n if (!value.match(this.state.Passwd)) {\n return 'error';\n } else {\n return true;\n }\n break;\n case 'phoneNumber':\n if (value.length > 10) {\n return 'error';\n }\n break;\n case 'telAz':\n if (value.length > 10) {\n return 'error';\n }\n break;\n case 'nomeAzienda':\n if (value.length > 50) {\n return 'error';\n }\n break;\n case 'subCategoria':\n if (value.length > 30) {\n return 'error';\n }\n break;\n case 'piva':\n if (value.length > 11) {\n return 'error';\n }\n break;\n case 'ateco':\n if (value.length > 8) {\n return 'error';\n }\n break;\n case 'provCCIAA':\n if (value.length > 2) {\n return 'error';\n }\n break;\n case 'numREA':\n if (value.length > 6) {\n return 'error';\n }\n break;\n case 'sedeLegInd':\n if (value.length > 30) {\n return 'error';\n }\n break;\n case 'sedeLegNum':\n if (value.length > 3) {\n return 'error';\n }\n break;\n case 'capLeg':\n if (value.length > 5) {\n return 'error';\n }\n break;\n case 'sedeLegFax':\n if (value.length > 10) {\n return 'error';\n }\n break;\n case 'sedeAmmInd':\n if (value.length > 30) {\n return 'error';\n }\n break;\n case 'sedeAmmNum':\n if (value.length > 3) {\n return 'error';\n }\n break;\n case 'capAmm':\n if (value.length > 5) {\n return 'error';\n }\n break;\n case 'sedeAmmFax':\n if (value.length > 10) {\n return 'error';\n }\n break;\n }\n }", "title": "" }, { "docid": "4bfddb85f9a73b72cd11a0679a647fc2", "score": "0.6430649", "text": "function checkIfEmpty(fields){\n for (var i = 0; i < fields.length; i++){\n if((fields[i].classList.contains(\"invalid\")) || (select.classList.contains(\"invalid\"))){\n return false\n }\n }\n return true\n }", "title": "" }, { "docid": "784616df0b927dfe7ce2b7f5c9e868b8", "score": "0.6430182", "text": "function RfvFor6Field(txtBox1,txtBox2,txtBox3,txtBox4,txtBox5,txtBox6)\n{\nif(txtBox1.value.length==0 || txtBox2.value.length==0 || txtBox3.value.length==0 || txtBox4.value.length==0 || txtBox5.value.length==0 || txtBox6.value.length==0)\n{\nalert('Please Enter the mandatory Fields');\nreturn false; \n} \nreturn true;\n}", "title": "" }, { "docid": "81e630fceb7d0a3b3bf6f6c38c66ad97", "score": "0.6427059", "text": "function hasValidFields(req, res, next) {\n const { data = {} } = req.body;\n const validFields = new Set([\n \"first_name\",\n \"last_name\",\n \"mobile_number\",\n \"reservation_date\",\n \"reservation_time\",\n \"people\",\n \"status\",\n \"created_at\",\n \"updated_at\",\n \"reservation_id\"\n ]);\n\n const invalidFields = Object.keys(data).filter(\n field => !validFields.has(field)\n );\n\n if (invalidFields.length)\n return next({\n status: 400,\n message: `Invalid field(s): ${invalidFields.join(\", \")}`,\n });\n next();\n}", "title": "" }, { "docid": "250c141e35d38bd73666f20ac1ac115e", "score": "0.642563", "text": "validateForm() {\n\t\tconst {name, description, athlete, date} = this.state;\n\t\treturn (\n\t\t\t\tname.length > 0 &&\n\t\t\t\tdescription.length > 0 &&\n\t\t\t\tathlete > 0\n\t\t);\n\t}", "title": "" }, { "docid": "768421b09814744bbfb9eccf0894b39f", "score": "0.641662", "text": "function validateAllFields()\r\n{\r\n\tvar retVal = true;\r\n\r\n\tfor (var i = 0; i < theFormValidations.length; i++) \r\n {\r\n\t\tvar field = document.getElementById(theFormValidations[i].id);\r\n\t\tif (theFormValidations[i].required == true)\r\n {\r\n if (!validate(field))\r\n {\r\n alert(\"ERROR: \" + theFormValidations[i].error);\r\n field.focus(); \r\n return false;\r\n } // end if (!validate(field))\r\n }\r\n else\r\n {\r\n if (!isEmpty(field.value))\r\n {\r\n if (!validate(field))\r\n {\r\n\t\t\t\t alert(\"ERROR: \" + theFormValidations[i].error);\r\n \t\t\t\tfield.focus();\r\n\r\n return false;\r\n }\r\n } // end if (!isEmpty(field.value)) \r\n } // end if (theFormValidations[i].required == true)\r\n\t} // end for (var i = 0; i < theFormValidations.length; i++) \r\n\r\n\treturn retVal;\r\n}", "title": "" }, { "docid": "02384e3737641b0f5bc7534dd1c10d9e", "score": "0.64140505", "text": "function NotEmpty(val,field)\r\n {\r\n if(val.length>0)\r\n {\r\n if(field===\"UserName\")\r\n {\r\n document.getElementById(\"name-error\").innerHTML=\" \";\r\n return true;\r\n }\r\n else if(field===\"Birthday\")\r\n {\r\n document.getElementById(\"birthday-error\").innerHTML=\" \";\r\n return true;\r\n }\r\n else if(field===\"City\")\r\n {\r\n document.getElementById(\"place-error\").innerHTML=\" \";\r\n return true;\r\n } \r\n else if(field===\"Gender\")\r\n {\r\n document.getElementById(\"gender-error\").innerHTML=\" \";\r\n return true;\r\n }\r\n else if(field===\"About\")\r\n {\r\n document.getElementById(\"about-error\").innerHTML=\" \";\r\n return true;\r\n }\r\n else if(field===\"Password\")\r\n {\r\n document.getElementById(\"password-error\").innerHTML=\" \";\r\n return true;\r\n }\r\n }\r\n else\r\n {\r\n if(field===\"UserName\")\r\n {\r\n document.getElementById(\"name-error\").innerHTML=\"Username field Can Not Be Empty\";\r\n return false;\r\n }\r\n else if(field===\"Birthday\")\r\n {\r\n document.getElementById(\"birthday-error\").innerHTML=\"Birthday field Can Not Be Empty\";\r\n return false;\r\n }\r\n else if(field===\"City\")\r\n {\r\n document.getElementById(\"place-error\").innerHTML=\"Place field Can Not Be Empty\";\r\n return false;\r\n } \r\n else if(field===\"Gender\")\r\n {\r\n document.getElementById(\"gender-error\").innerHTML=\"Gender field Can Not Be Empty\";\r\n return false;\r\n }\r\n else if(field===\"About\")\r\n {\r\n document.getElementById(\"about-error\").innerHTML=\"About field Can Not Be Empty\";\r\n return false;\r\n }\r\n else if(field===\"Password\")\r\n {\r\n document.getElementById(\"password-error\").innerHTML=\"Password field Can Not Be Empty\";\r\n return false;\r\n } \r\n }\r\n }", "title": "" }, { "docid": "b5e06a69110cc84c6c7f386783486e34", "score": "0.6413955", "text": "function checkField(){\n\t\t// skip testing fields whom their type is not HIDDEN but they are HIDDEN via CSS.\n\t\tif( this.type !='hidden' && $(this).is(':hidden') )\n\t\t\treturn true;\n\n\t\tprepareFieldData(this);\n\n\t\tfield.data( 'val', field[0].value.replace(/^\\s+|\\s+$/g, \"\") );\t// cache the value of the field and trim it\n\t\tdata = field.data();\n\n\t\t// Check if there is a specific error message for that field, if not, use the default 'invalid' message\n\t\talertTxt = message[field.prop('name')] || message.invalid;\n\n\t\t// SELECT / TEXTAREA nodes needs special treatment\n\t\tif( field[0].nodeName.toLowerCase() === \"select\" ){\n\t\t\tdata.type = 'select';\n\t\t}\n\t\tif( field[0].nodeName.toLowerCase() === \"textarea\" ){\n\t\t\tdata.type = 'text';\n\t\t}\n\t\t/* Gather Custom data attributes for specific validation:\n\t\t*/\n\t\tvalidateWords\t= data['validateWords'] || 0;\n\t\tlengthRange \t= data['validateLengthRange'] ? (data['validateLengthRange']+'').split(',') : [1];\n\t\tlengthLimit\t\t= data['validateLength'] ? (data['validateLength']+'').split(',') : false;\n\t\tminmax\t\t\t= data['validateMinmax'] ? (data['validateMinmax']+'').split(',') : ''; // for type 'number', defines the minimum and/or maximum for the value as a number.\n\n\t\tdata.valid = tests.hasValue(data.val);\n\t\t// check if field has any value\n\t\tif( data.valid ){\n\t\t\t/* Validate the field's value is different than the placeholder attribute (and attribute exists)\n\t\t\t* this is needed when fixing the placeholders for older browsers which does not support them.\n\t\t\t* in this case, make sure the \"placeholder\" jQuery plugin was even used before proceeding\n\t\t\t*/\n\t\t\tif( tests.sameAsPlaceholder(field) ){\n\t\t\t\talertTxt = message.empty;\n\t\t\t\tdata.valid = false;\n\t\t\t}\n\n\t\t\t// if this field is linked to another field (their values should be the same)\n\t\t\tif( data.validateLinked ){\n\t\t\t\tvar linkedTo = data['validateLinked'].indexOf('#') == 0 ? $(data['validateLinked']) : $(':input[name=' + data['validateLinked'] + ']');\n\t\t\t\tdata.valid = tests.linked( data.val, linkedTo.val() );\n\t\t\t}\n\t\t\t/* validate by type of field. use 'attr()' is proffered to get the actual value and not what the browsers sees for unsupported types.\n\t\t\t*/\n\t\t\telse if( data.valid || data.type == 'select' )\n\t\t\t\tdata.valid = testByType(data.type, data.val);\n\n\t\t\t// optional fields are only validated if they are not empty\n\t\t\tif( field.hasClass('optional') && !data.val )\n\t\t\t\tdata.valid = true;\n\t\t}\n\n\t\t// mark / unmark the field, and set the general 'submit' flag accordingly\n\t\tif( data.valid )\n\t\t\tunmark( field );\n\t\telse{\n\t\t\tmark( field, alertTxt );\n\t\t\tsubmit = false;\n\t\t}\n\n\t\treturn data.valid;\n\t}", "title": "" }, { "docid": "147c9fe4a5407eebef9cb5bae9d7fa83", "score": "0.64063334", "text": "function checkField(params){\n\n}", "title": "" }, { "docid": "6fe368ed8b3539b1e8cb1766dc28e471", "score": "0.63992524", "text": "function verifyFields() {\n const blurbCategory = blurbCategoryField.value;\n const blurbTitle = blurbTitleField.value;\n const blurbText = blurbTextField.value;\n\n return blurbCategory != \"\" && blurbTitle != \"\" && blurbText != \"\";\n}", "title": "" }, { "docid": "928e6cab986620eff0a0f03af92b37ab", "score": "0.63934773", "text": "function checkAllInputs() {\n checkUsername(username, usernameErrMsg);\n checkEmail(email, emailErrMsg);\n checkPassword(password, passwordErrMsg);\n passwordMatch(password, password2, password2ErrMsg);\n}", "title": "" }, { "docid": "d099aa75044126e310f5f81595f734b6", "score": "0.6392552", "text": "function checkAllStaffFieldsNonEmpty() {\n let name_text = $(\"#name\").val();\n let ssn_text = $(\"#ssn\").val();\n let birthday_text = $(\"#birthday\").val();\n let address_text = $(\"#address\").val();\n let sex_text = $(\"#sex\").val();\n let salary_text = $(\"#salary\").val();\n let superssn_text = $(\"#superssn\").val();\n let position_text = $(\"#position\").val();\n\n // Check if all boxes are non-empty\n if (name_text != \"\" && ssn_text != \"\" && birthday_text != \"\" && address_text != \"\" && sex_text != \"\" && salary_text != \"\" && superssn_text != \"\" && position_text != \"\") {\n $(\"#btn-save\").prop('disabled', false); // Enable the save button\n }\n else {\n $(\"#btn-save\").prop('disabled', true); // Disable save button if one or both of boxes or empty\n }\n\n // Check if at least one box has text\n if (name_text != \"\" || ssn_text != \"\" || birthday_text != \"\" || address_text != \"\" || sex_text != \"\" || salary_text != \"\" || superssn_text != \"\" || position_text != \"\") {\n $(\"#btn-clear-staff\").prop('disabled', false); // Enable the clear button\n }\n else {\n $(\"#btn-clear-staff\").prop('disabled', true); // disable the clear button\n }\n}", "title": "" }, { "docid": "b09ff13fe6f155925d9eafead6209bb4", "score": "0.6391987", "text": "function checkFields() { \n\tif(document.getElementById(\"currentBalance\").innerHTML == \"\"\n\t\t|| document.getElementById(\"currentBudget\").innerHTML == \"\"\n\t\t|| document.getElementById(\"url\").innerHTML == \"\"\n\t\t|| document.getElementById(\"cycleCount\").innerHTML == \"\") {\n\t\talert(\"ERROR: You are missing one or more field(s)!\")\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "550a74cec85e0ce8cde7d1847bb2b826", "score": "0.63857716", "text": "function cleanAndCheck(field) {\n\tvar cell_css_id = \"cell-\" + field.cell;\n\tvar v = getFormFieldValue(cell_css_id);\n\tif (includesA(\"cell-\" + cell_css_id, 'select')) {\n\t\treturn false;\n\t}\n\n\t// ignore if field unchanged to allow us to keep blank input values\n\tif (valueNotChangedForTextField(field, determineFieldValue(field))) {\n\t\treturn true;\n\t}\n\n\tif (field.format == \"excel_date\") {\n\t\tsetFormFieldValue(cell_css_id, removeSpaces(v));\n\t\tif (!checkDate(v)) return false;\n\t} else if (field.format == \"percentage\") {\n\t\tif (!v == null || v == '') { v = '0'; }\n\t\tv = removeNonDigitsPointMinus(v);\n\t\tif (!isNumeric(v)) {\n\t\t\tsetFormFieldValue(cell_css_id, removeNonDigitsPointMinus(v) + \"%\");\n\t\t\treturn false;\n\t\t}\n\t\tsetFormFieldValue(cell_css_id, removeNonDigitsPointMinus(v) + \"%\");\n\t} else if (field.format == \"money_rounded_input\") {\n\t\tif(field.cell == '45G117') {\n\t\t\tvar s = s + 1;\n\t\t}\n\t\tif (!v == null || v == '') { v = '0'; }\n\t\tv = removeNonDigitsPointMinus(v);\n\t\tif (!isNumeric(v)) {\n\t\t\tsetFormFieldValue(cell_css_id, removeNonDigitsPointMinus(v));\n\t\t\treturn false;\n\t\t} else {\n\t\t\tsetFormFieldValue(cell_css_id, Formats.commas.to(v));\n\t\t}\n\t} else if (field.format == \"string\") {\n\t\treturn true;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "8daa8fc62f058e788506f2ad75c32fe0", "score": "0.6383736", "text": "function validateFields(fname, lname, email, area, s_num) {\n\tvar invalid = \"\"\n\t\n\t// Check if fields were left blank\n\tif (fname == \"\") { invalid += \"First Name\\n\"; }\n\tif (lname == \"\") { invalid += \"Last Name\\n\"; }\n\tif (email == \"\") { invalid += \"Email Address\\n\"; }\n\tif (area == \"Please select an area\") { invalid += \"Area\\n\"; } \n\tif (s_num == \"\") { invalid += \"Student Number\\n\"; }\n\t\n\tif (invalid == \"\") {\n\t\treturn true;\n\t} else {\n\t\tinvalid = \"The following fields were not filled in:\\n\\n\" + invalid;\n\t\talert(invalid);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "d15f95fa4f825df476f24e3ad20c83a8", "score": "0.6382997", "text": "function validateEmpty(){\n if(validateName() || validateLastName() || validateEmail() || validatePhone())\n return true;\n else\n return false;\n }", "title": "" }, { "docid": "f47222266cc01c2c4cbde8e37eb19226", "score": "0.6376917", "text": "checkValidity() {\n const hasInvalidFields = this.$.customField.inputs\n .filter(input => !(input.checkValidity).call(input)).length > 0;\n const hasEmptyFields = this.required && this.$.customField.inputs.filter(el => !el.value).length > 0;\n\n if (hasInvalidFields || hasEmptyFields) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "897316dd8651cbae4c9d1a7d5acb489d", "score": "0.6376141", "text": "function empty_check()\n\t{\n\t\t// Retrive all the form elements\n\t\tvar form_all=document.forms[\"cust_form\"];\n\t\t// Iterate through all the elements.\n\t\tfor (index=0; index<form_all.length;index++)// form_all.length gives total\n\t\t\t\t\t\t\t\t\t\t\t\t\t// number of elements\n\t\t{\n\t\t\t// Checks for a blank\n\t\t\tif(form_all.elements[index].value==\"\")\n\t\t\t{\n\t\t\t\t// If field empty prompt the user\n\t\t\t\talert(\"All fields are mandatory\");\n\t\t\t\t// returns false to indicate validation failed\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// If all fields are filled returns true indicating validation success\n\t\treturn true;\n\t}", "title": "" }, { "docid": "1f1e220c9e01496213c0adac0772f8e8", "score": "0.63596594", "text": "function validateForm() {\n return facility.length > 0 && equipmentType.length > 0 && equipmentID.length > 0 && priority.length > 0 && time.length;\n }", "title": "" }, { "docid": "cf62bca2dddf2c6d38ad2949005cf6ca", "score": "0.63577306", "text": "function checkRequired(inputArr) {\n\n inputArr.forEach(function (input) {\n\n if (input.value.trim() === \"\") {\n showError(input, `${getFieldName(input)} is required`);\n }\n \n else {\n showSuccess(input);\n } \n \n \n });\n}", "title": "" }, { "docid": "b0a7d94944156d36f971e927c8bf4f53", "score": "0.63524336", "text": "function checkField (theField, desField, theFunction, emptyOK, focoOK, s)\r\n{\r\n var msg;\r\n if (checkField.arguments.length < 4) {emptyOK = defaultEmptyOK;}\r\n if (checkField.arguments.length < 5) {focoOK = true;}\r\n if (checkField.arguments.length == 6) {\r\n msg = s;\r\n } else {\r\n if( theFunction == isAlphabetic ) msg = pAlphabetic;\r\n if( theFunction == isAlphanumeric ) msg = pAlphanumeric;\r\n if( theFunction == isInteger ) msg = pInteger;\r\n if( theFunction == isNumber ) msg = pNumber;\r\n if( theFunction == isEmail ) msg = pEmail;\r\n if( theFunction == isPhoneNumber ) msg = pPhoneNumber;\r\n if( theFunction == isName ) msg = pName;\r\n if( theFunction == isDate ) msg = pDate;\r\n if( theFunction == isMes ) msg = pMes;\r\n if( theFunction == isRut ) msg = pRut;\r\n if( theFunction == isTime ) {\r\n if (theField.value.length == 5) {\r\n msg = pTimeHM;\r\n }else if (theField.value.length == 2) {\r\n msg = pTimeH;\r\n }else{\r\n msg = pTime;\r\n }\r\n }\r\n if( theFunction == isDateTime ) {\r\n if (theField.value.length == 16) {\r\n msg = pDateTimeHM;\r\n }else if (theField.value.length == 13) {\r\n msg = pDateTimeH;\r\n }else{\r\n msg = pDateTime;\r\n }\r\n }\r\n }\r\n\r\n statBar(\"\");\r\n\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n\r\n if ((emptyOK == false) && (isEmpty(theField.value))) \r\n return warnEmpty(theField,desField,focoOK);\r\n\r\n if (theFunction(theField.value) == true) \r\n return true;\r\n else\r\n return warnInvalid(theField,desField,msg,focoOK);\r\n}", "title": "" }, { "docid": "87c8c8f3c8bfb0c9df177470eff4897c", "score": "0.63420206", "text": "function checkRequiredFields(view, fields, callbackIfOK) {\n Knack.showSpinner()\n let isRequiredEntered = true\n let warningMessage = []\n\n // Remove any previous warnings\n $('.is-error-message').remove()\n $('.input-error').removeClass('input-error')\n\n // Check that a value has been supplied\n fields.forEach(field => {\n\n // Check short text field\n let $shortText = $(`.kn-input-short_text #${field}`)\n if ($shortText.length > 0) {\n if ($shortText.val() === '' && $shortText.closest('.kn-input').is(\":visible\")) {\n isRequiredEntered = false\n warningMessage.push(`<p><strong>${$('#kn-input-'+ field + ' label > span')[0].innerText} is required.</strong></p>`)\n $shortText.addClass('input-error')\n }\n } else if ($(`#kn-input-${field}`).length > 0) {\n\n let $input = $(`#${view.key}-${field}`)\n let $connectionInput = $(`#${view.key}_${field}_chzn`)\n let value = $input[0].value\n\n if (value === '' && $input.closest('.kn-input').is(\":visible\")) {\n isRequiredEntered = false\n warningMessage.push(`<p><strong>${$('#kn-input-'+ field + ' label > span')[0].innerText} is required.</strong></p>`)\n\n if ($connectionInput.length > 0) {\n $connectionInput.find('a').addClass('input-error') // single selection\n $connectionInput.find('ul').addClass('input-error') // multi selection\n } else {\n $input.addClass('input-error') //.addClass('is-error')\n }\n }\n }\n })\n\n if (isRequiredEntered) {\n if (callbackIfOK) callbackIfOK()\n Knack.hideSpinner()\n return true\n } else {\n let warning =\n `<div class=\"kn-message is-error is-error-message\">\n <span class=\"kn-message-body\">\n ${warningMessage.join('')}\n </span>\n </div>`\n\n if ($('.is-error-message').length === 0) $('#' + view.key + ' form').prepend(warning)\n Knack.hideSpinner()\n return false\n }\n\n}", "title": "" }, { "docid": "ae63d364febbe8480d91591aeb5562c7", "score": "0.6328111", "text": "function RfvFor4Field(txtBox1,txtBox2,txtBox3)\n{\nif(txtBox1.value.length==0 || txtBox2.value.length==0 || txtBox3.value.length==0 || txtBox4.value.length==0)\n{\nalert('Please Enter the mandatory Fields');\nreturn false; \n} \nreturn true;\n}", "title": "" }, { "docid": "8e2bcbc22cb2ab7ef139b1cb454d566f", "score": "0.63248134", "text": "function RfvFor5Field(txtBox1,txtBox2,txtBox3,txtBox4,txtBox5)\n{\nif(txtBox1.value.length==0 || txtBox2.value.length==0 || txtBox3.value.length==0 || txtBox4.value.length==0 || txtBox5.value.length==0)\n{\nalert('Please Enter the mandatory Fields');\nreturn false; \n} \nreturn true;\n}", "title": "" }, { "docid": "12ff822a6b9925cb888941d20276b51d", "score": "0.63212204", "text": "function mandatoryCheck()\n{ \n //checks all those fields who have a mandatory attribute;\n\n input_fields = document.getElementsByTagName('input');\n select_fields = document.getElementsByTagName('select'); //for cases like DOB\n textarea_fields = document.getElementsByTagName('textarea'); //for cases like Career Objective\n\n all_fields = [input_fields,select_fields,textarea_fields]; //the total set of elements that we we want to check for mandatoriness \n\n for (var j=0;j<all_fields.length;j++)\n {\n fields = all_fields[j]; //select the set of fields.\n \n for (var i=0; i<fields.length;i++)\n {\n if (fields[i].getAttribute('type') == 'hidden' || fields[i].type == 'button')\n {\n continue; //we don't want to touch such fields!\n }\n\n if (fields[i].getAttribute('mandatory') == 'true')\n {\n\n var field_name = fields[i].id; //because a field may or may not have a name but will always hv an ID\n \n //a=fields[i].name.split('_')[0]\n /* is the field enabled and still it's value is not entered */\n if ((fields[i].value==\"\")&&(input_fields[i].disabled==false) )\n {\n alertmsg = field_name.split('_')\n //now that we know validity, mark so visually and attributely\n //and tell the user\n\n styleClass = (fields[i].getAttribute('class') == null ? ' ' : fields[i].getAttribute('class')) ;\n fields[i].setAttribute('class',styleClass + ' invalid_data');\n \n if (alertmsg.length>1) //and there is more than one component in the name of the element\n {\n alert(alertmsg[1] + ' in the ' + alertmsg[0] + ' section is not filled');\n }\n else\n {\n alert(alertmsg[0] + ' is not filled!');\n }\n \n //TODO: find out a way to retrieve the parent tab of the element and call it's select() method \n fields[i].focus();\n return false;\n }\n else //if found valid, clear any existing invalidity reference!\n {\n styleClass = fields[i].getAttribute('class');\n if (styleClass != null)\n {\n x = fields[i].getAttribute('class').indexOf('invalid_data');\n class_without_invalid_mark = fields[i].getAttribute('class').slice(0,-1*x);\n fields[i].setAttribute('class',class_without_invalid_mark);\n }\n \n \n }\n }\n //whether it's mandatory or not, we need to replace it with proper name\n //everything is good with this field now replace it's name with it's id.\n if ((fields[i].id != '' || fields[i].id != null) && (fields[i].value != '' || fields[i].value != null))\n {\n //alert('setting name of ' + fields[i].name + ' to ' + fields[i].id);\n if (fields[i].tagName != 'select')\n fields[i].name = fields[i].id; // we dont need to do this for select. ebcause we have monthyear. and of dependency checking fails, then the name also gets changed. which creates a problem later on.\n }\n }\n }\n \n \n var tables = new Array('marks','workex','certification','projects','academic','extracurricular')\n \n //dependency checking -- if content is filled and the month-year isn't OR if month-year is filled and content isn't.\n select=document.getElementsByTagName('select');\n for (var i=0;i<select.length;i++)\n {\n a=select[i].id.split('_')[0]\n if (tables.indexOf(a)>=0)\n {\n o=select[i].parentNode.parentNode.children;\n if (select[i].value)\n var filled=true;\n else\n var filled = false;\n \n for(var j=0;j<o.length;j++)\n {\n \n for (var k=0;k<o[j].children.length;k++)\n {\n \n if ((o[j].children[k].tagName==\"INPUT\" || o[j].children[k].tagName==\"SELECT\" || o[j].children[k].tagName==\"TEXTAREA\") && ((filled && !o[j].children[k].value)|| (!filled && o[j].children[k].value)))\n {\n alertmsg=o[j].children[k].id.split('_');\n alert('Check your '+ alertmsg[0] +' entry...' + alertmsg[1] +' is not filled properly'); return false;\n }\n }\n\n } \n }\n } \n //alert('returning true')\n return true;\n}", "title": "" }, { "docid": "3349a2aa1d33936527d5df8318219fcf", "score": "0.6310845", "text": "function validateFields(field) {\n let text = 'ok';\n let classField = field.className;\n if (classField === 'developers') {\n let result = validDevelopers(field);\n if (!result) {\n text = 'expected: \"-\", \"_\", \".\", \",\", \" \", 0-9, A-z, А-я';\n }\n return text;\n }\n else if (classField === 'siteName') {\n let result = validSiteName(field);\n if (!result) {\n text = 'expected: \"-\", \"_\", \".\", \" \", 0-9, A-z, А-я';\n }\n return text;\n }\n else if (classField === 'siteURL') {\n let result = validSiteURL(field);\n if (!result) {\n text = 'invalid URL';\n }\n return text;\n }\n else if (classField === 'siteEmail') {\n let result = validSiteEmail(field);\n if (!result) {\n text = 'invalid email';\n }\n return text;\n }\n else {\n return text;\n }\n\n function validDevelopers(elem) {\n let regName = /[а-яa-z0-9 \\.\\-_,]+/i;\n return regName.test(elem.value);\n }\n function validSiteName(elem) {\n let regName = /[-a-zа-я0-9\\._ ]+/i;\n return regName.test(elem.value);\n }\n function validSiteURL(elem) {\n let regURL = /((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[\\-;:&=+$,\\w]+@)?[A-Za-z0-9\\.\\-]+|(?:www\\.|[\\-;:&=+$,\\w]+@)[A-Za-z0-9\\.\\-]+)((?:\\/[+~%\\/\\.\\w\\-_]*)?\\??(?:[\\-+=&;%@\\.\\w_]*)#?(?:[\\.!\\/\\\\\\w]*))?)/;\n return regURL.test(elem.value);\n }\n function validSiteEmail(elem) {\n let regMail = /^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}/;\n return regMail.test(elem.value);\n }\n}", "title": "" }, { "docid": "3082678e9eec35837c6572de50bb9c0e", "score": "0.6306015", "text": "function verifyInput(field) {\n\tvar fieldName = field.name;\n\tvar pipeExpr = /[|]/; // Because pipes are used to split the field name and value in fetchMap.php\n\tif (pipeExpr.test(field.value)) {\n\t\tfield.classList.add(\"failInput\");\n\t\treturn false;\n\t} else {\n\t\tfield.classList.remove(\"failInput\");\n\t}\n\n\t// Checks that required fields are filled out\n\tif (fieldName == \"location\" || fieldName == \"description\" || fieldName == \"year\" || fieldName == \"width\" ||\n\t\t\tfieldName == \"height\" || fieldName == \"backText\" || fieldName == \"shelf\") {\n\t\tif (field.value === \"\") {\n\t\t\tfield.classList.add(\"failInput\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tfield.classList.remove(\"failInput\");\n\t\t}\n\t}\n\n\t// Checks that numeric fields contain only numeric values\n\tif (fieldName == \"year\" || fieldName == \"width\" || fieldName == \"height\" || fieldName == \"quantity\") {\n\t\tvar numberExpr = /\\D/;\n\t\tif (numberExpr.test(field.value) && field.value !== \"\") {\n\t\t\tfield.classList.add(\"failInput\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tfield.classList.remove(\"failInput\");\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "cce634471bd9da75f95087d183cf42e7", "score": "0.63053054", "text": "function validateRequiredFields(itemIds) {\r\n var item;\r\n var count;\r\n var validate = true;\r\n for (count = 0; count < itemIds.length; count++){\r\n item = itemIds[count];\r\n if($(item) != null) {\r\n if(($F(item)).strip() == '') {\r\n validate = false;\r\n }\r\n }\r\n }\r\n return validate;\r\n}", "title": "" }, { "docid": "39aa3365abe2ddf7697293a9f17c15c3", "score": "0.63042694", "text": "function dataValidation(thanim, modelpedogogi, eikef, ramatoryanut, mashavimkaiamim){\r\n if (thanim != 0 && modelpedogogi != 0 && modelpedogogi != 0 && eikef != 0 && ramatoryanut != 0 && mashavimkaiamim != 0) {\r\n modelCalculation(thanim, modelpedogogi, eikef, ramatoryanut, mashavimkaiamim)\r\n }\r\n else {\r\n alert(\"you have to fill all the fields\")\r\n }\r\n}", "title": "" }, { "docid": "cfff9848fa72cae5c2081c8be103ee3b", "score": "0.6296178", "text": "function validateFields(req, res, next){\n var flag = false;\n //Check if there are any fields whose value after sanitizing is different from original\n //If there is, then it is an indication that the original field is invalid\n for (var field in req.body){\n if (req.body[field] != sanitizer.sanitize(req.body[field])){\n flag = true;\n }\n } \n if (flag == true){\n res.json({ error: \"invalid input! Try again.\"});\n\n }else{\n next(); \n }\n}", "title": "" }, { "docid": "61c65501c135bf26911a85e463e2a36d", "score": "0.6295756", "text": "validarDados() {\n // o for in vai passar por todos os itens do formulario e ver se eles estao preenchidos se eles nao estiver preenchidos vai ser retornado false e se estiver vai retornar true... na funcao cadastrar despesas vai ser chamando o metodo e caso ele seja true vai mostrar a mensagem de cadastro realizado com sucesso e caso false vai mostrar para preencher todos os campos.\n for(let i in this) {\n if(this[i] == undefined || this[i] == '' || this[i] == null) {\n return false\n }\n \n }\n return true\n }", "title": "" }, { "docid": "cf16ec97edcb126fb59b131d539ead91", "score": "0.62954915", "text": "validateFields() {\n const iban = document.querySelector(`#${this.ibanID}`);\n const clientFirstName = document.querySelector(`#${this.clientFirstNameID}`);\n const clientLastName = document.querySelector(`#${this.clientLastNameID}`);\n const clientEmail = document.querySelector(`#${this.clientEmailID}`);\n const clientCity = document.querySelector(`#${this.clientCityID}`);\n const clientZipcode = document.querySelector(`#${this.clientZipcodeID}`);\n const clientStreet = document.querySelector(`#${this.clientStreetID}`);\n const clientHouseNumber = document.querySelector(`#${this.clientHouseNumberID}`);\n const jobDescription = document.querySelector(`#${this.jobDescriptionID}`);\n const jobLocation = document.querySelector(`#${this.jobLocationID}`);\n const jobDirectedBy = document.querySelector(`#${this.jobDirectedByID}`);\n const jobStartDate = document.querySelector(`#${this.jobStartDateID}`);\n const jobEndDate = document.querySelector(`#${this.jobEndDateID}`);\n\n validate(iban, );\n validate(clientFirstName, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientLastName, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientEmail, /^(([^<>()\\[\\]\\\\.,;:\\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 validate(clientCity, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientZipcode, /^\\d{4}\\s*[a-zA-z]{2}$/);\n validate(clientStreet, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(clientHouseNumber, /^[0-9][^\\s]*$/);\n validate(jobDescription, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(jobLocation, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(jobDirectedBy, /^[a-zA-Z][^\\s]*[\\s|a-zA-Z]*?$/);\n validate(jobStartDate, /^[0-9]{4}-[0-9]{2}-[0-9]{2}/);\n validate(jobEndDate, /^[0-9]{4}-[0-9]{2}-[0-9]{2}/);\n }", "title": "" }, { "docid": "8017e28d117d3ca429c91c83fbfe7652", "score": "0.62844676", "text": "function FieldNotEmpty(){\r\r\n var id = \"t1-1\";//Start at the beginning\r\r\n for(var x = 1; x <= 9; x++){ //Loop trough all the rows\r\r\n id = setRow(id, x);\r\r\n for(var y = 1; y <= 9; y++){ //Loop trough all the collums\r\r\n id = setCollum(id, y);\r\r\n if(getNumber(id) === \"\"){ // Cneck if the numbers is not empty\r\r\n return true;\r\r\n }\r\r\n }\r\r\n }\r\r\n return false; //No empty space found!\r\r\n}", "title": "" }, { "docid": "3fa5cda0a6d07b716040c74c873ad3b4", "score": "0.6275014", "text": "function __validate () {\n\n if (typeof __on_validate_start_function == \"function\")\n __on_validate_start_function();\n\n var fields_valid = true;\n var validated_values = {};\n\n __validator_errors = {};\n\n for (field in __fields) {\n\n var field_valid = true;\n\n if (!__fields[field]().validate()) {\n\n __validator_errors[field] = __fields[field]().getValidationErrors();\n\n field_valid = false;\n fields_valid = false;\n\n }\n\n validated_values[field] = __fields[field]().getValidatedValue();\n\n if (field_valid) {\n\n if (typeof __on_field_valid_function == \"function\")\n // invoke custom onFieldValid function\n __on_field_valid_function(field, validated_values[field]);\n\n } else {\n\n if (typeof __on_field_invalid_function == \"function\")\n // invoke custom onFieldInvalid function\n __on_field_invalid_function(field, __validator_errors[field]);\n\n }\n\n }\n\n if (fields_valid) {\n\n if (typeof __on_valid_function == \"function\")\n // invoke custom onValid function\n __on_valid_function(validated_values);\n\n } else {\n\n if (typeof __on_invalid_function == \"function\")\n // invoke custom onInvalid function\n __on_invalid_function(__validator_errors);\n\n }\n\n if (typeof __on_validate_finish_function == \"function\")\n __on_validate_finish_function();\n\n return fields_valid;\n\n }", "title": "" }, { "docid": "c44c56ee9a97166e98f3fac57e4a3cd0", "score": "0.62643033", "text": "function isValid() {\n if (values.length == 0) return false;\n\n let noColumns = values[0].length;\n if (values.filter((row) => row.length != noColumns).length != 0)\n return false;\n\n\n for (let i = 0; i < values.length; i++) {\n for (let j = 0; j < noColumns; j++) {\n if (!(values[i][j] && values[i][j] instanceof field))\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "48d58c761983712612790ebf69a64b59", "score": "0.62514806", "text": "function required()\n{\nvar empty1 = document.forms[\"feedback\"][\"month\"].value;\nvar empty2 = document.forms[\"feedback\"][\"day\"].value;\nvar empty3 = document.forms[\"feedback\"][\"year\"].value;\nvar empty4 = document.forms[\"feedback\"][\"desc\"].value;\nvar empty5 = document.forms[\"feedback\"][\"username\"].value;\nvar empty6 = document.forms[\"feedback\"][\"age\"].value;\nvar empty7 = document.forms[\"feedback\"][\"email\"].value;\n\nif (empty1 == \"\" || empty2 == \"\" || empty3 == \"\" || empty4 == \"\" || empty5 == \"\" \n|| empty6 == \"\" || empty7 == \"\" )\n{\nalert(\"Please input all values!\");\nreturn false;\n}\nelse \n{\nreturn true; \n}\n}", "title": "" }, { "docid": "080ed46fd7c09d7cac4769c8ad6c310b", "score": "0.6251018", "text": "function notEmpty(fields) {\n for(let i in fields) {\n if(!fields[i]) { return false; }\n }\n return true;\n}", "title": "" }, { "docid": "67abfba02c1dbf0ad449f4596f4dc8a6", "score": "0.6246504", "text": "function validateChkMethod(){\r\n var blankFieldsNames = [];\r\n var invalidFieldIds = [];\r\n if($('checknumber_id') != null) {\r\n var checkNumber = $F('checknumber_id').strip();\r\n if(checkNumber == '' || checkNumber.match(/^[\\w]+$/) == null ||\r\n checkNumber.match(/[^0]/) == null || isCheckNumberAutoGenerated() == true) {\r\n blankFieldsNames.push(' Check Number');\r\n invalidFieldIds.push('checknumber_id');\r\n }\r\n }\r\n if($('client_type') != null && $F('client_type').strip().toUpperCase() != 'UNIVERSITY OF PITTSBURGH MEDICAL CENTER' ) {\r\n if($('aba_routing_number_id') != null) {\r\n var routingNumber = $F('aba_routing_number_id').strip();\r\n if(routingNumber == '' || routingNumber.match(/^[\\w]+$/) == null ||\r\n routingNumber.match(/[^0]/) == null) {\r\n blankFieldsNames.push(' ABA Routing #');\r\n invalidFieldIds.push('aba_routing_number_id');\r\n }\r\n }\r\n if($('payer_account_number_id') != null) {\r\n var accountNumber = $F('payer_account_number_id'.strip());\r\n if(accountNumber == '' || accountNumber.match(/^[\\w]+$/) == null ||\r\n accountNumber.match(/[^0]/) == null) {\r\n blankFieldsNames.push(' Payer Account #');\r\n invalidFieldIds.push('payer_account_number_id');\r\n }\r\n }\r\n }\r\n if($F(\"checkamount_id\").strip() == '' || parseFloat($F(\"checkamount_id\")) == 0){\r\n blankFieldsNames.push(\" Check Amount\");\r\n invalidFieldIds.push('checkamount_id');\r\n }\r\n \r\n if($(\"checkdate_id\") != null && $(\"checkdate_id\").type != 'hidden') {\r\n var checkDate = $F(\"checkdate_id\").strip().toUpperCase();\r\n if(checkDate == '' || checkDate == \"MM/DD/YY\"){\r\n blankFieldsNames.push(\" Check Date\");\r\n invalidFieldIds.push('checkdate_id');\r\n }\r\n }\r\n if(blankFieldsNames.length > 0){\r\n if($F('payment_method') == 'CHK')\r\n alert(\"The Payment Method is selected as CHK. Please enter value in : \" + blankFieldsNames);\r\n else if($F('payment_method') == 'OTH')\r\n alert(\"The Payment Method is selected as OTH. Please enter value in : \" + blankFieldsNames);\r\n setTimeout(function(){\r\n $(invalidFieldIds[0]).focus();\r\n },50);\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "4c415fb5a1bab12a1c066479e13af9c5", "score": "0.6246105", "text": "function checkFields() {\n let model = coursesModel.getCurrentObj();\n // Check if code is empty\n if (sharedHelpersInstance.isEmpty(model.code)) {\n sharedHelpersInstance.showErrorInput(\n document.getElementById(\"course_code\"),\n strings.codeEmpty\n );\n return;\n }\n // Check if campus is empty\n if (sharedHelpersInstance.isEmpty(model.campus)) {\n sharedHelpersInstance.showErrorInput(\n document.getElementById(\"Campuses\"),\n strings.campusNotSelected\n );\n return;\n }\n\n hideError();\n // If all the fields are valid, add the course\n submitAddCourse();\n }", "title": "" }, { "docid": "a6031dd657363c8026dc6913a07df49a", "score": "0.62441194", "text": "function validate(field)\n{\n name = field.id.split('_'); \n value = field.value;\n validateFor = field.getAttribute('datatype');\n valid = true;\n reason = '';\n switch (validateFor)\n {\n case 'float':\n debug('i am in float');\n parts = value.split('.');\n if (parts.length == 1)\n validateFor = 'numeric';\n else\n {\n if ((parts.length != 2) || (isNaN(parts[0])) || (isNaN(parts[1])))\n {\n valid = false;\n reason = 'NaN';\n }\n else\n {\n if ((parts[1].length > 4) || (parts[0].length > 6) || (value.length > 10))\n {\n valid = false;\n reason = 'decimal_length';\n }\n else\n {\n valid = true;\n }\n }\n highlightError(field,!valid,reason);\n //break only when are we done fully addition.\n break;\n }\n //we aren't breaking when the type is numeric\n case 'numeric':\n debug('i am numeric');\n if ((isNaN(value)) || (parseInt(value) < 0))\n {\n highlightError(field,true,\"numeric\");\n valid = false;\n }\n else {valid = true; highlightError(field,false,\"\");}\n break;\n case 'email':\n debug('i am email'); // from w3chools\n var atpos=value.indexOf(\"@\");\n var dotpos=value.lastIndexOf(\".\");\n if ((atpos<1) || (dotpos<atpos+2) || (dotpos+2 >= value.length))\n {\n reason =\"email\"\n valid = false;\n }\n else\n {\n valid = true;\n }\n highlightError(field,!valid,reason);\n //regexp = 'email ka regexp';\n break;\n case 'monthyear':\n debug ('value is ' + value);\n parts = value.split(',');\n if ((parseInt(parts[0]) >= 1 && parseInt(parts[0]) <= 31) && (parseInt(parts[1]) >= 1) && (parseInt(parts[1]) <= 12) && (parts[2] != ''))\n {\n valid = true;\n }\n else\n {\n valid = false;\n //it's invalid, now we need to focus and highlight on the right field\n id = field.id.split('_');\n if (id[1].indexOf('monthyear') == 0)\n {\n id[1] = 'year';\n \n }\n else\n {\n id[1] = id[1].substr(0,id[1].indexOf(\"monthyear\"))+\"year\"; // start_montheyar or endmonthyear.\n }\n f = document.getElementById(id);\n //to be on safe side \n createDates(f);\n\n highlightError(f,!valid,'invalid_date');\n }\n //WARNING: Samar added the break statement below because he thought it should be here :P \n break; \n case 'string': //only chars, spaces and parantheses and hyphen allowed...eg Full Name\n valid = true\n debug('i am string');\n break;\n }\n \n //if found invalid, stop right here.\n if (!valid)\n return false;\n \n switch (field.tagName)\n {\n case 'select':\n case 'SELECT':\n// valid = dependencyCheck(field);\n valid =true\n \n break;\n case 'input':\n case 'INPUT':\n valid = true; \n break;\n case 'TEXTAREA':\n case 'textarea':\n valid =true;\n debug('i am in textarea');\n break;\n }\n return valid;\n}", "title": "" }, { "docid": "a74905bd86806b3ee7b6f47498ef120e", "score": "0.62435645", "text": "function validateMandatoryFields(){\r\n\terrMsg = new Array();\r\n\terrCount=0;\r\n\r\n\t//Colocar en el estado inicial al campo resaltado\r\n\tresetFields(field);\r\n\tfirstErr=null;\r\n\r\n\t//Llamado a las funciones de validacion de los campos\r\n\tvalidate_name();\r\n\tvalidate_lastname();\r\n\tcheckFields();\t\r\n\tvalidate_cont_postal_cd();\r\n\tvalidate_cont_sex_cd();\r\n\t\r\n\t\r\n\t\r\n\r\n\tif(errCount>0){\r\n\t\tfor(i=0;i<1;i++){\r\n\t\t alert(errMsg[i]);\r\n\t }\r\n\t\tfield=firstErr.id;\r\n\t\t//Resaltar el primer campo donde existe un error\r\n\t\tdocument.getElementById('title_'+firstErr.id+'_underline').style.display='block';\r\n\t\tdocument.getElementById('label_'+firstErr.id+'_underline').style.background='#FFFFCC';\r\n\t\tdocument.getElementById('input_'+firstErr.id+'_underline').style.background='#FFFFCC';\r\n\r\n\t\t//Fijar el foco en el campo en el que se presenta el primer error\r\n\t\tfirstErr.focus();\r\n\t\tdocument.getElementById('title_'+firstErr.id+'_underline').scrollIntoView(true);\r\n\t\t\r\n\t\t\r\n\t}else{\r\n\t\tdocument.forma.submit();\r\n\t}\r\n}", "title": "" }, { "docid": "473d7634bec3ec43da6bee0940ac9b21", "score": "0.62410957", "text": "function validateAll()\r\n{\r\n\tfor (var i = 0; i < theFormValidations.length; i++) \r\n {\r\n\t\tvar field = document.getElementById(theFormValidations[i].id);\r\n\t\tif (!isEmpty(field.value)) validate(field);\r\n\t} // end for (var i = 0; i < theFormValidations.length; i++) \r\n}", "title": "" }, { "docid": "1a704334a8ccb2eabee004aa2fc73d5d", "score": "0.6237997", "text": "function isFilled(field) { \n return field !== undefined && field !== ''; \n}", "title": "" }, { "docid": "a3d8fabb85051f581d977f138ba34d1c", "score": "0.6232056", "text": "validateFormInputs() {\n const fields = this.formFields;\n \n if(!fields || fields.length <= 0 )\n return;\n\n let errors = fields && fields.map((fieldItem) => {\n if(fieldItem.Mandatory === true) {\n\n // Check PP\n if(fieldItem.Type === \"PeoplePicker\") {\n //console.log('TCL: validateFormInputs -> fieldItem PP', fieldItem)\n if(this.validatePeoplePicker(fieldItem.Field_State_Name) === true)\n return false\n else {\n return true;\n }\n\n }\n // Check empty value for text input\n else if(fieldItem.Type === \"Text\" || fieldItem.Type === \"Decimal\" || fieldItem.Type === \"Integer\") {\n //console.log(`TCL: validateFormInputs -> fieldItem.value Text->${fieldItem.Field_State_Name}`, fieldItem.value)\n if(this.state[fieldItem.Field_State_Name] === null || this.state[fieldItem.Field_State_Name] === \"\" ) {\n this.addErrorStatus(fieldItem.Field_State_Name);\n return true;\n }\n else {\n this.removeErrorStatus(fieldItem.Field_State_Name)\n return false;\n } \n \n }\n // Check Combo\n else if(fieldItem.Type === \"Combo\" || fieldItem.Type === \"DynamicField\") {\n //console.log(`TCL: validateFormInputs -> fieldItem.value Copmbo->${fieldItem.Field_State_Name}`, fieldItem.value)\n if(this.state[fieldItem.Field_State_Name].value === \"\" || this.state[fieldItem.Field_State_Name].value === null || this.state[fieldItem.Field_State_Name] === null || this.state[fieldItem.Field_State_Name] === []) {\n this.addErrorStatus(fieldItem.Field_State_Name);\n return true;\n // errors.push( {error : true, field : fieldItem.Field_State_Name})\n }\n else {\n this.removeErrorStatus(fieldItem.Field_State_Name)\n return false;\n } \n \n \n }\n }\n })\n \n\n\n // Check How Many erros Are\n const errorsCount = errors && errors.filter(error=>{return error===true}).length\n\t\t\t\t\t//console.log('TCL: validateFormInputs -> errorsCount', errorsCount)\n\n return errorsCount > 0 ? false : true\n \n }", "title": "" }, { "docid": "aec51a0be1c5d85e760c8c3aa18a283c", "score": "0.6231206", "text": "function validateAll(){\n var condition = (validEmail() && validName() && validChoice() && validNo())//This is only true if all are valid\n if (!condition){\n var textArea = document.getElementsByTagName(\"textarea\")[0];\n textArea.value = \"\";1\n }\n return condition;\n}", "title": "" }, { "docid": "c356bd2ff0298ffd51f34b67d9c32dd0", "score": "0.6213794", "text": "function validateInputFields() {\n var msg = '';\n if ($(\"#txtCode\").val() === \"\") {\n msg += \"O campo 'Código' é obrigatório.\";\n }\n if ($(\"#txtName\").val() === \"\") {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Nome' é obrigatório.\";\n }\n if ($(\"#txtStartDate\").data(\"DateTimePicker\").date() === null) {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Data Inicial' é obrigatório.\";\n }\n if ($(\"#ddlStatus option:selected\").val() === undefined) {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Estado' é obrigatório.\";\n }\n if (msg.length > 0) {\n MessageBox.info(msg);\n return false;\n }\n MessageBox.clear();\n return true;\n }", "title": "" }, { "docid": "8507aac7509c0eb2d66999015617159b", "score": "0.6207803", "text": "function validDiaryEntry() {\n\n var v = document.getElementById(\"input_\").value;\n var w = document.getElementById(\"day_\").value;\n var x = document.getElementById(\"hour_\").value;\n var y = document.getElementById(\"minute_\").value;\n var z = document.getElementById(\"am_pm_\").value;\n\n if (v == \"\" || w == \"\" || x == \"\" || y == \"\" || z == \"\") {\n alert(\"all fields must be completed\");\n return false;\n }\n}", "title": "" }, { "docid": "95bc4bccab7902252167226d3a7b7909", "score": "0.6205261", "text": "validateFormField(field, value) {\n let validEmail = this.state.validEmail\n let validFirstName = this.state.validFirstName\n let validLastName = this.state.validLastName\n let validGpa = this.state.validGpa\n\n switch (field) {\n case 'email':\n validEmail = !!value.match(/^(([^<>()\\[\\]\\\\.,;:\\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,}))$/i)\n break;\n case 'firstName':\n validFirstName = value.length > 0\n break;\n case 'lastName':\n validLastName = value.length > 0\n break;\n case 'gpa':\n validGpa = value >= 0.0 && value <= 10.0\n break;\n default:\n break;\n }\n this.setState({\n validEmail,\n validFirstName,\n validLastName,\n validGpa\n })\n }", "title": "" }, { "docid": "11280e47184022f709252f1ae2d967df", "score": "0.61990607", "text": "function validateField(i) {\r\n\t\tvar res = 0;\r\n\t\tif ( f=this.eleById ) {\r\n\t\t\tif ( ''==f.value ) res=1;\r\n\t\t\telse if ( this.ptnArr[i] && !this.ptnArr[i].test(f.value) ) res=2;\r\n\t\t\tif ( res!=0 && true==this.isValid ) this.isValid = false;\r\n\t\t}\r\n\t\treturn res;\r\n\t}", "title": "" }, { "docid": "cd82d79948d11bad18207ce57878681e", "score": "0.61961997", "text": "function validateFilled() {\n var field, err, valid = true;\n\n field = document.getElementById(\"buy-first_name\");\n err = document.getElementById(\"buy-first_name-err\");\n if(!(field.value.length > 0)) { //If error, write it\n field.classList.add(\"err\");\n err.innerHTML = \"Συμπληρώστε το πεδίο\";\n valid = false;\n }\n else { //Else restore it\n field.classList.remove(\"err\");\n err.innerHTML = \"\";\n }\n\n field = document.getElementById(\"buy-last_name\");\n err = document.getElementById(\"buy-last_name-err\");\n if(!(field.value.length > 0)) {\n field.classList.add(\"err\");\n err.innerHTML = \"Συμπληρώστε το πεδίο\";\n valid = false;\n }\n else {\n field.classList.remove(\"err\");\n err.innerHTML = \"\";\n }\n\n field = document.getElementById(\"buy-email\");\n err = document.getElementById(\"buy-email-err\");\n if(!(field.value.length > 0)) {\n field.classList.add(\"err\");\n err.innerHTML = \"Συμπληρώστε το πεδίο\";\n valid = false;\n }\n //Don't restore error in email and phone as they are being checked by other functions as well\n\n field = document.getElementById(\"buy-dob\");\n err = document.getElementById(\"buy-dob-err\");\n if(!(field.value.length > 0)) {\n field.classList.add(\"err\");\n err.innerHTML = \"Συμπληρώστε το πεδίο\";\n valid = false;\n }\n else {\n field.classList.remove(\"err\");\n err.innerHTML = \"\";\n }\n\n field = document.getElementById(\"buy-phone\");\n err = document.getElementById(\"buy-phone-err\");\n if(!(field.value.length > 0)) {\n field.classList.add(\"err\");\n err.innerHTML = \"Συμπληρώστε το πεδίο\";\n valid = false;\n }\n\n return valid;\n}", "title": "" }, { "docid": "7dacfabdcb720028915dd5587706b85a", "score": "0.6191412", "text": "function validation() {\r\n var name = fI.value;\r\n var lName = lI.value;\r\n var aName = aI.value;\r\n var stName = sI.value;\r\n var cName = cI.value;\r\n\r\n if (name === '' || lName === '' || aName === '' || stName === '' || cName === '') {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "796266626df760b4a15e0e2f81f5e23e", "score": "0.61899334", "text": "function validatedFormNonCredit (){\n let validated = validName() && validEmail() && validActivities(); \n return validated;\n}", "title": "" }, { "docid": "c4bc1f1965b2489e02a0f0e97b935993", "score": "0.6185852", "text": "function checkRequiredFields(obj)\n {\n\t\t \n\t\tvar flag=1;\n \t\t\t$(\"#\"+obj).find('.requiredInput').each(function(index)\n\t\t\t\t{\n \t\t\t\t var inputVal = $(\"#\"+this.id).val();\n \t\t\t\t \n \t\t\t\t if(inputVal.trim()==\"\" || inputVal.trim()==0)\n \t\t\t\t\t{\n \t\t\t\t \t $(\"#\"+this.id).addClass(\"textboxError\");\n\t\t\t\t\t\t\t flag=0;\n \t\t\t\t\t}\n \t\t\t\t});\n\t\t\t\t\n \t\t\t$(\"#\"+obj).find('.requiredTextAreaInput').each(function(index)\n\t\t\t\t{\n \t\t\t\t var inputVal = $(\"#\"+this.id).val();\n \t\t\t\t \n \t\t\t\t if(inputVal.trim()==\"\" || inputVal.trim()==0)\n \t\t\t\t\t{\n \t\t\t\t \t $(\"#\"+this.id).addClass(\"textAreaError\");\n \t\t\t\t\t}\n \t\t\t});\n\t\t\t\t\n\t\t\t\tif(flag==0){\n \t\t\t$().toastmessage('showToast', {\n\t\t\t\t\ttext : 'Please Fill Required Fields',\n\t\t\t\t\tposition : 'top-right',\n\t\t\t\t\tstayTime: 4000,\n\t\t\t\t\ttype : 'error'\n\t\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\treturn true;\n }", "title": "" }, { "docid": "6f45af97a25d8384f6ac61c7a10aa2cc", "score": "0.6179435", "text": "function isAllValid() {\n let allFieldsValid = true\n //check if any of those input fields have empty value or have \"invalid\" class:\n equationCard.find('input[type!=submit]:visible').each(function () {\n //==> !$(this).is(maxIter) to leave max iteration variable as optional.\n // if (($(this).val() == '' && !$(this).is(maxIter)) || $(this).hasClass('invalid')) {\n // allFieldsValid = false;\n // }\n\n //==> if any field that isn't (maxIter) or (err) or (derivative in newton func) is empty then return false:\n if ($(this).val() == '' && !$(this).is(maxIter) && !$(this).is(err) && !$(this).is(diffInput)) {\n allFieldsValid = false\n }\n //==> if both maxIter and err are empty empty then return false:\n else if (err.val() == '' && maxIter.val() == '' && isRootOfPolynomialsMethod) {\n allFieldsValid = false\n } else if ($(this).hasClass('invalid')) {\n allFieldsValid = false\n }\n })\n\n if (allFieldsValid) {\n // calcBtn.removeClass('disabled');\n calcBtn.prop('disabled', false)\n } else {\n // calcBtn.addClass('disabled');\n calcBtn.prop('disabled', true)\n }\n }", "title": "" }, { "docid": "9b178cf44497441b75e4428e85747748", "score": "0.61689967", "text": "function validateValues() {\n if (ctrl.item.kind === 'cron') {\n var scheduleAttribute = lodash.find(ctrl.selectedClass.attributes, { name: 'schedule' });\n var intervalAttribute = lodash.find(ctrl.selectedClass.attributes, { name: 'interval' });\n var intervalInputIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_interval.$viewValue);\n var scheduleInputIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_schedule.$viewValue);\n\n if (intervalInputIsFilled === scheduleInputIsFilled) {\n\n // if interval and schedule fields are filled or they are empty - makes these fields invalid\n ctrl.editItemForm.item_interval.$setValidity('text', false);\n ctrl.editItemForm.item_schedule.$setValidity('text', false);\n } else {\n\n // if interval or schedule filed is filled - makes these fields valid\n ctrl.editItemForm.item_interval.$setValidity('text', true);\n ctrl.editItemForm.item_schedule.$setValidity('text', true);\n scheduleAttribute.allowEmpty = intervalInputIsFilled;\n intervalAttribute.allowEmpty = scheduleInputIsFilled;\n }\n } else if (ctrl.item.kind === 'rabbit-mq') {\n var queueName = lodash.find(ctrl.selectedClass.attributes, { name: 'queueName' });\n var topics = lodash.find(ctrl.selectedClass.attributes, { name: 'topics' });\n var queueNameIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_queueName.$viewValue);\n var topicsIsFilled = !lodash.isEmpty(ctrl.editItemForm.item_topics.$viewValue);\n\n // Queue Name and Topics cannot be both empty at the same time\n // at least one of them should be filled\n // if one of them is filled, the other is allowed to be empty\n queueName.allowEmpty = topicsIsFilled;\n topics.allowEmpty = queueNameIsFilled;\n\n // update validity: if empty is not allowed and value is currently empty - mark invalid, otherwise valid\n ctrl.editItemForm.item_queueName.$setValidity('text', queueName.allowEmpty || queueNameIsFilled);\n ctrl.editItemForm.item_topics.$setValidity('text', topics.allowEmpty || topicsIsFilled);\n }\n }", "title": "" }, { "docid": "0def3cd13c0aadc57216b0c47637285e", "score": "0.6167059", "text": "function checkEmptyValues(){\n if(fname.value===null||fname.value==\"\"||prenom.value===null||prenom.value==\"\"||email.value===null||email.value==\"\"||message.value===null||message.value==\"\"){\n /* error.innerHTML = \"* fields cannot be empty\" */\n error.innerHTML = \"* les champs ne peuvent pas être vides\"\n return false\n }\n else{\n return true\n }\n}", "title": "" }, { "docid": "438e052192d948d7af329fdee12aea68", "score": "0.6166405", "text": "function verifyFieldsSignUp()\n{\n //llama a verificar nombre y apellido\n if(!verifyNameSurname())\n {\n return false;\n }else if(!verifyEmail())//llama a verificar email valido\n {\n return false;\n }else if(!verifyDocument())//llama a verificar documento\n {\n return false;\n }else if(!verifyUserName())//llama a verificar existencia de nombre de usuario\n {\n return false;\n }else if(!verifyPassword())//llama a verificacion de password y largo del mismo\n {\n return false;\n }else {\n return true;//si se cumplen todas las verificaciones se retorna true\n }\n\n}", "title": "" }, { "docid": "a3395854422784349fb6487d67fee997", "score": "0.6165274", "text": "isAnyFieldLeftBlank() {\n return this.state.email === \"\"\n || this.state.password === \"\";\n }", "title": "" }, { "docid": "04487a26447eea6f71918761b85224eb", "score": "0.61597127", "text": "isValid() {\n return (\n this.username.length > 0 &&\n this.emailAddress.length > 0 &&\n this.mobilePhone.length > 0\n );\n }", "title": "" }, { "docid": "1268b8cd688a7fcc3572b14bf419d0f1", "score": "0.61567265", "text": "function isFertilzerValid(data){\n\tlet isValid = true;\n let validationRulesLenghtMoreThan0 = ['name','log','quantity','location','quantityUnit','unit','type','tc','no3','nh4','k2o','p2o5','price','currency'];\n validationRulesLenghtMoreThan0.forEach((rule) =>{\n if(data[rule] && !data[rule].toString().length){\n \tisValid = isValid && false\n }\n });\n return isValid;\n}", "title": "" }, { "docid": "6a4448ab911ecca59933e87ddb5289f2", "score": "0.6154583", "text": "function validate() {\n\t\t\n\t\tvar result = [];\n\t\t\n\t\tvar value = getDataFromForm();\n\t\t\n\t\tif (value.text.length < 1) {\n\t\t result['error'] = 1;\n\t\t result['error_text'] = 'You must fill text field';\n\t\t}\n\t\t\n\t\tif (value.deadline.length < 1) {\n\t\t result['error'] = 1;\n\t\t result['error_deadline'] = 'You must fill deadline field';\n\t\t}\n\t\t\n\t\tif (result['error'] == 1) {\n\t\t return result;\n\t\t} else {\n\t\t return value;\n\t\t}\n\t\n\t }", "title": "" }, { "docid": "892650f1723088e268145356b959f35a", "score": "0.6149137", "text": "function checkvalidity(){\n let travelmediumError=\"\";\n let nameError=\"\";\n let ageError=\"\";\n let mobnoError=\"\";\n let emailError=\"\";\n let genderError=\"\";\n\n if (!passenger.travelmedium) {\n travelmediumError = \"⚠ choose medium\";\n }\n if (!passenger.name) {\n nameError= \"⚠ field can't be empty\";\n }\n if(!passenger.age){\n ageError=\"⚠ empty field\";\n }\n if(!passenger.mobno){\n mobnoError=\"⚠ empty field\";\n }\n if(!passenger.email){\n emailError=\"⚠ empty field\";\n } \n if(!passenger.gender){\n genderError=\"⚠ choose gender\";\n } \n if(travelmediumError||nameError||ageError||mobnoError||emailError||genderError)\n {\n setPassenger({...passenger,travelmediumError,nameError,ageError,mobnoError,emailError,genderError});\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "e484776b771691adfac220b97e8ef017", "score": "0.6148412", "text": "function checkRequired(inputArr) {\r\n inputArr.forEach(function(input) {\r\n \r\n if (input.value.trim() === '') {\r\n showError(input, `${getFieldName(input)} is required`)\r\n }\r\n\r\n else {\r\n showSuccess(input)\r\n }\r\n\r\n\r\n })\r\n}", "title": "" }, { "docid": "ac8ec6ef3a9a8b30f23fc1c376960e38", "score": "0.61479455", "text": "function cheque_fields_validation()\n{\n\tvar docF = define_docF();\n\n\tvar disable_arr = define_disable_array();\n\tvar check_fields;\n\tfor(var i=0; i < disable_arr.length; i++)\n\t{\n\t\tif(docF.mode.value == disable_arr[i])\n\t\t{\n\t\t\tcheck_fields = 0;\n\t\t\tbreak;\n\t\t}\n\t\telse\n\t\t\tcheck_fields = 1;\n\t}\n\tif(check_fields || docF.from_source.value == \"BANK_TRSFR_CASH\")\n\t{\n\t\tif(docF.cdnum.value.length==\"0\" && docF.from_source.value != \"BANK_TRSFR_CASH\")\n\t\t{\n\t\t\talert('Please fill the Cheque/DD Number/CC Offline Transaction No field');\n\t\t\treturn 1;\n\t\t}\n\t\tif(docF.mode.value==\"CHEQUE\" || docF.mode.value==\"DD\" || docF.from_source.value == \"BANK_TRSFR_CASH\")\n\t\t{\n\t\t\tif(docF.cd_day.value.length==\"0\" || docF.cd_month.value.length==\"0\" || docF.cd_year.value.length==\"0\")\n\t\t\t{\n\t\t\t\talert('Please fill the Cheque/DD Date field');\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(docF.cd_city.value.length==\"0\")\n\t\t\t{\n\t\t\t\talert('Please fill the Cheque/DD City field');\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(docF.Bank.value==\"Other\" && docF.obank.value.length==0)\n\t\t\t{\n\t\t\t\talert('Please select a Bank Name or fill the If Other(bank) field');\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t\treturn 0;\n}", "title": "" }, { "docid": "54483ba6f050fbafa0a6d7b7ec2d1ace", "score": "0.61451936", "text": "function check(field, errorMessage) {\n if (field.id === \"car-year\") {\n let fieldNumber = Number(field.value)\n if (fieldNumber >= 1900 && fieldNumber <= now.getFullYear()) {\n markValid(field)\n validity++\n } else {\n markInvalid(field, errorMessage)\n }\n } else if (field.id === \"start-date\") {\n if (isDateTodayorLater(query('#start-date').value)) {\n markValid(field)\n validity++\n } else {\n markInvalid(field, errorMessage)\n }\n } else if (field.id === \"days\") {\n let fieldNumber = Number(field.value)\n if (fieldNumber >= 1 && fieldNumber <= 30) {\n markValid(field)\n validity++\n } else {\n markInvalid(field, errorMessage)\n }\n } else if (field.id === \"credit-card\") {\n if (validateCardNumber(field.value)) {\n markValid(field)\n validity++\n } else {\n markInvalid(field, errorMessage)\n }\n } else if (field.id === \"cvv\") {\n let fieldNumber = Number(field.value)\n if (field.value.length === 3 && !isNaN(fieldNumber)) {\n markValid(field)\n validity++\n } else {\n markInvalid(field, errorMessage)\n }\n } else if (field.id === \"expiration\") {\n let expire = field.value.split('/')\n expire[0] = Number(expire[0])\n expire[1] = Number(expire[1])\n if (expire[1] > (now.getYear() - 100) && expire[0] > 0 && expire[0] < 13) {\n markValid(field)\n validity++\n } else if (expire[1] === (now.getYear() - 100) && expire[0] >= (now.getMonth() + 1) && expire[0] < 13) {\n markValid(field)\n validity++\n } else {\n markInvalid(field, errorMessage)\n }\n } else if (!field.value.trim()) {\n markInvalid(field, errorMessage)\n } else {\n markValid(field)\n validity++\n }\n}", "title": "" }, { "docid": "2a608aaba98bd4ec5e29a35c2a6f6b64", "score": "0.6138786", "text": "function validate(fields, files) {\n let isValid = true;\n\n if (fields.NAME === null || validator.isEmpty(fields.NAME)) {\n isValid = false;\n }\n\n if (fields.WEIGHT === null || validator.isEmpty(fields.WEIGHT) || !validator.isNumeric(fields.WEIGHT)) {\n isValid = false;\n }\n\n if (fields.LENGTH === null || validator.isEmpty(fields.LENGTH) || !validator.isNumeric(fields.LENGTH)) {\n isValid = false;\n }\n\n if (fields.LATITUDE === null || validator.isEmpty(fields.LATITUDE)) {\n isValid = false;\n }\n\n if (fields.LONGITUDE === null || validator.isEmpty(fields.LONGITUDE)) {\n isValid = false;\n }\n\n if (fields.USERNAME === null || validator.isEmpty(fields.USERNAME)) {\n isValid = false;\n }\n\n if (files === null || files === undefined || files.IMAGE === null || files.IMAGE === undefined) {\n isValid = false;\n }\n\n return isValid;\n}", "title": "" } ]
4c083f86a740aee403499b7bfb4bdc44
show experience based on value of currentItem
[ { "docid": "88f86ff2acbf55c67d157d351094afdb", "score": "0.71590954", "text": "function showExperience(){\r\n const item=experience[currentItem];\r\n img.src=item.img;\r\n name.textContent=item.name;\r\n job.textContent=item.job;\r\n info.textContent=item.text;\r\n }", "title": "" } ]
[ { "docid": "e0a42a7dbcb486cc75ed97ce961218b4", "score": "0.58403236", "text": "renderExperience(i, dataA) {\n const data = dataA[i]; \n return (\n <div>\n <ListItem disabled={true}\n leftIcon={<ContentSend/>} initiallyOpen={true}>\n {this.experienceText(data)}\n </ListItem>\n <Divider /></div>)\n }", "title": "" }, { "docid": "54b6490856ea94ec9e12dc1d40a07fe9", "score": "0.5829816", "text": "function itemImpediment() {\n var selectedCell = ss.getActiveCell().getA1Notation();\n var item = Kanban.getItemByCell(selectedCell);\n Kanban.setImpediment(item);\n}", "title": "" }, { "docid": "617562a7d34e975c0a5f79a5ed820919", "score": "0.5807485", "text": "showProgression(){\n document.getElementById(\"level\").innerHTML = \"Level: \" + this.level;\n document.getElementById(\"experience\").innerHTML = \"Experience: \" + this.experience + \" / \" + this.experienceNeeded;\n }", "title": "" }, { "docid": "694686f7159c72ca2dfe57098b7f4894", "score": "0.5771786", "text": "function lookAtItem(item) {\n\tif (guide[item].room === guide.room || guide[item].room === 'inventory') {\n\t\tsetPrior();\n\t\tdisplayText = guide[item].description;\n\t\tsetCurrent();\n\t\tif (item === 'bed') {\n\t\t\tguide.pillow.seen = true;\n\t\t\tguide.blanket.seen = true;\n\t\t} else if (item === 'night stand') {\n\t\t\tguide.book.seen = true;\n\t\t} else if (item === 'book') {\n\t\t\tguide['number lock'].seen = true;\n\t\t} else if (item === 'desk') {\n\t\t\tguide['desk drawer'].seen = true;\n\t\t\tguide.poem.seen = true;\n\t\t} else if (item === 'dresser') {\n\t\t\tguide['top drawer'].seen = true;\n\t\t\tguide['bottom drawer'].seen = true;\n\t\t} else if (item === 'sink') {\n\t\t\tguide.cabinet.seen = true;\n\t\t\tguide.candle.seen = true;\n\t\t} else if (item === 'tub') {\n\t\t\tguide['tub nozzle'].seen = true;\n\t\t\tguide['shower nozzle'].seen = true;\n\t\t\tguide.diverter.seen = true;\n\t\t} else if (item === 'wastebin') {\n\t\t\tguide.ribbon.seen = true;\n\t\t}\n\t\tdisplaySeen();\n\t} else {\n\t\twrongRoomError();\n\t}\n}", "title": "" }, { "docid": "db9a1759d996f0f6b2489c59ac401944", "score": "0.56594115", "text": "function showCurrentItem(currentIndex){\n\t\tminiCurrentItem=$('.miniSlider>div>span').eq(miniCurrentIndex);\n\t\tminiItems.hide();\n\t\tminiCurrentItem.show();\n\t\tif(!(miniCurrentItem.hasClass('anim'))){\n\t\t\tminiCurrentItem.addClass('anim');\n\t\t}\n\t}", "title": "" }, { "docid": "5b85662bad69804097a9136baad5aee3", "score": "0.5650752", "text": "_potion_life(){\n var quantity=50;\n var items=this.state.items;\n items['player'].stats.life=(items['player'].stats.life+quantity>items['player'].stats.totalLife?items['player'].stats.totalLife:items['player'].stats.life+quantity);\n this.setState({items:items});\n }", "title": "" }, { "docid": "bd3a69142c44e6fbcff3f3069e53115d", "score": "0.56211066", "text": "displayItemHealth() {\n let flashlight = this.getInventoryItem('flashlight');\n\n if (flashlight != null &&\n flashlight.life < 50) {\n console.log('Your flashlight batteries are low! ' + flashlight.life + '% power left!');\n console.log('Start looking for batteries soon or you\\'ll find no escape!');\n }\n }", "title": "" }, { "docid": "d8bda9a81a983a38a5a75a6724b8f1c3", "score": "0.5601468", "text": "function showVacancy(item) {\n $(\"#title_text\").text(item.title);\n $(\"#v_i_text\").text(item.type_job);\n $(\"#experience_text\").text(\"More than \" + item.experience + \" years\");\n $(\"#department_text\").text(item.department);\n $(\"#level_text\").text(item.career_level);\n $(\"#type_text\").text(item.type_time);\n $(\"#short_desc_text\").text(item.short_description);\n $(\"#desc_text\").html(item.description);\n}", "title": "" }, { "docid": "6cbccfd6e38673da907b2d8579f323b7", "score": "0.55325663", "text": "function showItem(){\n const item = images[currentItem];\n img.src = item.img;\n}", "title": "" }, { "docid": "c2de301b6f1846ec76cc5d1aec7c98b7", "score": "0.5518128", "text": "function displayItem() {\n\tconst incomeList = document.getElementById('incomeList');\n\tconst expensesList = document.getElementById('expensesList');\n\n\tincomeList.innerHTML = '<li>INCOME</li>';\n\texpensesList.innerHTML = '<li>EXPENSES</li>';\n\n\tif (data.length === 0) {\n\t\tupdateAmount();\n\t}\n\n\tdata.map((item) => {\n\t\tif (item.state === 'Income' && item.desc !== '' && isNaN(item.desc) && item.value !== '' && item.value > 0) {\n\t\t\tincomeList.innerHTML += `\n\t\t\t<li class='itemList' id='${item.id}'><p class='incomeListDesc'>${item.desc}</p><p class=\"incomeListValue\">${item.value}</p><i class=\"far fa-trash-alt incomeListButton\" onclick=\"removeItem(event)\"></i></li>\n\t\t\t`;\n\t\t} else if (\n\t\t\titem.state === 'Expenses' &&\n\t\t\titem.desc !== '' &&\n\t\t\tisNaN(item.desc) &&\n\t\t\titem.value !== '' &&\n\t\t\titem.value > 0\n\t\t) {\n\t\t\texpensesList.innerHTML += `\n\t\t\t<li class='itemList' id='${item.id}'><p class=\"expensesListDesc\">${item.desc}</p><p class=\"expensesListValue\">${item.value *\n\t\t\t\t-1}</p><i onclick=\"removeItem(event)\" class=\"far fa-trash-alt expensesListButton\"></i></li>\n\t\t\t`;\n\t\t}\n\t\tupdateAmount();\n\t});\n}", "title": "" }, { "docid": "574582009557b6471af1c7a19e74a60f", "score": "0.5489855", "text": "static displayExpense() {\n const expenses = Store.getExpense();\n\n expenses.forEach(expense => {\n UI.addExpenseToList(expense);\n });\n }", "title": "" }, { "docid": "ac5706c572c1eba8d7d929c40a3a7756", "score": "0.5485224", "text": "function addExp(context) {\n \"use strict\";\n\n context.points.earned = Math.round(context.points.earned);\n var pointsTop = Math.round(context.points.earned / context.points.possible * 100);\n\n context.experience = {\n pointsTop: context.points.earned,\n pointsBot: context.points.possible,\n width: makeWidth(context.points.earned, context.points.possible, constant.BARS_LEFT, constant.BARS_RIGHT)\n };\n }", "title": "" }, { "docid": "ed42bf4eb03adca8fe6f7cdc431c1729", "score": "0.5423509", "text": "function SetMilestone(playerSkills, lowestSkill) {\n if (playerSkills[19].level == 120 && playerSkills[25].level == 120 && playerSkills[27].level == 120) {\n milestone = \"Max Total\";\n } else if (lowestSkill == 99) {\n milestone = \"Maxed\";\n } else if (lowestSkill == 1) {\n milestone = \"1\";\n } else {\n milestone = Math.floor(lowestSkill / 10) * 10;\n }\n document.getElementById(\"milestone\").innerText = milestone;\n}", "title": "" }, { "docid": "05d077e4e03b3a698b900ece25f2b9e0", "score": "0.54207414", "text": "function updateItemInterface(item) {\n\tdocument.getElementById(item.name + \"Cost\").innerHTML = addCommas(prettyBigNumber(item.cost()));\n\tdocument.getElementById(item.name + \"Number\").innerHTML = item.number;\n\t\n\t\n\tif(item.cost()<=roundGold && totalItemsOwned < maxItemsNumber){ // cost must turn red if gold isn't enough or if you already have 6 items.\n\tdocument.getElementById(item.name + \"Cost\").style.color = \"green\";\n\t}\n\telse{\n\tdocument.getElementById(item.name + \"Cost\").style.color = \"red\";\n\t}\n}", "title": "" }, { "docid": "b4cab16bac9ee8c5d23cee9c1e2d5344", "score": "0.5399973", "text": "function calculateExp(skillName, expGained){\r\n skillName.exp += expGained;\r\n var a;\r\n for(a in skillExp){\r\n a = parseInt(a);\r\n if(skillExp[a] <= skillName.exp){\r\n skillName.lvl = a;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "24fae164acf7007fed38e7d6d187a490", "score": "0.5393522", "text": "function calculateExp(skillName, expGained){\r\n skillName.exp += expGained;\r\n var a;\r\n for(a in skillExp){\r\n a = parseInt(a);\r\n if(skillExp[a] <= skillName.exp){\r\n skillName.lvl = a;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "09bb8f8da9cf35f5e188a4d29bd68d80", "score": "0.53408045", "text": "function positiveReact(item) {\n let namedPet = $(\"#nameInput\").val();\n\n // happy face\n document.getElementById(\"eyes\").src = \"assets/images/eye1.png\";\n //Return to neutral eyes after a second\n setTimeout(function() {\n document.getElementById(\"eyes\").src = \"assets/images/eye0.png\";\n }, 1000); //1 seconds\n\n // update text log (happy)\n $(\"#log\").append(namedPet + \" liked the \" + item.value + \"!<br>\");\n updateScroll();\n updateBar();\n\n}", "title": "" }, { "docid": "d7ac9bb7cef48c53e8f189d8e575c4c4", "score": "0.53382564", "text": "function itemDetails( buf, /* item */ theItem) {\n\tconst buf2 = STRING(), buf3 = STRING(), theName = STRING(), goodColorEscape = STRING(), badColorEscape = STRING(), whiteColorEscape = STRING();\n\tlet singular, carried;\n\tlet enchant;\n\tlet nextLevelState = 0, newValue;\n\tlet accuracyChange, damageChange, current, currentDamage, newDamage;\n\n\tencodeMessageColor(goodColorEscape, 0, goodMessageColor);\n\tencodeMessageColor(badColorEscape, 0, badMessageColor);\n\tencodeMessageColor(whiteColorEscape, 0, white);\n\n\tsingular = (theItem.quantity == 1 ? true : false);\n\tcarried = itemIsCarried(theItem);\n\n\t// Name\n\titemName(theItem, theName, true, true, NULL);\n\tencodeMessageColor(buf, 0, itemMessageColor);\n\tcapitalize(theName);\n\tstrcat(buf, theName);\n\tif (carried) {\n\t\tsprintf(buf2, \" (%c)\", theItem.inventoryLetter);\n\t\tstrcat(buf, buf2);\n\t}\n\tencodeMessageColor(buf2, 0, white);\n\tstrcat(buf, buf2);\n\tstrcat(buf, \"\\n\\n\");\n\n\tenchant = fp_netEnchant(theItem);\n\titemName(theItem, theName, false, false, NULL);\n\n\t// introductory text\n const itemTable = tableForItemCategory(theItem.category, NULL);\n\tif (itemTable && (itemTable[theItem.kind].identified || rogue.playbackOmniscience))\n {\n\t\tstrcat(buf, tableForItemCategory(theItem.category, NULL)[theItem.kind].description);\n\n if (theItem.category == POTION && theItem.kind == POTION_LIFE) {\n\t\t\tsprintf(buf2, \"\\n\\nIt will increase your maximum health by %s%i%%s.\",\n\t\t\t\t\t\t\tgoodColorEscape,\n\t\t\t\t\t\t\tMath.floor((player.info.maxHP + 10) * 100 / player.info.maxHP - 100),\n\t\t\t\t\t\t\twhiteColorEscape);\n\t\t\tstrcat(buf, buf2);\n }\n\t} else {\n\t\tswitch (theItem.category) {\n\t\t\tcase POTION:\n\t\t\t\tsprintf(buf2, \"%s flask%s contain%s a swirling %s liquid. Who knows what %s will do when drunk or thrown?\",\n\t\t\t\t\t\t(singular ? \"This\" : \"These\"),\n\t\t\t\t\t\t(singular ? \"\" : \"s\"),\n\t\t\t\t\t\t(singular ? \"s\" : \"\"),\n\t\t\t\t\t\titemTable[theItem.kind].flavor,\n\t\t\t\t\t\t(singular ? \"it\" : \"they\"));\n\t\t\t\tbreak;\n\t\t\tcase SCROLL:\n\t\t\t\tsprintf(buf2, \"%s parchment%s %s covered with indecipherable writing, and bear%s a title of \\\"%s.\\\" Who knows what %s will do when read aloud?\",\n\t\t\t\t\t\t(singular ? \"This\" : \"These\"),\n\t\t\t\t\t\t(singular ? \"\" : \"s\"),\n\t\t\t\t\t\t(singular ? \"is\" : \"are\"),\n\t\t\t\t\t\t(singular ? \"s\" : \"\"),\n\t\t\t\t\t\titemTable[theItem.kind].flavor,\n\t\t\t\t\t\t(singular ? \"it\" : \"they\"));\n\t\t\t\tbreak;\n\t\t\tcase STAFF:\n\t\t\t\tsprintf(buf2, \"This gnarled %s staff is warm to the touch. Who knows what it will do when used?\",\n\t\t\t\t\t\titemTable[theItem.kind].flavor);\n\t\t\t\tbreak;\n\t\t\tcase WAND:\n\t\t\t\tsprintf(buf2, \"This thin %s wand is warm to the touch. Who knows what it will do when used?\",\n\t\t\t\t\t\titemTable[theItem.kind].flavor);\n\t\t\t\tbreak;\n\t\t\tcase RING:\n\t\t\t\tsprintf(buf2, \"This metal band is adorned with a%s %s gem that glitters in the darkness. Who knows what effect it has when worn? \",\n isVowelish(itemTable[theItem.kind].flavor) ? \"n\" : \"\",\n\t\t\t\t\t\titemTable[theItem.kind].flavor);\n\t\t\t\tbreak;\n\t\t\tcase CHARM: // Should never be displayed.\n\t\t\t\tstrcat(buf2, \"What a perplexing charm!\");\n\t\t\t\tbreak;\n\t\t\tcase AMULET:\n\t\t\t\tstrcpy(buf2, \"Legends are told about this mysterious golden amulet, and legions of adventurers have perished in its pursuit. Unfathomable riches await anyone with the skill and ambition to carry it into the light of day.\");\n\t\t\t\tbreak;\n\t\t\tcase GEM:\n\t\t\t\tsprintf(buf2, \"Faint golden lights swirl and fluoresce beneath the stone%s surface. Lumenstones are said to contain mysterious properties of untold power, but for you, they mean one thing: riches.\",\n\t\t\t\t\t\t(singular ? \"'s\" : \"s'\"));\n\t\t\t\tbreak;\n\t\t\tcase KEY:\n\t\t\t\tstrcpy(buf2, keyTable[theItem.kind].description);\n\t\t\t\tbreak;\n\t\t\tcase GOLD:\n\t\t\t\tsprintf(buf2, \"A pile of %i shining gold coins.\", theItem.quantity);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tstrcat(buf, buf2);\n\t}\n\n if (carried && theItem.originDepth > 0) {\n sprintf(buf2, \" (You found %s on depth %i.) \",\n singular ? \"it\" : \"them\",\n theItem.originDepth);\n\t\t\tstrcat(buf, buf2);\n }\n\n\t// detailed description\n\tswitch (theItem.category) {\n\n\t\tcase FOOD:\n\t\t\tsprintf(buf2, \"\\n\\nYou are %shungry enough to fully enjoy a %s.\",\n\t\t\t\t\t((STOMACH_SIZE - player.status[STATUS_NUTRITION]) >= foodTable[theItem.kind].strengthRequired ? \"\" : \"not yet \"),\n\t\t\t\t\tfoodTable[theItem.kind].name);\n\t\t\tstrcat(buf, buf2);\n\t\t\tbreak;\n\n\t\tcase WEAPON:\n\t\tcase ARMOR:\n\t\t\t// enchanted? strength modifier?\n\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\tif (theItem.enchant1) {\n if (theItem.enchant1 > 0) {\n sprintf(buf2, \"\\n\\nThe %s bear%s an intrinsic enchantment of %s+%i%s\",\n theName,\n (singular ? \"s\" : \"\"),\n goodColorEscape,\n theItem.enchant1,\n whiteColorEscape);\n } else {\n sprintf(buf2, \"\\n\\nThe %s bear%s an intrinsic penalty of %s%i%s\",\n theName,\n (singular ? \"s\" : \"\"),\n badColorEscape,\n theItem.enchant1,\n whiteColorEscape);\n }\n\t\t\t\t} else {\n\t\t\t\t\tsprintf(buf2, \"\\n\\nThe %s bear%s no intrinsic enchantment\",\n\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t(singular ? \"s\" : \"\"));\n\t\t\t\t}\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t\tif (fp_strengthModifier(theItem)) {\n\t\t\t\t\tsprintf(buf2, \", %s %s %s %s%s%{f,2}%s because of your %s strength. \",\n\t\t\t\t\t\t\t(theItem.enchant1 ? \"and\" : \"but\"),\n\t\t\t\t\t\t\t(singular ? \"carries\" : \"carry\"),\n\t\t\t\t\t\t\t(theItem.enchant1 && (theItem.enchant1 > 0) == (fp_strengthModifier(theItem) > 0) ? \"an additional\" : \"a\"),\n\t\t\t\t\t\t\t(fp_strengthModifier(theItem) > 0 ? \"bonus of +\" : \"penalty of \"),\n (fp_strengthModifier(theItem) > 0 ? goodColorEscape : badColorEscape),\n\t\t\t\t\t\t\tMath.floor(fp_strengthModifier(theItem) / FP_FACTOR),\n whiteColorEscape,\n\t\t\t\t\t\t\t(fp_strengthModifier(theItem) > 0 ? \"excess\" : \"inadequate\"));\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t} else {\n\t\t\t\t\tstrcat(buf, \". \");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((theItem.enchant1 > 0) && (theItem.flags & ITEM_MAGIC_DETECTED)) {\n\t\t\t\t\tsprintf(buf2, \"\\n\\nYou can feel an %saura of benevolent magic%s radiating from the %s. \",\n goodColorEscape,\n whiteColorEscape,\n\t\t\t\t\t\t\ttheName);\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t}\n\t\t\t\tif (fp_strengthModifier(theItem)) {\n\t\t\t\t\tsprintf(buf2, \"\\n\\nThe %s %s%s a %s%s%{f,2}%s because of your %s strength. \",\n\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t((theItem.enchant1 > 0) && (theItem.flags & ITEM_MAGIC_DETECTED) ? \"also \" : \"\"),\n\t\t\t\t\t\t\t(singular ? \"carries\" : \"carry\"),\n\t\t\t\t\t\t\t(fp_strengthModifier(theItem) > 0 ? \"bonus of +\" : \"penalty of \"),\n (fp_strengthModifier(theItem) > 0 ? goodColorEscape : badColorEscape),\n\t\t\t\t\t\t\tMath.floor(fp_strengthModifier(theItem) / FP_FACTOR),\n whiteColorEscape,\n\t\t\t\t\t\t\t(fp_strengthModifier(theItem) > 0 ? \"excess\" : \"inadequate\"));\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t}\n\n\t\t\t\tif (theItem.category & WEAPON) {\n\t\t\t\t\tsprintf(buf2, \"It will reveal its secrets if you defeat %i%s %s with it. \",\n\t\t\t\t\t\t\ttheItem.charges,\n\t\t\t\t\t\t\t(theItem.charges == WEAPON_KILLS_TO_AUTO_ID ? \"\" : \" more\"),\n\t\t\t\t\t\t\t(theItem.charges == 1 ? \"enemy\" : \"enemies\"));\n\t\t\t\t} else {\n\t\t\t\t\tsprintf(buf2, \"It will reveal its secrets if worn for %i%s turn%s. \",\n\t\t\t\t\t\t\ttheItem.charges,\n\t\t\t\t\t\t\t(theItem.charges == ARMOR_DELAY_TO_AUTO_ID ? \"\" : \" more\"),\n\t\t\t\t\t\t\t(theItem.charges == 1 ? \"\" : \"s\"));\n\t\t\t\t}\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t}\n\n\t\t\t// Display the known percentage by which the armor/weapon will increase/decrease accuracy/damage/defense if not already equipped.\n\t\t\tif (!(theItem.flags & ITEM_EQUIPPED)) {\n\t\t\t\tif (theItem.category & WEAPON) {\n\t\t\t\t\tcurrent = player.info.accuracy;\n\t\t\t\t\tif (rogue.weapon) {\n currentDamage = Math.floor((rogue.weapon.damage.lowerBound + rogue.weapon.damage.upperBound << FP_BASE) / 2);\n\t\t\t\t\t\tif ((rogue.weapon.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\t\tcurrent = current * fp_accuracyFraction(fp_netEnchant(rogue.weapon)) >> FP_BASE;\n\t\t\t\t\t\t\tcurrentDamage = currentDamage * fp_damageFraction(fp_netEnchant(rogue.weapon)) >> FP_BASE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcurrent = current * fp_accuracyFraction(fp_strengthModifier(rogue.weapon)) >> FP_BASE;\n\t\t\t\t\t\t\tcurrentDamage = currentDamage * fp_damageFraction(fp_strengthModifier(rogue.weapon)) >> FP_BASE;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n currentDamage = Math.floor((player.info.damage.lowerBound + player.info.damage.upperBound << FP_BASE) / 2);\n }\n\n\t\t\t\t\tnewValue = player.info.accuracy;\n\t\t\t\t\tnewDamage = Math.floor((theItem.damage.lowerBound + theItem.damage.upperBound << FP_BASE) / 2);\n\t\t\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\tnewValue = newValue * fp_accuracyFraction(fp_netEnchant(theItem)) >> FP_BASE;\n\t\t\t\t\t\tnewDamage = newDamage * fp_damageFraction(fp_netEnchant(theItem)) >> FP_BASE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewValue = newValue * fp_accuracyFraction(fp_strengthModifier(theItem)) >> FP_BASE;\n\t\t\t\t\t\tnewDamage = newDamage * fp_damageFraction(fp_strengthModifier(theItem)) >> FP_BASE;\n\t\t\t\t\t}\n\t\t\t\t\taccuracyChange\t= Math.floor(newValue * 100 / current) - 100;\n\t\t\t\t\tdamageChange\t= Math.floor(newDamage * 100 / currentDamage) - 100;\n\t\t\t\t\tsprintf(buf2, \"Wielding the %s%s will %s your current accuracy by %s%i%%s, and will %s your current damage by %s%i%%s. \",\n\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) ? \"\" : \", assuming it has no hidden properties,\",\n\t\t\t\t\t\t\t((accuracyChange) < 0) ? \"decrease\" : \"increase\",\n ((accuracyChange) < 0) ? badColorEscape : (accuracyChange > 0 ? goodColorEscape : \"\"),\n\t\t\t\t\t\t\tabs(accuracyChange),\n whiteColorEscape,\n\t\t\t\t\t\t\t((damageChange) < 0) ? \"decrease\" : \"increase\",\n ((damageChange) < 0) ? badColorEscape : (damageChange > 0 ? goodColorEscape : \"\"),\n\t\t\t\t\t\t\tabs(damageChange),\n whiteColorEscape);\n\t\t\t\t} else {\n\t\t\t\t\tnewValue = theItem.armor;\n\t\t\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\tnewValue += 10 * fp_netEnchant(theItem) >> FP_BASE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewValue += 10 * fp_strengthModifier(theItem) >> FP_BASE;\n\t\t\t\t\t}\n\t\t\t\t\tnewValue = max(0, newValue);\n newValue = Math.floor(newValue / 10);\n\t\t\t\t\tsprintf(buf2, \"Wearing the %s%s will result in an armor rating of %s%i%s. \",\n\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) ? \"\" : \", assuming it has no hidden properties,\",\n (newValue > displayedArmorValue() ? goodColorEscape : (newValue < displayedArmorValue() ? badColorEscape : whiteColorEscape)),\n\t\t\t\t\t\t\tMath.floor(newValue),\n whiteColorEscape);\n\t\t\t\t}\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t}\n\n\t\t\t// protected?\n\t\t\tif (theItem.flags & ITEM_PROTECTED) {\n\t\t\t\tsprintf(buf2, \"%sThe %s cannot be corroded by acid.%s \",\n goodColorEscape,\n\t\t\t\t\t\ttheName,\n whiteColorEscape);\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t}\n\n\t\t\t// heavy armor?\n current = armorAggroAdjustment(rogue.armor);\n\t\t\tif ((theItem.category & ARMOR)\n && !(theItem.flags & ITEM_EQUIPPED)\n && (current != armorAggroAdjustment(theItem)))\n {\n newValue = armorAggroAdjustment(theItem);\n if (rogue.armor) {\n newValue -= armorAggroAdjustment(rogue.armor);\n }\n\t\t\t\tsprintf(buf2, \"Equipping the %s will %s%s your stealth range by %i%s. \",\n\t\t\t\t\t\ttheName,\n newValue > 0 ? badColorEscape : goodColorEscape,\n newValue > 0 ? \"increase\" : \"decrease\",\n abs(newValue),\n whiteColorEscape);\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t}\n\n\t\t\tif (theItem.category & WEAPON) {\n\n\t\t\t\t// runic?\n\t\t\t\tif (theItem.flags & ITEM_RUNIC) {\n\t\t\t\t\tif ((theItem.flags & ITEM_RUNIC_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\tsprintf(buf2, \"\\n\\nGlowing runes of %s adorn the %s. \",\n\t\t\t\t\t\t\t\tweaponRunicNames[theItem.enchant2],\n\t\t\t\t\t\t\t\ttheName);\n\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\tif (theItem.enchant2 == W_SLAYING) {\n describeMonsterClass(buf3, theItem.vorpalEnemy, false);\n\t\t\t\t\t\t\tsprintf(buf2, \"It will never fail to slay a%s %s in a single stroke. \",\n (isVowelish(buf3) ? \"n\" : \"\"),\n\t\t\t\t\t\t\t\t\tbuf3);\n\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t} else if (theItem.enchant2 == W_MULTIPLICITY) {\n\t\t\t\t\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\t\t\tsprintf(buf2, \"%i% of the time that it hits an enemy, %i spectral %s%s will spring into being with accuracy and attack power equal to your own, and will dissipate %i turns later. (If the %s is enchanted, %i image%s will appear %i% of the time, and will last %i turns.)\",\n\t\t\t\t\t\t\t\t\t\trunicWeaponChance(theItem, false, 0),\n\t\t\t\t\t\t\t\t\t\tfp_weaponImageCount(enchant),\n\t\t\t\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t\t\t\t(fp_weaponImageCount(enchant) > 1 ? \"s\" : \"\"),\n\t\t\t\t\t\t\t\t\t\tfp_weaponImageDuration(enchant),\n\t\t\t\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t\t\t\tfp_weaponImageCount(enchant + fp_enchantIncrement(theItem)),\n\t\t\t\t\t\t\t\t\t\t(fp_weaponImageCount(enchant + fp_enchantIncrement(theItem)) > 1 ? \"s\" : \"\"),\n\t\t\t\t\t\t\t\t\t\trunicWeaponChance(theItem, true, enchant + fp_enchantIncrement(theItem)),\n\t\t\t\t\t\t\t\t\t\tfp_weaponImageDuration(enchant + fp_enchantIncrement(theItem)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsprintf(buf2, \"Sometimes, when it hits an enemy, spectral %ss will spring into being with accuracy and attack power equal to your own, and will dissipate shortly thereafter.\",\n\t\t\t\t\t\t\t\t\t\ttheName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n if (runicWeaponChance(theItem, false, 0) < 2\n && rogue.strength - player.weaknessAmount < theItem.strengthRequired)\n {\n\t\t\t\t\t\t\t\t\tstrcpy(buf2, \"Its runic effect will almost never activate because of your inadequate strength, but sometimes, when\");\n } else {\n\t\t\t\t\t\t\t\t\tsprintf(buf2, \"%i% of the time that\",\n\t\t\t\t\t\t\t\t\t\t\t\t\trunicWeaponChance(theItem, false, 0));\n }\n\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstrcat(buf, \"Sometimes, when\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsprintf(buf2, \" it hits an enemy, %s\",\n\t\t\t\t\t\t\t\t\tweaponRunicEffectDescriptions[theItem.enchant2]);\n\t\t\t\t\t\t\tstrcat(buf, buf2);\n\n\t\t\t\t\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\t\t\tswitch (theItem.enchant2) {\n\t\t\t\t\t\t\t\t\tcase W_SPEED:\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, \". \");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase W_PARALYSIS:\n\t\t\t\t\t\t\t\t\t\tsprintf(buf2, \" for %i turns. \",\n\t\t\t\t\t\t\t\t\t\t\t\t(fp_weaponParalysisDuration(enchant)));\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\t\tnextLevelState = Math.floor(fp_weaponParalysisDuration(enchant + fp_enchantIncrement(theItem)));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase W_SLOWING:\n\t\t\t\t\t\t\t\t\t\tsprintf(buf2, \" for %i turns. \",\n\t\t\t\t\t\t\t\t\t\t\t\tfp_weaponSlowDuration(enchant));\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\t\tnextLevelState = fp_weaponSlowDuration(enchant + fp_enchantIncrement(theItem));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase W_CONFUSION:\n\t\t\t\t\t\t\t\t\t\tsprintf(buf2, \" for %i turns. \",\n\t\t\t\t\t\t\t\t\t\t\t\tfp_weaponConfusionDuration(enchant));\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\t\tnextLevelState = fp_weaponConfusionDuration(enchant + fp_enchantIncrement(theItem));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase W_FORCE:\n\t\t\t\t\t\t\t\t\t\tsprintf(buf2, \" up to %i spaces backward. If the enemy hits an obstruction, it (and any monster it hits) will take damage in proportion to the distance it flew. \",\n\t\t\t\t\t\t\t\t\t\t\t\tfp_weaponForceDistance(enchant));\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\t\tnextLevelState = fp_weaponForceDistance(enchant + fp_enchantIncrement(theItem));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase W_MERCY:\n\t\t\t\t\t\t\t\t\t\tstrcpy(buf2, \" by 50% of its maximum health. \");\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tstrcpy(buf2, \". \");\n\t\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience)\n\t\t\t\t\t\t\t\t\t&& runicWeaponChance(theItem, false, 0) < runicWeaponChance(theItem, true, (enchant + fp_enchantIncrement(theItem))))\n {\n\t\t\t\t\t\t\t\t\tsprintf(buf2, \"(If the %s is enchanted, the chance will increase to %i%\",\n\t\t\t\t\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t\t\t\t\trunicWeaponChance(theItem, true, (enchant + fp_enchantIncrement(theItem))));\n\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t\tif (nextLevelState) {\n if (theItem.enchant2 == W_FORCE) {\n sprintf(buf2, \" and the distance will increase to %i.)\",\n nextLevelState);\n } else {\n sprintf(buf2, \" and the duration will increase to %i turns.)\",\n nextLevelState);\n }\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstrcpy(buf2, \".)\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstrcat(buf, \". \");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if (theItem.flags & ITEM_IDENTIFIED) {\n\t\t\t\t\t\tsprintf(buf2, \"\\n\\nGlowing runes of an indecipherable language run down the length of the %s. \",\n\t\t\t\t\t\t\t\ttheName);\n\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// equipped? cursed?\n\t\t\t\tif (theItem.flags & ITEM_EQUIPPED) {\n\t\t\t\t\tsprintf(buf2, \"\\n\\nYou hold the %s at the ready%s. \",\n\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t((theItem.flags & ITEM_CURSED) ? \", and because it is cursed, you are powerless to let go\" : \"\"));\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t} else if (((theItem.flags & (ITEM_IDENTIFIED | ITEM_MAGIC_DETECTED)) || rogue.playbackOmniscience)\n\t\t\t\t\t\t && (theItem.flags & ITEM_CURSED))\n {\n\t\t\t\t\tsprintf(buf2, \"\\n\\n%sYou can feel a malevolent magic lurking within the %s.%s \",\n badColorEscape,\n theName,\n whiteColorEscape);\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t}\n\n\t\t\t} else if (theItem.category & ARMOR) {\n\n\t\t\t\t// runic?\n\t\t\t\tif (theItem.flags & ITEM_RUNIC) {\n\t\t\t\t\tif ((theItem.flags & ITEM_RUNIC_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\t\t\tsprintf(buf2, \"\\n\\nGlowing runes of %s adorn the %s. \",\n\t\t\t\t\t\t\t\tarmorRunicNames[theItem.enchant2],\n\t\t\t\t\t\t\t\ttheName);\n\t\t\t\t\t\tstrcat(buf, buf2);\n\n\t\t\t\t\t\t// A_MULTIPLICITY, A_MUTUALITY, A_ABSORPTION, A_REPRISAL, A_IMMUNITY, A_REFLECTION, A_BURDEN, A_VULNERABILITY, A_IMMOLATION\n\t\t\t\t\t\tswitch (theItem.enchant2) {\n\t\t\t\t\t\t\tcase A_MULTIPLICITY:\n\t\t\t\t\t\t\t\tsprintf(buf2, \"When worn, 33% of the time that an enemy's attack connects, %i allied spectral duplicate%s of your attacker will appear for 3 turns. \",\n\t\t\t\t\t\t\t\t\t\tfp_armorImageCount(enchant),\n\t\t\t\t\t\t\t\t\t\t(fp_armorImageCount(enchant) == 1 ? \"\" : \"s\"));\n\t\t\t\t\t\t\t\tif (fp_armorImageCount(enchant + fp_enchantIncrement(theItem)) > fp_armorImageCount(enchant)) {\n\t\t\t\t\t\t\t\t\tsprintf(buf3, \"(If the %s is enchanted, the number of duplicates will increase to %i.) \",\n\t\t\t\t\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t\t\t\t\t(fp_armorImageCount(enchant + fp_enchantIncrement(theItem))));\n\t\t\t\t\t\t\t\t\tstrcat(buf2, buf3);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase A_MUTUALITY:\n\t\t\t\t\t\t\t\tstrcpy(buf2, \"When worn, the damage that you incur from physical attacks will be split evenly among yourself and all other adjacent enemies. \");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase A_ABSORPTION:\n if (theItem.flags & ITEM_IDENTIFIED) {\n sprintf(buf2, \"It will reduce the damage of inbound attacks by a random amount between 0 and %i, which is %i% of your current maximum health. (If the %s is enchanted, this maximum amount will %s %i.) \",\n fp_armorAbsorptionMax(enchant),\n Math.floor(100 * fp_armorAbsorptionMax(enchant) / player.info.maxHP),\n theName,\n (fp_armorAbsorptionMax(enchant) == fp_armorAbsorptionMax((enchant + fp_enchantIncrement(theItem))) ? \"remain at\" : \"increase to\"),\n fp_armorAbsorptionMax((enchant + fp_enchantIncrement(theItem))));\n } else {\n\t\t\t\t\t\t\t\t\tstrcpy(buf2, \"It will reduce the damage of inbound attacks by a random amount determined by its enchantment level. \");\n }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase A_REPRISAL:\n if (theItem.flags & ITEM_IDENTIFIED) {\n sprintf(buf2, \"Any enemy that attacks you will itself be wounded by %i% of the damage that it inflicts. (If the %s is enchanted, this percentage will increase to %i%.) \",\n fp_armorReprisalPercent(enchant),\n theName,\n fp_armorReprisalPercent((enchant + fp_enchantIncrement(theItem))));\n } else {\n strcpy(buf2, \"Any enemy that attacks you will itself be wounded by a percentage (determined by enchantment level) of the damage that it inflicts. \");\n }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase A_IMMUNITY:\n describeMonsterClass(buf3, theItem.vorpalEnemy, false);\n\t\t\t\t\t\t\t\tsprintf(buf2, \"It offers complete protection from any attacking %s. \",\n\t\t\t\t\t\t\t\t\t\tbuf3);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase A_REFLECTION:\n if (theItem.flags & ITEM_IDENTIFIED) {\n if (theItem.enchant1 > 0) {\n const reflectChance = fp_reflectionChance(enchant);\n const reflectChance2 = fp_reflectionChance(enchant + fp_enchantIncrement(theItem));\n sprintf(buf2, \"When worn, you will deflect %i% of incoming spells -- including directly back at their source %i% of the time. (If the armor is enchanted, these will increase to %i% and %i%.) \",\n reflectChance,\n Math.floor(reflectChance * reflectChance / 100),\n reflectChance2,\n Math.floor(reflectChance2 * reflectChance2 / 100));\n } else if (theItem.enchant1 < 0) {\n const reflectChance = fp_reflectionChance(enchant);\n const reflectChance2 = fp_reflectionChance(enchant + fp_enchantIncrement(theItem));\n sprintf(buf2, \"When worn, %i% of your own spells will deflect from their target -- including directly back at you %i% of the time. (If the armor is enchanted, these will decrease to %i% and %i%.) \",\n reflectChance,\n Math.floor(reflectChance * reflectChance / 100),\n reflectChance2,\n Math.floor(reflectChance2 * reflectChance2 / 100));\n }\n } else {\n\t\t\t\t\t\t\t\t\tstrcpy(buf2, \"When worn, you will deflect some percentage of incoming spells, determined by enchantment level. \");\n }\n\t\t\t\t\t\t\t\tbreak;\n case A_RESPIRATION:\n\t\t\t\t\t\t\t\t\tstrcpy(buf2, \"When worn, it will maintain a pocket of fresh air around you, rendering you immune to the effects of steam and all toxic gases. \");\n break;\n case A_DAMPENING:\n\t\t\t\t\t\t\t\t\tstrcpy(buf2, \"When worn, it will safely absorb the concussive impact of any explosions (though you may still be burned). \");\n break;\n\t\t\t\t\t\t\tcase A_BURDEN:\n\t\t\t\t\t\t\t\tstrcpy(buf2, \"10% of the time it absorbs a blow, its strength requirement will permanently increase. \");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase A_VULNERABILITY:\n\t\t\t\t\t\t\t\tstrcpy(buf2, \"While it is worn, inbound attacks will inflict twice as much damage. \");\n\t\t\t\t\t\t\t\tbreak;\n case A_IMMOLATION:\n\t\t\t\t\t\t\t\tstrcpy(buf2, \"10% of the time it absorbs a blow, it will explode in flames. \");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t} else if (theItem.flags & ITEM_IDENTIFIED) {\n\t\t\t\t\t\tsprintf(buf2, \"\\n\\nGlowing runes of an indecipherable language spiral around the %s. \",\n\t\t\t\t\t\t\t\ttheName);\n\t\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// equipped? cursed?\n\t\t\t\tif (theItem.flags & ITEM_EQUIPPED) {\n\t\t\t\t\tsprintf(buf2, \"\\n\\nYou are wearing the %s%s. \",\n\t\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t\t((theItem.flags & ITEM_CURSED) ? \", and because it is cursed, you are powerless to remove it\" : \"\"));\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t} else if (((theItem.flags & (ITEM_IDENTIFIED | ITEM_MAGIC_DETECTED)) || rogue.playbackOmniscience)\n\t\t\t\t\t\t && (theItem.flags & ITEM_CURSED))\n {\n\t\t\t\t\tsprintf(buf2, \"\\n\\n%sYou can feel a malevolent magic lurking within the %s.%s \",\n badColorEscape,\n theName,\n whiteColorEscape);\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase STAFF:\n\t\t\t// charges\n\n\t\t\tnewValue = apparentRingBonus(RING_WISDOM);\n\t\t\tif ((theItem.flags & ITEM_IDENTIFIED) || rogue.playbackOmniscience) {\n\t\t\t\tsprintf(buf2, \"\\n\\nThe %s has %i charges remaining out of a maximum of %i charges, and%s recovers a charge in approximately %i turns. \",\n\t\t\t\t\t\ttheName,\n\t\t\t\t\t\ttheItem.charges,\n\t\t\t\t\t\ttheItem.enchant1,\n newValue == 0 ? \"\" : \", with your current rings,\",\n Math.floor(staffChargeDuration(theItem) / fp_ringWisdomMultiplier(newValue << FP_BASE)));\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t} else if (theItem.flags & ITEM_MAX_CHARGES_KNOWN) {\n\t\t\t\tsprintf(buf2, \"\\n\\nThe %s has a maximum of %i charges, and%s recovers a charge in approximately %i turns. \",\n\t\t\t\t\t\t\ttheName,\n theItem.enchant1,\n newValue == 0 ? \"\" : \", with your current rings,\",\n Math.floor(staffChargeDuration(theItem) / fp_ringWisdomMultiplier(newValue << FP_BASE)));\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t}\n\n\t\t\t// effect description\n\t\t\tif (((theItem.flags & (ITEM_IDENTIFIED | ITEM_MAX_CHARGES_KNOWN)) && staffTable[theItem.kind].identified)\n\t\t\t\t|| rogue.playbackOmniscience)\n {\n\t\t\t\tswitch (theItem.kind) {\n\t\t\t\t\tcase STAFF_LIGHTNING:\n\t\t\t\t\t\tsprintf(buf2, \"This staff deals damage to every creature in its line of fire; nothing is immune. (If the staff is enchanted, its average damage will increase by %i%.)\",\n\t\t\t\t\t\t\t\tMath.floor(100 * (fp_staffDamageLow(enchant + FP_FACTOR) + fp_staffDamageHigh(enchant + FP_FACTOR)) / (fp_staffDamageLow(enchant) + fp_staffDamageHigh(enchant)) - 100));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_FIRE:\n\t\t\t\t\t\tsprintf(buf2, \"This staff deals damage to any creature that it hits, unless the creature is immune to fire. (If the staff is enchanted, its average damage will increase by %i%.) It also sets creatures and flammable terrain on fire.\",\n\t\t\t\t\t\t\t\tMath.floor(100 * (fp_staffDamageLow(enchant + FP_FACTOR) + fp_staffDamageHigh(enchant + FP_FACTOR)) / (fp_staffDamageLow(enchant) + fp_staffDamageHigh(enchant)) - 100));\n break;\n\t\t\t\t\tcase STAFF_POISON:\n\t\t\t\t\t\tsprintf(buf2, \"The bolt from this staff will poison any creature that it hits for %i turns. (If the staff is enchanted, this will increase to %i turns.)\",\n\t\t\t\t\t\t\t\tfp_staffPoison(enchant),\n\t\t\t\t\t\t\t\tfp_staffPoison(enchant + FP_FACTOR));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_TUNNELING:\n\t\t\t\t\t\tsprintf(buf2, \"The bolt from this staff will dissolve %i layers of obstruction. (If the staff is enchanted, this will increase to %i layers.)\",\n\t\t\t\t\t\t\t\ttheItem.enchant1,\n\t\t\t\t\t\t\t\ttheItem.enchant1 + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_BLINKING:\n\t\t\t\t\t\tsprintf(buf2, \"This staff enables you to teleport up to %i spaces. (If the staff is enchanted, this will increase to %i spaces.)\",\n\t\t\t\t\t\t\t\tfp_staffBlinkDistance(enchant),\n\t\t\t\t\t\t\t\tfp_staffBlinkDistance(enchant + FP_FACTOR));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_ENTRANCEMENT:\n\t\t\t\t\t\tsprintf(buf2, \"This staff will compel its target to mirror your movements for %i turns. (If the staff is enchanted, this will increase to %i turns.)\",\n\t\t\t\t\t\t\t\tfp_staffEntrancementDuration(enchant),\n\t\t\t\t\t\t\t\tfp_staffEntrancementDuration(enchant + FP_FACTOR));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_HEALING:\n\t\t\t\t\t\tif (enchant < 10) {\n\t\t\t\t\t\t\tsprintf(buf2, \"This staff will heal its target by %i% of its maximum health. (If the staff is enchanted, this will increase to %i%.)\",\n\t\t\t\t\t\t\t\t\ttheItem.enchant1 * 10,\n\t\t\t\t\t\t\t\t\t(theItem.enchant1 + 1) * 10);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstrcpy(buf2, \"This staff will completely heal its target.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_HASTE:\n\t\t\t\t\t\tsprintf(buf2, \"This staff will cause its target to move twice as fast for %i turns. (If the staff is enchanted, this will increase to %i turns.)\",\n\t\t\t\t\t\t\t\tfp_staffHasteDuration(enchant),\n\t\t\t\t\t\t\t\tfp_staffHasteDuration(enchant + FP_FACTOR));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_OBSTRUCTION:\n\t\t\t\t\t\tstrcpy(buf2, \"\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_DISCORD:\n\t\t\t\t\t\tsprintf(buf2, \"This staff will cause discord for %i turns. (If the staff is enchanted, this will increase to %i turns.)\",\n\t\t\t\t\t\t\t\tfp_staffDiscordDuration(enchant),\n\t\t\t\t\t\t\t\tfp_staffDiscordDuration(enchant + FP_FACTOR));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_CONJURATION:\n\t\t\t\t\t\tsprintf(buf2, \"%i phantom blades will be called into service. (If the staff is enchanted, this will increase to %i blades.)\",\n\t\t\t\t\t\t\t\tfp_staffBladeCount(enchant),\n\t\t\t\t\t\t\t\tfp_staffBladeCount(enchant + FP_FACTOR));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAFF_PROTECTION:\n\t\t\t\t\t\tsprintf(buf2, \"This staff will shield a creature for up to 20 turns against up to %i damage. (If the staff is enchanted, this will increase to %i damage.)\",\n\t\t\t\t\t\t\t\tMath.floor(fp_staffProtection(enchant) / 10),\n\t\t\t\t\t\t\t\tMath.floor(fp_staffProtection(enchant + FP_FACTOR) / 10));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tstrcpy(buf2, \"No one knows what this staff does.\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n if (strlen(buf2)) {\n strcat(buf, \"\\n\\n\");\n strcat(buf, buf2);\n }\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase WAND:\n\t\t\tstrcat(buf, \"\\n\\n\");\n\t\t\tif ((theItem.flags & (ITEM_IDENTIFIED | ITEM_MAX_CHARGES_KNOWN)) || rogue.playbackOmniscience) {\n\t\t\t\tif (theItem.charges) {\n\t\t\t\t\tsprintf(buf2, \"%i charge%s remain%s. Enchanting this wand will add %i charge%s.\",\n\t\t\t\t\t\t\ttheItem.charges,\n\t\t\t\t\t\t\t(theItem.charges == 1 ? \"\" : \"s\"),\n\t\t\t\t\t\t\t(theItem.charges == 1 ? \"s\" : \"\"),\n wandTable[theItem.kind].range.lowerBound,\n (wandTable[theItem.kind].range.lowerBound == 1 ? \"\" : \"s\"));\n\t\t\t\t} else {\n\t\t\t\t\tsprintf(buf2, \"No charges remain. Enchanting this wand will add %i charge%s.\",\n wandTable[theItem.kind].range.lowerBound,\n (wandTable[theItem.kind].range.lowerBound == 1 ? \"\" : \"s\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (theItem.enchant2) {\n\t\t\t\t\tsprintf(buf2, \"You have used this wand %i time%s, but do not know how many charges, if any, remain.\",\n\t\t\t\t\t\t\ttheItem.enchant2,\n\t\t\t\t\t\t\t(theItem.enchant2 == 1 ? \"\" : \"s\"));\n\t\t\t\t} else {\n\t\t\t\t\tstrcpy(buf2, \"You have not yet used this wand.\");\n\t\t\t\t}\n\n\t\t\t\tif (wandTable[theItem.kind].identified) {\n\t\t\t\t\tstrcat(buf, buf2);\n\t\t\t\t\tsprintf(buf2, \" Wands of this type can be found with %i to %i charges. Enchanting this wand will add %i charge%s.\",\n\t\t\t\t\t\t\twandTable[theItem.kind].range.lowerBound,\n\t\t\t\t\t\t\twandTable[theItem.kind].range.upperBound,\n wandTable[theItem.kind].range.lowerBound,\n (wandTable[theItem.kind].range.lowerBound == 1 ? \"\" : \"s\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrcat(buf, buf2);\n\t\t\tbreak;\n\n\t\tcase RING:\n\t\t\tif (((theItem.flags & ITEM_IDENTIFIED) && ringTable[theItem.kind].identified) || rogue.playbackOmniscience) {\n if (theItem.enchant1) {\n switch (theItem.kind) {\n case RING_CLAIRVOYANCE:\n if (theItem.enchant1 > 0) {\n sprintf(buf2, \"\\n\\nThis ring provides magical sight with a radius of %i. (If the ring is enchanted, this will increase to %i.)\",\n theItem.enchant1 + 1,\n theItem.enchant1 + 2);\n } else {\n sprintf(buf2, \"\\n\\nThis ring magically blinds you to a radius of %i. (If the ring is enchanted, this will decrease to %i.)\",\n (theItem.enchant1 * -1) + 1,\n (theItem.enchant1 * -1));\n }\n strcat(buf, buf2);\n break;\n case RING_REGENERATION:\n sprintf(buf2, \"\\n\\nWith this ring equipped, you will regenerate all of your health in %li turns (instead of %li). (If the ring is enchanted, this will decrease to %li turns.)\",\n Math.floor(fp_turnsForFullRegenInThousandths(theItem.enchant1) / 1000),\n TURNS_FOR_FULL_REGEN,\n Math.floor(fp_turnsForFullRegenInThousandths(theItem.enchant1 + 1) / 1000));\n strcat(buf, buf2);\n break;\n case RING_TRANSFERENCE:\n sprintf(buf2, \"\\n\\nDealing direct damage to a creature (whether in melee or otherwise) will %s you by %i% of the damage dealt. (If the ring is enchanted, this will %s to %i%.)\",\n (theItem.enchant1 >= 0 ? \"heal\" : \"harm\"),\n abs(theItem.enchant1) * 5,\n (theItem.enchant1 >= 0 ? \"increase\" : \"decrease\"),\n abs(theItem.enchant1 + 1) * 5);\n strcat(buf, buf2);\n break;\n case RING_WISDOM:\n sprintf(buf2, \"\\n\\nWhen worn, your staffs will recharge at %i% of their normal rate. (If the ring is enchanted, the rate will increase to %i% of the normal rate.)\",\n\t\t\t\t\t\t\t\t\t\t\tMath.floor(100 * fp_ringWisdomMultiplier(enchant) >> FP_BASE),\n\t\t\t\t\t\t\t\t\t\t\tMath.floor(100 * fp_ringWisdomMultiplier(enchant + FP_FACTOR) >> FP_BASE));\n strcat(buf, buf2);\n break;\n case RING_REAPING:\n sprintf(buf2, \"\\n\\nEach blow that you land with a weapon will %s your staffs and charms by 0-%i turns per point of damage dealt. (If the ring is enchanted, this will %s to 0-%i turns per point of damage.)\",\n (theItem.enchant1 >= 0 ? \"recharge\" : \"drain\"),\n abs(theItem.enchant1),\n (theItem.enchant1 >= 0 ? \"increase\" : \"decrease\"),\n abs(theItem.enchant1 + 1));\n strcat(buf, buf2);\n break;\n default:\n break;\n }\n }\n\t\t\t} else {\n\t\t\t\tsprintf(buf2, \"\\n\\nIt will reveal its secrets if worn for %i%s turn%s\",\n\t\t\t\t\t\ttheItem.charges,\n\t\t\t\t\t\t(theItem.charges == RING_DELAY_TO_AUTO_ID ? \"\" : \" more\"),\n\t\t\t\t\t\t(theItem.charges == 1 ? \"\" : \"s\"));\n\t\t\t\tstrcat(buf, buf2);\n\n if ((theItem.charges < RING_DELAY_TO_AUTO_ID || (theItem.flags & (ITEM_MAGIC_DETECTED | ITEM_IDENTIFIED)))\n && theItem.enchant1 > 0) // Mention the unknown-positive-ring footnote only if it's good magic and you know it.\n {\n sprintf(buf2, \", and until you understand its secrets, it will function as a +%i ring.\", theItem.timesEnchanted + 1);\n strcat(buf, buf2);\n } else {\n\t\t\t\t\t\tstrcat(buf, \".\");\n }\n\t\t\t}\n\n\t\t\t// equipped? cursed?\n\t\t\tif (theItem.flags & ITEM_EQUIPPED) {\n\t\t\t\tsprintf(buf2, \"\\n\\nThe %s is on your finger%s. \",\n\t\t\t\t\t\ttheName,\n\t\t\t\t\t\t((theItem.flags & ITEM_CURSED) ? \", and because it is cursed, you are powerless to remove it\" : \"\"));\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t} else if (((theItem.flags & (ITEM_IDENTIFIED | ITEM_MAGIC_DETECTED)) || rogue.playbackOmniscience)\n\t\t\t\t\t && (theItem.flags & ITEM_CURSED))\n {\n\t\t\t\tsprintf(buf2, \"\\n\\n%sYou can feel a malevolent magic lurking within the %s.%s \",\n badColorEscape,\n theName,\n whiteColorEscape);\n\t\t\t\tstrcat(buf, buf2);\n\t\t\t}\n\t\t\tbreak;\n case CHARM:\n switch (theItem.kind) {\n case CHARM_HEALTH:\n sprintf(buf2, \"\\n\\nWhen used, the charm will heal %i% of your health and recharge in %i turns. (If the charm is enchanted, it will heal %i% of your health and recharge in %i turns.)\",\n\t\t\t\t\t\t\t\t\t\t\tfp_charmHealing(enchant),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1),\n\t\t\t\t\t\t\t\t\t\t\tfp_charmHealing(enchant + FP_FACTOR),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_PROTECTION:\n\t\t\t\t\t\t\tsprintf(buf2, \"\\n\\nWhen used, the charm will shield you for up to 20 turns for up to %i% of your total health and recharge in %i turns. (If the charm is enchanted, it will shield up to %i% of your total health and recharge in %i turns.)\",\n\t\t\t\t\t\t\t\t\t\t\tMath.floor(100 * fp_charmProtection(enchant) / 10 / player.info.maxHP),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1),\n\t\t\t\t\t\t\t\t\t\t\tMath.floor(100 * fp_charmProtection(enchant + FP_FACTOR) / 10 / player.info.maxHP),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_HASTE:\n sprintf(buf2, \"\\n\\nWhen used, the charm will haste you for %i turns and recharge in %i turns. (If the charm is enchanted, the haste will last %i turns and it will recharge in %i turns.)\",\n charmEffectDuration(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmEffectDuration(theItem.kind, theItem.enchant1 + 1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_FIRE_IMMUNITY:\n sprintf(buf2, \"\\n\\nWhen used, the charm will grant you immunity to fire for %i turns and recharge in %i turns. (If the charm is enchanted, the immunity will last %i turns and it will recharge in %i turns.)\",\n charmEffectDuration(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmEffectDuration(theItem.kind, theItem.enchant1 + 1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_INVISIBILITY:\n sprintf(buf2, \"\\n\\nWhen used, the charm will turn you invisible for %i turns and recharge in %i turns. While invisible, monsters more than two spaces away cannot track you. (If the charm is enchanted, the invisibility will last %i turns and it will recharge in %i turns.)\",\n charmEffectDuration(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmEffectDuration(theItem.kind, theItem.enchant1 + 1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_TELEPATHY:\n sprintf(buf2, \"\\n\\nWhen used, the charm will grant you telepathy for %i turns and recharge in %i turns. (If the charm is enchanted, the telepathy will last %i turns and it will recharge in %i turns.)\",\n charmEffectDuration(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmEffectDuration(theItem.kind, theItem.enchant1 + 1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_LEVITATION:\n sprintf(buf2, \"\\n\\nWhen used, the charm will lift you off the ground for %i turns and recharge in %i turns. (If the charm is enchanted, the levitation will last %i turns and it will recharge in %i turns.)\",\n charmEffectDuration(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmEffectDuration(theItem.kind, theItem.enchant1 + 1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_SHATTERING:\n\t\t\t\t\t\t\tsprintf(buf2, \"\\n\\nWhen used, the charm will dissolve the nearby walls up to %i spaces away, and recharge in %i turns. (If the charm is enchanted, it will reach up to %i spaces and recharge in %i turns.)\",\n\t\t\t\t\t\t\t\t\t\t\tfp_charmShattering(enchant),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1),\n\t\t\t\t\t\t\t\t\t\t\tfp_charmShattering(enchant + FP_FACTOR),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_GUARDIAN:\n sprintf(buf2, \"\\n\\nWhen used, a guardian will materialize for %i turns, and the charm will recharge in %i turns. (If the charm is enchanted, the guardian will last for %i turns and the charm will recharge in %i turns.)\",\n\t\t\t\t\t\t\t\t\t\t\tfp_charmGuardianLifespan(enchant),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1),\n\t\t\t\t\t\t\t\t\t\t\tfp_charmGuardianLifespan(enchant + FP_FACTOR),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_TELEPORTATION:\n sprintf(buf2, \"\\n\\nWhen used, the charm will teleport you elsewhere in the dungeon and recharge in %i turns. (If the charm is enchanted, it will recharge in %i turns.)\",\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_RECHARGING:\n sprintf(buf2, \"\\n\\nWhen used, the charm will recharge your staffs (though not your wands or charms), after which it will recharge in %i turns. (If the charm is enchanted, it will recharge in %i turns.)\",\n charmRechargeDelay(theItem.kind, theItem.enchant1),\n charmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n case CHARM_NEGATION:\n sprintf(buf2, \"\\n\\nWhen used, the charm will negate all magical effects on the creatures in your field of view and the items on the ground up to %i spaces away, and recharge in %i turns. (If the charm is enchanted, it will reach up to %i spaces and recharge in %i turns.)\",\n\t\t\t\t\t\t\t\t\t\t\tfp_charmNegationRadius(enchant),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1),\n\t\t\t\t\t\t\t\t\t\t\tfp_charmNegationRadius(enchant + FP_FACTOR),\n\t\t\t\t\t\t\t\t\t\t\tcharmRechargeDelay(theItem.kind, theItem.enchant1 + 1));\n break;\n default:\n break;\n }\n strcat(buf, buf2);\n break;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n return buf;\n}", "title": "" }, { "docid": "25c6e294c1a5b0c92d7efcb8f482e0d2", "score": "0.5328146", "text": "function itemHandler(player, item) {\n item.kill();\n if (item.key === 'blue') {\n currentScore = currentScore + 10;\n }else if (item.key === 'orange') {\n currentScore = currentScore + 10;\n }else if (item.key === ' yello') {\n currentScore = currentScore + 10;\n }else if (item.key === 'green') {\n currentScore = currentScore + 10;\n }else if (item.key === 'violet') {\n currentScore = currentScore + 10;\n }\n if (currentScore === winningScore) {\n createBadge();\n }\n}", "title": "" }, { "docid": "d703fb08dca36edcc9358936ee6085b6", "score": "0.5317124", "text": "async onUseItem(itemName, amount) {\n /* animation */\n }", "title": "" }, { "docid": "f9b7abacb5d9950f3a1bf935813f152f", "score": "0.5313388", "text": "function Experience(props){\n\tconst experience = props.experience;\t\n\tlet list = experience.map((exp)=>{return exp.company});\n\treturn(\n\t\t<span>{list.join(', ')}</span>\n\t\t);\n}", "title": "" }, { "docid": "7e061c8341f9abf9e69ea3a7fb45421e", "score": "0.5311024", "text": "experienceText(data)\n {\n return (<div>\n <b>Overall Experience: </b> {data.overallExperience} <br /></div>)\n }", "title": "" }, { "docid": "a4c0c0cbe054932990f7e9258f2da59a", "score": "0.5270964", "text": "function negativeReact(item) {\n let namedPet = $(\"#nameInput\").val();\n\n // angry face\n document.getElementById(\"eyes\").src = \"assets/images/eye2.png\";\n\n //Return to neutral eyes after a second\n setTimeout(function() {\n document.getElementById(\"eyes\").src = \"assets/images/eye0.png\";\n }, 1000); //1 seconds\n\n // update text log (unhappy)\n $(\"#log\").append(namedPet + \" did not like the \" + item.value + \" ...<br>\");\n updateScroll();\n updateBar();\n}", "title": "" }, { "docid": "3f37273b1d8ad6725d479d67dc9333bb", "score": "0.52571434", "text": "setLevelAndExperience() {\n const today = new Date().getTime();\n const age = this.calculateAge(today);\n\n this.setLevel(age);\n this.setProgressBarFill(this.calculateProgressTowardsNextLevel(age, today));\n }", "title": "" }, { "docid": "b3fedfa6eec3919b8550ffd94decfc12", "score": "0.52331215", "text": "static displayIncome() {\n const incomes = Store.getIncomes();\n\n incomes.forEach(income => {\n UI.addIncomeToList(income);\n });\n }", "title": "" }, { "docid": "076d187ba5a25fff15222cc08d0b48ce", "score": "0.52272165", "text": "updateInformations() {\n let player = Game.current.teamHeroes[this.windowChoicesTabs\n .currentSelectedIndex];\n if (this.selectedEquipment === -1) {\n this.list = [];\n }\n else {\n let item = this.windowChoicesList.getCurrentContent();\n let equipmentID = Datas.BattleSystems.equipmentsOrder[this\n .windowChoicesEquipment.currentSelectedIndex];\n let system = item.item ? item.item.system : null;\n let result = player.getEquipmentStatsAndBonus(system, equipmentID);\n this.list = result[0];\n this.bonus = result[1];\n }\n this.windowInformation.content = new Graphic.EquipStats(player, this.list);\n }", "title": "" }, { "docid": "0597e79725dffe53e8cf1898718645ed", "score": "0.52267706", "text": "onInteract() {\n // Filter out the hammer\n var items = player.getInventory().getItems().filter(item => item.name != \"hammer\");\n\n // If we have an item in the inventory which is usable for placing on the plate...\n if (items.length > 0) {\n // Remove it from the inventory, update the sprite, and enable the pressure plate\n player.getInventory().removeItemByName(items[0].name);\n this.item.sprite.setSpritesheet(items[0].image);\n this.item.sprite.show();\n this.itemPlaced = items[0];\n this.setState(true);\n } else {\n utils.displayDialogBox(\"I need something heavy...\", 2000);\n }\n }", "title": "" }, { "docid": "362d0724929c216fd9c90b95fc16eae0", "score": "0.5223771", "text": "function showInfo(item) {\n\tvar usedValue = item.tmv.nationalBasePrice.usedPrivateParty;\n\tvar usedRegionalAdd = item.tmv.regionalAdjustment.usedPrivateParty; //173\n\tvar ballParkPrivate = usedValue + usedRegionalAdd;\n\tvar curday = new Date();\n\tconsole.log(usedValue);\n\tconsole.log(usedRegionalAdd);\n\tconsole.log(ballParkPrivate);\n\t$('.results').append(curday + \"<h2>The estimated value is:</h2>\" + \"$\" + ballParkPrivate);\n\t//var tradeinValue = item.tmv.nationalBasePrice.regionalAdjustment.usedTradeIn;\n\treturn ballParkPrivate; // added this since last session\n\t// console.log(usedValue);\n\t// console.log(tradeinValue);\n\t// console.log();\n\t// return usedValue + + tradeinValue + ;\n}", "title": "" }, { "docid": "e7cae22c09f9d576b3d8002db648ceaf", "score": "0.52120477", "text": "function useItem(anitem) {\n\tswitch (parseInt(amove)) {\n\t\tcase 1:\n\t\t\t//Use potion\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\t//Another Item\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\t//Other Item\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\n\t}\n}", "title": "" }, { "docid": "57a31eed0548ea751747f7e4fc802ee7", "score": "0.5204021", "text": "function experience(years){ //FUNCAO QUE RETORNA O NIVEL DE EXPERIENCIA DE ACORDO COM OS ANOS - FUNCTION THAT RETURNS THE LEVEL OF EXPERIENCE IN ACCORDANCE WITH THE YEARS\n //LOGICA PARA DETERMINAR A EXPERIENCIA - LOGIC TO DETERMINE THE EXPERIENCE\n if(years <= 1){\n return \"Iniciante\";\n }else if(years > 1 && years <=3){\n return \"Intermediário\";\n }else if(years > 3 && years <=6){\n return \"Avançado\";\n }else{\n return \"Jedi Master\";\n }\n}", "title": "" }, { "docid": "3b042342beeb51ae0b425dd85da2dd2a", "score": "0.5191304", "text": "function showCurrentSlidee() {\n var slidee = $(slideelist[currentslidee]);\n\n image.attr(\"src\",slidee.data(\"img\"));\n description.html( slidee.data(\"desc\" ) );\n }", "title": "" }, { "docid": "5f4e341fb9fcb63f151ae452a230365b", "score": "0.5178981", "text": "function createExp(experience){\n return <Experience exp={experience} />;\n}", "title": "" }, { "docid": "2e5e70ed70f3cc7b1bd0f3d07d9b0a91", "score": "0.51786", "text": "applyHealthEffects(item) {\n if (item === 'knife' &&\n this.isBandaged === false) {\n console.log('The knife was sharp!\\nYou\\'ve grabbed it from the wrong end and cut yourself!');\n console.log('In shock you\\'ve dropped the bloody knife onto the floor!');\n console.log('You\\'ll need to find some bandages quickly!');\n this.inventory.pop();\n }\n else if (item === 'bandages' &&\n this.healthLevel < 100) {\n console.log('You patch your knife wound with the bandages and the bleeding stops.');\n console.log('Not a moment too soon!\\nYou would have surely perished otherwise!');\n this.healthLevel = 100;\n this.isBandaged = true;\n }\n }", "title": "" }, { "docid": "dece89aa1d579301ef08890dc8834c09", "score": "0.5175743", "text": "advanceLevel() {\n const newLevel = this._actor.get('Experience').getExpLevel();\n if (newLevel % 4 === 0) {\n // Get other random actor class\n // Use it to add new abilities to the actor\n }\n }", "title": "" }, { "docid": "4f6864a486a72c61b68cdf9d990383bc", "score": "0.51650006", "text": "function describe(item) {\n\tif (guide[item] === undefined) {\n\t\tsetPrior();\n\t\t$('#storyZone').html(`<p id=\"storyText\">I'm not sure what you're asking me to describe. Try again.</p>`);\n\t} else {\n\t\tif (item === 'room' || item === 'bedroom' || item === 'bathroom') {\n\t\t\tif ((item === 'room' || item === 'bedroom') && guide.room === 'bedroom') {\n\t\t\t\tguide.bed.seen = true;\n\t\t\t\tguide.desk.seen = true;\n\t\t\t\tguide.dresser.seen = true;\n\t\t\t\tguide['blue door'].seen = true;\n\t\t\t\tdisplaySeen();\n\t\t\t\tsetPrior();\n\t\t\t\tdisplayText = guide[guide.room].description;\n\t\t\t\tsetCurrent();\n\t\t\t} else if ((item === 'room' || item === 'bathroom') && guide.room === 'bathroom') {\n\t\t\t\tguide.sink.seen = true;\n\t\t\t\tguide['blue door'].seen = true;\n\t\t\t\tguide.tub.seen = true;\n\t\t\t\tguide.toilet.seen = true;\n\t\t\t\tdisplaySeen();\n\t\t\t\tsetPrior();\n\t\t\t\tdisplayText = guide[guide.room].description;\n\t\t\t\tsetCurrent();\n\t\t\t} else {\n\t\t\t\tsetPrior();\n\t\t\t\tdisplayText = `You are not currently in the ${item}.`;\n\t\t\t\tsetCurrent();\n\t\t\t}\n\t\t} else {\n\t\t\tif (guide[item].seen === true) {\n\t\t\t\tlookAtItem(item);\n\t\t\t} else {\n\t\t\t\tseeError();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bcd3c7547f9469068da634f87cc87990", "score": "0.5163379", "text": "_onCycleSkillProficiency(event) {\r\n event.preventDefault();\r\n let field = $(event.currentTarget).siblings('input[type=\"hidden\"]');\r\n\r\n // Get the skill type (used to determine if this is a Lore skill)\r\n let skillType = $(event.currentTarget).parents(\".item\").attr(\"data-item-type\");\r\n let containerType = $(event.currentTarget).parents(\".item-container\").attr(\"data-container-type\");\r\n\r\n // Get the current level and the array of levels\r\n let level = parseFloat(field.val());\r\n const levels = [0, 1, 2, 3, 4];\r\n let idx = levels.indexOf(level)\r\n let newLevel = \"\";\r\n\r\n // Toggle next level - forward on click, backwards on right\r\n if ( event.type === \"click\" ) {\r\n newLevel = levels[(idx === levels.length - 1) ? 0 : idx + 1];\r\n } else if ( event.type === \"contextmenu\" ) {\r\n newLevel = levels[(idx === 0) ? levels.length - 1 : idx - 1];\r\n }\r\n\r\n // Update the field value and save the form\r\n if (skillType === \"lore\") {\r\n let itemId = $(event.currentTarget).parents(\".item\").attr(\"data-item-id\");\r\n //const itemToEdit = this.actor.items.find(i => i.id === itemId);\r\n //const itemToEdit = this.actor.getOwnedItem(itemId).data;\r\n /* itemToEdit.data.proficient.value = newLevel;\r\n this.actor.updateOwnedItem(itemToEdit); */\r\n\r\n this.actor.updateEmbeddedEntity(\"OwnedItem\", {_id: itemId, \"data.proficient.value\" : newLevel });\r\n\r\n } else if (containerType === \"spellcastingEntry\") {\r\n let itemId = $(event.currentTarget).parents(\".item-container\").attr(\"data-container-id\");\r\n //const itemToEdit = this.actor.items.find(i => i.id === itemId);\r\n /* const itemToEdit = this.actor.getOwnedItem(itemId).data;\r\n itemToEdit.data.proficiency.value = newLevel;\r\n this.actor.updateOwnedItem(itemToEdit); */\r\n\r\n this.actor.updateEmbeddedEntity(\"OwnedItem\", {_id: itemId, \"data.proficiency.value\" : newLevel });\r\n\r\n } else {\r\n field.val(newLevel);\r\n this._onSubmit(event);\r\n }\r\n }", "title": "" }, { "docid": "590cc6698777ec96758fd688098c8c56", "score": "0.51619", "text": "function displayObjectives(ctx) {\r\n\tvar href = \"/jcourse/workbook/activity/objectives\";\r\n\thref += \"?context=\" + escape(ctx);\r\n\topenLgWin(href, \"objectives\");\r\n}", "title": "" }, { "docid": "e9109b340f34da9d3e46736cfaef91c3", "score": "0.5140268", "text": "function displaySeen() {\n\tlet itemList = [];\n\tfor (let item in guide) {\n\t\tif (guide[item].seen === true) itemList.push(guide[item].name);\n\t}\n\tlet invCount = itemList.length;\n\tlet itemString = itemList.join(', ');\n\n\t$('#seenZone').html(`<span>Seen Items (${invCount}/52)</span><div class=\"seenItem\">${itemString}</div>`);\n\n\tif (invCount === 52) {\n\t\tif (guide.achievements.seenItAll === false) {\n\t\t\tguide.achievements.seenItAll = true;\n\t\t\tguide.achievements.count++;\n\t\t\t$('#achievement-count').text(guide.achievements.count);\n\t\t\t$('#achievement-seenItAll').show();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fa563dcda65a3f06e779b4207742ffb9", "score": "0.5136229", "text": "function itemHandler(player, item) {\n item.kill();\n if (item.key === 'coin') {\n currentScore = currentScore + 10;\n } else if (item.key === 'onion') {\n currentScore = currentScore - 25;\n } else if (item.key === 'star') {\n currentScore = currentScore + 25;\n }\n if (currentScore === winningScore) {\n createBadge();\n } else if (currentScore === winningScore2) {\n createBadge();\n } else if (currentScore >= 80) {\n createBadge();\n }\n}", "title": "" }, { "docid": "e9a2cac0882deaec665860e27e6f2d70", "score": "0.5131227", "text": "function earnLife(){\n\tvar currentLives = gameSession.getCurrentPlayer().lives;\n\t\n\tTi.API.warn('GAINED life. Have '+currentLives);\n\t\n\tif(currentLives == 0){\n\t\theartIcon1.show();\n\t} else if(currentLives == 1){\n\t\theartIcon2.show();\n\t} else if(currentLives == 2){\n\t\theartIcon3.show();\n\t} else if(currentLives == 3){\n\t\theartIcon4.show();\n\t} else if(currentLives == 4){\n\t\theartIcon5.show();\n\t} \n\t\n\tgameSession.incrementLives();\n\t\n\t//Play sound\n\tif(SOUNDS_MODE){\n\t\taudioBonusLife.play();\t\n\t}\n}", "title": "" }, { "docid": "ba3cae0b086cda1b51e7202d58ec8726", "score": "0.512932", "text": "display_item(itemIDIn) {\n // Set item ID as int\n const itemID = parseInt(itemIDIn);\n\n // Set the current item by the item ID\n PLEX.current_item = PLEX.current_section.items[itemID];\n\n // Set the window location hash\n window.location.hash = `${PLEX.current_section.key}/${PLEX.current_item.key}`;\n\n // Set the popup HTML\n const popupHTML = PLEX.generate_item_content();\n\n // Set popup container HTML\n PLEX._popup_container.innerHTML = popupHTML;\n\n // Listen for click on footer items\n PLEX._popup_container\n .querySelectorAll('#popup-footer span')\n .forEach(footerItem =>\n footerItem.addEventListener('click', () => {\n // Display the selected item\n PLEX.display_item(footerItem.dataset.item);\n })\n );\n\n // Add event listener to the seasons list items\n const popupSeasonSeasonsUl = document.querySelector(\n '#popup_seasons_seasons'\n );\n if (popupSeasonSeasonsUl) {\n popupSeasonSeasonsUl\n .querySelectorAll('li')\n .forEach(popupSeasonSeasonsLi =>\n popupSeasonSeasonsLi.addEventListener('click', seasonEvent => {\n // Set the current target\n const { target } = seasonEvent;\n // Remove the current class from the popup seasons seasons\n popupSeasonSeasonsUl\n .querySelectorAll('li.current')\n .forEach(seasonsListLi => {\n seasonsListLi.classList.remove('current');\n });\n\n // Add current class to this element\n if (!target.classList.contains('current'))\n target.classList.add('current');\n\n // Get the current season key\n const seasonKey = target.dataset.season;\n\n // Get the current season data\n const season = PLEX.current_item.seasons[seasonKey];\n\n // Init the season episodes list\n let innerHTML = '<ul>';\n\n // Loop through the episode sort order\n season.episode_sort_order.forEach(key => {\n // Get the episode data\n const episode = season.episodes[key];\n\n // Add the episode data to the season episodes list\n innerHTML += `<li data-season=\"${season.key}\" data-episode=\"${episode.key}\">${episode.index}. ${episode.title}</li>`;\n });\n\n // End the season episode list\n innerHTML += '</ul>';\n\n // Update the seasons episodes inner HTML\n document.querySelector(\n '#popup_seasons_episodes'\n ).innerHTML = innerHTML;\n\n // Add event listener to the episodes list items\n const popupSeasonEpisodesUl = document.querySelector(\n '#popup_seasons_episodes'\n );\n if (popupSeasonEpisodesUl) {\n popupSeasonEpisodesUl\n .querySelectorAll('li')\n .forEach(popupSeasonEpisodesLi =>\n popupSeasonEpisodesLi.addEventListener(\n 'click',\n episodeEvent => {\n // Set the current target\n const episodeTarget = episodeEvent.target;\n // Remove the current class from the popup seasons episodes\n popupSeasonEpisodesUl\n .querySelectorAll('li.current')\n .forEach(episodesListLi => {\n episodesListLi.classList.remove('current');\n });\n\n // Add current class to this element\n if (!episodeTarget.classList.contains('current'))\n episodeTarget.classList.add('current');\n\n // Get the current episode key\n const episodeKey = episodeTarget.dataset.episode;\n\n // Get the current episode data\n const episode = season.episodes[episodeKey];\n\n // Set the episode length in minutes\n const minutes = Math.round(episode.duration / 60000);\n\n // Set the episodes data\n const episodeInnerHTML = `<div id=\"episode_content\"><h5>${\n episode.title\n }</h5><p class=\"meta\">${episode_tag(\n season,\n episode\n )} | ${minutes} ${inflect(minutes, 'minute')} | Rated ${\n episode.rating\n }</p><p>${episode.summary}</p></div>`;\n\n // Update the episode inner HTML\n document.querySelector(\n '#popup_seasons_episode'\n ).innerHTML = episodeInnerHTML;\n }\n )\n );\n } // end SEASONS EPISODES CLICK\n })\n );\n } // end SEASONS SEASONS CLICK\n\n // Fade in the popup overlay\n FX.fadeIn(PLEX._popup_overlay, {\n duration: 400,\n setTo: 0.6,\n complete: null,\n });\n\n // Set the popup height and display\n PLEX._popup_overlay.style.height = `${document.body.scrollHeight}px`;\n\n // Listen for click on popup overlay\n PLEX._popup_overlay.addEventListener('click', () => {\n // Hide the popup\n PLEX.hide_item();\n });\n\n // Set popup container styling\n PLEX._popup_container.style.opacity = 0;\n PLEX._popup_container.style.display = 'block';\n PLEX._popup_container.style.top = `${document.documentElement.scrollTop +\n (document.documentElement.clientHeight -\n PLEX._popup_container.offsetHeight) /\n 4}px`;\n PLEX._popup_container.style.left = `${(document.body.offsetWidth -\n PLEX._popup_container.offsetWidth) /\n 2}px`;\n\n // Fade in popup container\n FX.fadeIn(PLEX._popup_container);\n\n // Listen for click on popup close\n PLEX._popup_container\n .querySelector('.close')\n .addEventListener('click', () => {\n // Hide the popup\n PLEX.hide_item();\n });\n }", "title": "" }, { "docid": "4932abec7d48c788aa367905538ddddb", "score": "0.5125914", "text": "updateLives() {\n lifeSlctr.innerText = `${this.life}`\n }", "title": "" }, { "docid": "dab8b24a99b409670bddcb725b53dd25", "score": "0.51239425", "text": "function showItems() {\n // Show image pieces\n piecesSlider.showPieces({items: currentImageIndex, ignore: ['tx'], singly: true, update: (anim) => {\n // Stop the pieces animation at 60%, and run a new indefinitely animation of `ty` for each piece\n if (anim.progress > 60) {\n var piece = anim.animatables[0].target;\n var ty = piece.ty;\n anime.remove(piece);\n anime({\n targets: piece,\n ty: piece.h_ty < 300\n ? [{value: ty + 10, duration: 1000}, {value: ty - 10, duration: 2000}, {value: ty, duration: 1000}]\n : [{value: ty - 10, duration: 1000}, {value: ty + 10, duration: 2000}, {value: ty, duration: 1000}],\n duration: 2000,\n easing: 'linear',\n loop: true\n });\n }\n }});\n // Show pieces for text and number, using alternate `ty` values\n piecesSlider.showPieces({items: currentTextIndex});\n piecesSlider.showPieces({items: currentNumberIndex, ty: function(p, i) { return p.s_ty - [-3, 3][i % 2]; }});\n }", "title": "" }, { "docid": "d0601f363e72f2d3dc579bb6c25af5f1", "score": "0.5110768", "text": "advanceLevel() {\n const newLevel = this._actor.get('Experience').getExpLevel();\n if (this._messages.hasOwnProperty(newLevel)) {\n const cell = this._actor.getCell();\n RG.gameMsg({cell, msg: this._messages[newLevel]});\n }\n if (this._advances.hasOwnProperty(newLevel)) {\n this._advances[newLevel]();\n }\n }", "title": "" }, { "docid": "c6fc7b0cf6c77a9ef095b63a801fe2cd", "score": "0.51070166", "text": "function useItemOnInteractive(item, interactive){\n\t\tlet itemObj = gameFactory.getItemFromInventoryByName(item);\n\t\tlet interactiveObj = gameFactory.getInteractiveByName(interactive);\n\n\t\tif (itemObj === null || interactiveObj === null || interactiveObj.activator_id !== itemObj.id){\n\t\t\talertPlayer(\"INVALID ITEM OR INTERACTIVE.\");\n\t\t\treturn;\n\t\t}\n\n\t\tlet itemName = gameFactory.useItemOnInteractive(itemObj, interactiveObj);\n\t\talertPlayer(\"YOU RECEIVED THE \" + itemName);\n\n\t\t$scope.gameObject.inventory = gameFactory.getInventory();\n\t\t$scope.gameObject.roomInteractive = gameFactory.getCurrentInteractive();\n\t\t$('#userInputBox').prop('value', '');\n\t\t$scope.isGameOver = gameFactory.getIsGameOver();\n\t}", "title": "" }, { "docid": "2910d95fe8e077664edd3624c0bdab48", "score": "0.5098414", "text": "function calculateLives(difficulty, questions){\n if(difficulty === 'easy' && questions === 10){\n lives.innerHTML = 3;\n } else if(difficulty === 'easy' && questions === 20){\n lives.innerHTML = 6;\n } else if(difficulty === 'easy' && questions === 30){\n lives.innerHTML = 9;\n } else if(difficulty === 'easy' && questions === 40){\n lives.innerHTML = 12;\n } else if(difficulty === 'medium' && questions === 10){\n lives.innerHTML = 3;\n } else if(difficulty === 'medium' && questions === 20){\n lives.innerHTML = 6;\n } else if(difficulty === 'medium' && questions === 30){\n lives.innerHTML = 9;\n } else if(difficulty === 'medium' && questions === 40){\n lives.innerHTML = 12;\n } else if(difficulty === 'medium' && questions === 50){\n lives.innerHTML = 15;\n } else if(difficulty === 'hard' && questions === 10){\n lives.innerHTML = 3;\n } else if(difficulty === 'hard' && questions === 20){\n lives.innerHTML = 6;\n }\n}", "title": "" }, { "docid": "3302893c611b35072848f762f7432323", "score": "0.5085465", "text": "function increment(item){\r\n var current_clicks = '#' + item.name + \"-status\";\r\n\r\n //use item.name to refer to an item in the items array\r\n items[item.name] = Number(items[item.name]) + 1;\r\n\r\n //update the text on page with the new quantity\r\n $(current_clicks).text(items[item.name]);\r\n \r\n $(\"button img\").animate({\r\nopacity: '0.5',\r\n }).delay(20).animate({\r\nopacity: '1',\r\n });\r\n}", "title": "" }, { "docid": "a6a536ed834f903f852946b2ec6570e9", "score": "0.50785375", "text": "updateItemHealth() {\n let flashlight = this.getInventoryItem('flashlight');\n let batteries = this.getInventoryItem('batteries');\n\n // Reduce the flashlight life if player doesn't have batteries\n if (flashlight != null &&\n batteries === null &&\n flashlight.useStatus === true &&\n flashlight.life > 0) {\n flashlight.life = flashlight.life - 10;\n flashlight.timerRunning = true;\n }\n\n // Restore the flashlight if the player has batteries\n if (batteries != null &&\n flashlight != null &&\n flashlight.useStatus === true) {\n flashlight.life = 100;\n }\n }", "title": "" }, { "docid": "ea0fdad85f3e83ad1a260eb43e68c807", "score": "0.507087", "text": "function getScore(item) {return item.score;}", "title": "" }, { "docid": "c859280e14c7d4d7772b4a6d75d57435", "score": "0.504531", "text": "updateInfo()\n {\n if (this.detached) return;\n\n const player = store.getState().player;\n \n const index = this.inventory.rows.selected;\n const item = player.inventory.items[index];\n \n let infoContent = '';\n if (item) {\n infoContent = `{bold}${item.name}{/bold}\\n`; \n Object.keys(item.attributes).forEach(attr => {\n if (item.attributes[attr])\n infoContent += `\\n${attr}: {cyan-fg}${item.attributes[attr]}{/}`;\n });\n }\n \n this.info.setContent(infoContent);\n this.screen.render();\n }", "title": "" }, { "docid": "f3465c9c6daebee725d3f7749118263b", "score": "0.50443065", "text": "function matchItem(item) {\n console.log('matched');\n console.log(Object.keys(menuList));\n\n if (item in menuList) {\n document.getElementById('rate').value = menuList[item];\n }\n }", "title": "" }, { "docid": "8836f564d6c0bac12e409734c2a44cbd", "score": "0.50356174", "text": "function popup(item) {\nvar element = items[item];\n$(\"#shoppePop\").show();\n$(\"#price\").html(\"Price: $\" + element.price);\n$(\"#item\").attr(\"src\", element.src);\n$(\"#hidden\").val(item);\n}", "title": "" }, { "docid": "30587b225d08ca82fcb6885cfdd65acf", "score": "0.5030889", "text": "function C101_KinbakuClub_Erica_AddedEgg() {\n\tif (PlayerHasLockedInventory(\"VibratingEgg\")) OverridenIntroText = GetText(\"ChangeEgg\");\n\telse PlayerLockInventory(\"VibratingEgg\");\n}", "title": "" }, { "docid": "6755ac490b5c782e24f1fd8e26f295c6", "score": "0.5029175", "text": "function gainLife()\n {\n if(lives >= 5)\n {\n score = score + (increment * 2);\n }\n else\n {\n lives++;\n }\n popBonus();\n displayMenu();\n }", "title": "" }, { "docid": "2c63fed8219c0136835c70ab1c0b1c3d", "score": "0.50237644", "text": "getExpenseInfo() {\n const { params } = this.props.navigation.state;\n const editItem = params ? params.editItem : null;\n if(this.state.editActive)\n {\n const expense = {\n store: this.state.store,\n items: this.state.items,\n total: this.state.total\n };\n return(\n <FormFields\n error={this.showError.bind(this)}\n editActive={true}\n expense={expense}\n submit={this.submitEdit.bind(this)}\n submitText=\"Save\"\n />\n );\n } else {\n const { prevouslyEdited } = this.state;\n return (\n <React.Fragment>\n <Text style={styles.itemText}>\n Store: {prevouslyEdited ? this.state.store : editItem.store}\n </Text>\n <Text style={styles.itemText}>\n Items: \n </Text>\n {this.renderItemsFromExpense(\n prevouslyEdited ? this.state.items : editItem.items\n )}\n <Text style={styles.itemText}>\n Total: ${prevouslyEdited ? this.state.total : editItem.total}\n </Text>\n </React.Fragment>\n );\n }\n }", "title": "" }, { "docid": "bf3f6e4098d26a200d5ca9062166c237", "score": "0.5019716", "text": "function experience(year) {\n if (yearsStudy < 2) {\n console.log('Beginner')\n } else if (year > 1 && year < 4) {\n console.log('Intermediate')\n } else if (year > 3 && year < 7) {\n console.log('Advanced')\n } else if (year > 6) {\n console.log('Jedi Master')\n }\n}", "title": "" }, { "docid": "4d917132178e255820570b53ac4e88eb", "score": "0.5015409", "text": "async amountofItemCollectedUI(player, item) {\r\n if (this.collectItemVisible == true) {\r\n this.collectItemUI.setVisible(false);\r\n this.collectItemUIAmount.setVisible(false); \r\n }\r\n\t\tlet xAnchor = this.cameras.main.centerX - (this.cameras.main.width / 2);\r\n this.collectItemUI = this.add.text(xAnchor,0,\"You Collected An Item!\");\r\n this.collectItemUI.setVisible(true);\r\n this.collectItemUIAmount = this.add.text(xAnchor,15,this.itemsCollected + \"/\" + this.itemsLefttoCollect);\r\n await this.sleep(2000);\r\n this.collectItemVisible = false;\r\n this.collectItemUI.setVisible(false);\r\n this.collectItemUIAmount.setVisible(false);\r\n }", "title": "" }, { "docid": "aec6a30ee11e88a1c9ea0d5989ec1253", "score": "0.5002166", "text": "function theItem(){\n\t\tmessageClass.style.display = \"none\";\n\n\t\tevent.preventDefault();\n\n\t\tlinkClick.map((el, i, arr) => {\n\t\t\tel.classList.remove('active');\n\t\t})\n\n\t\tthis.classList.add(\"active\");\n\n\t\tlet num = parseInt((this.innerHTML + \"0\") - 10);\n\n\t\tlet itemToDisplay = studentItems.slice(num, num + 10);\n\n\t\tstudentItems.map(el => el.style.display = \"none\");\n\n\t\titemToDisplay.map((el, i, arr) => {\n\t\t\tel.style.display = \"block\";\n\t\t});\n}", "title": "" }, { "docid": "bf509d717e1f3d628a791cd1e4911393", "score": "0.4991861", "text": "function useItem( foe ) {\n\t//alert(\"You drink a health potion.\");\n\tplayer.health += getRand(3) + 2; //30% - 50%\n\tenemyAttack( foe );\n}", "title": "" }, { "docid": "26f65c5291338410071c0ed4e20ebd38", "score": "0.49897298", "text": "async roll() {\n\t\tif (this.rolled) {\n\t\t\tconsole.log(\"Already rolled!\", this);\n\t\t\treturn;\n\t\t}\n\n\t\tHooks.call(\"preRollItemBetterRolls\", this);\n\n\t\tconst item = await this.getItem();\n\t\tconst actor = await this.getActor();\n\n\t\t// Pre-update item configurations which updates the params\n\t\tif (item) {\n\t\t\tawait ItemUtils.ensureFlags(item, { commit: true });\n\n\t\t\t// Set up preset but only if there aren't fields\n\t\t\tif (!this.fields || this.fields.length === 0) {\n\t\t\t\tthis.params.preset = this.params.preset ?? 0;\n\t\t\t\tif (Number.isInteger(this.params.preset)) {\n\t\t\t\t\tawait this.updateForPreset();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get Params\n\t\tconst params = this.params;\n\t\tconst consume = params.consume;\n\t\tlet placeTemplate = params.useTemplate;\n\n\t\t// Determine spell level and configuration settings\n\t\tif (item?.data.type === \"spell\" && consume && !params.slotLevel) {\n\t\t\tconst config = await this.configureSpell();\n\t\t\tif (config === \"error\") {\n\t\t\t\tthis.error = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tplaceTemplate = config.placeTemplate;\n\t\t}\n\n\t\t// Update item casted level property to match the slot level\n\t\t// This ensure things like the property list showing the correct spell level\n\t\tif (item && this.params.slotLevel) {\n\t\t\titem.data.update({ 'data.castedLevel': this.params.slotLevel });\n\t\t}\n\n\t\t// Show Advantage/Normal/Disadvantage dialog if enabled\n\t\tconst hasAttack = this.fields.some(\n\t\t\t(f) => [\"attack\", \"check\", \"custom\", \"tool\", \"toolcheck\"].includes(f[0]) && !f[1]?.rollState);\n\t\tif (!this.params.rollState && getSettings().queryAdvantageEnabled && hasAttack) {\n\t\t\tconst rollState = await new Promise(resolve => {\n\t\t\t\tnew Dialog({\n\t\t\t\t\ttitle: i18n(\"brSnS.querying.title\"),\n\t\t\t\t\tbuttons: {\n\t\t\t\t\t\tdisadvantage: {\n\t\t\t\t\t\t\tlabel: i18n(\"brSnS.querying.disadvantage\"),\n\t\t\t\t\t\t\tcallback: () => resolve(\"lowest\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnormal: {\n\t\t\t\t\t\t\tlabel: i18n(\"brSnS.querying.normal\"),\n\t\t\t\t\t\t\tcallback: () => resolve(\"first\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tadvantage: {\n\t\t\t\t\t\t\tlabel: i18n(\"brSnS.querying.advantage\"),\n\t\t\t\t\t\t\tcallback: () => resolve(\"highest\")\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tclose: () => resolve(\"cancel\")\n\t\t\t\t}).render(true);\n\t\t\t});\n\n\t\t\tif (rollState === \"cancel\") {\n\t\t\t\tthis.error = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.params.rollState = rollState;\n\t\t}\n\n\t\t// Check if we need to consume ammo. It will be consumed later (so that attack calcs work properly)\n\t\t// This consumes even if consuming is globally disabled. Roll repeats need to consume ammo.\n\t\tlet ammo = null;\n\t\tlet ammoUpdate = {};\n\t\tif (actor && item) {\n\t\t\tconst request = this.params.useCharge;\n\t\t\tconst consume = item.data.data.consume;\n\t\t\tif (request.resource && consume?.type === \"ammo\") {\n\t\t\t\tammo = actor.items.get(consume.target);\n\t\t\t\tconst usage = item._getUsageUpdates({consumeResource: true});\n\t\t\t\tif (usage === false) {\n\t\t\t\t\tthis.error = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tammoUpdate = usage.resourceUpdates || {};\n\t\t\t}\n\t\t}\n\n\t\t// Process all fields (this builds the data entries)\n\t\tfor (const field of this.fields) {\n\t\t\tawait this._processField(field);\n\t\t}\n\n\t\t// Consume ammo (now that fields have been processed)\n\t\tif (ammo && !isObjectEmpty(ammoUpdate)) {\n\t\t\tawait ammo.update(ammoUpdate);\n\t\t}\n\n\t\t// Post-build item updates\n\t\tif (item) {\n\t\t\t// Check to consume charges. Prevents the roll if charges are required and none are left.\n\t\t\tif (consume) {\n\t\t\t\tlet chargeCheck = await this.consume();\n\t\t\t\tif (chargeCheck === \"error\") {\n\t\t\t\t\tthis.error = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load Item Footer Properties if params.properties is true\n\t\t\tif (params.properties) {\n\t\t\t\tthis.properties = ItemUtils.getPropertyList(item);\n\t\t\t}\n\n\t\t\t// Place the template if applicable\n\t\t\tif (placeTemplate) {\n\t\t\t\tItemUtils.placeTemplate(item);\n\t\t\t}\n\t\t}\n\n\t\tthis.rolled = true;\n\t\tthis.error = false;\n\t\tawait Hooks.callAll(\"rollItemBetterRolls\", this);\n\t\tawait new Promise(r => setTimeout(r, 25));\n\n\t\t// Add models (non-hidden) to dice pool (for 3D Dice)\n\t\tfor (const entry of this.entries) {\n\t\t\tif (entry.type === \"multiroll\") {\n\t\t\t\tthis.dicePool.push(...entry.entries.map(e => e.roll), entry.bonus);\n\t\t\t} else if (entry.type === \"damage-group\" && !entry.prompt) {\n\t\t\t\tfor (const subEntry of entry.entries) {\n\t\t\t\t\tif (subEntry.type === \"damage\" || (subEntry.type === \"crit\" && subEntry.revealed)) {\n\t\t\t\t\t\tthis.dicePool.push(subEntry.baseRoll, subEntry.critRoll);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "75296852c322471b2e2b5362869a7dc0", "score": "0.4989686", "text": "function showItems (current_day) {\n // Display attraction on itinerary\n attractions.forEach(function(attraction) {\n for (i=0; i<daily_plan[current_day][attraction+'s'].length; i++) {\n $('#'+attraction+'_itinerary').append('<li>'+daily_plan[current_day][attraction+'s'][i].place[0].name+'</li>');\n }\n })\n // Display attraction map marker\n for (i=0; i<daily_plan[day_no]['markers'].length; i++) {\n daily_plan[day_no]['markers'][i].setMap(map);\n }\n}", "title": "" }, { "docid": "4e9ef4bd0eb2aabaca4457d07c0a9c08", "score": "0.49894202", "text": "equip() {\n let index = this.windowChoicesTabs.currentSelectedIndex;\n let character = Game.current.teamHeroes[index];\n let gameItem = this.windowChoicesList\n .getCurrentContent().item;\n let id = Datas.BattleSystems.equipmentsOrder[this.windowChoicesEquipment\n .currentSelectedIndex];\n let prev = character.equip[id];\n character.equip[id] = gameItem;\n // Remove one equip from inventory\n let item;\n for (let i = 0, l = Game.current.items.length; i < l; i++) {\n item = Game.current.items[i];\n if (item.kind === gameItem.kind && item.system.id === gameItem.system.id) {\n item.remove(1);\n break;\n }\n }\n if (prev) {\n let item = Item.findItem(prev.kind, prev.system.id);\n if (item === null) {\n prev.add(1);\n }\n else {\n item.add(1);\n }\n }\n this.updateStats();\n }", "title": "" }, { "docid": "65411936cef1fd117a3f9ff5a0e300c3", "score": "0.49880326", "text": "function showItem(elmt) {\n \n var itemID = Exhibit.getAttribute(elmt, \"title\"); \n var uiContext = exhibit.getUIContext();\n var heading = elmt.getElementsByTagName(\"span\");\n heading = heading[0].innerHTML;\n itemID = '<b>'+heading+'</b><br>'+itemID;\n\t//console.log(itemID);\n //Exhibit.UI.showItemInPopup(itemID, elmt, exhibit.getUIContext());\n Exhibit.UI.showItemInPopup = function(itemID, elmt, uiContext, opts) {\n\t\t//SimileAjax.WindowManager.popAllLayers();\n\n opts = opts || {};\n opts.coords = opts.coords || Exhibit.UI.calculatePopupPosition(elmt);\n\n var itemLensDiv = document.createElement(\"div\");\n itemLensDiv.innerHTML=itemID;\n\t\t/*var close = function () {\n\t\t\t//console.log(\"Trying to close \");\n\t\t\t//console.log(itemLensDiv);\n\t\t\t//console.log(bubble);\n\t\t\t//document.body.removeChild(itemLensDiv);\n\t\t};*/\n\t\t//console.log(SimileAjax.WindowManager._layers);\n\t\t//var layer = SimileAjax.WindowManager.pushLayer(close, true, itemLensDiv);\n\t\t//console.log(SimileAjax.WindowManager._layers);\n var lensOpts = {\n inPopup: true,\n coords: opts.coords\n };\n\n if (opts.lensType == 'normal') {\n lensOpts.lensTemplate = uiContext.getLensRegistry().getNormalLens(itemID, uiContext);\n } else if (opts.lensType == 'edit') {\n lensOpts.lensTemplate = uiContext.getLensRegistry().getEditLens(itemID, uiContext);\n } else if (opts.lensType) {\n SimileAjax.Debug.warn('Unknown Exhibit.UI.showItemInPopup opts.lensType: ' + opts.lensType);\n }\n\n uiContext.getLensRegistry().createLens(itemID, itemLensDiv, uiContext, lensOpts);\n\n SimileAjax.Graphics.createBubbleForContentAndPoint(\n itemLensDiv, \n opts.coords.x,\n opts.coords.y, \n\t\t\tuiContext.getSetting(\"bubbleWidth\"));\n }(itemID, elmt, exhibit.getUIContext());\n\t\n\t/*Exhibit.UI.showItemInPopup = function(itemID, elmt, uiContext, opts) {\n var itemLensDiv, lensOpts;\n\n $(document).trigger(\"closeAllModeless.exhibit\");\n\n opts = opts || {};\n opts.coords = opts.coords || Exhibit.UI.calculatePopupPosition(elmt);\n \n //itemLensDiv = $(\"<div>\");\n\tvar itemLensDiv = document.createElement(\"div\");\n\titemLensDiv.innerHTML=itemID;\n\tconsole.log(\"in show item popup\"+itemID);\n lensOpts = {\n inPopup: true,\n coords: opts.coords\n };\n\n if (opts.lensType === \"normal\") {\n lensOpts.lensTemplate = uiContext.getLensRegistry().getNormalLens(itemID, uiContext);\n } else if (opts.lensType === \"edit\") {\n lensOpts.lensTemplate = uiContext.getLensRegistry().getEditLens(itemID, uiContext);\n } else if (opts.lensType) {\n Exhibit.Debug.warn(Exhibit._(\"%general.error.unknownLensType\", opts.lensType));\n }\n\n uiContext.getLensRegistry().createLens(itemID, itemLensDiv, uiContext, lensOpts);\n \n $.simileBubble(\"createBubbleForContentAndPoint\",\n itemLensDiv, \n opts.coords.x,\n opts.coords.y, \n uiContext.getSetting(\"bubbleWidth\")\n );\n}(itemID, elmt, exhibit.getUIContext());*/\n}", "title": "" }, { "docid": "4a34218df9d8fe3524a3a0e1176dafef", "score": "0.49866748", "text": "get impact() {\n return this._impact;\n }", "title": "" }, { "docid": "e3881cd0282c3574407191e40d096914", "score": "0.49825022", "text": "function showPerson(){\nconst item = reviews[currentItem];\nimage.src = item.image;\nauthor.textContent = item.author;\njob.textContent = item.job;\ninfo.textContent = item.text;\n}", "title": "" }, { "docid": "0602c55d6f8c82302f1f7a9b2ea8b8e1", "score": "0.4972854", "text": "renderAllExperiences(index, output) {\n var data = output[index].results;\n if (this.state.openPosIndex !== -1)\n data = this.state.pos[this.state.posArr[this.state.openPosIndex]]\n\n // creates an array of each review, to create the list items\n const range = Array.from(Array(data.length).keys())\n const listItems = range.map((i) => this.renderExperience(i, data))\n\n return (<div><Card style={{overflow: 'auto', maxHeight: \"35vh\"}} zdepth={2}>\n <CardText style={{whiteSpace: 'pre-line'}}>\n <b><u> Experiences </u></b> <br />\n <List>{listItems}</List>\n </CardText>\n </Card></div>);\n }", "title": "" }, { "docid": "eee1b1b4316012e28e9684920033d1ad", "score": "0.49638063", "text": "getInvest() {\n if (this.Invest) {\n return this.Invest;\n }\n return 0;\n }", "title": "" }, { "docid": "528fe7f5577e5f7cccb023576590e1a6", "score": "0.49560067", "text": "giveItem() {\n if (hasItem == true && !this.physics.world.overlap(this.playerOne, this.bonusGroup, this.addItem, null, this)) {\n score += 500;\n this.collectNoise.play();\n hasItem = false;\n }\n }", "title": "" }, { "docid": "82eb3c7c91261adc460ebf6613dd05ac", "score": "0.49526295", "text": "function edgtfItemShowcase() {\n var itemShowcase = $('.edgtf-item-showcase');\n if (itemShowcase.length) {\n itemShowcase.each(function(){\n var thisItemShowcase = $(this),\n leftItems = thisItemShowcase.find('.edgtf-item-left'),\n rightItems = thisItemShowcase.find('.edgtf-item-right'),\n itemImage = thisItemShowcase.find('.edgtf-item-image');\n\n //logic\n leftItems.wrapAll( \"<div class='edgtf-item-showcase-holder edgtf-holder-left' />\");\n rightItems.wrapAll( \"<div class='edgtf-item-showcase-holder edgtf-holder-right' />\");\n thisItemShowcase.animate({opacity:1},200);\n setTimeout(function(){\n thisItemShowcase.appear(function(){\n itemImage.addClass('edgtf-appeared');\n thisItemShowcase.on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend',\n function(e) {\n if(edgtf.windowWidth > 1200) {\n itemAppear('.edgtf-holder-left .edgtf-item');\n itemAppear('.edgtf-holder-right .edgtf-item');\n } else {\n itemAppear('.edgtf-item');\n }\n });\n },{accX: 0, accY: 0});\n },100);\n\n //appear animation trigger\n function itemAppear(itemCSSClass) {\n thisItemShowcase.find(itemCSSClass).each(function(i){\n var thisListItem = $(this);\n setTimeout(function(){\n thisListItem.appear(function(){\n $(this).addClass('edgtf-appeared');\n },{accX: 0, accY: 0});\n }, i*150);\n });\n }\n });\n\n }\n }", "title": "" }, { "docid": "2fe86fe796c2709782067bf295624d90", "score": "0.49502575", "text": "function calculateProfitAndLoss(initial, quantity, current) {\n if(initial > current){\n var loss = (initial - current) * quantity;\n var lossPer = ((loss/initial) * 100).toFixed(2)\n document.body.style.backgroundColor = \"#EF4444\"\n \n showOutput(`sorry, you got loss of ${loss} and loss percentage is ${lossPer}`)\n\n }else if(initial < current){\n var profit = (current - initial)*quantity\n var profitPer = ((profit/initial) * 100).toFixed(2)\n\n document.body.style.backgroundColor = \"#6EE7B7\"\n showOutput(`yupee, you made a proft of ${profit} and profit percentage is ${profitPer}`)\n }\n else{\n showOutput(\"no pain no gain\")\n }\n}", "title": "" }, { "docid": "f6db8bda554d32cd2bf219076b253c04", "score": "0.49448055", "text": "function updateAPLDisplay() {\n var apl = calculateAPL()\n var selectedDiff = $('#DifficultyPicker').val().trim();\n var diffNum = difficulty[selectedDiff];\n var encounterCR = apl + diffNum;\n if (encounterCR == 0) {encounterCR = \"1/2\"}\n var xpBudget = xp[encounterCR.toString()];\n var xpUsed = addXP();\n\n $('#aplDisplay').html('APL: <b>' + apl.toString() + '</b>');\n $('#crDisplay').html('Encounter CR: <b>' + encounterCR.toString() + '</b>');\n $('#xpDisplay').html('XP Budget: <b id=\"xpBold\">' + xpUsed + '/' + xpBudget + '</b>');\n\n if (xpUsed > xpBudget) {\n $('#xpBold').addClass('highlight-shadow');\n } else {\n $('#xpBold').removeClass('highlight-shadow');\n }\n}", "title": "" }, { "docid": "01fdbc3085bbf9185a3825c0297fd8bd", "score": "0.49441367", "text": "function availableItems() { \n for (i=1;i<5;i++) {\n // UNLOCK any items player HASNT bought but CAN afford\n if (player.totalEarnings >= tools[i].toolCost && tools[i].purchased == false) {\n let changeText = document.querySelector(\".tool\"+i);\n changeText.style.color = \"lime\";\n changeText.innerHTML = `BUY`;\n // LOCK any items player HASNT bought and CANT afford\n } else if (player.totalEarnings < tools[i].toolCost && tools[i].purchased == false) {\n let changeText = document.querySelector(\".tool\"+i);\n changeText.style.color = \"rgba(255, 255, 255, 0.685)\";\n changeText.innerHTML = `$${tools[i].toolCost}`;\n } else {\n }\n }}", "title": "" }, { "docid": "02b641b49e36fb0166b6ac2b2b1efff0", "score": "0.49338", "text": "function showSkill(skill) {\n var content =\n '<p>' + skill.title + '</p>' +\n '<div class=\"w3-light-grey w3-round-xlarge w3-small\" style=\"color:#52B77C;\">' +\n '<div class=\"w3-container w3-center w3-round-xlarge w3-teal\" style=\"width:' + skill.skill_level + '%\">' + skill.skill_level + '%</div>' +\n '</div>'\n $('#skills-list').append(content);\n}", "title": "" }, { "docid": "ab340954cff7c29fca09afd2b306a969", "score": "0.49310046", "text": "function achievementCurrent (accountData, id, pointsPerRepeat = 0) {\n if (!accountData.achievements) {\n return null\n }\n\n // Find the achievement\n const achievement = accountData.achievements.find(x => x.id === id)\n\n // The achievement does not exist, so the user did not start it\n if (!achievement) {\n return 0\n }\n\n // Sum up the total value of the achievement\n return (achievement.repeated || 0) * pointsPerRepeat + achievement.current\n}", "title": "" }, { "docid": "2cf0fef811af26291e03a4d7516d9ef6", "score": "0.49170968", "text": "function pickUpItem(heroObj, weaponObj) {\n weaponObj.type = \"dagger\";\n weaponObj.damage = 2;\n heroObj.inventory.push(weaponObj);\n \n displayStats(hero); \n}", "title": "" }, { "docid": "e8692943ae2ccacaed0a1ca4b2d7835a", "score": "0.49156183", "text": "function showPerson(){\n const item = reviews[currentItem];\n img.src = item.img;\n author.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text;\n}", "title": "" }, { "docid": "8525afa44823c4344f4439ef818fc430", "score": "0.4912496", "text": "function showIncome(index) {\n setIncome(income[index].income);\n setMonth(months[income[index].month - 1]);\n document.getElementsByClassName('income')[0].style.display = \"flex\"\n document.getElementsByClassName('spendings')[0].style.display = \"none\"\n }", "title": "" }, { "docid": "d04df9a4d0b933531ced863b90417f38", "score": "0.4910259", "text": "function takeItem(userChoice) {\n\tuserChoice = userChoice.join(' ');\n\tlet item;\n\tfor (let obj in guide) {\n\t\tif (userChoice.includes(obj)) {\n\t\t\titem = obj;\n\t\t}\n\t}\n\tif (!(guide[item] === undefined)) {\n\t\tif (guide[item].seen === true) {\n\t\t\tif (guide[item].room === guide.room) {\n\t\t\t\tsetPrior();\n\t\t\t\tif (guide[item].canBeTaken === true) {\n\t\t\t\t\tdisplayText = `You took the ${item}`;\n\t\t\t\t\tguide[item].canBeTaken = false;\n\t\t\t\t\tguide[item].room = 'inventory';\n\t\t\t\t\tguide.inventory.push(item);\n\t\t\t\t\tinventorySetup();\n\t\t\t\t\tif (item === 'book') {\n\t\t\t\t\t\tguide['night stand'].description = `A small bedside NIGHT STAND.`;\n\t\t\t\t\t} else if (item === 'poem') {\n\t\t\t\t\t\tguide.desk.description = `A wooden DESK with a single DESK DRAWER.`;\n\t\t\t\t\t} else if (item === 'ribbon') {\n\t\t\t\t\t\tguide.wastebin.description = `A WASTEBIN that's empty. What a bunch of rubbish.`;\n\t\t\t\t\t} else if (item === 'heart key') {\n\t\t\t\t\t\tguide.rug.description = 'A red, spiral RUG. It covers most of the floor.';\n\t\t\t\t\t\tguide.bedroom.down = `There is a red, spiral RUG below your feet.`;\n\t\t\t\t\t} else if (item === 'plunger') {\n\t\t\t\t\t\tdisplayText = 'You take the PLUNGER and close the CABINET.';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdisplayText = `The item either can't be taken or it's already in your inventory.`;\n\t\t\t\t}\n\t\t\t\tsetCurrent();\n\t\t\t} else {\n\t\t\t\twrongRoomError();\n\t\t\t}\n\t\t} else {\n\t\t\tseeError();\n\t\t}\n\t} else {\n\t\terrorMessage();\n\t}\n}", "title": "" }, { "docid": "7dc3bb8ac6776cfd4287f54d36e5e50c", "score": "0.49092665", "text": "function getResult() {\n let pensionDeficit; // in US trillions\n if (document.getElementById('interactive-option--uk').getAttribute('aria-pressed') === 'true') {\n if (document.getElementById('interactive-option--public').getAttribute('aria-pressed') === 'true') {\n pensionDeficit = 0.06172; // UK public\n } else {\n pensionDeficit = 0.196; // UK private\n }\n } else {\n if (document.getElementById('interactive-option--public').getAttribute('aria-pressed') === 'true') {\n pensionDeficit = 3.41; // US public\n } else {\n pensionDeficit = 0.638; // US private\n }\n }\n\n const name = document.getElementById('interactive-compare').value;\n const category = _.findWhere(data, { name }).category;\n const value = _.findWhere(data, { name }).value;\n\n let unit = '(market cap)';\n if (category === 'country') {\n unit = '(GDP)';\n }\n\n let thanOf = ' than ';\n\n let multiplyFactor = pensionDeficit / value;\n let interactiveText;\n\n if (multiplyFactor < 1) {\n // if (Math.round(1 / multiplyFactor) !== 1) {\n // multiplyFactor = Math.round(1 / multiplyFactor);\n // } else {\n // multiplyFactor = Math.round(1000 / multiplyFactor) / 1000;\n // }\n // multiplyFactor = numberWithCommas(multiplyFactor);\n // let percentNum = 100 - Math.round(100 / multiplyFactor);\n // if (percentNum === 100) {\n // percentNum = 100 - Math.round(1000 / multiplyFactor) / 10;\n // }\n const percentNum = Math.round(multiplyFactor * 100);\n interactiveText = `<div class='multiplier'>${percentNum}% </div><br />the size`;\n thanOf = ' of ';\n } else {\n if (Math.round(1 / multiplyFactor) !== 1) {\n multiplyFactor = numberWithCommas(Math.round(multiplyFactor));\n } else {\n multiplyFactor = Math.round(multiplyFactor * 100) / 100;\n }\n interactiveText = `<div class='multiplier'>${multiplyFactor} </div><br />times bigger`;\n }\n\n document.getElementById('interactive-compare-text').innerHTML = name;\n document.getElementById('thanhack').innerHTML = thanOf;\n document.getElementById('interactive-unit').innerHTML = unit;\n document.getElementById('interactive-result').innerHTML = interactiveText;\n\n changeTweetText();\n colorCode();\n }", "title": "" }, { "docid": "0a674083e407e28a74584649d8f94981", "score": "0.49019575", "text": "renderInterview(i, dataA) {\n const data = dataA[i]; \n return (\n <div>\n <ListItem disabled={true}\n leftIcon={<ContentSend/>} initiallyOpen={true}>\n {this.interviewText(data)}\n </ListItem>\n <Divider /></div>)\n }", "title": "" }, { "docid": "68e04dd1a4a28231ee7b04d64a2bf098", "score": "0.48822823", "text": "handleIncome(item, ecosystem) {\r\n let unit = this.util.formatUnit(ecosystem, true);\r\n let result = ``;\r\n const account = this.auth.getUser('key_id');\r\n // console.log(account);\r\n const objShow =\r\n item.sender_id == item.recipient_id\r\n ? { mark: '+-', color: '#3961f5' }\r\n : item.recipient_id == account\r\n ? { mark: '+', color: '#04B78A' }\r\n : item.sender_id == account\r\n ? { mark: '-', color: '#EE2E6B' }\r\n : { mark: '', color: '' };\r\n const { mark, color } = objShow;\r\n result = `<font color=\"${color}\">${mark} ${this.util.formatAmountData(\r\n item.amount\r\n )} ${unit}</font>`;\r\n return result;\r\n }", "title": "" }, { "docid": "e91dbc722e1bce4ad8f2b772b84452af", "score": "0.48779118", "text": "function doQuality(selected) {\n\tfor (let n = 1; n <= 2; n++) {\n\t\tdocument.getElementById(\"select_superior_\"+n).style.display = \"none\";\n\t\tdocument.getElementById(\"select_superior_value_\"+n).style.display = \"none\";\n\t}\n\tif (selected == 2) {\n\t\tdocument.getElementById(\"select_superior_1\").style.display = \"block\";\n\t\titemCustom.superior = true;\n\t\titemCustom.inferior = false;\n\t\titemCustom.name_prefix = \"Superior \";\n\t\tload(\"superior\");\n\t} else {\n\t\tdata.superior = {index:[0],categories:{}}\n\t\titemCustom.sup = 0;\n\t\titemCustom.superior = false;\n\t\tif (selected == 1) {\n\t\t\titemCustom.inferior = true;\n\t\t\tvar inferior_prefixes = [\"Low Quality \", \"Cracked \", \"Crude \", \"Damaged \"];\n\t\t\tvar r = Math.floor(Math.random()*4);\n\t\t\titemCustom.name_prefix = inferior_prefixes[r];\n\t\t\t// TODO: pointmods cannot be from tier 5/6, and cannot be more than +1\n\t\t\t// TODO: durability & defense/damage may be affected\n\t\t} else {\n\t\t\titemCustom.inferior = false;\n\t\t\titemCustom.name_prefix = \"\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f8d42dd41e1b0fca5516a791b0620e57", "score": "0.48753846", "text": "updateStats() {\n const index = this.windowChoicesTabs.currentSelectedIndex;\n this.party()[index].updateEquipmentStats(this.list, this.bonus);\n }", "title": "" }, { "docid": "2253fa9a485a163e2cce4121fd130d6f", "score": "0.48747146", "text": "function showShopItem(item, show) {\n if (show && item.cost >= 0) {\n $(\"#\" + item.id).css(\"opacity\", \"1\");\n $(\"#about-img-\" + item.id).css(\"opacity\", \"1\");\n item.hidden = false;\n } else {\n $(\"#\" + item.id).css(\"opacity\", \"0.3\");\n $(\"#about-img-\" + item.id).css(\"opacity\", \"0.3\");\n item.hidden = true;\n }\n}", "title": "" }, { "docid": "53dc991c2a542e95ba3583f7157ac646", "score": "0.48740458", "text": "async showPetsForSale() {\n const character = this.character;\n const location = character.location;\n\n const petsOwned = await PetsOwned.load(character);\n\n let description = location.getDescription(character)\n + character.location.getShopDescription(character, 'pets')\n + __('\\nYou review the pets on offer:');\n let actions = new Actions();\n let options = new Options();\n\n const petsForSale = location.getUnownedShopPets(character, petsOwned);\n\n if (petsForSale.length === 0) {\n return await this.updateLast({\n attachments: Attachments.one({\n title: __(':warning: There are no pets for sale at this time.'),\n color: COLORS.WARNING,\n }),\n doLook: true,\n });\n }\n\n for (const petType of petsForSale) {\n const pet = Items.new(petType, { character });\n const canBuyText = pet.canBePurchasedBy(character) ? '✓' : '✗';\n\n options.add(\n `${pet.getDisplayName(character)} ${canBuyText}`,\n { action: ACTION_BUY, step: STEP_CONFIRM, pet: pet.type }\n );\n description += `\\n>- ${pet.getDisplayName(character)} (${pet.getCostDescription(character)}): ${pet.getShopDescription(character)}`;\n }\n\n actions.addSelect(__(\"Pets\"), \"pets\", options.getCollection());\n\n actions.addButton(__(\"Cancel\"), \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({\n description,\n attachments: Attachments.one({\n title: __('Which do you want to bring home?'),\n actions,\n })\n });\n }", "title": "" }, { "docid": "d7ba8c22e855817cca296fb41eeb99ae", "score": "0.4869172", "text": "display_items() {\n // Init items as current section\n let { items } = PLEX.current_section;\n\n // Check if current seen is not \"all\"\n if (PLEX.current_seen !== 'all') {\n // Set items filtered as current seen\n items = PLEX.filter_items_by_seen(items, PLEX.current_seen);\n }\n\n // Check if there is a filter value set\n if (PLEX._section_filter.value !== '') {\n // Set items filtered as filter value match\n items = PLEX.filter_items_by_term(items, PLEX._section_filter.value);\n }\n\n // Check that current genre isn't \"all\"\n if (PLEX.current_genre !== 'all') {\n // Set items filtered as current genre\n items = PLEX.filter_items_by_genre(items, PLEX.current_genre);\n }\n\n // Check current director isn't \"all\"\n if (PLEX.current_director !== 'all') {\n // Set items filtered as current director\n items = PLEX.filter_items_by_director(items, PLEX.current_director);\n }\n\n // Reset the item list inner HTML\n PLEX._item_list.innerHTML = '';\n\n let numItems = 0; // Init the number of items\n let innerHTML = ''; // Init the inner HTML\n\n // Loop through the current section sorts\n PLEX.current_section.sorts[\n `${PLEX.current_sort_key}_${PLEX.current_sort_order}`\n ].forEach(key => {\n // If the item is undefined, skip\n if (typeof items[key] === 'undefined') return;\n const item = items[key]; // Set the item\n const thumb =\n item.thumb === false ? 'assets/images/default.png' : item.thumb; // Set the thumb\n\n // Set the data to the innerHTML\n innerHTML += `<li data-item=\"${item.key}\" class=\"item\" title=\"${item.title}\"><img src=\"${thumb}\" /><h4>${item.title}</h4></li>`;\n\n numItems += 1; // Increment the number of items\n });\n document.querySelector('#section_num_items').innerHTML=`Titles: `+numItems;\n\n // Update the item list inner HTML\n PLEX._item_list.innerHTML = innerHTML;\n // Check if there are no items\n if (numItems === 0) {\n PLEX._section_meta.innerText = 'No items in this collection'; // Update the section meta inner text\n PLEX._item_list_status.innerHTML =\n '<p>There are no items to display in this collection that matches the filters set.</p>'; // Update the item list status inner html\n PLEX._item_list_status.style.display = 'block'; // Show the item list status section\n \n } else {\n // There are items\n // Hide the item list status\n PLEX._container.style.display = 'grid';\n PLEX._section_header.style.display = 'block';\n PLEX._item_list_status.style.display = 'none';\n // Set the section meta inner text\n /* PLEX._section_meta.innerText = `${number_format(numItems)} ${inflect(\n numItems,\n 'item'\n )} in this collection`;*/\n }\n\n // $(document).trigger(\"scroll\");\n }", "title": "" }, { "docid": "dd592bffd73f2bd1f4d12400958d0f89", "score": "0.48671603", "text": "function succeed(item) {\n if(item.enhancement < 20) {\n return {...item, enhancement: item.enhancement+1}\n } else {\n return {...item}\n }\n}", "title": "" }, { "docid": "aeebc3b7b769e255d1451bdbd1088a51", "score": "0.48669103", "text": "_doDamages(damage, target){\n if(damage>0){\n var items=this.state.items;\n\n // Eyecandy efect on target\n if(target=='player' || target==this.state.currentEnemy){\n var div='#target-'+(target=='player'?'player':'enemy');\n $(div).css('backgroundColor', 'rgba(200, 0, 0,0.5)');\n var interval=setInterval(function () {\n $(div).css('backgroundColor', 'rgb(234, 234, 234)');\n clearInterval(interval);\n }, 200);\n $(div).fadeTo(100, 0.5).fadeTo(100,1);\n }\n\n // Remove life\n items[target].stats.life=items[target].stats.life-damage;\n\n // Check state\n if(items[target].stats.life <= 0){\n // Copy position\n let pPos=items[target].position;\n // Nice tomb\n var tomb='';\n switch(items[target].type){\n case 'player':\n tomb='tomb_stone_player';\n break;\n case 'enemy':\n tomb='tomb_stone';\n break;\n case 'boss':\n tomb='tomb_stone_boss';\n break;\n }\n items[target]=Object.assign({}, DEFAULT_ITEM, ITEMS[tomb]);\n // Re-set position\n items[target].position=pPos;\n }\n this.setState({items:items});\n }\n return this.state.items[target].stats.life || 0;\n }", "title": "" }, { "docid": "79b95e71a4649c42906165711579c7b3", "score": "0.48557344", "text": "modelDataExtractor(item) {\n\n let championDays = moment.duration(moment().diff(item.item.date)).days();\n\n let rightSideImageStack;\n if (item.item.deltas) {\n\n // Check who is winning: the champion of the retrained\n let champWins = 0;\n let retrainedWins = 0;\n for (var i = 0; i < item.item.deltas.length; i++) {\n\n let delta = item.item.deltas[i];\n\n if (delta.delta > 0) retrainedWins++;\n else champWins++;\n }\n\n let normalSize = 24;\n let smallSize = 12;\n\n rightSideImageStack = [\n { image: require('TotoML/img/fight.png'), size: champWins >= retrainedWins ? smallSize : normalSize },\n { image: require('TotoML/img/trophy.png'), size: champWins >= retrainedWins ? normalSize : smallSize },\n ]\n }\n\n return {\n title: item.item.name,\n avatar: {\n type: 'number',\n value: item.item.version\n },\n leftSideValue: {\n type: 'duration',\n value: championDays,\n unit: 'days'\n },\n rightSideImageStack: rightSideImageStack, \n rightSideLabel: item.item.totomlPythonSDKVersion\n }\n\n }", "title": "" }, { "docid": "86a8d92f46ebeb14fafc60566d40e73c", "score": "0.48539615", "text": "function showSolution(item) {\n let sessionControl = getItemSessionControl(item);\n return sessionControl.showSolution===\"true\";\n}", "title": "" }, { "docid": "95cc1437f87636dfea2182e272ea8fa4", "score": "0.48532382", "text": "function playerDisplay(){\n \n if (player.exp>=player.totalExperience){\n player.level++;\n page.infoBox.innerHTML+=\"<br> Congratulations! You have reached level \"+player.level+\"! \";\n player.totalExperience=5*player.level;\n player.exp=0;\n }\n page.characterBarElement.style.width = player.health*100/player.totalHealth+\"%\"\n page.characterHealthText.innerHTML= Math.round(player.health)+\" / \"+player.totalHealth;\n page.characterBarElementFlee.style.width = player.health*100/player.totalHealth+\"%\"\n page.characterHealthTextFlee.innerHTML = Math.round(player.health)+\" / \"+player.totalHealth;\n page.characterExperienceText.innerHTML=Math.round(player.exp*100/player.totalExperience)+\"%\"\n page.characterExperienceTextFlee.innerHTML=Math.round(player.exp*100/player.totalExperience)+\"%\"\n page.characterExperienceBar.style.width=player.exp*100/player.totalExperience+\"%\";\n page.characterExperienceBarFlee.style.width=player.exp*100/player.totalExperience+\"%\";\n }", "title": "" }, { "docid": "c6451bc492d94773f95b6c5fb81798f6", "score": "0.48457402", "text": "function updateExpPer() {\n var fields = document.querySelectorAll(\".item__percentage\");\n for (var i = 0; i < fields.length; i++) {\n var per = Math.round((valEx[i] / income) * 100);\n if (income != 0 && per > 0) {\n fields[i].textContent = per + \"%\";\n } else {\n fields[i].textContent = \"---\";\n }\n }\n }", "title": "" }, { "docid": "48f2d26f340c4174a9724dd4b741a435", "score": "0.48454744", "text": "updateAge() {\n\t\t$('#age').text(`Age: ${this.pet.increaseAge()}`);\n\t}", "title": "" }, { "docid": "bfa2c35dcdf8569043535d85ae40a069", "score": "0.4844977", "text": "onClickControlItem(item) {\n //Get the dayAPI and setDay function from props\n const { setDay, dayAPI, currentDay } = this.props;\n\n //If the day we are leaving has goals, update the day in memory\n if (currentDay.dayGoals.length !== 0) {\n this.props.dayAPI.pushDay(currentDay);\n }\n\n //Get Today's Day\n const today = dayAPI.getToday();\n\n //Do something based on the item clicked\n switch (item) {\n case \"Today\":\n setDay(today);\n break;\n case \"Yesterday\":\n setDay(dayAPI.getPreviousDay(today));\n break;\n case \"Tomorrow\":\n setDay(dayAPI.getNextDay(today));\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "7e9be5a4d0c0c67c692361621c11d51b", "score": "0.48445246", "text": "function LMSAPI_getAnticipatedItem() {\n\tvar href = window.lmsContentFrame.location.href;\n\tif (this.anticipatedItem != null) return this.anticipatedItem;\n\telse if (this.currentItem != null && href == this.currentItem.href) return this.currentItem;\n\telse return this.cam.organizations.findByHRef(href);\n}", "title": "" }, { "docid": "4b8d7547b2d01808d8dd6f3251fcab24", "score": "0.48409855", "text": "GetItem(item) {\n Alert.alert(item);\n }", "title": "" }, { "docid": "4b8d7547b2d01808d8dd6f3251fcab24", "score": "0.48409855", "text": "GetItem(item) {\n Alert.alert(item);\n }", "title": "" }, { "docid": "3fcf1c474ab5d56c6f4f8e568cb78219", "score": "0.4837169", "text": "itemCollected() {\r\n this.x = 1000;\r\n this.y = 1000;\r\n if (this.name == \"gem\") {\r\n gameSound.playGem();\r\n player.score += 50;\r\n setTimeout(() => {\r\n this.itemReset();\r\n }, 15000);\r\n } else {\r\n gameSound.playLife();\r\n player.life += 1;\r\n setTimeout(() => {\r\n this.itemReset();\r\n }, 30000);\r\n }\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "952da08be4aad89b16dec2d76d87c490", "score": "0.48348457", "text": "function itemHandler(player, item) {\n \n \n\n switch(item.key){\n case 'star': powerup = true;\n currentScore = currentScore + 20;\n item.kill();\n textoPowerUp.kill();\n break;\n case 'poison':lives = lives-1;\n \n item.kill(); \n generarNuevo();\n \n break;\n\n case 'fondo': break;\n case 'peach': \n \n\n break;\n\n\n default: currentScore = currentScore + 10;\n item.kill();\n \n if (currentScore === winningScore) {\n createBadge();\n }\n }\n \n}", "title": "" }, { "docid": "8cf1a40c6a0c27ec78ae2c5fb67f954b", "score": "0.483407", "text": "function updateSellSelectedButton() {\n getInventorySelectedMarketableItems(function(items) {\n var selectedItems = items.length;\n if (items.length == 0) {\n $('.sell_selected').hide();\n $('.sell_manual').hide();\n } else {\n $('.sell_selected').show();\n if (canSellSelectedItemsManually(items)) {\n $('.sell_manual').show();\n $('.sell_manual > span').text('Sell ' + selectedItems + (selectedItems == 1 ? ' Item Manual' : ' Items Manual'));\n } else {\n $('.sell_manual').hide();\n }\n $('.sell_selected > span').text('Sell ' + selectedItems + (selectedItems == 1 ? ' Item' : ' Items'));\n }\n });\n }", "title": "" } ]
4bc257cb87e7ccd1bccaea997fbf8013
Unobserves the entire keypath.
[ { "docid": "0615e9a6410e44767d644b98aee78ebd", "score": "0.59619725", "text": "unobserve() {\n let obj;\n let token;\n\n for (let index = 0; index < this.tokens.length; index++) {\n token = this.tokens[index]\n if (obj = this.objectPath[index]) {\n this.set(false, token, obj, this)\n }\n }\n\n if (isObject(this.target)) {\n this.set(false, this.key, this.target, this.callback)\n }\n }", "title": "" } ]
[ { "docid": "72e4d9171ec4ce83424c1b319fa9f859", "score": "0.62281704", "text": "unsubscribe (path, key, nocontext) {\n let id = this.uid\n if (key) {\n id += '.' + key\n }\n // make shared shit\n let pathType = typeof path\n if (path === true) {\n path = [] // make faster\n } else if (pathType === 'string') {\n id += path\n path = path.split('.')\n } else if (pathType === 'number') {\n id += path\n path = [path]\n } else {\n id += path.join('.')\n }\n\n let index = 0\n let length = path.length\n return unsubscribe(this, path, index, length, id, nocontext)\n }", "title": "" }, { "docid": "53d6a872bb9a58dd43281247c4cf6038", "score": "0.6036776", "text": "Unsub(key) {\n return this.s.Unsub(key);\n }", "title": "" }, { "docid": "c160b1ffbf4135043890582691b8a4e5", "score": "0.5884982", "text": "async pop(key, path) {\n try {\n const data = await this.get(key, path)\n if (!_isArray(data)) return undefined\n data.pop()\n await this.set(key, data, path)\n return\n } catch (err) {\n throw new Error(err)\n }\n }", "title": "" }, { "docid": "8cbbee486cc69d9748c28f9f5d0f9992", "score": "0.58209646", "text": "unload() {\n if (this._loaded_key !== null) {\n const key = this._loaded_key\n this._data = null;\n this._loaded_key = null;\n Log.dbg(\"config\", \"Unloaded. key: %o\", key)\n }\n }", "title": "" }, { "docid": "a630ac47850d0c6ad52d58dc35b8dce4", "score": "0.5802236", "text": "unassign( key ) {\n\n _.unset(this, key);\n\n }", "title": "" }, { "docid": "95bae2a37bcb93f966e0bfd59465cfed", "score": "0.580131", "text": "forget(key) {\n this.ensureIsReady();\n this.ensureIsMutable();\n this.store.unset(key);\n }", "title": "" }, { "docid": "6793e26ee39fdba907f1e9da1cf232a9", "score": "0.5766403", "text": "deletePropertyPath() {\n delete this.dangerousMutableThisObj[this.lastPathName];\n }", "title": "" }, { "docid": "e5382fcb1b20438016a89f44a5a5fdea", "score": "0.5728809", "text": "Unsub(key) {\n if (this.closed) {\n return false;\n }\n return delete this.m[key];\n }", "title": "" }, { "docid": "904c9261480dcbfb1006bb5f4e0d1144", "score": "0.5673563", "text": "function unsetPath(object, path) {\r\n if (isNotNestedPath(path)) {\r\n delete object[cleanupNonNestedPath(path)];\r\n return;\r\n }\r\n const keys = path.split(/\\.|\\[(\\d+)\\]/).filter(Boolean);\r\n let acc = object;\r\n for (let i = 0; i < keys.length; i++) {\r\n // Last key, unset it\r\n if (i === keys.length - 1) {\r\n unset(acc, keys[i]);\r\n break;\r\n }\r\n // Key does not exist, exit\r\n if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) {\r\n break;\r\n }\r\n acc = acc[keys[i]];\r\n }\r\n const pathValues = keys.map((_, idx) => {\r\n return getFromPath(object, keys.slice(0, idx).join('.'));\r\n });\r\n for (let i = pathValues.length - 1; i >= 0; i--) {\r\n if (!isEmptyContainer(pathValues[i])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n unset(object, keys[0]);\r\n continue;\r\n }\r\n unset(pathValues[i - 1], keys[i - 1]);\r\n }\r\n }", "title": "" }, { "docid": "4b6d691fbea177276cdcb0fb06ea4b73", "score": "0.5650973", "text": "Unsub(key) {\n // Entry key is the prefix of the key indicating which entry is belongs to.\n const entryKey = key.split(\"_\")[0];\n // Wildcard (\"*\") values are given the prefix \"global\".\n if (entryKey === \"global\") {\n // Run global unsub and return\n return this.unsub(key);\n }\n const entry = this.m[entryKey];\n if (!entry) {\n // Entry doesn't exist, return early\n return false;\n }\n // Unsubscribe provided key from entry\n return entry.Unsub(key);\n }", "title": "" }, { "docid": "18ea90ede8d759d72cb209b1a40eac86", "score": "0.55853313", "text": "unregister(type, key) {\n\t\ttype = normalizeType(type, true);\n\t\tdelete internals[type][key];\n\t}", "title": "" }, { "docid": "58e6a90070c1c4c38abdb4eaa8047c5a", "score": "0.5583056", "text": "stopObservingResource(path) {\r\n // remove observer\r\n const observerUrl = this.getObserverUrl(path);\r\n const index = this.observedPaths.indexOf(observerUrl);\r\n if (index === -1)\r\n return;\r\n node_coap_client_1.CoapClient.stopObserving(observerUrl);\r\n this.observedPaths.splice(index, 1);\r\n this.rememberedObserveCallbacks.delete(observerUrl);\r\n }", "title": "" }, { "docid": "a1a6a0cca1ba77cb579b50366ee7992f", "score": "0.5570895", "text": "delete(path) {\n const {\n object: acc,\n valueKey\n } = getParentAtPath(path, this[$private].stateStore);\n\n if (acc) {\n let deletedValue = acc[valueKey];\n delete acc[valueKey];\n\n if (hasObservable) {\n let observers = getValueAtPath(path, this[$private].stateObservers);\n if (observers && observers.length) observers.forEach(o => o.next(undefined));\n }\n {\n if (listeners && listeners.length) {\n listeners.forEach(l => {\n if (l.listenerCount('change') > 0) {\n l.emit('delete', deletedValue)\n }\n else {\n // lose that one from the list.\n listeners.remove(l);\n }\n });\n }\n\n if (allListeners.length) {\n allListeners.forEach(l => {\n if (l.listenerCount('change') > 0) {\n l.emit('delete', deletedValue)\n }\n else {\n // lose that one from the list.\n allListeners.remove(l);\n }\n });\n }\n }\n }\n }", "title": "" }, { "docid": "e55cfbdab6ffa62eb43a53bab9b19274", "score": "0.553978", "text": "function deleteJsonElement(key, path) {\n delete global.currentJson[key];\n global.globalJsonData = saveCurrentNode(global.currentPath, global.globalJsonData, global.currentJson);\n\n //console.log(global.globalJsonData);\n changePath(global.currentPath);\n}", "title": "" }, { "docid": "cacff7907da8868eb60633e602e76119", "score": "0.553905", "text": "function unobserve (obj, path, observer) {\n\n if (!obj || !obj.__emitter__) return\n\n path = path ? path + '.' : ''\n var proxies = observer.proxies[path]\n if (!proxies) return\n\n // turn off listeners\n obj.__emitter__\n .off('get', proxies.get)\n .off('set', proxies.set)\n .off('mutate', proxies.mutate)\n\n // remove reference\n observer.proxies[path] = null\n}", "title": "" }, { "docid": "d8d7e105fcff30c46a12f20696972b3b", "score": "0.5444278", "text": "clear() {\n this._keyHistory = [];\n }", "title": "" }, { "docid": "0404674168e9c291d99e9b065fb38e3d", "score": "0.54363835", "text": "unset(keyPath, options) {\n super.unset(keyPath, options);\n emitConfigSettings({\n settings: this._config.settings,\n options\n });\n }", "title": "" }, { "docid": "38eb9ff7ee73db0f196852d12428e946", "score": "0.54210883", "text": "remove(key) {}", "title": "" }, { "docid": "67b81b25015d405d68b9643b3b32e14a", "score": "0.53811246", "text": "function unstoreObject(key)\n{\n if (!isStored(key))\n {\n console.log('[ERROR] failed to locate object in local store using key: ' + key);\n return null;\n }\n\n let value = unstore(key);\n return JSON.parse(value);\n}", "title": "" }, { "docid": "a93d9db7cb2a9735a885eb2486644d97", "score": "0.53705275", "text": "function ensurePath (obj, key) {\n var path = key.split('.'), sec\n for (var i = 0, d = path.length - 1; i < d; i++) {\n sec = path[i]\n if (!obj[sec]) {\n obj[sec] = {}\n if (obj.__emitter__) convertKey(obj, sec)\n }\n obj = obj[sec]\n }\n if (isObject(obj)) {\n sec = path[i]\n if (!(hasOwn.call(obj, sec))) {\n obj[sec] = undefined\n if (obj.__emitter__) convertKey(obj, sec)\n }\n }\n}", "title": "" }, { "docid": "f3e6c182dd41628da2f89376dc8d26dc", "score": "0.53348464", "text": "function removePath(user) {\r\n for (key in lastPaths) {\r\n if (key == user) {\r\n lastPaths[key].remove();\r\n lastPaths[key] = null;\r\n }\r\n }\r\n view.draw();\r\n}", "title": "" }, { "docid": "51eaf6d1ae04e6d28b0584f81145512e", "score": "0.530102", "text": "get path() {\n return this._key.path.canonicalString();\n }", "title": "" }, { "docid": "51eaf6d1ae04e6d28b0584f81145512e", "score": "0.530102", "text": "get path() {\n return this._key.path.canonicalString();\n }", "title": "" }, { "docid": "d35883005d8f2e451f194f095c977584", "score": "0.5272399", "text": "function bucketsRemovePath(api, key, path, root, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.debug('remove path request');\n const req = new bucketsd_pb_1.RemovePathRequest();\n req.setKey(key);\n req.setPath(path);\n if (root) req.setRoot(root);\n yield api.unary(bucketsd_pb_service_1.APIService.RemovePath, req, ctx);\n return;\n });\n }", "title": "" }, { "docid": "ada2c5feddb0604d078af585223e6389", "score": "0.52715975", "text": "function removePersitentKey(key)\n{\n persistentCollapsedIDs = \"\";\n removePersistenceData();\n return;\n}", "title": "" }, { "docid": "8741347a7e1bf06243c801f12957e67a", "score": "0.52585536", "text": "clear(key) {\n if (key != null) {\n this._silentPush(key, null)\n } else {\n for (let prop in this.obj)\n this._silentPush(prop, null)\n }\n\n this._replaceUrl()\n }", "title": "" }, { "docid": "0a5327a80f0a59337b1b3c8a914512e0", "score": "0.52573586", "text": "unwatchMappingKey(variable, ...indices) {\n return __awaiter(this, void 0, void 0, function* () {\n this.checkAllocationSuccess();\n let slot = this.constructSlot(variable, ...indices)[0];\n if (slot === undefined) {\n return; //not strictly necessary, but may as well\n }\n //remove mapping key and all descendants\n this.mappingKeys = this.mappingKeys.filter(existingSlot => {\n while (existingSlot !== undefined) {\n if (codec_1.Storage.Utils.equalSlots(existingSlot, slot)) {\n return false; //if it matches, remove it\n }\n existingSlot = existingSlot.path;\n }\n return true; //if we didn't match, keep the key\n });\n });\n }", "title": "" }, { "docid": "5242b2dcffcca53bc1a40fad3e044f5e", "score": "0.5243578", "text": "teardown(obj, keyName, meta$$1) {\n if (!this._volatile) {\n let cache = peekCacheFor(obj);\n if (cache !== undefined && cache.delete(keyName)) {\n removeDependentKeys(this, obj, keyName, meta$$1);\n }\n }\n super.teardown(obj, keyName, meta$$1);\n }", "title": "" }, { "docid": "c5167be3bf989a60c660af194a1db1b0", "score": "0.5236827", "text": "function removeFromDictionary () {\n action.removeListener('started', removeFromDictionary);\n action.removeListener('killed', removeFromDictionary);\n assert(\n self._peerDictionary[key], 'The entry should exist because this is ' +\n 'the only place that can remove it'\n );\n delete self._peerDictionary[key];\n }", "title": "" }, { "docid": "9727c81bc3c7bbfe2ade4b65b517bfeb", "score": "0.5224522", "text": "unregister(key: any) : void {\n this._resolvers.delete(key);\n }", "title": "" }, { "docid": "7782668776fb8272043c91b7094d3719", "score": "0.5217854", "text": "invalidatePath(sourcePath) {\n const pathComponentList = this.getPathComponents(sourcePath);\n let node = this.checkTree;\n for (const pathComponent of pathComponentList.slice(0, -1)) {\n node = node.get(pathComponent);\n if (typeof node === 'undefined') {\n break;\n }\n }\n if (typeof node !== 'undefined') {\n node.delete(pathComponentList[pathComponentList.length - 1]);\n }\n }", "title": "" }, { "docid": "45df8cc5edf704a8bf6d89db8b458d19", "score": "0.52019095", "text": "async clear() {\n this.keys = {};\n }", "title": "" }, { "docid": "cb0e0fac66dfb11b9b1b87175c26c8e7", "score": "0.51995575", "text": "clear() {\n\t\tif (this.#keyPrefix) this.keys.forEach(key => this.remove(key));\n\t\telse {\n\t\t\tthis.#backend.clear();\n\t\t\tthis.dispatchEvent(new StorageEvent(null));\n\t\t}\n\t}", "title": "" }, { "docid": "b07fcedf4d3ba7a39eb1690c52e901d7", "score": "0.51991117", "text": "@action\n removeGun( keyProperty ) {\n this.gun.get( keyProperty ).put(null)\n this.server.get('buy').get( keyProperty ).put(null)\n this.server.get('sell').get( keyProperty ).put(null)\n this.server.get('lease').get( keyProperty ).put(null)\n this.server.get('rent').get( keyProperty ).put(null)\n this.currentProperty.get('match').get( keyProperty).put(null)\n this.matchedList.clear()\n this.like.clear()\n this.reject.clear()\n this.view.clear()\n this.property = null\n this.propertyKey = null\n }", "title": "" }, { "docid": "6084181836cd7e99b051406a344fa080", "score": "0.5190135", "text": "unset( key, context ) {\n\n _.unset(context, key);\n\n }", "title": "" }, { "docid": "6e3a1f11e1c75642ad570a9843ee85de", "score": "0.5177945", "text": "function remove(key) {return __async(function*(){\n const cfg = yield read()\n delete cfg[key]\n fs.writeFileSync(file, JSON.stringify(cfg, null, 2))\n}())}", "title": "" }, { "docid": "0c7b0b87e767df86da1781b42bdfd781", "score": "0.5176505", "text": "onUnlink(path) {\n const { filename, directory } = this._getFilePathAndDirectory(path)\n\n this._tree[directory] = this._tree[directory].filter(fname => fname !== filename)\n\n this.onFileDeleted({ filename, directory })\n }", "title": "" }, { "docid": "a819c246ccb1b9a5f6d8d22ffb6bc2fc", "score": "0.51689833", "text": "remove_possible_simple_key() {\n var key;\n if (!(key = this.possible_simple_keys[this.flow_level])) {\n return;\n }\n if (!key.required) {\n return delete this.possible_simple_keys[this.flow_level];\n } else {\n throw new exports.ScannerError('while scanning a simple key', key.mark, 'could not find expected \\':\\'', this.get_mark());\n }\n }", "title": "" }, { "docid": "103572e9d6e883aa3ef9aba22c97fb18", "score": "0.5166637", "text": "remove(path) {\n let paths = this.paths;\n if (paths === undefined) {\n return;\n }\n if (paths[path] > 0) {\n paths[path]--;\n }\n let tails = path.split('.');\n this.unchain(tails.shift(), tails);\n }", "title": "" }, { "docid": "c008410a2ebbce4f3a033c7ff9a7dc80", "score": "0.51608837", "text": "_deleteKey(objName /*: string */\n , key /*: string */ = '') /*: void */{\n let obj /*: InternalMap */ = Ember.get(this, objName);\n if (obj.hasOwnProperty(key)) {\n delete obj[key];\n }\n let c /*: ChangesetDef */ = this;\n c.notifyPropertyChange(`${objName}.${key}`);\n c.notifyPropertyChange(objName);\n }", "title": "" }, { "docid": "fc5f2dc1bf811284ca26b6a4d4b38e8f", "score": "0.51539195", "text": "async clear() {\n this.keys = {};\n }", "title": "" }, { "docid": "fdd360a4b41e91043a23ceeb376850a2", "score": "0.5146389", "text": "clearKey(key) {\n let sess = this._req.session;\n delete sess[key];\n }", "title": "" }, { "docid": "3b1135ffed582d2a7a1a846ae8e1f4e1", "score": "0.51413614", "text": "clear() {\n this._keyPressSubscription.unsubscribe();\n }", "title": "" }, { "docid": "04ed146246a597e5b776f9d1e263ade9", "score": "0.51409924", "text": "function unbindKey(key, scope) {\n var keys = key.split('+'),\n mods = [],\n i, obj;\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i in _handlers[key]) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }", "title": "" }, { "docid": "4f9c800973ab6b112f8cad96715f7317", "score": "0.5131769", "text": "function unbindKey(key, scope) {\n var keys = key.split('+'),\n mods = [],\n i,\n obj;\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i in _handlers[key]) {\n obj = _handlers[key][i];\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }", "title": "" }, { "docid": "1382a5f8c48a338e9cc175de8c636b08", "score": "0.51257837", "text": "clear() {\n // Delete one by one to emit the correct signals.\n let keyList = this.keys();\n for (let i = 0; i < keyList.length; i++) {\n this.delete(keyList[i]);\n }\n }", "title": "" }, { "docid": "ebffb611ad535fb3b4d7cea337e211f3", "score": "0.5115903", "text": "function deleteKey() {\r\n _key.publicKeyArmored = null;\r\n _key.privateKeyArmored = null;\r\n\r\n _saveKey();\r\n }", "title": "" }, { "docid": "ab246dbab3000539297ee2c707424e26", "score": "0.51044124", "text": "function unlockPath(path){\r\n var unlockedObjects = new Array();\r\n var parentObjects = new Array();\r\n var currentObject = path;\r\n var i = 0;\r\n\r\n while (currentObject.typename != \"Document\") {\r\n parentObjects.unshift(currentObject);\r\n currentObject = currentObject.parent;\r\n }\r\n for (i=0; i<parentObjects.length; i++) {\r\n if (parentObjects[i].locked) {\r\n parentObjects[i].locked = false;\r\n unlockedObjects.unshift(parentObjects[i]);\r\n }\r\n }\r\n return unlockedObjects;\r\n}", "title": "" }, { "docid": "fdb1ca0fba6cb317c652e1d197bc98ea", "score": "0.5099578", "text": "async observe(key, path) {\n try {\n let proxy\n const data = await this.get(key, path)\n if (!data) return\n proxy = onChange(data, async (k, v) => {\n if (path) return await this.set(key, v, `${path}.${k}`)\n await this.set(key, v, k)\n })\n return proxy\n } catch (err) {\n throw new Error(err)\n }\n }", "title": "" }, { "docid": "6709e26ec5a1343aa8ddaae24faac895", "score": "0.5089256", "text": "function unstore(key)\n{\n return window.localStorage.getItem(key); \n}", "title": "" }, { "docid": "630144984b86eeea8ad718b41d1624f5", "score": "0.5088091", "text": "function unbindKey(key, scope) {\n\t var multipleKeys, keys,\n\t mods = [],\n\t i, j, obj;\n\n\t multipleKeys = getKeys(key);\n\n\t for (j = 0; j < multipleKeys.length; j++) {\n\t keys = multipleKeys[j].split('+');\n\n\t if (keys.length > 1) {\n\t mods = getMods(keys);\n\t }\n\n\t key = keys[keys.length - 1];\n\t key = code(key);\n\n\t if (scope === undefined) {\n\t scope = getScope();\n\t }\n\t if (!_handlers[key]) {\n\t return;\n\t }\n\t for (i = 0; i < _handlers[key].length; i++) {\n\t obj = _handlers[key][i];\n\t // only clear handlers if correct scope and mods match\n\t if (obj.scope === scope && compareArray(obj.mods, mods)) {\n\t _handlers[key][i] = {};\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "8c5346c4d2a608083b7a6c7f47ee08e8", "score": "0.5086403", "text": "delete(key) {\n delete object[key];\n }", "title": "" }, { "docid": "8c5346c4d2a608083b7a6c7f47ee08e8", "score": "0.5086403", "text": "delete(key) {\n delete object[key];\n }", "title": "" }, { "docid": "6aa3a3002edf14c1f2b703e6ee151f79", "score": "0.50860023", "text": "async shift(key, path) {\n try {\n const data = await this.get(key, path)\n if (!_isArray(data)) return undefined\n data.shift()\n await this.set(key, data, path)\n return\n } catch (err) {\n throw new Error(err)\n }\n }", "title": "" }, { "docid": "fa12ede5c77f9b522b09cbdc78fb8ccf", "score": "0.5085592", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n }", "title": "" }, { "docid": "715b646e2a14c4259c241918dc9c915a", "score": "0.50736964", "text": "pop() {\n this._path.pop();\n }", "title": "" }, { "docid": "b10befb544b58b14ec4d43f186d99916", "score": "0.5066978", "text": "function bucketsRemovePath(api, key, path, root, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.debug('remove path request');\n const req = new buckets_pb_1.RemovePathRequest();\n req.setKey(key);\n req.setPath(path);\n if (root)\n req.setRoot(root);\n yield api.unary(buckets_pb_service_1.APIService.RemovePath, req, ctx);\n return;\n });\n}", "title": "" }, { "docid": "798dbebe45bc462e1767c3bef7cf2f51", "score": "0.5064357", "text": "function deleteKey(key) {\n delete filter[key];\n }", "title": "" }, { "docid": "2b4946549d21af8aaab48e046fc60028", "score": "0.50526834", "text": "function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n }\n\n key = keys[keys.length - 1];\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n }", "title": "" }, { "docid": "2b4946549d21af8aaab48e046fc60028", "score": "0.50526834", "text": "function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n }\n\n key = keys[keys.length - 1];\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n }", "title": "" }, { "docid": "70d8a3189f3c09b75348505348574aa4", "score": "0.5050011", "text": "clear() {\n for (let key of this.keys()) {\n this.delete(key);\n }\n }", "title": "" }, { "docid": "2cdb28dff7fc81f25d589f482a4da85a", "score": "0.5042537", "text": "function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n }", "title": "" }, { "docid": "2cdb28dff7fc81f25d589f482a4da85a", "score": "0.5042537", "text": "function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n }", "title": "" }, { "docid": "6031c623fb324df0203eda4070b7990b", "score": "0.5039439", "text": "function unbindKey(key, scope) {\r\n var multipleKeys, keys,\r\n mods = [],\r\n i, j, obj;\r\n\r\n multipleKeys = getKeys(key);\r\n\r\n for (j = 0; j < multipleKeys.length; j++) {\r\n keys = multipleKeys[j].split('+');\r\n\r\n if (keys.length > 1) {\r\n mods = getMods(keys);\r\n key = keys[keys.length - 1];\r\n }\r\n\r\n key = code(key);\r\n\r\n if (scope === undefined) {\r\n scope = getScope();\r\n }\r\n if (!_handlers[key]) {\r\n return;\r\n }\r\n for (i = 0; i < _handlers[key].length; i++) {\r\n obj = _handlers[key][i];\r\n // only clear handlers if correct scope and mods match\r\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\r\n _handlers[key][i] = {};\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d422d0331f66f18e34406a3252e5cf09", "score": "0.50300163", "text": "async clearKeyrings () {\n // clear keyrings from memory\n this.keyrings = []\n this.memStore.updateState({\n keyrings: [],\n })\n }", "title": "" }, { "docid": "49b48c7fd5f995ffcb564b27cab40b49", "score": "0.50286883", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "title": "" }, { "docid": "49b48c7fd5f995ffcb564b27cab40b49", "score": "0.50286883", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "title": "" }, { "docid": "49b48c7fd5f995ffcb564b27cab40b49", "score": "0.50286883", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "title": "" }, { "docid": "49b48c7fd5f995ffcb564b27cab40b49", "score": "0.50286883", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "title": "" }, { "docid": "49b48c7fd5f995ffcb564b27cab40b49", "score": "0.50286883", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "title": "" }, { "docid": "49b48c7fd5f995ffcb564b27cab40b49", "score": "0.50286883", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.50255054", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.50255054", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.50255054", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.50255054", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.50255054", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.50255054", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "ac1505014ccae71806899a6825a65676", "score": "0.50180984", "text": "function removePathFromField(path) {\n\t return \"\" + vega_util_1.splitAccessPath(path).join('.');\n\t}", "title": "" }, { "docid": "4383ea4e9ec26cc5e72382dc974cb261", "score": "0.50147015", "text": "deleteSubKey() {\n if (Array.isArray(this.getSubKey()) && this.getSubKey().length === 0) {\n delete this[this._subKey || getConfig().subKey];\n }\n }", "title": "" }, { "docid": "9000d6e7585e3df87b971a338f2fc3d7", "score": "0.50030136", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n\n return flattened.reverse();\n}", "title": "" }, { "docid": "9000d6e7585e3df87b971a338f2fc3d7", "score": "0.50030136", "text": "function responsePathAsArray(path) {\n var flattened = [];\n var curr = path;\n\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n\n return flattened.reverse();\n}", "title": "" }, { "docid": "9a312adf1cef88c6b627cfba9f05e6b0", "score": "0.49971393", "text": "pop() {\r\n\t this._path.pop();\r\n\t }", "title": "" }, { "docid": "c72b2884e5f7e9bdc8b98fc0eabe24dc", "score": "0.4989136", "text": "function elideHelper(path) {\n\t\tif (t.isIdentifier(path)) {\n\t\t\tconst p = path.getOuterBindingIdentifierPaths();\n\t\t\tfor (let ident in p) {\n\t\t\t\tconst binding = path.scope.getBinding(ident);\n\t\t\t\tbinding.dereference();\n\t\t\t\tif (!binding.referenced) {\n\t\t\t\t\tbinding.path.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e6d37c786519522a1adafbc3ed3a1183", "score": "0.4981418", "text": "stale_possible_simple_keys() {\n var key, level, ref, results;\n ref = this.possible_simple_keys;\n results = [];\n for (level in ref) {\n if (!hasProp.call(ref, level)) continue;\n key = ref[level];\n if (key.line === this.line && this.index - key.index <= 1024) {\n continue;\n }\n if (!key.required) {\n results.push(delete this.possible_simple_keys[level]);\n } else {\n throw new exports.ScannerError('while scanning a simple key', key.mark, 'could not find expected \\':\\'', this.get_mark());\n }\n }\n return results;\n }", "title": "" }, { "docid": "43469887707048d8c10acac5b2ac893b", "score": "0.49767438", "text": "function deleteCurPath(owner) {\n\t\tif (!initialPathsReceived) { return; }\n\t\tconsole.log('socket ' + owner + ' disconnected while drawing, releasing lock...');\n\t\tcurPath.remove();\n\t\tcurPath = new paper.Path();\n\t\tunlockCanvas(owner);\n\t}", "title": "" }, { "docid": "0142605e3fe7ed95176d82377fd2aee0", "score": "0.4962872", "text": "function removePathFromField(path) {\n return \"\" + vega_util_1.splitAccessPath(path).join('.');\n}", "title": "" }, { "docid": "0142605e3fe7ed95176d82377fd2aee0", "score": "0.4962872", "text": "function removePathFromField(path) {\n return \"\" + vega_util_1.splitAccessPath(path).join('.');\n}", "title": "" }, { "docid": "16c19af519ef342764681ff6c3b5c8ad", "score": "0.49576563", "text": "function deleteKey(key) {\n first = deleteSpecifiedKey(first, key);\n }", "title": "" }, { "docid": "b74798b49558083c8208e5c6e378d71f", "score": "0.49551043", "text": "get path() { return this[_private].path; }", "title": "" }, { "docid": "52ace92993787e9b1626884ebbf5dd9c", "score": "0.4952429", "text": "remove(key) {\n // YOUR WORK HERE\n }", "title": "" }, { "docid": "bd34105306e625d6bd64a5b194ea2bd3", "score": "0.4951932", "text": "deleteObjectPath (object, ...path) {\n\t\tconst stack = [object];\n\n\t\tif (object == null) return object;\n\t\tfor (let i = 0; i < path.length - 1; ++i) {\n\t\t\tobject = object[path[i]];\n\t\t\tstack.push(object);\n\t\t\tif (object === undefined) return object;\n\t\t}\n\t\tconst out = delete object[path.last()];\n\n\t\tfor (let i = path.length - 1; i > 0; --i) {\n\t\t\tif (!Object.keys(stack[i]).length) delete stack[i - 1][path[i - 1]];\n\t\t}\n\n\t\treturn out;\n\t}", "title": "" }, { "docid": "22109b156bd5f7b2e26aa35d508609b2", "score": "0.49499947", "text": "function remove(key) {\n context.removeItem(key);\n}", "title": "" }, { "docid": "22109b156bd5f7b2e26aa35d508609b2", "score": "0.49499947", "text": "function remove(key) {\n context.removeItem(key);\n}", "title": "" }, { "docid": "dc3a78783c5369308b133dac91314c84", "score": "0.49480644", "text": "function unbindKey(key, scope) {\n var multipleKeys,\n keys,\n mods = [],\n i,\n j,\n obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n}", "title": "" }, { "docid": "ee55889356c85e00e595ee2868c1aafb", "score": "0.49411651", "text": "remove(key) {\n const values = this.data();\n\n if (values[key]) {\n delete values[key];\n counterRequest++;\n localStorage.setItem(this._id, JSON.stringify(values));\n }\n }", "title": "" }, { "docid": "bc574a85b29e9878d1d147c11d16fcbd", "score": "0.49271432", "text": "async del(key) {\n await this.lock.wait();\n const { node, stack } = await this.findPath(key);\n if (node) {\n await this._deleteNode(key, stack);\n }\n this.lock.signal();\n }", "title": "" }, { "docid": "c1cf102a55edf87a049ef09abb6aa744", "score": "0.49253687", "text": "function removePathFromField(path) {\n return `${splitAccessPath(path).join('.')}`;\n }", "title": "" }, { "docid": "55867f482de6c64bb8f6b73f88478bee", "score": "0.49170947", "text": "function unKey(that) {\n\t$(that).unbind('keypress').val('');\n}", "title": "" }, { "docid": "67287ade9d28c04b0dcb50c40fff3ac9", "score": "0.4902848", "text": "function downHandler({key}) {\n if(keys[key]){\n inputHandler(null, {\n [keys[key]]: true\n })\n\n }\n }", "title": "" }, { "docid": "a275b979d20d183d1c70120795a06583", "score": "0.48991922", "text": "function remove(key) {\n delete receivers[key];\n}", "title": "" } ]
579e68f40192984018fd93903e719f8d
The following function is from QuirksMode, hence not under the GPL
[ { "docid": "8299b13726a7f57b1cd28c8113d027c0", "score": "0.0", "text": "function findPosX(obj)\r\n{\r\n\tvar curleft = 0;\r\n\tif (obj.offsetParent)\r\n\t{\r\n\t\twhile (obj.offsetParent)\r\n\t\t{\r\n\t\t\tcurleft += obj.offsetLeft\r\n\t\t\tobj = obj.offsetParent;\r\n\t\t}\r\n\t}\r\n\telse if (obj.x)\r\n\t\tcurleft += obj.x;\r\n\treturn curleft;\r\n}", "title": "" } ]
[ { "docid": "a17a6748e65f6ae5618fd62b360f9f23", "score": "0.64085203", "text": "function Section_Browser_Compatibility____________________________________________(){}", "title": "" }, { "docid": "a17a6748e65f6ae5618fd62b360f9f23", "score": "0.64085203", "text": "function Section_Browser_Compatibility____________________________________________(){}", "title": "" }, { "docid": "7f23521ff9bd3f4a6c4735ac4ea5b0d8", "score": "0.56964874", "text": "function Z(a){return ma.isWindow(a)?a:9===a.nodeType&&a.defaultView}", "title": "" }, { "docid": "361472344296d25a99ec9e5fc7118366", "score": "0.5641148", "text": "function H(e){return J.isWindow(e)?e:9===e.nodeType&&e.defaultView}// Can't do this because several apps including ASP.NET trace", "title": "" }, { "docid": "bbf93f38a10324759b88dca071183949", "score": "0.5505307", "text": "function V(a){return fa.isWindow(a)?a:9===a.nodeType&&a.defaultView}", "title": "" }, { "docid": "17a807b3e40687826eb174d4c437fa8b", "score": "0.5467641", "text": "function WBC_isIE() {\r\n\tif (navigator.appName.indexOf(\"Microsoft\") != -1) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "0cd16666dc6369b49aba90b4d787d5b8", "score": "0.5447589", "text": "function e(){}// Avoid IE9 activeElement of death when an iframe is used.", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.54118025", "text": "function SafeStyle() { }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.54118025", "text": "function SafeStyle() { }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.54118025", "text": "function SafeStyle() { }", "title": "" }, { "docid": "5d13ffd1ba906e8f9361e90a165925eb", "score": "0.5403402", "text": "function SafeStyle() {}", "title": "" }, { "docid": "5d13ffd1ba906e8f9361e90a165925eb", "score": "0.5403402", "text": "function SafeStyle() {}", "title": "" }, { "docid": "39aa16fae29a066f66375e47c2526be5", "score": "0.53847814", "text": "function DOCTYPE() {\n\treturn '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\\n';\n}", "title": "" }, { "docid": "5f3e250ca36a3ffc0315605800383fe8", "score": "0.53215563", "text": "function getBrowser()\r\n{\r\nvar agt=navigator.userAgent.toLowerCase();\r\nvar v_maj=parseInt(navigator.appVersion);\r\nvar v_min=parseFloat(navigator.appVersion);\r\nis_nav=((agt.indexOf('mozilla')!=-1)&&(agt.indexOf('spoofer')==-1)&&\r\n\t(agt.indexOf('compatible')==-1)&&(agt.indexOf('webtv')==-1)&&\r\n\t(agt.indexOf('msie')==-1)&&(agt.indexOf('firefox')==-1)&&\r\n\t(agt.indexOf('safari')==-1));\r\nis_nav3=(is_nav&&(v_maj==3));\r\nis_nav4up=(is_nav&&(v_maj>=4));\r\nis_nav407up=(is_nav&&(v_min>=4.07));\r\nis_nav408up=(is_nav&&(v_min>=4.08));\r\nis_ie=((agt.indexOf(\"msie\")!=-1)&&(agt.indexOf(\"opera\")==-1));\r\nis_ie3=(is_ie&&(v_maj<4));\r\nis_ie4=(is_ie&&(v_maj==4)&&(agt.indexOf(\"msie 5\")==-1)&&(agt.indexOf(\"msie 6\")==-1));\r\nis_ie4up=(is_ie&&(v_maj>=4));\r\nis_ie5=(is_ie&&(v_maj==4)&&(agt.indexOf(\"msie 5\")!=-1)); \r\nis_ie5up=(is_ie&&!is_ie3&&!is_ie4);\r\nis_win=((agt.indexOf(\"win\")!=-1)||(agt.indexOf(\"16bit\")!=-1));\r\nis_win95=((agt.indexOf(\"win95\")!=-1)||(agt.indexOf(\"windows 95\")!=-1));\r\nis_win98=((agt.indexOf(\"win98\")!=-1)||(agt.indexOf(\"windows 98\")!=-1));\r\nis_winnt=((agt.indexOf(\"winnt\")!=-1)||(agt.indexOf(\"windows nt\")!=-1));\r\nis_win32=(is_win95||is_winnt||is_win98||\r\n\t((v_maj>=4)&&(navigator.platform==\"Win32\"))||\r\n\t(agt.indexOf(\"win32\")!=-1)||(agt.indexOf(\"32bit\")!=-1));\r\nis_mac=(agt.indexOf(\"mac\")!=-1);\r\nis_macPPC=(is_mac&&((agt.indexOf(\"ppc\")!=-1)||(agt.indexOf(\"powerpc\")!=-1)));\r\nis_macOSX=((is_mac&&((agt.indexOf(\"powerpc\")!=-1)&&(agt.indexOf(\"msie 5.1\")!=-1)))||\r\n\t(agt.indexOf(\"mac os x\")!=-1));\r\nis_x86linuxmoz=((agt.indexOf(\"linux\")!=-1)&&(agt.indexOf(\"mozilla\")!=-1)&&(agt.indexOf(\"i686\")!=-1));\r\nis_solarismoz=((agt.indexOf(\"sunos\")!=-1)&&(agt.indexOf(\"mozilla\")!=-1));\r\n}", "title": "" }, { "docid": "8876c370bbc95a1a636e1cf05ba7379e", "score": "0.5315695", "text": "function __ZNKSt3__15ctypeIcE8do_widenEc($this, $c) {\n var label = 0;\n var $1;\n var $2;\n $1=$this;\n $2=$c;\n var $3=$1;\n var $4=$2;\n return $4;\n}", "title": "" }, { "docid": "3ee65e90b217704a740a2198d8a5527c", "score": "0.5262921", "text": "function t(){a.style.cssText=// Support: Firefox<29, Android 2.3\n// Vendor-prefix box-sizing\n\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute\",a.innerHTML=\"\",i.appendChild(o);var t=e.getComputedStyle(a,null);n=\"1%\"!==t.top,r=\"4px\"===t.width,i.removeChild(o)}", "title": "" }, { "docid": "e17552b9d733ad10a9915bcc3201e386", "score": "0.5248201", "text": "function wc(){return function(){function a(){mb()}function b(a,b){return b?\"\\x00\"===a?\"\\ufffd\":a.slice(0,-1)+\"\\\\\"+a.charCodeAt(a.length-1).toString(16)+\" \":\"\\\\\"+a}function c(a,b,c){a=\"0x\"+b-65536;return a!==a||c?b:0>a?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,a&1023|56320)}function d(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function e(a,b){a===b&&(ma=!0);return 0}function f(a,c,d,e){var f,g,h,k,l=c&&c.ownerDocument,m=c?c.nodeType:9;d=d||[];if(\"string\"!==\ntypeof a||!a||1!==m&&9!==m&&11!==m)return d;if(!e&&((c?c.ownerDocument||c:Ea)!==J&&mb(c),c=c||J,Fa)){if(11!==m&&(k=ij.exec(a)))if(f=k[1])if(9===m)if(g=c.getElementById(f)){if(g.id===f)return d.push(g),d}else return d;else{if(l&&(g=l.getElementById(f))&&$b(c,g)&&g.id===f)return d.push(g),d}else{if(k[2])return ab.apply(d,c.getElementsByTagName(a)),d;if((f=k[3])&&S.getElementsByClassName&&c.getElementsByClassName)return ab.apply(d,c.getElementsByClassName(f)),d}if(!(!S.qsa||Nc[a+\" \"]||X&&X.test(a))){if(1!==\nm){l=c;var qa=a}else if(\"object\"!==c.nodeName.toLowerCase()){(h=c.getAttribute(\"id\"))?h=h.replace(Vf,b):c.setAttribute(\"id\",h=P);g=Oc(a);for(f=g.length;f--;)g[f]=\"#\"+h+\" \"+z(g[f]);qa=g.join(\",\");l=Zd.test(a)&&x(c.parentNode)||c}if(qa)try{return ab.apply(d,l.querySelectorAll(qa)),d}catch(tm){Nc(a)}finally{h===P&&c.removeAttribute(\"id\")}}}return jj(a.replace(Pc,\"$1\"),c,d,e)}function g(){function a(c,d){b.push(c+\" \")>K.cacheLength&&delete a[b.shift()];return a[c+\" \"]=d}var b=[];return a}function h(a){a[P]=\n!0;return a}function k(a){var b=J.createElement(\"fieldset\");try{return!!a(b)}catch(ca){return!1}finally{b.parentNode&&b.parentNode.removeChild(b)}}function m(a,b){for(var c=a.split(\"|\"),d=c.length;d--;)K.attrHandle[c[d]]=b}function l(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function n(a){return function(b){return\"input\"===b.nodeName.toLowerCase()&&b.type===a}}function p(a){return function(b){var c=\nb.nodeName.toLowerCase();return(\"input\"===c||\"button\"===c)&&b.type===a}}function q(a){return function(b){return\"form\"in b?b.parentNode&&!1===b.disabled?\"label\"in b?\"label\"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&kj(b)===a:b.disabled===a:\"label\"in b?b.disabled===a:!1}}function v(a){return h(function(b){b=+b;return h(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function x(a){return a&&\"undefined\"!==\ntypeof a.getElementsByTagName&&a}function y(){}function z(a){for(var b=0,c=a.length,d=\"\";b<c;b++)d+=a[b].value;return d}function A(a,b,c){var d=b.dir,e=b.next,f=c&&\"parentNode\"===(e||d),g=lj++;return b.first?function(b,c,e){for(;b=b[d];)if(1===b.nodeType||f)return a(b,c,e);return!1}:function(b,c,h){var k,l,m=bb+\" \"+g;if(h)for(;b=b[d];){if((1===b.nodeType||f)&&a(b,c,h))return!0}else for(;b=b[d];)if(1===b.nodeType||f){var n=b[P]||(b[P]={});n=n[b.uniqueID]||(n[b.uniqueID]={});if(e&&e===b.nodeName.toLowerCase())b=\nb[d]||b;else if((l=n[d])&&l[0]===m){if(!0===(k=l[1])||k===Y)return!0===k}else if(l=n[d]=[m],l[1]=a(b,c,h)||Y,!0===l[1])return!0}return!1}}function t(a){return 1<a.length?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function B(a,b,c,d,e){for(var f,g=[],h=0,k=a.length,l=null!=b;h<k;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),l&&b.push(h);return g}function D(a,b,c,e,g,k){e&&!e[P]&&(e=D(e));g&&!g[P]&&(g=D(g,k));return h(function(h,k,l,m){var n,p=[],qa=[],q=k.length,ca;if(!(ca=\nh)){ca=b||\"*\";for(var t=l.nodeType?[l]:l,v=[],Gb=0,y=t.length;Gb<y;Gb++)f(ca,t[Gb],v);ca=v}ca=!a||!h&&b?ca:B(ca,p,a,l,m);t=c?g||(h?a:q||e)?[]:k:ca;c&&c(ca,t,l,m);if(e){var x=B(t,qa);e(x,[],l,m);for(l=x.length;l--;)if(n=x[l])t[qa[l]]=!(ca[qa[l]]=n)}if(h){if(g||a){if(g){x=[];for(l=t.length;l--;)(n=t[l])&&x.push(ca[l]=n);g(null,t=[],x,m)}for(l=t.length;l--;)(n=t[l])&&-1<(x=g?d(h,n):p[l])&&(h[x]=!(k[x]=n))}}else t=B(t===k?t.splice(q,t.length):t),g?g(null,k,t,m):ab.apply(k,t)})}function C(a){var b,c,e=\na.length,f=K.relative[a[0].type];var g=f||K.relative[\" \"];for(var h=f?1:0,k=A(function(a){return a===b},g,!0),l=A(function(a){return-1<d(b,a)},g,!0),m=[function(a,c,d){a=!f&&(d||c!==aa)||((b=c).nodeType?k(a,c,d):l(a,c,d));b=null;return a}];h<e;h++)if(g=K.relative[a[h].type])m=[A(t(m),g)];else{g=K.filter[a[h].type].apply(null,a[h].matches);if(g[P]){for(c=++h;c<e&&!K.relative[a[c].type];c++);return D(1<h&&t(m),1<h&&z(a.slice(0,h-1).concat({value:\" \"===a[h-2].type?\"*\":\"\"})).replace(Pc,\"$1\"),g,h<c&&C(a.slice(h,\nc)),c<e&&C(a=a.slice(c)),c<e&&z(a))}m.push(g)}return t(m)}function M(a,b){function c(c,h,k,l,m){var n,p,qa=0,q=\"0\",ca=c&&[],t=[],v=aa,Gb=c||g&&K.find.TAG(\"*\",m),y=bb+=null==v?1:Math.random()||.1,x=Gb.length;m&&(aa=h===J||h||m,Y=d);for(;q!==x&&null!=(n=Gb[q]);q++){if(g&&n){var z=0;h||n.ownerDocument===J||(mb(n),k=!Fa);for(;p=a[z++];)if(p(n,h||J,k)){l.push(n);break}m&&(bb=y,Y=++d)}e&&((n=!p&&n)&&qa--,c&&ca.push(n))}qa+=q;if(e&&q!==qa){for(z=0;p=b[z++];)p(ca,t,h,k);if(c){if(0<qa)for(;q--;)ca[q]||t[q]||\n(t[q]=mj.call(l));t=B(t)}ab.apply(l,t);m&&!c&&0<t.length&&1<qa+b.length&&f.function_______________$uniqueSort(l)}m&&(bb=y,aa=v);return ca}var d=0,e=0<b.length,g=0<a.length;return e?h(c):c}var L,Y,aa,V,ma,J,da,Fa,X,nb,Qc,$b,P=\"sizzle\"+1*new Date,Ea=window.document,bb=0,lj=0,Wf=g(),Xf=g(),Yf=g(),Nc=g(),nj={}.hasOwnProperty,ob=[],mj=ob.pop,oj=ob.push,ab=ob.push,Zf=ob.slice,pj=RegExp(\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]+\",\"g\"),Pc=RegExp(\"^[\\\\x20\\\\t\\\\r\\\\n\\\\f]+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)[\\\\x20\\\\t\\\\r\\\\n\\\\f]+$\",\"g\"),qj=/^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*/,\nrj=/^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*/,sj=/:((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(#?(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)/,tj=/^(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+$/,Rc={ID:/^#((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)/,CLASS:/^\\.((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)/,TAG:/^((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+|[*])/,\nATTR:/^\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(#?(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\]/,PSEUDO:/^:((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(#?(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)/,CHILD:/^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)/i,\nbool:/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,needsContext:/^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)/i},uj=/^(?:input|select|textarea|button)$/i,vj=/^h\\d$/i,ac=/^[^{]+\\{\\s*\\[native \\w/,ij=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,Zd=/[+~]/,Ta=RegExp(\"\\\\\\\\([\\\\da-f]{1,6}[\\\\x20\\\\t\\\\r\\\\n\\\\f]?|([\\\\x20\\\\t\\\\r\\\\n\\\\f])|.)\",\"ig\"),Vf=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\nkj=A(function(a){return!0===a.disabled&&\"fieldset\"===a.nodeName.toLowerCase()},{dir:\"parentNode\",next:\"legend\"});try{ab.apply(ob=Zf.call(Ea.childNodes),Ea.childNodes),ob[Ea.childNodes.length].nodeType}catch(qa){ab={apply:ob.length?function(a,b){oj.apply(a,Zf.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}var S=f.function_______________$support={};var wj=f.isXML=function(a){return(a=a&&(a.ownerDocument||a).documentElement)?\"HTML\"!==a.nodeName:!1};var mb=f.setDocument=\nfunction(b){var f;b=b?b.ownerDocument||b:Ea;if(b===J||9!==b.nodeType||!b.documentElement)return J;J=b;da=J.documentElement;Fa=!wj(J);Ea!==J&&(f=J.defaultView)&&f.top!==f&&(f.addEventListener?f.addEventListener(\"unload\",a,!1):f.attachEvent&&f.attachEvent(\"onunload\",a));S.attributes=k(function(a){a.className=\"i\";return!a.getAttribute(\"className\")});S.getElementsByTagName=k(function(a){a.appendChild(J.createComment(\"\"));return!a.getElementsByTagName(\"*\").length});S.getElementsByClassName=ac.test(J.getElementsByClassName);\nS.getById=k(function(a){da.appendChild(a).id=P;return!J.getElementsByName||!J.getElementsByName(P).length});S.getById?(K.filter.ID=function(a){var b=a.replace(Ta,c);return function(a){return a.getAttribute(\"id\")===b}},K.find.ID=function(a,b){if(\"undefined\"!==typeof b.getElementById&&Fa){var c=b.getElementById(a);return c?[c]:[]}}):(K.filter.ID=function(a){var b=a.replace(Ta,c);return function(a){return(a=\"undefined\"!==typeof a.getAttributeNode&&a.getAttributeNode(\"id\"))&&a.value===b}},K.find.ID=function(a,\nb){if(\"undefined\"!==typeof b.getElementById&&Fa){var c,d,e=b.getElementById(a);if(e){if((c=e.getAttributeNode(\"id\"))&&c.value===a)return[e];var f=b.getElementsByName(a);for(d=0;e=f[d++];)if((c=e.getAttributeNode(\"id\"))&&c.value===a)return[e]}return[]}});K.find.TAG=S.getElementsByTagName?function(a,b){if(\"undefined\"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a);if(S.qsa)return b.querySelectorAll(a)}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if(\"*\"===a){for(;c=f[e++];)1===\nc.nodeType&&d.push(c);return d}return f};K.find.CLASS=S.getElementsByClassName&&function(a,b){if(\"undefined\"!==typeof b.getElementsByClassName&&Fa)return b.getElementsByClassName(a)};nb=[];X=[];if(S.qsa=ac.test(J.querySelectorAll))k(function(a){da.appendChild(a).innerHTML=\"<a id='\"+P+\"'></a><select id='\"+P+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\";a.querySelectorAll(\"[msallowcapture^='']\").length&&X.push(\"[*^$]=[\\\\x20\\\\t\\\\r\\\\n\\\\f]*(?:''|\\\"\\\")\");a.querySelectorAll(\"[selected]\").length||\nX.push(\"\\\\[[\\\\x20\\\\t\\\\r\\\\n\\\\f]*(?:value|checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)\");a.querySelectorAll(\"[id~=\"+P+\"-]\").length||X.push(\"~=\");a.querySelectorAll(\":checked\").length||X.push(\":checked\");a.querySelectorAll(\"a#\"+P+\"+*\").length||X.push(\".#.+[+~]\")}),k(function(a){a.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";var b=J.createElement(\"input\");b.setAttribute(\"type\",\n\"hidden\");a.appendChild(b).setAttribute(\"name\",\"D\");a.querySelectorAll(\"[name=d]\").length&&X.push(\"name[\\\\x20\\\\t\\\\r\\\\n\\\\f]*[*^$|!~]?=\");2!==a.querySelectorAll(\":enabled\").length&&X.push(\":enabled\",\":disabled\");da.appendChild(a).disabled=!0;2!==a.querySelectorAll(\":disabled\").length&&X.push(\":enabled\",\":disabled\");X.push(\",.*:\")});(S.matchesSelector=ac.test(Qc=da.matches||da.webkitMatchesSelector||da.mozMatchesSelector||da.oMatchesSelector||da.msMatchesSelector))&&k(function(a){S.disconnectedMatch=\nQc.call(a,\"*\");Qc.call(a,\"[s!='']:x\");nb.push(\"!=\",\":((?:\\\\\\\\.|[\\\\w-]|[^\\x00-\\\\xa0])+)(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\\\\[[\\\\x20\\\\t\\\\r\\\\n\\\\f]*((?:\\\\\\\\.|[\\\\w-]|[^\\x00-\\\\xa0])+)(?:[\\\\x20\\\\t\\\\r\\\\n\\\\f]*([*^$|!~]?=)[\\\\x20\\\\t\\\\r\\\\n\\\\f]*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(#?(?:\\\\\\\\.|[\\\\w-]|[^\\x00-\\\\xa0])+))|)[\\\\x20\\\\t\\\\r\\\\n\\\\f]*\\\\])*)|.*)\\\\)|)\")});X=X.length&&new RegExp(X.join(\"|\"));nb=nb.length&&new RegExp(nb.join(\"|\"));$b=(f=ac.test(da.compareDocumentPosition))||\nac.test(da.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&1===d.nodeType&&(c.contains?c.contains(d):a.compareDocumentPosition&&a.compareDocumentPosition(d)&16))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1};e=f?function(a,b){if(a===b)return ma=!0,0;var c=!a.compareDocumentPosition-!b.compareDocumentPosition;if(c)return c;c=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;return c&1||!S.sortDetached&&\nb.compareDocumentPosition(a)===c?a===J||a.ownerDocument===Ea&&$b(Ea,a)?-1:b===J||b.ownerDocument===Ea&&$b(Ea,b)?1:V?d(V,a)-d(V,b):0:c&4?-1:1}:function(a,b){if(a===b)return ma=!0,0;var c=0;var e=a.parentNode;var f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===J?-1:b===J?1:e?-1:f?1:V?d(V,a)-d(V,b):0;if(e===f)return l(a,b);for(e=a;e=e.parentNode;)g.unshift(e);for(e=b;e=e.parentNode;)h.unshift(e);for(;g[c]===h[c];)c++;return c?l(g[c],h[c]):g[c]===Ea?-1:h[c]===Ea?1:0};return J};f.matches=function(a,b){return f(a,\nnull,null,b)};f.matchesSelector=function(a,b){(a.ownerDocument||a)!==J&&mb(a);if(!(!S.matchesSelector||!Fa||Nc[b+\" \"]||nb&&nb.test(b)||X&&X.test(b)))try{var c=Qc.call(a,b);if(c||S.disconnectedMatch||a.document&&11!==a.document.nodeType)return c}catch(sm){Nc(b)}return 0<f(b,J,null,[a]).length};f.contains=function(a,b){(a.ownerDocument||a)!==J&&mb(a);return $b(a,b)};f.function_______________$attr=function(a,b){(a.ownerDocument||a)!==J&&mb(a);var c=K.attrHandle[b.toLowerCase()];c=c&&nj.call(K.attrHandle,\nb.toLowerCase())?c(a,b,!Fa):void 0;return void 0!==c?c:S.attributes||!Fa?a.getAttribute(b):(c=a.getAttributeNode(b))&&c.specified?c.value:null};f.function_______________$escape=function(a){return(a+\"\").replace(Vf,b)};f.error=function(a){throw Error(\"Syntax error, unrecognized expression: \"+a);};f.function_______________$uniqueSort=function(a){var b,c=[],d=0,f=0;ma=!S.detectDuplicates;V=!S.sortStable&&a.slice(0);a.sort(e);if(ma){for(;b=a[f++];)b===a[f]&&(d=c.push(f));for(;d--;)a.splice(c[d],1)}V=null};\nvar $d=f.getText=function(a){var b=\"\",c=0;var d=a.nodeType;if(!d)for(;d=a[c++];)b+=$d(d);else if(1===d||9===d||11===d){if(\"string\"===typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)b+=$d(a)}else if(3===d||4===d)return a.nodeValue;return b};var K=f.selectors={cacheLength:50,createPseudo:h,match:Rc,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(a){a[1]=\na[1].replace(Ta,c);a[3]=(a[3]||a[4]||a[5]||\"\").replace(Ta,c);\"~=\"===a[2]&&(a[3]=\" \"+a[3]+\" \");return a.slice(0,4)},CHILD:function(a){a[1]=a[1].toLowerCase();\"nth\"===a[1].slice(0,3)?(a[3]||f.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*(\"even\"===a[3]||\"odd\"===a[3])),a[5]=+(a[7]+a[8]||\"odd\"===a[3])):a[3]&&f.error(a[0]);return a},PSEUDO:function(a){var b,c=!a[6]&&a[2];if(Rc.CHILD.test(a[0]))return null;a[3]?a[2]=a[4]||a[5]||\"\":c&&sj.test(c)&&(b=Oc(c,!0))&&(b=c.indexOf(\")\",c.length-b)-c.length)&&(a[0]=a[0].slice(0,\nb),a[2]=c.slice(0,b));return a.slice(0,3)}},filter:{TAG:function(a){var b=a.replace(Ta,c).toLowerCase();return\"*\"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=Wf[a+\" \"];return b||(b=new RegExp(\"(^|[\\\\x20\\\\t\\\\r\\\\n\\\\f])\"+a+\"([\\\\x20\\\\t\\\\r\\\\n\\\\f]|$)\"),Wf(a,function(a){return b.test(\"string\"===typeof a.className&&a.className||\"undefined\"!==typeof a.getAttribute&&a.getAttribute(\"class\")||\"\")}))},ATTR:function(a,b,c){return function(d){d=\nf.function_______________$attr(d,a);return null==d?\"!=\"===b:b?\"=\"===b?d===c:\"!=\"===b?d!==c:\"^=\"===b?c&&0===d.indexOf(c):\"*=\"===b?c&&-1<d.indexOf(c):\"$=\"===b?c&&d.slice(-c.length)===c:\"~=\"===b?-1<(\" \"+d.replace(pj,\" \")+\" \").indexOf(c):\"|=\"===b?d===c||d.slice(0,c.length+1)===c+\"-\":!1:!0}},CHILD:function(a,b,c,d,e){var f=\"nth\"!==a.slice(0,3),g=\"last\"!==a.slice(-4),h=\"of-type\"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,k){var l,m;c=f!==g?\"nextSibling\":\"previousSibling\";var n=\nb.parentNode,p=h&&b.nodeName.toLowerCase();k=!k&&!h;var q=!1;if(n){if(f){for(;c;){for(l=b;l=l[c];)if(h?l.nodeName.toLowerCase()===p:1===l.nodeType)return!1;var t=c=\"only\"===a&&!t&&\"nextSibling\"}return!0}t=[g?n.firstChild:n.lastChild];if(g&&k){l=n;var v=l[P]||(l[P]={});v=v[l.uniqueID]||(v[l.uniqueID]={});q=v[a]||[];q=(m=q[0]===bb&&q[1])&&q[2];for(l=m&&n.childNodes[m];l=++m&&l&&l[c]||(q=m=0)||t.pop();)if(1===l.nodeType&&++q&&l===b){v[a]=[bb,m,q];break}}else if(k&&(l=b,v=l[P]||(l[P]={}),v=v[l.uniqueID]||\n(v[l.uniqueID]={}),q=v[a]||[],q=m=q[0]===bb&&q[1]),!1===q)for(;(l=++m&&l&&l[c]||(q=m=0)||t.pop())&&((h?l.nodeName.toLowerCase()!==p:1!==l.nodeType)||!++q||(k&&(v=l[P]||(l[P]={}),v=v[l.uniqueID]||(v[l.uniqueID]={}),v[a]=[bb,q]),l!==b)););q-=e;return q===d||0===q%d&&0<=q/d}}},PSEUDO:function(a,b){var c=K.pseudos[a]||K.setFilters[a.toLowerCase()]||f.error(\"unsupported pseudo: \"+a);if(c[P])return c(b);if(1<c.length){var e=[a,a,\"\",b];return K.setFilters.hasOwnProperty(a.toLowerCase())?h(function(a,e){for(var f,\ng=c(a,b),h=g.length;h--;)f=d(a,g[h]),a[f]=!(e[f]=g[h])}):function(a){return c(a,0,e)}}return c}},pseudos:{not:h(function(a){var b=[],c=[],d=$f(a.replace(Pc,\"$1\"));return d[P]?h(function(a,b,c,e){e=d(a,null,e,[]);for(var f=a.length;f--;)if(c=e[f])a[f]=!(b[f]=c)}):function(a,e,f){b[0]=a;d(b,null,f,c);b[0]=null;return!c.pop()}}),has:h(function(a){return function(b){return 0<f(a,b).length}}),contains:h(function(a){a=a.replace(Ta,c);return function(b){return-1<(b.textContent||b.innerText||$d(b)).indexOf(a)}}),\nlang:h(function(a){tj.test(a||\"\")||f.error(\"unsupported lang: \"+a);a=a.replace(Ta,c).toLowerCase();return function(b){var c;do if(c=Fa?b.lang:b.getAttribute(\"xml:lang\")||b.getAttribute(\"lang\"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+\"-\");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(a){var b=window.location&&window.location.hash;return b&&b.slice(1)===a.id},root:function(a){return a===da},focus:function(a){return a===J.activeElement&&(!J.hasFocus||J.hasFocus())&&!!(a.type||\na.href||~a.tabIndex)},enabled:q(!1),disabled:q(!0),checked:function(a){var b=a.nodeName.toLowerCase();return\"input\"===b&&!!a.checked||\"option\"===b&&!!a.selected},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return!0===a.selected},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(6>a.nodeType)return!1;return!0},parent:function(a){return!K.pseudos.empty(a)},header:function(a){return vj.test(a.nodeName)},input:function(a){return uj.test(a.nodeName)},button:function(a){var b=\na.nodeName.toLowerCase();return\"input\"===b&&\"button\"===a.type||\"button\"===b},text:function(a){var b;return\"input\"===a.nodeName.toLowerCase()&&\"text\"===a.type&&(null==(b=a.getAttribute(\"type\"))||\"text\"===b.toLowerCase())},first:v(function(){return[0]}),last:v(function(a,b){return[b-1]}),eq:v(function(a,b,c){return[0>c?c+b:c]}),even:v(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:v(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:v(function(a,b,c){for(b=0>c?c+b:c;0<=--b;)a.push(b);\nreturn a}),gt:v(function(a,b,c){for(c=0>c?c+b:c;++c<b;)a.push(c);return a})}};K.pseudos.nth=K.pseudos.eq;for(L in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})K.pseudos[L]=n(L);for(L in{submit:!0,reset:!0})K.pseudos[L]=p(L);y.prototype=K.filters=K.pseudos;K.setFilters=new y;var Oc=f.tokenize=function(a,b){var c,d,e,g,h;if(g=Xf[a+\" \"])return b?0:g.slice(0);g=a;var k=[];for(h=K.preFilter;g;){if(!l||(c=qj.exec(g)))c&&(g=g.slice(c[0].length)||g),k.push(d=[]);var l=!1;if(c=rj.exec(g))l=c.shift(),\nd.push({value:l,type:c[0].replace(Pc,\" \")}),g=g.slice(l.length);for(e in K.filter)!(c=Rc[e].exec(g))||h[e]&&!(c=h[e](c))||(l=c.shift(),d.push({value:l,type:e,matches:c}),g=g.slice(l.length));if(!l)break}return b?g.length:g?f.error(a):Xf(a,k).slice(0)};var $f=f.compile=function(a,b){var c,d=[],e=[],f=Yf[a+\" \"];if(!f){b||(b=Oc(a));for(c=b.length;c--;)f=C(b[c]),f[P]?d.push(f):e.push(f);f=Yf(a,M(e,d));f.selector=a}return f};var jj=f.function_______________$select=function(a,b,d,e){var f,g,h,k=\"function\"===\ntypeof a&&a,l=!e&&Oc(a=k.selector||a);d=d||[];if(1===l.length){var m=l[0]=l[0].slice(0);if(2<m.length&&\"ID\"===(g=m[0]).type&&9===b.nodeType&&Fa&&K.relative[m[1].type]){b=(K.find.ID(g.matches[0].replace(Ta,c),b)||[])[0];if(!b)return d;k&&(b=b.parentNode);a=a.slice(m.shift().value.length)}for(f=Rc.needsContext.test(a)?0:m.length;f--;){g=m[f];if(K.relative[h=g.type])break;if(h=K.find[h])if(e=h(g.matches[0].replace(Ta,c),Zd.test(m[0].type)&&x(b.parentNode)||b)){m.splice(f,1);a=e.length&&z(m);if(!a)return ab.apply(d,\ne),d;break}}}(k||$f(a,l))(e,b,!Fa,d,!b||Zd.test(a)&&x(b.parentNode)||b);return d};S.sortStable=P.split(\"\").sort(e).join(\"\")===P;S.detectDuplicates=!!ma;mb();S.sortDetached=k(function(a){return a.compareDocumentPosition(J.createElement(\"fieldset\"))&1});k(function(a){a.innerHTML=\"<a href='#'></a>\";return\"#\"===a.firstChild.getAttribute(\"href\")})||m(\"type|href|height|width\",function(a,b,c){if(!c)return a.getAttribute(b,\"type\"===b.toLowerCase()?1:2)});S.attributes&&k(function(a){a.innerHTML=\"<input/>\";\na.firstChild.setAttribute(\"value\",\"\");return\"\"===a.firstChild.getAttribute(\"value\")})||m(\"value\",function(a,b,c){if(!c&&\"input\"===a.nodeName.toLowerCase())return a.defaultValue});k(function(a){return null==a.getAttribute(\"disabled\")})||m(\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",function(a,b,c){var d;if(!c)return!0===a[b]?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null});return f}()}", "title": "" }, { "docid": "3301179c92022aa64f24bd011eb7c664", "score": "0.52226985", "text": "function V(a){return ea.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}", "title": "" }, { "docid": "528a73af0c8f1d6c66a2cc2d17b1ab80", "score": "0.51998013", "text": "function isInternetExplorer()\n{\n if (window.ActiveXObject) return true;\n return false;\n}", "title": "" }, { "docid": "29f4bea26b0e139c5d5262c88f97962a", "score": "0.51656777", "text": "function SafeStyle(){}", "title": "" }, { "docid": "937118acd55434d7010fbda48b0d2dfd", "score": "0.51599056", "text": "function verticalCenter404Ie9() {\n\t\tvar contentInnerH = contentInner.height();\n\t\tvar contentInnerHB = contentInnerH+108;\n\t\tvar windowH = win.height();\n\t\tvar marginTopCalc = (windowH-108-contentInnerH)/2-6;\n\t\tif (( $.browser.version == 9.0 ) || ( $.browser.version == 10.0 )){\t\t\n\t\t\t\n\t\t\tif (windowH>(contentInnerHB)){\n\t\t\t\tcontentOuter.css(\"margin\", \"0 auto\");\n\t\t\t\tcontentInner.css(\"margin-top\", marginTopCalc);\n\t\t\t\tcontentOuter.css(\"display\", \"table\");\n\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcontentOuter.css(\"margin\", \"0 auto\");\n\t\t\t\tcontentInner.css(\"margin-top\", \"18px\");\n\t\t\t\tcontentInner.css(\"margin-bottom\", \"36px\");\n\t\t\t\tcontentOuter.css(\"display\", \"table\");\n\t\t\t}\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "6f1cc8c401cb18f95d6b05e20f59b176", "score": "0.51492393", "text": "function Ec(a,b){var c,e;switch(b){case \"innerHTML\":return a=Fc(a),a===D.ElementContentType.SAFE_HTML?D.AttrType.SAFE_HTML:null;case \"textContent\":return a=Fc(a),a===D.ElementContentType.SAFE_HTML||a===D.ElementContentType.STRING_RCDATA?D.AttrType.NONE:null;default:return null!==(e=null===(c=Gc[a.localName])||void 0===c?void 0:c[b])&&void 0!==e?e:null}}", "title": "" }, { "docid": "ba30fab6d9166658e90075899e18fd53", "score": "0.51488155", "text": "function checkBrowser() {\n\tn = (document.layers) ? 1:0\n\tie = (document.all) ? 1:0\t\n}", "title": "" }, { "docid": "587bf33a052b2e3174a3381e381d768a", "score": "0.5147705", "text": "function fixIeBug(string) {\n\t\t\t\tif (browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "4034fb5629c206abee7f94b3db5d9836", "score": "0.51437724", "text": "function ge(){var a=I();return uc&&!!Fc&&11==Fc||/Edge\\/\\d+/.test(a)}", "title": "" }, { "docid": "af2a63a5793e8a05f9313cb4bdf09a98", "score": "0.5136287", "text": "static get wideMode() {}", "title": "" }, { "docid": "56ffb095aa33569d5ccbfa3dd95044c1", "score": "0.51357293", "text": "function i(e){var t=getComputedStyle(e);return t||s(\"Style returned \"+t+\". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1\"),t}", "title": "" }, { "docid": "11813109dd5c0be0625bd49f6153c0d1", "score": "0.5133271", "text": "function getStyle(elem){var style=getComputedStyle(elem);if(!style){logError('Style returned '+style+'. Are you running this code in a hidden iframe on Firefox? '+'See https://bit.ly/getsizebug1');}return style;}// -------------------------- setup -------------------------- //", "title": "" }, { "docid": "aaabc5fe90c7f9c570106e66ed506614", "score": "0.51199853", "text": "function iao_iframefix()\r\n{\r\n\tif(ulm_ie&&!ulm_mac&&!ulm_oldie&&!ulm_ie7)\r\n\t{\r\n\t\tfor(var i=0;i<(x31=uld.getElementsByTagName(\"iframe\")).length;i++)\r\n\t\t{ \r\n\t\t\tif((a=x31[i]).getAttribute(\"x30\"))\r\n\t\t\t{\r\n\t\t\t\ta.style.height=(x32=a.parentNode.getElementsByTagName(\"UL\")[0]).offsetHeight;a.style.width=x32.offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "bc3e897a8fc407d8d80425fd8940f23e", "score": "0.5097397", "text": "function dhtmlXWindowsSngl(){}", "title": "" }, { "docid": "617bce01be8e34423e36f058872ce9db", "score": "0.5089798", "text": "function WM_netscapeCssFix() {\r\n if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth ||\r\n document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {\r\n document.location = document.location;\r\n }\r\n}", "title": "" }, { "docid": "4e1787f642e4e1f029cee87b5540cbe1", "score": "0.5086781", "text": "function getFullCharset(spec) {\n\t return spec.charset;\n\t}", "title": "" }, { "docid": "4e1787f642e4e1f029cee87b5540cbe1", "score": "0.5086781", "text": "function getFullCharset(spec) {\n\t return spec.charset;\n\t}", "title": "" }, { "docid": "4e1787f642e4e1f029cee87b5540cbe1", "score": "0.5086781", "text": "function getFullCharset(spec) {\n\t return spec.charset;\n\t}", "title": "" }, { "docid": "5090ec5c969b85d1dda944ec5cf3e49d", "score": "0.5078996", "text": "function ie(a,b,c){if(c){var d=document.createDocumentFragment(),f=!b.hasAttribute(\"viewBox\")&&c.getAttribute(\"viewBox\");f&&b.setAttribute(\"viewBox\",f);for(b=c.cloneNode(!0);b.childNodes.length;)d.appendChild(b.firstChild);a.appendChild(d)}}", "title": "" }, { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.5070301", "text": "function StupidBug() {}", "title": "" }, { "docid": "311505155e530aa4175fcba5e81a9a44", "score": "0.50682974", "text": "function createIeResizeFixer() {\r\n var oldWidth, oldHeight;\r\n\r\n return {\r\n // returns true if the window hasn't actually resized.\r\n isBadResize: function () {\r\n var width = $(window).width();\r\n var height = $(window).height();\r\n if (oldWidth != width || oldHeight != height) {\r\n oldWidth = width;\r\n oldHeight = height;\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n };\r\n}", "title": "" }, { "docid": "11e1f9a8a55337c90862143e70c8b65f", "score": "0.5063886", "text": "function getComputedStyleIE(node) { // @param Node:\n // @return Hash: { width: \"123px\", ... }\n // http://d.hatena.ne.jp/uupaa/20091212\n var rv, rect, ut, v, w, x, i = 0, mem,\n style = node.style,\n currentStyle = node.currentStyle,\n runtimeStyle = node.runtimeStyle,\n UNITS = { m: 1, t: 2, \"%\": 3, o: 3 }, // em, pt, %, auto,\n RECTANGLE = { top: 1, left: 2, width: 3, height: 4 },\n fontSize = currentStyle.fontSize,\n em = parseFloat(fontSize) * (uucssunit.pt.test(fontSize) ? 4 / 3 : 1),\n boxProperties = getComputedStyleIE.boxs,\n cache = { \"0px\": \"0px\", \"1px\": \"1px\", \"2px\": \"2px\", \"5px\": \"5px\",\n thin: \"1px\", medium: \"3px\",\n thick: _env.ie8 ? \"5px\" : \"6px\" }; // [IE6][IE7] thick = \"6px\"\n\n rv = getComputedStyleIE.getProps(currentStyle);\n\n // calc: border***Width, padding***, margin***\n for (; w = boxProperties[i++]; ) {\n v = currentStyle[w];\n if (!(v in cache)) {\n x = v;\n switch (ut = UNITS[v.slice(-1)]) {\n case 1: x = parseFloat(v) * em; break; // \"12em\"\n case 2: x = parseFloat(v) * 4 / 3; break; // \"12pt\"\n case 3: // %, auto\n mem = [style.left, runtimeStyle.left];\n runtimeStyle.left = currentStyle.left;\n style.left = v;\n x = style.pixelLeft;\n style.left = mem[0];\n runtimeStyle.left = mem[1];\n }\n cache[v] = ut ? (x + \"px\") : x;\n }\n rv[w] = cache[v];\n }\n // calc: top, left, width, height\n for (w in RECTANGLE) {\n v = currentStyle[w];\n switch (ut = UNITS[v.slice(-1)]) {\n case 1: v = parseFloat(v) * em; break; // \"12em\"\n case 2: v = parseFloat(v) * 4 / 3; break; // \"12pt\"\n case 3: // %, auto\n switch (RECTANGLE[w]) {\n case 1: v = node.offsetTop; break; // style.top\n case 2: v = node.offsetLeft; break; // style.left\n case 3: rect || (rect = node.getBoundingClientRect());\n v = (node.offsetWidth || rect.right - rect.left) // style.width\n - parseInt(rv.borderLeftWidth)\n - parseInt(rv.borderRightWidth)\n - parseInt(rv.paddingLeft)\n - parseInt(rv.paddingRight);\n v = v > 0 ? v : 0;\n break;\n case 4: rect || (rect = node.getBoundingClientRect());\n v = (node.offsetHeight || rect.bottom - rect.top) // style.height\n - parseInt(rv.borderTopWidth)\n - parseInt(rv.borderBottomWidth)\n - parseInt(rv.paddingTop)\n - parseInt(rv.paddingBottom);\n v = v > 0 ? v : 0;\n }\n }\n rv[w] = ut ? (v + \"px\") : v;\n }\n rv.opacity = uucssopacity(node);\n rv.fontSize = em + \"px\";\n rv.cssFloat = currentStyle.styleFloat; // compat\n return rv;\n}", "title": "" }, { "docid": "73a35cc7ec07e618bdc74fad6d0d8e82", "score": "0.5060717", "text": "function Kc(){return function(){function a(){kb()}function b(a,b){return b?\"\\x00\"===a?\"\\ufffd\":a.slice(0,-1)+\"\\\\\"+a.charCodeAt(a.length-1).toString(16)+\" \":\"\\\\\"+a}function c(a,b,c){a=\"0x\"+b-65536;return a!==a||c?b:0>a?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,a&1023|56320)}function d(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function e(a,b){a===b&&(na=!0);return 0}function f(a,c,d,e){var f,g,h,k,l=c&&c.ownerDocument,m=c?c.nodeType:9;d=d||[];if(\"string\"!==\ntypeof a||!a||1!==m&&9!==m&&11!==m)return d;if(!e&&((c?c.ownerDocument||c:Ba)!==L&&kb(c),c=c||L,qa)){if(11!==m&&(k=Di.exec(a)))if(f=k[1])if(9===m)if(g=c.getElementById(f)){if(g.id===f)return d.push(g),d}else return d;else{if(l&&(g=l.getElementById(f))&&Vb(c,g)&&g.id===f)return d.push(g),d}else{if(k[2])return db.apply(d,c.getElementsByTagName(a)),d;if((f=k[3])&&U.getElementsByClassName&&c.getElementsByClassName)return db.apply(d,c.getElementsByClassName(f)),d}if(!(!U.qsa||Dc[a+\" \"]||fa&&fa.test(a))){if(1!==\nm){l=c;var pa=a}else if(\"object\"!==c.nodeName.toLowerCase()){(h=c.getAttribute(\"id\"))?h=h.replace(Bf,b):c.setAttribute(\"id\",h=T);g=Ec(a);for(f=g.length;f--;)g[f]=\"#\"+h+\" \"+x(g[f]);pa=g.join(\",\");l=Id.test(a)&&v(c.parentNode)||c}if(pa)try{return db.apply(d,l.querySelectorAll(pa)),d}catch(ql){Dc(a)}finally{h===T&&c.removeAttribute(\"id\")}}}return Ei(a.replace(Fc,\"$1\"),c,d,e)}function g(){function a(c,d){b.push(c+\" \")>N.cacheLength&&delete a[b.shift()];return a[c+\" \"]=d}var b=[];return a}function h(a){a[T]=\n!0;return a}function k(a){var b=L.createElement(\"fieldset\");try{return!!a(b)}catch(ea){return!1}finally{b.parentNode&&b.parentNode.removeChild(b)}}function l(a,b){for(var c=a.split(\"|\"),d=c.length;d--;)N.attrHandle[c[d]]=b}function m(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function p(a){return function(b){return\"input\"===b.nodeName.toLowerCase()&&b.type===a}}function n(a){return function(b){var c=\nb.nodeName.toLowerCase();return(\"input\"===c||\"button\"===c)&&b.type===a}}function q(a){return function(b){return\"form\"in b?b.parentNode&&!1===b.disabled?\"label\"in b?\"label\"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&Fi(b)===a:b.disabled===a:\"label\"in b?b.disabled===a:!1}}function r(a){return h(function(b){b=+b;return h(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function v(a){return a&&\"undefined\"!==\ntypeof a.getElementsByTagName&&a}function z(){}function x(a){for(var b=0,c=a.length,d=\"\";b<c;b++)d+=a[b].value;return d}function A(a,b,c){var d=b.dir,e=b.next,f=c&&\"parentNode\"===(e||d),g=Gi++;return b.first?function(b,c,e){for(;b=b[d];)if(1===b.nodeType||f)return a(b,c,e);return!1}:function(b,c,h){var k,l,m=eb+\" \"+g;if(h)for(;b=b[d];){if((1===b.nodeType||f)&&a(b,c,h))return!0}else for(;b=b[d];)if(1===b.nodeType||f){var p=b[T]||(b[T]={});p=p[b.uniqueID]||(p[b.uniqueID]={});if(e&&e===b.nodeName.toLowerCase())b=\nb[d]||b;else if((l=p[d])&&l[0]===m){if(!0===(k=l[1])||k===O)return!0===k}else if(l=p[d]=[m],l[1]=a(b,c,h)||O,!0===l[1])return!0}return!1}}function t(a){return 1<a.length?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function B(a,b,c,d,e){for(var f,g=[],h=0,k=a.length,l=null!=b;h<k;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),l&&b.push(h);return g}function C(a,b,c,e,g,k){e&&!e[T]&&(e=C(e));g&&!g[T]&&(g=C(g,k));return h(function(h,k,l,m){var p,n=[],pa=[],q=k.length,ea;if(!(ea=\nh)){ea=b||\"*\";for(var t=l.nodeType?[l]:l,r=[],Db=0,z=t.length;Db<z;Db++)f(ea,t[Db],r);ea=r}ea=!a||!h&&b?ea:B(ea,n,a,l,m);t=c?g||(h?a:q||e)?[]:k:ea;c&&c(ea,t,l,m);if(e){var v=B(t,pa);e(v,[],l,m);for(l=v.length;l--;)if(p=v[l])t[pa[l]]=!(ea[pa[l]]=p)}if(h){if(g||a){if(g){v=[];for(l=t.length;l--;)(p=t[l])&&v.push(ea[l]=p);g(null,t=[],v,m)}for(l=t.length;l--;)(p=t[l])&&-1<(v=g?d(h,p):n[l])&&(h[v]=!(k[v]=p))}}else t=B(t===k?t.splice(q,t.length):t),g?g(null,k,t,m):db.apply(k,t)})}function D(a){var b,c,e=\na.length,f=N.relative[a[0].type];var g=f||N.relative[\" \"];for(var h=f?1:0,k=A(function(a){return a===b},g,!0),l=A(function(a){return-1<d(b,a)},g,!0),m=[function(a,c,d){a=!f&&(d||c!==M)||((b=c).nodeType?k(a,c,d):l(a,c,d));b=null;return a}];h<e;h++)if(g=N.relative[a[h].type])m=[A(t(m),g)];else{g=N.filter[a[h].type].apply(null,a[h].matches);if(g[T]){for(c=++h;c<e&&!N.relative[a[c].type];c++);return C(1<h&&t(m),1<h&&x(a.slice(0,h-1).concat({value:\" \"===a[h-2].type?\"*\":\"\"})).replace(Fc,\"$1\"),g,h<c&&D(a.slice(h,\nc)),c<e&&D(a=a.slice(c)),c<e&&x(a))}m.push(g)}return t(m)}function F(a,b){function c(c,h,k,l,m){var p,n,pa=0,q=\"0\",ea=c&&[],t=[],r=M,v=c||g&&N.find.TAG(\"*\",m),Db=eb+=null==r?1:Math.random()||.1,z=v.length;m&&(M=h===L||h||m,O=d);for(;q!==z&&null!=(p=v[q]);q++){if(g&&p){var x=0;h||p.ownerDocument===L||(kb(p),k=!qa);for(;n=a[x++];)if(n(p,h||L,k)){l.push(p);break}m&&(eb=Db,O=++d)}e&&((p=!n&&p)&&pa--,c&&ea.push(p))}pa+=q;if(e&&q!==pa){for(x=0;n=b[x++];)n(ea,t,h,k);if(c){if(0<pa)for(;q--;)ea[q]||t[q]||\n(t[q]=Hi.call(l));t=B(t)}db.apply(l,t);m&&!c&&0<t.length&&1<pa+b.length&&f.function_______________$uniqueSort(l)}m&&(eb=Db,M=r);return ea}var d=0,e=0<b.length,g=0<a.length;return e?h(c):c}var K,O,M,P,na,L,ha,qa,fa,lb,Gc,Vb,T=\"sizzle\"+1*new Date,Ba=window.document,eb=0,Gi=0,Cf=g(),Df=g(),Ef=g(),Dc=g(),Ii={}.hasOwnProperty,mb=[],Hi=mb.pop,Ji=mb.push,db=mb.push,Ff=mb.slice,Ki=RegExp(\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]+\",\"g\"),Fc=RegExp(\"^[\\\\x20\\\\t\\\\r\\\\n\\\\f]+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)[\\\\x20\\\\t\\\\r\\\\n\\\\f]+$\",\"g\"),Li=/^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*/,\nMi=/^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*/,Ni=/:((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(#?(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)/,Oi=/^(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+$/,Hc={ID:/^#((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)/,CLASS:/^\\.((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)/,TAG:/^((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+|[*])/,\nATTR:/^\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(#?(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\]/,PSEUDO:/^:((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(#?(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)/,CHILD:/^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)/i,\nbool:/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,needsContext:/^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)/i},Pi=/^(?:input|select|textarea|button)$/i,Qi=/^h\\d$/i,Wb=/^[^{]+\\{\\s*\\[native \\w/,Di=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,Id=/[+~]/,Ta=RegExp(\"\\\\\\\\([\\\\da-f]{1,6}[\\\\x20\\\\t\\\\r\\\\n\\\\f]?|([\\\\x20\\\\t\\\\r\\\\n\\\\f])|.)\",\"ig\"),Bf=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\nFi=A(function(a){return!0===a.disabled&&\"fieldset\"===a.nodeName.toLowerCase()},{dir:\"parentNode\",next:\"legend\"});try{db.apply(mb=Ff.call(Ba.childNodes),Ba.childNodes),mb[Ba.childNodes.length].nodeType}catch(pa){db={apply:mb.length?function(a,b){Ji.apply(a,Ff.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}var U=f.function_______________$support={};var Ri=f.isXML=function(a){return(a=a&&(a.ownerDocument||a).documentElement)?\"HTML\"!==a.nodeName:!1};var kb=f.setDocument=\nfunction(b){var f;b=b?b.ownerDocument||b:Ba;if(b===L||9!==b.nodeType||!b.documentElement)return L;L=b;ha=L.documentElement;qa=!Ri(L);Ba!==L&&(f=L.defaultView)&&f.top!==f&&(f.addEventListener?f.addEventListener(\"unload\",a,!1):f.attachEvent&&f.attachEvent(\"onunload\",a));U.attributes=k(function(a){a.className=\"i\";return!a.getAttribute(\"className\")});U.getElementsByTagName=k(function(a){a.appendChild(L.createComment(\"\"));return!a.getElementsByTagName(\"*\").length});U.getElementsByClassName=Wb.test(L.getElementsByClassName);\nU.getById=k(function(a){ha.appendChild(a).id=T;return!L.getElementsByName||!L.getElementsByName(T).length});U.getById?(N.filter.ID=function(a){var b=a.replace(Ta,c);return function(a){return a.getAttribute(\"id\")===b}},N.find.ID=function(a,b){if(\"undefined\"!==typeof b.getElementById&&qa){var c=b.getElementById(a);return c?[c]:[]}}):(N.filter.ID=function(a){var b=a.replace(Ta,c);return function(a){return(a=\"undefined\"!==typeof a.getAttributeNode&&a.getAttributeNode(\"id\"))&&a.value===b}},N.find.ID=function(a,\nb){if(\"undefined\"!==typeof b.getElementById&&qa){var c,d,e=b.getElementById(a);if(e){if((c=e.getAttributeNode(\"id\"))&&c.value===a)return[e];var f=b.getElementsByName(a);for(d=0;e=f[d++];)if((c=e.getAttributeNode(\"id\"))&&c.value===a)return[e]}return[]}});N.find.TAG=U.getElementsByTagName?function(a,b){if(\"undefined\"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a);if(U.qsa)return b.querySelectorAll(a)}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if(\"*\"===a){for(;c=f[e++];)1===\nc.nodeType&&d.push(c);return d}return f};N.find.CLASS=U.getElementsByClassName&&function(a,b){if(\"undefined\"!==typeof b.getElementsByClassName&&qa)return b.getElementsByClassName(a)};lb=[];fa=[];if(U.qsa=Wb.test(L.querySelectorAll))k(function(a){ha.appendChild(a).innerHTML=\"<a id='\"+T+\"'></a><select id='\"+T+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\";a.querySelectorAll(\"[msallowcapture^='']\").length&&fa.push(\"[*^$]=[\\\\x20\\\\t\\\\r\\\\n\\\\f]*(?:''|\\\"\\\")\");a.querySelectorAll(\"[selected]\").length||\nfa.push(\"\\\\[[\\\\x20\\\\t\\\\r\\\\n\\\\f]*(?:value|checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)\");a.querySelectorAll(\"[id~=\"+T+\"-]\").length||fa.push(\"~=\");a.querySelectorAll(\":checked\").length||fa.push(\":checked\");a.querySelectorAll(\"a#\"+T+\"+*\").length||fa.push(\".#.+[+~]\")}),k(function(a){a.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";var b=L.createElement(\"input\");b.setAttribute(\"type\",\n\"hidden\");a.appendChild(b).setAttribute(\"name\",\"D\");a.querySelectorAll(\"[name=d]\").length&&fa.push(\"name[\\\\x20\\\\t\\\\r\\\\n\\\\f]*[*^$|!~]?=\");2!==a.querySelectorAll(\":enabled\").length&&fa.push(\":enabled\",\":disabled\");ha.appendChild(a).disabled=!0;2!==a.querySelectorAll(\":disabled\").length&&fa.push(\":enabled\",\":disabled\");fa.push(\",.*:\")});(U.matchesSelector=Wb.test(Gc=ha.matches||ha.webkitMatchesSelector||ha.mozMatchesSelector||ha.oMatchesSelector||ha.msMatchesSelector))&&k(function(a){U.disconnectedMatch=\nGc.call(a,\"*\");Gc.call(a,\"[s!='']:x\");lb.push(\"!=\",\":((?:\\\\\\\\.|[\\\\w-]|[^\\x00-\\\\xa0])+)(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\\\\[[\\\\x20\\\\t\\\\r\\\\n\\\\f]*((?:\\\\\\\\.|[\\\\w-]|[^\\x00-\\\\xa0])+)(?:[\\\\x20\\\\t\\\\r\\\\n\\\\f]*([*^$|!~]?=)[\\\\x20\\\\t\\\\r\\\\n\\\\f]*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(#?(?:\\\\\\\\.|[\\\\w-]|[^\\x00-\\\\xa0])+))|)[\\\\x20\\\\t\\\\r\\\\n\\\\f]*\\\\])*)|.*)\\\\)|)\")});fa=fa.length&&new RegExp(fa.join(\"|\"));lb=lb.length&&new RegExp(lb.join(\"|\"));Vb=(f=Wb.test(ha.compareDocumentPosition))||\nWb.test(ha.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&1===d.nodeType&&(c.contains?c.contains(d):a.compareDocumentPosition&&a.compareDocumentPosition(d)&16))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1};e=f?function(a,b){if(a===b)return na=!0,0;var c=!a.compareDocumentPosition-!b.compareDocumentPosition;if(c)return c;c=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;return c&1||!U.sortDetached&&\nb.compareDocumentPosition(a)===c?a===L||a.ownerDocument===Ba&&Vb(Ba,a)?-1:b===L||b.ownerDocument===Ba&&Vb(Ba,b)?1:P?d(P,a)-d(P,b):0:c&4?-1:1}:function(a,b){if(a===b)return na=!0,0;var c=0;var e=a.parentNode;var f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===L?-1:b===L?1:e?-1:f?1:P?d(P,a)-d(P,b):0;if(e===f)return m(a,b);for(e=a;e=e.parentNode;)g.unshift(e);for(e=b;e=e.parentNode;)h.unshift(e);for(;g[c]===h[c];)c++;return c?m(g[c],h[c]):g[c]===Ba?-1:h[c]===Ba?1:0};return L};f.matches=function(a,b){return f(a,\nnull,null,b)};f.matchesSelector=function(a,b){(a.ownerDocument||a)!==L&&kb(a);if(!(!U.matchesSelector||!qa||Dc[b+\" \"]||lb&&lb.test(b)||fa&&fa.test(b)))try{var c=Gc.call(a,b);if(c||U.disconnectedMatch||a.document&&11!==a.document.nodeType)return c}catch(pl){Dc(b)}return 0<f(b,L,null,[a]).length};f.contains=function(a,b){(a.ownerDocument||a)!==L&&kb(a);return Vb(a,b)};f.function_______________$attr=function(a,b){(a.ownerDocument||a)!==L&&kb(a);var c=N.attrHandle[b.toLowerCase()];c=c&&Ii.call(N.attrHandle,\nb.toLowerCase())?c(a,b,!qa):void 0;return void 0!==c?c:U.attributes||!qa?a.getAttribute(b):(c=a.getAttributeNode(b))&&c.specified?c.value:null};f.function_______________$escape=function(a){return(a+\"\").replace(Bf,b)};f.error=function(a){throw Error(\"Syntax error, unrecognized expression: \"+a);};f.function_______________$uniqueSort=function(a){var b,c=[],d=0,f=0;na=!U.detectDuplicates;P=!U.sortStable&&a.slice(0);a.sort(e);if(na){for(;b=a[f++];)b===a[f]&&(d=c.push(f));for(;d--;)a.splice(c[d],1)}P=null};\nvar Jd=f.getText=function(a){var b=\"\",c=0;var d=a.nodeType;if(!d)for(;d=a[c++];)b+=Jd(d);else if(1===d||9===d||11===d){if(\"string\"===typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)b+=Jd(a)}else if(3===d||4===d)return a.nodeValue;return b};var N=f.selectors={cacheLength:50,createPseudo:h,match:Hc,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(a){a[1]=\na[1].replace(Ta,c);a[3]=(a[3]||a[4]||a[5]||\"\").replace(Ta,c);\"~=\"===a[2]&&(a[3]=\" \"+a[3]+\" \");return a.slice(0,4)},CHILD:function(a){a[1]=a[1].toLowerCase();\"nth\"===a[1].slice(0,3)?(a[3]||f.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*(\"even\"===a[3]||\"odd\"===a[3])),a[5]=+(a[7]+a[8]||\"odd\"===a[3])):a[3]&&f.error(a[0]);return a},PSEUDO:function(a){var b,c=!a[6]&&a[2];if(Hc.CHILD.test(a[0]))return null;a[3]?a[2]=a[4]||a[5]||\"\":c&&Ni.test(c)&&(b=Ec(c,!0))&&(b=c.indexOf(\")\",c.length-b)-c.length)&&(a[0]=a[0].slice(0,\nb),a[2]=c.slice(0,b));return a.slice(0,3)}},filter:{TAG:function(a){var b=a.replace(Ta,c).toLowerCase();return\"*\"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=Cf[a+\" \"];return b||(b=new RegExp(\"(^|[\\\\x20\\\\t\\\\r\\\\n\\\\f])\"+a+\"([\\\\x20\\\\t\\\\r\\\\n\\\\f]|$)\"),Cf(a,function(a){return b.test(\"string\"===typeof a.className&&a.className||\"undefined\"!==typeof a.getAttribute&&a.getAttribute(\"class\")||\"\")}))},ATTR:function(a,b,c){return function(d){d=\nf.function_______________$attr(d,a);return null==d?\"!=\"===b:b?\"=\"===b?d===c:\"!=\"===b?d!==c:\"^=\"===b?c&&0===d.indexOf(c):\"*=\"===b?c&&-1<d.indexOf(c):\"$=\"===b?c&&d.slice(-c.length)===c:\"~=\"===b?-1<(\" \"+d.replace(Ki,\" \")+\" \").indexOf(c):\"|=\"===b?d===c||d.slice(0,c.length+1)===c+\"-\":!1:!0}},CHILD:function(a,b,c,d,e){var f=\"nth\"!==a.slice(0,3),g=\"last\"!==a.slice(-4),h=\"of-type\"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,k){var l,m;c=f!==g?\"nextSibling\":\"previousSibling\";var p=\nb.parentNode,n=h&&b.nodeName.toLowerCase();k=!k&&!h;var q=!1;if(p){if(f){for(;c;){for(l=b;l=l[c];)if(h?l.nodeName.toLowerCase()===n:1===l.nodeType)return!1;var t=c=\"only\"===a&&!t&&\"nextSibling\"}return!0}t=[g?p.firstChild:p.lastChild];if(g&&k){l=p;var r=l[T]||(l[T]={});r=r[l.uniqueID]||(r[l.uniqueID]={});q=r[a]||[];q=(m=q[0]===eb&&q[1])&&q[2];for(l=m&&p.childNodes[m];l=++m&&l&&l[c]||(q=m=0)||t.pop();)if(1===l.nodeType&&++q&&l===b){r[a]=[eb,m,q];break}}else if(k&&(l=b,r=l[T]||(l[T]={}),r=r[l.uniqueID]||\n(r[l.uniqueID]={}),q=r[a]||[],q=m=q[0]===eb&&q[1]),!1===q)for(;(l=++m&&l&&l[c]||(q=m=0)||t.pop())&&((h?l.nodeName.toLowerCase()!==n:1!==l.nodeType)||!++q||(k&&(r=l[T]||(l[T]={}),r=r[l.uniqueID]||(r[l.uniqueID]={}),r[a]=[eb,q]),l!==b)););q-=e;return q===d||0===q%d&&0<=q/d}}},PSEUDO:function(a,b){var c=N.pseudos[a]||N.setFilters[a.toLowerCase()]||f.error(\"unsupported pseudo: \"+a);if(c[T])return c(b);if(1<c.length){var e=[a,a,\"\",b];return N.setFilters.hasOwnProperty(a.toLowerCase())?h(function(a,e){for(var f,\ng=c(a,b),h=g.length;h--;)f=d(a,g[h]),a[f]=!(e[f]=g[h])}):function(a){return c(a,0,e)}}return c}},pseudos:{not:h(function(a){var b=[],c=[],d=Gf(a.replace(Fc,\"$1\"));return d[T]?h(function(a,b,c,e){e=d(a,null,e,[]);for(var f=a.length;f--;)if(c=e[f])a[f]=!(b[f]=c)}):function(a,e,f){b[0]=a;d(b,null,f,c);b[0]=null;return!c.pop()}}),has:h(function(a){return function(b){return 0<f(a,b).length}}),contains:h(function(a){a=a.replace(Ta,c);return function(b){return-1<(b.textContent||b.innerText||Jd(b)).indexOf(a)}}),\nlang:h(function(a){Oi.test(a||\"\")||f.error(\"unsupported lang: \"+a);a=a.replace(Ta,c).toLowerCase();return function(b){var c;do if(c=qa?b.lang:b.getAttribute(\"xml:lang\")||b.getAttribute(\"lang\"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+\"-\");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(a){var b=window.location&&window.location.hash;return b&&b.slice(1)===a.id},root:function(a){return a===ha},focus:function(a){return a===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(a.type||\na.href||~a.tabIndex)},enabled:q(!1),disabled:q(!0),checked:function(a){var b=a.nodeName.toLowerCase();return\"input\"===b&&!!a.checked||\"option\"===b&&!!a.selected},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return!0===a.selected},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(6>a.nodeType)return!1;return!0},parent:function(a){return!N.pseudos.empty(a)},header:function(a){return Qi.test(a.nodeName)},input:function(a){return Pi.test(a.nodeName)},button:function(a){var b=\na.nodeName.toLowerCase();return\"input\"===b&&\"button\"===a.type||\"button\"===b},text:function(a){var b;return\"input\"===a.nodeName.toLowerCase()&&\"text\"===a.type&&(null==(b=a.getAttribute(\"type\"))||\"text\"===b.toLowerCase())},first:r(function(){return[0]}),last:r(function(a,b){return[b-1]}),eq:r(function(a,b,c){return[0>c?c+b:c]}),even:r(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:r(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:r(function(a,b,c){for(b=0>c?c+b:c;0<=--b;)a.push(b);\nreturn a}),gt:r(function(a,b,c){for(c=0>c?c+b:c;++c<b;)a.push(c);return a})}};N.pseudos.nth=N.pseudos.eq;for(K in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})N.pseudos[K]=p(K);for(K in{submit:!0,reset:!0})N.pseudos[K]=n(K);z.prototype=N.filters=N.pseudos;N.setFilters=new z;var Ec=f.tokenize=function(a,b){var c,d,e,g,h;if(g=Df[a+\" \"])return b?0:g.slice(0);g=a;var l=[];for(h=N.preFilter;g;){if(!k||(c=Li.exec(g)))c&&(g=g.slice(c[0].length)||g),l.push(d=[]);var k=!1;if(c=Mi.exec(g))k=c.shift(),\nd.push({value:k,type:c[0].replace(Fc,\" \")}),g=g.slice(k.length);for(e in N.filter)!(c=Hc[e].exec(g))||h[e]&&!(c=h[e](c))||(k=c.shift(),d.push({value:k,type:e,matches:c}),g=g.slice(k.length));if(!k)break}return b?g.length:g?f.error(a):Df(a,l).slice(0)};var Gf=f.compile=function(a,b){var c,d=[],e=[],f=Ef[a+\" \"];if(!f){b||(b=Ec(a));for(c=b.length;c--;)f=D(b[c]),f[T]?d.push(f):e.push(f);f=Ef(a,F(e,d));f.selector=a}return f};var Ei=f.function_______________$select=function(a,b,d,e){var f,g,h,l=\"function\"===\ntypeof a&&a,k=!e&&Ec(a=l.selector||a);d=d||[];if(1===k.length){var m=k[0]=k[0].slice(0);if(2<m.length&&\"ID\"===(g=m[0]).type&&9===b.nodeType&&qa&&N.relative[m[1].type]){b=(N.find.ID(g.matches[0].replace(Ta,c),b)||[])[0];if(!b)return d;l&&(b=b.parentNode);a=a.slice(m.shift().value.length)}for(f=Hc.needsContext.test(a)?0:m.length;f--;){g=m[f];if(N.relative[h=g.type])break;if(h=N.find[h])if(e=h(g.matches[0].replace(Ta,c),Id.test(m[0].type)&&v(b.parentNode)||b)){m.splice(f,1);a=e.length&&x(m);if(!a)return db.apply(d,\ne),d;break}}}(l||Gf(a,k))(e,b,!qa,d,!b||Id.test(a)&&v(b.parentNode)||b);return d};U.sortStable=T.split(\"\").sort(e).join(\"\")===T;U.detectDuplicates=!!na;kb();U.sortDetached=k(function(a){return a.compareDocumentPosition(L.createElement(\"fieldset\"))&1});k(function(a){a.innerHTML=\"<a href='#'></a>\";return\"#\"===a.firstChild.getAttribute(\"href\")})||l(\"type|href|height|width\",function(a,b,c){if(!c)return a.getAttribute(b,\"type\"===b.toLowerCase()?1:2)});U.attributes&&k(function(a){a.innerHTML=\"<input/>\";\na.firstChild.setAttribute(\"value\",\"\");return\"\"===a.firstChild.getAttribute(\"value\")})||l(\"value\",function(a,b,c){if(!c&&\"input\"===a.nodeName.toLowerCase())return a.defaultValue});k(function(a){return null==a.getAttribute(\"disabled\")})||l(\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",function(a,b,c){var d;if(!c)return!0===a[b]?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null});return f}()}", "title": "" }, { "docid": "dfe79e3c897ce167cbec015d20cb2605", "score": "0.5048495", "text": "function frameToHtmlString(frame) {\n\tvar codeOutput = frame.contentDocument.documentElement.outerHTML;\n\tvar doctype = '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"> \\n';\n codeOutput = doctype + codeOutput;\n return codeOutput;\n}", "title": "" }, { "docid": "e83dc662d6f28b80144773e2906562b1", "score": "0.5042891", "text": "function getFullCharset(spec) {\r\n return spec.charset;\r\n}", "title": "" }, { "docid": "77b4327db8fa570548f687fee3f8c82e", "score": "0.5033113", "text": "function isOldWebKit() {\n var webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n return !!(webKitChunks && webKitChunks[1] < 536);\n }", "title": "" }, { "docid": "46362d09bf9be4ef4d54f7e78791579e", "score": "0.50244284", "text": "function is_ie(){\r\n\tif(navigator.appName.match(/microsoft/ig)) return true;\r\n\telse return false;\r\n}", "title": "" }, { "docid": "b8ff3410a48bb0208cbd29ae6f26983e", "score": "0.5012771", "text": "function _isIe11() {\n return (!!window.MSInputMethodContext && !!document.documentMode);\n}", "title": "" }, { "docid": "2631472fc081f3c9e33376a3bd1ce783", "score": "0.49950132", "text": "function fixMinWidthForIE(){\n try{\n if(!document.body.currentStyle){return} //IE only\n }catch(e){return}\n var elems=document.getElementsByTagName(\"*\");\n for(e=0; e<elems.length; e++){\n var eCurStyle = elems[e].currentStyle;\n var l_minWidth = (eCurStyle.minWidth) ? eCurStyle.minWidth : eCurStyle.getAttribute(\"min-width\"); //IE7 : IE6\n if(l_minWidth && l_minWidth != 'auto'){\n var shim = document.createElement(\"DIV\");\n shim.style.cssText = 'margin:0 !important; padding:0 !important; border:0 !important; line-height:0 !important; height:0 !important; BACKGROUND:RED;';\n shim.style.width = l_minWidth;\n //shim.appendChild(document.createElement(\"&nbsp;\"));\n shim.innerHTML = \"&nbsp;\"; //\n if(elems[e].canHaveChildren){\n elems[e].appendChild(shim);\n }else{\n //??\n }\n }\n }\n}", "title": "" }, { "docid": "1516f0d28a11f13d561e6571b82c78e0", "score": "0.49927306", "text": "function expressMode(textarea_div){\n\n\n}", "title": "" }, { "docid": "4d604f9fd0b54de7ca367c38668d2f74", "score": "0.49878126", "text": "get enableFocusAwareRealization(): boolean {\n return (\n NativeQuirkSettings.getConstants().enableFocusAwareRealization ??\n DefaultQuirks.enableFocusAwareRealization\n );\n }", "title": "" }, { "docid": "a701e672905f7daaabbff5035bbd604c", "score": "0.49877855", "text": "function html_getDefaultBorderStyle()\n{\n // Avoiding any 'return statement ignores stuff after newline' shenanigans\n // by building the string in a variable first\n var return_value = html_default_border_size + \" \" \n + html_default_border_style + \" \"\n + html_default_border_color;\n return return_value;\n}", "title": "" }, { "docid": "cc4c10ac03204c2927f24c22585019ab", "score": "0.4982682", "text": "function y(a){var b=(a||u).toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var s=/(edge)[ \\/]([\\w.]+)/;var t=/(mozilla)(?:.*? rv:([\\w.]+))?/;var v=s.exec(b)||q.exec(b)||e.exec(b)||f.exec(b)||i.exec(b)||b.indexOf(\"compatible\")<0&&t.exec(b)||[];var w={browser:v[1]||\"\",version:v[2]||\"0\"};w[w.browser]=true;return w;}", "title": "" }, { "docid": "cc4c10ac03204c2927f24c22585019ab", "score": "0.4982682", "text": "function y(a){var b=(a||u).toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var s=/(edge)[ \\/]([\\w.]+)/;var t=/(mozilla)(?:.*? rv:([\\w.]+))?/;var v=s.exec(b)||q.exec(b)||e.exec(b)||f.exec(b)||i.exec(b)||b.indexOf(\"compatible\")<0&&t.exec(b)||[];var w={browser:v[1]||\"\",version:v[2]||\"0\"};w[w.browser]=true;return w;}", "title": "" }, { "docid": "2635793ca2c5a6bf1a718134cadf50b5", "score": "0.4978359", "text": "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "44da8ea87e19399d98bb0b6b48a013b0", "score": "0.49751914", "text": "function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!(\"function\"==typeof n.Node?e instanceof n.Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "62bc0369c14f192e55ab455c24fd3a9d", "score": "0.49693605", "text": "function getElementAbsolutePos(element) {\r\n\tvar res = new Object();\r\n\tres.x = 0; res.y = 0;\r\n\tif (element !== null) { \r\n\t\tif (element.getBoundingClientRect) {\r\n\t\t\tvar viewportElement = document.documentElement; \r\n \t var box = element.getBoundingClientRect();\r\n\t\t var scrollLeft = viewportElement.scrollLeft;\r\n \t\t var scrollTop = viewportElement.scrollTop;\r\n\r\n\t\t res.x = box.left + scrollLeft;\r\n\t\t res.y = box.top + scrollTop;\r\n\r\n\t\t}\r\n\t\telse { //for old browsers\r\n\t\t\tres.x = element.offsetLeft;\r\n\t\t\tres.y = element.offsetTop;\r\n\r\n\t\t\tvar parentNode = element.parentNode;\r\n\t\t\tvar borderWidth = null;\r\n\r\n\t\t\twhile (offsetParent != null) {\r\n\t\t\t\tres.x += offsetParent.offsetLeft;\r\n\t\t\t\tres.y += offsetParent.offsetTop;\r\n\t\t\t\t\r\n\t\t\t\tvar parentTagName = \r\n\t\t\t\t\toffsetParent.tagName.toLowerCase();\t\r\n\r\n\t\t\t\tif ((__isIEOld && parentTagName != \"table\") || \r\n\t\t\t\t\t((__isFireFoxNew || __isChrome) && \r\n\t\t\t\t\t\tparentTagName == \"td\")) {\t\t \r\n\t\t\t\t\tborderWidth = kGetBorderWidth\r\n\t\t\t\t\t\t\t(offsetParent);\r\n\t\t\t\t\tres.x += borderWidth.left;\r\n\t\t\t\t\tres.y += borderWidth.top;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (offsetParent != document.body && \r\n\t\t\t\toffsetParent != document.documentElement) {\r\n\t\t\t\t\tres.x -= offsetParent.scrollLeft;\r\n\t\t\t\t\tres.y -= offsetParent.scrollTop;\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t//next lines are necessary to fix the problem \r\n\t\t\t\t//with offsetParent\r\n\t\t\t\tif (!__isIE && !__isOperaOld || __isIENew) {\r\n\t\t\t\t\twhile (offsetParent != parentNode && \r\n\t\t\t\t\t\tparentNode !== null) {\r\n\t\t\t\t\t\tres.x -= parentNode.scrollLeft;\r\n\t\t\t\t\t\tres.y -= parentNode.scrollTop;\r\n\t\t\t\t\t\tif (__isFireFoxOld || __isWebKit) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t borderWidth = \r\n\t\t\t\t\t\t kGetBorderWidth(parentNode);\r\n\t\t\t\t\t\t res.x += borderWidth.left;\r\n\t\t\t\t\t\t res.y += borderWidth.top;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tparentNode = parentNode.parentNode;\r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\r\n\t\t\t\tparentNode = offsetParent.parentNode;\r\n\t\t\t\toffsetParent = offsetParent.offsetParent;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n return res;\r\n}", "title": "" }, { "docid": "2bf1a6a0d3a86062e405acf3f41c6c60", "score": "0.49620682", "text": "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "title": "" }, { "docid": "2bf1a6a0d3a86062e405acf3f41c6c60", "score": "0.49620682", "text": "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "title": "" }, { "docid": "2bf1a6a0d3a86062e405acf3f41c6c60", "score": "0.49620682", "text": "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "title": "" }, { "docid": "2bf1a6a0d3a86062e405acf3f41c6c60", "score": "0.49620682", "text": "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "title": "" }, { "docid": "357cb23d69d1a5edf4f218532991e5fb", "score": "0.49591294", "text": "function msieversion() {\n\t var ua = window.navigator.userAgent;\n\t var msie = ua.indexOf(\"MSIE \");\n\t if (msie > 0) {\n\t return Number.parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n\t } else if (ua.indexOf('rv:11') > 0) {\n\t return 11;\n\t } else if (ua.indexOf(\"Edge\") > 0) {\n\t return 'edge';\n\t } else {\n\t return false;\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "9e16b94d4958bee26cac0309c5d56436", "score": "0.49547923", "text": "function _IG_AdjustIFrameHeight()\n{\n //function desactivated for opera\n if (!Browser.Engine.presto)\n {\n \tvar l_height;\n \tif (document.height){\n \t\tl_height=document.height;\n \t}\n \telse if (document.all){\n \t\tif (document.compatMode && document.compatMode != 'BackCompat'){\n \t\t\tl_height=document.documentElement.scrollHeight + 5;\n \t\t}\n \t\telse{\n \t\t\tl_height = document.body.scrollHeight + 5;\n \t\t}\n \t} \n \tif (navigator.appName==\"Netscape\"){\n \t\ttop.outerHeight=l_height;\n \t}\n \telse top.resizeTo(400,l_height);\n }\n}", "title": "" }, { "docid": "6f041c89c951f4497d8bf61ec2c5f69b", "score": "0.49474376", "text": "function isWindow(obj){// must use == for ie8\n/* eslint eqeqeq:0 */return obj!==null&&obj!==undefined&&obj==obj.window;}", "title": "" }, { "docid": "a693a1cbaa5ff63e94d815a9ac33d7cd", "score": "0.49423254", "text": "function InsertTable(border,padding,spacing){\n if(browser.isIE5up){\n colstext = prompt('Enter the number of columns per row.');\n rowstext = prompt('Enter the number of rows to create.');\n rows = parseInt(rowstext);\n cols = parseInt(colstext);\n\n document.getElementById('wysiwyg_content').contentWindow.focus();\n var cursor = document.getElementById('wysiwyg_content').document.selection.createRange();\n if(rows<1) rows=1;\n if(cols<1) cols=1;\n\n var ieTable = '<table border=\"'+border+'\" cellpadding=\"'+padding+'\" cellspacing=\"'+spacing+'\">';\n while(rows>0){\n rows--;\n var rowCols = cols;\n ieTable = ieTable + '<tr>';\n while(parseInt(rowCols)>0){\n rowCols--;\n ieTable=ieTable+'<td>&nbsp;</td>';\n }\n ieTable = ieTable + '</tr>';\n }\n ieTable = ieTable + '</table>';\n cursor.pasteHTML(ieTable);\n document.getElementById('wysiwyg_content').contentWindow.focus();\n }else{\n // Gecko browsers\n e = document.getElementById('wysiwyg_content');\n colstext = prompt('Enter the number of columns per row.');\n rowstext = prompt('Enter the number of rows to create.');\n rows = parseInt(rowstext);\n cols = parseInt(colstext);\n if((rows > 0) && (cols > 0)){\n table = e.contentWindow.document.createElement('table');\n table.setAttribute('border', border);\n table.setAttribute('cellpadding', padding);\n table.setAttribute('cellspacing', spacing);\n tbody = e.contentWindow.document.createElement('tbody');\n for (var i=0; i < rows; i++) {\n tr =e.contentWindow.document.createElement('tr');\n for (var j=0; j < cols; j++) {\n td =e.contentWindow.document.createElement('td');\n br =e.contentWindow.document.createElement('br');\n td.appendChild(br);\n tr.appendChild(td);\n }\n tbody.appendChild(tr);\n }\n table.appendChild(tbody);\n insertNodeAtSelection(e.contentWindow, table);\n }\n }\n return true;\n}", "title": "" }, { "docid": "bd6fee392f00058b87448df563b9d823", "score": "0.49390066", "text": "function isMsBrowser() {\n return Boolean(document.documentMode || /Edge/.test(navigator.userAgent));\n}", "title": "" }, { "docid": "bd6fee392f00058b87448df563b9d823", "score": "0.49390066", "text": "function isMsBrowser() {\n return Boolean(document.documentMode || /Edge/.test(navigator.userAgent));\n}", "title": "" }, { "docid": "17fb8e428c4b8a29aeff5229810722f9", "score": "0.49314362", "text": "function DOMtoString(document_root) {\n var html = '',\n node = document_root.firstChild;\n while (node) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n html += node.innerText;\n break;\n /*case Node.TEXT_NODE:\n html += node.nodeValue;\n break;*/\n /*case Node.CDATA_SECTION_NODE:\n html += '<![CDATA[' + node.nodeValue + ']]>';\n break;*/\n /*case Node.COMMENT_NODE:\n html += '<!--' + node.nodeValue + '-->';\n break;*/\n /*case Node.DOCUMENT_TYPE_NODE:\n // (X)HTML documents are identified by public identifiers\n html += \"<!DOCTYPE \" + node.name + (node.publicId ? ' PUBLIC \"' + node.publicId + '\"' : '') + (!node.publicId && node.systemId ? ' SYSTEM' : '') + (node.systemId ? ' \"' + node.systemId + '\"' : '') + '>\\n';\n break;*/\n }\n node = node.nextSibling;\n }\n/*var keyInfo;\n for(i = 0; i<html.length-4;i++)\n {\n if(html[i]== '<' && html[i+1]== 'p' && html[i+2]== '>')\n {\n var u=i+3; \n While(html[u]!= '<' && html[u+1]!= '/' && html[u+2]!= 'p' && html[u+3]!='>')\n {\n keyInfo+=html[u];\n u++; \n }\n keyInfo+=' '\n }\n \n \n }*/\n\n\n /*var keyInfo = html.slice(html.indexOf(\"<table\"), html.indexOf(\"</table\"));\n\n console.log(keyInfo);*/\n\n return html;\n}", "title": "" }, { "docid": "ba68308c2019622550369b23c26f6239", "score": "0.49218717", "text": "function getWidthBrowser() {\n var myWidth;\n\n if( typeof( window.innerWidth ) == 'number' ) { \n //Non-IE \n myWidth = window.innerWidth;\n //myHeight = window.innerHeight; \n } \n else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { \n //IE 6+ in 'standards compliant mode' \n myWidth = document.documentElement.clientWidth; \n //myHeight = document.documentElement.clientHeight; \n } \n else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { \n //IE 4 compatible \n myWidth = document.body.clientWidth; \n //myHeight = document.body.clientHeight; \n }\n\n return myWidth;\n}", "title": "" }, { "docid": "8f37e085a9a81f26f9de03c8afabc0e4", "score": "0.4912244", "text": "function de(){var a=I();return Ub&&!!ec&&11==ec||/Edge\\/\\d+/.test(a)}", "title": "" }, { "docid": "9c089fcf6bc80710d364331ecf91f4df", "score": "0.49114418", "text": "function n(e){var t=e?e.ownerDocument||e:document,i=t.defaultView||window;return!(!e||!(\"function\"==typeof i.Node?e instanceof i.Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "a6fd5cb63f456aa6a3649a2d8a33ee9c", "score": "0.49113467", "text": "function getFullCharset(spec) {\n return spec.charset;\n }", "title": "" }, { "docid": "c92ee3d6aad5399a7a9a8667623378e4", "score": "0.4905225", "text": "function BrowserUtils() {\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.48960283", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "4e77c01065d5c084f0b6296921a6f290", "score": "0.48909512", "text": "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "title": "" }, { "docid": "ce1ba957c5ae107aaa3b5f435c134412", "score": "0.48790553", "text": "function _____G_CONTROL_POSITION_HACK() {} // [DELETELINE]", "title": "" }, { "docid": "06fa5f4dd30dc0435108c6e22349f8cc", "score": "0.48724642", "text": "function n(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!(\"function\"==typeof n.Node?e instanceof n.Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" } ]
d8771060c805a752f3633a7399d49d39
constructor function for creating stores
[ { "docid": "fde1d868421e7dc03f6f9aa6051080bc", "score": "0.69021994", "text": "function Store(name, avgSale, maxCust, minCust) {\n this.name = name;\n this.avgSale = avgSale;\n this.maxCust = maxCust;\n this.minCust = minCust;\n this.dailySales = 0;\n this.hourlySales = [];\n stores.push(this);\n}", "title": "" } ]
[ { "docid": "f65f6d569c92ffb8ddbb691638029ede", "score": "0.792833", "text": "constructor(...args) {\n super(...args);\n\n this.createStores();\n }", "title": "" }, { "docid": "98c70f649b233f0ddf87fd6b54766de1", "score": "0.7614034", "text": "function StoreManager() {}", "title": "" }, { "docid": "4f72b07009c70ec525c126dd19d153d4", "score": "0.75811243", "text": "constructor() {\n this.initStore();\n }", "title": "" }, { "docid": "13a1139e31f2806267f728d76f5490c4", "score": "0.7576538", "text": "constructor(numberOfStores) {\n this.numberOfStores = numberOfStores;\n this.stores = new Array(numberOfStores)\n .fill(null)\n .map(el => new KeyValueStore());\n }", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.74927175", "text": "function Store(){}", "title": "" }, { "docid": "3fc9c4c5caffbbe3f39a7b75dfecb050", "score": "0.7407928", "text": "constructor(name,storeName){\n\t\t//this.name=name;\n\t\tthis.storeName=storeName||\"\";\n\t\tthis.storeKeys={}; // the keys of this store, key -> size in bytes\n\t\tthis.storage=localforage.createInstance({ // the db instance: all data in all stores\n\t\t\tname: name,\n\t\t\tstoreName: \"storage\"\n\t\t});\n\t\tthis.storeList=localforage.createInstance({ // the db instance: index of all stores\n\t\t\tname: name,\n\t\t\tstoreName: \"store\"\n\t\t});\n\t\tthis.size=0;\n\t}", "title": "" }, { "docid": "82d8cfdb54599a18e80eb7b7e09b00fe", "score": "0.7406582", "text": "function Store() {}", "title": "" }, { "docid": "82d8cfdb54599a18e80eb7b7e09b00fe", "score": "0.7406582", "text": "function Store() {}", "title": "" }, { "docid": "82d8cfdb54599a18e80eb7b7e09b00fe", "score": "0.7406582", "text": "function Store() {}", "title": "" }, { "docid": "825e14c532b622987518459ccd2b6789", "score": "0.73648614", "text": "function Store () {\n this.store = {}\n}", "title": "" }, { "docid": "90459577619abaebbc5ce50dc1b08b77", "score": "0.72206324", "text": "function Store(nameOfStore, minCustomer, maxCustomer, avgCookiesSoldPerSale) {\n this.storeName = nameOfStore;\n this.minCustomer = minCustomer;\n this.maxCustomer = maxCustomer;\n this.avgCookiesSoldPerSale = avgCookiesSoldPerSale;\n this.arrayOfCookies = [];\n this.sumOfStoreHourCookies = 0;\n everyLocation.push(this);\n}", "title": "" }, { "docid": "49027a521867577ad81592c460a33bdb", "score": "0.7129734", "text": "function createStores(state, token) {\n\n\treturn {\n\t\ttest: new TestStore(),\n\t}\n}", "title": "" }, { "docid": "9db313a98ad3decc2aa0e3dc8b815aec", "score": "0.7085286", "text": "function Store() {\n if (!(this instanceof Store)) {\n return new Store();\n };\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.70801646", "text": "function Store() {\n}", "title": "" }, { "docid": "43a30cf7ef5d7d300e3e84e7632da6e0", "score": "0.7076748", "text": "function Store(store, minCust, maxCust, avgCookie, amStoreHours, pmStoreHours)\n{\n this.store = store,\n this.minCust = minCust,\n this.maxCust = maxCust,\n this.avgCookie = avgCookie,\n this.amStoreHours = amStoreHours,\n this.pmStoreHours = pmStoreHours\n}", "title": "" }, { "docid": "9f8b345b65b664a780f2ee4166da9685", "score": "0.7058113", "text": "constructor() {\n this.store = new Map();\n }", "title": "" }, { "docid": "557e396a5a0a0113f20ed35b52204d16", "score": "0.6936271", "text": "function Store$1(name, id, keys, optionalEngine) {\n this.id = id;\n this.name = name;\n this.keys = keys || {};\n this.engine = optionalEngine || defaultEngine$1;\n }", "title": "" }, { "docid": "6dc4901e01c15854211f04e2ce427506", "score": "0.6928908", "text": "function newStore(url, store){\n require([\"dojo/store/JsonRest\",\"dojo/dom\",\"dojo/store/Observable\",\n \"dojo/store/Memory\", \"dojo/store/Cache\", \"dojo/dom-construct\", \"dojo/on\",\n \"dojo/domReady!\"\n ],\n function(JsonRest, dom, Observable, Memory, Cache, domConstruct, on, fx){\n var memoryStore = new Memory({ idProperty: \"id\" });\n jsonStore = new JsonRest({\n idProperty: \"id\",\n target: \"api/\"+url, \n queryEngine: memoryStore.queryEngine\n });\n jsonStore = Observable(jsonStore);\n stores[store] = new Cache(jsonStore, memoryStore);\n });\n\n}", "title": "" }, { "docid": "55f7ff12387d7b6d22da38249aa0c1b3", "score": "0.6923635", "text": "constructor() {\n this.store = {};\n this.count = 0;\n }", "title": "" }, { "docid": "61512228768cf313b81f23df87881f65", "score": "0.6920051", "text": "constructor(root, store) {\n this.root = root;\n this.store = store;\n init();\n }", "title": "" }, { "docid": "61512228768cf313b81f23df87881f65", "score": "0.6920051", "text": "constructor(root, store) {\n this.root = root;\n this.store = store;\n init();\n }", "title": "" }, { "docid": "7dab03607d32a83c2882701db0aa078d", "score": "0.6908003", "text": "function Store(name, min, max, avg) {\n this.name = name;\n this.min = min;\n this.max = max;\n this.avg = avg;\n this.hourlySales = [];\n this.dailyTotal = 0;\n allStores.push(this);\n}", "title": "" }, { "docid": "e62e0fc985a509615963173cbf4f6891", "score": "0.6864231", "text": "_createNewStore (name) {\n if (this.store[name]) {\n return;\n }\n \n this.store[name] = [];\n }", "title": "" }, { "docid": "6e3fc3264a344576cae65a7da7e2c219", "score": "0.6863621", "text": "constructor() {\n this.key = 0;\n this.store = {};\n }", "title": "" }, { "docid": "c18ddfcc771402fa6427bda0f1e465da", "score": "0.6859181", "text": "function Store() {\n _classCallCheck(this, Store);\n\n this.object = undefined;\n this.id = undefined;\n this.name = undefined;\n this.name_raw = undefined;\n }", "title": "" }, { "docid": "1df5c82afbef0cba8f6f371b9a3b05be", "score": "0.6843193", "text": "function Store () {\n if (!(this instanceof Store)) {\n return new Store();\n }\n\n this._inflights = {};\n}", "title": "" }, { "docid": "1df5c82afbef0cba8f6f371b9a3b05be", "score": "0.6843193", "text": "function Store () {\n if (!(this instanceof Store)) {\n return new Store();\n }\n\n this._inflights = {};\n}", "title": "" }, { "docid": "1df5c82afbef0cba8f6f371b9a3b05be", "score": "0.6843193", "text": "function Store () {\n if (!(this instanceof Store)) {\n return new Store();\n }\n\n this._inflights = {};\n}", "title": "" }, { "docid": "164fbb852e6045bec29d68247add6007", "score": "0.6796366", "text": "function StoreCreator (location, minCust, maxCust, avgCookies, hoursOpen) {\r\n this.location = location;\r\n this.minCust = minCust; \r\n this.maxCust = maxCust; \r\n this.avgCookies = avgCookies;\r\n var time = ['6am ', '7am ', '8am ', '9am ', '10am ', '11am ', '12pm ', '1pm ', '2pm ', '3pm ', '4pm ', '5pm ', '6pm ', '7pm ',];\r\n this.time = time; \r\n this.hoursOpen = hoursOpen; \r\n this.sales = this.random();\r\n console.log (this.sales);\r\n this.cookieSoldHr = this.sales;\r\n stores.push(this);\r\n }", "title": "" }, { "docid": "f9bd387098d44e89ca0f50f5c370e158", "score": "0.67513746", "text": "function Store(name, minCustPerHr, maxCustPerHr, avgCookiePerCust) {\r\n this.name = name;\r\n this.minCustPerHr = minCustPerHr;\r\n this.maxCustPerHr = maxCustPerHr;\r\n this.avgCookiePerCust = avgCookiePerCust;\r\n this.totalHrs = 14;\r\n this.avgCookieSalesPerHr = [];\r\n allStores.push(this);\r\n}", "title": "" }, { "docid": "5cfe75f143ff8bc2e6d033933ecbb5e9", "score": "0.67464083", "text": "function Store() {\n this.mem = {};\n}", "title": "" }, { "docid": "66a4276b618fe2e1df478bd60663b54e", "score": "0.67381495", "text": "function Store (location, mincustomer, maxCustomer, avgCookieSale) {\n this.minCustPerHour = mincustomer;\n this.maxCustPerHour = maxCustomer;\n this.avgCookieSale = avgCookieSale;\n this.locationName = location;\n this.custEachHour = [];\n this.cookiesEachHr = [];\n this.TotalCookieForDay = 0;\n allStores.push(this);\n}", "title": "" }, { "docid": "57fb9fd5badda4d2ecf079deb5fe164d", "score": "0.6730403", "text": "function Stores(locationName, minCustomers, maxCustomers, avgCookieSales) {\n //start by listing unique variabl es using this keyword, use = instead of :\n this.locationName = locationName;\n this.minCustomers = minCustomers;\n this.maxCustomers = maxCustomers;\n this.avgCookieSales = avgCookieSales;\n this.hourlySalesArray = [];\n this.dayTotal = 0;\n this.acrossLocs = 0;\n this.totalTotal = 0;\n storesArray.push(this);\n}", "title": "" }, { "docid": "b00af091f016cdb5a1f58a88a6b4cb7f", "score": "0.67271143", "text": "function NewStore(storeName, storeLocation, minSalesPerHour, maxSalesPerHour, avgCookiesPerSale, stores) {\n\n this.storeName = storeName;\n this.storeLocation = storeLocation;\n this.minSalesPerHour = minSalesPerHour;\n this.maxSalesPerHour = maxSalesPerHour;\n this.avgCookiesPerSale = avgCookiesPerSale;\n this.cookieSalesForecast = [];\n this.totalDailySales = 0;\n stores.push(this);\n\n this.forecastCookieSales = function () {\n var estimatedSales;\n var cookieSalesForecastPerHour;\n for (var i = 0; i < hoursOfOperations.length; i++) {\n estimatedSales = Math.ceil(Math.random()*(this.maxSalesPerHour-this.minSalesPerHour+1)+this.minSalesPerHour);\n console.log('estimatedSales for ' + this.storeLocation + ': ' + estimatedSales);\n cookieSalesForecastPerHour = Math.ceil(estimatedSales * this.avgCookiesPerSale);\n this.cookieSalesForecast.push([hoursOfOperations[i], cookieSalesForecastPerHour]);\n this.totalDailySales += cookieSalesForecastPerHour;\n }\n };\n\n // this is awful. view data in my constructor! the concerns! the concerns!\n this.renderCookieSalesForecast = function (tableBody) {\n var cell = 0;\n this.forecastCookieSales();\n\n var newRow = tableBody.insertRow();\n\n var newRow1Cell0 = newRow.insertCell(0);\n newRow1Cell0.appendChild(document.createTextNode(this.storeLocation));\n\n for (var r = 0; r < hoursOfOperations.length; r++) {\n cell = newRow.insertCell(r + 1);\n cell.appendChild(document.createTextNode(this.cookieSalesForecast[r][1]));\n }\n\n cell = newRow.insertCell(hoursOfOperations.length + 1);\n cell.appendChild(document.createTextNode(this.totalDailySales));\n };\n\n}", "title": "" }, { "docid": "1c8816a6f958eeffc0b52030e98a1a66", "score": "0.666948", "text": "function dameStore(objstore){\r\n\t\treturn new Ext.data.Store({\r\n\t\t\turl: objstore.url,\r\n\t\t\treader:dameReaderCampos(objstore)\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "f6d1323618d6f86a1e2bb267baf382bd", "score": "0.6663933", "text": "function StoreLocation(locationName,minCustomers,maxCustomers,avgCookieBuy){\n this.location = locationName;\n this.minCustomers = minCustomers;\n this.maxCustomers = maxCustomers;\n this.avgCookieBuy = avgCookieBuy;\n this.dailyCookieCount = [];\n this.guestCookiesArr = [];\n allStores.push(this);\n}", "title": "" }, { "docid": "d8f08cc69f23ad7b8030c9a6dde3c0cf", "score": "0.6649931", "text": "initStore(data) {\n const newStore = Object.assign(this.store, data);\n this.store = newStore;\n }", "title": "" }, { "docid": "4fcfe8a2af6d78b179cdf949bd736aca", "score": "0.66133547", "text": "constructor(store, props) {\n this.store = store;\n this.props = props;\n this.initializeComponent();\n }", "title": "" }, { "docid": "d3f1a48d6edf2893fafa95eb3734ddae", "score": "0.6605894", "text": "function CookieStore(storeName, minCust, maxCust, avgCookies) {\n //var this = {};\n this.name = storeName;\n //return this;\n\n this.minCust = minCust;\n this.maxCust = maxCust;\n this.avgCookies = avgCookies;\n//below this holds things not in the constructor but used anyway.\n this.salesPerHour = [];\n this.total = 0;\n\n//end of CookieStore construction function\n}", "title": "" }, { "docid": "344031cf58d2d990e13de02dc0d09adc", "score": "0.6593178", "text": "function Stores(name, min, max, avgCookieSale){\n this.name = name;\n this.min = min;\n this.max = max;\n this.avgCookieSale = avgCookieSale;\n\n this.customers = [];\n this.cookies = [];\n this.totalCookies = 0;\n\n allStores.push(this);\n}", "title": "" }, { "docid": "bf75d4e87b3dd6a1b53dfbbe58255eea", "score": "0.6587693", "text": "function Store(props) {\n _classCallCheck(this, Store);\n\n var _this4 = _possibleConstructorReturn(this, (Store.__proto__ || Object.getPrototypeOf(Store)).call(this, props));\n\n _this4.createStoreItem = _this4.createStoreItem.bind(_this4);\n _this4.keys = Object.keys(props.inventory);\n return _this4;\n }", "title": "" }, { "docid": "ff3075c78971676be9646c2913c25051", "score": "0.65852225", "text": "function StoreMaster(cityName,minCustormers,maxCustormers,averageCookieSale){\n this.cityName = cityName;\n this.minCustormers= minCustormers;\n this.maxCustormers= maxCustormers;\n this.averageCookieSale = averageCookieSale;\n this.averageCustomer= [];\n this.averageCookieSold=[];\n this.totalCookiesSold=[];\n\n allStoresInfo.push(this);\n}", "title": "" }, { "docid": "dfd65a4908b6db157e89afb5b2d31c3b", "score": "0.65750694", "text": "constructor(root, store) {\n this.root = root;\n this.store = store;\n this.items = this.store.cartItems;\n this.init();\n }", "title": "" }, { "docid": "81555e061695e569e04167b967e68ca1", "score": "0.6537663", "text": "function createStore() {\r\n for(let i = 0; i < allStores.length; i++) { \r\n allStores[i].render();\r\n }\r\n}", "title": "" }, { "docid": "1f09bc32874fb37d9d873f4d06376275", "score": "0.6527572", "text": "function Store (id, opts = {}) {\n\t//console.dir('Store construction begins')\n\tthis.id = id ? id : uuidv4()\n\tthis.scale = _.isInteger(opts.scale) ? opts.scale : scales.indexOf('Object')\n\tthis.value = opts.value ? opts.value : 'Store 1'\n\tthis.type = opts.type ? opts.type : 'ShortText'\n\tthis.tag = opts.tag ? opts.tag : 'Data Store'\n\tthis.name = opts.name ? opts.name : 'store'\n\t//console.dir('Store construction ends')\n}", "title": "" }, { "docid": "53eb180221ab40218f714f70bd7a5a49", "score": "0.64891905", "text": "initialize(state) {\n const create = (id, v) => {\n // Create new object\n let next;\n if (v instanceof Array) {\n next = new List();\n this.store.add(id, next);\n addList(next, id, v);\n } else if (v instanceof Object) {\n next = new Map();\n this.store.add(id, next);\n addObj(next, id, v);\n } else {\n next = new Register(v);\n this.store.add(id, next);\n }\n // Add new object to store\n // this.store.add(id, next);\n };\n // Recursively adds to store\n const addList = (cursor, cursorId, list) => {\n let afterId;\n list.forEach(element => {\n const id = this.clock.timestamp();\n this.clock.tick();\n create(id, element);\n cursor = cursor.insert(afterId, id, id);\n afterId = id;\n });\n this.store.update(cursorId, cursor);\n };\n const addObj = (cursor, cursorId, obj) => {\n Object.entries(obj).forEach(([k, v]) => {\n // Generate id for crdt\n const id = this.clock.timestamp();\n this.clock.tick();\n create(id, v);\n // Add the new object id to cursor\n cursor = cursor.add(k, id, id);\n });\n this.store.update(cursorId, cursor);\n };\n if (state instanceof Array) {\n this.store = new Registry(new List());\n addList(this.store.root(), this.store.rootId(), state);\n } else if (state instanceof Object) {\n this.store = new Registry(new Map());\n addObj(this.store.root(), this.store.rootId(), state);\n } else {\n this.store = new Registry(new Register(state));\n }\n }", "title": "" }, { "docid": "a1ddea3bc4a5692bc3e980c8be596780", "score": "0.6477735", "text": "init(store): DeviceManager {\n this.store = store;\n return this;\n }", "title": "" }, { "docid": "94154a0d8ea0c372c9b333a352626259", "score": "0.6468303", "text": "store(t){const e=this.transaction.objectStore(t);return new zs(e);}", "title": "" }, { "docid": "7290128a17022a29e6946fc7757e2c03", "score": "0.6465217", "text": "static get Store() {\n return Store;\n }", "title": "" }, { "docid": "72c01cbd9f41adfc6bbaa514a1d0dd4c", "score": "0.6465013", "text": "init() {\n this.authorStore.init();\n this.bookStore.init();\n this.publisherStore.init();\n }", "title": "" }, { "docid": "0c8d851da6ae84d4294efa55613915b4", "score": "0.6461777", "text": "createStoreInstancesInType() {\n let storeInstances = this.get('model.storeInstancesInTypeXML');\n storeInstances.pushObject(FdClassExternalStoreInstancesInType.create());\n }", "title": "" }, { "docid": "4e4de21f732dedd914d3116ad6080d78", "score": "0.64431036", "text": "function Store (name, min, max, avg) {\n this.name = name;\n this.min = min;\n this.max = max;\n this.avg = avg;\n this.salesByHour = [];\n this.mainSales();\n}", "title": "" }, { "docid": "69cc6de92e82440bec4c0fcd385888e2", "score": "0.64414304", "text": "function getStores() {\n return [QuizStore];\n}", "title": "" }, { "docid": "28e17fe935a53d008420935f882abcc2", "score": "0.64280826", "text": "function CookieStore(location, minCust, maxCust, avgCookie){\n this.location = location;\n this.minCust = minCust;\n this.maxCust = maxCust;\n this.avgCookie = avgCookie;\n this.hourlySales = [];\n allStores.push(this);\n}", "title": "" }, { "docid": "2bcf31e8b0ddf5d8fe4339d7b18e7122", "score": "0.6419781", "text": "function Stores(name, minimumCustomersPerHour, maximumCustomersPerHour, averageCookiesPerCustomer) {\n this.name = name;\n this.minimumCustomersPerHour = minimumCustomersPerHour;\n this.maximumCustomersPerHour = maximumCustomersPerHour;\n this.averageCookiesPerCustomer = averageCookiesPerCustomer;\n this.customersEachHour = [];\n this.cookiesSoldEachHour = [];\n this.totalCookiesForTheDay = 0;\n this.totalHourCookie = 0; //added 10/07\n this.generateCookiesSoldEachHour();\n allStores.push(this);\n\n}", "title": "" }, { "docid": "d0621865840cd2328dd01f78a5bef30c", "score": "0.64186096", "text": "function getStore() {\n return store;\n}", "title": "" }, { "docid": "8e11e91cf8a64aa5ea00a57f62006bf4", "score": "0.6404417", "text": "constructor(data, store) {\n this._store = store;\n this._status = \"empty\";\n\n this.set(data);\n }", "title": "" }, { "docid": "cfb8dbce0ab38ceb6aca52c9041a802a", "score": "0.63844466", "text": "function DataStore() {\n this.data = {};\n }", "title": "" }, { "docid": "adcb4811a36306c90fa5a51a8260abb1", "score": "0.6362243", "text": "init(storeConfig) {\n this[config] = thorin.util.extend({\n debug: {\n create: true,\n read: true,\n update: true,\n delete: true,\n measure: true // should we measure ms\n },\n path: {\n formlets: path.normalize(thorin.root + '/app/formlets') // the formlet definition files\n },\n domain: null, // the domain to use for all formlet namespaces\n dropCreate: false, // set to true to perform drop-create. WARNING: removes ALL data.\n host: process.env.FORMLET_HOST || 'https://formlet.io',\n key: process.env.FORMLET_KEY || ''\n }, storeConfig);\n if (storeConfig.debug === false) {\n this[config].debug = false;\n }\n this[instance] = new formlet(this[config]);\n /* read up all models. */\n loadFormlets.call(this, this[config]);\n thorin.config('store.' + this.name, this[config]);\n }", "title": "" }, { "docid": "522478ef8f3a2bbb14c0f4189deec6ba", "score": "0.63537663", "text": "function Store () {\n EventEmitter.call(this)\n}", "title": "" }, { "docid": "d673e4b2267302a21ecbcd13b3552c72", "score": "0.6340012", "text": "function newStore(storeParams) {\n if (storeParams.middlewares) {\n return applyMiddleware.apply(void 0, storeParams.middlewares)(createStore)(storeParams.reducers, storeParams.parentWidget, storeParams.initialState);\n }\n return createStore(storeParams.reducers, storeParams.parentWidget, storeParams.initialState);\n}", "title": "" }, { "docid": "480866ec5f39f8b17be6836c72286d1a", "score": "0.63217026", "text": "initialiseStore(state) {\n if(localStorage.getItem('store')) {\n Object.assign(state, JSON.parse(localStorage.getItem('store')))\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ef4b45da9d288ff1f7a219d8b1d89604", "score": "0.6301659", "text": "function Stores(name, minCustomers, maxCustomers, avg){\n this.name = name;\n this.minCustomers = minCustomers;\n this.maxCustomers = maxCustomers;\n this.avg = avg;\n this.salesAmounts = [];\n this.totalHourlySales = 0;\n}", "title": "" }, { "docid": "eb011a3e6dfc91e08612f48c16f8898c", "score": "0.629594", "text": "function DataStore() {\n\t this.name = \"DataStore\";\n\t exports.extend(this, EventSystem);\n\t this.setDriver(\"json\"); //default data source is an\n\n\t this.pull = {}; //hash of IDs\n\n\t this.order = toArray(); //order of IDs\n\n\t this._marks = {};\n\t}", "title": "" }, { "docid": "0937156f23c871a919eae4d2d6463c6c", "score": "0.6279506", "text": "static getStore(props) {\n const { posts = [], post = {}, config = {} } = props;\n const store = {\n posts,\n post,\n config,\n };\n return store;\n }", "title": "" }, { "docid": "77a693e02f2d14ed149fd7753d7eb941", "score": "0.6276237", "text": "function store() {\n this.products = [];\n}", "title": "" }, { "docid": "dd37700a44d4d4c4ca5eb25a2c657812", "score": "0.627603", "text": "function LocationStoreFactory(name, members){\n\n class LocationStore extends Reflux.Store {\n constructor() {\n super();\n\n this.state = { name:name,\n members: members,\n visible: false,\n };\n this.listenables = locationActions;\n\n this.onVisible = this.onVisible.bind(this);\n }\n\n // Actions\n onVisible(location) {\n this.setState({visible:false});\n if (location === name) {\n this.setState({visible: true});\n // eslint-disable-next-line\n actions.map( (action) => {\n action.visible(name);\n });\n }\n }\n }\n\n LocationStore.id = name;\n return LocationStore;\n}", "title": "" }, { "docid": "da27d42914a68822e2d5ee7e0af2ed02", "score": "0.6272167", "text": "function Store(location, minimum, maximum, avgcookies) {\n this.location = location;\n this.minimum = minimum;\n this.maximum = maximum;\n this.avgcookies = avgcookies;\n this.cookieSales = ['<td>' + location + '</td>'];\n this.totalcookies = 0;\n}", "title": "" }, { "docid": "b50f38adda6b8d8494220d7a91dd00d5", "score": "0.6265233", "text": "constructor (store, name = '', description = '', id = v4(), createdTime = Date.now()) {\n this.store = store\n this.id = id\n this.pName = name\n this.pDescription = description\n this.pLastUpdate = createdTime\n this.pArchived = false\n this.pTaskList = []\n }", "title": "" }, { "docid": "7fb7b1e82aafcd8f67a6fb6106c8ec37", "score": "0.62636113", "text": "function instantiateStore(){return angular.injector([name]).invoke(factory, _store)}", "title": "" }, { "docid": "493b373aaf4b07f310e309f9c3e9b8a6", "score": "0.6253056", "text": "constructor(store) {\n this.store = store;\n this.enabled = this.test();\n }", "title": "" }, { "docid": "493b373aaf4b07f310e309f9c3e9b8a6", "score": "0.6253056", "text": "constructor(store) {\n this.store = store;\n this.enabled = this.test();\n }", "title": "" }, { "docid": "4bad516a4ae4602a4e49ebedeae308cb", "score": "0.62340105", "text": "function makeStands() {\n new MakeLocation('First and Pike', 23, 65, 6.3);\n new MakeLocation('SeaTac Airport', 3, 24, 1.2);\n //make one for each store\n}", "title": "" }, { "docid": "7a32d9e84d1f35b13d39b5d57b1a8496", "score": "0.62181634", "text": "function initStore(username) {\n if (window.redis) {\n store = new LocalStore({\n scope: username,\n store: new RedisStore({\n scope: username\n }),\n appSettings: appSettings\n });\n } else {\n store = new StaticDocStore();\n }\n}", "title": "" }, { "docid": "a24da6641d18a3e8170112ef720afc93", "score": "0.621788", "text": "constructor() {\n this.store = {};\n this.fastStore = configureFastStore();\n this.images = [];\n this.controllers = [];\n this.viewers = [];\n // TODO: make it configurable in the url\n this.devMode = true;\n }", "title": "" }, { "docid": "26256e0748320bb88347b2f22f14bf98", "score": "0.62116975", "text": "function BaseStore() {\n this._isDisposed = false;\n this._listeners = [];\n this._isDisposed = false;\n }", "title": "" }, { "docid": "db1cfccd1c520216b5ecc953a14afacb", "score": "0.62012494", "text": "function CookiesShops(store,min,max,avg,operationHours){\nthis.store=store;\nthis.min=min;\nthis.max=max;\nthis.avg=avg;\nthis.operationHours=operationHours;\nthis.cookiesperHour=[];\nthis.cookiePerDay=0;\n// push the constructor to the array\ntotalStrores.push(this);\n}", "title": "" }, { "docid": "aa3e9dfe0e432af3117580664061b9f0", "score": "0.6166798", "text": "static get store() {\n\t\treturn store;\n\t}", "title": "" }, { "docid": "c14f39d36fa7f85b4de17f53e9d511a7", "score": "0.61600727", "text": "function StoreLocator ( element, options ) {\n\t\t\tthis.element = element;\n\n\t\t\tthis.settings = $.extend( true, defaults, options );\n\t\t\tthis._name = pluginName;\n this.markers = [];\n this._markers = {};\n this.stores = {};\n this._showData = [];\n this.itemCount;\n this._markerCluster = null;\n this._filterNavigationHeight = null;\n this._activeCategories = [];\n this.infowindow = null;\n this.zoomListener = null;\n this.init();\n\t\t}", "title": "" }, { "docid": "8c51d49292f241ec7c8ea8ecdeff7d2b", "score": "0.61485445", "text": "function loadStores() {\n // get this stuff from database\n}", "title": "" }, { "docid": "437756a85f3303b485e119478e3f077c", "score": "0.614825", "text": "function Store(options = {}) {\n this.__set__ = options.set;\n this.__get__ = options.get;\n this.__keys__ = {};\n}", "title": "" } ]
d09f300829deac64365e464acc9beece
ToDo add constructor, state, component did mount and axios function to store shelters in state.
[ { "docid": "98a57e1a0e7c87e4c8f2e1733381df7a", "score": "0.62236303", "text": "constructor(props) {\n super(props);\n this.state = {\n sheltersZipCodes:[]\n };\n }", "title": "" } ]
[ { "docid": "1a4b0ed187d8f5dc4dd9447dc85f5a21", "score": "0.6745269", "text": "componentDidMount() {\n BooksAPI.getAll()\n .then((books) => {\n this.setShelvesState(books);\n this.setState({books: books});\n });\n }", "title": "" }, { "docid": "3978adb7976c650ea058d69dfab734c1", "score": "0.65293884", "text": "componentDidMount() {\n BooksAPI.getAll().then(books => {\n this.updateStateShelf(books);\n });\n }", "title": "" }, { "docid": "e4b490410f090b09496c22f99c30c1eb", "score": "0.64176047", "text": "setShelvesState(books) {\n let shelves = {};\n ShelfNames.forEach((shelf) => shelves[shelf.id] = []);\n\n books.forEach((book) => shelves[book.shelf].push(book.id));\n this.setState({shelves: shelves});\n }", "title": "" }, { "docid": "48740e7b020cc77908e34d6e874fdd3d", "score": "0.6263269", "text": "constructor(props) {\n //Call the constrictor of Super class i.e The Component\n super(props);\n //maintain the state required for this component\n this.state = {\n id : localStorage.getItem(\"id\"),\n getREvent: [],\n\n }\n //Bind the handlers to this class\n\n }", "title": "" }, { "docid": "180d124fa77cc8045550a38ed708ee14", "score": "0.6216649", "text": "getAll(){\n BooksAPI.getAll()\n .then(books => {\n // construct initial shelves in temp object\n const shelves = {} ;\n books.forEach(\n book => ( shelves[book.shelf] || (shelves[book.shelf] = []) ).push(book)\n ) ;\n this.setState({\n shelves\n }) ;\n })\n .catch(error=>{\n // ???\n })\n }", "title": "" }, { "docid": "c6468ec8d060c249d3557613b1feef53", "score": "0.61997694", "text": "componentDidMount() {\n this.setState({\n name: localStorage.getItem(`name`),\n type: localStorage.getItem(`type`),\n username: localStorage.getItem(`username`)\n });\n\n axios\n .post(config.get(\"host_url\") + config.get(\"routes.user_profile\"), {\n username: localStorage.getItem(`username`),\n type: localStorage.getItem(`type`)\n })\n .then(res => {\n var data = res.data;\n this.setState({\n starList: data.starList,\n sourceSubscription: data.sourceSubscription\n });\n })\n .catch(error => {\n this.setState({\n error: error,\n placeholder: error.message,\n submitting: false\n });\n });\n\n axios\n .get(config.get(\"host_url\") + config.get(\"routes.sources\"))\n .then(res => {\n this.setState({\n sources: res.data.source_list\n });\n });\n }", "title": "" }, { "docid": "8d5c91c81877c2d0db23571629ef4932", "score": "0.61833435", "text": "componentDidMount(){\n\t\tAxios.get('/api/store/preferred')\n\t\t \t .then(res => {\n\t\t\t\tlet response = res.data.response;\n\t\t\t\tlet status = res.data.status;\n\n\t\t \t \tif(status ==='error'){\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tinfo : {\n\t\t\t\t\t\t\ttitle : 'Error',\n\t\t\t\t\t\t\tcolor : 'danger',\n\t\t\t\t\t\t\ttext : ' There is no SHOPS saved in your Preferred List yet',\n\t\t\t\t\t\t\thide : false\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t \t}else{\n\n\t\t \tif(!response.length){\n\t\t \t\tthis.setState({\n\t\t\t\t \t info : {\n\t\t\t\t\t\t\t\ttitle : 'Empty',\n\t\t\t\t color : 'info',\n\t\t\t\t\t\t\t\ttext : ' There is no SHOPS saved in your Preferred List yet',\n\t\t\t\t\t\t\t\thide: false\n\t\t\t\t \t}\n\t\t\t\t \t});\n\t\t }else{\n\t\t\t\t\t\t\t\n\t\t\t const shops = response.filter(str =>{\n\t\t\t\t \tlet point = {\n\t\t\t\t\t\t\t \t\t'id' : str.Id,\n\t\t\t\t\t\t\t \t'Name' : str.Name ,\n\t\t\t\t\t\t\t \t'Address' : str.Address,\n\t\t\t\t\t\t\t \t'Owner'\t : str.Owner,\n\t\t\t\t\t\t\t \t'Like'\t : str.Like,\n\t\t\t\t\t\t\t \t'Dislike' : str.Dislike,\n\t\t\t\t\t\t\t \t'Coords' : {\tlatitude: str.Coords.latitude,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlongitude: str.Coords.longitude\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t \t\t\t};\n\t\t\t\t \treturn point.Like;\n\t\t\t });\n\n\t\t\t\t this.setState({\n\t\t\t\t \tshops : shops\n\t\t\t\t });\n\n\t\t\t }\n\t \t}\n\t\t})\n\t\t \t .catch(err =>{\n\t\t\t\t \n\t\t\t\t this.setState({\n\t\t\t\t\tinfo : {\n\t\t\t\t\t\tcolor : 'danger',\n\t\t\t\t\t\ttext : ' an error occured while fetching Stores List [ ' + err.response.statusText + ' ]',\n\t\t\t\t\t\thide : false\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t}", "title": "" }, { "docid": "eb1e2d0b8bc5ffeffb4f2143c7711c26", "score": "0.6151194", "text": "async componentWillMount() {\n if (!sessionStorage.traits) {\n var traits = await axios.get('/api/traits');\n \n sessionStorage.traits = JSON.stringify(traits.data);\n }\n\n this.setState({ data: JSON.parse(sessionStorage.traits) });\n\n if (window.location.href.includes(\"edit\")) {\n\n // Do student lookup from id, and then fill data/set state\n const { id } = this.props.match.params;\n\n var student = await axios.get(`/api/student?id=${id}`);\n student = student.data;\n\n this.setState({\n studentName: student.studentName,\n studentClass: student.studentClass,\n year_semester: student.year_semester,\n selectedTraits: student.selectedTraits,\n id\n });\n }\n\n var classes = await axios.get('/api/classes');\n this.setState({ classes: classes.data });\n }", "title": "" }, { "docid": "f5490d0343fd04956865a5033ecc71a3", "score": "0.6134643", "text": "constructor(props){\n super(props);\n this.state = { \n loading: false,\n ticker: '',\n tickers: [],\n tickerData: []\n };\n\n this.handleTickerChange = this.handleTickerChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.deleteTicker = this.deleteTicker.bind(this);\n this.createTickers();\n }", "title": "" }, { "docid": "f72edb62d01ec202c19e3de3ef5ad665", "score": "0.61297077", "text": "constructor(props) {\n //make sure this stays a React component\n super(props);\n\n // 1. initiate states\n this.state = {\n currentColor: \"red\",\n currentHarmony: \"direct\",\n harmonyColor: appState.harmonyColor,\n harmonyHex: appState.harmonyHex,\n activeHarmony: \"direct\"\n };\n\n //register App component as a watcher for a change in data\n harmoniesDataStore.register(this);\n }", "title": "" }, { "docid": "b02880b2974599bcae0bcc0f9f9490cd", "score": "0.6101117", "text": "componentDidMount() {\r\n let service = new ItemService();\r\n let data = service.getCatalog();\r\n this.setState({ catalog: data });\r\n }", "title": "" }, { "docid": "77f3c64547e3f8b45edc1087d98290df", "score": "0.6092304", "text": "constructor(props) { //this is how we define/initialize state in a class based component\n super(props);\n\n this.state = { term: ''}; // this.state = an object\n }", "title": "" }, { "docid": "e52ab76865ced892db66c5bf6e1fa3b4", "score": "0.6089869", "text": "constructor(props) {\n //Call the constrictor of Super class i.e The Component\n super(props);\n //maintain the state required for this component\n this.state = {\n id: localStorage.getItem(\"id\"),\n toggle: false,\n text: \"\",\n data: []\n }\n\n this.changeDisplay = this.changeDisplay.bind(this)\n this.changHandler = this.changHandler.bind(this)\n this.chat = this.chat.bind(this)\n\n }", "title": "" }, { "docid": "84d7945a25f5d6fd1aee70fd4391d250", "score": "0.60854673", "text": "componentDidMount() {\n Api.getShoes().then((result) => {\n this.setState({shoes : result});\n });\n }", "title": "" }, { "docid": "c1f584f93d4f7d623d6a13df238f9641", "score": "0.6071175", "text": "constructor () {\n super()\n this.state = {\n\n }\n }", "title": "" }, { "docid": "c2c574904d1498502acb94da82d605be", "score": "0.6069179", "text": "constructor(props) {\n super(props)\n\n this.state = {\n serversState: [],\n }\n }", "title": "" }, { "docid": "8e85e3479d4c73ceae4913d7b094137d", "score": "0.60594666", "text": "componentDidMount() {\n let service = new ItemService();\n let data = service.getCatalog();\n\n \n this.setState({ catalog: data});\n }", "title": "" }, { "docid": "d287e2654f26758a70cd88c424d50104", "score": "0.6059346", "text": "constructor () {\n\t\tsuper()\n\t\tthis.state = {\n\n\t\t}\n\t}", "title": "" }, { "docid": "9dcc4697b48ac937941ab20603172d39", "score": "0.6047201", "text": "constructor(props){\n super (props);\n this.state = { books: JSON.parse(localStorage.getItem('books')) , term:'' };\n this.onDelete = this.onDelete.bind(this);\n this.onAdd = this.onAdd.bind(this);\n this.onEditSubmit = this.onEditSubmit.bind(this);\n this.searchBook = this.searchBook.bind(this);\n }", "title": "" }, { "docid": "22e103dfabc33eadf0984a1674dcf760", "score": "0.6042765", "text": "constructor(){\r\n\t\tsuper();\r\n\t\tthis.state = { \r\n\t\t\tguests: []\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7ce47b86ef230d83a68823edbcf650c8", "score": "0.60399574", "text": "componentDidMount() {\n\t\tBooksAPI.getAll()\n\t\t\t.then(books => {\n\t\t\t\t// Organize the books into a map (id:object) to allow constant time lookups\n\t\t\t\t// store the shelf contents as ids, the detailed object can be retreived from the map if needed\n\t\t\t\tconst myState = books.reduce((state, book) => {\n\t\t\t\t\tstate.bookMap[book.id] = book\n\t\t\t\t\tswitch (book.shelf) {\n\t\t\t\t\t\tcase 'wantToRead':\n\t\t\t\t\t\t\tstate.wantToRead.push(book.id)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'currentlyReading':\n\t\t\t\t\t\t\tstate.currentlyReading.push(book.id)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'read':\n\t\t\t\t\t\t\tstate.read.push(book.id)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\treturn state\n\t\t\t\t}, this.initialState)\n\t\t\t\tthis.setState(myState)\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\t// show a small toast message when the api call fails\n\t\t\t\tconsole.log('an error ocurred', error)\n\t\t\t\tnotify.show(`Failed to communicate with Books API`, 'error', 2000)\n\t\t\t})\n\t}", "title": "" }, { "docid": "243c89c04e06276edc30c48375a847d4", "score": "0.603138", "text": "constructor(){\n super()\n this.state = {}\n }", "title": "" }, { "docid": "841805e53708fff7c4d832ac4e3e516a", "score": "0.602419", "text": "componentDidMount() {\n axios.get(\"/api/menus\")\n .then( res => {\n this.setState({ menus: res.data, });\n })\n .catch( err => {\n console.log(err);\n });\n \n }", "title": "" }, { "docid": "55dc0939d3f3fa8a6330bce39703dba4", "score": "0.60123616", "text": "constructor() {\n // we'll have to use super() whenevr we're extending from some other class\n super();\n this.state = {\n homeLink: \"Home\",\n homeMounted: true,\n };\n }", "title": "" }, { "docid": "d0edd272c355a817829efe64292695f8", "score": "0.60054475", "text": "constructor() {\n super()\n this.state = {}\n }", "title": "" }, { "docid": "8175393f57aedefe48f10caa4fb8c940", "score": "0.6004911", "text": "constructor(){\n super();\n this.state={}\n }", "title": "" }, { "docid": "81a4001a917016aaf7f30c12760ec430", "score": "0.60034734", "text": "constructor() {\n super();\n this.state = {\n data: []\n };\n }", "title": "" }, { "docid": "9d43d88c07aa2667ca49c2b1694ec078", "score": "0.5990309", "text": "componentDidMount(){\n axios.get('http://localhost:3001/cluster-home')\n .then((response) => {\n this.setState({\n clusters : this.state.clusters.concat(response.data) \n });\n });\n }", "title": "" }, { "docid": "13e8cc1c0e61f72d93810114ecdb2c88", "score": "0.59862053", "text": "constructor() {\n super();\n\n this.state = { data: [] };\n }", "title": "" }, { "docid": "c4554c73a3f8e4310a7d6a9c4593f87d", "score": "0.5982732", "text": "constructor(props) {\n super(props);\n\n this.state = ({\n userPortalPermissionModel: \"\",\n userPortalPermissionunmodifiedModel: \"\",\n componentJustMounted: true\n });\n\n }", "title": "" }, { "docid": "6dec5dcc6c94bdac5322894c504be43e", "score": "0.59687346", "text": "constructor(){\n super()\n this.state= {\n robots: robots,\n searchfield: '',\n }\n }", "title": "" }, { "docid": "82ee1a4711fcaac20960a30fae934d25", "score": "0.59637535", "text": "constructor(props, context) {\n super(props, context);\n const SimpleStorage = context.drizzle.contracts[\"SimpleStorage\"];\n this.state.dataKey = SimpleStorage.methods[\"storedData\"].cacheCall();\n }", "title": "" }, { "docid": "dee0b743676d19712e0e07e6d62215cf", "score": "0.5959417", "text": "componentDidMount() {\n\t\tlet newStates = {};\n\t\tif(authed){\n\t axios.get(`${window.location.protocol}//${window.location.host}/getvideo/${this.props.match.params.videoId}`)\n\t .then(res => {\n\t newStates.video = res.data;\n\t return axios.get(`${window.location.protocol}//${window.location.host}/getchannel/${res.data.snippet.channelId}`);\n\t }).then(res => {\n\t \tnewStates.channel = res.data;\n\t \tthis.setState(newStates);\n\t });\n \t}\n\t}", "title": "" }, { "docid": "b86c7b66178c59bcd66329dbd041cebe", "score": "0.5955325", "text": "componentWillMount(){\n console.log(\"componentWillMount in AlnumList\");\n axios.get('https://rallycoding.herokuapp.com/api/music_albums')\n .then(response=>{\n console.log(\"check salon list response:\",response);\n this.setState({albums: response.data});\n }) \n console.log(\"my class state prop\",this.state.albums);\n }", "title": "" }, { "docid": "81615c761faedad38dc534b6d7fc3d6b", "score": "0.5955251", "text": "constructor() {\n super();\n this.state = {\n // robotsState: robots,\n // robots: robots,\n //(#5): will be loaded from now\n robots: [],\n searchfield: '',\n };\n // console.log('Constructor');\n }", "title": "" }, { "docid": "656cdac7d16081e01d485efc5444561b", "score": "0.59453404", "text": "constructor(props) {\n super(props);\n this.state = {\n user: localStorage.getItem('username'),\n events: [],\n columns: [],\n eventLoading: false\n }\n }", "title": "" }, { "docid": "31351e6374fbd0e608829a251301b0ed", "score": "0.59394366", "text": "componentDidMount()\n {\n //This is the data model;\n const data = new Data();\n\n if(localStorage.getItem('settings') === null) {\n browserHistory.push('/setup');\n }\n else {\n this.state = {\n widgets : JSON.parse(localStorage.getItem('widgets') || '[]'),\n hidden_widgets : JSON.parse(localStorage.getItem('hidden_widgets') || '[]'),\n editing : false,\n newCounter: 0\n };\n\n this.updateDevices(data);\n }\n\n this.generateLayout();\n }", "title": "" }, { "docid": "28515076d41cc58dd9c979963b5da833", "score": "0.59378475", "text": "constructor() {\n super();\n\n //add props\n this.state = {\n name: 'Mufasa',\n size: 'Large'\n };\n }", "title": "" }, { "docid": "937c903eab8572618e4f4c6a92b6b1df", "score": "0.59372693", "text": "componentDidMount() {\n //add some data\n axios.get('/api/movies')\n .then((response) => {\n this.setState((state)=> {\n //add key of title and add key of watched to match previous info\n var addedKeys = response.data.map(function(movie){\n return {...movie, title: movie.Title, watched: false, show: false}\n });\n return {movies: addedKeys};\n })\n })\n .catch((err) => {\n console.log(err)\n })\n }", "title": "" }, { "docid": "805e028330f23e5c76a4e180111727a6", "score": "0.59369403", "text": "constructor({ addCat }){\n super();\n this.state = {\n name: '',\n alignment: ''\n }\n }", "title": "" }, { "docid": "d39e0d8ee62c97eb7f8b15791a157f2b", "score": "0.5936458", "text": "async componentDidMount() {\n const { data: stores } = await getStores();\n this.setState({ stores });\n }", "title": "" }, { "docid": "313a86d4962a81e0414fbc7613949abf", "score": "0.5934098", "text": "componentDidMount() {\n axios\n .get('http://localhost:3333/smurfs')\n .then(res => this.setState({ smurfs: res.data }));\n }", "title": "" }, { "docid": "3430f65bc2d1a3bd50cae96a48024966", "score": "0.5933726", "text": "constructor(props){\n super(props);\n this.state = {info: data} \n \n }", "title": "" }, { "docid": "308fde6440980cba9bc18c764ec061ff", "score": "0.5933409", "text": "componentDidMount() {\n\t\taxios({\n\t\t\tmethod: 'get',\n\t\t\turl: environment['api-url'] + '/me',\n\t\t\theaders: {'Authorization': read_cookie('auth_token')},\n\t\t})\n\t\t.then(function(response) {\n\t\t\tthis.setState({\n\t\t\t\t'reddit': response.data.settings.reddit,\n\t\t\t\t'facebook': response.data.settings.facebook,\n\t\t\t\t'twitter': response.data.settings.twitter\n\t\t\t})\n\t\t}.bind(this))\n\t\t.catch(function(response) {\n\t\t\tconsole.log(response);\n\t\t\t\n\t\t});\t\t\n\t }", "title": "" }, { "docid": "b2c4c61e77a182c806719a5349aa5bf4", "score": "0.5930625", "text": "constructor(props) {\n super(props);\n this.state = {\n name: props.name,\n uuid: props.uuid,\n x: props.x,\n y: props.y,\n status: props.status,\n friends: props.friends,\n }\n }", "title": "" }, { "docid": "295fd851addd77576f19debcab93b7c6", "score": "0.5922758", "text": "constructor(props) {\n super(props);\n this.state = {\n //defined a 'cryptos' property which will hold the response\n //data from the api\n cryptos: [],\n }\n }", "title": "" }, { "docid": "8c4a3224a4b92a8898abaf26b5dfe98f", "score": "0.59190464", "text": "componentDidMount() {\r\n let localBooksData = getDataFromLocalStorage(\"bookShelf\");\r\n if (localBooksData) {\r\n localBooksData = localBooksData.filter(onlyUnique);\r\n this.setState({\r\n filterdShelves: [...localBooksData]\r\n });\r\n }\r\n }", "title": "" }, { "docid": "4e5fec9daa12a5dc24638bf1d5decce4", "score": "0.5916951", "text": "constructor() {\n super();\n this.state = {\n data: []\n };\n }", "title": "" }, { "docid": "97985978517072dd35ab148e35d7ffb0", "score": "0.59125745", "text": "init() {\n this.onBuyNowListener = this.onBuyNow.bind(this);\n this.categLinkActionListener = this.categLinkAction.bind(this);\n \n // state data required for hbs template\n this.state = {\n products: this.data.products.map(product => {\n return { ...product }\n }),\n empty: this.data.products.length == 0,\n allSelected: !this.routeParams.id || this.routeParams.id.length == 0,\n categories: this.data.categories.map(category => {\n return { ...category, active: this.routeParams.id == category.id };\n })\n };\n }", "title": "" }, { "docid": "445a162728b504b8fd5d3c06cb47e3a8", "score": "0.59086156", "text": "componentDidMount() {\n $(\"#addseriescancel\").click(function () {\n $(\"#new-series-area\").toggleClass(\"sform\");\n $(\"#trender-area\").toggleClass(\"hchart\");\n });\n\n $(\"#addseriessave\").click(function () {\n $(\"#new-series-area\").toggleClass(\"sform\");\n $(\"#trender-area\").toggleClass(\"hchart\");\n });\n }", "title": "" }, { "docid": "6ab118ab9ae86683717a92af6b76da25", "score": "0.59048164", "text": "componentDidMount() {\n this.setState({\n hobbies: localStorage.get('hobbies')\n });\n localStorage.set('HobbiesKomplett', this.checkComponentCompleteness());\n }", "title": "" }, { "docid": "d9f606764a6e8c3bab99dad5b29ee0d4", "score": "0.5896593", "text": "constructor(props) {\n super(props);\n this.state = {\n id: h.randomString(),\n suggestions: [],\n };\n }", "title": "" }, { "docid": "10322248057f782f8f3460323c311033", "score": "0.5878666", "text": "componentDidMount() {\n axios.get('http://localhost:3333/smurfs')\n .then(response => {\n this.setState({\n smurfs: response.data\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "d408129d7399084567c347ccf0b7d9fd", "score": "0.58756524", "text": "componentWillMount() { \n console.log(\"Inside Account componentDidMount : \");\n //console.log(store.getState());\n console.log(sessionStorage.getItem(\"user\"));\n //this.state.user = JSON.parse(sessionStorage.getItem(\"user\"));\n this.setState({\n user: JSON.parse(sessionStorage.getItem(\"user\"))\n });\n //this.state.setState('user', JSON.parse(sessionStorage.getItem(\"user\")));\n //this.state.user.UserName = \"varun\";\n //console.log(store.getState().user.UserName + \" : \" + this.state.user.UserName);\n // axios.get(url + \"account\").then((response) => {\n // //update the state with the response data\n // console.log(\"Inside account axios.get\");\n // this.setState({\n // books: this.state.books.concat(response.data),\n // });\n // });\n }", "title": "" }, { "docid": "0761e974ff5c9ba9d9b3cdec35308cee", "score": "0.58738905", "text": "componentDidMount() {\n axios.get('/api/inventory').then( response => {\n console.log('hit api')\n this.setState({\n inventory: response.data\n })\n }).catch( err => {\n console.log('mfr',err)\n })\n }", "title": "" }, { "docid": "f96f487133d1008ae1d52ce4c44a1e8a", "score": "0.58731145", "text": "constructor(props) {\n super(props);\n //define the initial state\n this.state = {\n pets: []\n };\n }", "title": "" }, { "docid": "63810f3b9706820b435387554f74e8ac", "score": "0.5869819", "text": "constructor(props) {\n super(props)\n this.state = {\n healthObjects: []\n }\n\n this.serviceObjects = [{\n \"serviceName\": \"Customers Service\",\n \"serviceUrl\": \"/api/customers/health\",\n \"serviceStatusCode\": '',\n \"serviceStatusText\": ''\n },\n {\n \"serviceName\": \"Articles Service\",\n \"serviceUrl\": \"/api/articles/health\",\n \"serviceStatusCode\": '',\n \"serviceStatusText\": ''\n },\n {\n \"serviceName\": \"Inventory Service\",\n \"serviceUrl\": \"/api/inventory/health\",\n \"serviceStatusCode\": '',\n \"serviceStatusText\": ''\n },\n {\n \"serviceName\": \"Orders Service\",\n \"serviceUrl\": \"/api/orders/health\",\n \"serviceStatusCode\": '',\n \"serviceStatusText\": ''\n }]\n\n this.urls = [\"/api/customers/health\", \"/api/articles/health\", \"/api/orders/health\"]\n this.promises = [];\n\n }", "title": "" }, { "docid": "a5be2e8bc2105b8e5cfbc9bda2075afc", "score": "0.58641005", "text": "componentDidMount(){\n\t\tif(!this.sh){\n\t\t\tthrow new Error('A Chart object is initialized without a manager!');\n\t\t}\n\n\t\tthis.sh.addKey(this.myKey,this,this.myId);\n\t}", "title": "" }, { "docid": "6ab461022c7b635780edabd1ee1c1301", "score": "0.58581233", "text": "constructor(props) {\n super(props);\n this.state = {\n name: '',\n description: '',\n thumbnail: '',\n website: '',\n github: '',\n date_completed: '',\n tag_id: ''\n }\n }", "title": "" }, { "docid": "3ccb003c6dcbad09d8cd9bebf12f6898", "score": "0.5857694", "text": "componentDidMount() {\n // Retrieve the list of state data from the server\n api.get('/states').then((response) => {\n this.setState({ states: response.data });\n });\n }", "title": "" }, { "docid": "6d408bdd5f26aeef2891b7f0ce5926de", "score": "0.58525825", "text": "componentDidMount(){\r\n //call the service to get the list of items\r\n var service = new ItemService();\r\n var items = service.getCatalog();\r\n this.setState({items: items});\r\n }", "title": "" }, { "docid": "ae7e432855629aa3a51f63f8d3a970ec", "score": "0.5851546", "text": "componentDidMount() {\n axios.get('/inv/')\n .then(response => {\n this.setState({inventory: response.data});\n })\n .catch(function (error) {\n console.log(error);\n })\n }", "title": "" }, { "docid": "ae7e432855629aa3a51f63f8d3a970ec", "score": "0.5851546", "text": "componentDidMount() {\n axios.get('/inv/')\n .then(response => {\n this.setState({inventory: response.data});\n })\n .catch(function (error) {\n console.log(error);\n })\n }", "title": "" }, { "docid": "e91788be9f04ffaaeaffaf96275de61a", "score": "0.5851298", "text": "componentDidMount() {\n let name = localStorage.getItem(\"userName\")\n this.setState({ userName: name });\n axios.get('http://localhost:8080/cart')\n .then(res => {\n console.log(res)\n this.setState({\n cartItems: res.data\n })\n })\n .catch((error) => {\n console.log(\"error2\")\n console.log(error)\n })\n }", "title": "" }, { "docid": "ee2921a401aeef9aebc149176f341f27", "score": "0.5849782", "text": "constructor() {\n // This calls the constructor from component so that we can use the\n // \"this\" keyword.\n super()\n this.state = {\n // These are the things that can change and affect our app\n robots: [],\n searchfield: ''\n }\n }", "title": "" }, { "docid": "68dbc67e7ed91802a41bff504f2ac06e", "score": "0.58488417", "text": "constructor(props){\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tusersCards:JSON.parse(JSON.stringify(modelInstance.getUsersCards())),\n\t\t\topponentsCards:JSON.parse(JSON.stringify(modelInstance.getOpponentsCards())),\n\t\t\thistory:[],\n\t\t};\n\t}", "title": "" }, { "docid": "613c41e2f8409b6386f8c7ec32159907", "score": "0.58438915", "text": "constructor(props) {\n super(props);\n this.state = {\n name: props.name,\n \n };\n }", "title": "" }, { "docid": "ad089d79a72f337b5853a2cd8b08423b", "score": "0.58436173", "text": "constructor(props) {\n super(props);\n\n this.state = { items: [],name:'',user:[],isloaded:false};\n}", "title": "" }, { "docid": "952ee0f955c2dc573198481230ea8723", "score": "0.5842081", "text": "constructor(props) {\n super(props);\n\n // this.state = {\n // dishes: DISHES,\n // comments: COMMENTS,\n // promotions: PROMOTIONS,\n // leaders: LEADERS\n // };\n }", "title": "" }, { "docid": "7ec7308f19b26a4a4b9bd69186a81b1b", "score": "0.5839231", "text": "constructor(props) {\r\n //Call the constrictor of Super class i.e The Component\r\n super(props);\r\n //maintain the state required for this component\r\n this.state = {\r\n email: localStorage.getItem('user'),\r\n repoData: [],\r\n authFlag: false,\r\n error_message: \"\",\r\n show: false,\r\n setShow: false,\r\n repoName:\"\",\r\n repoDescription:\"\",\r\n confirmation:\"\",\r\n tester_show: false,\r\n tester_setShow: false,\r\n testerData:[],\r\n assignRepo:\"\",\r\n assignTester:\"\",\r\n repoError:\"\"\r\n }\r\n this.handleClose = this.handleClose.bind(this);\r\n this.handleShow = this.handleShow.bind(this);\r\n this.tester_handleClose = this.tester_handleClose.bind(this);\r\n this.tester_handleShow = this.tester_handleShow.bind(this);\r\n this.addRepo = this.addRepo.bind(this);\r\n this.assignTester = this.assignTester.bind(this);\r\n }", "title": "" }, { "docid": "cfb9ebaf025864cb93228725d865bb78", "score": "0.58388925", "text": "componentDidMount(){\n axios\n .get('http://localhost:3333/smurfs')\n .then(res => {\n this.setState({\n smurfs: res.data\n })\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "33722c2092b9553b9d4696fc85fbe0c8", "score": "0.58357984", "text": "constructor(props) {\n // INVOKE SUPER TO ACCESS PROPS FROM PARENT\n super(props);\n // OUR STATE DECLARATION\n this.state = {\n subreddits: [\"r/reactJS\", \"r/pcmasterrace\", \"r/cutedoggos\", \"r/uglycats\"]\n };\n // BIND FUNCTION IN CONSTRUCTOR TO KEEP CONTEXT ON APP\n this.handleNameChange = this.handleNameChange.bind(this);\n }", "title": "" }, { "docid": "9e2da1d23a85582f96149fff811c2c0f", "score": "0.5834821", "text": "constructor()\n {\n super()\n this.state = { \n ref:[],\n title:[],\n pic: [],\n disc: [],\n website: [],\n }\n }", "title": "" }, { "docid": "7ac5b9bb57ca73ebc3f7279535adfc98", "score": "0.5831408", "text": "componentDidMount() {\n const repositories = localStorage.getItem('repositories');\n /**\n * busca os repositórios já armazenados no\n * localStorage e exibe assim que o componente é montado\n */\n\n if (repositories) {\n this.setState({ repositories: JSON.parse(repositories) });\n } /** se existirem repositórios já armazenados, eles são carregados e formatados em JSON */\n }", "title": "" }, { "docid": "2ccca8c1ab8f46bbbd68b4396b3c18b0", "score": "0.58251184", "text": "constructor(props) {\n super(props);\n this.createRepo = this.createRepo.bind(this);\n this.state = {\n repos :[],\n name:\"\",\n smShow: false,\n repoName:\"\",\n description: \"\",\n type:false,\n error:\"\",\n\n\n\n };\n }", "title": "" }, { "docid": "361a428e78b814c3df0c6b40cd8aebf5", "score": "0.5821789", "text": "componentDidMount(){\n\n /// get the id of current user \n let ID = getInfo().data._id\n\n // Mack API call to get all the service of close state\n getAllClosedService(ID)\n .then( (reponse)=>{\n this.setState({History: reponse.data})\n })\n .catch( (error)=>{\n })\n }", "title": "" }, { "docid": "940b5dcc0f1b487baa50d57af6f1c113", "score": "0.58212465", "text": "constructor(props) {\n super(props);\n this.state = {environment: '', heading: ''}\n }", "title": "" }, { "docid": "c5e9b95ad405e83d02fb26f8114bc992", "score": "0.5814679", "text": "constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n id: props.id,\r\n name: props.name,\r\n nickname: props.nickname,\r\n hobby: props.hobby,\r\n };\r\n }", "title": "" }, { "docid": "4888f72bad292ae1f3092974c26b2b1d", "score": "0.581345", "text": "componentWillMount() {\n const _this = this;\n axios.get('/items') // get the products related data\n .then((response) => {\n _this.setState({ data: response.data.catalog });\n })\n .catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "8fdacd9f47e698c99e17815af0e9282b", "score": "0.5808603", "text": "componentDidMount() {\n axios\n .get(this.apiUrl)\n .then(({ data: { title, data } }) => {\n this.setState({ title, content: data });\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "36979913684d773cdb058caca9ab0093", "score": "0.58061767", "text": "constructor(){\n super()\n this.state = {\n robots: [],\n searchField: ''\n }\n }", "title": "" }, { "docid": "338af6866c8212b9e36bd11552385fa1", "score": "0.5800425", "text": "constructor(props){\n super(props)\n this.state = {\n // can be imported as module too\n books: booksData\n };\n }", "title": "" }, { "docid": "e20062bf42a6e439b0057a12bb72303c", "score": "0.5798623", "text": "constructor(props){\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "e20062bf42a6e439b0057a12bb72303c", "score": "0.5798623", "text": "constructor(props){\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "426b3aa1f16df0eb0f75a83e34baa5ec", "score": "0.5798374", "text": "componentDidMount() {\n API.fetchSavedBooks()\n // store in state\n .then(res => this.setState({ savedTitles: res.data.data }))\n }", "title": "" }, { "docid": "a6f55264132d12bd384392c3f2d5d111", "score": "0.5794147", "text": "constructor(props) {\n super(props);\n this.state = { data: [] };\n }", "title": "" }, { "docid": "c5ff461a642874634c97c7a0d163945d", "score": "0.57923305", "text": "componentDidMount() {\n LocalStorage.loadToState(this.getSaveName(), this);\n }", "title": "" }, { "docid": "c5ff461a642874634c97c7a0d163945d", "score": "0.57923305", "text": "componentDidMount() {\n LocalStorage.loadToState(this.getSaveName(), this);\n }", "title": "" }, { "docid": "0dad2667d152f84d5b21db634f24a98e", "score": "0.579109", "text": "constructor(props){ //Constructor always receive props\n super(props); //Superconstructor\n this.state = {\n username: '',\n isSearching: false,\n option: '',\n state: '',\n entries:[],\n };\n }", "title": "" }, { "docid": "8fbba37df3c93358f15b5a61870efc94", "score": "0.5790115", "text": "constructor() {\n super();\n this.state = {\n recipes: [],\n userInput: \"\",\n };\n }", "title": "" }, { "docid": "a5ec16ac5bc290f16eab1060f9aa829f", "score": "0.57888067", "text": "componentDidMount()\n {\n // When initializing for the first time,\n // reach out to the server to get the product list.\n api.listProducts(response => {\n store.dispatch({\n type: \"addProductList\",\n data: response.data,\n })\n })\n }", "title": "" }, { "docid": "68545f197ba917e6a7f31501c491c7d5", "score": "0.5788704", "text": "constructor(props) {\n super(props);\n this.state = {\n key: {key:key},\n selected: 'guide', //initial tab selection\n center: {\"lat\": 39.7289820, \"lng\": -104.984931},\n zip: 80264,\n icons: {'wheelchairs':[], \n 'meters':[], \n 'lamps': [], \n 'hydrants': [],\n 'nopark': [],\n 'sidewalks': [],\n 'm_streets':[],\n 'ramps':[],\n 'facilities':[]},\n text: 'Charting Accessibility Obstacles and Accessible Parking Opportunities with Computer Vision, Google Street View and Denver OpenData.',\n secondary: \"Search anywhere in the Denver area to populate that section of the map, or pan and click to re-center!\",\n third: \"(Non-locals - try searching 'River North Brewery - Blake Street Taproom' or 'Goed Zuur'.)\"\n };\n //this.get_lookup();\n this.get_icons();\n }", "title": "" }, { "docid": "8e7e796fc24b9bbfc5cc9b1538e52563", "score": "0.5782573", "text": "constructor(props) {\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "8e7e796fc24b9bbfc5cc9b1538e52563", "score": "0.5782573", "text": "constructor(props) {\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "e8c3250c9f486ea6747b8453ca4f92c2", "score": "0.5781846", "text": "componentDidMount(){\n\t\tBooksAPI.getAll().then((books) => {\n\t\t\tthis.setState(() => ({ books }));\n\t\t});\n\t}", "title": "" }, { "docid": "65a93e23dc2cb372895d682740ce35c6", "score": "0.5781235", "text": "componentDidMount() {\r\n const newState = {}\r\n APIManager.getAllEntries(\"hikes\", `/?completed=false&userId=${this.state.currentUserId}`)\r\n .then(hikes => newState.hikes = hikes)\r\n .then(() => this.setState(newState))\r\n }", "title": "" }, { "docid": "b4d890f2b39c7f3859d97affa9a1920a", "score": "0.577716", "text": "constructor(props){\n super(props);\n let bucket_id = this.props.match.params.bucket_id;\n this.state = {bucket_name: '', description: '', category: '', bucket_id:bucket_id, isAuthorized:false};\n this.handleUpdateName = this.handleUpdateName.bind(this);\n this.handleUpdateDescription = this.handleUpdateDescription.bind(this);\n this.handleUpdateCategory = this.handleUpdateCategory.bind(this);\n this.handleUpdate = this.handleUpdate.bind(this);\n }", "title": "" }, { "docid": "9e123eb412a27f812a3a2fda26e224cb", "score": "0.5774044", "text": "constructor() {\n // super calls the constructor method on the component class\n super();\n this.state = {\n monsters: []\n \n }\n}", "title": "" }, { "docid": "e575aed70d53f477c0c6e0c67266e209", "score": "0.5769025", "text": "created() {\n // Listen for changes in the store and save them in local storage\n this.store.subscribe(() => {\n // Save the list of snacks as a JSON String in localstorage\n const snacks = this.store.getState().snacks;\n window.localStorage.snacks = JSON.stringify(snacks);\n });\n\n // \"mount\" (Start up) views\n this.snackForm.mounted();\n this.snackList.mounted();\n\n // Get the stringified list of snacks or a default of an empty array\n const dataString = window.localStorage.snacks || '[]';\n // Dispatch FIND_ALL to the store with the data loaded from localstorage\n this.store.dispatch({ type: 'SNACK@FIND_ALL', data: JSON.parse(dataString) });\n }", "title": "" }, { "docid": "61bdc413c1cf136d3524c84282699cf1", "score": "0.5763716", "text": "componentDidMount(){\n axios.get('http://localhost:5000/startup/')\n .then(response =>{\n this.setState({startups: response.data})\n })\n .catch((error) =>{\n console.log(error);\n })\n }", "title": "" } ]
316b57e38ded715f81d16891762fcc46
escapest html special characters to html.
[ { "docid": "55b66ae1f1805937028a1438756504bb", "score": "0.0", "text": "function textToHtml(str) {\n return str.replace(pr_amp, '&amp;')\n .replace(pr_lt, '&lt;')\n .replace(pr_gt, '&gt;');\n }", "title": "" } ]
[ { "docid": "6b17d93db213718ff67e3173585ab1d0", "score": "0.78479433", "text": "function initEscHtml() {\r\n var escd = {\"<\":\"&lt;\",\">\":\"&gt;\",\"&\":\"&amp;\",\"'\":\"&#039;\",'\"':\"&quot;\"};\r\n\r\n escHtml = function (s) {\r\n s = s.split(\"\");\r\n var r = \"\";\r\n\r\n for (var i = 0; i < s.length; i++) {\r\n r += escd[s[i]] != null ? escd[s[i]] : s[i];\r\n }\r\n\r\n return r;\r\n };\r\n}", "title": "" }, { "docid": "b7fa74a0f19d11dbba1dc82f1b7a2562", "score": "0.7830362", "text": "static escape(html, encode) {\r\n return html\r\n .replace( // replace ...\r\n !encode // not encode? (default behavior) ...\r\n ? /&(?!#?\\w+;)/g // '&' that is not part of an escape sequence\r\n : /&/g, // raw '&' (if 'encode' is true)\r\n '&amp;') // -> &amp;\r\n .replace(/</g, '&lt;') // replace < -> &lt;\r\n .replace(/>/g, '&gt;') // replace > -> &gt;\r\n .replace(/\"/g, '&quot;') // replace \" -> &quot;\r\n .replace(/'/g, '&#39;') // replace ' -> &#39;\r\n }", "title": "" }, { "docid": "5674f42a22ca77d9c5dc9ee84bc823fa", "score": "0.77558357", "text": "function escapeHtml(text) {\n\t\tvar map = {\n\t\t\t'&': '&amp;',\n\t\t\t'<': '&lt;',\n\t\t\t'>': '&gt;',\n\t\t\t'\"': '&quot;',\n\t\t\t\"'\": '&#039;'\n\t\t};\n\n\t\treturn text.replace(/[&<>\"']/g, function(m) {\n\t\t\treturn map[m];\n\t\t});\n\t}", "title": "" }, { "docid": "12a59bff2293d6e70a0d284bfc515c44", "score": "0.77435255", "text": "function escape(_html) {\n\t var html = '' + _html;\n\t var regexResult = /[\"&<>]/.exec(html);\n\t if (!regexResult) return _html;\n\n\t var result = '';\n\t var i, lastIndex, escape;\n\t for (i = regexResult.index, lastIndex = 0; i < html.length; i++) {\n\t switch (html.charCodeAt(i)) {\n\t case 34:\n\t escape = '&quot;';break;\n\t case 38:\n\t escape = '&amp;';break;\n\t case 60:\n\t escape = '&lt;';break;\n\t case 62:\n\t escape = '&gt;';break;\n\t default:\n\t continue;\n\t }\n\t if (lastIndex !== i) result += html.substring(lastIndex, i);\n\t lastIndex = i + 1;\n\t result += escape;\n\t }\n\t if (lastIndex !== i) return result + html.substring(lastIndex, i);else return result;\n\t}", "title": "" }, { "docid": "cc500818577895a886786300b19ef858", "score": "0.77275133", "text": "function htmlSpecialChars(str, quote_style)\r\n{\r\n\tstr = str.replace(/&/ig,\"&amp;\");\r\n\tif(!quote_style || quote_style==1)\r\n\t{\r\n\t\tstr = str.replace(/\\\"/ig,\"&quot;\")\r\n\t\tif(quote_style==1)\r\n\t\t\tstr = str.replace(/\\'/ig,\"&#039;\")\r\n\t}\r\n\tstr = str.replace(/\\>/ig,\"&gt;\");\r\n\tstr = str.replace(/\\</ig,\"&lt;\");\r\n\treturn str;\r\n}", "title": "" }, { "docid": "e25159d726ca4873381e14ab0bf3c815", "score": "0.772137", "text": "function escapeHTML(txt)\n{\n return txt.replace(/&/g, '&#0038;')\n .replace(/\"/g, '&#0034;')\n .replace(/'/g, '&#0039;')\n .replace(/</g, '&#0060;')\n .replace(/>/g, '&#0062;');\n}", "title": "" }, { "docid": "e41bc8aa6747370d47175a1c2d8bacfc", "score": "0.77158195", "text": "function escapeHTML(text) {\n return text.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;');\n }", "title": "" }, { "docid": "619b4522aa88734747b39f71e41385fc", "score": "0.7704103", "text": "function escapeHtml(str){\n\t str = toString(str)\n\t .replace(/&/g, '&amp;')\n\t .replace(/</g, '&lt;')\n\t .replace(/>/g, '&gt;')\n\t .replace(/'/g, '&#39;')\n\t .replace(/\"/g, '&quot;');\n\t return str;\n\t }", "title": "" }, { "docid": "b3d3be7b97777dbb1a526d90e265b9bc", "score": "0.76998156", "text": "function escapeHTML(text) {\n\t\t\treturn text.replace(/\\&/g,'&amp;').replace(/\\</g,'&lt;').replace(/\\>/g,'&gt;');\n\t\t}", "title": "" }, { "docid": "39bc33288d6c50ef9381cc98a3a1ef11", "score": "0.76792514", "text": "function dm3_escape_html(str) {\n return str\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n }", "title": "" }, { "docid": "279301a7affbd2ec9dc42a9c428d02bb", "score": "0.76771843", "text": "function escapeHtml(text) \n{\n return text\n\t .replace(/&/g, \"&amp;\")\n\t .replace(/</g, \"&lt;\")\n\t .replace(/>/g, \"&gt;\")\n\t .replace(/\"/g, \"&quot;\")\n\t .replace(/'/g, \"&#039;\");\n}", "title": "" }, { "docid": "3854653647fe8780cbd6690e4b445612", "score": "0.7670205", "text": "function escapeHtml(str){\n str = str.replace(/&/g, '&amp;');\n str = str.replace(/>/g, '&gt;');\n str = str.replace(/</g, '&lt;');\n str = str.replace(/\"/g, '&quot;');\n str = str.replace(/'/g, '&#x27;');\n str = str.replace(/`/g, '&#x60;');\n return str;\n}", "title": "" }, { "docid": "f8425c6fabfc7287f302cd9b9490ef1a", "score": "0.7660597", "text": "function escapeHtml(text) {\n var map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n\n return text.replace(/[&<>\"']/g, function (m) {\n return map[m];\n });\n }", "title": "" }, { "docid": "95f16dcb57e8c36bf0c0a13270943525", "score": "0.7655966", "text": "function escapeHTML(txt) {\n \"use strict\";\n return txt.replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "31df829bafa7e05ae789bea68bc921c4", "score": "0.76527405", "text": "function escapeHtml(html){\n return String(html)\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "caac8baa6e2ee9d0d822d484b93aae34", "score": "0.7624736", "text": "function escapeHtml(text) {\r\n var map = {\r\n '&': '&amp;',\r\n '<': '&lt;',\r\n '>': '&gt;',\r\n '\"': '&quot;',\r\n \"'\": '&#039;'\r\n };\r\n return text.replace(/[&<>\"']/g, function(m) { return map[m]; });\r\n}", "title": "" }, { "docid": "5c3c6ccbbbda32fa2248e15cb114d780", "score": "0.7619663", "text": "function dm3_escape_html(str) {\r\n return str\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n}", "title": "" }, { "docid": "877e258acd206e1ad0774a84337e267b", "score": "0.7615698", "text": "function escapeHtml(text) {\n var map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n return text.replace(/[&<>\"']/g, function(m) { return map[m]; });\n}", "title": "" }, { "docid": "4f5437833fd841ec6d8cc07b0929abde", "score": "0.76098835", "text": "function escapeHtml(text) {\n var dict = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n\n return text.replace(/[&<>\"']/g,\n function(m) {\n return dict[m];\n });\n}", "title": "" }, { "docid": "1f196faa44696813f94a374e3c314e17", "score": "0.76044416", "text": "function escapeHTML(text) {\n return text.replace(/\\&/g,'&amp;').replace(/\\</g,'&lt;').replace(/\\>/g,'&gt;');\n }", "title": "" }, { "docid": "ddbbeb4068be579df0f5e74314dbd619", "score": "0.76022696", "text": "function encodeHTML(text) {\n\t return String(text).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;');\n\t }", "title": "" }, { "docid": "13a7af5f2fea03539a70881b4f2c2ae6", "score": "0.7599693", "text": "function escapehtml(str) {\n\treturn (''+str).replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;').replace(/ /g,'&nbsp;&nbsp;');\n}", "title": "" }, { "docid": "047b359ad318bcf4efdd87b719d06fdc", "score": "0.75908107", "text": "function escapeHtml(str) {\n return String(str).replace(/[&<>\\/]/g, function (s) {\n return escape_entity_map[s];\n });\n }", "title": "" }, { "docid": "b8a5024343fd02ce7d74f57858df7841", "score": "0.7581195", "text": "function escapeHtml(string)\n{\n return String(string).replace(/[&<>\"'\\/]/g, function (aChar)\n {\n return entityMap[aChar];\n });\n}", "title": "" }, { "docid": "4c74d2ba977b3344eb0cd2286a3013f5", "score": "0.75810236", "text": "function escapeHTML(text) {\n return text.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;');\n }", "title": "" }, { "docid": "4c74d2ba977b3344eb0cd2286a3013f5", "score": "0.75810236", "text": "function escapeHTML(text) {\n return text.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;');\n }", "title": "" }, { "docid": "362e08477c0cab41473199d40b3b9e7c", "score": "0.7571527", "text": "function escapeHtml(text) {\n var map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n\n return text.replace(/[&<>\"']/g, function(m) { return map[m]; });\n}", "title": "" }, { "docid": "700c653f8ea0a956c9281d80f812c297", "score": "0.7557568", "text": "function escapeHtml(string){\n\tvar entityMap = {\n\t\t \"&\": \"&amp;\",\n\t\t \"<\": \"&lt;\",\n\t\t \">\": \"&gt;\",\n\t\t '\"': '&quot;',\n\t\t \"'\": '&apos;',\n\t\t \"/\": '&#x2F;'\n\t\t };\n\t\n\treturn String(string).replace(/[&<>\"'\\/]/g, function (s){\n\t return entityMap[s];\n\t});\n}", "title": "" }, { "docid": "f70eee8684f69f24b076ac0c2beda4af", "score": "0.75433964", "text": "escapeHTML(text) {\n const replacers = {'<': '&lt;', '>': '&gt;', '&': '&amp;', '\"': '&quot;'};\n return String(text || '').replace(/[<>&\"]/g, (x) => { return replacers[x]; });\n }", "title": "" }, { "docid": "4ac44af44c438ab2743ea4f4a8243354", "score": "0.7520271", "text": "function escapeHTML(s) {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "373fe6546626d10fd346cee006d1080a", "score": "0.75106406", "text": "function htmlEscape(text) {\n return text.replace(/[<>&\"]/g, function(match, pos, originalText) {\n switch(match) {\n case \"<\":\n return \"&lt;\";\n case \">\":\n return \"&gt;\";\n case \"&\":\n return \"&amp;\";\n case \"\\\"\":\n return \"&quot;\";\n }\n })\n}", "title": "" }, { "docid": "8130cae2ce7d02450353c91eba4d474c", "score": "0.7483013", "text": "function replaceHtmlSpecialChar(m) {\n var oEscape = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n \"'\": '&#39;',\n '\"': '&quot;'\n };\n return oEscape[m];\n }", "title": "" }, { "docid": "e0df1fc76c7498bb171e7964367d3f73", "score": "0.74547684", "text": "function escapeHtml(unsafe) {\n return unsafe.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&#039;\");\n}", "title": "" }, { "docid": "f457ea62a01480cbaff6948943a4dcb9", "score": "0.7442588", "text": "function escapeHtml(content)\n{\n return content\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "93222798dc7116290a235c9924fc8176", "score": "0.74403715", "text": "function escapeHTML(text) {\n\tvar replacements = {\n\t\t\"<\": \"&lt;\",\n\t\t\">\": \"&gt;\",\n\t\t\"&\": \"&amp;\",\n\t\t\"\\\"\": \"&quot;\"\n\t};\n\treturn text.replace(/[<>&\"]/g, function (character) {\n\t\treturn replacements[character];\n\t});\n}", "title": "" }, { "docid": "8ad887308cd2c1c809b0776c7f074c72", "score": "0.7429337", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "46cd861170b39dc5ae020b1950620227", "score": "0.7405679", "text": "function htmlSpecialChars(str){\n\t'use strict';\n\tvar map = {\n\t\t'&': '&amp;',\n\t\t'<': '&lt;',\n\t\t'>': '&gt;',\n\t\t'\"': '&quot;',\n\t\t\"'\": '&#039;'\n\t};\n\treturn str.replace(/[&<>\"']/g, function(m) { return map[m]; });\n}", "title": "" }, { "docid": "278a2a06c0c9fb31303846d7561f98ad", "score": "0.74052763", "text": "function escape_html(m)\n{\n if (!m)\n return m;\n\n var n = \"\";\n for (var i = 0; i < m.length; i++) {\n var c = m[i];\n if (c === \"&\") { n += \"&amp;\"; continue; }\n if (c === \"<\") { n += \"&lt;\"; continue; }\n if (c === \">\") { n += \"&gt;\"; continue; }\n if (c === \"\\\"\") { n += \"&quot;\"; continue; }\n if (c === \"'\") { n += \"&#039;\"; continue; }\n n += c;\n }\n \n return n;\n}", "title": "" }, { "docid": "d8deb06a61f65423062ec54d273975c0", "score": "0.7400355", "text": "function escapeHtml (string) {\n\t\n entityMap = {\n \t\t '&': '&amp;',\n \t\t '<': '&lt;',\n \t\t '>': '&gt;',\n \t\t '\"': '&quot;',\n \t\t \"'\": '&#39;',\n \t\t '/': '&#x2F;',\n \t\t '`': '&#x60;',\n \t\t '=': '&#x3D;'\n \t\t};\n\n return String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n return entityMap[s];\n });\n}", "title": "" }, { "docid": "3432954414cd82cfb30046ef64bdf9ec", "score": "0.73867136", "text": "function escapeHtml(str) {\n return str.replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}", "title": "" }, { "docid": "83d7d8ef4ed75186dae02a8f7aea7bfb", "score": "0.73613334", "text": "function encodeHTML(s) {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;');\n}", "title": "" }, { "docid": "978146bfd9187e25ea886e11945a6135", "score": "0.73557717", "text": "function escapeHtml(str) {\n\t\treturn String(str)\n\t\t\t.replace(/&/g, \"&amp;\")\n\t\t\t.replace(/</g, \"&lt;\")\n\t\t\t.replace(/>/g, \"&gt;\")\n\t\t\t.replace(/\"/g, \"&quot;\")\n\t\t\t.replace(/'/g, \"&#039;\")\n\t\t\t.replace(/\\//g, \"&#x2F;\") \n\t}", "title": "" }, { "docid": "179dc8b33e02977d1d14392b20f829a0", "score": "0.7348625", "text": "function _escapeHtml(html) {\n return $('<div />').text(html).html();\n}", "title": "" }, { "docid": "2e1dc307a1bced64f96387e8a8b38892", "score": "0.7347312", "text": "function escapeHtml(unsafe) {\n return unsafe\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n}", "title": "" }, { "docid": "3c12226fd13af930c699bed30d777fad", "score": "0.7345009", "text": "function escape(html, encode) {\n\tif (encode) {\n\t\tif (escape.escapeTest.test(html)) {\n\t\t\treturn html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; });\n\t\t}\n\t} else {\n\t\tif (escape.escapeTestNoEncode.test(html)) {\n\t\t\treturn html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; });\n\t\t}\n\t}\n\n\treturn html;\n}", "title": "" }, { "docid": "cff4267c08cc88a517aaa01a361af6a3", "score": "0.73444504", "text": "function HtmlEscape(str) {\n if (!str) return \"\";\n return str.replace(amp_re_, \"&amp;\").replace(lt_re_, \"&lt;\").\n replace(gt_re_, \"&gt;\").replace(quote_re_, \"&quot;\");\n}", "title": "" }, { "docid": "46133d2f1285077b31fb8ff5fd158b6f", "score": "0.73296744", "text": "function encodeHtml(str) {\n str = str.replace(/&/g, '&amp;');\n str = str.replace(/</g, '&lt;');\n str = str.replace(/>/g, '&gt;');\n str = str.replace(/ /g, '&nbsp;');\n return str;\n}", "title": "" }, { "docid": "855c0d8f2be3fd314dc42ebe5d49a5b7", "score": "0.7321103", "text": "function EscapeHTML(str)\n{\n var entityMap = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\"\n };\n return str.replace(/[&<>]/g, function(s) { return entityMap[s]; });\n}", "title": "" }, { "docid": "dca3dd91dbac5654926539856472e8b4", "score": "0.729314", "text": "function quoteHTML(s) {\r\n\ts = s.replace(/&/g, \"&amp;\");\r\n\ts = s.replace(/</g, \"&lt;\");\r\n\ts = s.replace(/>/g, \"&gt;\");\r\n\treturn s;\r\n }", "title": "" }, { "docid": "d412f8892503660fc36aae4f2e06f11c", "score": "0.7286053", "text": "function htmlEscape(str) {\r\n return String(str)\r\n .replace(/&/g, '&amp;')\r\n .replace(/\"/g, '&quot;')\r\n .replace(/'/g, '&#39;')\r\n .replace(/</g, '&lt;')\r\n .replace(/>/g, '&gt;')\r\n }", "title": "" }, { "docid": "40e977f4b1a501b2434496a51c497926", "score": "0.72764724", "text": "function htmlEncode(html) {\r\n if (html.length == 0) return \"\";\r\n html = html.replace(/&/g, \"&amp;\");\r\n html = html.replace(/</g, \"&lt;\");\r\n html = html.replace(/>/g, \"&gt;\");\r\n html = html.replace(/ /g, \"&nbsp;\");\r\n html = html.replace(/\\'/g, \"'\");\r\n html = html.replace(/\\\"/g, \"&quot;\");\r\n html = html.replace(/\\n/g, \"<br/>\");\r\n return html;\r\n}", "title": "" }, { "docid": "1fb182c5a6fd9ea187bbd8628f8464ee", "score": "0.7263205", "text": "function htmlEncode(text){\n return (\n text.replace(/&/g,'&amp;')\n .replace(/</g,'&lt;')\n .replace(/</g,'&lt;')\n .replace(/ /g,'&nbsp;')\n .replace(/([^<>&]{10})/g,'$1<wbr>&shy;' + wbr)\n );\n }", "title": "" }, { "docid": "9b4d2ca05cc6c9502a6df883aa75a6a1", "score": "0.7260563", "text": "function escapeHtml(str) {\n return str\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\")\n .replace(/\\n/g, '<br>');\n }", "title": "" }, { "docid": "915710b8f52a93fba41e6a02c6e9809f", "score": "0.7257488", "text": "function escapeHtml(rawText) {\n return rawText\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;')\n}", "title": "" }, { "docid": "915710b8f52a93fba41e6a02c6e9809f", "score": "0.7257488", "text": "function escapeHtml(rawText) {\n return rawText\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;')\n}", "title": "" }, { "docid": "915710b8f52a93fba41e6a02c6e9809f", "score": "0.7257488", "text": "function escapeHtml(rawText) {\n return rawText\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;')\n}", "title": "" }, { "docid": "915710b8f52a93fba41e6a02c6e9809f", "score": "0.7257488", "text": "function escapeHtml(rawText) {\n return rawText\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;')\n}", "title": "" }, { "docid": "13cee18358c58a6aca913eb2b2d059b4", "score": "0.72559834", "text": "function escapeHtml(unsafe) {\n return (String(unsafe)).replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\").replace(/'/g, \"&#039;\");\n}", "title": "" }, { "docid": "b6a4047227c03be6c0b4c56d3992764e", "score": "0.7253359", "text": "function escapeHtml(unsafe) {\n if (unsafe == null) {\n return \"\";\n }\n return unsafe\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n}", "title": "" }, { "docid": "966eb9c8842bd23e2a80ddb70810c08f", "score": "0.7249945", "text": "escapeHTML(str) {\n\t\tif (!str) return '';\n\t\treturn ('' + str)\n\t\t\t.replace(/&/g, '&amp;')\n\t\t\t.replace(/</g, '&lt;')\n\t\t\t.replace(/>/g, '&gt;')\n\t\t\t.replace(/\"/g, '&quot;')\n\t\t\t.replace(/'/g, '&apos;')\n\t\t\t.replace(/\\//g, '&#x2f;');\n\t}", "title": "" }, { "docid": "150b6b6ed72554e95c22c951c445451f", "score": "0.7234721", "text": "function escapeSpecialChar(str){\n var tmp = str.replace(/&/g, \"&amp;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&apos;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/{/g, \"&#123;\").replace(/}/g, \"&#125;\");\n return tmp;\n}", "title": "" }, { "docid": "db52962f20e05cbf2246fc1a8aaefece", "score": "0.72333485", "text": "function escapeSpecialCharacters(str) {\n // Replace \" with two ' b/c \" cannot be escaped properly in output onto DOM\n // Search for special characters \\, ', (, ) globally in string\n // and insert a forward slash \\ to escape those characters\n str = str.replace(/\\\"/gi,'\\'\\'').replace(/[\\\\\\'()]/gi, '\\\\$&');\n return str;\n}", "title": "" }, { "docid": "3562c56213032d8752aca39e4b623f90", "score": "0.72321725", "text": "function escaparHtml(str) {\n var t = {\n '&': 'amp',\n '<': 'lt',\n '>': 'gt',\n '\"': 'quot',\n '\\'': '#39'\n };\n return str.replace(/[&<>\"']/g, function(x) {\n return '&' + t[x] + ';';\n });\n }", "title": "" }, { "docid": "bcef82f38376aed7ae6a21dc5697d991", "score": "0.7226465", "text": "function escapeHTML(value) {\n return String(value)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;');\n }", "title": "" }, { "docid": "5844c1a43e0dd434103cfdb1bf436c37", "score": "0.7218317", "text": "function replaceSpecialCharactersHTML(str) {\r\n\tif (str != \"undefined\" && str != \"\" && str != null) {\r\n\t\tstr = str.replace(/\\'/gi, \"&lsquo;\");\r\n\t\tstr = str.replace(/\\xE9/gi, \"&eacute;\");\r\n\t\tstr = str.replace(/\\`/gi, \"&lsquo;\");\r\n str = str.replace(/\\\"/gi, \"\\\\\\\"\");\r\n\t}\r\n\treturn str;\r\n}", "title": "" }, { "docid": "7beccb7a0a790493770b301a68b7ccea", "score": "0.71833336", "text": "function htmlEncode(text)\n{\n return text.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}", "title": "" }, { "docid": "bd5191a37c81e6c749e5eaf5e50ffc2f", "score": "0.7165707", "text": "function escapeHtml(rawText) {\n return rawText.\n replace(/</g, '&lt;').\n replace(/>/g, '&gt;').\n replace(/\"/g, '&quot;').\n replace(/'/g, '&apos;');\n}", "title": "" }, { "docid": "bd5191a37c81e6c749e5eaf5e50ffc2f", "score": "0.7165707", "text": "function escapeHtml(rawText) {\n return rawText.\n replace(/</g, '&lt;').\n replace(/>/g, '&gt;').\n replace(/\"/g, '&quot;').\n replace(/'/g, '&apos;');\n}", "title": "" }, { "docid": "eb8328fe75524dacbba87d15116319c7", "score": "0.7162706", "text": "function escapeHTML(value) {\n return String(value)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;');\n}", "title": "" }, { "docid": "0c4f067bd615c25d74d169081a76078c", "score": "0.7156285", "text": "function escapeHTML(s) {\n return ensureString(s).replace(/[<>&\"']/g, c => HTML_ESCAPES[c]);\n}", "title": "" }, { "docid": "09f8f92b4a6031265a5ec0172ab085ea", "score": "0.7150957", "text": "function EscapeHtml (string) {\n // http://stackoverflow.com/a/12034334/881731\n return String(string).replace(/[&<>\"'`=\\/]/g, function(s) {\n return ENTITY_MAP[s];\n });\n }", "title": "" }, { "docid": "08486d9d5e9cb9f08d06aff15f56f148", "score": "0.71322215", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "08486d9d5e9cb9f08d06aff15f56f148", "score": "0.71322215", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "8008af208c392824e6b17ef3be0067fd", "score": "0.7122599", "text": "function escapeHtml(unsafe_string) {\n return unsafe_string\n .replace(/&/g, \"&amp;\")\n .replace(/>/g, \"&gt;\")\n .replace(/</g, \"&lt;\")\n .replace(/'/g, \"&#39;\")\n .replace(/\"/g, \"&#34;\");\n}", "title": "" }, { "docid": "0f1f73ee17cc40ae0f0ea6539342beea", "score": "0.7115515", "text": "function escapeHTML(text) {\n var replacements = [[\"&\", \"&amp;\"], [\"\\\"\", \"&quot;\"],\n [\"<\", \"&lt;\"], [\">\", \"&gt;\"]];\n\n forEach(replacements, function(replace) {\n text = text.replace(replace[0], replace[1]);\n });\n return text;\n}", "title": "" }, { "docid": "2156c41d79e91f5a0a2ea51d5a2b6fc2", "score": "0.7103838", "text": "function htmlEscape(string) {\n var htmlEscapes = {'<': '&lt;','>': '&gt;','\"': '&quot;',\"'\": '&#x27;','/': '&#x2F;'};\n var htmlEscaper = /[<>\"'\\/]/g;\n return ('' + string).replace(htmlEscaper, function(match) {\n return htmlEscapes[match];\n });\n}", "title": "" }, { "docid": "e9aadfd17788b10e78e571e8c04ad321", "score": "0.7100727", "text": "function escapeHtml (string) {\n return String(string).replace(entityPattern, function (s) {\n return entityMap[s];\n });\n }", "title": "" }, { "docid": "ae6d50ee4067f911d399299282c20544", "score": "0.7097586", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "ae6d50ee4067f911d399299282c20544", "score": "0.7097586", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "242d65874dcfdf75bb015bd4824cb6bc", "score": "0.7079807", "text": "function escapeHTML(s) {\n return s.replace(rescaper, replacer);\n }", "title": "" }, { "docid": "517c597742ac11fa2adbc8c84bfaa8c1", "score": "0.70631844", "text": "function html_encode(string) {\n\treturn string.replace(/&/g, \"&amp;\").replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\").replace(/\"/g, \"&quot;\");\n}", "title": "" }, { "docid": "f2914156f71d4f7613b9bee3ecb2e035", "score": "0.70450467", "text": "function escape(value) {\n return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n return htmlEscapes[character];\n }) : value;\n}", "title": "" }, { "docid": "4c8e42144830b8e54b8b93102ac2018c", "score": "0.70348376", "text": "function htmlEscape(str) {\n return String(str)\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\\//g, '&#47;');\n }", "title": "" }, { "docid": "d3eadfbea14f5707027523a3806c7d2c", "score": "0.7032457", "text": "function escape(s){var n=s;n = n.replace(/&/g,\"&amp;\");n = n.replace(/</g,\"&lt;\");n = n.replace(/>/g,\"&gt;\");n = n.replace(/\"/g,\"&quot;\");return n;}", "title": "" }, { "docid": "91b584b7baa9d18d7d946877ad69e18e", "score": "0.70096725", "text": "function escape_html(text) {\n var esc = document.createElement('div');\n esc.textContent = text;\n return esc.innerHTML;\n}", "title": "" }, { "docid": "4b199fb6c86bb7ce613f999d759be4c2", "score": "0.70051396", "text": "function doescape(original) {\n original = original.replace(/&/g, '&amp;'); // First, of course.\n original = original.replace(/</g, '&lt;');\n original = original.replace(/>/g, '&gt;');\n return original;\n}", "title": "" }, { "docid": "8c47ee3ff6bb5742ee58c5b44a36800e", "score": "0.70026326", "text": "function escapeHTML(text) {\n\treturn text.toString()\n\t\t.split('&').join('&amp;')\n\t\t.split('<').join('&lt;')\n\t\t.split('>').join('&gt;')\n\t\t.split('\"').join('&quot;')\n\t\t.split('\\'').join('&#039;')\n}", "title": "" }, { "docid": "279f99ed6acb5825a405166070b4cb9e", "score": "0.70001364", "text": "function htmlEncode(text) {\n\t// HTML encode: Replace < > & ' and \" by corresponding entities.\n\treturn text != undefined ? rIsHtml.test(text) && (\"\" + text).replace(rHtmlEncode, getCharEntity) || text : \"\";\n}", "title": "" }, { "docid": "25ca2c472bb88fa316de6c980effd0fb", "score": "0.69693625", "text": "function htmlFilter(c) {\n /* Used to escape HTML-sensitive characters in a string */\n switch (c) {\n case \"&\":\n return \"&amp;\";\n case \"<\":\n return \"&lt;\";\n case \">\":\n return \"&gt;\";\n case \"\\\"\":\n return \"&quot;\";\n default:\n return c;\n }\n }", "title": "" }, { "docid": "de383ca28cb2dcdb22a6e13af28489a6", "score": "0.696677", "text": "function escapeHTML(s) {\n return s.split(\"&\").join(\"&amp;\").\n\tsplit(\"<\").join(\"&lt;\").split(\">\").join(\"&gt;\");\n}", "title": "" }, { "docid": "820db5dfa6af8600b6050575f87aa37e", "score": "0.695324", "text": "function htmlEncode(str) {\n\t\treturn String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n\t}", "title": "" }, { "docid": "5eeb4666ec9729313db48646ef6c744f", "score": "0.69520146", "text": "function htmlescape(str) {\n str = str.replace(\"&\",\"&amp;\");\n str = str.replace(\"<\",\"&lt;\");\n str = str.replace(\">\",\"&gt;\");\n return str;\n \n}", "title": "" }, { "docid": "d8b085fb32d96ab3f78a8c5fd01eba2f", "score": "0.69015974", "text": "function _escTag(s){ return s.replace(\"<\",\"&lt;\").replace(\">\",\"&gt;\");}", "title": "" }, { "docid": "d8b085fb32d96ab3f78a8c5fd01eba2f", "score": "0.69015974", "text": "function _escTag(s){ return s.replace(\"<\",\"&lt;\").replace(\">\",\"&gt;\");}", "title": "" }, { "docid": "7239dfad077a7b92aedf86949c31db0b", "score": "0.68970776", "text": "function SafeHtml(){}", "title": "" }, { "docid": "b2f3ed997977ce0ee42150324ea1c582", "score": "0.6895801", "text": "function escapeHtml(string) {\r\n\treturn string ? ('' + string).replace(/</g, '&lt;').replace(/>/g, '&gt;') : string;\r\n}", "title": "" }, { "docid": "068d1b2e9114e936bc4eb9243c9fec62", "score": "0.68752396", "text": "function htmlEncode() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n }, function (up) {\n var d = document.createElement('div');\n d.textContent = up.intext;\n return d.innerHTML;\n });\n }", "title": "" }, { "docid": "ea37a94fc180e8767d2f1120ba19c36d", "score": "0.6850992", "text": "function escapeHTML(s) {\n return s.split('&').join('&amp;').split('<').join('&lt;').split('\"').join('&quot;');\n}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6847474", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6847474", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6847474", "text": "function SafeHtml() {}", "title": "" } ]
26ede63fa000b85675c37fa93d48a140
get user information based on username stored in local storage
[ { "docid": "9b3b24d89725b0f2b89f447791c9f524", "score": "0.0", "text": "getUser() {\n //if I use this.props.user, I have to make the user log back in - can't navigate away and back unless I use localStorage\n axios.get(`${Config.API_URL}/users/${localStorage.getItem('user')}`, {\n headers: { Authorization: `Bearer ${localStorage.getItem('token')}`}\n })\n .then(response => {\n console.log('this is getUser');\n console.log(`username ${this.state.Username}`);\n console.log(response); // should I pull this as one prop, then pull out the pieces when used?\n let data = response.data;\n this.setState({\n FirstName: data.FirstName,\n LastName: data.LastName,\n Email: data.Email,\n DOB: data.Birth,\n Username: data.Username,\n favoriteMovies: data.FavoriteMovies.split(',')\n });\n console.log(this.state.Username);\n })\n .catch(e => {\n console.log(e),\n this.setState({\n message: 'We were unable to load your information.'\n });\n });\n }", "title": "" } ]
[ { "docid": "44bd9c72981d3962eee45b176e0b171a", "score": "0.75229645", "text": "function getUsername() {\n\tvar username = localStorage.getItem('username');\n\treturn username;\n}", "title": "" }, { "docid": "44bd9c72981d3962eee45b176e0b171a", "score": "0.75229645", "text": "function getUsername() {\n\tvar username = localStorage.getItem('username');\n\treturn username;\n}", "title": "" }, { "docid": "2b08db83e95ccda0d9b93a8b10a9253e", "score": "0.7480388", "text": "function getUsername(){\n var username = window.localStorage.getItem(\"username\");\n return username\n}", "title": "" }, { "docid": "6653799864daec9eb4b16daccfe4ccac", "score": "0.7444194", "text": "function getProfileDataFromStorage(username) {\n var allProfilesDataString = localStorage.getItem('allProfiles');\n if (allProfilesDataString) {\n var allProfileData = JSON.parse(allProfilesDataString);\n for (var i = 0; i < allProfileData.length; i++) {\n if (allProfileData[i].username === username) {\n allProfiles = allProfileData;\n myProfile = allProfileData[i];\n return allProfileData[i];\n }\n }\n }\n}", "title": "" }, { "docid": "5ea801f9eae948918ac6d6dc55f2b457", "score": "0.73190135", "text": "function getUserName() {\n var userName = window.localStorage.getItem(\"userName\");\n return userName;\n}", "title": "" }, { "docid": "91aeb0baed9916ea58b7a3cd132867f7", "score": "0.7246616", "text": "function getUserFromLocalStorage() {\n return localStorage.getItem('user')\n ? JSON.parse(localStorage.getItem('user')) // TRUE: Return User\n : { username: null, token: null }; // FALSE: Empty user\n}", "title": "" }, { "docid": "7d05c0f3c4eee44673067eaaf0b9bf2c", "score": "0.72131073", "text": "function Showloggedname() {\n var userLoggedname = JSON.parse(localStorage.getItem('loggedUser'));\n $('#username').html(userLoggedname.fullnameLogged);\n}", "title": "" }, { "docid": "512a88df4ce26a93b90dd29464649393", "score": "0.7155531", "text": "getUserInfoInStorage() {\n this.user = new _model_user_model__WEBPACK_IMPORTED_MODULE_1__[\"User\"](sessionStorage.getItem('username'), '');\n return this.user;\n }", "title": "" }, { "docid": "5731806ee33f70add399ce26a52af7e2", "score": "0.7104244", "text": "function checkCurrentUser(){\n let getUser = localStorage.getItem(\"USER\");\n let getUserObject = JSON.parse(getUser);\n\n if(getUserObject === null){\n console.log(\"Nothing in local storage\");\n }\n else{\n phoneNum = getUserObject['phone'];\n console.log(phoneNum);\n\n // Display the username on the page\n let usernameDisplay = document.getElementById('username');\n usernameDisplay.innerHTML = \"Hello, \" + getUserObject['username'] + \". Select the skill you are interested to watch\";\n }\n}", "title": "" }, { "docid": "e6ca9b72818e9fd4a2713ef0aee1171a", "score": "0.7090506", "text": "function getFromLocalstorage() {\r\n const getList = localStorage.getItem('user');\r\n if (getList) {\r\n list = JSON.parse(getList);\r\n display(list)\r\n }\r\n }", "title": "" }, { "docid": "5054a67743d08eba7df131b5a4a63be2", "score": "0.7028389", "text": "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem(\"user\"));\n }", "title": "" }, { "docid": "99a87cb143dfb62bf2a5409cee905bfe", "score": "0.70022684", "text": "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem('user'))\n }", "title": "" }, { "docid": "99a87cb143dfb62bf2a5409cee905bfe", "score": "0.70022684", "text": "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem('user'))\n }", "title": "" }, { "docid": "f13d85583fd7efa87016f9244f564b7a", "score": "0.6981636", "text": "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem(\"user\"))\n }", "title": "" }, { "docid": "1a8017ed2cc7de1e3485cf8a864ea78c", "score": "0.69681364", "text": "function getUserInfo() {\n chrome.storage.sync.get(['user', 'access_token'], result => {\n if (! result.user) {\n const token = result.access_token;\n var xhr = new XMLHttpRequest();\n var url = \"https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=\" + token;\n xhr.open(\"GET\", url);\n\n xhr.setRequestHeader('Authorization', 'Bearer ' + token);\n xhr.onload = function() {\n if (this.status === 401) {\n wipeData();\n } else {\n userStorage.set(JSON.parse(this.response));\n fillInPopup(JSON.parse(this.response));\n }\n }\n xhr.send();\n } else {\n fillInPopup(result.user);\n }\n });\n }", "title": "" }, { "docid": "0626e827d7458bbd7ea9c2dd50cc458c", "score": "0.69257224", "text": "async function loadUsername() {\n try {\n const { username } = await browser.storage.local.get(\"username\");\n if (username) {\n return username;\n }\n } catch (e) {\n }\n return \"\";\n}", "title": "" }, { "docid": "69c78fae1f78297133d2d1b5643ae5ad", "score": "0.68611157", "text": "getUser() {\n const userStr = sessionStorage.getItem(\"user\");\n if (userStr) return JSON.parse(userStr);\n else return null;\n }", "title": "" }, { "docid": "fbf3890aefc2a74e1422e2ca825ad4c3", "score": "0.68569547", "text": "function getUser(username) {\n var user = null;\n settings.demoUsers.forEach(function (u) {\n if (username === u.username) {\n user = u;\n }\n });\n return user;\n}", "title": "" }, { "docid": "3e5f71ea791ec52709e44c938823abbf", "score": "0.68557155", "text": "static async getUserInfo(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }", "title": "" }, { "docid": "3f384830bebc5fefb8e855e098891a94", "score": "0.6848166", "text": "userData(){\n return JSON.parse(localStorage.getItem('user'));\n }", "title": "" }, { "docid": "1d0ac618462ecea16cd2d25e6e0646da", "score": "0.68387944", "text": "function getUser() {\n return _user || JSON.parse(localStorage.getItem('user'));\n}", "title": "" }, { "docid": "b26fa13c443788062c293fe84e3f56b0", "score": "0.68277454", "text": "function getUserId() {\n return localStorage.getItem(localStorageUserIdName);\n}", "title": "" }, { "docid": "eecea3e519c65d2bf2ff9cbdaa54b871", "score": "0.6815685", "text": "function userName(){\r\n\t\tvar username = localStorage.getItem(\"username\");\r\n\t\tif (username == undefined || username == null){\r\n\t\t\tconsole.log('No username saved.')\r\n\t\t} else {\r\n\t\t\t$('.followeradd').val(username);\r\n\t\t}\t\r\n\t}", "title": "" }, { "docid": "866f4f022dbba00cea4ea470471bf3f3", "score": "0.6784716", "text": "get user ( ) {\n var value = this.$window.localStorage.getItem(this.USER_KEY);\n return value ? JSON.parse( value ) : null;\n }", "title": "" }, { "docid": "4ef6ef1bb9166ef4741117dfb5725669", "score": "0.6782606", "text": "function getUser(username, users){\n if(users.hasOwnProperty(username)){\n return users[username];\n }\n return null;\n}", "title": "" }, { "docid": "53dd8d24260e33e23b5eaa47235036f7", "score": "0.6762139", "text": "async function getuser(_username) {\n //let url: string = \"http://localhost:8100/getUser?\" + \"username=\" + _username;\n let url = \"https://kochem-mit-jochem.herokuapp.com/getUser?\" + \"username=\" + _username;\n let resp = await fetch(url);\n currentuser = await resp.json();\n }", "title": "" }, { "docid": "b2170c035945a680746f7a06cd718cd6", "score": "0.6750865", "text": "function getUsrName() {\n //if (!isUsrTokenValid()) {\n // return \"\";\n //}else\n return localStorage.getItem(\"usrName\");\n}", "title": "" }, { "docid": "8feebff79d2f805c73075e849570c462", "score": "0.6745159", "text": "function fetchUserData(name) {\n let userList\n fetch(\"http://localhost:3000/api/users\")\n .then(resp => resp.json())\n .then(function (json) {\n userList = json\n for (i = 0; i < userList.length; i++) {\n if (userList[i].username === name) {\n renderNamedUserPanel(userList[i])\n }\n }\n //to add: if user doesn't exist, create new user\n createUserPanel.children[0].children[0].value = \"\"\n createUserPanel.style.display = \"none\"\n })\n }", "title": "" }, { "docid": "9862573f00e393acc80f23865aa1fe71", "score": "0.6739929", "text": "function getUser(user) {\n if (user) {\n localStorage.setItem(\"username\",user.username);\n \n window.location.reload();\n return user;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "a64209dcad0370387ffc12fa446f5e7f", "score": "0.67357254", "text": "function name() {\n var name1 = window.localStorage.getItem(\"user1\");\n var name2 = window.localStorage.getItem(\"user2\");\n var name3 = window.localStorage.getItem('user3');\n document.getElementById(\"nameOne\").innerHTML = name1;\n document.getElementById(\"nameTwo\").innerHTML = name2;\n document.getElementById(\"nameThree\").innerHTML = name3;\n document.getElementById(\"nameT1\").innerHTML = name1;\n document.getElementById(\"nameT2\").innerHTML = name2;\n document.getElementById(\"nameT3\").innerHTML = name3;\n }", "title": "" }, { "docid": "6da5929d6b9ef665fde47e25cd60e8c6", "score": "0.67304397", "text": "function loadUserData(username){\n return JSON.parse(fs.readFileSync(`bookings/${username}.json`).toString());\n}", "title": "" }, { "docid": "b412c3904198c48ec7d6ddcf87d077e4", "score": "0.6723929", "text": "getUser() {\n const data = localStorage.getItem('simpleAdminApp');\n if (!data) return null;\n const user = JSON.parse(data);\n if (user) return user.user;\n return null;\n }", "title": "" }, { "docid": "0e8790ed463bd55ecbe567bf8c2d76a9", "score": "0.67033654", "text": "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "title": "" }, { "docid": "0e8790ed463bd55ecbe567bf8c2d76a9", "score": "0.67033654", "text": "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "title": "" }, { "docid": "73268c258364ba827273fdcaf87992f3", "score": "0.66991705", "text": "function getUser(){\n user = {\n email: localStorage.getItem('email'),\n token: localStorage.getItem('token')\n }\n }", "title": "" }, { "docid": "ffdb1dfa61b60afec6c1ce13ed4e7751", "score": "0.6688828", "text": "function checkUserLoggedIn() {\n const name = localStorage.getItem('name');\n const surname = localStorage.getItem('surname');\n return {\n name,\n surname\n }\n}", "title": "" }, { "docid": "51453ac85a6168561ac1ac5b64fa96c4", "score": "0.6679667", "text": "function getUserInfo(user) {\n getData('data/' + user._id + '.json').then(getUser.success, getUser.error); \n}", "title": "" }, { "docid": "23ef1cb87e248e9aceb51c0f7590e1d9", "score": "0.6666873", "text": "getUserFromUsername(username) {\n return this.db.query(\"SELECT * FROM user WHERE login LIKE ?\", [username]);\n }", "title": "" }, { "docid": "ca004adaef3e3a533b446f8f196aface", "score": "0.6664878", "text": "function getLocalUserName(){\n\tif(checkLogedIn()){\n\t\treturn localStorage.getItem(\"login\");\n\t}\n}", "title": "" }, { "docid": "5789f0336a1f58a50b4fa35059c8fce8", "score": "0.66639507", "text": "function loadCurrentUser() {\n return Cookies.get('username') || ''; // username의 value cookie read\n}", "title": "" }, { "docid": "4479d9c3f04b0f7fa96cd1b1477c83a6", "score": "0.66586566", "text": "function findCurrentUser(username) {\n fetch(`${baseUrl}/users/${username}`)\n .then(response => response.json())\n .then( user => {\n changeUser(user)\n history.push(`/users/${user.id}/trips`)\n })\n }", "title": "" }, { "docid": "507d5de2f8dbb04de0ef34c506e20f97", "score": "0.6635536", "text": "async fetchMe() {\n return (await super.request(\"get\", `profile/${localStorage.getItem(\"username\")}`)).data;\n }", "title": "" }, { "docid": "a1149f6c770ee7ae0b5b4ada7daffbdd", "score": "0.663505", "text": "async getLoggedInUser() {\n return fetch(process.env.REACT_APP_API_PATH+\"/users/\" + sessionStorage.getItem(\"user\"), {\n method: \"get\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n })\n .then(res => res.json())\n .then(result => result.username)\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "bd24372166da47e268f5be16bed7e082", "score": "0.6630966", "text": "getUserByUsername(username) {\n let sql = \"SELECT * FROM user WHERE username=?;\";\n return this.get(sql, [username]);\n }", "title": "" }, { "docid": "9b8b1d5f57073b4b39e0f0f25eb85b3e", "score": "0.6626411", "text": "function getUserInfo(){\n uid = document.querySelector(\".UserInfo-avatar\");\n uid = uid != undefined ? uid.firstElementChild.getAttribute(\"uid\"):\"未知\";\n if(localStorage.getItem(uid+\"🌴🔮🌴\")!=null){\n uname = localStorage.getItem(uid+\"🌴🔮🌴\");\n }else{\n var ajax = new XMLHttpRequest();\n ajax.timeout = 2000;\n ajax.responseType =\"document\";\n ajax.open('get', 'https://www.douyu.com/member/cp',true);\n ajax.send();\n ajax.onreadystatechange = function() {\n if (ajax.readyState == 4 && ajax.status == 200) {\n var htmlDoc = ajax.responseXML;\n uname = htmlDoc.querySelector(\".uname_con\").innerText.trim()\n localStorage.setItem(uid+\"🌴🔮🌴\", uname);\n }\n }\n }\n }", "title": "" }, { "docid": "a4255b8cc0311bc2fc94ae01d136d4ea", "score": "0.66183436", "text": "function loadData() {\n var account = localStorage.getItem('_account');\n if (!account) return false;\n localStorage.removeItem('_account');\n //decodes a string data encoded using base-64\n account = atob(account);\n //parses to Object the JSON string\n account = JSON.parse(account);\n //do what you need with the Object\n return account.User;\n // return true;\n}", "title": "" }, { "docid": "69b62be74219c539e9d071c98294993a", "score": "0.66088355", "text": "getCurrentUser() {\n return JSON.parse(localStorage.getItem(\"user\"));\n }", "title": "" }, { "docid": "1c7ad5f7c364d2ec52a12d41aeeefa66", "score": "0.66087687", "text": "function getUserName() {\n $.get(\"/api/user_data\").then(data => {\n $(\".member-name\").text(data.name);\n $(\".member-id\").text(`Your ID is ${data.id}`);\n $(\".member-id\").attr(\"value\", data.id);\n renderAllBookmark(data.id);\n });\n }", "title": "" }, { "docid": "f519d3f5229e363638cdb758353c1938", "score": "0.6600898", "text": "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "title": "" }, { "docid": "f519d3f5229e363638cdb758353c1938", "score": "0.6600898", "text": "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "title": "" }, { "docid": "4fc0949dfa74140be3bd802e1740e773", "score": "0.6597293", "text": "function loadCurrentUser() {\r\n let currentUserAsString = localStorage.getItem(\"currentUser\");\r\n\r\n if (currentUserAsString) {\r\n currentUser = JSON.parse(currentUserAsString);\r\n }\r\n}", "title": "" }, { "docid": "2b1a6a24a6c834904922d2b92d4575ce", "score": "0.6587681", "text": "function userID(){\n\n\t\tlet nombre = document.getElementById(\"nombre-id\").value;\n\n\t\tlocalStorage.setItem(\"Nombre\", nombre);\n\n\t\tvar namae = localStorage.getItem(\"Nombre\");\n\n\t\tconsole.log(namae);\n\n\t}", "title": "" }, { "docid": "dda5c2b02306f9e2dd9c980f370c3149", "score": "0.6573178", "text": "function userName() {\n let user = prompt(\"Please enter your name\");\n if (user != null) {\n const localData = getLocalData();\n localData['user'] = user;\n parseData(localData);\n lastUpdate();\n }\n}", "title": "" }, { "docid": "ca1ebb9800e540016f61f6ab34def819", "score": "0.6568204", "text": "function profile_name(){\n\tvar result = document.getElementById(\"welcome\");\n\tvar user_mail = sessionStorage.getItem('user_mail');\n\tvar user_details = localStorage.getItem(user_mail);\n\tvar user_data = JSON.parse(user_details);\n\tvar fullname = user_data.name;\n\tresult.innerHTML = atob(fullname);\n}", "title": "" }, { "docid": "c8b70f17e9f9d29cc3cffae6a0cb03c1", "score": "0.65600365", "text": "function getUser() {\n const user = storage.get(USER_INFO_KEY);\n const token = cookie.get(USER_TOKEN_KEY);\n if (!token || !user || user.isGuestUser) return guest;\n return user;\n}", "title": "" }, { "docid": "2bba446d6af9f4a561a68057a3df3ce0", "score": "0.65599495", "text": "async _fetchUserInfo() {\n try {\n const userInfo = await AsyncStorage.getItem('userInfo');\n return JSON.parse(userInfo);\n } catch (err) {\n console.log(err);\n return null;\n }\n }", "title": "" }, { "docid": "555a246038259682c55530de76c6f876", "score": "0.655533", "text": "function getAuthenticatedUserFromCache() {\n const jwtToken = localStorage.getItem('jwtToken');\n const userid = localStorage.getItem('userid');\n const username = localStorage.getItem('username');\n const name = localStorage.getItem('name');\n const email = localStorage.getItem('email');\n\n //If a jwt was found in the local storage, return the following data\n if (jwtToken) {\n return {\n jwtToken,\n userid,\n username,\n name,\n email\n };\n } else {\n //if not, return undefined because we couldnt find it and that shows the user jwt is expired or never had one\n return undefined;\n }\n}", "title": "" }, { "docid": "90157bb488afa36d4a23845e67e23c5c", "score": "0.6551766", "text": "getCurrentUser() {\n return JSON.parse(localStorage.getItem('user'));\n }", "title": "" }, { "docid": "3d657aace88c014e9fad8e375e75a8f5", "score": "0.6544732", "text": "function loadCurrentUser() {\n let currentUserAsString = localStorage.getItem(\"currentUser\");\n\n if (currentUserAsString) {\n currentUser = JSON.parse(currentUserAsString);\n };\n}", "title": "" }, { "docid": "4f834195a0f206c3625e19a66b0a7c69", "score": "0.6540099", "text": "function retrieveLocal(){\r\n if(localStorage.getItem(\"localData\")){\r\n var localData = localStorage.getItem(\"localData\");\r\n var data = JSON.parse(localData);\r\n document.querySelector('#user').value = data.user;\r\n document.querySelector('#city').value = data.city;\r\n }\r\n}", "title": "" }, { "docid": "1a7e8883a8b26667c765c0171a038906", "score": "0.6539005", "text": "function getUser() {\n\t$.getJSON('/loggedin_user', { format: 'json' }).then(resp => currentUser = resp);\n}", "title": "" }, { "docid": "a3e3315acca7b7c91c51aee6549ca540", "score": "0.6538399", "text": "function checkUserId(username){\r\n\t$.getJSON(\"https://beam.pro/api/v1/channels/\" + username, function(data) {\r\n\t\tvar dataString = JSON.stringify(data, function(key, value){\r\n\t\t\tif(value === null){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\treturn value;\r\n\t\t});\r\n var strippedString = dataString.replace(/(<([^>]+)>)/ig,\"\");\r\n var parsedData = JSON.parse(strippedString);\r\n\t\tuserId = parsedData.userId;\r\n\t\tusername = parsedData.token;\r\n\t\taddAllFollows(userId);\r\n\t\tlocalStorage.setItem(\"username\", username);\r\n\t})\r\n}", "title": "" }, { "docid": "d28a5b943519433963ffe6127bf36c75", "score": "0.649913", "text": "function findUserByUsername(username) {\n let allUsers = fs.readFileSync('./config/user.json');\n allUsers = JSON.parse(allUsers);\n for (let i = 0; i < allUsers.length; i++) {\n if (allUsers[i].username == username) {\n return allUsers[i];\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "1ceabd10eca1736c9b9637b22369360f", "score": "0.6477505", "text": "async checkExistingUser() {\n const userDetails = await AsyncStorage.getItem('userDetails').catch(error => error);\n return userDetails;\n }", "title": "" }, { "docid": "4c45e9c871ac90b03e1b7afe2ee08c4c", "score": "0.64773756", "text": "async function readUser() {\n // if we don't have item user will be null\n const user = await AsyncStorage.getItem(\"user\");\n // await AsyncStorage.removeItem(\"user\");\n if (user) {\n setUser(JSON.parse(user));\n }\n }", "title": "" }, { "docid": "09a6d6bb2a3308bc132c0d2992e3ce23", "score": "0.6474022", "text": "function getAuthenticatedUser() {\n const jwtToken = localStorage.getItem('jwtToken');\n const userid = localStorage.getItem('userid');\n const username = localStorage.getItem('username');\n const firstName = localStorage.getItem('firstName');\n const lastName = localStorage.getItem('lastName');\n\n if (jwtToken) {\n return {\n jwtToken,\n userid,\n username,\n firstName,\n lastName\n };\n } else {\n return undefined;\n }\n}", "title": "" }, { "docid": "b925f246cf8d9a47b7561789fe70e893", "score": "0.64705664", "text": "function getUser(){\n var user = firebase.auth().currentUser;\n if (user != null) {\n $(\"#id_user_name\").val(user.displayName);\n $(\"#user_name\").text(user.displayName);\n $(\"#user_mail\").text(user.email);\n // Retrieve image path from web storage\n $(\"#profile_pic\").attr(\"src\", localStorage.getItem(user.uid));\n }\n }", "title": "" }, { "docid": "0b5b9aa6b00993d97a3a8cf43569949e", "score": "0.64595574", "text": "function displayUser(method, url, username) {\n const data = sessionStorage.getItem(\"userData\");\n\n makeRequest('GET', 'https://us-central1-qac-sandbox.cloudfunctions.net/getUser')\n .then((value) => {\n for(key in value){\n if (username == key){\n document.getElementById(\"username\").value=key;\n document.getElementById(\"password\").value=key.password;\n document.getElementById(\"firstName\").value=key.firstName;\n document.getElementById(\"lastName\").value=key.lastName;\n break;\n }\n } \n console.log(value);\n }).catch((error) => {\n console.warn(error);\n });\n console.log(value); //prints out details\n \n}", "title": "" }, { "docid": "a28bbf001b0bc6fb4182c05f0ca425df", "score": "0.645827", "text": "function getUserName() {\n var user_blueprints = localStorageService.get('usersurveys');\n return user_blueprints['userName']\n }", "title": "" }, { "docid": "7eb30e672166ef1188c10930e76d75f2", "score": "0.6432705", "text": "getUserInfo(username){\n\t\treturn this.get(`https://api.github.com/users/${username}`)\n\t}", "title": "" }, { "docid": "81e7ae7a491e086ed5d7a036acf74dec", "score": "0.6429132", "text": "function display_saved_info(){\n\n const user = localStorage.getItem('user');\n if (!user){\n document.getElementById('new_user').style.display = 'block';\n document.getElementById('old_user').style.display = 'none';\n document.getElementById('sign_up').onclick = () => {\n const uname = document.getElementById('uname').value;\n if (uname){\n localStorage.setItem('user', uname);\n welcome_user(uname);\n }\n }\n }\n else {\n welcome_user(user);\n const channel = localStorage.getItem('channel');\n if (channel){\n load_channel(channel);\n }\n }\n}", "title": "" }, { "docid": "4bf8dd65893db137310ceca9b6f79e3f", "score": "0.6425745", "text": "function getUserData(username, callback) {\n if (typeof username != 'string' || typeof callback != 'function') {\n return console.error('Invalid parameters. Usage: getID(username, callback);');\n }\n getJSON(\n 'https://api.twitch.tv/helix/users',\n '?login=' + encodeURIComponent(username),\n function (err, res) {\n if (res.data[0] == null) callback({});\n else callback(res.data[0]);\n }\n );\n}", "title": "" }, { "docid": "b86eb20e6ca3621d06a7276adb8c9da5", "score": "0.64186645", "text": "function getUser(username) {\n return axios.get(`/api/user/${username}`);\n }", "title": "" }, { "docid": "9d6eb263459d150891c2677e8bff46cf", "score": "0.6395292", "text": "isUserNameAvailable(uName) {\n let temp = JSON.parse(localStorage.getItem(\"USERS\"));\n var users = temp ? temp : [];\n\n for (let user of users) {\n if (user.name == uName) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "6a8fafc880877ae46caeec2f6c2612f3", "score": "0.6390847", "text": "get_user() {\n this.usuario = JSON.parse(localStorage.getItem('usuario'))[0];\n this.aux = this.usuario;\n }", "title": "" }, { "docid": "bfe240a4d79250568a82eb9be26e0591", "score": "0.638892", "text": "function updateUserName() {\n var h4 = document.querySelector(\"#username\");\n var uname = localStorage.getItem(\"user\");\n h4.textContent = \"My Name\";\n if (uname === null) {\n uname = prompt(\"Welcome to the ToDo List Application. What is your name?\");\n localStorage.setItem(\"user\", uname);\n }\n h4.textContent = uname;\n}", "title": "" }, { "docid": "99f82dbc98bc378197c3592e567d5995", "score": "0.6384405", "text": "function loadName() {\n name = localStorage.getItem('user-name');\n console.log(name);\n $('.user-name').prepend('Welcome back, ');\n if (name != \"null\" && name != undefined) {\n $('.user-name').text('Welcome back, ');\n $('.user-name').append(name);\n }\n $('.user-name').append('!');\n}", "title": "" }, { "docid": "31185d7feaf3c8e27d779d87fcf88ffe", "score": "0.63842565", "text": "function getUsers() {\n var allUsers = localStorage.users;\n if (allUsers == null || allUsers == undefined || allUsers == \"[]\")\n return null;\n return JSON.parse(allUsers);\n}", "title": "" }, { "docid": "433af42dfd21678388300bb4b249cb7e", "score": "0.63733244", "text": "function fetchUser(screen_name) { \n return T.get('users/show', {screen_name: screen_name}) \n}", "title": "" }, { "docid": "1df62bfcea8d6ec2224e0fcb5a51fdb9", "score": "0.63709205", "text": "function getUser(requestingUser, userId){\n if(!containsUserObject(requestingUser)){\n console.log(\"user is null\");\n return null;\n }\n\n if(users.hasOwnProperty(userId)){\n if(requestingUser.username == userId){\n console.log(\"user names matched\");\n return users[userId];\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "cbc27e5811abcc9b5242f1f68028d3f9", "score": "0.6360206", "text": "function getUserName() {\n // check the url and store it in a variable so we can search it\n var pageURL = window.location.href,\n uNameRegEx = /[?&]+([^?&]+)/g, // regex to match strings after ? in url\n passedData = pageURL.match(uNameRegEx); // cache all the matching strings\n // search the match data for the passed username and return it\n for (var i = 0; i < passedData.length; i++) {\n var currStr = passedData[i];\n // match function returns array, loop through that array to find username\n if (currStr.substr(0, 9) === '?username') {\n // break the loop when we find the username\n return currStr.substr(10)\n }\n }\n}", "title": "" }, { "docid": "cd532a50d65adf8992b2b5d4bcff89ef", "score": "0.63545185", "text": "checkForUsername () {\n if (!window.localStorage.username) {\n this.userNameEntry()\n } else {\n const userNameDiv = this.shadowRoot.querySelector('.username')\n const chatWindow = this.shadowRoot.querySelector('.chatbox')\n userNameDiv.classList.add('hidden')\n chatWindow.classList.remove('hidden')\n this.message.username = JSON.parse(window.localStorage.username)\n this.printUsernameInDiv()\n this.sendAndRetrieveMessages()\n }\n }", "title": "" }, { "docid": "f4c5a6c7cb20c34608bb6feb70d395fc", "score": "0.6354208", "text": "function getUser(username) {\n return fetch(`${baseUrl}/users/${username}`)\n .then(res => res.json());\n}", "title": "" }, { "docid": "1e270fe804f8814be704c0a85e07ad8b", "score": "0.63527584", "text": "static async getUser(username) {\n const userRes = await db.query(\n `SELECT username,\n first_name AS \"firstName\", \n last_name AS \"lastName\",\n email, \n hobbies, \n interests,\n zip,\n radius\n FROM users\n WHERE username = $1`,\n [username],\n )\n const user = userRes.rows[0];\n\n if (!user) throw new NotFoundError(`No user with ${username} found`);\n\n return user;\n }", "title": "" }, { "docid": "9498169cccb3b3fda4095b3acec02516", "score": "0.63482", "text": "static async getCurrentUser(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }", "title": "" }, { "docid": "6cc87f08c7ac3fdd5dfa235f8d8111d0", "score": "0.6332798", "text": "function accessUserName(userName) {\n userFullName = userName;\n}", "title": "" }, { "docid": "021738eb0313af7083051e47493454ff", "score": "0.63312316", "text": "getUsername(state) {\n // make call to API\n // call mutatios -> setUserData\n return state.currentUser.username;\n }", "title": "" }, { "docid": "0979c3f2df08a0d3cd9db53bf3258140", "score": "0.6328729", "text": "user (state) { return state.authUser.username }", "title": "" }, { "docid": "20bac23f4561488dc29296eae9b02fe6", "score": "0.6328362", "text": "function user(){\n$.get('/user', function(data){\n sessionStorage.setItem('user', data.login) \n getUserData()\n})\n}", "title": "" }, { "docid": "1697d5c8d81e2e0b5ddbd5cb8f9c6344", "score": "0.6328138", "text": "async function setLocalUser () {\n const loggedInUser = localStorage.getItem('userInfo')\n if (loggedInUser !== null) {\n const foundUser = JSON.parse(loggedInUser);\n props.setUserData(foundUser);\n }\n }", "title": "" }, { "docid": "98bc687efb1c6d1aa5dcedfd657beea8", "score": "0.6321202", "text": "function populateUser() {\n // check if user is logged in server side...\n loginService.checkLoginStatus()\n .then(function(response){\n // if logged in, populate user from sessionStorage\n if (!!response.data) {\n $scope.user = sessionService.getUser();\n }\n });\n }", "title": "" }, { "docid": "988c8396879a9d4eaa2b9dea4ec3a4fb", "score": "0.6317491", "text": "function showUsername() {\n document.getElementById(\"uname\").innerHTML = sessionStorage.getItem('uname')\n}", "title": "" }, { "docid": "9e90cfeea78e92ab3bf27f0fd843bcdb", "score": "0.6313255", "text": "static getUser() {\n return userName;\n }", "title": "" }, { "docid": "ff08d888b21f7814e3d28c99a63760a5", "score": "0.63091475", "text": "function getUserData(){\n // returns the object containing firstname, familyname etc...\n var token = localStorage.getItem(\"token\"); //user token\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if(this.readyState == 4 && this.status == 200){\n var response = JSON.parse(req.responseText);\n if(response.success){\n\n var userData = response.data;\n document.getElementById(\"nameLabel\").innerHTML = \"Name: \" + userData.firstname + \" \" + userData.familyname;\n document.getElementById(\"genderLabel\").innerHTML = \"Gender: \" + userData.gender;\n document.getElementById(\"cityLabel\").innerHTML = \"City: \" + userData.city;\n document.getElementById(\"countryLabel\").innerHTML =\"Country: \" + userData.country;\n document.getElementById(\"emailLabel\").innerHTML = \"Email: \" + userData.email;\n }\n }\n }\n req.open(\"GET\", \"/getdatatoken\", true);\n req.setRequestHeader(\"Authorization\", token);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n req.send();\n}", "title": "" }, { "docid": "953629ac5e94c0ae3166a4a287e72bf7", "score": "0.6306952", "text": "function findUser(username){\n return users.find(item=> item.username === username)\n }", "title": "" }, { "docid": "65a906a797b9f4c1602cc27839001e5b", "score": "0.63012123", "text": "function getLocalStorageUser() {\n var storedUser = localStorage.user;\n if (storedUser === undefined || storedUser === \"null\") {\n user = new User();\n localStorage.user = JSON.stringify(user)//store user\n return user\n }\n\n o = JSON.parse(storedUser);\n var u = new User();\n\n u.setUsername(o.username);\n u.setLogin(o.loggedIn);\n if (o.loggedIn){\n //if the user is logged in don't ignore the prompt\n u.setLoginPrompt(false);\n }\n u.setBlacklist(o.blacklist);\n u.setWhitelist(o.whitelist);\n\n return u\n}", "title": "" }, { "docid": "b7eba1dba83e02d64fde5aa48ffeb194", "score": "0.6294841", "text": "function getUserInfo()\n{\n\t\n\t\n\t//PREVIOUS EXIST? IF NOT REDIRECT WITH MESSAGE\n\tif(localStorage.savedUserSettings === undefined)\n\t{\n\t\t\n\t\t$.mobile.changePage( \"#userLoginPage\");\n\t\t$(\".infoBarHeadingText\").text('PRO ZMĚNU NASTAVENÍ JE TŘEBA SE PŘIHLÁSIT');\n\t\t\n\t\t\n\t}\n\t\n\n\t//FILL FORM AND DISABLE INPUTS\n\telse\n\t{\n\tconsole.log(\"UZIVATEL JE PRIHLASEN, NACITAM JEHO DATA\"); \n\t//GET VALUES AND PREPARE FROM STRING TO WORK\n\tvar parsedItems = JSON.parse(localStorage.savedUserSettings);\n\n\t\n\t\n\t $(\"#registerUpdateFieldContain :input\").attr(\"disabled\", \"disabled\");\n\t\n\n\t$('#changedName').val(parsedItems.values[0].jmeno);\n\n\t$('#changedSurname').val(parsedItems.values[0].prijmeni);\n\n\t$('#changedUserEmail').val(parsedItems.values[0].email);\n\n\n\t$('#changedCellPhone').val(parsedItems.values[0].tel);\n\n\t\n\t}\n\t \n\t\n\t\n\t\n}", "title": "" }, { "docid": "49ef7cf19e29911c869b395945009d7c", "score": "0.6293303", "text": "static async get(username) {\n\t\tconst user = await db.query(\n\t\t\t`\n SELECT u.username, first_name, last_name, email, photo_url, is_admin, a.job_id, a.state FROM users AS u FULL JOIN applications AS a ON a.username = u.username WHERE u.username = $1`,\n\t\t\t[ username ]\n\t\t);\n\t\tif (!user.rows[0]) {\n\t\t\tthrow new ExpressError(`No such user: ${username}`, 404);\n\t\t}\n\t\tconst u = user.rows[0];\n\t\tconst j = user.rows;\n\t\tconst jobs = [];\n\t\tfor (let job of j) {\n\t\t\tjobs.push({ job_id: job.job_id, state: job.state });\n\t\t}\n\t\treturn new User(u.username, u.first_name, u.last_name, u.email, u.photo_url, u.is_admin, jobs);\n\t}", "title": "" }, { "docid": "e36ab1a18ee0a159e7c4241e833505ad", "score": "0.6291323", "text": "getUserId() {\n return this.getItem(defaults.user_storage_key);\n }", "title": "" }, { "docid": "42e5fc9415154357a0729c7ef4030895", "score": "0.6290037", "text": "function getUserPreferences() {\n return JSON.parse(localStorage.getItem(\"user\")) || {};\n}", "title": "" }, { "docid": "366a42d5d05ea9e309b425871aac93e6", "score": "0.6285949", "text": "function checkuserinfo(checkuser){\n var newuser = {\n usertitle: \"Newbie\",\n favorites: [],\n recentlyWatched: [],\n profilePicture: \"default.png\",\n settings: {\n autoplay: true,\n },\n };\n if(!checkuser.hasOwnProperty(\"usertitle\")){\n checkuser.usertitle = newuser.usertitle;\n }\n if (!checkuser.hasOwnProperty(\"favorites\")){\n checkuser.favorites = newuser.favorites;\n }\n if (!checkuser.hasOwnProperty(\"recentlyWatched\")){\n checkuser.recentlyWatched = newuser.recentlyWatched;\n }\n if (!checkuser.hasOwnProperty(\"profilePicture\")){\n checkuser.profilePicture = newuser.profilePicture;\n }else if (checkuser.profilePicture == \"\"){\n checkuser.profilePicture = newuser.profilePicture;\n }\n if (!checkuser.hasOwnProperty(\"settings\")){\n checkuser.settings = newuser.settings;\n }\n userArray.forEach((user, index) => {\n if(user.username == checkuser.username){\n userArray.splice(index,1);\n userArray.push(checkuser);\n localStorage.setItem(\"users\", JSON.stringify(userArray));\n }\n });\n }", "title": "" } ]
404d9155dcbcfbf4440d27ef4223460a
Navigate Girvi List Panel By Amount Range
[ { "docid": "8ac0502fa93b0595ccf7bdaf9449046b", "score": "0.56156206", "text": "function navigationGirviListPanelByAmtRange(pageNo, grvAmtRange) {\r\n loadXMLDoc();\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n document.getElementById(\"ajaxLoadNextGirviPanelList\").style.visibility = \"hidden\";\r\n document.getElementById(\"ajaxLoadNextGirviPanelListButt\").style.visibility = \"visible\";\r\n document.getElementById(\"girviListPanelDiv\").innerHTML = xmlhttp.responseText;\r\n } else {\r\n document.getElementById(\"ajaxLoadNextGirviPanelList\").style.visibility = \"visible\";\r\n document.getElementById(\"ajaxLoadNextGirviPanelListButt\").style.visibility = \"hidden\";\r\n }\r\n };\r\n xmlhttp.open(\"POST\", \"include/php/orgsamrd.php?page=\" + pageNo + \"&grvAmtRange=\" + grvAmtRange, true);\r\n xmlhttp.send();\r\n}", "title": "" } ]
[ { "docid": "8d60f9cfd5b87e3c21f57435401bd870", "score": "0.617832", "text": "function addRange(start, finish, scope) {\r\n var i = 0;\r\n for (i = start; i <= finish; i++) {\r\n var item = {\r\n value: i.toString(),\r\n liClass: scope.page == i ? scope.activeClass : 'waves-effect',\r\n action: function() {\r\n internalAction(scope, this.value);\r\n }\r\n };\r\n\r\n scope.List.push(item);\r\n }\r\n }", "title": "" }, { "docid": "002e9012072d535f54d2938d92073a2f", "score": "0.6036297", "text": "function refresh_page(page_number, item_range_min, item_range_max)\n {\n items.hide();\n items.slice(item_range_min, item_range_max).show();\n }", "title": "" }, { "docid": "691ff658fd54aba316c3f694a617f0ef", "score": "0.60083085", "text": "function navigationGirviListPanelByCustomAmtRange(pageNo, startRange, endRange) {\r\n loadXMLDoc();\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n document.getElementById(\"ajaxLoadNextGirviPanelList\").style.visibility = \"hidden\";\r\n document.getElementById(\"ajaxLoadNextGirviPanelListButt\").style.visibility = \"visible\";\r\n document.getElementById(\"girviListPanelDiv\").innerHTML = xmlhttp.responseText;\r\n } else {\r\n document.getElementById(\"ajaxLoadNextGirviPanelList\").style.visibility = \"visible\";\r\n document.getElementById(\"ajaxLoadNextGirviPanelListButt\").style.visibility = \"hidden\";\r\n }\r\n };\r\n xmlhttp.open(\"POST\", \"include/php/orgscard.php?page=\" + pageNo + \"&startRange=\" + startRange + \"&endRange=\" + endRange, true);\r\n xmlhttp.send();\r\n}", "title": "" }, { "docid": "9610fd5e95b2840bed9fd82c8e065265", "score": "0.5709769", "text": "range() {\n const {page, rowsPerPage, count} = this.props;\n const nbPages = Math.ceil(count / rowsPerPage) || 1;\n if (isNaN(page) || nbPages === 1) {\n return [];\n }\n const input = [];\n // display page links around the current page\n if (page > 1) {\n input.push(1);\n }\n if (page === 3) {\n input.push(2);\n }\n if (page > 3) {\n input.push('.');\n }\n if (page > 0) {\n input.push(page);\n }\n input.push(page + 1);\n if (page < nbPages - 1) {\n input.push(page + 2);\n }\n if (page === nbPages - 4) {\n input.push(nbPages - 1);\n }\n if (page < nbPages - 4) {\n input.push('.');\n }\n if (page < nbPages - 2) {\n input.push(nbPages);\n }\n\n return input;\n }", "title": "" }, { "docid": "3c3b8f72e4c0459b825bcb10baccbecd", "score": "0.5657627", "text": "function updateRangeValues() {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.56193435", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.56193435", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.56193435", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.56193435", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "846d04016593cb802f3e67387729eec6", "score": "0.5610738", "text": "function updateRangeValues() {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }", "title": "" }, { "docid": "aab67532dad10a83d8407d1e768f5783", "score": "0.56082976", "text": "function showAll() {\n vm.rangeNum = vm.fullList.length;\n }", "title": "" }, { "docid": "ea84c5ffbc990c5d0ba44a133ed8f56a", "score": "0.5586499", "text": "function showPage(list, page) { \n const startIndex = (page * pageMax) - pageMax; //startIndex becomes 0 if the page is 1, 10 if page is 2, etc.\n const endIndex = (page * pageMax) - 1; //endIndex becomes 9 if page is 1, 19 if page is 2, etc.\n for (let i = 0; i < list.length; i++) //for loop will run through the entire number of list items before stopping\n if ( i >= startIndex && i <= endIndex) {\n list[i].style.display = ''; //displays all list items within the range of startIndex' value and endIndex' value\n } else {\n list[i].style.display = 'none'; //hides all list items not contained within the start and end Index values.\n }\n\n}", "title": "" }, { "docid": "5b0046c812b42277cee4599356680edb", "score": "0.55648607", "text": "function numbers() {\n //Minimum 5, 2 each side of index...\n var i, min, max, res, cnt = pageCount;\n\n min = $scope.options.index - 4;\n max = $scope.options.index + 4;\n\n if (min < 0) {\n max = max - min;\n min = 0;\n } else if (max >= cnt) {\n min = min - (max - cnt + 1);\n max = cnt - 1;\n }\n if (min < 0) {\n min = 0;\n }\n if (max >= cnt) {\n max = cnt - 1;\n }\n\n res = [];\n for (i = min; i <= max; i++) {\n res.push(i + 1);\n }\n return res;\n }", "title": "" }, { "docid": "4d63aa41252c0edcbf37c906323629a1", "score": "0.54815584", "text": "function filterPrice(min, max){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.price >= min && l.price <= max && listings[i].visible;\r\n }\r\n}", "title": "" }, { "docid": "01131f49f1d0ace8a94d024daaf70be1", "score": "0.5467659", "text": "showPriceRangeValues() {\n\t\t$('#price-min').text(this.getPriceRange()[0]);\n\t\t$('#price-max').text(this.getPriceRange()[1]);\n\t}", "title": "" }, { "docid": "38bfd6776ed1fbe4973722600d04dedb", "score": "0.5392066", "text": "function showLess() {\n vm.rangeNum = vm.limitNum;\n }", "title": "" }, { "docid": "9d9a63a81cea3ad92ae5d06a216e83c6", "score": "0.53858674", "text": "add(range) {\n this.list.push(range);\n this.addRangeToList();\n }", "title": "" }, { "docid": "ee76599d6074f327fc42ad9b0e215373", "score": "0.5367052", "text": "function setPaginationAndItemsAmount(items) {\r\n\r\n // elemeent DOM\r\n const paginationContainer = document.querySelector(\".pagination\");\r\n const paginationWrapper = document.querySelector(\".pag-wrapper\");\r\n const paginationNum = paginationContainer.querySelector(\".numbers\");\r\n let status_info = paginationContainer.querySelector(\".items-status-info\");\r\n\r\n let showingItems = 20;\r\n\r\n for (let i = 1; i <= Math.ceil(items.length / showingItems); i++) {\r\n\r\n if (paginationNum && (items.length / showingItems > 1)) {\r\n paginationWrapper.style.display = 'block';\r\n\r\n if (i === 1) {\r\n paginationNum.innerHTML =\r\n `<span class=\"page-number black-focus\">${i}</span>`;\r\n } else {\r\n paginationNum.innerHTML += `<span class=\"page-number\">${i}</span>`;\r\n }\r\n }\r\n }\r\n\r\n\r\n if (status_info && items.length > showingItems) {\r\n status_info.innerHTML =\r\n `<small><i><strong>${showingItems}</strong> of <strong>${items.length}</strong> total<i/></small>`\r\n } else {\r\n paginationWrapper.style.display = 'none';\r\n status_info.innerHTML =\r\n `<small><i><strong>${items.length}</strong> total Items<i/></small>`\r\n }\r\n\r\n paginationRight.addEventListener(\"click\", nextPage);\r\n paginationLeft.addEventListener(\"click\", prevPage);\r\n\r\n\r\n // add event to paginationNum numbers\r\n //if (paginationNum) \r\n pagiArray = Array.prototype.slice.call(paginationNum.children);\r\n\r\n //if (pagiArray) \r\n pagiArray.forEach(num => {\r\n num.addEventListener(\"click\", (e) => {\r\n console.log(\"num\");\r\n getpage = Number(pagiArray.indexOf(e.currentTarget));\r\n let itemsNum = 20 * getpage;\r\n itemsContainer.innerHTML = \"\";\r\n loadPages(itemsNum, contenItems);\r\n checkFocus(paginationLeft);\r\n checkFocus(paginationRight);\r\n getCurrentList()\r\n view === \"list\" ? styleList(\"l\") : styleList(\"g\");\r\n });\r\n });\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "72b12d35732b222544fe7cfc05bd4179", "score": "0.53590167", "text": "function changePageNum(num)\n {\n ;\n setNum(num); \n let p1=(pageNum - 1) * 6;\n let p2=pageNum * 6 - 1;\n items=items.slice(p1, p2)\n // setItems(list.slice((pageNum - 1) * 6, pageNum * 6 - 1))\n var list= items.slice((pageNum - 1) * 6, pageNum * 6 - 1)\n // setMyItems({\n // ...items,\n // list\n // });\n\n }", "title": "" }, { "docid": "27e8962b93204370944874457b862e06", "score": "0.5350957", "text": "function showPage(list,page){ // 1- receives list of elements and page number as arguments\n\n// 2- calculate start/end index according to the page \nlet startIndex = (page * liPerPage) -liPerPage; //i.e. (2*10)-10 = 10.. start index is 10 on second page\nlet endIndex = page * liPerPage; // i.e. 2*10 = 20.. Gets items from 10 to 20 on second page\n\n// 4- iterare trough list and display items within the range of StartIndex-EndIndex \nfor (i = 0; i< list.length; i++) { \n\n if( (i >= startIndex) && (i<endIndex)) {\n\nlist[i].style.display = 'block';\n\n }\n// 5- Hide the remaining items 'none'\n else {\n \n list[i].style.display = 'none';\n \n }\n }\n\n\n}", "title": "" }, { "docid": "fc3d587968b8ea86a4a4a9c405291d13", "score": "0.53481895", "text": "function computeThisPageList()\n{\n thisPageList.length = 0;\n \n if (currentPage < pageAmount)\n for (var i = 0; i < maxPageAmount; i++)\n thisPageList.push(GMList[GMAmount - maxPageAmount * (currentPage - 1) - i - 1]);\n else\n for (var i = 0; i < (GMAmount % maxPageAmount); i++)\n thisPageList.push(GMList[GMAmount - maxPageAmount * (currentPage - 1) - i - 1]);\n\n showThisPageList();\n\n for (var i = 0; i < thisPageList.length; i++)\n document.getElementById(\"list\" + i).removeAttribute('style');\n for (var i = thisPageList.length; i < maxPageAmount; i++)\n document.getElementById(\"list\" + i).style.display = \"none\";\n}", "title": "" }, { "docid": "b55d13a8e8ca6415d38b4deea481b38b", "score": "0.53248274", "text": "function percentageControl(memberAmount, restAmount) {\n var data = [{\n\n // SNH48\n name: 'SNH48',\n itemStyle: {\n color: '#00b6de'\n },\n children: [{ // Team SII\n name: 'Team SII',\n itemStyle: {\n color: '#00b6de'\n },\n children: [{ // 莫寒\n name: '莫寒',\n value: parseFloat(memberAmount[\"莫寒\"]),\n itemStyle: {\n color: '#297CD7'\n }\n }, { // 许佳琪\n name: '许佳琪',\n value: parseFloat(memberAmount[\"许佳琪\"]),\n itemStyle: {\n color: '#FF093D'\n }\n }, { // 戴萌\n name: '戴萌',\n value: parseFloat(memberAmount[\"戴萌\"]),\n itemStyle: {\n color: '#F6BDC1'\n }\n }, { // 钱蓓婷\n name: '钱蓓婷',\n value: parseFloat(memberAmount[\"钱蓓婷\"]),\n itemStyle: {\n color: '#3A5BA5'\n }\n }, { // 吴哲晗\n name: '吴哲晗',\n value: parseFloat(memberAmount[\"吴哲晗\"]),\n itemStyle: {\n color: '#F6C5C6'\n }\n }, { // 孔肖吟\n name: '孔肖吟',\n value: parseFloat(memberAmount[\"孔肖吟\"]),\n itemStyle: {\n color: '#FF613C'\n }\n }, { // 张语格\n name: '张语格',\n value: parseFloat(memberAmount[\"张语格\"]),\n itemStyle: {\n color: '#FF0030'\n }\n }, { // 徐子轩\n name: '徐子轩',\n value: parseFloat(memberAmount[\"徐子轩\"]),\n itemStyle: {\n color: '#FFA899'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_SII\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, { // Team NII\n name: 'Team NII',\n itemStyle: {\n color: '#9e57b4'\n },\n children: [{ // 周诗雨\n name: '周诗雨',\n value: parseFloat(memberAmount[\"周诗雨\"]),\n itemStyle: {\n color: '#FDF200'\n }\n }, { // 赵佳蕊\n name: '赵佳蕊',\n value: parseFloat(memberAmount[\"赵佳蕊\"]),\n itemStyle: {\n color: '#31B26B'\n }\n }, { // 谢妮\n name: '谢妮',\n value: parseFloat(memberAmount[\"谢妮\"]),\n itemStyle: {\n color: '#D9205E'\n }\n }, { // 张怡\n name: '张怡',\n value: parseFloat(memberAmount[\"张怡\"]),\n itemStyle: {\n color: '#0C7CE5'\n }\n }, { // 张雨鑫\n name: '张雨鑫',\n value: parseFloat(memberAmount[\"张雨鑫\"]),\n itemStyle: {\n color: '#ffb3b3'\n }\n }, { // 易嘉爱\n name: '易嘉爱',\n value: parseFloat(memberAmount[\"易嘉爱\"]),\n itemStyle: {\n color: '#D06479'\n }\n },{ // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_NII\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, { // Team HII\n name: 'Team HII',\n itemStyle: {\n color: '#f8941d'\n },\n children: [{ // 李艺彤\n name: '李艺彤',\n value: parseFloat(memberAmount[\"李艺彤\"]),\n itemStyle: {\n color: '#E60111'\n }\n }, { // 林思意\n name: '林思意',\n value: parseFloat(memberAmount[\"林思意\"]),\n itemStyle: {\n color: '#009441'\n }\n }, { // 姜杉\n name: '姜杉',\n value: parseFloat(memberAmount[\"姜杉\"]),\n itemStyle: {\n color: '#870000'\n }\n }, { // 费沁源\n name: '费沁源',\n value: parseFloat(memberAmount[\"费沁源\"]),\n itemStyle: {\n color: '#E7B3D2'\n }\n }, { // 沈梦瑶\n name: '沈梦瑶',\n value: parseFloat(memberAmount[\"沈梦瑶\"]),\n itemStyle: {\n color: '#CE50A7'\n }\n }, { // 许杨玉琢\n name: '许杨玉琢',\n value: parseFloat(memberAmount[\"许杨玉琢\"]),\n itemStyle: {\n color: '#009113'\n }\n }, { // 袁一琦\n name: '袁一琦',\n value: parseFloat(memberAmount[\"袁一琦\"]),\n itemStyle: {\n color: '#2E2928'\n }\n }, { // 张昕\n name: '张昕',\n value: parseFloat(memberAmount[\"张昕\"]),\n itemStyle: {\n color: '#AE014E'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_HII\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, { // Team X\n name: 'Team X',\n itemStyle: {\n color: '#b1d61b'\n },\n children: [{ // 宋昕冉\n name: '宋昕冉',\n value: parseFloat(memberAmount[\"宋昕冉\"]),\n itemStyle: {\n color: '#FCC525'\n }\n }, { // 杨冰怡\n name: '杨冰怡',\n value: parseFloat(memberAmount[\"杨冰怡\"]),\n itemStyle: {\n color: '#AA302E'\n }\n }, { // 李星羽\n name: '李星羽',\n value: parseFloat(memberAmount[\"李星羽\"]),\n itemStyle: {\n color: '#EB7477'\n }\n }, { // 冯晓菲\n name: '冯晓菲',\n value: parseFloat(memberAmount[\"冯晓菲\"]),\n itemStyle: {\n color: '#E75398'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_X\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }]\n }, {\n\n // BEJ48\n name: 'BEJ48',\n itemStyle: {\n color: '#ff4083'\n },\n children: [{ // Team B\n name: 'Team B',\n itemStyle: {\n color: '#ff4083'\n },\n children: [{ // 段艺璇\n name: '段艺璇',\n value: parseFloat(memberAmount[\"段艺璇\"]),\n itemStyle: {\n color: '#FF9700'\n }\n }, { // 胡晓慧\n name: '胡晓慧',\n value: parseFloat(memberAmount[\"胡晓慧\"]),\n itemStyle: {\n color: '#F7A5A4'\n }\n }, { // 刘姝贤\n name: '刘姝贤',\n value: parseFloat(memberAmount[\"刘姝贤\"]),\n itemStyle: {\n color: '#EFCED0'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_B\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, { // Team E\n name: 'Team E',\n itemStyle: {\n color: '#0cc8c3'\n },\n children: [{ // 苏杉杉\n name: '苏杉杉',\n value: parseFloat(memberAmount[\"苏杉杉\"]),\n itemStyle: {\n color: '#F29A03'\n }\n }, { // 刘胜男\n name: '刘胜男',\n value: parseFloat(memberAmount[\"刘胜男\"]),\n itemStyle: {\n color: '#FED737'\n }\n }, { // 陈倩楠\n name: '陈倩楠',\n value: parseFloat(memberAmount[\"陈倩楠\"]),\n itemStyle: {\n color: '#8B99CD'\n }\n }, { // 李梓\n name: '李梓',\n value: parseFloat(memberAmount[\"李梓\"]),\n itemStyle: {\n color: '#931211'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_E\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, {\n // Team J\n name: 'Team J',\n itemStyle: {\n color: '#006ab7'\n },\n children: [{ // 韩家乐\n name: '韩家乐',\n value: parseFloat(memberAmount[\"韩家乐\"]),\n itemStyle: {\n color: '#F5B5B1'\n }\n }, { // 张怀瑾\n name: '张怀瑾',\n value: parseFloat(memberAmount[\"张怀瑾\"]),\n itemStyle: {\n color: '#E9D19C'\n }\n }, { // 黄恩茹\n name: '黄恩茹',\n value: parseFloat(memberAmount[\"黄恩茹\"]),\n itemStyle: {\n color: '#FEE0F9'\n }\n }, { // 柏欣妤\n name: '柏欣妤',\n value: parseFloat(memberAmount[\"柏欣妤\"]),\n itemStyle: {\n color: '#232F3A'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_J\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }]\n }, {\n\n //GNZ48\n name: 'GNZ48',\n itemStyle: {\n color: '#9FBF40'\n },\n children: [{ // Team G\n name: 'Team G',\n itemStyle: {\n color: '#9FBF40'\n },\n children: [{ // 谢蕾蕾\n name: '谢蕾蕾',\n value: parseFloat(memberAmount[\"谢蕾蕾\"]),\n itemStyle: {\n color: '#ffb6bd'\n }\n }, { // 陈珂\n name: '陈珂',\n value: parseFloat(memberAmount[\"陈珂\"]),\n itemStyle: {\n color: '#FADB2E'\n }\n }, { // 徐楚雯\n name: '徐楚雯',\n value: parseFloat(memberAmount[\"徐楚雯\"]),\n itemStyle: {\n color: '#61C4C0'\n }\n }, { // 张琼予\n name: '张琼予',\n value: parseFloat(memberAmount[\"张琼予\"]),\n itemStyle: {\n color: '#005caf'\n }\n }, { // 李姗姗\n name: '李姗姗',\n value: parseFloat(memberAmount[\"李姗姗\"]),\n itemStyle: {\n color: '#68AFDE'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_G\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, { // Team NIII\n name: 'Team NIII',\n itemStyle: {\n color: '#ffe249'\n },\n children: [{ // 郑丹妮\n name: '郑丹妮',\n value: parseFloat(memberAmount[\"郑丹妮\"]),\n itemStyle: {\n color: '#F6EABD'\n }\n }, { // 刘力菲\n name: '刘力菲',\n value: parseFloat(memberAmount[\"刘力菲\"]),\n itemStyle: {\n color: '#8DC41E'\n }\n }, { // 唐莉佳\n name: '唐莉佳',\n value: parseFloat(memberAmount[\"唐莉佳\"]),\n itemStyle: {\n color: '#5F4A8A'\n }\n }, { // 左婧媛\n name: '左婧媛',\n value: parseFloat(memberAmount[\"左婧媛\"]),\n itemStyle: {\n color: '#653B8C'\n }\n }, { // 卢静\n name: '卢静',\n value: parseFloat(memberAmount[\"卢静\"]),\n itemStyle: {\n color: '#C0DDEE'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_NIII\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }, { // Team Z\n name: 'Team Z',\n itemStyle: {\n color: '#ea617b'\n },\n children: [{ // 杨媛媛\n name: '杨媛媛',\n value: parseFloat(memberAmount[\"杨媛媛\"]),\n itemStyle: {\n color: '#BF0204'\n }\n }, { // 梁婉琳\n name: '梁婉琳',\n value: parseFloat(memberAmount[\"梁婉琳\"]),\n itemStyle: {\n color: '#A93539',\n }\n }, { // 龙亦瑞\n name: '龙亦瑞',\n value: parseFloat(memberAmount[\"龙亦瑞\"]),\n itemStyle: {\n color: '#B484B7'\n }\n }, { // 方琪\n name: '方琪',\n value: parseFloat(memberAmount[\"方琪\"]),\n itemStyle: {\n color: '#B484B7'\n }\n }, { // 其他\n name: '其他',\n value: parseFloat(restAmount[\"rest_Z\"]),\n itemStyle: {\n color: '#eeeeee'\n }\n }]\n }]\n }];\n\n var option = {\n title: {\n text: '集资分布',\n subtext: '点击圆环查看各分团/队伍的集资分布详情 点击圆心返回上一级',\n textStyle: {\n fontSize: 24,\n align: 'center',\n color: '#C0DAFF',\n },\n subtextStyle: {\n align: 'center',\n color: '#C0DAFF',\n fontSize: 15,\n // fontFamily: \"楷体\",\n },\n x: \"center\", // Title align\n y: 10, // Distance from div top.\n },\n tooltip: {\n trigger: 'item',\n // formatter: \"{b}: {c} ({d}%)\",\n formatter: function (params) {\n // Theater.\n if (params.name === \"SNH48\" || params.name === \"BEJ48\" || params.name === \"GNZ48\") {\n return params.name + \"<br/>\"\n + \"集资总额:\" + params.value.toFixed(2) + \"<br/>\"\n + \"团间比例:\" + ((params.value/params.treePathInfo[0].value)*100).toFixed(1) + \"%\";\n // Team.\n } else if (params.name === \"Team SII\" || params.name === \"Team NII\" || params.name === \"Team HII\" || params.name === \"Team X\" ||\n params.name === \"Team B\" || params.name === \"Team E\" || params.name === \"Team J\" ||\n params.name === \"Team G\" || params.name === \"Team NIII\"|| params.name === \"Team Z\") {\n return params.name + \"<br/>\"\n + \"集资总额&nbsp;&nbsp;&nbsp;:\" + params.value.toFixed(2) + \"<br/>\"\n + \"分团内比例:\" + ((params.value/params.treePathInfo[1].value)*100).toFixed(1) + \"%\" + \"<br/>\"\n + \"队伍间比例:\" + ((params.value/params.treePathInfo[0].value)*100).toFixed(1) + \"%\";\n // Member/other.\n } else if (params.treePathInfo[2]) {\n return params.name + \"<br/>\"\n + \"集资总额&nbsp;&nbsp;&nbsp;:\" + params.value.toFixed(2) + \"<br/>\"\n + \"队伍内比例:\" + ((params.value/params.treePathInfo[2].value)*100).toFixed(1) + \"%\" + \"<br/>\"\n + \"分团内比例:\" + ((params.value/params.treePathInfo[1].value)*100).toFixed(1) + \"%\" + \"<br/>\"\n + \"全团比例&nbsp;&nbsp;&nbsp;:\" + ((params.value/params.treePathInfo[0].value)*100).toFixed(1) + \"%\";\n } else {\n return null;\n }\n }\n },\n series: {\n type: 'sunburst',\n highlightPolicy: 'ancestor',\n data: data,\n itemStyle: {\n color: '#C0DAFF',\n borderWidth: 0,\n },\n // radius: [0, '95%'],\n radius: [0, '80%'],\n center: ['50%', '55%'],\n sort: null,\n levels: [{}, {\n r0: '10%',\n r: '30%',\n itemStyle: {\n borderWidth: 3\n },\n label: {\n rotate: 'tangential'\n }\n }, {\n r0: '35%',\n r: '60%',\n itemStyle: {\n borderWidth: 2\n },\n label: {\n align: 'right'\n }\n }, {\n r0: '65%',\n r: '70%',\n label: {\n position: 'outside',\n padding: 3,\n silent: false\n },\n itemStyle: {\n borderWidth: 1\n }\n }]\n },\n textStyle: {\n color: '#C0DAFF',\n textBorderColor: 'transparent',\n }\n };\n\n percentageChart.hideLoading();\n percentageChart.setOption(option, true);\n}", "title": "" }, { "docid": "3fe53c3cc01c25132609abfe2de877cc", "score": "0.5318423", "text": "function getItemsAtRange(opts, value, range) {\n range = range || value.selection;\n\n if (!range.startKey) {\n return (0, _immutable.List)();\n }\n\n var document = value.document;\n\n\n var startBlock = document.getClosestBlock(range.startKey);\n var endBlock = document.getClosestBlock(range.endKey);\n\n if (startBlock === endBlock) {\n var item = (0, _getCurrentItem2.default)(opts, value, startBlock);\n return item ? (0, _immutable.List)([item]) : (0, _immutable.List)();\n }\n\n var ancestor = document.getCommonAncestor(startBlock.key, endBlock.key);\n\n if ((0, _isList2.default)(opts, ancestor)) {\n var startPath = ancestor.getPath(startBlock.key);\n var endPath = ancestor.getPath(endBlock.key);\n\n return ancestor.nodes.slice(startPath[0], endPath[0] + 1);\n } else if (ancestor.type === opts.typeItem) {\n // The ancestor is the highest list item that covers the range\n return (0, _immutable.List)([ancestor]);\n }\n // No list of items can cover the range\n return (0, _immutable.List)();\n}", "title": "" }, { "docid": "3fe53c3cc01c25132609abfe2de877cc", "score": "0.5318423", "text": "function getItemsAtRange(opts, value, range) {\n range = range || value.selection;\n\n if (!range.startKey) {\n return (0, _immutable.List)();\n }\n\n var document = value.document;\n\n\n var startBlock = document.getClosestBlock(range.startKey);\n var endBlock = document.getClosestBlock(range.endKey);\n\n if (startBlock === endBlock) {\n var item = (0, _getCurrentItem2.default)(opts, value, startBlock);\n return item ? (0, _immutable.List)([item]) : (0, _immutable.List)();\n }\n\n var ancestor = document.getCommonAncestor(startBlock.key, endBlock.key);\n\n if ((0, _isList2.default)(opts, ancestor)) {\n var startPath = ancestor.getPath(startBlock.key);\n var endPath = ancestor.getPath(endBlock.key);\n\n return ancestor.nodes.slice(startPath[0], endPath[0] + 1);\n } else if (ancestor.type === opts.typeItem) {\n // The ancestor is the highest list item that covers the range\n return (0, _immutable.List)([ancestor]);\n }\n // No list of items can cover the range\n return (0, _immutable.List)();\n}", "title": "" }, { "docid": "1aeb1dae03f6dfb2cfb6b39135d72359", "score": "0.5303115", "text": "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n //first i am going to make an array to hold the numbers .pushed into it for the range function\n var rangeArray = [];\n //here i am making a loop that will decide in which order the number will be returned \n \n if(start < end){\n for(var i = start; i <= end; i++){\n rangeArray.push(i);\n }\n }else{\n for(var i = start; i >= end; i--){\n rangeArray.push(i);\n }\n }\n // i am returning range array so that it will hold the new output data\n return (rangeArray); \n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "title": "" }, { "docid": "489ee203a7612451ce76b68412bfd3cb", "score": "0.52933216", "text": "function itemsBetween(value){\n\n return (value.price > 14 && value.price < 18);\n}", "title": "" }, { "docid": "a5f13c64fd2cdd8fa4a4c64482d0be07", "score": "0.5262693", "text": "function showRange(to, bar, vis) {\n document.getElementById(to).style.display=vis\n document.getElementById(bar).style.display=vis\n}", "title": "" }, { "docid": "1db8cc820295940e0a009cf803b7ef2b", "score": "0.52403265", "text": "function getCostElemetList () {\n \t\n\tCostElemetsList=GetSettingCostElements();\n\tCostElementDetailList=getCostElementDetailList();\n \tfor(var i=0;i<CostElemetsList.length;i++)\n\t{\n\t\t//Ti.API.info('Cost Group : '+CostElemetsList[i].Name);\n\t\tvar headerRow=createHeaderRow(i);\n\t\tscrollView.add(headerRow);\n\t\tfor(var j=0;j<CostElementDetailList.length;j++)\n\t\t{\n\t\t\tif(CostElementDetailList[j].CostGroupId == CostElemetsList[i].CostGroupID)\n\t\t\t{\n\t\t\t\tTi.API.info('Cost Elements : '+CostElementDetailList[j].CostElementName);\n\t\t\t\tvar roww = createSubRow(j);\n\t\t\t\tscrollView.add(roww);\n\t\t\t}\n\t\t}\n\t}\n CostElementWin.add(scrollView);\n }", "title": "" }, { "docid": "cf2fd8181709db93509fa6a6de235213", "score": "0.5219", "text": "function filterSize(min, max){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.size >= min && l.size <= max && listings[i].visible;\r\n }\r\n}", "title": "" }, { "docid": "a18ec25c9405972b283e1ba2db186a5f", "score": "0.520015", "text": "function showPage (list , page){\n\n \n const pageNum = parseInt (page);\n const upperIndex = (page*listNum);\n const lowerIndex = (page*listNum)-listNum;\n\n for (let i=0;i<list.length;i++){\n\n if (i >= lowerIndex && i< upperIndex){\n list[i].style.display = '';\n }; \n\n if(i < lowerIndex || i >= upperIndex ){\n\n list[i].style.display = 'none';\n };\n };\n \n \n}", "title": "" }, { "docid": "23fb0b0fbce070a197fb0b3eeb9b6877", "score": "0.51998186", "text": "function showPage(pageNumber, listName) { // Takes arguments for page number and source list\n $(eachStudent).hide(); // Hides initial list of all students\n let currentLength = listName.length;\n for (let i = 0; i < currentLength; i++) { // Loops to check for right range\n if (i < pageNumber * studentsperPage && i + 1 > (pageNumber - 1) * studentsperPage) {\n $(listName[i]).show(); // Shows students in correct number range\n }\n }\n currentList = listName; // Sets current list so addPages knows how many pages to make\n}", "title": "" }, { "docid": "8af6f3b35e18b992c47538a46097fe32", "score": "0.51919806", "text": "gettingItems () {\n let temp = []\n let bottomLimit = this.currentPage - 2\n let topLimit = this.currentPage + 2\n let showing = 5\n if (bottomLimit <= 0) {\n bottomLimit = 1\n topLimit = 5\n }\n if (topLimit >= this.lastPage) {\n bottomLimit = this.lastPage - 4\n topLimit = this.lastPage\n }\n if (this.lastPage < 5) {\n showing = this.lastPage\n }\n if (bottomLimit <= 0) {\n bottomLimit = 1\n }\n if (this.lastPage === 0 || this.lastPage === 1) {\n showing = 1\n }\n for (let i = 0; i < showing; i++) {\n temp[i] = i + bottomLimit\n }\n return temp\n }", "title": "" }, { "docid": "c94a06a4cc94dad94dff97f74b59cc27", "score": "0.5179933", "text": "function reRangeList(currentList, index) {\n var elStyle, newTop, currentTop, offset;\n\n for (var i = 0; i < currentList.length; i++) {\n var el = document.getElementById('decision-' + currentList[i].id);\n\n if (!el) return;\n\n offset = i * AppListConstant.OFFSET_Y_BOTTOM;\n newTop = sumArrayIndex(currentList, i) + offset + 'px';\n elStyle = window.getComputedStyle(el, null);\n\n if (elStyle) {\n currentTop = elStyle.getPropertyValue('top');\n if (newTop !== currentTop) el.style.top = newTop;\n }\n }\n }", "title": "" }, { "docid": "debba38b99f47af638aaf44975d57fa2", "score": "0.5170166", "text": "function positionLozenges() {\n return cosmo.view.cal.itemRegistry.each(positionLozenge);\n }", "title": "" }, { "docid": "ab3aed040a4ac0febc932d57cbafc5d6", "score": "0.5156071", "text": "function showSliderValue() {\n rangeBullet.innerHTML = rangeSlider.value; \n const range = maxYear - minYear;\n var bulletPosition = (rangeSlider.value - minYear) / range;\n rangeBullet.style.left = (bulletPosition * 578) + \"px\";\n }", "title": "" }, { "docid": "be14dc224eb69ab52091eb0e50ae0c8e", "score": "0.51506317", "text": "function showPage(listOfStudents, paginationPageSelected) {\r\n //if the first paginatinon button is selected the last index = 9, if the second pagination button is selected the last index = 19 etc\r\n const lastIndexToDisplay = (paginationPageSelected*10)-1;\r\n const firstIndexToDisplay = lastIndexToDisplay - 9;\r\n //make list items are hidden\r\n for(let i=0; i < list.length; i+=1) {\r\n document.querySelector('ul.student-list').children[i].style.display = 'none'//hides all\r\n }\r\n // of the matchedList, make sure that the onces within the selected index are revealed\r\n for(let i=0; i < listOfStudents.length; i+=1) {\r\n if(i >= firstIndexToDisplay && i <= lastIndexToDisplay) {\r\n // if the index of the matchedList is in the required range, reveal it!!!\r\n listOfStudents[i].style.display= '';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "f727d85faefd5c88d4090fe178a97562", "score": "0.51471895", "text": "function setEvenItemPageNavigate(item, list) {\n item.addEventListener('click', function () {\n let ul = document.getElementById('itemPage');\n itempage = item.firstChild.innerHTML;\n tbody.innerHTML = '';\n setList(list, itempage);\n if (list.length % 10 == 0) {\n totaltemp = list.length / 10;\n } else {\n totaltemp = parseInt(list.length / 10) + 1;\n }\n if (totaltemp <= 5) {\n itemnavigate = 1;\n setPageNavigation(list);\n } else {\n if (itempage <= 3) {\n itemnavigate = 1;\n setPageNavigation(list);\n } else if (itempage >= totaltemp - 2) {\n itemnavigate = totaltemp - 4;\n setPageNavigation(list);\n } else {\n if (parseInt(ul.firstChild.firstChild.innerHTML) + 3 == itempage && parseInt(ul.lastChild.firstChild.innerHTML) - 1 == itempage) {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML) + 1;\n setPageNavigation(list);\n } else if (itempage == ul.lastChild.firstChild.innerHTML) {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML) + 2;\n setPageNavigation(list);\n } else if (itempage == ul.firstChild.firstChild.innerHTML) {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML) - 2;\n setPageNavigation(list);\n } else if (parseInt(ul.firstChild.firstChild.innerHTML) + 1 == itempage && parseInt(ul.lastChild.firstChild.innerHTML) - 3 == itempage) {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML) - 1;\n setPageNavigation(list);\n } else if (parseInt(ul.firstChild.firstChild.innerHTML) + 2 == itempage && parseInt(ul.lastChild.firstChild.innerHTML) - 2 == itempage) {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML);\n setPageNavigation(list);\n }\n }\n }\n });\n}", "title": "" }, { "docid": "c53a98aa3af0d1d39718ceba85fd0d7d", "score": "0.5135147", "text": "function showRange() {\r\n\tdisplay.innerHTML = '(' + localStorage[\"rate\"].substring(localStorage[\"dslFrom\"], localStorage[\"dslTo\"]) + ')';\r\n}", "title": "" }, { "docid": "748c5d49dd02b5d49e6ee6245560ca1a", "score": "0.51071566", "text": "function showPage(list, page) {\n const startIndex = (page * numberOfItems) - numberOfItems;\n const endIndex = page * numberOfItems;\n for ( let i = 0; i < list.length; i++ ) {\n if ( i < startIndex || i >= endIndex ) { //condition to select 10 items per page. true if either of the conditions are true.\n list[i].style.display = 'none';\n } else {\n list[i].style.display = 'block';\n }\n }\n}", "title": "" }, { "docid": "c731c0ff8d4b53cb245cad5991e1f4ab", "score": "0.51069105", "text": "function showDenominations() {\n //query the helper table for a list of all denominations\n var queryText = encodeURIComponent(\"SELECT 'Denomination' FROM 420855 {ORDER BY 'Denomination' {ASC}} \");\n var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText);\n \n //send the resulting list to getData()\n query.send(getData);\n}", "title": "" }, { "docid": "b19c4f87716ead9e628ffc30b8bb4376", "score": "0.5088482", "text": "function createList (jsonUrl) { \n\n d3.json(`${jsonUrl}`, function(error, response) {\n\n if (error) return console.warn(error);\n\n console.log(response);\n\n if (firstLoad == true) {\n\n minVal.push(response[0]);\n maxVal.push(response[1]);\n\n minVal = minVal[0];\n maxVal = maxVal[0];\n\n initFilters(bedSlider, minVal.beds, maxVal.beds, minVal.beds, maxVal.beds); \n initFilters(bathSlider, minVal.baths, maxVal.baths, minVal.baths, maxVal.baths);\n initFilters(priceSlider, minVal.price, maxVal.price, minVal.price, maxVal.price);\n initFilters(sqftSlider, minVal.sq_ft, maxVal.sq_ft, minVal.sq_ft, maxVal.sq_ft);\n initFilters(yearSlider, minVal.year_built, maxVal.year_built, minVal.year_built, maxVal.year_built);\n initFilters(moneySqftSlider, minVal.money_per_sq_ft, maxVal.money_per_sq_ft, minVal.money_per_sq_ft, maxVal.money_per_sq_ft);\n initFilters(hoaSlider, minVal.hoa_per_month, maxVal.hoa_per_month, minVal.hoa_per_month, maxVal.hoa_per_month);\n };\n\n firstLoad = false;\n\n inputConnection(bedParam);\n inputConnection(bathParam);\n inputConnection(priceParam);\n inputConnection(sqftParam);\n inputConnection(yearParam);\n inputConnection(moneySqFtParam);\n inputConnection(hoaParam);\n\n response = response.slice(2);\n\n d3.select(\".list-group\").selectAll(\"li\").remove()\n\n // Creates scrolling list NOW WITH BUTTONS!\n var scrollListRow = d3.select(\".list-group\").selectAll(\"li\")\n .data(response, function(d) { return d[\"id\"];})\n .enter()\n .append(\"li\")\n .classed(\"list-group-item row\", true);\n\n scrollListRow.append(\"label\")\n .classed(\"col-md-1 scroll-list scroll-list-left\", true)\n .attr('for',function(d){ return \"a\"; })\n .append(\"input\")\n .attr(\"unchecked\", true)\n .attr(\"type\", \"checkbox\")\n .attr(\"id\", \"c\")\n .on(\"click\", function(d) { return console.log(d[\"address\"]); });\n\n scrollListRow.append(\"span\")\n .html(function(d) {\n return `\n <a class=\"col-md-3 scroll-list\" href=\"/search?id=${d[\"id\"]}\"> ${d[\"address\"]} </a>\n <a class=\"col-md-2 scroll-list\" href=\"/search?id=${d[\"id\"]}\"> ${d[\"location\"]} </a> \n <a class=\"col-md-2 scroll-list\" href=\"/search?id=${d[\"id\"]}\"> $${d[\"price\"]} </a>\n <a class=\"col-md-1 scroll-list\" href=\"/search?id=${d[\"id\"]}\"> ${d[\"beds\"]} </a>\n <a class=\"col-md-1 scroll-list\" href=\"/search?id=${d[\"id\"]}\"> ${d[\"baths\"]} </a>\n <a class=\"col-md-2 scroll-list\" href=\"/search?id=${d[\"id\"]}\"> ${d[\"sq_ft\"]} Sq. Ft. </a>`\n });\n\n /// JUSTIN 2 of 2 \n var ndx = crossfilter(response);\n var all = ndx.groupAll();\n\n var propTypeDim = ndx.dimension(function (d){\n return d[\"property_type\"];\n });\n var zipTypeDim = ndx.dimension(function (d){\n return d[\"location\"];\n });\n var idTypeDim = ndx.dimension(function (d){\n return d[\"id\"];\n });\n // scatter\n var scatterDim = ndx.dimension(function (d){\n return [d[\"sq_ft\"],d[\"price\"]]\n });\n var allDim = ndx.dimension(function(d) {return d;});\n\n \n var propTypeGroup = propTypeDim.group();\n var zipTypeGroup = zipTypeDim.group();\n var idTypeGroup = idTypeDim.group();\n // scatter\n var scatterGroup = scatterDim.group();\n\n\n\n propTypeChart\n .width(500)\n .height(250)\n .dimension(propTypeDim)\n .group(propTypeGroup)\n .elasticX(true);\n \n\n zipTypeChart\n .width(500)\n .height(250)\n .dimension(zipTypeDim)\n .group(zipTypeGroup)\n .elasticX(true)\n .data(function (group){\n return group.top(10)\n });\n\n chart\n .width(550)\n .height(275)\n .dimension(scatterDim)\n .group(scatterGroup)\n .symbolSize(9)\n // .elasticX(true)\n .yAxisPadding(500)\n .xAxisPadding(100)\n .yAxisLabel([\"Price\"])\n .xAxisLabel(\"Square Feet\")\n .margins({top: 10, right: 20, bottom: 50, left: 80})\n // .renderlet(function (chart) {\n // chart.selectAll(\"g.x text\")\n // .attr('dx', '-30')\n // .attr('transform', \"rotate(-90)\");\n // })\n // .xAxis([0, 1000, 2000, 3000, 4000, 5000])\n .x(d3.scale.linear().domain([25, 6508]))\n .yAxis().ticks(10).tickFormat(function (v) {\n return \"$\" + v;});\n // .y(d3.scale.linear().domain([0, 100]));\n\n visCount\n .dimension(ndx)\n .group(all);\n \n visTable \n .dimension(idTypeDim)\n .group(function(d) {\n return d[\"id\"];\n })\n .columns([\n {\n label: \"PROPERTY TYPE\",\n format: function (d){ return d[\"id\"]}\n },\n {\n label: \"PROPERTY TYPE\",\n format: function (d){ return d[\"property_type\"]}\n },\n {\n label: \"ADDRESS\",\n format: function (d){ return d[\"address\"]}\n },\n {\n label: \"CITY\",\n format: function (d){ return d[\"city\"]}\n },\n {\n label: \"STATE\",\n format: function (d){ return d[\"state\"]}\n },\n {\n label: \"ZIP\",\n format: function (d){ return d[\"zip_\"]}\n },\n {\n label: \"PRICE\",\n format: function (d){ return d[\"price\"]}\n },\n {\n label: \"BEDS\",\n format: function (d){ return d[\"beds\"]}\n },\n {\n label: \"BATHS\",\n format: function (d){ return d[\"baths\"]}\n },\n {\n label: \"LOCATION\",\n format: function (d){ return d[\"location\"]}\n },\n {\n label: \"SQUARE FEET\",\n format: function (d){ return d[\"sq_ft\"]}\n },\n {\n label: \"URL\",\n format: function (d){ return d[\"url\"]}\n }\n ])\n .on('renderlet', function (table) { // update map with locations to match filtered data\n table.select('tr.dc-table-group').remove();\n mapMarkers.clearLayers();\n _.each(allDim.top(Infinity), function (d) {\n var addy = d.address;\n var marker = L.marker([d.lat, d.lon]);\n marker.bindPopup(\"<u/>\" +\n \"<li>\" + \"Sales Price: \" + \"$\" + d.price + \"</li>\" +\n \"<li>\" + \"Sq Feet: \" + d.sq_ft + \"</li>\" +\n \"<li>\" + \"Address: \" + addy + \", \" + d.city + \" \" + d.state + \" \" + \"</li>\" +\n \"<li>\" + \"Neighborhood: \" + d.location + \"</li>\" +\n \"<li>\" + \"Property Type: \" + d.property_type + \"</li>\" +\n \"<li>\" + \"Days on Market: \" + d.days_on_market + \"</li>\" +\n \"<li>\" + \"Year Built: \" + d.year_built + \"</li>\" +\n \"<li>\" + \"<a href=\" + d.url + \">Visit Redfin Listing for more information!\" + \"</a>\" + \"</li>\" \n );\n mapMarkers.addLayer(marker);\n });\n myMap.addLayer(mapMarkers);\n myMap.fitBounds(mapMarkers.getBounds());\n });\n // Justin 2 of 2 END\n \n\n dc.renderAll();\n\n });\n\n}", "title": "" }, { "docid": "a95338d5eb522b20485f8ff7c713c921", "score": "0.5086123", "text": "function showPages(listParameter, pageClicked) {\n // remove all studets \n for (i = 0; i < list.length; i++) {\n list[i].style.display = \"none\"\n }\n\n // display appropraite students\n let startIndex = (pageClicked * 10) - 10\n let endIndex = pageClicked * 10\n for (i = startIndex; i < endIndex; i++) {\n if (listParameter[i] != undefined) {\n listParameter[i].style.display = \"block\"\n }\n }\n}", "title": "" }, { "docid": "b20d5cd0715d38e5b0758a780e492b0f", "score": "0.5063377", "text": "function range(start, end, step=1) {\n // Your code here\n var list = [];\n var counter = 0;\n if(typeof step === \"undefined\"){\n step = 1;\n }\n for(var i = start; i!=end+step; i= i+step){\n list[counter] = i;\n counter++;\n }\n return list;\n}", "title": "" }, { "docid": "19f525ace0fd37d47897ef1f41cb92b2", "score": "0.5061829", "text": "function LoadDurationMappingLowerRange(voices, voiceTotal) {\n if (voiceTotal == 1) {\n $('[id^=dMappingPanel1]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dRange1]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayLowerBound);\n });\n }\n else if (voiceTotal == 2) {\n $('[id^=dMappingPanel2]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dRange2]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayLowerBound);\n });\n }\n else if (voiceTotal == 3) {\n $('[id^=dMappingPanel3]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dRange3]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayLowerBound);\n });\n }\n else if (voiceTotal == 4) {\n $('[id^=dMappingPanel4]').ready(function () {\n var $panel = $(this);\n var $UpperBound = $panel.find('[id^=dRange4]');\n $UpperBound.val(voices[voiceTotal - 1].durationMappingArrayLowerBound);\n });\n }\n}", "title": "" }, { "docid": "5a060630501cbe8b7687520bfc889917", "score": "0.50528246", "text": "function getValuesAndSetupHomepage(inputId, itemPrice, min, max, rowIndex){\r\n\t\tamount = parseInt($(inputId).val());\r\n\t\tif(amount != NaN && amount <= max && amount >= min){\r\n\t\t\tsetHTML(rowIndex, itemPrice * amount);\r\n\t\t\treturn amount;\r\n\t\t} // end if\r\n\t\treturn -1;\r\n\t}", "title": "" }, { "docid": "578b93a02bae0229efad13613672891f", "score": "0.5036082", "text": "displaySetup(page,list){\n const end = ( (page*8+8<list.length)?(page*8+8) : list.length )\n this.setState({lastInd: end});\n return(list.slice((page*8), end));\n }", "title": "" }, { "docid": "ca1bfb9cfb92577f28d3b42552fe9c93", "score": "0.50236493", "text": "function listPages(total_plants, on_page_num, isSearched) {\n\n const total_pages = Math.floor(total_plants / 20),\n subtracted = total_pages - on_page_num;\n\n let num_pages = [],\n limit_bounds = [-1, 4];\n let old_pages = document.querySelectorAll('button');\n let switched = false;\n\n // hide all the detail-related elements\n plant_detail.style.display = 'none';\n plant_detail_wrapper.style.display = 'none';\n\n // check for any old buttons before loading new ones\n if (old_pages.length > 0) {\n\n // remove them\n removeElements(old_pages);\n } \n\n // current page number is less than 20321\n if (on_page_num <= total_pages) {\n\n // change the currently selected page to one\n // so that the for loop below won't start with a negative number\n if (on_page_num === 0) {\n on_page_num = 1;\n switched = true;\n }\n\n // check if the current page reaches the 4 ending pages (upper limit)\n if (on_page_num > total_pages - 4) {\n\n // both limits will drop\n // upper limit should always be negative\n limit_bounds[0] = subtracted - 5;\n\n // lower limit should always be positive\n limit_bounds[1] = subtracted;\n }\n \n // create pages section at the bottom of a page\n // the loop starts with a page before the currently selected page\n // as the page progresses to the 4 ending pages, the index will start doing the calculation\n // so that, there is less numbers left on the right hand side and more on the left hand side of the selected page\n for (let i = on_page_num + limit_bounds[0]; i < on_page_num + limit_bounds[1]; i++) {\n\n // show the number of pages\n num_pages[i] = document.createElement('button');\n num_pages[i].innerHTML = i + 1;\n num_pages[i].className = 'page_number';\n pages.appendChild(num_pages[i]);\n\n // listen for a click event on one of the page numbers\n num_pages[i].addEventListener('click', async function () {\n\n // if the workflow chain starts with a search\n if (isSearched) {\n\n // re-start the workflow, with a selected page index passed in \n // to get started from there instead of going back from scratch \n await searchPlants(i + 1, i); \n\n // otherwise\n } else {\n\n // same logic\n await getPlants(i + 1, i);\n } \n \n // scroll the page to the top again\n window.scrollTo({ top: 0, behavior: 'smooth' });\n });\n\n // wait till the loop gets to the last element of the array\n if (i === on_page_num + limit_bounds[1] - 1) {\n\n const index = getModifiedIndexNumber(on_page_num, switched);\n \n // change the style of the currently selected button\n num_pages[index].style.backgroundColor = 'rgba(176, 245, 48, 0.699)';\n num_pages[index].style.fontSize = '10px';\n }\n }\n }\n}", "title": "" }, { "docid": "3810490b7920099e3e7110618b29b37d", "score": "0.50205624", "text": "@expression(\"items <start> to <end> of <List>\", { types: [ Integer, Integer, List ], returns: List })\n\tstatic range(list, start, end) {\n\t\tif (!(list instanceof List)) return undefined\n\t\tif (!(start instanceof Integer)) return undefined\n\t\tif (!(end instanceof Integer)) return undefined\n\n\t\tif (end === undefined) end = list.items.length\n\t\tlet duplicate = List.duplicate(list)\n\t\tduplicate.items = list.items.slice(list, start - 1, end)\n\t\treturn duplicate\n\t}", "title": "" }, { "docid": "6be896aa8e001c47d1aa7b652f179585", "score": "0.50126797", "text": "function computeThisPageList()\n{\n thisPageList.length = 0;\n if (currentPage < pageAmount)\n for (var i = 0; i < maxPageAmount; i++)\n thisPageList.push(taskList[maxPageAmount * (currentPage - 1) + i]);\n else\n for (var i = 0; i < (taskAmount % maxPageAmount); i++)\n thisPageList.push(taskList[maxPageAmount * (currentPage - 1) + i]);\n\n showDetail();\n}", "title": "" }, { "docid": "712c87f54ae71e225682a62dd244d9cc", "score": "0.50080407", "text": "function showMoreItemsPerPageDOM() {\n setTimeout(function() {\n $('#Grid, #GridLocations, #grid').find('.t-dropdown-wrap.t-state-default, .k-dropdown-wrap.k-state-default').click();\n $('.t-animation-container .t-item:contains(50), .k-animation-container .k-item:contains(50)').click();\n }, 770);\n }", "title": "" }, { "docid": "be721bbf16e4645c668229a6b6a035dd", "score": "0.49842823", "text": "function showPage (pageNumber, studentList) {\n hideList(studentList);\n for(let i = 1; i <= studentList.length; i++) {\n const li = studentList[i - 1];\n if(i >= getLowerRange(pageNumber) &&\n i <= getUpperRange(pageNumber))\n li.style.display = '';\n }\n}", "title": "" }, { "docid": "edcfab1b7155581e953cc56eb0401f64", "score": "0.49681318", "text": "function showOverpanel(pullFrom, slotName, pageNum) {\n //console.log(\"Overpanel Function Acitvted\");\n var itemsPerPage = columns * rows;\n var start = pageNum * itemsPerPage;\n if (start == pullFrom.length - 1)\n start -= 3;\n var stopHere = pullFrom.length;\n if (pageNum < 0 || start > stopHere) {\n //console.log(\"Page number is less than 0 or the start number is beyond stophere\");\n return 0;\n }\n var i;\n var j;\n var itemRarity;\n var itemCount = start;\n document.getElementById(\"overpanel\").style.display = \"block\";\n var finalHTML = \"<table id=\" + toHTML(\"opTable\") + \">\";\n for (i = 0; i < rows; i++) {\n if (itemCount >= stopHere)\n break;\n finalHTML += \"<tr>\"\n for (j = 0; j < columns; j++) {\n itemRarity = pullFrom[itemCount].rarity;\n finalHTML += \"<th class=\" + toHTML(\"cellcontainer\") + \"onclick=\" + toHTML(\"siteManager.guiSelectItem(siteManager.sManager.\" + slotName + \", \" + pullFrom[itemCount].pKey + \")\") + \"><div class=\" + toHTML(\"holdicon\") + \" style=\" + toHTML(\"background-color:\" + getColor(itemRarity)) + \"><img src=\" + toHTML(filePath + pullFrom[itemCount].icon) + \"></div><div class=\" + toHTML(\"holdname\") + \">\" + pullFrom[itemCount].name + \"</div></th>\";\n itemCount++;\n if (itemCount >= stopHere) {\n finalHTML += \"</tr>\";\n break;\n }\n }\n }\n finalHTML += \"</table><table id=\" + toHTML(\"bottomNav\") + \"><tr><th class=\" + toHTML(\"menuNav\") + \" onclick=\" + toHTML(\"clickedPrev(\" + pageNum + \", siteManager.sManager.\" + slotName + \")\") + \">&lt; PREV</th><th class=\" + toHTML(\"menuBlank\") + \"onclick=\" + toHTML(\"clickedClear(siteManager.sManager.\" + slotName + \")\") + \">CLEAR</th><th class=\" + toHTML(\"menuClose\") + \" onclick=\" + toHTML(\"clickedClose()\") + \">CLOSE</th><th class=\" + toHTML(\"menuNav\") + \" onclick=\" + toHTML(\"clickedNext(\" + pageNum + \", \" + \"siteManager.sManager.\" + slotName + \")\") + \">NEXT &gt;</th></tr></table>\";\n //console.log(finalHTML);\n document.getElementById(\"overpanel\").innerHTML = finalHTML;\n}", "title": "" }, { "docid": "d4bddb8fea5014e74fb7f97f1d066a16", "score": "0.4967304", "text": "function wpbc_do_slider_range(range){\n\t\tvar rangeSliderJQ = range.find('.slider-range');\n\t\t\n\t \tvar rangeSlider = rangeSliderJQ.get(0); \n\t \tif(!rangeSlider) return;\n\n\t \tvar deffaults_moneyFormat = {\n\t\t decimals: 0,\n\t\t thousand: '.',\n\t\t prefix: 'USD'\n\t\t };\n\n\t \tvar data_money_format = range.data('money-format') ? range.data('money-format') : deffaults_moneyFormat; \n\t \t\n\t \tvar moneyFormat = wNumb(data_money_format);\n\n\t \tvar deffaults_sliderArgs = {\n\t\t\t start: [500000, 1000000],\n\t\t\t step: 1000,\n\t\t\t range: {\n\t\t\t 'min': [100000],\n\t\t\t 'max': [1000000]\n\t\t\t },\n\t\t\t rangeLabels: {\n\t\t\t \t'min': 'Min:',\n\t\t\t \t'max': 'Max:'\n\t\t\t },\n\t\t\t hideRangeLabels: false,\n\t\t\t format: moneyFormat,\n\t\t\t connect: true\n\t\t\t }; \n\n\t\tvar data_range_args = range.data('range-args'); \n\t\tif(data_range_args){\n\t\t\tvar sliderArgs = $.extend(deffaults_sliderArgs, data_range_args);\n\t\t}else{\n\t\t\tvar sliderArgs = deffaults_sliderArgs;\n\t\t} \n\n\t \n\t\tif( sliderArgs.rangeLabels && !sliderArgs.hideRangeLabels ){\n\t\t\tvar labels = range.append('<div class=\"range-labels\"/>');\n\t\t\t$.each(sliderArgs.range, function(e){ \n\t\t\t\tvar label = '<label><b>'+sliderArgs.rangeLabels[e]+' <span class=\"slider-range-'+ e +'\"></span></b></label>'; \n\t\t\t\trange.find('.range-labels').append( label );\n\t\t \t});\n\t \t} \n\t \tvar arr_range = Object.values(sliderArgs.range);\n\t \tvar arr_rageLabels = Object.values(sliderArgs.rangeLabels); \n\n\t \tnoUiSlider.create(rangeSlider, sliderArgs); \n\t\t \n\t\trangeSlider.noUiSlider.on('update', function(values, handle) { \n\n\t \t\t$.each(values, function(e,v){ \n\t\t \t\t$.each(sliderArgs.range, function(index, obj){ \n\t\t \t\t\tvar ii = arr_range.indexOf(obj); \n\t\t\t\t\tif(ii == e){\n\t\t\t\t\t\tvar output_values = '.slider-range-'+ index;\n\t\t\t\t\t\trange.find(output_values).html(v); \n\t\t\t\t\t\tvar output_inputs = range.data('input-'+index);\n\t\t\t\t\t\t$(output_inputs).val( moneyFormat.from(v) ); \n\t\t\t\t\t}\n\t\t\t \t});\n\t\t \t}); \n\t\t \n\t\t });\n\t}", "title": "" }, { "docid": "db5ab8c9dbb4b10ea9e8f1fb87582af9", "score": "0.49589372", "text": "function Ranking_pageshow() {\n\ttry {\n\t\t// Grab some users and display them.\n\t\tdrupalgap.views_datasource.call({\n\t\t\t'path': 'drupalgap/views_datasource/padel_ranking',\n\t\t\t'success': function(data) {\n\t\t\t\t// Extract the users into items, then drop them in the list.\n\t\t\t\tvar rows = [];\n\t\t\t\tvar rank = 0;\n\t\t\t\t$.each(data.ranking, function(index, object) {\n\t\t\t\t\trank = rank + 1;\n\t\t\t\t\tvar pos = object.position;\n\t\t\t\t\trows.push([rank, \n\t\t\t\t\t l(pos.team,\"leage/matches/?team=\" + pos.team), \n\t\t\t\t\t pos.Jugados, pos.Ganados, pos.Perdidos, pos.SetsFavor, pos.SetsContra]);\n\n\t\t\t\t});\n\t\t\t\tdrupalgap_table_populate('#Ranking_list', rows);\n\t\t\t}\n\t\t});\n\t\tconsole.log( $('#Ranking_list').html());\n\t}\n\tcatch (error) { console.log('Ranking_pageshow - ' + error); }\n}", "title": "" }, { "docid": "be141be2d86ee2d95eb73c529f7f5e0d", "score": "0.4934686", "text": "function setItemValue(pTypeL, index, pActionTypeL, restrictByLease){\n var selectedId = rplmTypeController.itemId;\n var action = rplmTypeController.action;\n\t\n View.openDialog('ab-rplm-bldgproplist.axvw', null, true, {\n width: 800,\n height: 600,\n closeButton: false,\n afterInitialDataFetch: function(dialogView){\n var dialogController = dialogView.controllers.get('abRplmBldgPropList');\n dialogController.selectedType = pTypeL;\n dialogController.selectedId = selectedId;\n dialogController.openerController = rplmTypeController;\n if (pTypeL == 'BUILDING') {\n dialogController.gridBuildingList.show(true, false);\n if(restrictByLease && action == 'EDIT'){\n\t\t\t\t\tdialogController.gridBuildingList.addParameter('restricByLease', ' bl.bl_id in (select distinct ls.bl_id from ls)');\n\t\t\t\t}\n\t\t\t\tdialogController.gridBuildingList.refresh();\n dialogController.gridBuildingList.setTitle(getMessage('title_building'));\n dialogController.gridPropertyList.show(false, true);\n }\n if (pTypeL == 'LAND' || pTypeL == 'STRUCTURE' || pTypeL == 'PROPERTY') {\n dialogController.gridBuildingList.show(false, true);\n dialogController.gridPropertyList.show(true, false);\n\t\t\t\tif(restrictByLease && action == 'EDIT'){\n\t\t\t\t\tdialogController.gridPropertyList.addParameter('restricByLease', ' property.pr_id in (select distinct ls.pr_id from ls)');\n\t\t\t\t}\n\t\t\t\tdialogController.gridPropertyList.refresh();\n if (pTypeL == 'LAND') {\n dialogController.gridPropertyList.refresh('property.property_type = \\'Land\\'');\n dialogController.gridPropertyList.setTitle(getMessage('title_land'));\n }\n if (pTypeL == 'STRUCTURE') {\n dialogController.gridPropertyList.refresh('property.property_type = \\'Structure\\'');\n dialogController.gridPropertyList.setTitle(getMessage('title_structure'));\n }\n if (pTypeL == 'PROPERTY') {\n dialogController.gridPropertyList.setTitle(getMessage('title_property'));\n }\n }\n dialogController.restoreSelection();\n }\n });\n}", "title": "" }, { "docid": "9c32acbfe90c67a4645545c6aabdf734", "score": "0.49319223", "text": "rangeQuery( l, r) {\n return (r + 1) * this.sum( r,this.B1) - this.sum( r,this.B2) \n - (l * this.sum( l - 1,this.B1) - this.sum( l - 1,this.B2));\n }", "title": "" }, { "docid": "afa0e6c683fcf1cfff57d9d80f6ef373", "score": "0.49295312", "text": "calc_range() {\n let z = this.zoom / this.drug.z\n let zk = (1 / z - 1) / 2\n\n let range = this.y_range.slice()\n let delta = range[0] - range[1]\n range[0] = range[0] + delta * zk\n range[1] = range[1] - delta * zk\n\n return range\n }", "title": "" }, { "docid": "62b4c1772eea03bf4594953b84efc33c", "score": "0.49264488", "text": "function showItemsFor(ctx){\n\tvar selectedRow = ctx.row;\n\tvar dataSource = ctx.grid.getDataSource();\n\tvar selection = []; \n\t// get group by selection from datasource definition\n\tdataSource.fieldDefs.each(function(fieldDef){\n\t\tif (fieldDef.groupBy) {\n\t\t\t//var fieldId = fieldDef.id;\n\t\t\t// we must read column name from parameters\n\t\t\tvar paramName = fieldDef.id.substr(fieldDef.id.indexOf('.')+1);\n\t\t\tvar columnId = selectedRow.panel.parameters[paramName];\n\t\t\tvar fieldValue = selectedRow.getFieldValue(fieldDef.id);\n\t\t\tselection.push({id: columnId, value: fieldValue});\n\t\t}\n\t});\n\tvar controller = View.controllers.get(\"abRepmPfadminItemsByLocationController\");\n\tcontroller.showPortfolioItemsFor(selection);\n}", "title": "" }, { "docid": "3fde2960afc3fc16f3e2d1e00d989a88", "score": "0.4925351", "text": "function getRangeIndex(scrollPtg, itemCount, visibleCount) {\n var _getLocationItem = getLocationItem(scrollPtg, itemCount),\n index = _getLocationItem.index,\n offsetPtg = _getLocationItem.offsetPtg;\n\n var beforeCount = Math.ceil(scrollPtg * visibleCount);\n var afterCount = Math.ceil((1 - scrollPtg) * visibleCount);\n return {\n itemIndex: index,\n itemOffsetPtg: offsetPtg,\n startIndex: Math.max(0, index - beforeCount),\n endIndex: Math.min(itemCount - 1, index + afterCount)\n };\n}", "title": "" }, { "docid": "3fde2960afc3fc16f3e2d1e00d989a88", "score": "0.4925351", "text": "function getRangeIndex(scrollPtg, itemCount, visibleCount) {\n var _getLocationItem = getLocationItem(scrollPtg, itemCount),\n index = _getLocationItem.index,\n offsetPtg = _getLocationItem.offsetPtg;\n\n var beforeCount = Math.ceil(scrollPtg * visibleCount);\n var afterCount = Math.ceil((1 - scrollPtg) * visibleCount);\n return {\n itemIndex: index,\n itemOffsetPtg: offsetPtg,\n startIndex: Math.max(0, index - beforeCount),\n endIndex: Math.min(itemCount - 1, index + afterCount)\n };\n}", "title": "" }, { "docid": "7078ff3d2d57c193c8d38cc18d512471", "score": "0.49240693", "text": "getGatedItems(cb, { offset=0, limit=0 }={}) {\n this.session.get({\n url: this.url + '/api/filter/gated',\n qs: { offset, limit },\n }, cb);\n }", "title": "" }, { "docid": "f5a3d78186a0716ca93e8a6ab173bec9", "score": "0.49224383", "text": "customRange() {\n\t\t$(\".range-wrap\").each(function () {\n\t\t\tlet _this = $(this);\n\t\t\tvar $d3 = _this.find(\".slider-js\");\n\n\t\t\tvar slider = $d3.ionRangeSlider({\n\t\t\t\tskin: \"round\",\n\t\t\t\ttype: \"double\",\n\t\t\t\tgrid: false,\n\t\t\t\tgrid_snap: false,\n\t\t\t\thide_min_max: true,\n\t\t\t\thide_from_to: true,\n\t\t\t\tonStart: function (data) {\n\t\t\t\t\t_this.find('.minus').val(data.from);\n\t\t\t\t\t_this.find('.plus').val(data.to);\n\t\t\t\t},\n\t\t\t\tonChange: function (data) {\n\t\t\t\t\t_this.find('.minus').val(data.from);\n\t\t\t\t\t_this.find('.plus').val(data.to);\n\t\t\t\t},\n\t\t\t\tonFinish: function (data) {\n\t\t\t\t\t_this.find('.minus').val(data.from);\n\t\t\t\t\t_this.find('.plus').val(data.to);\n\t\t\t\t},\n\t\t\t\tonUpdate: function (data) {\n\t\t\t\t\t_this.find('.minus').val(data.from);\n\t\t\t\t\t_this.find('.plus').val(data.to);\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar $d3_instance = slider.data(\"ionRangeSlider\");\n\t\t\t$(this).on('change input cut copy paste', '.minus', function () {\n\t\t\t\tvar th = $(this);\n\t\t\t\tvar data = th.val();\n\t\t\t\tvar min = +data;\n\t\t\t\t// th.val(data + ' т')\n\t\t\t\tconsole.log(1);\n\t\t\t\t$d3_instance.update({\n\t\t\t\t\tfrom: min,\n\t\t\t\t})\n\t\t\t});\n\n\t\t\t$(this).on('change input cut copy paste', '.plus', function () {\n\t\t\t\tvar th = $(this);\n\t\t\t\tvar data = th.val();\n\t\t\t\tvar max = +data;\n\n\t\t\t\t//max => new val of max inp\n\t\t\t\t//min => value of the min inp\n\n\t\t\t\tlet min = Number(document.querySelector('.range-result.range-result--minus.minus').value);\n\t\t\t\tif (min >= max) {\n\t\t\t\t\tmin = 0;\n\t\t\t\t\t$d3_instance.update({\n\t\t\t\t\t\tfrom: min,\n\t\t\t\t\t\tto: max,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$d3_instance.update({\n\t\t\t\t\t\tto: max,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\t// $d3.on(\"change\", function () {\n\t\t\t// \tvar $inp = $(this);\n\t\t\t// \tvar from = $inp.prop(\"value\"); // reading input value\n\t\t\t// \tvar from2 = $inp.data(\"from\"); // reading input data-from attribute\n\n\t\t\t// \t_this.find('range-result--minus').val(from); // FROM value\n\t\t\t// \t_this.find('range-result--plus').val(from); // FROM value\n\t\t\t// });\n\n\n\t\t})\n\t}", "title": "" }, { "docid": "8f944a723668e26958a60221269b165a", "score": "0.49121118", "text": "function gSrangeFromList(list,begin,end) {\n return list.slice(begin,end+1)\n}", "title": "" }, { "docid": "3ac9bf93d64150d62723f398982566e6", "score": "0.4904835", "text": "function range(nbr,min,max){if(nbr<min){return min;}else if(nbr>max){return max;}else{return nbr;}}", "title": "" }, { "docid": "336e93942ce288c69ee513e60d857d62", "score": "0.4901703", "text": "function rgXSlider__2__dragwrap_gen_list({\n rgX,\n orientation,\n nospinner,\n stdMod,\n }) {\n stdMod.customDraggers_list.push(\n ( function( medD8D ) {\n rgX.dragDecorColor= rgX.pcolor; //'#00aaba';\n sDomF.rgX_2_dragWrap({\n medD8D,\n rgX,\n orientation,\n nospinner,\n })\n })\n );\n //todm ... do automate\n stdMod.railsCustomSlidersCount = has( stdMod, 'railsCustomSlidersCount' ) ?\n stdMod.railsCustomSlidersCount + 1 : 1; \n }", "title": "" }, { "docid": "85ae07b8968c359262738833ff532947", "score": "0.48981258", "text": "function limit_and_composite( data )\n {\n var temp_index\n \n \n $(\"#listview\").empty();\n for( i = 0; i < data.length; i++ )\n {\n\t data[i].limit_std = parseInt( data[i].limit_std*conversion_factor*100)/100\n\t data[i].limit_avg = parseInt( data[i].limit_avg*conversion_factor*100)/100\n\t data[i].composite_avg = parseInt( data[i].composite_avg*conversion_factor*100)/100\n\t data[i].composite_std = parseInt( data[i].composite_std*conversion_factor*100)/100\n\t $(\"#listview\").append('<li><h5>'+generate_description( i , schedule_name)+\"<br>Flow Limits Avg: \"+data[i].limit_avg+\" Std: \"+data[i].limit_std+\"<br>Last Value Avg: \"+data[i].composite_avg+\n\t \" Std: \"+data[i].composite_std +\"</h5> </li>\")\n \n\t }\n $(\"#listview\").listview(\"refresh\"); \n }", "title": "" }, { "docid": "ad4ff44dd0a2d4e220fcb51424174af6", "score": "0.4889743", "text": "function displayRangeValue(e) {\n var span = e.target.parentElement.querySelector('span');\n span.textContent = e.target.value;\n\n}", "title": "" }, { "docid": "113aa713b614c652730f5d7602f2d775", "score": "0.48882788", "text": "function showPage(page,list) {\r\n const startIndex = (page * itemsPerPage) - itemsPerPage;\r\n const endIndex = page * itemsPerPage;\r\n //loop over the student list, print 10 student according the index position\r\n for(let i = 0; i < list.length; i++){\r\n if( i >= startIndex && i < endIndex){\r\n list[i].style.display = 'block';\r\n } else {\r\n list[i].style.display = 'none';\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a8fa8f35883a9f2cc3771209c5e41efe", "score": "0.48881015", "text": "addRange(high, low, mid) {\n this.range.push({\n 'high': high,\n 'low': low,\n 'mid': mid,\n })\n //return this.range\n }", "title": "" }, { "docid": "41e9dfd2fd6356052809ff85852c0397", "score": "0.48877752", "text": "function extendDisplayedItems() {\n var list = currentList();\n if (maxItemsDisplayed === null) {\n initMaxItemsDisplayed();\n } else {\n maxItemsDisplayed = Math.min(maxItemsDisplayed + ITEMS_IN_NEXT_BATCHES, nbItems(list));\n }\n // if (console.log) console.log(\"maxItemsDisplayed: \" + maxItemsDisplayed + \" / \" + nbItems(list));\n updateDisplay(list);\n }", "title": "" }, { "docid": "a0ff7fd86dcac4c7157040f78e9c5caa", "score": "0.48877525", "text": "function selectSplitTotal(){\n \n}", "title": "" }, { "docid": "5999b83bc31ba6e74386f729d80eeba1", "score": "0.488621", "text": "function fliter_price_items(db, min_price, max_price){\n document.querySelectorAll('.item_div').forEach(item =>{\n \n for (j=0; j<db.length; j++){\n if(db[j]['pk'].toString() === item.id){ // find div item in db\n item_price=db[j]['fields']['price'];\n \n if (item_price < min_price || item_price > max_price){\n item.style.display= \"none\";\n\n }else{\n item.style.display= \"flex\"\n\n }\n }\n }\n \n })\n }", "title": "" }, { "docid": "f595e2a685696b267b0e761034034467", "score": "0.48782778", "text": "function getLegendDataForCustomRangeReport(dateFrom, dateTo){\n\n //console.log(\"Global Report get Y data for custom chart Legend, from: \" + dateFrom+\", to: \"+dateTo);\n\n customRangeChartListModel.clear();\n var db = getDatabase();\n db.transaction(function(tx) {\n\n var rs = tx.executeSql(\"select a.current_amount, c.cat_name from (select id_category, sum(amount) as current_amount from expense e where date(e.date) <= date('\"+dateTo+\"') and date(e.date) >= date('\"+dateFrom+\"') group by id_category) a left join category c where a.id_category = c.id\");\n for(var i =0;i < rs.rows.length;i++){\n customRangeChartListModel.append(rs.rows.item(i));\n //console.log('Category name: '+rs.rows.item(i).cat_name+ \" have amount: \"+rs.rows.item(i).current_amount);\n }\n }\n );\n }", "title": "" }, { "docid": "b6058938df8207ef0c49d42675d6fe03", "score": "0.48750883", "text": "function livello (livello) {\n var range;\n switch (livello) {\n case (0):\n range = 100;\n break;\n case (1):\n range = 80;\n break;\n case (2):\n range = 50;\n break;\n }\n return range;\n}", "title": "" }, { "docid": "832fb70582c7e50e3272956eeb97177c", "score": "0.4870751", "text": "function tab() {\n\n var $wrap = $(\"#numWrap\"), $strip = $(\"#strip\"),\n $leftArrow = $(\".wrapper > .arrows\").first(),\n wrapWidth = $wrap.width(),\n margin = 10, left = 0; //declare variables for divs in which tabs are placed\n $strip.on(\"click\", \".numberItem\", function () { select($(this)); });\n $(\".wrapper\").on(\"click\", \"a.arrow\", function () { //wrapper is div with left and right arrows alongwith tabs\n var stripPos = $strip.position(); //strip is innerdiv of wrapper\n var height = $(\"#strip\").height(); //find height of strip div \n if (this.id == \"lft\") { //if left arrow is clicked\n if ($('#hdnCount').val() == 1) { //hdncount is a variable which is increment on right arrow click and decrement on left arrow click\n // //alert(height1);\n $('#lft').css(\"display\", \"none\"); //hide left arrow if data is not avaible on left side\n $('#rgt').css(\"display\", \"block\"); //hide right arrow if data is not avaible on right side\n }\n else {\n // //alert('jj');\n $('#lft').css(\"display\", \"block\"); //if hdncount is larger than one\n\n }\n if ($('#hdnCount').val() < 0) {\n $('#hdnCount').val(0);\n }\n var con;\n height = (height / 38); //becoz one scroll height is 38 so find the no. of scroll\n // //alert(height);\n if (height > 1 && height < 2) {\n con = -((wrapWidth / 2) * 2); //find the scrolling of strip\n }\n if (height >= 2) {\n con = -((wrapWidth / 2) * height); //wrapwidth is wrapper width\n } else {\n con = -((wrapWidth / 2));\n }\n\n var mov = stripPos.left + wrapWidth;\n if (((stripPos.left + wrapWidth) > 0 && (stripPos.left + wrapWidth) < 1)) {\n mov = -1;\n }\n var condition = ((wrapWidth * 2) / height);\n if (condition < 887 && condition > 885) {\n // //alert('gh');\n condition = 888;\n }\n // //alert('condition=' + condition);\n if (con <= (stripPos.left + wrapWidth) && (stripPos.left < condition)) { //condition for stopping left click if no data is available on left side\n if ($strip.width() - $wrap.width() > 0) {\n $strip.css({ \"left\": (stripPos.left + (wrapWidth / 2)) });\n }\n }\n // }\n $('#hdnCount').val(parseInt($('#hdnCount').val()) - 1); //decrement of hdncount on click on left arrow \n } else {\n var height1 = $(\"#strip\").height();\n height1 = (height1 / 38);\n //alert('height1=' + height1);\n var con;\n height = (height / 38);\n if (height > 1 && height < 2) {\n con = -((wrapWidth / 2) * 2);\n\n }\n if (height > 2) {\n ////alert('GH');\n con = ((wrapWidth / 2) * height);\n } else {\n con = ((wrapWidth / 2));\n }\n\n if ((parseInt(con + left) >= parseInt(wrapWidth / 2))) {\n if (stripPos.left == -425.5) {\n stripPos.left = -427;\n }\n ////alert('height1=' + height);\n //alert('hdncount=' + $('#hdnCount').val());\n if (height1 == 1 || height == 1) {\n // //alert('1');\n\n $('#rgt').css(\"display\", \"none\");\n $('#lft').css(\"display\", \"block\");\n }\n else {\n if (stripPos.left >= ((-425 * height) - 1)) {\n $strip.css({ \"left\": parseFloat(stripPos.left) - parseFloat(wrapWidth / 2) });\n height1 = $(\"#strip\").height() - 38;\n height1 = (height1 / 38);\n $('#rgt').css(\"display\", \"block\");\n if (height1 == 1 && $('#hdnCount').val() == 0) {\n //alert('height1=' + height1);\n //alert('hdncount=' + $('#hdnCount').val());\n $('#rgt').css(\"display\", \"none\");\n $('#lft').css(\"display\", \"block\");\n // //alert('2');\n // //alert($('#hdnCount').val());\n }\n else {\n $('#rgt').css(\"display\", \"block\");\n // //alert('3');\n }\n }\n }\n }\n\n $('#hdnCount').val(parseInt($('#hdnCount').val()) + 1);\n }\n });\n $('#strip ul li a').hover(function () { //on hover of tab store its left and top position in hiddenvariable\n var stripPos = $strip.position();\n var pos = $(this).position();\n $(this).css({ \"left\": pos.left });\n $(this).css({ \"top\": pos.top });\n // //alert(pos.left);\n $('#hdnleft').val(pos.left);\n $('#hdntop').val(pos.top);\n $('#hdntab').val(this.text);\n $('#hdnwidth').val(stripPos.left);\n\n });\n\n var arr = jQuery.makeArray($('#strip ul li a'));\n\n var flag = 0;\n var width = 0;\n $('#cbdb-menu_id').find('a').each(function () {\n if ($('#hdntab').val() != null) {\n if (this.text == $('#hdntab').val()) {\n\n flag = 1;\n }\n }\n if (flag != 1) {\n //width = $(this).innerWidth() + width;\n width = ($(this).width() + 32) + width;\n }\n if ($('#hdntab').val() != null) {\n if (this.text == $('#hdntab').val()) {\n }\n var height1 = $(\"#strip\").height();\n height1 = (height1 / 38);\n // //alert(height1);\n if (height1 != 1 && $('#hdnCount').val() == 0) {\n ////alert('12');\n $('#lft').css(\"display\", \"none\");\n ////alert('1');\n }\n else if (height1 == 1 && $('#hdnCount').val() > 0) {\n $('#rgt').css(\"display\", \"block\");\n }\n var left = $('#hdnleft').val();\n var top = $('#hdntop').val();\n var left1 = $('#hdnwidth').val();\n // var r = $('#<%= hdnIndex.ClientID %>').val();\n if (parseInt(left1) == 0 && $('#hdnCount').val() == 0) { //if tab's position in first scroll\n //$strip.css({ \"margin-left\": (-756 + left) });\n var num = -(parseFloat(width));\n ////alert('left=0');\n // //alert('width=' + width);\n $strip.css({ \"margin-left\": left1 });\n $(this).css({ \"left\": num })\n $(this).css({ \"top\": top })\n // //alert('case1');\n //alert('1');\n\n }\n else if (parseInt(left1) == 0 && $('#hdnCount').val() > 0) {//if in not in first scroll\n // //alert('tt');\n var $wrap = $(\"#numWrap\");\n var $p = $(\"#Strip\");\n var wrapWidth = $p.width() - $wrap.width();\n var p = (wrapWidth / 2);\n p = (parseFloat(p)) + \"px\";\n if ($('#hdnCount').val() > 2) { //second scroll\n p = parseFloat(p) * 3;\n p = (parseFloat(p)) + \"px\";\n // alert('2');\n\n }\n else if ($('#hdnCount').val() > 1) { //first scroll\n p = (wrapWidth / 2);\n p = parseFloat(p) * 2;\n p = (parseFloat(p)) + \"px\";\n //alert('3');\n\n }\n else {\n p = 0;\n //alert(p);\n }\n // //alert('p=' + p);\n // alert(p);\n // alert($('#hdnCount').val());\n $strip.css({ \"margin-left\": p }); //finally apply css for margin-left\n $(this).css({ \"left\": width })\n $(this).css({ \"top\": top })\n }\n\n else {\n\n var num = -(parseFloat(left1) + parseFloat(width));\n // var num = -(width);\n if (num != NaN)\n if ($('#hdnCount').val() > 2 && left1 > -(width / 2)) {\n left1 = left1 * 3;\n //alert('4');\n //alert('left1=' + left1);\n //alert('(width / 2)' + (width / 2));\n\n }\n else if ($('#hdnCount').val() > 1 && left1 > -(width / 2)) {\n left1 = left1 * 2;\n ////alert('5');\n\n\n }\n\n\n if ($('#hdnCount').val() < 1 && left1 > (width / 2)) {\n left1 = 0;\n ////alert('6');\n\n\n ////alert('case7');\n }\n else if ($('#hdnCount').val() < 2 && left1 > (width / 2)) {\n left1 = -parseFloat(left1);\n ////alert('case8');\n // //alert('7');\n\n }\n else if ($('#hdnCount').val() < 3 && left1 > (width / 2)) {\n left1 = -parseFloat(left1);\n ////alert('case9');\n ////alert('8');\n\n }\n else if ($('#hdnCount').val() > 2 && left1 < -(width / 2)) {\n left1 = left1;\n ////alert('case10');\n ////alert('9');\n\n }\n\n var p = left1 + \"px\";\n $strip.css({ \"margin-left\": p });\n $(this).css({ \"left\": width })\n $(this).css({ \"top\": top })\n }\n }\n });\n\n}", "title": "" }, { "docid": "dd1cd62475ede291aafe232b35fc0e52", "score": "0.48608863", "text": "createVisualBoundaries() {\n this.groups.forEach(item => {\n if (item.id != ID_GROUP_TOTAL) {\n this.items.add({\n group: item.id,\n start: item.end,\n end: item.end,\n type: \"background\"\n });\n }\n });\n }", "title": "" }, { "docid": "09a3dabf1c4b8ff8e71b3f46f3623561", "score": "0.48552433", "text": "function displayPagination() {\n venuePaginationEl.empty();\n venuePaginationEl.append(`<li id=\"left-arrow\" class=\"${currentPage == 1 ? \"disabled\" : \"waves-effect\"}\"><a><i class=\"material-icons\">chevron_left</i></a></li>`);\n for (var i = 1; i <= totalPages; i++) {\n venuePaginationEl.append(`<li class=\"${i == currentPage ? \"active\" : \"waves-effect\"}\" data-value=\"${i}\"><a>${i}</a></li>`);\n }\n venuePaginationEl.append(`<li id=\"right-arrow\" class=\"${currentPage == totalPages ? \"disabled\" : \"waves-effect\"}\"><a><i class=\"material-icons\">chevron_right</i></a></li>`);\n}", "title": "" }, { "docid": "0bcee82490282520e6eba60636dbd45f", "score": "0.4851033", "text": "function vrange(val, meta, record, rI, cI, store) {\n var range = maxvals[cI] - minvals[cI];\n var spl = val.split(',');\n var low = parseFloat(spl[0]);\n var high = parseFloat(spl[1]);\n var roffset = 0;\n var loffset = 0;\n if (range != 0) {\n loffset = ((low - minvals[cI]) / range) * 100 - 1;\n roffset = ((maxvals[cI] - high) / range) * 100 - 1;\n }\n var ret = high + low;\n if (range != 0 && low != NaN && high != NaN) {\n return '<div class=\"woot\"><div style=\"margin-right:' + roffset + '%; margin-left:' + loffset + '%;\"></div></div>';\n } else {\n return '<div class=\"woot empty\"></div>';\n }\n }", "title": "" }, { "docid": "4c9f8dabcc1e0086d8544faa66c05d1f", "score": "0.4850475", "text": "function filterByPrice(){\n // inputRange = document.querySelector(\".slider\")\n inputRange.setAttribute(\"min\",min);\n inputRange.setAttribute(\"max\",max)\n // console.log(min ,max )\n var result = resultHotel.filter((hotel)=> {\n return hotel.price >= inputRange.value;\n })\n display(result);\n}", "title": "" }, { "docid": "77e450a9ef93b781ccc9104140cb27b3", "score": "0.4848009", "text": "function showGangList(data) {\n\n $('#gangmultyresult').removeAttr('hidden');\n\n $('#gangresultsize').html(data.length);\n\n for (var i = 0; i < data.length; i++) {\n\n var gangName = data[i].name;\n var ownerId = data[i].owner;\n var memberSize = data[i].members.length;\n\n var gangColor;\n\n if(memberSize >= 10){\n gangColor = '#FFE17E';\n }else if(memberSize > 12){\n gangColor = '#FF3333';\n }else{\n gangColor = '#FFF';\n }\n\n var listElement = $('<a style=\"cursor:pointer;\" id=\"' + ownerId + '\" data-id=\"' + ownerId + '\" class=\"list-group-item list-group-item-action flex-column align-items-start\">' +\n ' <div class=\"d-flex w-100 justify-content-between\">' +\n ' <h5 class=\"mb-1\">' + gangName + '</h5>' +\n ' <small><i class=\"fas fa-external-link-alt\"></i></small>' +\n ' </div>' +\n ' <small>Dimensioni: <span style=\"color: ' + gangColor + '\">' + memberSize + '/12 </span> - Proprietario: ' + ownerId + '</small>' +\n ' </a>');\n\n $('#listGangAppendElement').append(listElement);\n\n }\n\n for (var x = 0; x < data.length; x++) {\n\n var ownerId2 = data[x].owner;\n\n $('#' + ownerId2).on('click', function () {\n loadingScreen();\n searchByGang($(this).data(\"id\"));\n });\n }\n\n}", "title": "" }, { "docid": "a2888d70868af907048566034585a9e9", "score": "0.48454478", "text": "function updateRange(ui,rangeInfo)\r\n\t{\r\n\t\tif(ui.values[1] - ui.values[0] >= 2)\r\n\t\t{\r\n\t\t\tsetStartEndIndex(ui.values[0],ui.values[1]);\r\n\t\t\trangeInfo.html(toKm( g_data['kmstart']) + \" - \" + toKm(g_data['kmend']));\r\n\r\n\t\t\t$('#search-input .rangekm').html(toKm(g_data['kmstart'])+' - '+toKm(g_data['kmend']));\r\n\t\t//\tupdateBinding(['rangekm','kmstart','kmend']);\r\n\t\t\t//updateLinkVideoLightBox()\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a964444d601244e351c03aaedc2bd7a7", "score": "0.4840731", "text": "function updateRangeSelection() {\n\td3.selectAll('#details div.range').style('display', function() {\n\t\treturn (d3.select(this).classed(sn.runtime.powerIOAreaParameters.aggregate.toLowerCase()) ? 'block' : 'none');\n\t});\n}", "title": "" }, { "docid": "93d3f0c1858aee86688dd75ee968296c", "score": "0.483208", "text": "function range(start, end, step=1) {\n // Your code here\n var numRange = [];\n if(start <= end) {\n \n for(var i = start; i <= end; i+=step) {\n numRange.push(i);\n }\n }\n else {\n for(var j = start; j >= end; j+=step){\n numRange.push(j);\n }\n }\n return numRange;\n}", "title": "" }, { "docid": "1c96f8a4ca6befc6cb7b5a6522ecd1e8", "score": "0.48320517", "text": "GetRange() {\n\n }", "title": "" }, { "docid": "6c0ee6fea8bd2e1d7091addbda4677d8", "score": "0.48303306", "text": "function displayPriceRange() {\r\n //Output all products with a user specified price range\r\n let lowPrice = Number(prompt(\"Please enter lowest price: \"));\r\n let highPrice = Number(prompt(\"Please enter highest price: \"));\r\n\r\n let count = 0;\r\n\r\n outputEl.innerHTML = \"<h2>Display Price Products</h2>\";\r\n outputStr = \"<ul>\";\r\n for (let i = 0; i < groceryData.length; i++) {\r\n let product = groceryData[i];\r\n if (product.price >= lowPrice && product.price <= highPrice){\r\n outputEl.innerHTML += \"<li>\" + productString(product) + \"</li>\";\r\n count++;\r\n }\r\n \r\n }\r\n outputStr = \"</ul>\";\r\n outputEl.innerHTML += \"<p>Total number of products : \" + count + \"</p>\";\r\n \r\n}", "title": "" }, { "docid": "1189ec30eb4720d644457434b4d4472f", "score": "0.48264354", "text": "function setPageNavigation(list) {\n let liprev = document.getElementById('itemPage');\n let total = 0;\n if (list.length == 0) {\n document.getElementById('myPageNavigation').className = 'hide';\n } else {\n document.getElementById('myPageNavigation').className = 'd-flex justify-content-center';\n if (list.length % 10 == 0) {\n total = list.length / 10;\n totaltemp = total;\n } else {\n total = parseInt(list.length / 10) + 1;\n totaltemp = total;\n }\n liprev.innerHTML = '';\n for (let i = itemnavigate; i <= total; i++) {\n if (i >= itemnavigate && i <= itemnavigate + 4) {\n let li = document.createElement('li');\n let a = `<a class=\"page-link mylink\" href=\"#menuFeature\">${i}</a>`;\n li.innerHTML = a;\n liprev.appendChild(li);\n setEvenItemPageNavigate(li, list);\n if (i == itempage) {\n li.className = 'page-item textdecoration';\n li.setAttribute('id', 'active');\n } else {\n li.className = 'page-item';\n }\n }\n }\n if (total == 1) {\n document.getElementById('buttonprev').className = 'page-link mylink hide';\n document.getElementById('buttonnext').className = 'page-link mylink hide';\n } else {\n if (document.getElementById('active').firstChild.innerHTML == 1) {\n document.getElementById('buttonprev').className = 'page-link mylink hide';\n document.getElementById('buttonnext').className = 'page-link mylink show';\n } else if (document.getElementById('active').firstChild.innerHTML == total) {\n document.getElementById('buttonprev').className = 'page-link mylink show';\n document.getElementById('buttonnext').className = 'page-link mylink hide';\n } else {\n document.getElementById('buttonprev').className = 'page-link mylink show';\n document.getElementById('buttonnext').className = 'page-link mylink show';\n }\n }\n }\n}", "title": "" }, { "docid": "72422cfc11c6b07f51a8fd38883b36d3", "score": "0.4822146", "text": "loadStepList()\n {\n console.log(\"Step list method was called\");\n let htmlToGenerate = '';\n let newStepList = [];\n let steps = 6000 / 50; // 6000 split into 50.\n for(let k = 1 ; k <= steps ; k++)\n {\n let value = k * 50;\n newStepList.push(value); //pseudo list generation\n let toAppend = \"<option>\" + value + \"</option>\\n\"; //phyiscal option generation\n //console.log(toAppend);\n htmlToGenerate += toAppend;\n }\n this.stepList = newStepList;\n $('.steplist').html(htmlToGenerate);\n console.log(\"step list loaded\");\n }", "title": "" }, { "docid": "fc63d3a1d8933a86bca8b7100179719b", "score": "0.48130563", "text": "function navigationLossGirviListPanel(button, offset, totalGirviProcessed, maxLimit, maxLimitProcess, selFirmId, sortKeyword, rowsPerPage, pageNo, searchColumn, searchValue) {\r\n loadXMLDoc();\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n document.getElementById(\"ajaxLoadNextGirviPanelList\").style.visibility = \"hidden\";\r\n document.getElementById(\"ajaxLoadNextGirviPanelListButt\").style.visibility = \"visible\";\r\n document.getElementById(\"girviListPanelDiv\").innerHTML = xmlhttp.responseText;\r\n } else {\r\n document.getElementById(\"ajaxLoadNextGirviPanelList\").style.visibility = \"visible\";\r\n document.getElementById(\"ajaxLoadNextGirviPanelListButt\").style.visibility = \"hidden\";\r\n }\r\n };\r\n xmlhttp.open(\"POST\", \"include/php/orgplglp.php?button=\" + button + \"&offset=\" + offset + \"&totalGirviProcessed=\" + totalGirviProcessed + \"&maxLimit=\" + maxLimit + \"&maxLimitProcess=\" + maxLimitProcess +\r\n \"&selFirmId=\" + selFirmId + \"&sortKeyword=\" + sortKeyword + \"&rowsPerPage=\" + rowsPerPage + \"&page=\" + pageNo + \"&searchColumn=\" + searchColumn + \"&searchValue=\" + searchValue, true);\r\n xmlhttp.send();\r\n}", "title": "" }, { "docid": "ac07b1e9ccdc16708f4137f29b960a50", "score": "0.4809419", "text": "showWidget() {\n let sortedItems = this.sortListItems();\n\n // Show loading indicator while initial data is being fetched\n if (this.props.listItems.length === 0) {\n return null;\n }\n\n // Get min/max values for progress bar\n let min = 0;\n let max = sortedItems[0].value;\n\n return (\n <ListDisplay>\n {/* Add a ListItem for each piece of data */}\n {sortedItems.map((item, index) => <ListItem key={item.label} label={item.label} value={item.value} min={min} max={max} />)}\n </ListDisplay>\n );\n }", "title": "" }, { "docid": "4bf1f0a27fcf75876aeb27296ca88318", "score": "0.48084992", "text": "function filterRange(array, range, min, max){\n array.forEach(function(el){\n if(min === 0 || max === 0){\n return false;\n };\n if(range === \"size\"){\n if(!(el.size >= min && el.size <= max)){\n $(\"#\"+el.id).hide();\n } \n }else if(range === \"price\"){\n if(!(el.price >= min && el.price <= max)){\n $(\"#\"+el.id).hide();\n }\n }\n });\n }", "title": "" }, { "docid": "dc71b8648924c4b699531b48c96c9a42", "score": "0.4806291", "text": "function go_to_page(page_num){\n var show_per_page = parseInt($('#show_per_page').val());\n start_from = page_num * show_per_page;\n end_on = start_from + show_per_page;\n $('#names').children().css('display', 'none').slice(start_from, end_on).css('display', 'inline-flex');\n $('.page_link[longdesc=' + page_num +']').addClass('active_page').siblings('.active_page').removeClass('active_page');\n $('#current_page').val(page_num);\n}", "title": "" }, { "docid": "5046b1877d531192efecc0ef2c84fe0f", "score": "0.48022392", "text": "function tenList(list, p, valor) {\n var list = sendMap(list, p, valor);\n var N = list.length;\n var last = list[0];\n for (var i = 1; i <= N; i++) {\n if ((i / N) <= p) {\n last = list[i - 1];\n }\n }\n\n return last;\n }", "title": "" }, { "docid": "523d6111f5cd68740ebcf9dff854567b", "score": "0.48017505", "text": "function display() {\n\t\tlet totFilteredRecs = ndx.groupAll().value();\n\t\tlet end = ofs + pag > totFilteredRecs ? totFilteredRecs : ofs + pag;\n\t\td3.select('#begin').text(end === 0 ? ofs : ofs + 1);\n\t\td3.select('#end').text(end);\n\t\td3.select('#last').attr('disabled', ofs - pag < 0 ? 'true' : null);\n\t\td3.select('#next').attr(\n\t\t\t'disabled',\n\t\t\tofs + pag >= totFilteredRecs ? 'true' : null\n\t\t);\n\t\td3.select('#size').text(totFilteredRecs);\n\t\tif (totFilteredRecs != ndx.size()) {\n\t\t\td3.select('#totalsize').text('(Unfiltered Total: ' + ndx.size() + ')');\n\t\t} else {\n\t\t\td3.select('#totalsize').text('');\n\t\t}\n\t}", "title": "" }, { "docid": "c4cd9f79bfb0130706210fc6c7f6355f", "score": "0.48003784", "text": "function setEventButtonNavigation(listtemp) {\n let buttonprev = document.getElementById('buttonprev');\n let buttonnext = document.getElementById('buttonnext');\n buttonprev.addEventListener('click', function () {\n let ul = document.getElementById('itemPage');\n let active = document.getElementById('active');\n itempage = parseInt(active.firstChild.innerHTML) - 1;\n tbody.innerHTML = '';\n setList(listtemp, itempage);\n if (totaltemp <= 5) {\n itemnavigate = 1;\n setPageNavigation(listtemp);\n } else {\n if (itempage <= 3) {\n itemnavigate = 1;\n setPageNavigation(listtemp);\n } else if (itempage >= totaltemp - 2) {\n itemnavigate = totaltemp - 4;\n setPageNavigation(listtemp);\n } else {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML) - 1;\n setPageNavigation(listtemp);\n }\n }\n });\n buttonnext.addEventListener('click', function () {\n let ul = document.getElementById('itemPage');\n let active = document.getElementById('active');\n itempage = parseInt(active.firstChild.innerHTML) + 1;\n tbody.innerHTML = '';\n setList(listtemp, itempage);\n if (totaltemp <= 5) {\n itemnavigate = 1;\n setPageNavigation(listtemp);\n } else {\n if (itempage <= 3) {\n itemnavigate = 1;\n setPageNavigation(listtemp);\n } else if (itempage >= totaltemp - 2) {\n itemnavigate = totaltemp - 4;\n setPageNavigation(listtemp);\n } else {\n itemnavigate = parseInt(ul.firstChild.firstChild.innerHTML) + 1;\n setPageNavigation(listtemp);\n }\n }\n });\n}", "title": "" }, { "docid": "a84b563922c25ae9551c5a0b0321506b", "score": "0.47986177", "text": "static fromRange(start, end){\n return FlowFactory.getFlow([...new Array(end - start + 1).keys()].map((elem) => elem + start));\n }", "title": "" }, { "docid": "a1bc4f1e248df4bbea7b90e7d699aaec", "score": "0.47864223", "text": "function showValueOfRange (id,map,constantsVariableName) {\n var valueId = id + \"_value\";\n var rangeValue = document.getElementById(id).value;\n\n if (Array.isArray(map)) {\n document.getElementById(valueId).value = map[parseInt(rangeValue)];\n this._overWriteGraphConstants(constantsVariableName,map[parseInt(rangeValue)]);\n }\n else {\n document.getElementById(valueId).value = parseInt(map) * parseFloat(rangeValue);\n this._overWriteGraphConstants(constantsVariableName, parseInt(map) * parseFloat(rangeValue));\n }\n\n if (constantsVariableName == \"hierarchicalLayout_direction\" ||\n constantsVariableName == \"hierarchicalLayout_levelSeparation\" ||\n constantsVariableName == \"hierarchicalLayout_nodeSpacing\") {\n this._setupHierarchicalLayout();\n }\n this.moving = true;\n this.start();\n }", "title": "" }, { "docid": "58f31c1ea60c9feccd089e993cb6cff4", "score": "0.4783492", "text": "function getRow(height,list){\n //console.log(\"getting row at height - \" + height)\n var rv = []\n for(var i = 0; i < list.length; i++){\n var cur = list[i];\n // console.log(\"element posY for \" + cur.text)\n // console.log(cur.posY)\n if(parseInt(cur.posY) >= height && parseInt(cur.posY) < (height+100)){\n rv.push(cur)\n }\n }\n return rv;\n}", "title": "" }, { "docid": "97973a781b5130816178944ff5943f5a", "score": "0.47824153", "text": "get llaves()\r\n\t{\r\n\t\tvar llaves =\r\n\t\t{\r\n\t\t\tid:this.grid._selectedItem.id,\t\r\n\t\t}\r\n\t\treturn llaves;\r\n\t}", "title": "" }, { "docid": "ac707b33ec21cfeb3da46c65c91c39c6", "score": "0.4780197", "text": "addExpenseToList(name, amount){\r\n\t\tconst li = document.createElement('li');\r\n\t\tli.className = 'list-group-item d-flex justify-content-between align-items-center';\r\n\t\t// Create template\r\n\t\tli.innerHTML = `\r\n\t\t\t${name}\r\n\t\t\t<span class=\"badge badge-primary badge-pill\">$ ${amount}</span>\r\n\t\t`;\r\n\t\texpensesList.appendChild(li);\r\n\t}", "title": "" }, { "docid": "42acb421b0ffc988669c43792d9ee376", "score": "0.47769338", "text": "function displayData(p, rows) {\n console.log(\"page no.:\"+ p);\n console.log(\"row count:\"+ rows);\n $tbody.innerHTML = '';\n\n if (parseInt(Number(p)) == p)\n {\n data = filteredData.slice((p-1)*rows, (p*rows));\n console.log(data);\n }\n else\n {\n\t alert('Please click on Previous or Next to navigate the pages.');\n console.log('Sorry!! This is not hanlded :( Need some more time.');\n return;\n }\n\n for (var i = 0; i < data.length; i++) {\n var UFOData = data[i];\n var fields = Object.keys(UFOData);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the UFOData object, create a new cell at set its inner text to be the current value\n // at the current UFOData's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = UFOData[field];\n }\n }\n}", "title": "" } ]
b731bbd339ae23034d964ca2b636e34b
optional parameter just put ?
[ { "docid": "7aad64e263fd3973cfeb680fb435bb94", "score": "0.0", "text": "function add(num1, num2) {\n if (num2)\n return num1 + num2;\n else\n return num1;\n}", "title": "" } ]
[ { "docid": "31d1382fc26cd5f53036cc26fe56ba26", "score": "0.6715582", "text": "function AcceptMaybeParam(may) {}", "title": "" }, { "docid": "7e1afa835859230fbdbcd2e34fa0a44b", "score": "0.6626631", "text": "_setParamIfEmpty(param){\r\n\t\t\r\n\t\tif(param == null) param = {};\r\n\t\t\r\n\t\tif(param['ajax_url'] == null) param['ajax_url'] = 'dummy';\r\n\t\t\r\n\t\treturn param;\r\n\t}", "title": "" }, { "docid": "f01e852653dce9025b97fdf4b2c3d5ab", "score": "0.66084266", "text": "function check_param(par) { \n return (par != null && par.length > 0) ? par:'';\n}", "title": "" }, { "docid": "d9503b3bdf0e49d8dc11603c08d08ad9", "score": "0.6458623", "text": "_setParamIfEmpty(param){\r\n\t\t\r\n\t\tif(param == null) param = {};\r\n\t\t\r\n\t\tif(param['ja_flg'] == null) param['ja_flg'] = 1; \r\n\t\tif(param['datetimepicker_f'] == null) param['datetimepicker_f'] = 0; \r\n\t\t\r\n\t\treturn param;\r\n\t}", "title": "" }, { "docid": "f78ff5caa338cb3bfc7c64c32f261e41", "score": "0.62480205", "text": "function validateOptionalArgType(functionName,type,position,argument){if(argument!==undefined){validateArgType(functionName,type,position,argument);}}", "title": "" }, { "docid": "d3ddc69e3fd1da86584e975781c5316f", "score": "0.6195573", "text": "function foo(param = 'no') {\n return 'yes';\n}", "title": "" }, { "docid": "58749d4f6a31d9f86cbbc39f08e24856", "score": "0.5948813", "text": "function functionName(param = value) {\n //codes\n}", "title": "" }, { "docid": "35d6b1ac21bb83bf714114afd8f2e0ac", "score": "0.59289587", "text": "function noOp(param) {\n return param;\n}", "title": "" }, { "docid": "457f2b6bfbf10c340f50e76eae9b8d2f", "score": "0.59094876", "text": "async getNoParam() {\n\t\treturn \"\";\n\t}", "title": "" }, { "docid": "4f13e9b93481b28d0c6a6c94204518c1", "score": "0.59050924", "text": "function quux (foo = 'FOO') {\n\n}", "title": "" }, { "docid": "a74b7bca387d1b1d919da41445f0bae5", "score": "0.5902519", "text": "function optional(a = 1, b = 1) {\n console.log(\"a+b\", a + b)\n}", "title": "" }, { "docid": "742b56ad0324d59f5819520ad9d9dd12", "score": "0.585597", "text": "function a(param=0) {\n return param;\n}", "title": "" }, { "docid": "e0237e5fa4039806086d3ce2dc19b519", "score": "0.5827258", "text": "function paramTypeNotSpecified(p) {\n return p;\n}", "title": "" }, { "docid": "f7099f522d7d605051faa9b90742b96a", "score": "0.57871336", "text": "function parametros (nombre, apellido, edad) {\n var nombre = nombre || \"Carlos\";\n var apellido = apellido || \"Suarez\";\n var edad = edad || 23;\n console.log(nombre, apellido, edad);\n}", "title": "" }, { "docid": "c8d937b012a9c43ea95232ee72a495dd", "score": "0.577648", "text": "function def(arg, val) { return (typeof arg !== 'undefined') ? arg : val; }", "title": "" }, { "docid": "6c66487ce9323088cbf14fa0d7e1c43d", "score": "0.57325286", "text": "function addOptional(param) {\n param.hidden = true;\n addRow();\n}", "title": "" }, { "docid": "17a6fee600d9a375e3d3354e0c008f89", "score": "0.5721377", "text": "function foo() {\n\tvar a = arguments[0] !== (void 0) ? arguments[0] : 2;\n\tconsole.log( a );\n}", "title": "" }, { "docid": "2b9b4617e8ab4676bc2edbf2b045e9ba", "score": "0.57023853", "text": "function argumentOrDefault(key){var args=customizations; return args[key]===undefined ? _defaultParams2.default[key] : args[key];}", "title": "" }, { "docid": "53d2ee9ee1a379558e962c45c61953a6", "score": "0.56971955", "text": "function _setParamIfEmpty(param){\r\n\t\t\r\n\t\tif(param == undefined){\r\n\t\t\tparam = {};\r\n\t\t}\r\n\t\r\n\t\t// ローカルストレージで保存していたパラメータをセットする\r\n\t\tvar param_json = localStorage.getItem(self.ls_key);\r\n\t\tif(!_empty(param_json)){\r\n\t\t\tvar lsParam = JSON.parse(param_json);\r\n\t\t\tif(lsParam){\r\n\t\t\t\tfor(var i in self.saveKeys){\r\n\t\t\t\t\tvar s_key = self.saveKeys[i];\r\n\t\t\t\t\tparam[s_key] = lsParam[s_key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif(param['panel_id'] == undefined){\r\n\t\t\tparam['panel_id'] = 'panel_x';\r\n\t\t}\r\n\t\t\r\n\t\tparam['panel_slt'] = '#' + param['panel_id'];\r\n\t\t\r\n\t\tif(param['title'] == undefined){\r\n\t\t\tparam['title'] = 'パネルX';\r\n\t\t}\r\n\t\t\r\n\t\tif(param['contents'] == undefined){\r\n\t\t\tparam['contents'] = '';\r\n\t\t}\r\n\t\t\r\n\t\tif(param['parent_panel_slt'] == undefined){\r\n\t\t\tparam['parent_panel_slt'] = '';\r\n\t\t}\r\n\t\t\r\n\t\tif(param['base_width'] == undefined){\r\n\t\t\tparam['base_width'] = 640;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(param['panel_css'] == undefined){\r\n\t\t\tparam['panel_css'] = _getDefaultCss();\r\n\t\t}else{\r\n\t\t\t// デフォルトCSSへ引数のCSSをマージする\r\n\t\t\tvar def_css = _getDefaultCss();\r\n\t\t\tdef_css['width'] = param['base_width'];\r\n\t\t\tvar panel_css = param['panel_css'];\r\n\t\t\tparam['panel_css'] = $.extend(def_css,panel_css);\r\n\t\t}\r\n\t\t\r\n\t\tif(param['panel_body_slt'] == undefined){\r\n\t\t\tparam['panel_body_slt'] = param['panel_slt'] + '_body';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn param;\r\n\t}", "title": "" }, { "docid": "31537d2d97497c8c51b0f3515582b3e5", "score": "0.5680794", "text": "function myOtherFunction (first_argument = second_argument, second_argument) {}", "title": "" }, { "docid": "800fd3332424249ca3971eae16010e44", "score": "0.56721497", "text": "function foo() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'www.wikipedia.com';\n var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Welcome to wikipedia';\n console.log(\"Argument with Default Parameter Url =\" + url);\n console.log(\"Argument with Default Parameter message =\" + message);\n}", "title": "" }, { "docid": "9938c3ef96f76cc25482974fba9f00cd", "score": "0.5644796", "text": "function addOptionalParams(num1, num2) {\n if (num2)\n return num1 + num2;\n else\n return num1;\n}", "title": "" }, { "docid": "6388746b4a95461007db518e9893883e", "score": "0.55826586", "text": "parameter(name) {\r\n\t\t\t\tif (this.shared && this.parent.check(name, true)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\treturn this.add(name, 'param');\r\n\t\t\t}", "title": "" }, { "docid": "47035df0c2cec7eac57b767a375d7827", "score": "0.55741304", "text": "function testParameter(key, defaultValue) {\n\t\t\t\tif (key == 'view') {\n\t\t\t\t\tif (params[key].length<=0) {\n\t\t\t\t\t\tparams[key] = defaultValue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar val = parseInt(params[key])\n\t\t\t\t\t\tif (isNaN(val) == true) {\n\t\t\t\t\t\t\tthrow(\"Cannot parse params[\"+key+\"]\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparams[key] = parseInt(params[key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(err) {\n\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\tparams[key] = defaultValue;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "879a892fe961aecc4d653b6fcebfb160", "score": "0.55732435", "text": "function validateNamedOptionalType(functionName,type,optionName,argument){if(argument!==undefined){validateNamedType(functionName,type,optionName,argument);}}", "title": "" }, { "docid": "153ba50ce0879898dee2516cfe4d4246", "score": "0.5540226", "text": "function example(param1, opt_param2, var_args){\n\t\n}", "title": "" }, { "docid": "0b474cf445de665bfc74836f12199ebe", "score": "0.5538995", "text": "function soSomething (x, y=4){\n console.log(x,y);\n}", "title": "" }, { "docid": "302cbbb0281794fddd8c00fbc12f4893", "score": "0.55292594", "text": "function test(name, age) {\n if (!name)\n name = \"defaultname\"\n if (!age)\n age = 26\n //logic\n}", "title": "" }, { "docid": "ed5db925ca6c362b1cd288a7b58aa9b8", "score": "0.55155855", "text": "function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName];}else if(arguments.length===3){return aDefaultValue;}else{throw new Error('\"'+aName+'\" is a required argument.');}}", "title": "" }, { "docid": "fbbaeefd6fd2e0f89f33fc387aed417c", "score": "0.5509267", "text": "function isFilledParam(node) {\n\treturn node.type === 'func' && node.value === 'param' && node.nodes.length === 4 && node.nodes[1].type === 'word';\n}", "title": "" }, { "docid": "3a3958d4aa458d28da736f177f42a498", "score": "0.550561", "text": "function isEmpty(parameter) {\n if (parameter === undefined) return 'your parameter is empty';\n else return parameter;\n}", "title": "" }, { "docid": "941620c154d7f9dd367880a6d59334ee", "score": "0.55003035", "text": "function addParam(params,predicate,value,argNumber,totalExpectedArgs){if(predicate){params.push(value);}else if(argNumber<totalExpectedArgs){params.push(NULL_EXPR);}}", "title": "" }, { "docid": "93ed9d0359f573acd22232686346682c", "score": "0.5498596", "text": "function addParameter(param) {\n if (!param) return;\n\n var isFirst = _hashString.length === 0;\n _hashString += isFirst ? param + \"=\" : \"&\" + param + \"=\";\n }", "title": "" }, { "docid": "11dcdc1af4ed03e8aa5462763d9e4829", "score": "0.5491905", "text": "parameter(name) {\n if (this.shared && this.parent.check(name, true)) {\n return;\n }\n return this.add(name, 'param');\n }", "title": "" }, { "docid": "8d76fb5ad010e48742b718c47373a746", "score": "0.5473692", "text": "function getExtParams (param)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif (!Ext.isEmpty(param))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvar extParams = param(extraParams);\r\n\t\t\t\t\t\t\t\t\t\treturn extParams;\r\n\r\n\t\t\t\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn extraParams;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "6290a5142b15fce77dbc3a27e742e6ab", "score": "0.5469762", "text": "function optional(arg, fallback) {\n return (arg !== void 0) ? arg : fallback;\n}", "title": "" }, { "docid": "8d3d2d893487d6ca2ea791287ce70eea", "score": "0.54673773", "text": "function default_val(arg, val) {\n\treturn typeof arg === \"undefined\" ? val : arg;\n} // default_val()", "title": "" }, { "docid": "2be6c913a6d451898ddc37734abdd14d", "score": "0.54591846", "text": "function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }", "title": "" }, { "docid": "1ed297f58207066bb8d5f5cbac1080e6", "score": "0.54583997", "text": "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "title": "" }, { "docid": "1ed297f58207066bb8d5f5cbac1080e6", "score": "0.54583997", "text": "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "title": "" }, { "docid": "1ed297f58207066bb8d5f5cbac1080e6", "score": "0.54583997", "text": "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "title": "" }, { "docid": "b009fe12629f06ea8df442a73a81b423", "score": "0.5449785", "text": "function argumentOrDefault(key) {\n\t var args = customizations;\n\t return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n\t }", "title": "" }, { "docid": "8f2e77d94d3d9aa0c92950888ac0d56c", "score": "0.54483145", "text": "function foo({first=10, second=true} = {}) {\n\n}", "title": "" }, { "docid": "a82fe0f67190a7cacd3dec6bd3f1280a", "score": "0.5441435", "text": "function sum_one(a, b=5){\n return a+b;\n}", "title": "" }, { "docid": "ed1f266161320a33f814b1d577639cc2", "score": "0.5438506", "text": "function add(a=10 , b = 20 ){\r\n\treturn a+b;\r\n}", "title": "" }, { "docid": "61e8d77633571afd6a2c09af760516cd", "score": "0.5430009", "text": "function foo(a, b = 2) {\n // foo() => a = undefined, b = 2\n // foo(1) => a = 1, b = 2\n // foo(1, \"truc\") => a = 1, b = \"truc\"\n}", "title": "" }, { "docid": "2c2599d1accd8e81dad276367ba8023e", "score": "0.5419526", "text": "function person(name='John Doe', age=99) {\n console.log(name+' '+age)\n}", "title": "" }, { "docid": "054878e2d8d8383315533bd947a8a7d5", "score": "0.54100996", "text": "function param(err){if(err){return done(err);}if(i>=keys.length){return done();}paramIndex=0;key=keys[i++];name=key.name;paramVal=req.params[name];paramCallbacks=params[name];paramCalled=called[name];if(paramVal===undefined||!paramCallbacks){return param();}// param previously called with same value or error occurred\nif(paramCalled&&(paramCalled.match===paramVal||paramCalled.error&&paramCalled.error!=='route')){// restore value\nreq.params[name]=paramCalled.value;// next param\nreturn param(paramCalled.error);}called[name]=paramCalled={error:null,match:paramVal,value:paramVal};paramCallback();}// single param callbacks", "title": "" }, { "docid": "88e69b40e205b6df926814fb27540b65", "score": "0.54095083", "text": "function Parameter() {}", "title": "" }, { "docid": "da68dac03a67493ce2039028a6b7cfd9", "score": "0.5389601", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n }", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5385962", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5385962", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5385962", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5385962", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5385962", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5385962", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "508069694b46b8cd39829c32e376a405", "score": "0.5385392", "text": "function test (arg){\n // var argument = arg; (arg n'est pas défini (undefined ou false) alors valeur par défaut = 567)\n var argument = arg || 567;\n\n console.log(argument)\n}", "title": "" }, { "docid": "3dea15e577e13b2aa3e619e6a6012de9", "score": "0.53773004", "text": "checkQueryParam() {\r\n let paramLayer = getParameterByName('layer');\r\n let paramProperty = getParameterByName('property');\r\n\r\n if (paramLayer) {\r\n if (paramProperty) {\r\n this.updateLayer(paramLayer, paramProperty);\r\n } else {\r\n this.updateLayer(paramLayer);\r\n }\r\n } else {\r\n this.updateLayer();\r\n }\r\n }", "title": "" }, { "docid": "c8a9e7eaa994500709c1e305312b8c91", "score": "0.5364043", "text": "function notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}", "title": "" }, { "docid": "b05726ec6bac36c3a335a6b0839777a4", "score": "0.5353089", "text": "function add1(a, b = 5) {\n // here we set a default value for the argument (b = 5)\n return a + b;\n}", "title": "" }, { "docid": "5f7cefa06a2341b7b873cce739788029", "score": "0.5349454", "text": "function argumentOrDefault(key) {\n var args = customizations;\n\n if (typeof args[key] !== 'undefined') {\n return args[key];\n } else {\n return defaultParams[key];\n }\n }", "title": "" }, { "docid": "451e65becbc034f80c0384f89c4db186", "score": "0.53448874", "text": "function vaildator(value){\n if(value!=''){\n return value;\n }\n else{\n return '(name not given)';\n }\n}", "title": "" }, { "docid": "2cf97b76d8b72975303a720c53c9bdfa", "score": "0.5342133", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67934c22b6890545f0c4bcb36c827f48", "score": "0.5340435", "text": "function helloWorldWithDefaultParam( name = \"student\" ) {\n return `Hello, ${name}!`;\n}", "title": "" }, { "docid": "9924bed785cf1ab3453ea5c98e2a0888", "score": "0.53388315", "text": "function pepe2(nombre = \"desconocido\") {\n console.log(`hola soy ${nombre}`);\n}", "title": "" }, { "docid": "d433a82df907090d3556be066f3bd7ea", "score": "0.53315604", "text": "function opt(x, z) { return x !== undefined ? x : z }", "title": "" }, { "docid": "0503b95d976a64096cee7178174a2212", "score": "0.5328847", "text": "function argumentOrDefault(key) {\r\n var args = customizations;\r\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\r\n }", "title": "" }, { "docid": "bc01ded7552bd1787f11fc0732028729", "score": "0.5316101", "text": "function validateDefault(params/*, markup*/) {\n return params.trim().split(' ', 2)[0] === name;\n }", "title": "" }, { "docid": "147f15892bd680ab067361fc2a7e2773", "score": "0.5315813", "text": "function fn(arg1, arg2, arg3 = 0) {\n return arg1 + arg2 + arg3;\n}", "title": "" }, { "docid": "d2bffc392c3ffbe94c2b2e9a307232ca", "score": "0.5315323", "text": "function param(err) {\n if (err) {\n return done(err);\n }\n\n if (i >= keys.length ) {\n return done();\n }\n\n paramIndex = 0;\n key = keys[i++];\n paramVal = key && req.params[key.name];\n paramCallbacks = key && params[key.name];\n\n try {\n if (paramCallbacks && undefined !== paramVal) {\n return paramCallback();\n } else if (key) {\n return param();\n }\n } catch (err) {\n return done(err);\n }\n\n done();\n }", "title": "" }, { "docid": "029514313adcd65afca7a88f06f46257", "score": "0.5313787", "text": "function provideHint(){\n\t// add code here\n}", "title": "" }, { "docid": "10e2fb393c9fc95c37de24b885d62e17", "score": "0.5303835", "text": "function UsingParams(pRequired, pDefault, pOptional) {\n if (pDefault === void 0) { pDefault = \"DBS-ID\"; }\n var pRest = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n pRest[_i - 3] = arguments[_i];\n }\n console.log(pRequired);\n console.log(pDefault);\n console.log(pOptional);\n console.log(pRest);\n}", "title": "" }, { "docid": "f9b1993fa11b94c3cbd9803d6d7e12ba", "score": "0.53023005", "text": "function ParamMap(){}", "title": "" }, { "docid": "a0755e092bdb35ffaabd37b0a39052e5", "score": "0.5300252", "text": "function addParam(params, predicate, value, argNumber, totalExpectedArgs) {\n if (predicate && value) {\n params.push(value);\n } else if (argNumber < totalExpectedArgs) {\n params.push(NULL_EXPR);\n }\n }", "title": "" }, { "docid": "ab1c49a2d04232e09846c8aba1e60bc1", "score": "0.5296747", "text": "function throwIfMissing() {\n throw new Error(\"Missing parameter\");\n}", "title": "" }, { "docid": "ceabb88ce658af67a049a0e04f39e661", "score": "0.52949125", "text": "function htmldb_Get_addParam(name,val){\n if ( this.params == '' )\n this.params = name + '='+ ( val != null ? this.escape(val) : '' );\n else\n //this.params = this.params + '&'+ name + '='+ ( val != null ? val : '' );\n this.params = this.params + '&'+ name + '='+ ( val != null ? this.escape(val) : '' );\n return;\n}", "title": "" }, { "docid": "c78db30e610ddcf58f5762de25b935ba", "score": "0.5290955", "text": "function __setUrlParam($url, $name, $value) {\r\n\r\n var charFix = $url.indexOf(\"?\")!=-1?\"&\":\"?\";\r\n var nIdxStart = $url.indexOf(\"&\" + $name + \"=\");\r\n if (nIdxStart==-1) {\r\n nIdxStart = $url.indexOf(\"?\" + $name + \"=\");\r\n }\r\n if (nIdxStart==-1) { //no params\r\n $url = $url + charFix + $name + \"=\" + $value;\r\n return $url;\r\n }\r\n /**\r\n * from upper it found the name start and then try to found the value end position\r\n * the value and be empty or it's the url end\r\n */\r\n var nIdxEnd = $url.indexOf(\"&\", nIdxStart+1);\r\n var urlPreFix = $url.substr(0, nIdxStart+1);\r\n var urlEndFix = \"\";\r\n if (nIdxEnd!=-1) {\r\n urlEndFix = $url.substr(nIdxEnd);\r\n }\r\n $url = urlPreFix + $name + \"=\" + $value + urlEndFix;\r\n return $url;\r\n}", "title": "" }, { "docid": "3b5ba8b9f9b11df82908c0762c523e0a", "score": "0.5287196", "text": "function checkForParameter(parameter, defaultparameter) {\r\n try {\r\n if (parameter !== null && parameter !== undefined\r\n && parameter !== \"null\" && parameter !== \"NaN\"\r\n && parameter !== \"undefined\"\r\n && parameter != \"\"\r\n && parameter != \" \") {\r\n return parameter;\r\n } else {\r\n\r\n return defaultparameter;\r\n }\r\n } catch (e) {\r\n log.error(\"Err@ FN checkForParameter\", e);\r\n }\r\n }", "title": "" }, { "docid": "38945e1f63ecbee4be23cc72102be9a5", "score": "0.5282542", "text": "function hello(name){\n name = name || 'Mystery Person'\n console.log(\"Hello\" + name + \" !\")\n}", "title": "" }, { "docid": "74678984b119f1ed66e3072686be0169", "score": "0.5277605", "text": "function addDefaultParams(num1, num2) {\n if (num2 === void 0) { num2 = 10; }\n if (num2)\n return num1 + num2;\n else\n return num1;\n}", "title": "" }, { "docid": "bf9747ec80c26752e93b678bb8f7dffa", "score": "0.527372", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "2493618b8695fbf306743eb70add7c9b", "score": "0.52653337", "text": "function get_opt(params, args) {\n var newParams = pj_get_params(args);\n var geoIsSet = ['datum', 'ellps', 'a', 'b', 'rf', 'f'].reduce(function(memo, key) {\n return memo || key in params;\n }, false);\n Object.keys(newParams).forEach(function(key) {\n // don't override existing params\n if (key in params) return;\n // don't set ellps if earth model info is set\n if (key == 'ellps' && geoIsSet) return;\n params[key] = newParams[key];\n });\n}", "title": "" }, { "docid": "30f08866c8eb263a90ed3999268c185e", "score": "0.52620125", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "title": "" }, { "docid": "30f08866c8eb263a90ed3999268c185e", "score": "0.52620125", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "title": "" }, { "docid": "30f08866c8eb263a90ed3999268c185e", "score": "0.52620125", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "title": "" }, { "docid": "30f08866c8eb263a90ed3999268c185e", "score": "0.52620125", "text": "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "title": "" }, { "docid": "6a0e20d7a534933fa37f227cd68313bd", "score": "0.52534693", "text": "function maybeSample(value: ?string){\n}", "title": "" }, { "docid": "5e0a31af0453a6c676e7c25d7e25fe21", "score": "0.52530706", "text": "addParam(value) {\n this._digitIsSub = false;\n if (this.length >= this.maxLength) {\n this._rejectDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength;\n this.params[this.length++] = value > MAX_VALUE ? MAX_VALUE : value;\n }", "title": "" }, { "docid": "b677988a41f6152e88e15d2cda2a8ae2", "score": "0.5244364", "text": "function hello(data = 1) {\n\n console.log('hey ' + data)\n}", "title": "" }, { "docid": "f2f410465f633698a1911f956fb874f4", "score": "0.52423555", "text": "function isParamsEx(name) {\n return name === 'params' || name === 'props';\n}", "title": "" }, { "docid": "3a3e1a7c750cc7ba1889b06b37a89f9c", "score": "0.52415675", "text": "function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('\"'+t+'\" is a required argument.')}", "title": "" }, { "docid": "2c08fce05d0eec53192754a45c096dad", "score": "0.5236616", "text": "function add(x, y = 17) {\n // y is 17 if not passed or passed as `undefined`\n return x + y;\n}", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.52319837", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" } ]
922d56392e623f4a2c9e534da3fe34af
draw some locations on the map
[ { "docid": "55c1df982b21590317f662a4202cc21c", "score": "0.0", "text": "function drawLocation(location, opts, name, type) {\n if (typeof opts !== 'object') {\n opts = {};\n }\n opts.position = new google.maps.LatLng(location[0], location[1]);\n opts.map = map;\n opts.title = makeTitle(name, type);\n var marker = new google.maps.Marker(opts);\n days[day][name] = {marker: marker, type: type}\n console.log(\"Days[day][\"+name+\"] JUST ASSIGNED AS\",days[day][name]);\n console.log(\"Days[day] is now\", days[day])\n }", "title": "" } ]
[ { "docid": "6aa6b7138805ebe43a4804331ff88614", "score": "0.79534185", "text": "function drawMyLocation() {\n setMapCordinates(updateMarkerCordinates);\n }", "title": "" }, { "docid": "b115ed3753d3ed667387ddf5b6d7b387", "score": "0.72582376", "text": "function drawPoints() {\n var offset = new MM.Point(0, 0);\n for (var i = 0; i < locations.length; i++) {\n var point = map.locationPoint(locations[i]);\n if (!locations[i].pointDiv) {\n locations[i].pointDiv = document.createElement('div');\n locations[i].pointDiv.className = 'wax-point-div';\n locations[i].pointDiv.style.position = 'absolute';\n locations[i].pointDiv.style.display = 'block';\n // TODO: avoid circular reference\n locations[i].pointDiv.location = locations[i];\n // Create this closure once per point\n MM.addEvent(locations[i].pointDiv, 'mouseup',\n (function selectPointWrap(e) {\n var l = locations[i];\n return function(e) {\n MM.removeEvent(map.parent, 'mouseup', mouseUp);\n pointselector.deletePoint(l, e);\n };\n })());\n map.parent.appendChild(locations[i].pointDiv);\n }\n locations[i].pointDiv.style.left = point.x + 'px';\n locations[i].pointDiv.style.top = point.y + 'px';\n }\n }", "title": "" }, { "docid": "ebc3c0db061d5013a45a5a95eb56322d", "score": "0.72510386", "text": "function drawPoints() {\n var offset = new MM.Point(0, 0);\n for (var i = 0; i < locations.length; i++) {\n var point = map.locationPoint(locations[i]);\n if (!locations[i].pointDiv) {\n locations[i].pointDiv = document.createElement('div');\n locations[i].pointDiv.className = 'wax-point-div';\n locations[i].pointDiv.style.position = 'absolute';\n locations[i].pointDiv.style.display = 'block';\n // TODO: avoid circular reference\n locations[i].pointDiv.location = locations[i];\n // Create this closure once per point\n bean.add(locations[i].pointDiv, 'mouseup',\n (function selectPointWrap(e) {\n var l = locations[i];\n return function(e) {\n MM.removeEvent(map.parent, 'mouseup', mouseUp);\n pointselector.deleteLocation(l, e);\n };\n })());\n map.parent.appendChild(locations[i].pointDiv);\n }\n locations[i].pointDiv.style.left = point.x + 'px';\n locations[i].pointDiv.style.top = point.y + 'px';\n }\n }", "title": "" }, { "docid": "a7d87367ada33bc285ff12c7a802f2c3", "score": "0.7082864", "text": "displayMap(){\n noStroke(); //turns off outlines (borders can interfere with detection)\n fill(this.mapColor);\n this.polygon(this.x,this.y,this.r,this.SIDES); \n }", "title": "" }, { "docid": "e1350a155024954ed0f78629301e0dac", "score": "0.7030905", "text": "function drawLocation(lat, long)\n{\n cx = mercX(long) - mercX(0);\n cy = mercY(lat) - mercY(0);\n stroke(255, 0, 255);\n fill(255, 0, 255, 200);\n ellipse(cx, cy, r, r);\n}", "title": "" }, { "docid": "7f3208a323bd80373b4d34c5f3ab1557", "score": "0.694365", "text": "function drawPoint(){\n clear();\n selectAll(\".locations\").forEach(location => location.hide());\n select(\".heading__year\").html(select(\"#yearSlider\").value());\n filteredBattles = filterData(document.getElementById(\"yearSlider\").value);\n for(var j =0; j<filteredBattles.length;j++) {\n if(filteredBattles[j].coord[0]) {\n var temp = myMap.latLngToPixel(filteredBattles[j].coord[0], filteredBattles[j].coord[1]);\n mapLocations[filteredBattles[j].id].updateLocation(temp.x,temp.y);\n mapLocations[filteredBattles[j].id].drawLocation();\n }\n }\n}", "title": "" }, { "docid": "c0f3df3a0af7acc24a0c46f40bd13c19", "score": "0.6918682", "text": "function draw() {\n onMapMousePos = getOnMapPos(mouseX, mouseY);\n doCamMove();\n background(68,107,164);\n translate(camX, camY);\n scale(zoom);\n if (drawState === 0) {\n image(mapImg,0,0);\n renderContinentNames();\n } else if (drawState === 1) {\n background(0);\n }\n\n // fill(0);\n // noStroke();\n // ellipse(onMapMousePos[0], onMapMousePos[1], 5/zoom, 5/zoom);\n\n}", "title": "" }, { "docid": "a274de38a00ff0de5afb989504f765bf", "score": "0.689205", "text": "function drawmap(curpos,way,x1,y1,dir) {\r\n var x2,y2;\r\n if (curpos.hasOwnProperty('F')){\r\n if (curpos.F !=null){\r\n if (dir==0) {x2 = x1; y2 = y1-curpos.F;}\r\n if (dir==1) {x2 = x1-curpos.F; y2 = y1;}\r\n if (dir==2) {x2 = x1; y2 = y1+curpos.F;}\r\n if (dir==3) {x2 = x1+curpos.F; y2 = y1;}\r\n pos1x_cp.push(x1); pos1y_cp.push(y1);\r\n pos2x_cp.push(x2); pos2y_cp.push(y2);\r\n dirc_cp.push(way);abs_dir_cp.push(dir);\r\n line(x1,y1,x2,y2);\r\n if (updatingMap){\r\n if (x2<0) {x_start += -x2+3; flag_redraw = 1;}\r\n if (x2>width) {x_start -= x2-width+3; flag_redraw = 1;}\r\n if (y2<0) {y_start += -y2+3; flag_redraw = 1;}\r\n if (y2>height) {y_start -= y2-height+3; flag_redraw = 1;}\r\n } else {\r\n if (x2<0) {x_start -= 1; flag_redraw = 1;}\r\n if (x2>width) {x_start += 1; flag_redraw = 1;}\r\n if (y2<0) {y_start += 1; flag_redraw = 1;}\r\n if (y2>height) {y_start -= 1; flag_redraw = 1;}\r\n }\r\n if (curpos.L!=null) {\r\n if (dir==0) drawmap(curpos.L,way+'L',x2,y2,1);\r\n if (dir==1) drawmap(curpos.L,way+'L',x2,y2,2);\r\n if (dir==2) drawmap(curpos.L,way+'L',x2,y2,3);\r\n if (dir==3) drawmap(curpos.L,way+'L',x2,y2,0);\r\n }\r\n if (curpos.R!=null) {\r\n if (dir==0) drawmap(curpos.R,way+'R',x2,y2,3);\r\n if (dir==1) drawmap(curpos.R,way+'R',x2,y2,0);\r\n if (dir==2) drawmap(curpos.R,way+'R',x2,y2,1);\r\n if (dir==3) drawmap(curpos.R,way+'R',x2,y2,2);\r\n }\r\n if (curpos.S!=null) {\r\n if (dir==0) drawmap(curpos.S,way+'S',x2,y2,0);\r\n if (dir==1) drawmap(curpos.S,way+'S',x2,y2,1);\r\n if (dir==2) drawmap(curpos.S,way+'S',x2,y2,2);\r\n if (dir==3) drawmap(curpos.S,way+'S',x2,y2,3);\r\n }\r\n if (curpos.L==null && curpos.R==null && curpos.S==null){\r\n //console.log(way+curpos.F);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7e636b60f92a8e7552b326a51ce4ac13", "score": "0.6863755", "text": "function showLocation(evt) {\n map.graphics.clear();\n var point = evt.result.feature.geometry;\n var symbol = new SimpleMarkerSymbol()\n .setStyle(\"square\")\n .setColor(new Color([255,0,0,0.5]));\n var graphic = new Graphic(point, symbol);\n map.graphics.add(graphic);\n }", "title": "" }, { "docid": "2169880e6837f1c71b6f0fd5256e1cf2", "score": "0.68520784", "text": "drawAll() {\n console.log('redrawing map');\n this.clearMap();\n this.drawMain();\n this.drawMinimap();\n this.canvas.context.translate(0.5, 0.5);\n }", "title": "" }, { "docid": "29d6180b4a09c221ba32b0f7d9b6e3e9", "score": "0.68314284", "text": "function MapLocations() {\t\n\tfor (var i = 0; i < data.length; i++) {\n\t\tvar dist = mathMod.Distance(currLocation, data[i]);\n\t\tvar horizAngle = mathMod.Bearing(currLocation, data[i]);\n\t\t\n\t\tvar ro = 28 * dist / maxDist;\n\t\tvar centerX = 28 + ro * Math.sin(horizAngle);\n\t\tvar centerY = 28 - ro * Math.cos(horizAngle);\n\n\t\tvar circView = Ti.UI.createView({\n\t\t\theight: 4,\n\t\t\twidth: 4,\n\t\t\tbackgroundColor: \"#fff\",\n\t\t\tborderRadius: 2,\n\t\t\ttop: centerY - 2,\n\t\t\tleft: centerX - 2\n\t\t});\n\t\tcircleView.add(circView);\n\t}\n}", "title": "" }, { "docid": "0beed5e96872f975758f8d617728e9f0", "score": "0.67198175", "text": "function draw() {\n\t\t//where animation happens\n\t\tdrawMap();\n\t}", "title": "" }, { "docid": "3275972eb9c38b646da3f4549c259e2a", "score": "0.66911703", "text": "function setup() {\n createCanvas(1024, 512);\n translate(width/2., height/2.);\n imageMode(CENTER);\n image(mapImg,0,0);\n\n //london \n drawLocation(londonLat, londonLon);\n //NY\n drawLocation(NYLat, NYLon);\n //Rio\n drawLocation(rioLat, rioLon);\n //ND`\n drawLocation(NDLat, NDLon);\n}", "title": "" }, { "docid": "507f921cf6e7c67ef0dda6c4eb8a78fd", "score": "0.6687828", "text": "function drawMap(json){\n\t\t\tif(undefined === bounds){\n\t\t\t\tcalculateBounds(json);\n\t\t\t}\n\t\t\tif(!map.drewNeighhbor){\n\t\t\t\tmapFactory.drawNeighborhoods(json,path);\n\t\t\t\tmap.drewNeighhbor = true;\n\t\t\t}\n\t\t\tif(map.drewNeighhbor){\n\t\t\t\tmapFactory.drawStreets(json,path);\n\t\t\t\t$scope.showApp = true;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5a94a12381992c91033f0f5ca7272685", "score": "0.6686325", "text": "function redrawMaps() {\n\tdrawMaps(player.availableTerrain, player.currentLocation);\n\tdrawInternalLocationMap();\n}", "title": "" }, { "docid": "cdaa7724a246e6a03b18e6e78900d33b", "score": "0.66653156", "text": "function drawMapWithClick(){\r\n \r\n \r\n \t if (GBrowserIsCompatible()) {\r\n var map = new GMap2(document.getElementById(\"map\"));\r\n map.setCenter(new GLatLng(21.0063,105.8429), 15);\r\n map.setUIToDefault();\r\n var i=0;\r\n var count = 0;\r\n \r\n }\r\n \t GEvent.addListener(map,\"click\", function(overlay, latlng) { \r\n \t\t if (latlng) { \r\n \t\t\t\r\n \t\t var myHtml = \"The Point value is: \" + latlng;\r\n \t\t map.openInfoWindow(latlng, myHtml);\r\n \t\t // Set Time\r\n \t\t var time = getTime();\r\n \t\t i++;\r\n \t\t count++;\r\n \t\t // Set text to Text-area\r\n \t\t var text = $(\"#bus-location-picker\").text();\r\n \t\t if(text==\"\")$(\"#bus-location-picker\").text(time+\"^\"+latlng);\r\n \t\t \t\telse $(\"#bus-location-picker\").text(text+'|'+time+\"^\"+latlng);\r\n \t\t // Set marker\r\n \t\t map.addOverlay(new GMarker(latlng));\r\n \t\t // Get lat,lng\r\n \t\t lat = latlng.lat();\r\n \t\t lng = latlng.lng();\r\n \t\t // Draw Line\r\n \t\t if(count>1)\r\n \t\t\t {\r\n \t\t\t aline = getLine1(tmplat,tmplng,lat,lng);\r\n \t\t\t map.addOverlay(aline);\r\n \t\t\t }\r\n \t\t tmplat = lat;\r\n \t\t tmplng = lng;\r\n \t\t \r\n \t\t }\r\n \t});\r\n }", "title": "" }, { "docid": "01b95f1bbb8af65afebf1ff7285baffa", "score": "0.66378", "text": "function drawMapWithSurvivorLoc() {\n controller.data.lonlat = 'POINT (' + controller.survivor.lat + ' ' + controller.survivor.lng + ')';\n var myLatlng = new google.maps.LatLng(controller.survivor.lat, controller.survivor.lng);\n\n // map options\n var mapOptions = {\n scrollwheel: false,\n center: { lat: controller.survivor.lat, lng: controller.survivor.lng },\n zoom: 13\n };\n\n // set map\n var map = new google.maps.Map(document.getElementById('google-map'), mapOptions);\n\n // set marker\n marker = new google.maps.Marker({\n draggable: true,\n position: myLatlng,\n title: 'I\\'m here!'\n });\n marker.setMap(map);\n addMarkerListener(marker); \n }", "title": "" }, { "docid": "2d53836956fcba0acbf65ed24ebbec23", "score": "0.660915", "text": "function drawGeofence() {\n //clearLists();\n indexPoint = -1;\n action = \"add\";\n $(\"#pcursor\").text(action);\n\n gpsLatLon = new GLatLng(47.643742,6.8565076);\n map.setCenter(gpsLatLon, 17);\n map.setUIToDefault();\n //map.clearOverlays();\n GEvent.clearListeners(map);\n GEvent.addListener(map, \"click\", getPoint);\n\n }", "title": "" }, { "docid": "10419abc82135cc1ba09e49227417849", "score": "0.65920806", "text": "function drawMap(map,lat,long,info) {\r\n \t\r\n \tif (lat == 0)\r\n \t\treturn;\r\n \tvar marker = createMarker(lat,long,info);\r\n \tvar point = new GLatLng(lat,long);\r\n \tmap.openInfoWindowHtml(point,info);\r\n \tmap.addOverlay(marker);\r\n \t\r\n \r\n }", "title": "" }, { "docid": "7d95b44c4673d8dc84388bd5ae0e90ce", "score": "0.6581123", "text": "function showMarkers() { setAllMap(map);}", "title": "" }, { "docid": "21a416fc00f31753902071c0739d9704", "score": "0.6563416", "text": "function drawMap(){\n\t\tvar mapX = 0;\n\t\tvar mapY = 0;\n\t\tif (mapIsLoaded)\n\t\t{\n\t\t\tfor(var j = 0; j < mapLength; j++)\n\t\t\t{\n\t\t\t\tif(typeof map[j] !== 'undefined')\n\t\t\t\t{\n\t\t\t\t\t\tswitch(map[j]) {\n\t\t\t\t\t\t\tcase '_': //ground token\n\t\t\t\t\t\t\t\tcreateTile(mapX,mapY);\n\t\t\t\t\t\t\t\tmapX+=brickSize;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'O': //air token\n\t\t\t\t\t\t\tcase ' ':\n\t\t\t\t\t\t\t\tmapX+=brickSize;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase ']': //custom newline token\n\t\t\t\t\t\t\t\tmapY+=brickSize; \n\t\t\t\t\t\t\t\tmapX=0;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\talert(\"MAP CONTAINS INVALID CHARACTERS\");\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9788cc2ff8b9e004dc2cc8ccb4c080b9", "score": "0.654128", "text": "function initMap(){ \n map = new google.maps.Map(\n document.getElementById(\"map\"), {\n zoom: 13, \n center: SouthStation \n }\n );\n renderStops();\n renderRedline(); \n getMyLocation();\n}", "title": "" }, { "docid": "e7238af45ad7062cf79c148ff26557e6", "score": "0.6522423", "text": "function drawMapAreas()\n {\n \n globals.ctx.drawImage(images[\"Map\"], 0,0,600,414);\n \n globals.ctx.strokeStyle = '#00FFFF';\n globals.ctx.lineWidth = 3;\n \n \n //Draw outlines of map areas\n for(let key in areaChoices){\n globals.ctx.save();\n let mapArea = areaChoices[key];\n\n //Only draw the quad icon during Polling\n if(mapArea.name != \"Quad\" || globals.isPoll){\n \n if(globals.isCurrentAreaHover == mapArea.id){\n globals.ctx.strokeStyle = '#FFFF00';\n \t globals.ctx.lineWidth = 6;\n }\n drawAreaPath(mapArea);\n globals.ctx.stroke();\n }\n globals.ctx.restore();\n }\n\n }", "title": "" }, { "docid": "1b35f3be4c579ae8e4d3aed9f270600a", "score": "0.65007263", "text": "function drawMap(lat, lng) {\n mymap.flyTo([lat, lng], 13);\n marker.setLatLng([lat, lng]);\n loaded();\n}", "title": "" }, { "docid": "b37f825fda5ac7247c4d9c2681e2b9c7", "score": "0.6493488", "text": "function DrawMiniMap()\n{\n\tvar localPosition = WorldToLocal(mapOrigin.x, mapOrigin.y, 1);\n\tvar color=0x47474F;\n\tvar size= miniMapBorder;\n\te.lineStyle(size, color);\n\te.beginFill(0x40420);\n\te.drawCircle(mapOrigin.x, mapOrigin.y, miniMapRadius);\n\te.endFill();\n}", "title": "" }, { "docid": "d6029f5f15c70089eafbf3adfd95c92e", "score": "0.6462979", "text": "function showMap() {\n\n }", "title": "" }, { "docid": "5c2c61cc0f96511b0020d902f060a5c2", "score": "0.6461683", "text": "draw() {\n fill(0);\n noStroke();\n rect(-MAP_WIDTH, 0, MAP_WIDTH, MAP_HEIGHT);\n\n fill(0);\n noStroke();\n rect(-MAP_WIDTH, 0, MAP_WIDTH * 2, -1000);\n\n fill(0);\n noStroke();\n rect(-MAP_WIDTH, MAP_HEIGHT, MAP_WIDTH * 2, 1000);\n\n fill(0);\n noStroke();\n rect(MAP_WIDTH, -400, 1000, MAP_HEIGHT + 2000);\n\n noFill();\n stroke(\"rgb(30,255,30)\");\n strokeWeight(1);\n rect(0, 0, MAP_WIDTH, MAP_HEIGHT);\n }", "title": "" }, { "docid": "0ee2d48f86f2bd13950287488a3b8df8", "score": "0.64486855", "text": "function click_map(e)\r\n{\r\n if (poly_draw)\r\n {\r\n add_poly_marker(e.latlng);\r\n if (poly_markers.length > 2)\r\n {\r\n poly_to_scratchpad();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "38bec5f639b47fb4819b9ca33b455537", "score": "0.6420869", "text": "function drawMap(){\r\n\timageMode(CORNER);\r\n\tfor(var i = 0; i < 17; i++){\r\n\t\tmap1Set = map1[i].split(\" \");\r\n\t\tfor(var j = 0; j < 17; j++){\r\n\t\t\tif(map1Set[j]>0){\r\n\t\t\t\timage(tiles[map1Set[j]], j*46, i*46);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "dddf08db6c9912062e55646bdea3bd3f", "score": "0.6412809", "text": "function drawMap() {\n CP.forEach(function (d, i) {\n let nmprv = d[\"Features Properties Provinsi\"].toUpperCase();\n if (TOTAL_PROVINCE_COUNT[nmprv]) {\n let act = \"activity\";\n if (TOTAL_PROVINCE_COUNT[nmprv] > 1) {\n act = \"activities\";\n }\n let radius = TOTAL_PROVINCE_COUNT[nmprv];\n if (radius < 5) {\n radius = 5;\n }\n L.circleMarker([d[\"Latitude\"], d[\"Longitude\"]], {\n radius: radius,\n fill: \"#20BFB3\",\n weight: 1,\n fillOpacity: 0.4,\n color: \"#20BFB3\",\n })\n .bindPopup(\n \"<b>\" + nmprv + \"</b>: \" + TOTAL_PROVINCE_COUNT[nmprv] + \" \" + act\n )\n .on(\"mouseover\", function () {\n this.openPopup();\n })\n .on(\"mouseout\", function () {\n this.closePopup();\n })\n .addTo(map);\n }\n });\n}", "title": "" }, { "docid": "00d6357515b9556e1ebf8f859d56372b", "score": "0.6409854", "text": "function draw_map(map) {\n for (let i = 0; i < map.length; i++) {\n let x1 = parseInt(i % 100);\n let x2 = parseInt(i / 100);\n drawcell(x1, x2, map[i]);\n }\n}", "title": "" }, { "docid": "de5488e07de9eb26358bffe6787a0636", "score": "0.6346404", "text": "function drawMap(weatherObject) {\n\tvar lat = weatherObject.location.lat;\n\tconsole.log(lat);\n\n\tvar lng = weatherObject.location.lon;\n\tvar Latlng = new google.maps.LatLng(lat, lng);\n\tvar mapOptions = {\n\t\tzoom: 6,\n\t\tcenter: Latlng\n\t}\n\tvar map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\t\n\tvar marker = new google.maps.Marker({\n\t\tposition: Latlng,\n\t\tmap: map,\n\t\ttitle: 'Hi there!'\n\t});\n}", "title": "" }, { "docid": "de5488e07de9eb26358bffe6787a0636", "score": "0.6346404", "text": "function drawMap(weatherObject) {\n\tvar lat = weatherObject.location.lat;\n\tconsole.log(lat);\n\n\tvar lng = weatherObject.location.lon;\n\tvar Latlng = new google.maps.LatLng(lat, lng);\n\tvar mapOptions = {\n\t\tzoom: 6,\n\t\tcenter: Latlng\n\t}\n\tvar map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\t\n\tvar marker = new google.maps.Marker({\n\t\tposition: Latlng,\n\t\tmap: map,\n\t\ttitle: 'Hi there!'\n\t});\n}", "title": "" }, { "docid": "e2bb449948e8984f30253b438cc736a7", "score": "0.6344268", "text": "function showOverlays() {\n setAllMap(map);\n}", "title": "" }, { "docid": "e2bb449948e8984f30253b438cc736a7", "score": "0.6344268", "text": "function showOverlays() {\n setAllMap(map);\n}", "title": "" }, { "docid": "f7a10efcfa97663f97ec5569560d72a1", "score": "0.6342944", "text": "function showMapMDTECK(){\r\n\tvar usuario=$(\"#usuario\").val();\r\n\tvar longitud=$(\"#longitud\").val();\r\n\tvar latitud=$(\"#latitud\").val();\r\n\tvar direccion=$(\"#direccion\").val();\r\n\tvar metodo=$(\"#metodo\").val();\r\n\tvar distrito=$(\"#distrito\").val();\r\n\tvar infoTemplate = new esri.InfoTemplate(\"Reporte de Localizacion\", \"Celular: \"+usuario+\"<br>Distrito:\"+distrito+\"<br>Direccion: <td>\"+direccion+\"</tr></td><br><tr>Metodo: <td>\"+metodo+\"</tr></td>\");\r\n\tvar pt=new esri.geometry.Point(longitud,latitud,map.spatialReference);\r\n\tvar g = new esri.Graphic(pt,symbol_priv);\r\n\tg.setInfoTemplate(infoTemplate);\r\n\tmap.graphics.add(g);\r\n\tmap.centerAt(pt);\t\t\r\n}", "title": "" }, { "docid": "4fc05758fd014f67ddff459956f20700", "score": "0.6332639", "text": "function draw() {\n for(var i = 0; i < map.length; i++) {\n for(var j = 0; j < map[i].length; j++) {\n setFillStyle(map[i][j]);\n ctx.fillRect(i * cellSize, j * cellSize, cellSize, cellSize);\n }\n }\n}", "title": "" }, { "docid": "9961dd5587c61811f5dd942ca8ba8cea", "score": "0.6332582", "text": "drawMap() {\n if (this.map && this.map.update) {\n this.map.draw(this.game.ctx)\n }\n }", "title": "" }, { "docid": "bd2c3595d36e740d7ab4ea2d85ee8ddc", "score": "0.63308007", "text": "function renderMap(coords) {\n mymap.setView(coords, 13);\n L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png').addTo(mymap);\n var marker = L.marker(coords).addTo(mymap);\n}", "title": "" }, { "docid": "3bab5ef50ccc3ca4574a97d1ba7c483e", "score": "0.6325875", "text": "function initialize(koordinatMap) {\n var drawingManagerHistory ='';\n var koordinatTengah = parseInt(koordinatMap.length/2);\n var korrdinatCenter = koordinatMap[koordinatTengah].split(\",\");\n\n var mapHistory = new google.maps.Map(document.getElementById('map-drawing'), {\n zoom: 18,\n mapTypeId: 'terrain',\n center: {lat: parseFloat(korrdinatCenter[0]),lng: parseFloat(korrdinatCenter[1])},\n disableDefaultUI: true,\n mapTypeControl:true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.BOTTOM_LEFT\n },\n optimized: false, \n zoomControl: true\n });\n \n var polyOptions = {\n strokeWeight: 0,\n fillOpacity: 0.45,\n editable: true\n };\n\n // Creates a drawing manager attached to the map that allows the user to draw\n // markers, lines, and shapes.\n drawingManagerHistory = new google.maps.drawing.DrawingManager({\n drawingMode: google.maps.drawing.OverlayType.POLYGON,\n drawingControl: true,\n drawingControlOptions: {\n position: google.maps.ControlPosition.TOP_CENTER,\n drawingModes: ['polygon']\n },\n polygonOptions: polyOptions,\n map: mapHistory\n });\n\n google.maps.event.addListener(drawingManagerHistory, 'overlaycomplete', function(e) {\n if (e.type != google.maps.drawing.OverlayType.MARKER) {\n // Switch back to non-drawing mode after drawing a shape.\n drawingManagerHistory.setDrawingMode(null);\n\n // Add an event listener that selects the newly-drawn shape when the user\n // mouses down on it.\n var newShape = e.overlay;\n newShape.type = e.type;\n google.maps.event.addListener(newShape, 'click', function() {\n setSelection(newShape);\n });\n var area = google.maps.geometry.spherical.computeArea(newShape.getPath());\n // document.getElementById(\"area\").innerHTML = \"Area =\" + area;\n setSelection(newShape);\n }\n });\n \n // //----------------ini untuk draw map dengan area seperti segitiga bermuda\n // // var bermudaTriangle = new google.maps.Polygon({\n // // paths: [koordinatMap, innerCoords],\n // // strokeColor: '#FF0000',\n // // strokeOpacity: 0.8,\n // // strokeWeight: 2,\n // // fillColor: '#FF0000',\n // // fillOpacity: 0.35\n // // });\n // //--------------------------------------------------------------------\n\n //------------------maps draw line----------------------------------------\n for(var i=0; i<koordinatMap.length; i++){\n var koordinatDalam = koordinatMap[i].split(\";\");\n for(var j=0; j<koordinatDalam.length; j++){\n var nextIndex = parseInt(j)+parseInt(1);\n if(nextIndex>=koordinatDalam.length){\n }else{\n var startCoords = koordinatDalam[j].split(\",\");\n var startPt = new google.maps.LatLng(startCoords[0],startCoords[1]);\n var endCoords = koordinatDalam[nextIndex].split(\",\");\n var endPt = new google.maps.LatLng(endCoords[0],endCoords[1]);\n \n var bermudaTriangle = new google.maps.Polyline({\n path: [startPt, endPt],\n strokeColor: 'red',\n strokeWeight: 2,\n strokeOpacity: 1\n });\n bermudaTriangle.setMap(mapHistory); \n }\n }\n \n }\n //--------------------------------------------------------------------\n\n //--------------- kalkukasi manual per koordinat\n var areaku=0;\n\n var mbek = [\n [112.755947,-7.251440],\n [112.756615,-7.251595],\n [112.756371,-7.252548 ],\n [112.755718,-7.252387],\n [112.755947,-7.251440]\n ];\n Math.radians = function(degrees) {\n return degrees * Math.PI / 180;\n };\n\n for(var i=0; i<mbek.length-1 ;i++){\n var b = i +1;\n areaku = areaku + Math.radians(mbek[b][0] - mbek[i][0]) * (2 + Math.sin(Math.radians(mbek[i][1])) +\n Math.sin(Math.radians(mbek[b][1])));\n }\n areaku = Math.abs(areaku * 6378137.0 * 6378137.0 / 2.0);\n var n = areaku.toFixed(2);\n // alert(n);\n //--------------------------------------------------------------------\n\n google.maps.event.addListener(drawingManagerHistory, 'drawingmode_changed', clearSelection);\n google.maps.event.addListener(mapHistory, 'click', clearSelection);\n google.maps.event.addDomListener(document.getElementById('delete-button'), 'click', deleteSelectedShape);\n \n }", "title": "" }, { "docid": "eb67d8eb251fe35caae81bc469e6bb2a", "score": "0.6320124", "text": "function drawMap() {\n let tile = new ol.layer.Tile({\n source: new ol.source.OSM()\n });\n let view = new ol.View({\n center: ol.proj.fromLonLat([inilon, inilat]),\n zoom: 12\n });\n map = new ol.Map({\n target: 'mymap',\n layers: [tile],\n view: view\n });\n}", "title": "" }, { "docid": "bf99eeead3f8805b40bdeba12c60cc31", "score": "0.63170797", "text": "function updateMap(ctx){\n // Redraw map\n ctx.translate(-(5 + 0.5 *g_grid_map.cellsize),-(5 + 0.5 * g_grid_map.cellsize));\n initMap(ctx);\n\n /** @todo Draw dots */\n\n // Draw PacMan\n g_gameObjects.agents[0].render(ctx);\n}", "title": "" }, { "docid": "0275c2fe8a73cb2216ffef7f8cf60a2c", "score": "0.631058", "text": "function addToMap(evt) {\n var geometryInput = evt.geometry;\n var tbDrawSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,\n new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.2]));\n map.graphics.clear();\n var graphicPolygon = new Graphic(geometryInput, tbDrawSymbol);\n map.graphics.add(graphicPolygon);\n selectCities(geometryInput);\n }", "title": "" }, { "docid": "7d5da967307a97ea8abf1798f18a0745", "score": "0.6305218", "text": "drawMarker(markerLoc){\n this.context.beginPath();\n this.context.lineWidth='1';\n this.context.strokeStyle='#000000';\n this.context.moveTo(markerLoc, 50);\n this.context.lineTo(markerLoc, 130);\n this.context.stroke();\n this.annotateMarker(markerLoc);\n }", "title": "" }, { "docid": "8ab19553c452f9565fb4d9539041da98", "score": "0.629645", "text": "function showPositionMap(coordinates) {\n if(currPos)\n currPos.remove();\n map.setView(coordinates,14);\n //Imposta posizione corrente del marker\n currPos = L.marker(coordinates, {draggable:'true'}); //il marker si può spostare\n currPos.setIcon(redIcon);\n //Aggiunge popup al marker\n currPos.bindPopup('Where I Am').openPopup();\n //Aggiunge marker alla mappa\n currPos.addTo(map);\n //Gestione eventi\n currPos.on('click', handleMarkerClick);\n\n }", "title": "" }, { "docid": "5aa970bf6d843cee7d89639fdb039907", "score": "0.62876546", "text": "function showMarkers() {\r\n\t setAllMap(map);\r\n\t}", "title": "" }, { "docid": "b1be0d6c881519f7cf9b083dc5c1b6a2", "score": "0.6285397", "text": "function map_draw(){\n\n\tvar mapOptions = {\n\t\tcenter: { lat: 51.520614, lng: -0.13002},\n\t\tzoom: 2,\n\t\tmapTypeControl: false,\n };\n \n\tvar map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n \n //////////////////////////////////////////////////////////\n //switch to decide if an eprints interface for input boxes \n //or a map interface. The drawing menu will still added\n var eprintsInterface = true;\n //////////////////////////////////////////////////////////\n \n var numRectangles = 0;\n\tvar markers = [];\n\tvar sMarkers = [];\n \n var dm = create_draw_manager(map);\n\t\n\t//call to all functions needed to add the menu to the map.\n setInterface(getNumFields(), eprintsInterface);\n\t\n\tfunction setInterface(numFields, eprintsInterface)\n\t{\n\t\taddBoxesMap(map, numFields, eprintsInterface);\n\t\tset_menu(dm, numFields, map); \n\t}\n\t\n\t//set up the initial latlng for setting the global latlng\n\tif(LocationsObject.getLocationEmpty(0) == false){\n\t\t\n\t\tvar location = LocationsObject.getLocation(0);\n\t\t\n\t\tvar ne = location.getBounds().getNorthEast();\n\t\tvar sw = location.getBounds().getSouthWest();\n\t\t\n\t\tLocationsObject.setNewWorkingLatLng(ne.lat(), ne.lng(), sw.lat(), sw.lng());\n\t}\n\t\n\t/* search box functionality */\n\tvar input = (document.getElementById('pac-input'));\n\t\n\tmap.controls[google.maps.ControlPosition.TOP_LEFT].push(input);\n\n\tvar searchBox = new google.maps.places.SearchBox((input));\n\n\tgoogle.maps.event.addListener(searchBox, 'places_changed', function() {\n\t\tvar places = searchBox.getPlaces();\n\n\t\tif (places.length == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tfor (var i = 0, marker; marker = markers[i]; i++)\n\t\t{\n\t\t\tmarker.setMap(null);\n\t\t}\n\n\t\t// For each place, get the icon, place name, and location.\n\t\tvar bounds = new google.maps.LatLngBounds();\n\t\t\n\t\tfor (var i = 0, place; place = places[i]; i++)\n\t\t{\n\t\t\tvar image = {\n\t\t\t\turl: place.icon,\n\t\t\t\tsize: new google.maps.Size(171, 171),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(17, 34),\n\t\t\t\tscaledSize: new google.maps.Size(25, 25)\n\t\t\t};\n\n\t\t\t// Create a marker for each place.\n\t\t\tvar markerSearch = new google.maps.Marker({\n\t\t\t\t map: map,\n\t\t\t\t icon: image,\n\t\t\t\t title: place.name,\n\t\t\t\t position: place.geometry.location\n\t\t\t });\n\n\t\t\tsMarkers.push(markerSearch);\n\t\t\tbounds.extend(place.geometry.location);\n\t\t}\n\t\tmap.fitBounds(bounds);\n\t});\n\t\n\t//End of search box functionality\n\tgoogle.maps.event.addListener(map, 'bounds_changed', function() {\n\t\tvar bounds = map.getBounds();\n\t\tsearchBox.setBounds(bounds);\n\t});\n}", "title": "" }, { "docid": "944ec2c854ad96a5951289f41899e856", "score": "0.62699205", "text": "function drawMap(world) {\n\n //(note that projection is global!\n // updateMap() will need it to add the winner/runner_up markers.)\n\n projection = d3.geoConicConformal().scale(150).translate([400, 350]);\n //console.log(world);\n // ******* TODO: PART IV *******\n\n // Draw the background (country outlines; hint: use #map)\n // Make sure and add gridlines to the map\n\n // Hint: assign an id to each country path to make it easier to select afterwards\n // we suggest you use the variable in the data element's .id field to set the id\n\n // Make sure and give your paths the appropriate class (see the .css selectors at\n // the top of the provided html file)\n var path = d3.geoPath()\n .projection(projection);\n\n d3.select(\"#map\").selectAll(\"path\")\n .data(topojson.feature(world, world.objects.countries).features)\n .enter()\n .append(\"path\")\n .attr(\"d\", path)\n .classed(\"countries\",true)\n .attr(\"id\",function (d) {\n return d.id;\n });\n\n var graticule = d3.geoGraticule();\n\n d3.select(\"#map\")\n .append('path')\n .datum(graticule)\n .attr('class', \"grat\")\n .attr('d', path);\n}", "title": "" }, { "docid": "b854ea65460e7ad00fc02c6ad84740f8", "score": "0.6265002", "text": "function drawMap() {\n\t//startX + startY refers to the tile number that the camera will start drawing from\n\tvar startX = Math.floor(camera.x);\n\tvar startY = Math.floor(camera.y);\n\n\t//which pixel the drawing will start from\n\tvar [screenStartX, screenStartY] = spaceToScreen(startX, startY);\n\tscreenStartX = Math.floor(screenStartX);\n\tscreenStartY = Math.floor(screenStartY);\n\t\n\t//sizeX + sizeY refers to the number of tiles that will be drawn\n\tvar sizeX = Math.ceil(canvas.width / camera.scale) + 1;\n\tvar sizeY = Math.ceil(canvas.height / camera.scale) + 1;\n\n\tfor (var y=Math.max(startY, 0); y<Math.min(startY+sizeY, data_map.length); y++) {\n\t\tfor (var x=Math.max(startX, 0); x<startX+sizeX; x++) {\n\t\t\tdrawMapSquare(screenStartX + (x - startX) * camera.scale, screenStartY + (y - startY) * camera.scale, data_map[y][x], camera.scale + 1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "271c2a0b1899bfb09c1881723a195441", "score": "0.6255388", "text": "function drawMap(latlng) {\n var myOptions = {\n zoom: 12,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\t\t\n\n\t\t//drawing map on webpage @ id map-canvas\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), myOptions);\n\t\t\n\t\t//This is used to highlight the blue skin bay area, by placing a red overlay over the location, this halps users find blueskin bay ont he map when they have moved away from it.\n\t\tvar blueskinArea = new google.maps.Circle({\n\t\t strokeColor: '#FF0000',\n\t\t\tstrokeOpacity: 0.8,\n\t\t\tstrokeWeight: 2,\n\t\t\tfillColor: '#FF0000',\n\t\t\tfillOpacity: 0.35,\n\t\t\tmap: map,\n\t\t\tcenter:{ lat:-45.7307748, lng: 170.5857255},\n\t\t\tradius: 6000\n\t\t\n\t\t});\n\t\t\n\t\t//This waits for the map to be at idle after loading the web page.Tthen Runs what ever is inside the first set of brackets.\n\t\tgoogle.maps.event.addListenerOnce( map, 'idle', function() {\n\t\t\t\t\n\t\t\t\t//print message to console, useful for debugging.\n\t\t\t\t//console.log('map at idle');\n\t\t\t\t\n\t\t\t\t\t//This loads data from our webserver and draws markers from it on the map. \n\t\t\t\t\tdrawAllMarkers();\n\t\t\t\t\t\t\n\t\t\t\t});\n\n \n }", "title": "" }, { "docid": "3c3260b09a65c4dd6afa6f58dca1bedb", "score": "0.6245137", "text": "draw() {\n\n\t\t// calculate which rows/cols are visible.\n\t\tlet leftCol = Math.floor(this.x / this.map.scaled); \n\t\tlet rightCol = Math.ceil((this.x + this.w )/ this.map.scaled);\n\t\tlet topRow = Math.floor(this.y / this.map.scaled);\n\t\tlet bottomRow = Math.ceil((this.y + this.h) / this.map.scaled);\n\n\t\tfor (var c = leftCol; c <= rightCol; c++) {\n\t\t\tfor (var r = topRow; r <= bottomRow; r++) {\n\n\t\t\t\tvar xyTarget = this.mapToCam(c*this.map.scaled, r*this.map.scaled);\n\n\t\t\t\tif(this.hasBG) {\n\t\t\t\t\tvar bgtile = this.bgmap.getTile(c,r);\n\t\t\t\t\tthis.drawTile(bgtile,xyTarget);\n\t\t\t\t}\n\n\t\t\t\tvar tile = this.map.getTile(c,r);\n\t\t\t\tthis.drawTile(tile,xyTarget);\n\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "136bd24a29cb9ff6fdbedc3e0b1137a8", "score": "0.6241517", "text": "function goktm(){\r\n\tmap.setView([27.6964, 85.3338], 14);\r\n}", "title": "" }, { "docid": "226836cb13fb9f415c10f7d21ac17f7c", "score": "0.6237621", "text": "function drawMap() {\n for (let y = 0; y < map.length; y++) {\n for (let x = 0; x < map[y].length; x++) {\n let m = map[y][x];\n if (m.sprite.sprite != undefined) {\n image(m.sprite.sprite, m.x, m.y, m.size, m.size);\n }\n }\n }\n}", "title": "" }, { "docid": "438a50e0b6f5b174dd510e5356859dcf", "score": "0.6235988", "text": "function drawMap(latlng) {\n var myOptions = {\n zoom: 15,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var map = new google.maps.Map(document.getElementById(\"map-canvas1\"), myOptions);\n // Add an overlay to the map of current lat/lng\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n title: \"Greetings!\"\n });\n }", "title": "" }, { "docid": "89cb110125e61c0f928844945bc32f52", "score": "0.62358856", "text": "drawMap(world) {\n\n //(note that projection is a class member\n // updateMap() will need it to add the winner/runner_up markers.)\n\n // ******* TODO: PART IV *******\n\n // Draw the background (country outlines; hint: use #map)\n // Make sure and add gridlines to the map\n\n var geoPath = d3.geoPath()\n .projection(this.projection);\n\n var map = d3.select('#map')\n .attr('width', 1000)\n .attr('height', 500);\n\n map.selectAll('path')\n .data(topojson.feature(world, world.objects.countries).features)\n .enter()\n .append('path')\n .attr('class', 'countries')\n .attr('id', function (d) {\n return d.id;\n })\n .attr('d', geoPath);\n\n map.append('path')\n .datum(d3.geoGraticule().stepMinor([10, 10]))\n .attr('id', 'grid')\n .attr('class', 'map-grid')\n .attr('d', geoPath);\n\n }", "title": "" }, { "docid": "10ea4e1489fde7108eaf8f25ea9657e0", "score": "0.62354624", "text": "function draw_markers(){\n // Draw boundaries\n draw_boundaries(boundaries);\n\n // Draw center markers\n if((show == 'cen' || show == 'all')){\n draw_cenmarkers(cenmarkers);\n }\n\n // Draw individual markers\n if((show == 'ind' || show == 'all')){\n draw_indmarkers(indmarkers);\n }\n\n console.log(markers.length);\n // Pan to center if no markers\n if(markers.length == 0){\n map.panTo(center);\n }\n else{\n map.fitBounds(markerBounds);\n }\n}", "title": "" }, { "docid": "43368b51bdabf94639ff73f4895c126a", "score": "0.6233516", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "38c3d10eebd8c91b088f32da24772159", "score": "0.6232389", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "38c3d10eebd8c91b088f32da24772159", "score": "0.6232389", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "38c3d10eebd8c91b088f32da24772159", "score": "0.6232389", "text": "function showMarkers() {\n setAllMap(map);\n}", "title": "" }, { "docid": "ca32fdadb8f778db12955743bee1062c", "score": "0.62284493", "text": "function drawPoint() {\r\n stroke(79, 121, 66);\r\n strokeWeight(1);\r\n let px = map(x, -2.1820, 2.6558, 0 , width);\r\n let py = map(y, 0 , 9.9983, height, 0 );\r\n point(px, py);\r\n}", "title": "" }, { "docid": "f0bad45cd0e722ef522e859528f354e8", "score": "0.6225676", "text": "function drawMap(countiesData, easementsData, cpEasementsData) {\n\n drawCounties(countiesData);\n drawEasements(easementsData);\n drawcpEasements(cpEasementsData);\n \n\n \n \n } //end of drawMap function", "title": "" }, { "docid": "3c30e039b4f667e04daf934eeb884258", "score": "0.62203", "text": "function printCoords() {\n var xCoordinate = (Math.round(mapArray[mapID].playerXPos / mapArray[mapID].tileSize));\n var yCoordinate = (Math.round(mapArray[mapID].playerYPos / mapArray[mapID].tileSize));\n \n\n\t \n\t /*This is an attempt at changing the current position tile to the next one. it is completely screwed up, but once I fix it, map making will be a piece of cake. I will also turn off collision\n\t for the character with this so he can \"fly\" and do a noclip\n\t \n\t */\n\t\t//if(xCoordinate === 5 && yCoordinate === 23){\n\t\t//\tplayerTouchedItem = true;\n\t\t//}\n context.font = \"30px times new roman\";\n context.fillStyle = \"red\";\n context.fillText(\"y:\" + yCoordinate, mapArray[mapID].playerXPos - 400, mapArray[mapID].playerYPos - 220);\n context.fillText(\"x:\" + xCoordinate, mapArray[mapID].playerXPos - 400, mapArray[mapID].playerYPos - 250); //coordinates follow npc and display as XY:N\n\n }", "title": "" }, { "docid": "bf217b523552324b5470035081c18547", "score": "0.6219934", "text": "function showMarkers() {\n\t setAllMap(map);\n\t}", "title": "" }, { "docid": "60b94c003e50e9ca80da0ab3e1504a2d", "score": "0.62181103", "text": "function setupMap(){\r\n\t\r\n\tif(polylines!=null){\r\n\t\tfor (i = 0; i < polylines.length; i++) { \r\n\t \t\tpolylines[i].setMap(null);\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(markers!=null){\r\n\t\tfor (i = 0; i < markers.length; i++) { \r\n\t\t\tmarkers[i].setMap(null);\r\n\t\t}\r\n\t}\r\n\t\r\n\tmarkers=[]; \r\n\tpolylines=[];\r\n\t\r\n \tmap.fitBounds(latLngBounds);\r\n \t\r\n\r\n \t//show route on map\r\n \t\r\n \t\r\n \tfor (i = 1; i < tempPath.length; i++) { \r\n \t\taddLineArray([tempPath[i-1],tempPath[i]]);\t \r\n\t}\r\n \t\r\n \tfor (i = 0; i < polylines.length; i++) { \r\n \t\tpolylines[i].setMap(map); \r\n\t}\r\n \t\r\n //show positions on map\r\n \t\r\n \tfor (i = 0; i < tempPoints.length; i++) { \r\n \t\taddMarkerArray(tempPoints[i]);\t\t \r\n\t}\r\n \t\r\n \tfor (i = 0; i < markers.length; i++) { \r\n \t\tmarkers[i].setMap(map); \r\n\t}\r\n \t\r\n \t\r\n \tif(page==\"user\"){\r\n \t\tshowInfoUser();\r\n\t}else{\r\n\t\tshowInfoAdmin();\t\r\n\t}\r\n \t \t\r\n}", "title": "" }, { "docid": "fc25542947cfc09c979c53ebf801ef68", "score": "0.62160903", "text": "function draw_map() {\n\t\t// Get user selections (determine color of graph)\n\t\tlet color_by = getSelection_infoColoring();\n\t\tlet year = getSelection_currentYear();\n\n\t\t// Establish color scale\n\t\t//// Range of colors\n\t\tlet colorScaleRange = [DEFAULT_GREY, \"#d4b7ff\", \"#c8a3ff\", \"#c298ff\", \"#bc8eff\", \"#b07aff\", \"#a465ff\", \"#9e5bff\", \"#9851ff\", \"#8c3dff\", \"#7e28fc\" ];\n\t\tvar colorScaleDomain = null;\n\t\t//// Domain of values\n\t\tif (color_by == 'property') {\n\t\t\tcolorScaleDomain = [0, 50, 100, 150, 200, 250, 300, 350, 400, 450];\n\t\t}\n\t\telse {\n\t\t\t// Age default\n\t\t\tcolorScaleDomain = [14, 16, 18, 20, 22, 24, 26, 28, 30];\n\t\t}\n\t\tvar colorScale = d3.scaleThreshold()\n\t\t\t.range(colorScaleRange)\n\t\t\t.domain(colorScaleDomain);\n\n\t\t// Color in map\n\t\td3.selectAll(\".county\").style(\"fill\", function(d) {\n\t\t\t// Shade in map based on selected parameters\n\t\t\tvar val = null;\n\t\t\tif (d.id in ua_bycounty_stats) {\n\t\t\t\tlet county_data = ua_bycounty_stats[d.id];\n\t\t\t\t// By_County statistics\n\t\t\t\tlet total = county_data['total'];\n\t\t\t\t// Age\n\t\t\t\tlet averageAgeAtWarStart = (county_data['averageBirthYear'] != null) ? CIVIL_WAR_START_YEAR - county_data['averageBirthYear'] : null;\n\t\t\t\t// Literacy\n\t\t\t\tlet literacyRate = format_decimal(1 - county_data['illiterateCount'][year]/total);\n\t\t\t\t//// Married\n\t\t\t\tlet marriedPercent = format_decimal(county_data['marriedCount'][year]/total);\n\t\t\t\t//// Personal property\n\t\t\t\tlet averagePersonalProperty = (county_data['averagePersonalProperty'][year] != null) ? Math.round(county_data['averagePersonalProperty'][year]*100)/100 : null;\n\t\t\t\t// Set coloring gradient\n\t\t\t\tif (color_by == 'property') {\n\t\t\t\t\tval = averagePersonalProperty;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tval = averageAgeAtWarStart;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Make sure we have valid value\n\t\t\tif (val == null) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn colorScale(val);\n\t\t});\n\n\t\t//\n\t\t// Show color scale on map\n\t\t//\n\t\t//// Set axis ticks\n\t\tmapColorLegendScaleX.domain([colorScaleDomain[0], colorScaleDomain[colorScaleDomain.length-1]]);\n\t\tmapColorScaleGradientBar.scale(mapColorLegendScaleX)\n\t\t\t.ticks(10);\n\t\td3.select(\"#map-uadata-legendTicks\").call(mapColorScaleGradientBar);\n\n\t\t//// Display color scale bar on map\n\t\td3.select(\"#map-uadata-colorScale\").selectAll(\"stop\")\n\t\t\t.data( colorScale.range() )\n\t\t\t.enter().append(\"stop\")\n\t\t\t.attr(\"offset\", function(d,i) { return i/(colorScale.range().length-1); })\n\t\t\t.attr(\"stop-color\", function(d) { return d; });\n\t}", "title": "" }, { "docid": "6b8dc77c9a7849924beafb81dfc7120c", "score": "0.6209654", "text": "displayMap() { \n for (let j = mapPos.x - floor(COLS/2), xPos = 0; xPos < COLS; j++, xPos++) {\n for (let i = mapPos.y - floor(ROWS/2), yPos = 0; yPos < ROWS; i++, yPos++) {\n fill(tileColor(this.grid[i][j]));\n noStroke();\n rect(xPos * groundUnit.width, yPos * groundUnit.height, groundUnit.width + 2, groundUnit.height + 2);\n\n if (this.grid[i][j] === \"@\") {\n determineNPC().display(xPos * groundUnit.width, yPos * groundUnit.height);\n }\n }\n }\n }", "title": "" }, { "docid": "6e341578441c6d78fcd1587767c942a9", "score": "0.62080145", "text": "function drawPins(data) {\n var places = new Backbone.GoogleMaps.LocationCollection(data);\n\n // Delete markers if there were previous markers on the map\n if (markerCollectionView) {\n markerCollectionView.closeChildren();\n }\n\n // Render Markers\n markerCollectionView = new Backbone.GoogleMaps.MarkerCollectionView({\n collection: places,\n map: map\n });\n markerCollectionView.render();\n }", "title": "" }, { "docid": "7922c64039590d489070bbd95af67fb1", "score": "0.6207377", "text": "function setNewMap(data){\n document.getElementById(\"map_id\").value = data.id;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n for (data_val in data.points){\n drawCircle(data.points[data_val]);\n }\n for (data_val in data.links){ //data.links[data_val]\n var start_x = data.points[data.links[data_val].start_point].x;\n var start_y = data.points[data.links[data_val].start_point].y;\n var end_x = data.points[data.links[data_val].end_point].x;\n var end_y = data.points[data.links[data_val].end_point].y;\n drawLine(start_x,start_y,end_x,end_y,data.links[data_val]);\n }\n }", "title": "" }, { "docid": "c8a1e6bbb7f5dca7152572656b569061", "score": "0.6205643", "text": "function setMarkers(map, locations) {\n // Add markers to the map\n // Marker sizes are expressed as a Size of X,Y\n // where the origin of the image (0,0) is located\n // in the top left of the image.\n\n // Origins, anchor positions and coordinates of the marker\n // increase in the X direction to the right and in\n // the Y direction down.\n\n var image_ultimo = {\n url: 'https://gmaps-samples.googlecode.com/svn/trunk/markers/green/blank.png',\n // This marker is 20 pixels wide by 32 pixels tall.\n size: new google.maps.Size(20, 32),\n // The origin for this image is 0,0.\n origin: new google.maps.Point(0,0),\n // The anchor for this image is the base of the flagpole at 0,32.\n anchor: new google.maps.Point(0, 32)\n };\n\n\n var image_inicio = {\n url: 'https://gmaps-samples.googlecode.com/svn/trunk/markers/orange/blank.png',\n // This marker is 20 pixels wide by 32 pixels tall.\n size: new google.maps.Size(20, 32),\n // The origin for this image is 0,0.\n origin: new google.maps.Point(0,0),\n // The anchor for this image is the base of the flagpole at 0,32.\n anchor: new google.maps.Point(0, 32)\n };\n \n\n\n\n var image = {\n url: 'https://gmaps-samples.googlecode.com/svn/trunk/markers/red/blank.png',\n // This marker is 20 pixels wide by 32 pixels tall.\n size: new google.maps.Size(20, 32),\n // The origin for this image is 0,0.\n origin: new google.maps.Point(0,0),\n // The anchor for this image is the base of the flagpole at 0,32.\n anchor: new google.maps.Point(0, 32)\n };\n // Shapes define the clickable region of the icon.\n // The type defines an HTML &lt;area&gt; element 'poly' which\n // traces out a polygon as a series of X,Y points. The final\n // coordinate closes the poly by connecting to the first\n // coordinate.\n var shape = {\n coord: [1, 1, 1, 20, 18, 20, 18 , 1],\n type: 'poly'\n };\n for (var i = 0; i < locations.length; i++) {\n var beach = locations[i];\n var myLatLng = new google.maps.LatLng(beach[1], beach[2]);\n image_muestra = image\n if ((locations.length -1) == i) {\n \timage_muestra = image_ultimo;\n };\n if (i==0) {\n \timage_muestra = image_inicio;\n };\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n icon: image_muestra,\n shape: shape,\n title: String(beach[4]),\n zIndex: beach[3],\n });\n var info = '<div id=\"contentInfoWindow' + beach[3]++ + '\" class=\"contentMap\">\\\n <div class=\"contentTxt\">\\\n <h1' + String(beach[4]) + '</h1>\\\n <p>' + \" ---- \" + String(beach[4]) + '</p>\\\n <ul>\\\n <li> Hora.:' + String(beach[5]) + '</li>\\\n <li> Direccion.:' + String(beach[7]) + '</li>\\\n <li>Diferencia Mts.:' + String(beach[6]) + '</li>\\\n </ul>\\\n </div>\\\n </div>'\n createinfo(marker, info, map);\n\n }\n}", "title": "" }, { "docid": "9649becd86698eb39b8e9dafd6c786f6", "score": "0.6203657", "text": "function locate() {\n map.locate({\n setView: true,\n maxZoom: 16\n });\n}", "title": "" }, { "docid": "1f02b178316ba14c8d560e291cb7b00e", "score": "0.6201362", "text": "function drawWay(path_array,color,offset){\n ctx.beginPath();\n ctx.strokeStyle=color;\n ctx.moveTo(map_array.points[start_point].x,map_array.points[start_point].y);\n for (data_val in path_array){\n ctx.lineTo(map_array.points[path_array[data_val]].x - offset,map_array.points[path_array[data_val]].y - offset);\n\n }\n ctx.stroke();\n }", "title": "" }, { "docid": "1d2422c20c0392653b7446a8fdc695c1", "score": "0.6201352", "text": "function drawLocation(location, opts) {\n if (typeof opts !== 'object') {\n opts = {};\n }\n opts.position = new google.maps.LatLng(location[0], location[1]);\n opts.map = map;\n var marker = new google.maps.Marker(opts);\n }", "title": "" }, { "docid": "1d2422c20c0392653b7446a8fdc695c1", "score": "0.6201352", "text": "function drawLocation(location, opts) {\n if (typeof opts !== 'object') {\n opts = {};\n }\n opts.position = new google.maps.LatLng(location[0], location[1]);\n opts.map = map;\n var marker = new google.maps.Marker(opts);\n }", "title": "" }, { "docid": "27a0469a84b3af5d29740f5cb74f27d8", "score": "0.61968946", "text": "function igdraw_markers(){\n // Draw boundaries\n draw_boundaries(boundaries);\n\n // Draw center markers\n if((show == 'cen' || show == 'all')){\n igdraw_cenmarkers(cenmarkers);\n }\n\n // Draw individual markers\n if((show == 'ind' || show == 'all')){\n igdraw_indmarkers(indmarkers);\n }\n // Pan to center if no markers\n if(markers.length == 0){\n map.panTo(center);\n }\n else{\n map.fitBounds(markerBounds);\n }\n}", "title": "" }, { "docid": "9dc177f8600f46b1ac8b24644d235d2a", "score": "0.61965007", "text": "function displayElements() {\n createMap(document.getElementById(\"corps_carte\"), 48.513202, 7.081958, 6);\n\t //console.log(map);\n\t \n if(markers != null && markers.length > 0) {\n //console.log(markers);\n for(var k = 0; k < markers.length; k++) {\n markers[k].setMap(null);\n delete markers[k];\n }\n }\n \n /* reset all constants of the map */\n index = 0;\n markers = new Array();\n \n\t for(var i = 0; i < hiveCoordinates.length; i++) {\n\t \t//console.log(JSON.stringify(hiveCoordinates[i]));\n\t if(hiveCoordinates[i] != null && (hiveCoordinates[i].lat != '0.00000000' || hiveCoordinates[i].lng != '0.00000000')) {\n\t markers[index] = createMarker(index, map, hiveCoordinates[i].lat, hiveCoordinates[i].lng, \"http://www.label-abeille.org/modules/cmaps/views/img/markers/yellow_pin.png\");\n\t\t index++;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "37e9ff58dee613d4331dc434839f63da", "score": "0.6189356", "text": "function showMarkers(locations) {\n setMapOnAll(map, locations);\n}", "title": "" }, { "docid": "4a8e36c7f8533995b3e3914664137df6", "score": "0.618497", "text": "function drawSavedCoordinates(buttonId){\n actualMarkers = locationsDB[buttonId];\n if (countMarkersInMap === 3) {\n deleteMarkers();\n addMarker(getLatLngFromString(actualMarkers[\"location1\"]), map);\n countMarkersInMap++;\n addMarker(getLatLngFromString(actualMarkers[\"location2\"]), map);\n countMarkersInMap++;\n addMarker(getLatLngFromString(actualMarkers[\"location3\"]), map);\n countMarkersInMap++;\n } else {\n addMarker(getLatLngFromString(actualMarkers[\"location1\"]), map);\n countMarkersInMap++;\n addMarker(getLatLngFromString(actualMarkers[\"location2\"]), map);\n countMarkersInMap++;\n addMarker(getLatLngFromString(actualMarkers[\"location3\"]), map);\n countMarkersInMap++;\n }\n printDistance();\n}", "title": "" }, { "docid": "7bcf0ec56b62bff4408912a44ff39c57", "score": "0.61798865", "text": "function display_markers()\n {\n for (var i=0;i<location_markers.length;i++) {\n location_markers[i].setMap(page);\n boundary.extend(location_markers[i].position);\n }\n page.fitBounds(boundary);\n }", "title": "" }, { "docid": "d39aa0d6849bb911d84f967646e30c57", "score": "0.61798054", "text": "function locate() {\n map.locate({setView: true, maxZoom: 16});\n }", "title": "" }, { "docid": "f16e37ae1e11238be60d3ed292527a16", "score": "0.6169928", "text": "render() {\n Game._drawWholeMap();\n }", "title": "" }, { "docid": "9d22d899f04a33ab048bb53d9ef2b733", "score": "0.6167712", "text": "function markerCoordsMapInit() {}", "title": "" }, { "docid": "b731b374e2a702bde961d005a9e1edb4", "score": "0.61646664", "text": "function initMap() {\n // The location of CH\n var ch = {lat: 35.910259, lng: -79.055473};\n // The map, centered at CH\n var map = new google.maps.Map(\n document.getElementById('map'), {\n zoom: 6,\n center: ch\n }\n );\n\n // Set variables\n var infowindow = new google.maps.InfoWindow();\n var marker, i;\n var coords = [];\n\n // For loop\n for (i = 0; i < locations.length; i++) {\n\n // new marker for each point\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[i].lat, locations[i].lng),\n map: map\n });\n\n // add tooltip on click\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n infowindow.setContent(locations[i].name + '<br>' + locations[i].description);\n infowindow.open(map, marker);\n }\n })(marker, i));\n\n // push coords to array for polyline\n coords.push({\n lat: locations[i].lat,\n lng: locations[i].lng\n })\n }// close for loop\n\n // set up polyline\n console.log(coords);\n var paths = new google.maps.Polyline({\n path: coords,\n geodesic: true,\n strokeColor: 'green',\n strokeOpacity: 1.0,\n strokeWeight: 4\n });\n\n paths.setMap(map);\n}", "title": "" }, { "docid": "a77a34e85c3a6384c88bc13c0e83d907", "score": "0.6163767", "text": "function drawLocationOnMap(position) \r\n{\r\n\t//get latitude/longitude from Position object\r\n\tvar lat = position.coords.latitude;\r\n\tvar lon = position.coords.longitude;\r\n\tvar msg = \"You are here: Latitude \"+lat+\", Longitude \"+lon;\r\n\t//mark current location on Google map\r\n\tvar pos = new google.maps.LatLng(lat, lon);\r\n\tvar infoBox = new google.maps.InfoWindow({map: map, position:pos,content: msg});\r\n\tmap.setCenter(pos);\r\n\treturn;\r\n}", "title": "" }, { "docid": "a0dbbca4904604c016dd9f2738e9407b", "score": "0.6154582", "text": "function drawmPanLoc() {\n mPanLoc.clearRect(0,0,720,720);\n\n if (mPanTrack === true) {\n drawTile(1,getTile('x'),getTile('y'),true); //send our reference, with the optional \"true\" to tell drawTile that we want a hgihlight\n }\n}", "title": "" }, { "docid": "e220dfb558eb5b5168b708ae4949ab09", "score": "0.61531657", "text": "function generateMap()\r\n{\r\n fill(0, 200, 256);\r\n rect(0, 580, 800, 20);\r\n rect(0, 0, 800, 20);\r\n rect(0, 0, 20, 600);\r\n rect(780, 0, 20, 260);\r\n rect(780, 340, 20, 260);\r\n\r\n}", "title": "" }, { "docid": "7461cd4591da4e6eb41ae61b83e494d6", "score": "0.6135589", "text": "function initPoints(){\r\n map.addLayer(tripVectorLayer);\r\n drawTrip();\r\n}", "title": "" }, { "docid": "19eaea9aec0d042d791b7f15abca9cf1", "score": "0.61287034", "text": "function showCircles() {\n setAllMap(circles,map);\n}", "title": "" }, { "docid": "27687e30105437da92d0a7ce1f658fa0", "score": "0.6114895", "text": "function displayMap(coordinates) {\n // The map, centered at park\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 6,\n center: coordinates,\n });\n // The marker, positioned at park\n const marker = new google.maps.Marker({\n position: coordinates,\n map: map,\n });\n }", "title": "" }, { "docid": "113050d6f220cdc81b80be04689faa2d", "score": "0.61050653", "text": "function showMarkers() {\n\t setMapOnAll(map);\n\t }", "title": "" }, { "docid": "c1777ae8c3fadfdd5b5fd298e63c716b", "score": "0.6100611", "text": "function showMap() {\n\t\t$('#map').css('top', top ? fromtop : dist)\n\t\t$('#map').find('.right').css('opacity', top ? '0' : '1')\n\t\t$('#map').find('.piti') .css('opacity', top ? '1' : '0')\n\t\ttop = !top\n checkWindowWidth()\n\t\tif(!top) {\n renderPanel(datas[current_place].places[0], 1)\n\t\t}\n\t}", "title": "" }, { "docid": "7d3033a2fc3350b2a84f4f9dd0144fed", "score": "0.6098575", "text": "function initialize() {\n // Map Center\n var myLatLng = new google.maps.LatLng(33.742288, -84.391080);\n // General Options\n var mapOptions = {\n zoom: 9,\n center: myLatLng,\n panControl: true,\n draggable: true, // turn off if it gets annoying\n mapTypeId: google.maps.MapTypeId.RoadMap\n };\n var Coords = [\n [33.45115165, -84.47746155],\n [34.04145679, -84.06980447],\n [34.00760354, -84.4051481],\n [33.53919369, -84.35052343],\n\n [33.95864168, -84.32948201],\n [33.79360378, -84.81473035],\n [33.70175666, -84.60660806],\n [33.5215979, -84.50413673],\n\n [33.69909706, -84.27462307],\n [33.74774811, -83.91736953],\n\n [33.52923386, -84.24305287],\n [33.62046045, -84.70285972],\n\n [33.45741751, -84.55540285],\n [33.42088977, -84.43779553],\n [33.56626149, -84.54677069],\n [33.66982268, -83.95274439],\n\n [33.50702712, -84.26892156],\n [33.89089051, -83.96931076],\n [33.43759675, -84.42983867],\n [33.930818, -84.76277657],\n\n [33.70193685, -84.49773735],\n [34.09400592, -84.29731868],\n [33.34720493, -84.52194647],\n [34.16406974, -84.43854776]\n ];\n\n var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);\n var infowindow = new google.maps.InfoWindow();\n var marker, i;\n\n for (i = 0; i < Coords.length; i++) {\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(Coords[i][0], Coords[i][1]),\n map: map\n });\n }\n\n}", "title": "" }, { "docid": "ce23a6ab836ddf9456d3f4afdc3b4f1c", "score": "0.6091075", "text": "function newMap(){\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 11,\r\n center: NYUSternSchoolofBusiness\r\n });\r\n drawNewYork(map);\r\n drawNYUMarker();\r\n if (document.getElementById('BoroughsMarkers').checked) {\r\n drawMarkers();\r\n }\r\n}", "title": "" }, { "docid": "738d41e72c7665809e34a9bb21deab6f", "score": "0.6084276", "text": "function genreShowMap() {\n\n $.ajax({\n url: document.URL,\n method:'GET',\n dataType: 'JSON'\n }).done(function(response){\n\n // STEP 1: SETUP MAP'S COORDINATES AND STYLES\n coord = {\n lat: response[0][\"lat\"],\n lng: response[0][\"lng\"]\n };\n\n var styles = [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n\n // STEP 2: GENERATING MAP\n googleMap = new google.maps.Map(document.getElementById('genre-map'), {\n center: coord,\n disableDefaultUI: true,\n zoom: 13,\n styles: styles\n });\n\n // STEP 3: GENERATE THE MARKERS AND ITS LOCATION\n response.map(function(venue, i) {\n var marker = new google.maps.Marker({\n map: googleMap,\n position: { lat: venue[\"lat\"], lng: venue[\"lng\"] },\n title: venue[\"eventName\"]\n });\n\n var eventLink = document.getElementById('event'+venue[\"eventId\"]).href\n\n // STEP 4: DISPLAY POPUP WINDOW CONTENT FOR EACH MARKER WHEN CLICK\n var contentString = '<div class=\"content\">'+\n '<h1>'+ venue[\"eventName\"] +'</h1> ' +\n '<p>'+ venue[\"address_1\"] + '</p>' +\n '<p>'+ venue[\"city\"] + '</p>' +\n '<p>'+ venue[\"postal_code\"] + '</p>' +\n '<a href=\"'+ eventLink +'\">take me there</a>' +\n '</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n // STEP 4.1: ADD CLICK EVENT LISTENER\n marker.addListener('click', function() {\n infowindow.open(googleMap, marker);\n });\n\n }); // END OF GENERATING MAP AND THE MARKERS FOR EACH EVENT\n\n // STEP 1: GENERATE USER'S LOCATION\n $.ajax({\n url: '/genres/location',\n method:'get',\n dataType: 'JSON'\n }).done(function(response){\n clientLocation = response[\"clientLocation\"]\n var marker = new google.maps.Marker({\n map: googleMap,\n position: clientLocation,\n title: \"your location\"\n });\n }) // END OF AJAX REQUEST FOR USER'S LOCATION\n })\n}", "title": "" }, { "docid": "e83bef9981c13dc6bc1aece67680033a", "score": "0.6083977", "text": "function locationYmap() {\n\n\t// //location-map\n\t// if ( $('#lk-location-map').length ) {\n\n\t// \tymaps.ready(function () {\n\t// \t\t// Create map\n\t// \t\tvar myMap = new ymaps.Map(\"lk-location-map\", {\n\t// \t\t\tcenter: [55.43, 37.75],\n\t// \t\t\tzoom: 12\n\t// \t\t});\n\t\t\t\t\t\n\t// \t\tvar myPlacemark = new ymaps.Placemark([55.43, 37.75], {\n\t// \t\t\thintContent: '',\n\t// \t\t\thelp_hint: '',\n\t// \t\t\tballoonContent: ''\n\t// \t\t},{\n\t// \t\t\ticonImageHref: './img/placemark.png',\n\t// \t\t\ticonImageSize: [79, 71],\n\t// \t\t\ticonImageOffset: [-50, -55],\n\t// \t\t\thideIconOnBalloonOpen: false,\n\t// \t\t\tzIndexActive: 0,\n\t// \t\t\tzIndex: 1,\n\t// \t\t\tballoonCloseButton: false\n\t// \t\t});\n\n\t// \t\tvar objects = ymaps.geoQuery(myPlacemark).addToMap(myMap);\n // circle = new ymaps.Circle([[55.43, 37.75], 2000], null, { \n // \t\tdraggable: false,\n // \t\tfillColor: '9299f1',\n // \t\tfillOpacity: 0.42,\n\t// strokeColor: '464da5',\n\t// strokeOpacity: 0.75,\n\t// strokeWidth: 4\n // });\n\t// \t circle.events.add('drag', function () {\n\t// \t // Объекты, попадающие в круг, будут становиться красными.\n\t// \t var objectsInsideCircle = objects.searchInside(circle);\n\t// \t objectsInsideCircle.setOptions('preset', 'islands#redIcon');\n\t// \t // Оставшиеся объекты - синими.\n\t// \t objects.remove(objectsInsideCircle).setOptions('preset', 'islands#blueIcon');\n\t// \t });\n\t// \t myMap.geoObjects.add(circle);\n\n\t\t\t\n\t// \t});\n\t// }\n\t\n\tif ( $('#lk-location-map').length ) {\n\t\tymaps.ready(function () {\n\t var myMap = new ymaps.Map('lk-location-map', {\n\t center: [55.753994, 37.622093],\n\t zoom: 9,\n\t behaviors: ['default', 'scrollZoom'],\n\t controls: []\n\t }),\n\t // Создание кнопки определения местоположения\n\t geolocationButton = new GeolocationButton({\n\t data: {\n\t image: 'wifi.png',\n\t title: 'Определить местоположение'\n\t },\n\t geolocationOptions: {\n\t enableHighAccuracy: true // Режим получения наиболее точных данных\n\t }\n\t }, {\n\t // Зададим опции для кнопки.\n\t selectOnClick: false\n\t });\n\n\t myMap.controls\n\t //.add('mapTools')\n\t .add(new CrossControl)\n\t //.add(geolocationButton, { top: 5, left: 100 })\n\t .add('zoomControl')\n\t //.add('typeSelector', { top: 5, right: 5 })\n\t //.add(new ymaps.control.SearchControl({ noPlacemark: true }), { top: 5, left: 200 });\n\t myMap.behaviors.disable('scrollZoom'); \n\t new LocationTool(myMap);\n\n\t //example\n\t // http://dimik.github.io/ymaps/examples/location-tool/\n\n\t });\n\t}\n\n}", "title": "" }, { "docid": "e6defc4fb0240de520a092fa599e6910", "score": "0.6071456", "text": "function drawpoints(result) {\n function openInfo(content, e) {\n var p = e.target;\n var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);\n var opts = {\n width: 250, // 信息窗口宽度\n height: 500, // 信息窗口高度\n title: \"数据点信息\", // 信息窗口标题\n enableMessage: true//设置允许信息窗发送短息\n };\n var infoWindow = new BMap.InfoWindow(content, opts); // 创建信息窗口对象\n map.openInfoWindow(infoWindow, point); //开启信息窗口\n }\n\n function addClickHandler(content, marker) {\n marker.addEventListener(\"click\", function (e) {\n openInfo(content, e)\n }\n );\n }\n\n new_points = result;\n //console.log(\"point=\" + new_points);\n //console.log(new_points);\n var t_point_list = [];\n for (var i = 0; i < new_points.length; i++) {\n var t_point = new BMap.Point(new_points[i].lng, new_points[i].lat);\n t_point_list.push(t_point);\n var t_marker = new BMap.Marker(t_point);\n var poi_text = \"lng=\" + new_points[i].lng + \"<br>lat=\" + new_points[i].lat + \"<br>\";\n poi_text += 'Timestamp:' + new_points[i].timestamp + '<br>';\n poi_text += 'Datetime:' + new Date(parseInt(new_points[i].timestamp)) + '<br>';\n poi_text += '<br>Context:' + new_points[i].context + '<br>';\n poi_text += 'Location:' + new_points[i].location + '<br>';\n poi_text += 'Sound:' + new_points[i].sound + '<br>';\n poi_text += 'Motion:' + new_points[i].motion + '<br>';\n poi_text += 'Speed:' + new_points[i].speed + '<br>';\n poi_text += 'Time:' + new_points[i].time + '<br>';\n poi_text += 'Day:' + new_points[i].day + '<br>';\n poi_text += '<br>RealPOIs:<br>';\n for (var j = 0; j < new_points[i].poi_types.length; j++) {\n poi_text += new_points[i].poi_types[j].title + \":\" + new_points[i].poi_types[j].mapping_type + \"<br>\";\n }\n //console.log(poi_text);\n addClickHandler(poi_text, t_marker);\n map.addOverlay(t_marker);\n }\n var polyline = new BMap.Polyline(t_point_list, {\n strokeColor: \"blue\",\n strokeWeight: 3,\n strokeOpacity: 1\n }); //创建折线\n map.addOverlay(polyline); //增加折线\n alert(\"ok\");\n map.centerAndZoom(new BMap.Point(t_point_list[0].lng, t_point_list[0].lat),15);\n }", "title": "" }, { "docid": "218e49958661fcaa686aee64088c9b0f", "score": "0.6069804", "text": "function showMarkers() {\n setAllMap(markers,map);\n}", "title": "" }, { "docid": "3b44b0b786bd096715ad2f560eb68ed6", "score": "0.60636014", "text": "draw(context){\n\t\tfor(var y = 0; y <= this._max_y_tile; y++){\n\t\t\tfor(var x = 0; x <= this._max_x_tile; x++){ \n\t\t\t\tvar tile = this.get_map_tile([x,y])\n\t\t\t\ttile.draw(context);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "841483df95ff16376604cc681fbbb195", "score": "0.6056339", "text": "function updatePoint() {\n mapView.graphics.removeAll();\n //create a new map point\n var mapPoint = new Point({\n x: mainView.center.x,\n y: mainView.center.y,\n z: mainView.center.z,\n spatialReference: 102100\n });\n\n pointGraphic = new Graphic({\n geometry: mapPoint,\n symbol: pointSymbol,\n });\n\n mapView.graphics.add(pointGraphic);\n }", "title": "" }, { "docid": "88ed6fb8fa7a9a01efef2032c493fbf0", "score": "0.6055378", "text": "draw() {\n const latlng = new window.google.maps.LatLng(\n this.position.lat,\n this.position.lng\n );\n // Correctly position the overlay relative to the map panes.\n const point = this.getProjection().fromLatLngToDivPixel(latlng);\n\n this.containerElement.style.left = `${point.x}px`;\n this.containerElement.style.top = `${point.y}px`;\n }", "title": "" }, { "docid": "c887df30aba3afcb7f712742b87b1fa7", "score": "0.6053649", "text": "function initMap() {\n\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: 42.886448, lng: -78.878372 },\n zoom: 10\n });\n\n infoWindow = new google.maps.InfoWindow();\n\n // create map markers and add the map markers to the location objects\n // Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n locations.forEach(function(location, index) {\n\n var marker = new google.maps.Marker({\n map: map,\n animation: google.maps.Animation.DROP,\n position: location.location,\n title: location.title\n });\n\n getFourSquare(location);\n\n vm.locations()[index].marker = marker;\n google.maps.event.addListener(marker, \"click\", function() {\n\n //marker.setIcon(\"http://maps.google.com/mapfiles/ms/icons/green-dot.png\");\n var contentString = makeContentString(location);\n infoWindow.setContent(contentString);\n infoWindow.open(map,marker);\n\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n location.marker.setAnimation(null);\n }, 1000);\n\n\n });\n // Add infoWindow property to location objects, used when search/filter.\n vm.locations()[index].infoWindow = infoWindow;\n });\n\n}", "title": "" } ]
e217fa14ea54af525e6d4ef074b70e06
add column by 1
[ { "docid": "9a0455b60f8413fb8483d8eb0c2f7d63", "score": "0.69275033", "text": "addColumn() {\n this.setState(state => ({col: state.col + 1}))\n }", "title": "" } ]
[ { "docid": "0b2b9a7c66cadc1515b468f1efaa831b", "score": "0.6942896", "text": "incrementColNum() {\n this.numCols += 1;\n }", "title": "" }, { "docid": "63d275a5be4d6d094380b2151c7e2952", "score": "0.63854605", "text": "function updateColumns(){\r\n column = 0;\r\n columnItems.each(function(idx, el){\r\n if (idx !== 0 && idx > (columnItems.length / columns.length) + (column * idx)){\r\n column += 1;\r\n }\r\n $(columns.get(column)).append(el);\r\n });\r\n }", "title": "" }, { "docid": "d88592621d23744fc3898352a59390f1", "score": "0.61367035", "text": "decrementColNum() {\n this.numCols -= 1;\n }", "title": "" }, { "docid": "93a5a93c5254d207e62d3d093ba598ac", "score": "0.61258423", "text": "function addColumn(col) {\n\tvar totValue = 0;\n\t\n\tfor (var i = 0; i < numRows; i++) {\n\t\tvar curVal = getNames(col + \"[]\")[i].value;\n\t\ttotValue += printRealNum(curVal);\n\t}\n\t\n\treturn totValue;\n}", "title": "" }, { "docid": "6ab8e9b7570c1182a611aadb5d3cb25c", "score": "0.60658747", "text": "static addColToCol(m, i, j, x = 1) {\n const i1 = i - 1;\n const i2 = j - 1;\n\n this.#validate(m);\n this.#validateIndex(m[0].length, i1, i2);\n this.#validateNumber(x);\n\n return m.map((row) => {\n const newValue = fixed(row[i1] + x * row[i2]);\n const newRow = Array.from(row);\n newRow[i1] = newValue;\n return newRow;\n });\n }", "title": "" }, { "docid": "57b5aee4aec6e8acd6ef684efe1b4759", "score": "0.6017821", "text": "insert(col, index) {\r\n col.on(`${__WEBPACK_IMPORTED_MODULE_1__Column__[\"a\" /* default */].EVENT_WIDTH_CHANGED}.stack`, this.adaptChange);\r\n //increase my width\r\n super.setWidth(this.length === 0 ? col.getWidth() : (this.getWidth() + col.getWidth()));\r\n return super.insert(col, index);\r\n }", "title": "" }, { "docid": "aba52eaf459405d37e53b36f83f34793", "score": "0.5960216", "text": "function addFixedColumn() {\n instance.updateSettings({\n fixedColumnsLeft: fixedColumnsCount + 1\n });\n fixedColumnsCount++;\n }", "title": "" }, { "docid": "e4fa370efa11654529ca178e0c78bb97", "score": "0.59253323", "text": "function col_increase(col, times) {\r\n var map = {\r\n a: \"b\",\r\n b: \"c\",\r\n c: \"d\",\r\n d: \"e\",\r\n e: \"f\",\r\n f: \"g\",\r\n g: \"h\",\r\n h: undefined\r\n };\r\n\r\n if (times) {\r\n for (var i = 0; i < times; i++) {\r\n col = map[col];\r\n }\r\n return col;\r\n }\r\n else {\r\n return map[col];\r\n }\r\n}", "title": "" }, { "docid": "f3d04000ccbef8a5c999411248fd492f", "score": "0.5923703", "text": "insert(col, index, weight = NaN) {\r\n if (!isNaN(weight)) {\r\n col.setWidth((weight / (1 - weight) * this.getWidth()));\r\n }\r\n col.on(`${__WEBPACK_IMPORTED_MODULE_1__Column__[\"a\" /* default */].EVENT_WIDTH_CHANGED}.stack`, this.adaptChange);\r\n //increase my width\r\n super.setWidth(this.length === 0 ? col.getWidth() : (this.getWidth() + col.getWidth()));\r\n return super.insert(col, index);\r\n }", "title": "" }, { "docid": "12874032d0ccbd5969d2f139d47e8c19", "score": "0.58862686", "text": "removeColumn() {\n if (this.state.col > 0) {\n this.setState(state => ({col: state.col - 1}))\n }\n }", "title": "" }, { "docid": "3f87ce392d4b465f4909c379a3bd39d4", "score": "0.58788323", "text": "handleAddColumn() {\n const { tableData, colCount } = this.state;\n\n Object.keys(tableData).forEach(rowKey => {\n tableData[rowKey][`c${colCount}`] = '';\n });\n\n this.setState({\n colCount: colCount + 1,\n tableData\n });\n }", "title": "" }, { "docid": "c127334773d37833c16f9470e172a413", "score": "0.58593225", "text": "add(row) {\n const id = randHex(16)\n const when = elapsed()\n row.mod = when\n this.rows.set(id, row)\n this.added.emit(id, row, when)\n return id\n }", "title": "" }, { "docid": "01a780f4cbe0da3396e3a8fe605f4495", "score": "0.58570415", "text": "function testAddColumn() {\n let termTable = document.getElementById('term_431');\n let cells = termTable.rows[0].cells;\n cells[cells.length -1].colSpan = 2;\n for (let i = 1; i < termTable.rows.length; ++i) {\n let cell = termTable.rows[i].insertCell(cells.length - 1);\n let text = document.createTextNode('new cell');\n cell.appendChild(text);\n }\n}", "title": "" }, { "docid": "655df70c91ebf260d61e45193ec23ade", "score": "0.58330053", "text": "setColumn1() {\n this.setState({column: 1})\n saveData.saveToCompare('1',this.state.l,this.state.l._url);\n this.handleCloseColumn();\n }", "title": "" }, { "docid": "dcc3a65d3bf57770d27cf8123db2bf6a", "score": "0.5831007", "text": "function addIndex(){\n $('td').each(function(index){\n $(this).append(index);\n })\n }", "title": "" }, { "docid": "066132256e6164dc1bad6935b982d27a", "score": "0.5762419", "text": "function addNumbers()\r\n{\r\n var i = 1;\r\n $('.cell-icon').parent().prepend(function(a,b){ return '<td>' + i++ +'</td>';} );\r\n $('th').parent().prepend('<td style=\"width: 25px\" ></th>');\r\n}", "title": "" }, { "docid": "46d63ddd38e5e4e5c7629716842e87d7", "score": "0.57407266", "text": "function CurrentColumn(index){\n index = index+\"\";\n return parseInt(\"1\"+index[1]);\n}", "title": "" }, { "docid": "a8a069d283f799cd158558772ea4693c", "score": "0.5709971", "text": "function appendColumn() {\n var tbl = document.getElementById(\"dataTable\"), // table reference\n i;\n // open loop for each row and append cell\n for (i = 0; i < tbl.rows.length; i++) {\n var val = String.fromCharCode(65 + tbl.rows[i].cells.length);\n createCell(\n tbl.rows[i].insertCell(tbl.rows[i].cells.length),\n \"col\",\n val + (i + 1)\n );\n }\n}", "title": "" }, { "docid": "c92a17a5f582fb74e48ee901e0f333e5", "score": "0.5706053", "text": "toggleOne(name) {\n this.setState(prev => {\n const idx = prev.columns.indexOf(name);\n if (idx < 0)\n prev.columns.push(name);\n else\n prev.columns.splice(idx, 1); \n \n return prev;\n });\n }", "title": "" }, { "docid": "956aa391a1f377a69e3179a717f0758e", "score": "0.5690722", "text": "function sumnum(num1) {\n return this.num + num1;\n}", "title": "" }, { "docid": "135d554c63b0db7846c39465164cd2f9", "score": "0.56842965", "text": "function appendColumn() {\n var tbl = document.getElementById('table'), // table reference\n i;\n // open loop for each row and append cell\n for (i = 0; i < tbl.rows.length; i++) {\n createCell(tbl.rows[i].insertCell(tbl.rows[i].cells.length), i, 'col');\n }\n}", "title": "" }, { "docid": "1f288fd4ab457771b249fd5b656244ce", "score": "0.5677201", "text": "function autNumber(tbl) {\n var trs = $(tbl);\n var x = 1;\n for (var i = 0; i < trs.length; i++) {\n $(trs[i]).children(\"td:nth-child(1)\").html(x);\n x++;\n }\n}", "title": "" }, { "docid": "152ca5418dc21d53b3fac72af3985195", "score": "0.5661924", "text": "function clickCell(column, matrix, i, j) {\n column.addEventListener('click', function () {\n matrix[i][j].amount += 1;\n column.textContent = parseInt(column.textContent) + 1;\n getRowSumAction();\n getColAverageAction();\n });\n }", "title": "" }, { "docid": "e4a6c80aff634d55152d5f199a637e93", "score": "0.56546813", "text": "function addColumn(sheet)\r\n {\r\n sheet.insertColumnAfter(sheet.getMaxColumns());\r\n }", "title": "" }, { "docid": "d955143f970ae9ed93f9663fc0329436", "score": "0.56497526", "text": "function addCol(){\n let rowsArr = Array.from(table.children);\n rowsArr.forEach((row) => {\n let y = document.createElement(\"TD\");\n row.appendChild(y);\n y.classList.add(\"noColor\");\n })\n totalCols++;\n}", "title": "" }, { "docid": "9b9e66781dfc3ff3c887096981d4f0a9", "score": "0.56426245", "text": "increment(column, amount = 1) {\n if (isObject(column)) {\n for (const key in column) {\n this._counter(key, column[key]);\n }\n\n return this;\n }\n\n return this._counter(column, amount);\n }", "title": "" }, { "docid": "33d73d4f667d04a180f7b0b4f3e32f48", "score": "0.56180763", "text": "function addCol() {\n\tcols++;\n\tvar table = document.getElementById(\"table\");\n\tvar th = document.createElement(\"th\");\n\tth.innerHTML = String.fromCharCode(letter+cols-1);\n\ttable.children[0].appendChild(th);\n\t\n\tfor(var i = 0; i<rows; i++) {\n\t\tvar td = document.createElement(\"td\");\n\t\ttd.setAttribute(\"id\",th.innerHTML+(i+1));\n\t\ttd.setAttribute(\"onclick\",\"focusize(this.id)\");\n\t\tt[td.id] = new Cell(td.id);\n\t\ttd.style.backgroundColor = t[td.id].backgroundColor;\n\t\ttd.style.color = t[td.id].color;\n\t\ttd.style.textAlign = t[td.id].textAlign;\n\t\ttd.innerHTML = t[td.id].value;\n\t\ttable.children[i+1].appendChild(td);\n\t}\n}", "title": "" }, { "docid": "15e2d81291234c594b198438f4923ca7", "score": "0.55998284", "text": "function addColumn() {\n colsToShow.push(parseInt($('#columnToAdd option:selected').val().substr(3)));\n updateTable();\n}", "title": "" }, { "docid": "3409f0a1b5d8e3ec009001caf709dfa6", "score": "0.55877995", "text": "function encode_row(row) { return \"\" + (row + 1); }", "title": "" }, { "docid": "90bd0dca794bc516efaf159cde18a7f3", "score": "0.55832946", "text": "function _expandColumn(col) {\n var $col = $(col);\n var $tds = $(\"#drplist td\");\n var small = 80 / $tds.length;\n $tds.stop(true, true);\n if ($tds.length > 8) {\n small = 150 / $tds.length;\n }\n $tds.removeClass(\"short\");\n $tds.addClass(\"short\");\n $tds.css({\n width: small + \"%\"\n });\n\n $col.stop(true, true).animate({\n width: \"50%\"\n }).removeClass(\"short\");\n }", "title": "" }, { "docid": "fdb18707b7a45b9b8d18f18178402ba4", "score": "0.55041236", "text": "column_mask(col) {\n if (typeof col === 'bigint')\n // eslint-disable-next-line no-undef\n return ((1n << BigInt(this.height)) - 1n) << (col * BigInt(this.height + 1));\n else\n\n // eslint-disable-next-line no-undef\n return ((1n << BigInt(this.height)) - 1n) << BigInt(col * (this.height + 1));\n }", "title": "" }, { "docid": "5a0aed5249c0aa19b65ba9cb117d8f7c", "score": "0.5466121", "text": "function _addColumn(){\n self._visitingAlter = true;\n var table = self._queryNode.table;\n self._visitingAddColumn = true;\n var result='ALTER TABLE '+self.visit(table.toNode())+' ADD ('+self.visit(alter.nodes[0].nodes[0]);\n for (var i= 1,len=alter.nodes.length; i<len; i++){\n var node=alter.nodes[i];\n assert(node.type=='ADD COLUMN',errMsg);\n result+=', '+self.visit(node.nodes[0]);\n }\n result+=')';\n self._visitingAddColumn = false;\n self._visitingAlter = false;\n return [result];\n }", "title": "" }, { "docid": "4af63bd2ca2b111d4cddba4f4aaeecf5", "score": "0.5458376", "text": "_counter(column, amount) {\n amount = parseFloat(amount);\n\n this._method = 'update';\n\n this._single.counter = this._single.counter || {};\n\n this._single.counter[column] = amount;\n\n return this;\n }", "title": "" }, { "docid": "218ca0fdd7570786e6a74b622caac98c", "score": "0.5454325", "text": "addColumn(col) {\n\n\t\t// No-sort if grid is not sortable\n\t\tif(!this.sortable)\n\t\t\tcol.nosort = true;\n\n\t\tthis.columns.push(col);\n\t}", "title": "" }, { "docid": "e5873f84edd9a7cb5bf84a317c9cdf48", "score": "0.5447102", "text": "function addToColumn(el){\n if(columnCounter === 0 && !isCollision(columns[0], el)){\n columns[0].push(el);\n addCollision(el);\n return;\n } else if(columnCounter === 0 && isCollision(columns[0], el)){\n columns[++columnCounter] = [el];\n addCollision(el);\n return;\n }else {\n for(var i=0; i<=columnCounter; i++){\n if(!isCollision(columns[i], el)){\n columns[i].push(el);\n addCollision(el);\n return;\n }\n }\n }\n\n columns[++columnCounter] = [el];\n addCollision(el);\n }", "title": "" }, { "docid": "cda718fd221c5896c4cc86595e21ecdb", "score": "0.5425133", "text": "function getColumnCount() {\n pquery = pobjects.get(0);\n colCount = pquery.getColumnCount();\n return colCount + 1; // we added a new column\n\n}", "title": "" }, { "docid": "d259258e682f61bc0f28d9cf67597df2", "score": "0.54215866", "text": "function adjustColumnIndex(date) {\n \n // dates above 18 require no change\n if (date >= 18) {\n return 0;\n // Dates below 18 should be added to the previous months column\n } else {\n return -1;\n }\n}", "title": "" }, { "docid": "d4c803a084551e788d8c0101550bc79f", "score": "0.5420879", "text": "bottom_mask_col(col) {\n if (typeof col === 'bigint')\n // eslint-disable-next-line no-undef\n return 1n << (col * BigInt(this.height + 1));\n else\n // eslint-disable-next-line no-undef\n return 1n << BigInt(col * (this.height + 1));\n }", "title": "" }, { "docid": "a09aab7f1f2081a9fdf4d727a7077679", "score": "0.5407547", "text": "function plusplus(el){\r\n\tvar row = el.parentElement;\r\n\tvar daScore = row.cells[1];\r\n\tvar score = Number(daScore.innerText);\r\n\tdaScore.innerText = score +1;\r\n}", "title": "" }, { "docid": "ef49b27b8580f4a3742fa88a9beaf695", "score": "0.54037815", "text": "function columnToX(col) {\n return col * 101;\n}", "title": "" }, { "docid": "9215fb417b775f7b760b92a7b54f9169", "score": "0.538788", "text": "updateCurrentBitValue(cell) {\r\n var row = parseInt(cell.split('-')[1][0], 10);\r\n var col = parseInt(cell.split('-')[1][1], 10);\r\n var newValue = 1 << ((row * 3) + col);\r\n this.currentBitValue += newValue;\r\n }", "title": "" }, { "docid": "f9736f90248e6b89faab6a1946397072", "score": "0.53760654", "text": "pushRowToLeft(row) {\n let nextNonZeroIndex;\n for (let i = 0; i < row.length; i++) {\n // Get the index of first non zero number which is not is 0th index\n nextNonZeroIndex = row.findIndex((currentValue, index) => {\n return index > i && currentValue !== 0;\n });\n // Safe check since if no value present findIndex will give -1\n if (nextNonZeroIndex !== -1) {\n // If current index location is 0 swap 0 with non zero item index\n if (row[i] === 0) {\n row[i] = row[nextNonZeroIndex];\n row[nextNonZeroIndex] = 0;\n // decrement i because if the same number is present else where is the next element of the array\n // that particular number should be added to this number\n i = i - 1;\n } else if (row[i] === row[nextNonZeroIndex]) {\n // If the next value is the same as non zero item, multiply current item and make non zero item index 0\n row[i] = row[i] * 2;\n row[nextNonZeroIndex] = 0;\n }\n }\n }\n return row;\n }", "title": "" }, { "docid": "504d466ff8e00d985e7670c79749de35", "score": "0.53709596", "text": "addColumn(record, index) {\n console.log('Entered addColumn....');\n console.log(record);\n console.log(index);\n this.props.toggleModal('addColumn');\n }", "title": "" }, { "docid": "2f29f822460c4f23a2517cf3e9d80b72", "score": "0.5369742", "text": "function addRowLanguage() {\n\tcol_id = col_id_global;\n\tvar table = document.getElementById('dyn_table');\n\tvar lastRow = table.rows.length;\n\n\tvar row = table.insertRow(lastRow);\n\t \n\tvar cell1 = row.insertCell(0);\n\tcell1.setAttribute(\"id\",col_id); \n\tcell1.setAttribute(\"width\",\"100%\"); \n}//ef", "title": "" }, { "docid": "dd6819a41330c03e3205338397aeac05", "score": "0.53660697", "text": "function addToColumn(column){\r\n const itemText = addItems[column].textContent;\r\n const selectedArray = listArrays[column];\r\n selectedArray.push(itemText);\r\n addItems[column].textContent = '';\r\n updateDOM();\r\n}", "title": "" }, { "docid": "b30c0a1d4baa8ac568912c378bc0430b", "score": "0.53651726", "text": "increment() {\n this.set(this.getValue() + 1);\n }", "title": "" }, { "docid": "12bc060debdc02206b682f77ca5a4996", "score": "0.5363027", "text": "madeHoneyAt(row, col) {\n if (this.getValue(row, col) !== UNLIMITED_HONEY) {\n this.setValue(row, col, this.getValue(row, col) - 1);\n }\n\n this.honey_ += 1;\n }", "title": "" }, { "docid": "f2fafc99c1df6c39d400d7a92d91dc9c", "score": "0.5359781", "text": "column(input, parameter) {\n this.currentColumn = this.currentRow.addStack()\n this.currentColumn.layoutVertically()\n this.currentColumn.setPadding(0, 0, 0, 0)\n this.currentColumn.spacing = 0\n if (parameter) this.currentColumn.size = new Size(parseInt(parameter),0)\n }", "title": "" }, { "docid": "899b3140661c7f6594a4d7709c1ede9d", "score": "0.53561443", "text": "[types.ADD_COLUMN] (state, { column }) {\n Vue.set(state.lists, column.id, column)\n }", "title": "" }, { "docid": "d2f53edb9d6f4ab06995cc9ab8f1633e", "score": "0.53352356", "text": "addRow() {\n this.setState(state => ({row: state.row + 1}))\n }", "title": "" }, { "docid": "83b389ab13f8739a6c9353d7a89abcbd", "score": "0.53199905", "text": "updateColumn(table, columnInfo) {\n // table.index(columnInfo.key) if columnInfo.options.indexed # fails if the column already exists\n // table.unique(columnInfo.key) if columnInfo.options.unique\n }", "title": "" }, { "docid": "37437f15473d2bc7bb0449ada543a1aa", "score": "0.53141415", "text": "function testAddOneRowHandler(row) {\n return _.mapObject(row, (value) => {\n return value + 1;\n })\n}", "title": "" }, { "docid": "1eab0cac03e5e3cdd3ebf0dad7181c7f", "score": "0.53079486", "text": "function col2x(col) {\n return col * 101;\n}", "title": "" }, { "docid": "ee5fa07ff8d6545ff2128d8149f479a1", "score": "0.5305788", "text": "set columns(value) {\n const minColumnsCount = 1;\n this._columns = value > minColumnsCount ? value : minColumnsCount;\n }", "title": "" }, { "docid": "2112abdaaf58b9d68469dde6345891d0", "score": "0.5282675", "text": "incr() {\n this.value += 1\n }", "title": "" }, { "docid": "7ab1e6dc8519575d5aac35da143f4605", "score": "0.5254076", "text": "function addCells(row){\n\tvar total = 0;\t\n\tfor(i=0; i < row.length; i++){\n\t\tif(row[i] === 'x'){\n\t\t\ttotal += 1;\n\t\t}else if (row[i] === 'o') {\n\t\t\ttotal += 4;\n\t\t}\n\t}\t\n\treturn total;\n}", "title": "" }, { "docid": "5123b1e6345c3471233ea7e1db671888", "score": "0.52272654", "text": "function addValue(i,j) {\n mineField[i][j].dataset.neighbMines = parseInt(mineField[i][j].dataset.neighbMines,10) + 1;\n}", "title": "" }, { "docid": "c968158e6cd958f58607642a54164a3a", "score": "0.5224425", "text": "get numColumns() {\n return this.columns.length + 2;\n }", "title": "" }, { "docid": "3fea18fbf8974da4536cfa11400fa1c6", "score": "0.519522", "text": "function addRow () {\r\n var table = document.getElementById (\"dynamic-table\");\r\n var row = table.insertRow (rowIndex++);\r\n var cell1 = row.insertCell (0);\r\n var cell2 = row.insertCell (1); \r\n cell1.innerHTML = \"cell\" + count1;\r\n cell2.innerHTML = \"cell\" + count2;\r\n count1= count1 + 2; \r\n count2 = count2 + 2;\r\n}", "title": "" }, { "docid": "a7c7752ad9ca2d1fd51f0356a135128e", "score": "0.51888204", "text": "function addRow(){\n\t\n\tvar square = Math.pow(number, 2);\n\tvar cube = Math.pow(number, 3);\n\t\n\t//add 1 row with 3 cells\n\tlet table = document.getElementById('mainTable');\n\tlet r = table.insertRow();\n\tlet c1 = r.insertCell(); \n\tlet c2 = r.insertCell(); \n\tlet c3 = r.insertCell();\n\t\n\t//values\n\tc1.innerHTML = number; \n\tc2.innerHTML = square;\n\tc3.innerHTML = cube;\n\t\n\t//change 'number' to next value. +1 increment\n\tnumber +=1;\n\t\n}", "title": "" }, { "docid": "2accea55ed5fe48a0424d47f6efc8be6", "score": "0.5179587", "text": "function add_column(parent)\n{\n var parentId = parent.attr('id') //get parent id\n var parentTag = $(\"tr th#\"+parentId) // get the parent tag or th of moodule\n\n var array = parentId.split('-');//{table,mid,assign}\n var module = array[2];\n var term = array[1]; //get the semester using id\n var label = module.charAt(0).toUpperCase() + module.slice(1);\n var header = array[0]+\"-header-\"+array[1]+\"-\"+module+getModuleCounter(label,term,\"val\");\n var items = array[0]+\"-items-\"+array[1]+\"-\"+module+getModuleCounter(label,term,\"val\"); // for getting items id\n var score = array[0]+\"-score-\"+array[1]+\"-\"+module+getModuleCounter(label,term,\"val\");\n \n var term_tag,label_num,newHeader,newItems,newScore;\n\n if (type_of_table == \"attendance_table\")\n {\n if ($(parentTag).attr('colspan') < 17)\n {\n parentTag.each(function(){\n var counter = getModuleCounter(label,term,\"val\");\n counter++;\n label_num = counter;\n var span=3+(counter-1);\n $(this).attr('colspan',span);\n setModuleCounter(getModuleCounter(label,term,\"name\"),counter);\n newHeader = array[0]+\"-header-\"+array[1]+\"-\"+module+counter;\n newScore = array[0]+\"-score-\"+array[1]+\"-\"+module+counter;\n });\n // console.log(header);\n // console.log(score);\n // console.log(label_num);\n\n $(\"#\"+parentId+\"-button-del\").css('display', 'inline-block');\n $(\"tr th#\"+header).after($(\"<th style='text-align:center' id='\"+newHeader+\"' contenteditable='true'>\"+ label +\" \"+ label_num + \"</th>\"));\n $(\"tr td#\"+score).after($(\"<td data-container='body' data-html='true' data-placement='bottom' id='\"+newScore+\"' contenteditable='true'></td>\"));\n }\n else alert(\"Only 15 column is allowed on this table.\");\n }\n\n if (module_type == \"Lab\")\n {\n if ($(parentTag).attr('colspan') != 12)\n {\n parentTag.each(function(){\n var counter = getModuleCounter(label,term,\"val\");\n counter++;\n var span=3+(counter-1);\n label_num = counter;\n $(this).attr('colspan',span);\n setModuleCounter(getModuleCounter(label,term,\"name\"),counter);\n newHeader = array[0]+\"-header-\"+array[1]+\"-\"+module+counter;\n newItems = array[0]+\"-items-\"+array[1]+\"-\"+module+counter;\n newScore = array[0]+\"-score-\"+array[1]+\"-\"+module+counter;\n });\n\n if (term == \"mid\")\n {\n term_tag = $('tr th#table-midterm');\n term_tag.each(function(){\n midtermCounter++;\n var term_span=11+midtermCounter;\n $(this).attr('colspan',term_span);\n });\n }\n else if (term == \"final\")\n {\n term_tag = $('tr th#table-finals');\n term_tag.each(function(){\n finalsCounter++;\n var term_span=11+finalsCounter;\n $(this).attr('colspan',term_span);\n });\n }\n\n $(\"#\"+parentId+\"-button-del\").css('display', 'inline-block');\n $(\"tr th#\"+header).after($(\"<th style='text-align:center' id='\"+newHeader+\"'>\"+ label +\" \"+ label_num + \"</th>\"));\n $(\"tr td#\"+items).after($(\"<td data-container='body' data-html='true' data-placement='bottom' id='\"+newItems+\"' contenteditable='true'></td>\"));\n $(\"tr td#\"+score).after($(\"<td data-container='body' data-html='true' data-placement='bottom' id='\"+newScore+\"' contenteditable='true'></td>\"));\n }\n else alert(\"Only 10 column is allowed on this table.\");\n addTooltip();\n }\n\n else if (module_type == \"Lec\")\n {\n var upper_module,mod_id;\n if ($(parentTag).attr('colspan') != 10)\n {\n parentTag.each(function(){\n var counter = getModuleCounter(label,term,\"val\");\n counter++;\n var span=1+(counter-1);\n label_num = counter;\n $(this).attr('colspan',span);\n // $(this).val(counter);\n setModuleCounter(getModuleCounter(label,term,\"name\"),counter);\n newHeader = array[0]+\"-header-\"+array[1]+\"-\"+module+counter;\n newItems = array[0]+\"-items-\"+array[1]+\"-\"+module+counter;\n newScore = array[0]+\"-score-\"+array[1]+\"-\"+module+counter;\n });\n\n \n if (term == \"mid\")\n {\n var i;//colspan\n term_tag = $('tr>th#table-midterm');\n if (label == \"Assign\" || label == \"Sw\" || label == \"Ex\" || label == \"Rec\") \n {\n upper_module = $('tr th#table-mid-class-standing');\n i = 6; \n }\n else if (label == \"Quiz\" || label == \"Le\") \n {\n upper_module = $('tr th#table-mid-quiz-le');\n i = 4;\n }\n mod_id = upper_module.attr('id');\n var arr = mod_id.split('-');\n var label2 = arr[2]+\"-\"+arr[3]\n upper_module.each(function(){\n var counter2 = getModuleCounter(label2,term,\"val\");\n counter2++;\n var span2=i+counter2;\n $(this).attr('colspan',span2);\n setModuleCounter(getModuleCounter(label2,term,\"name\"),counter2);\n });\n term_tag.each(function(){\n midtermCounter++;\n var term_span=15+midtermCounter;\n $(this).attr('colspan',term_span);\n });\n }\n else if (term == \"final\")\n {\n var i;\n term_tag = $('tr>th#table-finals');\n if (label == \"Assign\" || label == \"Sw\" || label == \"Ex\" || label == \"Rec\") \n {\n upper_module = $('tr th#table-final-class-standing');\n i = 6;\n }\n else if (label == \"Quiz\" || label == \"Le\") \n {\n upper_module = $('tr th#table-final-quiz-le');\n i = 4;\n }\n mod_id = upper_module.attr('id');\n var arr = mod_id.split('-');\n var label2 = arr[2]+\"-\"+arr[3]\n upper_module.each(function(){\n var counter2 = getModuleCounter(label2,term,\"val\");\n counter2++;\n var span2=i+counter2;\n $(this).attr('colspan',span2);\n setModuleCounter(getModuleCounter(label2,term,\"name\"),counter2);\n });\n term_tag.each(function(){\n finalsCounter++;\n var term_span=15+finalsCounter;\n $(this).attr('colspan',term_span);\n });\n }\n var class_name = get_class_name(label,label_num,term);\n\n $(\"#\"+parentId+\"-button-del\").css('display', 'inline-block');\n $(\"tr th#\"+header).after($(\"<th style='text-align:center' id='\"+newHeader+\"'>\"+ label +\" \"+ label_num + \"</th>\"));\n $(\"tr td#\"+items).after($(\"<td data-container='body' data-html='true' data-placement='bottom' class='\"+class_name+\"' id='\"+newItems+\"' contenteditable='true'></td>\"));\n $(\"tr td#\"+score).after($(\"<td data-container='body' data-html='true' data-placement='bottom' class='\"+class_name+\"' id='\"+newScore+\"' contenteditable='true'></td>\"));\n }\n else alert(\"Only 10 column is allowed on this table.\");\n addTooltip();\n }\n}", "title": "" }, { "docid": "18c3da12f5fef6dff36de9a33b847c3d", "score": "0.5162168", "text": "setColumn4() {\n this.setState({column: 4});\n saveData.saveToCompare('4',this.state.l, this.state.l._url);\n this.handleCloseColumn();\n }", "title": "" }, { "docid": "88d6fe6214a1bd2a40c76e859dda1f11", "score": "0.5157901", "text": "function setMainCoToOne(row, i){\n let mainCo = row[i];\n for(let j = 0; j <= vars.length; j++){\n row[j] /= mainCo;\n }\n }", "title": "" }, { "docid": "5f103089e87eaf55426cfc1e383275a3", "score": "0.5131897", "text": "function addColumnUp(){\n for (let i = 0; i < grid.length; i++){\n for (let j = 0; j <= grid.length; j++){\n if (grid[i][j] == ''){\n grid[i][j] = ''\n }\n else if (grid[i][j] == grid[i + 1][j]){\n let tempValue = grid[i][j] + grid[i + 1][j];\n grid[i][j] = tempValue;\n addScore(tempValue);\n grid[i+1][j] = ''; \n }\n }\n }\n //winningCondition();\n}", "title": "" }, { "docid": "e642762df5979a593db19d2d6e17baa6", "score": "0.5123792", "text": "function sumUpColumn() {\n sumUp = columnUp.reduce(add);\n sumUp >= 60 ? (sumUp = sumUp + 30) : (sumUp = sumUp);\n document.querySelector(\".sumUpFirst\").innerHTML = sumUp;\n sumPartOne();\n sumAllResult();\n}", "title": "" }, { "docid": "4bd583f3d49dd70dd70a7829b38984cd", "score": "0.5118104", "text": "function addColumn (coordinate, amount) {\n amount = amount || 1\n const parts = coordinate.split('')\n const columns = 'abcdefgh'\n const column = columns.indexOf(parts[0])\n if (column + amount < 0 || column + amount >= columns.length) {\n return\n }\n return columns[column + amount] + parts[1]\n }", "title": "" }, { "docid": "af3819d2106ad0bb0c0ceedcc869a300", "score": "0.51160467", "text": "function Actualizar_contador(){\n var contador =0;\n \n $('#table_planevaluacion tr').each(function(index, element){\n if (contador != 0){\n $(element).find(\"td\").eq(0).html(contador);\n contador += 1;\n }\n else{\n contador = 1;\n }\n \n });\n \n \n }", "title": "" }, { "docid": "eabdfca7a5d09080e0435c32abb9659e", "score": "0.51151735", "text": "function registraColumna(elem, index, arr) {\n console.log(\"registrnado row: \"+elem.equis+\" | \"+elem.val+\" index:\"+index);\n sheet1.set(1, index+1, elem.equis);\n sheet1.set(2, index+1, elem.val);\n }", "title": "" }, { "docid": "328cd93254e0457be8a90ad6d4e44f14", "score": "0.5110227", "text": "getColumnCount(e) {\n let count = e.target.value;\n let columnName;\n\n \n var columns = []\n //adding default column details\n for (var i = 0; i < count; i++) {\n columnName = 'Column' + (i + 1);\n\n columns.push({\n columnName: columnName,\n id: i + 1\n });\n }\n \n\n this.setState({\n columns:columns,\n columnCount: count\n });\n }", "title": "" }, { "docid": "f1414c6bc01849cd91c35002a44ccb89", "score": "0.5108004", "text": "add(col) {\n this.all.push(col);\n this.lookup.set(col.name, col);\n return this;\n }", "title": "" }, { "docid": "7af32b61850c5e480a90bc6bad53b3f5", "score": "0.51061994", "text": "columns(column) {\n if (!column && column !== 0) return this;\n this._statements.push({\n grouping: 'columns',\n value: normalizeArr(...arguments),\n });\n return this;\n }", "title": "" }, { "docid": "b1347cf07e76bf689142ea65cc8485c0", "score": "0.51058745", "text": "function addColumn(row, displayText, idText, tagType, pos) {\r\n var column = $('<' + tagType + '>').html(displayText);\r\n \r\n if (pos == null) {pos=0;}\r\n \r\n if (tagType === 'td' && pos == 0) // We add first the day column\r\n\t\tcolumn.attr({'days':idText, 'align':'center'});\r\n\telse if (tagType === 'td' && pos != 0)\r\n\t\tcolumn.attr({'align':'center'}); // This is the tag column\r\n \r\n $(row).children().eq(pos).before(column);\r\n}", "title": "" }, { "docid": "1db9ce9262bde562661615b6d9023ae7", "score": "0.510587", "text": "function creaColumna1() { \r\n $(\".full-col-1-1\").append('<img src=\"img/galeria/col-1-1.jpeg\" alt=\"\">');\r\n $(\".full-col-1-2\").append('<img src=\"img/galeria/col-1-2.jpeg\" alt=\"\">');\r\n $(\".full-col-1-3\").append('<img src=\"img/galeria/col-1-3.jpeg\" alt=\"\">');\r\n $(\".full-col-1-4\").append('<img src=\"img/galeria/col-1-4.jpeg\" alt=\"\">');\r\n }", "title": "" }, { "docid": "a3a46079dae650187b0c91941921cc8b", "score": "0.51022595", "text": "function addOne(expr) {\n return t.binaryExpression('+', expr, t.numericLiteral(1));\n}", "title": "" }, { "docid": "30a9151082fc660836f23ea37eeafcc8", "score": "0.5096484", "text": "function CreateColumn(){\n const newColumn = document.createElement('div');\n newColumn.classList.add('column');\n newColumn.setAttribute('data-column-id', columnCounter); \n columnCounter++;\n\n newColumn.innerHTML += `<p class=\"column-header\"> </p>\n <div data-notes></div>\n <p class=\"column-footer\">\n <button data-action-addNote class=\"action\">Добавить карточку</button>\n </p>`\n document.querySelector('.columns').append(newColumn); \n return newColumn;\n}", "title": "" }, { "docid": "6cf9782b921d5c231d86b2de7e7b87d1", "score": "0.50894916", "text": "function llenarColumna(numCol){\n let numFila = 5;\n while(numFila >= 0 && matriz[numCol][numFila] != undefined){\n numFila--;\n }\n if(numFila < 0) return;\n matriz[numCol][numFila] = turno;\n return numFila;\n}", "title": "" }, { "docid": "18a8edb4f91512f0fb94d99eebe421a4", "score": "0.508843", "text": "deleteColumn(column) {\n this.columns.splice(column, 1);\n }", "title": "" }, { "docid": "6cfeee08683603e2841b048b34a07013", "score": "0.5085004", "text": "function addone()\n{\n/////////addition plus 1////////////////\n i++;\n///////////////////enregistrement +1 dans le compteur text/////////\ncompteur.innerHTML = i ;\n\n}", "title": "" }, { "docid": "ab60b76170b3f1aa15163370fa6c53a2", "score": "0.5084588", "text": "function add(player, row) {\n if (player < 0 || player > 1) {\n return;\n }\n}", "title": "" }, { "docid": "e1b31793b485e416f113965c0b7f1aa2", "score": "0.50740486", "text": "function updateRowNumber(){\n $(\".unit-row\").each(function (i){\n $(this).find('#unit').html(i+1 + \".\");\n });\n }", "title": "" }, { "docid": "21d69c0dcccdc49184088e3a9398b9db", "score": "0.5074023", "text": "incrementOne(name) {\n this.increment(name, 1);\n }", "title": "" }, { "docid": "0a9a62f7d20dada2363a12b4de894302", "score": "0.50698394", "text": "function addColumn(tr, ref, col) {\n var map = ref.map;\n var tableStart = ref.tableStart;\n var table = ref.table;\n\n var refColumn = col > 0 ? -1 : 0;\n if (columnIsHeader(map, table, col + refColumn))\n { refColumn = col == 0 || col == map.width ? null : 0; }\n\n for (var row = 0; row < map.height; row++) {\n var index = row * map.width + col;\n // If this position falls inside a col-spanning cell\n if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {\n var pos = map.map[index], cell = table.nodeAt(pos);\n tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null,\n addColSpan(cell.attrs, col - map.colCount(pos)));\n // Skip ahead if rowspan > 1\n row += cell.attrs.rowspan - 1;\n } else {\n var type = refColumn == null ? tableNodeTypes(table.type.schema).cell\n : table.nodeAt(map.map[index + refColumn]).type;\n var pos$1 = map.positionAt(row, col, table);\n tr.insert(tr.mapping.map(tableStart + pos$1), type.createAndFill());\n }\n }\n return tr\n}", "title": "" }, { "docid": "0a9a62f7d20dada2363a12b4de894302", "score": "0.50698394", "text": "function addColumn(tr, ref, col) {\n var map = ref.map;\n var tableStart = ref.tableStart;\n var table = ref.table;\n\n var refColumn = col > 0 ? -1 : 0;\n if (columnIsHeader(map, table, col + refColumn))\n { refColumn = col == 0 || col == map.width ? null : 0; }\n\n for (var row = 0; row < map.height; row++) {\n var index = row * map.width + col;\n // If this position falls inside a col-spanning cell\n if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {\n var pos = map.map[index], cell = table.nodeAt(pos);\n tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null,\n addColSpan(cell.attrs, col - map.colCount(pos)));\n // Skip ahead if rowspan > 1\n row += cell.attrs.rowspan - 1;\n } else {\n var type = refColumn == null ? tableNodeTypes(table.type.schema).cell\n : table.nodeAt(map.map[index + refColumn]).type;\n var pos$1 = map.positionAt(row, col, table);\n tr.insert(tr.mapping.map(tableStart + pos$1), type.createAndFill());\n }\n }\n return tr\n}", "title": "" }, { "docid": "0a9a62f7d20dada2363a12b4de894302", "score": "0.50698394", "text": "function addColumn(tr, ref, col) {\n var map = ref.map;\n var tableStart = ref.tableStart;\n var table = ref.table;\n\n var refColumn = col > 0 ? -1 : 0;\n if (columnIsHeader(map, table, col + refColumn))\n { refColumn = col == 0 || col == map.width ? null : 0; }\n\n for (var row = 0; row < map.height; row++) {\n var index = row * map.width + col;\n // If this position falls inside a col-spanning cell\n if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {\n var pos = map.map[index], cell = table.nodeAt(pos);\n tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null,\n addColSpan(cell.attrs, col - map.colCount(pos)));\n // Skip ahead if rowspan > 1\n row += cell.attrs.rowspan - 1;\n } else {\n var type = refColumn == null ? tableNodeTypes(table.type.schema).cell\n : table.nodeAt(map.map[index + refColumn]).type;\n var pos$1 = map.positionAt(row, col, table);\n tr.insert(tr.mapping.map(tableStart + pos$1), type.createAndFill());\n }\n }\n return tr\n}", "title": "" }, { "docid": "0a9a62f7d20dada2363a12b4de894302", "score": "0.50698394", "text": "function addColumn(tr, ref, col) {\n var map = ref.map;\n var tableStart = ref.tableStart;\n var table = ref.table;\n\n var refColumn = col > 0 ? -1 : 0;\n if (columnIsHeader(map, table, col + refColumn))\n { refColumn = col == 0 || col == map.width ? null : 0; }\n\n for (var row = 0; row < map.height; row++) {\n var index = row * map.width + col;\n // If this position falls inside a col-spanning cell\n if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {\n var pos = map.map[index], cell = table.nodeAt(pos);\n tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null,\n addColSpan(cell.attrs, col - map.colCount(pos)));\n // Skip ahead if rowspan > 1\n row += cell.attrs.rowspan - 1;\n } else {\n var type = refColumn == null ? tableNodeTypes(table.type.schema).cell\n : table.nodeAt(map.map[index + refColumn]).type;\n var pos$1 = map.positionAt(row, col, table);\n tr.insert(tr.mapping.map(tableStart + pos$1), type.createAndFill());\n }\n }\n return tr\n}", "title": "" }, { "docid": "0a9a62f7d20dada2363a12b4de894302", "score": "0.50698394", "text": "function addColumn(tr, ref, col) {\n var map = ref.map;\n var tableStart = ref.tableStart;\n var table = ref.table;\n\n var refColumn = col > 0 ? -1 : 0;\n if (columnIsHeader(map, table, col + refColumn))\n { refColumn = col == 0 || col == map.width ? null : 0; }\n\n for (var row = 0; row < map.height; row++) {\n var index = row * map.width + col;\n // If this position falls inside a col-spanning cell\n if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {\n var pos = map.map[index], cell = table.nodeAt(pos);\n tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null,\n addColSpan(cell.attrs, col - map.colCount(pos)));\n // Skip ahead if rowspan > 1\n row += cell.attrs.rowspan - 1;\n } else {\n var type = refColumn == null ? tableNodeTypes(table.type.schema).cell\n : table.nodeAt(map.map[index + refColumn]).type;\n var pos$1 = map.positionAt(row, col, table);\n tr.insert(tr.mapping.map(tableStart + pos$1), type.createAndFill());\n }\n }\n return tr\n}", "title": "" }, { "docid": "0a9a62f7d20dada2363a12b4de894302", "score": "0.50698394", "text": "function addColumn(tr, ref, col) {\n var map = ref.map;\n var tableStart = ref.tableStart;\n var table = ref.table;\n\n var refColumn = col > 0 ? -1 : 0;\n if (columnIsHeader(map, table, col + refColumn))\n { refColumn = col == 0 || col == map.width ? null : 0; }\n\n for (var row = 0; row < map.height; row++) {\n var index = row * map.width + col;\n // If this position falls inside a col-spanning cell\n if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {\n var pos = map.map[index], cell = table.nodeAt(pos);\n tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null,\n addColSpan(cell.attrs, col - map.colCount(pos)));\n // Skip ahead if rowspan > 1\n row += cell.attrs.rowspan - 1;\n } else {\n var type = refColumn == null ? tableNodeTypes(table.type.schema).cell\n : table.nodeAt(map.map[index + refColumn]).type;\n var pos$1 = map.positionAt(row, col, table);\n tr.insert(tr.mapping.map(tableStart + pos$1), type.createAndFill());\n }\n }\n return tr\n}", "title": "" }, { "docid": "53b2c22d9cc39eebc3fe69b7020c8989", "score": "0.50580037", "text": "appendColumn() {\n let obj = this.state.data.map((p) => {\n let size = Object.keys(p).length;\n p[size+1] = '-';\n return p;\n });\n this.setState({data:obj});\n }", "title": "" }, { "docid": "5842d116d9548cda3bb59db0cb01a5ad", "score": "0.5057916", "text": "function newColumn(cellNum) {\n for(p= 0; p< rows.length; p++) {\n for(c= 0; c< cellNum; c++) {\n let newCell= document.createElement(\"div\");\n rows[c].appendChild(newCell).className= \"cell\"; \n }; \n };\n}", "title": "" }, { "docid": "079cee908445e26805ec9543712c85d0", "score": "0.5056588", "text": "function sidestart(){\r\n \r\n column13.push(column12.pop()) ;\r\n \r\n }", "title": "" }, { "docid": "03d40e062d23b01b4dc2728e29743fff", "score": "0.5054506", "text": "function addColumnDown(){\n for (let i = 0; i < grid.length; i++){\n for (let j = 0; j <= grid.length; j++){\n if (grid[i][j] == ''){\n grid[i][j] = ''\n }\n else if (grid[i][j] == grid[i + 1][j]){\n let tempValue = grid[i][j] + grid[i + 1][j];\n grid[i + 1][j] = tempValue;\n addScore(tempValue);\n grid[i][j] = '';\n }\n }\n }\n //winningCondition();\n}", "title": "" }, { "docid": "976d1b54bafecf677d1028ef072185dd", "score": "0.505371", "text": "function resetNumber() {\n i = $(this).closest('tr').find('td:eq(0)').text()\n $('#myTable').find('tr').find('td:first').each(function(i){\n $(this).text(parseInt(i)+1);\n alert(\"Row delete successfully.\");\n });\n }", "title": "" }, { "docid": "3486033c84eb596c80db3f9926971b93", "score": "0.50522023", "text": "insertColumn() {\n if (this.focusedCellController) {\n const previouslyFocused = this.focusedCellController;\n const cellElement = this.focusedCellController.element;\n const columnIndex = Dom.getIndexOfElementInParent(cellElement);\n this.model.spliceColumns(columnIndex, 1, 0);\n // Make the new column the same width as the old one\n this.model.columns[columnIndex].width =\n this.model.columns[columnIndex + 1].width;\n // Move the focus to the new column\n this.getRelativeCellController(previouslyFocused, CellController_1.default.WEST).focused = true;\n }\n else {\n throw Error('No cell is focused');\n }\n }", "title": "" }, { "docid": "fa923070b71e13784e34ce6de7573ce8", "score": "0.50492245", "text": "function setCollum(id, newcollum){ return \"t\" + getRow(id) + \"-\" + newcollum; }", "title": "" }, { "docid": "48f5ba96528e3ff3a63cc9c791b93ca4", "score": "0.5046266", "text": "top_mask_col(col) {\n if (typeof col === 'bigint')\n // eslint-disable-next-line no-undef\n return (1n << BigInt(this.height - 1)) << (col * BigInt(this.height + 1));\n else\n // eslint-disable-next-line no-undef\n return (1n << BigInt(this.height - 1)) << BigInt(col * (this.height + 1));\n }", "title": "" }, { "docid": "60ed7bb7eec921f37f71efe73ad0cc74", "score": "0.5041644", "text": "setLastColumn(columnHeader) {\n this.lastHeader = columnHeader;\n }", "title": "" }, { "docid": "2125c2c950902b4ce79fdae5a5cfd7d3", "score": "0.5035785", "text": "async _create_computed_column(event) {\n const data = event.detail;\n let computed_column_name = data.column_name;\n\n const cols = await this._table.columns();\n // edit overwrites last column, otherwise avoid name collision\n if (cols.includes(computed_column_name)) {\n computed_column_name += ` ${Math.round(Math.random() * 100)}`;\n }\n\n const params = [\n {\n computation: data.computation,\n column: computed_column_name,\n computed_function_name: data.computation.name,\n func: data.computation.func,\n inputs: data.input_columns.map(col => col.name),\n input_type: data.computation.input_type,\n type: data.computation.return_type\n }\n ];\n\n const table = this._table.add_computed(params);\n await this._load_table(table, true);\n this._update_column_view();\n }", "title": "" }, { "docid": "4648a737caaba73bf73c15010c8369e7", "score": "0.50293916", "text": "getCol (index) {\n return index % this.width;\n }", "title": "" }, { "docid": "d22f91df4caa516878a0e05bbf15a1a3", "score": "0.5018888", "text": "_handleInsertColumn(e) {\n this.insertColumn(e.detail);\n }", "title": "" }, { "docid": "27d68c03e9b7c80697d80378684c1a64", "score": "0.50128984", "text": "function fillSumTblFirstRowHelper($table, columnDates) {\n $table.find(\"thead th\").each(function (i) {\n if (i == 0) { return true; }\n $(this).text(columnDates[i - 1].format(\"dd DD\"));\n });\n}", "title": "" } ]
54d812137c75b11cb3f105fd16c938e0
there are backticks to make this html readable
[ { "docid": "138fe0a6c22cab1ab2aa666701c9f9ff", "score": "0.0", "text": "async getHtml(){\n return `\n <h1>Posts</h1>\n\n <p>\n\n Viewing the Posts\n\n </p>\n <p>\n\n <a href=\"/posts\" data-link>View Recent Posts</a>\n\n </p>\n `;\n \n\n }", "title": "" } ]
[ { "docid": "ff6d435ade29b494cd6ab16341ee9ebc", "score": "0.6447308", "text": "function _specialCharsHTML() {\n // Create special characters html.\n return \"\\n <div class=\\\"fr-buttons fr-tabs fr-tabs-scroll\\\">\\n \".concat(_renderSplCharsCategory(categories, selectedCategory), \"\\n </div>\\n <div class=\\\"fr-icon-container fr-sc-container\\\">\\n \").concat(_renderSpanSplCharsHtml(selectedCategory), \"\\n </div>\");\n }", "title": "" }, { "docid": "0f009f4943f5cfe6b3a4e4c39ebafbaa", "score": "0.63950014", "text": "function escape_html() {\n return this.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "07c8e9b7d15b5bd49166c3bc9ddd4559", "score": "0.638137", "text": "rawMarkup () {\n var rawMarkup = marked(this.props.children.toString(), {sanitize: true}) // eslint-disable-line\n return { __html: rawMarkup }\n }", "title": "" }, { "docid": "e08e805739cea1e3c7c178290f98077f", "score": "0.6364413", "text": "function html(h, node) {\n return h.dangerous ? h.augment(node, u('raw', node.value)) : null\n}", "title": "" }, { "docid": "e08e805739cea1e3c7c178290f98077f", "score": "0.6364413", "text": "function html(h, node) {\n return h.dangerous ? h.augment(node, u('raw', node.value)) : null\n}", "title": "" }, { "docid": "9db5f1fda7a8c5478e0a91dc1704d591", "score": "0.6299362", "text": "function M(e){return`\\n <div class=\"byline grid\">\\n <div class=\"authors-affiliations grid\">\\n <h3>Authors</h3>\\n <h3>Affiliations</h3>\\n ${e.authors.map(e=>`\\n <p class=\"author\">\\n ${e.personalURL?`\\n <a class=\"name\" href=\"${e.personalURL}\">${e.name}</a>`:`\\n <span class=\"name\">${e.name}</span>`}\\n </p>\\n <p class=\"affiliation\">\\n ${e.affiliations.map(e=>e.url?`<a class=\"affiliation\" href=\"${e.url}\">${e.name}</a>`:`<span class=\"affiliation\">${e.name}</span>`).join(\", \")}\\n </p>\\n `).join(\"\")}\\n </div>\\n <div>\\n <h3>Published</h3>\\n ${e.publishedDate?`\\n <p>${e.publishedMonth} ${e.publishedDay}, ${e.publishedYear}</p> `:\"\\n <p><em>Not published yet.</em></p>\"}\\n </div>\\n </div>\\n`}", "title": "" }, { "docid": "8ad887308cd2c1c809b0776c7f074c72", "score": "0.62981325", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "636c377f5bbb25b69947802f2b68aa7c", "score": "0.62866825", "text": "render() {\n return html`\n \n\n `;\n }", "title": "" }, { "docid": "d8b085fb32d96ab3f78a8c5fd01eba2f", "score": "0.6260107", "text": "function _escTag(s){ return s.replace(\"<\",\"&lt;\").replace(\">\",\"&gt;\");}", "title": "" }, { "docid": "d533807f81207290a18aa7a889a225ac", "score": "0.6230787", "text": "function escapeHTML(str) {return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');}", "title": "" }, { "docid": "d533807f81207290a18aa7a889a225ac", "score": "0.6230787", "text": "function escapeHTML(str) {return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');}", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.6208739", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.6208739", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.6208739", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.6208739", "text": "function SafeHtml() { }", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6194556", "text": "function SafeHtml() {}", "title": "" }, { "docid": "61f1fba2ce282f005665aa0944ca8b1e", "score": "0.61395055", "text": "function makeMarkup () {\n\n\tcharList = document.getElementById('in').value\n\tcharList = charList.replace(/ /g,'')\n\tchars = [...charList]\n type = index[chars[0]].status\n\tout = '<figure class=\"'+type+'Box auto noindex indexline\" data-cols=\"\" data-links=\"'\n\tfor (i=0;i<chars.length;i++) {\n\t\tout += index[chars[i]].section+','\n\t\t}\n\t//out +='\" data-notes=\"'\n \t//for (i=0;i<chars.length;i++) {\n\t//\tout += index[chars[i]].sectionName+','\n\t//\t}\n out += '\">'+chars.join('␣')+'</figure>'\n\tdocument.getElementById('out').value = out\n\tdocument.getElementById('out').select()\n\t}", "title": "" }, { "docid": "61f1fba2ce282f005665aa0944ca8b1e", "score": "0.61395055", "text": "function makeMarkup () {\n\n\tcharList = document.getElementById('in').value\n\tcharList = charList.replace(/ /g,'')\n\tchars = [...charList]\n type = index[chars[0]].status\n\tout = '<figure class=\"'+type+'Box auto noindex indexline\" data-cols=\"\" data-links=\"'\n\tfor (i=0;i<chars.length;i++) {\n\t\tout += index[chars[i]].section+','\n\t\t}\n\t//out +='\" data-notes=\"'\n \t//for (i=0;i<chars.length;i++) {\n\t//\tout += index[chars[i]].sectionName+','\n\t//\t}\n out += '\">'+chars.join('␣')+'</figure>'\n\tdocument.getElementById('out').value = out\n\tdocument.getElementById('out').select()\n\t}", "title": "" }, { "docid": "ec5cd37319b184a6d04a400ef12643ad", "score": "0.61181456", "text": "toMarkup() {\n return utils.escape(this.toText());\n }", "title": "" }, { "docid": "cd41fee52efbebf19ed0a0b5093d0ee9", "score": "0.61002934", "text": "function html(data) {\n const markUp = `\n <h3>Domain: ${data.domain}</h3>\n <h3>Available: ${data.available}</h3>\n <h3>Created: ${data.created_at}</h3>\n <h3>Expires: ${data.expires_at}</h3>\n <h3>Registrar: ${data.registrar}</h3>\n `;\n return markUp;\n}", "title": "" }, { "docid": "ebdaa5961706398322402eb50a88fec3", "score": "0.6037526", "text": "function html() { return [htmlSyntax, htmlSupport()]; }", "title": "" }, { "docid": "7a40c3e5fa99f036f08b4a4afc5ae4d0", "score": "0.6025675", "text": "getHTML() {\n var html = '';\n html += `<h4 class=\"linkHeadline\"><a class=\"linkTitle\" href=\"${this.url}\">${this.title}</a> <span class=\"linkUrl\">${this.url}</span></h4>`;\n html += `<span class=\"linkAuthor\">Submitted by ${this.author}</span>`;\n return html;\n }", "title": "" }, { "docid": "9c3759a05c08dc995ccd1c7228b0e5c9", "score": "0.6015707", "text": "function htmltag( contents )\n{\n // ' must be used for fields\n result = contents;\n result.replace (\"&lt;\", \"<\");\n result.replace (\"&gt;\", \">\");\n result.replace (\"&quot;\", \"\\\\\\\"\");\n return result;\n}", "title": "" }, { "docid": "e6a5df641db4953d2f53b0582bfd73d5", "score": "0.5992884", "text": "static formatContents(contents) {\n return contents.replace(/\\\\</g, '&#60;').replace(/\\\\\"/g, '&#34;');\n }", "title": "" }, { "docid": "d27a6aea97cbae3c2e023c7da3cabcd8", "score": "0.5956201", "text": "function toHTML(s) {\n let ar = [\"b\", \"u\", \"i\"]\n let tag1, tag2, flag\n for (i in ar) {\n c = ar[i]\n tag1 = c + \"\\\\[\"\n tag2 = \"\\\\]\" + c\n let r1 = new RegExp(tag1, 'g')\n let r2 = new RegExp(tag2, 'g')\n s = s.replace(r1, \"<\" + c + \">\").replace(r2, \"</\" + c + \">\")\n }\n \n if (s.includes(\"%%%\")) {\n let out = s.split(\"%%%\")\n for (let i = 1; i < out.length; i += 2)\n out[i] = \"<pre class='prettyprint' style='display: inline; padding: 1px 4px'>\" + out[i] + \"</pre>\"\n s = out.join(\"\")\n }\n return s\n}", "title": "" }, { "docid": "211486c1ea59eb36623bc231dbb902e3", "score": "0.59481806", "text": "get displayHtml() {\n var {escapeHtml} = Utils;\n var {matchedName, args} = this._verb;\n var html = '<span class=\"verb\">' + matchedName + \"</span> \";\n for (let x in (this.fromNounFirstSuggestion\n ? this._argSuggs\n : this._argStrings)) {\n let obj = x === \"object\";\n let prearg = (\n (obj || !args[x]? \"\" :\n '<span class=\"delimiter\">' +\n escapeHtml(args[x].preposition) +\n \"</span> \") +\n '<span class=\"' + (obj ? \"object\" : \"argument\") + '\">');\n let {summary} = this._argSuggs[x] || 0;\n html += (\n summary\n ? prearg + summary + \"</span> \"\n : (args[x]? ('<span class=\"needarg\">' +\n prearg + escapeHtml(args[x].label) +\n \"</span>\"): \"\") +\n \"</span> \");\n }\n return html;\n }", "title": "" }, { "docid": "3b8d31ef107055e7b2311543a0c8eaf6", "score": "0.59342194", "text": "function esc(s) { return s.replace(/\\{\\{>/g, '{{&gt;'); }", "title": "" }, { "docid": "7e06859c8121aedbe164ceccc5242791", "score": "0.5901774", "text": "toHTML() {\n\t\treturn '';\n\t}", "title": "" }, { "docid": "87fdce979dc18c3a4b669fbe5d6a28e8", "score": "0.5840621", "text": "setHtml() {\n\t\tthis.html = (\n\t\t\t<li>\n\t\t\t\t<div className='normal'>{this.value}</div>\n\t\t\t\t<ul>\n\t\t\t\t\t{this.htmlLeft} {this.htmlRight}\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t);\n\t}", "title": "" }, { "docid": "81d8c8759d6a4f285db6ebe3e1e7053b", "score": "0.5836025", "text": "function convertHTML(str) {\n // &colon;&rpar;\n str = str.replace(/&/g, \"&amp;\");\n str = str.replace(/</g, \"&lt;\");\n str = str.replace(/>/g, \"&gt;\");\n str = str.replace(/\"/g, \"&quot;\");\n str = str.replace(/'/g, \"&apos;\");\n \n console.log(str);\n return str;\n }", "title": "" }, { "docid": "4d8959d1bd91a1e21a6e9747e3baacd6", "score": "0.5822953", "text": "getHTML() {\n const endIndex = this.strings.length - 1;\n let html = '';\n for (let i = 0; i < endIndex; i++) {\n const s = this.strings[i];\n // This replace() call does two things:\n // 1) Appends a suffix to all bound attribute names to opt out of special\n // attribute value parsing that IE11 and Edge do, like for style and\n // many SVG attributes. The Template class also appends the same suffix\n // when looking up attributes to creat Parts.\n // 2) Adds an unquoted-attribute-safe marker for the first expression in\n // an attribute. Subsequent attribute expressions will use node markers,\n // and this is safe since attributes with multiple expressions are\n // guaranteed to be quoted.\n let addedMarker = false;\n html += s.replace(lastAttributeNameRegex, (_match, whitespace, name, value) => {\n addedMarker = true;\n return whitespace + name + boundAttributeSuffix + value + marker;\n });\n if (!addedMarker) {\n html += nodeMarker;\n }\n }\n return html + this.strings[endIndex];\n }", "title": "" }, { "docid": "0b58be1baf566c38a93651ff04f5c2aa", "score": "0.5818823", "text": "function escape_html(str) {\n\t return (str + '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n\t}", "title": "" }, { "docid": "179b09cb8d0dfa14fcf8ba3375be7c36", "score": "0.58154136", "text": "function escape(html) {\n return html.replace(/[<|>|&]/g, function (match) {\n switch (match) {\n case '<': return '&lt;';\n case '>': return '&gt;';\n case '&': return '&amp;';\n default: return match;\n }\n });\n }", "title": "" }, { "docid": "68266668e17bdd9ccf12c278a866e1b1", "score": "0.5786481", "text": "function specialToHTML(str) {\n\t\treturn str.replaceAll(\"&#47;\", \"/\");\n\t}", "title": "" }, { "docid": "b970b6e82fa29d6aef49bd702ec2bfd7", "score": "0.57852626", "text": "_generateMarkup()\n {\n\n }", "title": "" }, { "docid": "445e0efe7f202144d5d4e9b42c817621", "score": "0.57802016", "text": "getHTMLPreview() {\n return (\n <Message fluid content={ReactHtmlParser(replaceNL(this.props.value))} />\n );\n }", "title": "" }, { "docid": "bf68410119527a6bb42ccafed94670d2", "score": "0.57638973", "text": "function escapeHTML(str){\n return str.replace(/</g, \"&lt\").replace(/>/g, \"&gt\");\n}", "title": "" }, { "docid": "074e4308a39d9fa61c52da75550c3bb9", "score": "0.5759291", "text": "toHTML() {\n\t\tconst commands = [\n\t\t\t{type: 'move', name: 'TURN_L'},\n\t\t\t{type: 'move', name: 'TURN_R'},\n\t\t\t{type: 'move', name: 'MOVE_F'},\n\t\t\t{type: 'sensor', name: 'SENSE'},\n\t\t\t{type: 'label', name: 'LABEL'},\n\t\t\t{type: 'jump', name: 'PREV_LT'},\n\t\t\t{type: 'jump', name: 'NEXT_LT'}\n\t\t];\n return this.text\n .map(x => commands[x])\n .map(x => `<span data-code=\"${x.type}\">${x.name}</span>`)\n .join(', ');\n\t}", "title": "" }, { "docid": "5901e854f52e96b6311b417d10a1d315", "score": "0.5758577", "text": "function htmlEscape(text){\n return text.replace(/[<>\"&]/g, function(match, pos, originalText){\n switch(match){\n case \"<\":\n return \"&lt;\";\n case \">\":\n return \"&gt;\";\n case \"&\":\n return \"&amp;\";\n case \"\\\"\":\n return \"&quot;\";\n } \n });\n }", "title": "" }, { "docid": "3ae4d6cf0022b8d39b48e8a510ae1a85", "score": "0.57502073", "text": "function escapeHTML(value) {\n return String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;');\n }", "title": "" }, { "docid": "23a610ba581855fecfeb2ecf4c679982", "score": "0.57498103", "text": "function escapeHTML(s) {\n\t\t\treturn s.replace(rescaper, replacer);\n\t\t}", "title": "" }, { "docid": "ae6d50ee4067f911d399299282c20544", "score": "0.5737", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "ae6d50ee4067f911d399299282c20544", "score": "0.5737", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "ae6d50ee4067f911d399299282c20544", "score": "0.5737", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "30ef4d67d13477e4e2c1e34147c5b7c3", "score": "0.5733374", "text": "getRawMarkup() {\n var md = new Remarkable();\n return { __html: md.render(this.state.value) };\n }", "title": "" }, { "docid": "7404e30b79451097aa40bb6af39bf912", "score": "0.57328886", "text": "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n const close = s.lastIndexOf('>');\n // We're in a text position if the previous string closed its last tag, an\n // attribute position if the string opened an unclosed tag, and unchanged\n // if the string had no brackets at all:\n //\n // \"...>...\": text position. open === -1, close > -1\n // \"...<...\": attribute position. open > -1\n // \"...\": no change. open === -1, close === -1\n isTextBinding =\n (close > -1 || isTextBinding) && s.indexOf('<', close + 1) === -1;\n if (!isTextBinding && rewritesStyleAttribute) {\n html = html.replace(lastAttributeNameRegex, (match, p1, p2, p3) => {\n return (p2 === 'style') ? `${p1}style$${p3}` : match;\n });\n }\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "title": "" }, { "docid": "f8fbde2bb4a5c9d5b17e9e589c0b2d6c", "score": "0.57211953", "text": "esc(str) {\r\n let div = document.createElement(\"div\");\r\n div.appendChild(document.createTextNode(str));\r\n\r\n return div.innerHTML;\r\n }", "title": "" }, { "docid": "cc28584ce27d920b1d3232b33ba683d7", "score": "0.5721149", "text": "createMarkup() {\n return {__html: this.state.valoriCorrenti.testo_soluzione};\n }", "title": "" }, { "docid": "41c536ecacbed471ebb9d886559e6aa4", "score": "0.5674168", "text": "esc(str){\n let div = document.createElement(\"div\")\n div.appendChild(document.createTextNode(str))\n return div.innerHTML\n }", "title": "" }, { "docid": "98771c1546c469c2f34a3231861c706b", "score": "0.5661225", "text": "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "title": "" }, { "docid": "5b118cce50c54327b23c3b3785c1b103", "score": "0.565783", "text": "getHTML(){const endIndex=this.strings.length-1;let html='';for(let i=0;i<endIndex;i++){const s=this.strings[i];// This exec() call does two things:\n// 1) Appends a suffix to the bound attribute name to opt out of special\n// attribute value parsing that IE11 and Edge do, like for style and\n// many SVG attributes. The Template class also appends the same suffix\n// when looking up attributes to create Parts.\n// 2) Adds an unquoted-attribute-safe marker for the first expression in\n// an attribute. Subsequent attribute expressions will use node markers,\n// and this is safe since attributes with multiple expressions are\n// guaranteed to be quoted.\nconst match=lastAttributeNameRegex.exec(s);if(match){// We're starting a new bound attribute.\n// Add the safe attribute suffix, and use unquoted-attribute-safe\n// marker.\nhtml+=s.substr(0,match.index)+match[1]+match[2]+boundAttributeSuffix+match[3]+marker;}else{// We're either in a bound node, or trailing bound attribute.\n// Either way, nodeMarker is safe to use.\nhtml+=s+nodeMarker;}}return html+this.strings[endIndex];}", "title": "" }, { "docid": "5f729dd008733f3cdd1a3d5ce6bf9644", "score": "0.5657287", "text": "generateHTML() {\n return `<div class='aside-container aside-search'>\n <h4>${this.title}</h4>\n <div class=\"form\">\n <input id=\"search\" type=\"text\" placeholder='${this.placeholder}'>\n <i class=\"${this.icon.faClass}\"></i>\n </div>\n </div>`;\n\n \n }", "title": "" }, { "docid": "f2a5aeb64241beea8659e4634bf2bf7a", "score": "0.56525123", "text": "function escapeHTML(string) {\n var pre = document.createElement(\"pre\");\n var text = document.createTextNode(string);\n pre.appendChild(text);\n return pre.innerHTML;\n }", "title": "" }, { "docid": "143409264db814c987a5b874716dd44d", "score": "0.5648516", "text": "_getHtml(HTMLId, entityType) {\n return `\n <div\n class=\"textae-editor__signboard\"\n ${HTMLId ? `id=\"${HTMLId}\"` : ''}\n title=\"${this._model.title}\"\n data-entity-type=\"${entityType}\"\n data-id=\"${this._model.id}\"\n >\n <div\n class=\"textae-editor__signboard__type-values\"\n style=\"background-color: ${hexToRGBA(this._model.color, 0.4)};\"\n >\n <div\n class=\"textae-editor__signboard__type-label\"\n tabindex=\"0\"\n style=\"background-color: ${getLabelBackgroundColor()};\"\n >\n ${this._model.anchorHTML}\n </div>\n ${this._model.attributes.map((a) => a.contentHTML).join('')}\n </div>\n </div>\n `\n }", "title": "" }, { "docid": "dd3ec40eea5b99dd904b6ca0d2772e6e", "score": "0.5640836", "text": "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n const close = s.lastIndexOf('>');\n // We're in a text position if the previous string closed its last tag, an\n // attribute position if the string opened an unclosed tag, and unchanged\n // if the string had no brackets at all:\n //\n // \"...>...\": text position. open === -1, close > -1\n // \"...<...\": attribute position. open > -1\n // \"...\": no change. open === -1, close === -1\n isTextBinding =\n (close > -1 || isTextBinding) && s.indexOf('<', close + 1) === -1;\n if (!isTextBinding && rewritesStyleAttribute) {\n html = html.replace(lastAttributeNameRegex, (match, p1, p2, p3) => {\n return (p2 === 'style') ? `${p1}style$${p3}` : match;\n });\n }\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "title": "" }, { "docid": "dd3ec40eea5b99dd904b6ca0d2772e6e", "score": "0.5640836", "text": "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n const close = s.lastIndexOf('>');\n // We're in a text position if the previous string closed its last tag, an\n // attribute position if the string opened an unclosed tag, and unchanged\n // if the string had no brackets at all:\n //\n // \"...>...\": text position. open === -1, close > -1\n // \"...<...\": attribute position. open > -1\n // \"...\": no change. open === -1, close === -1\n isTextBinding =\n (close > -1 || isTextBinding) && s.indexOf('<', close + 1) === -1;\n if (!isTextBinding && rewritesStyleAttribute) {\n html = html.replace(lastAttributeNameRegex, (match, p1, p2, p3) => {\n return (p2 === 'style') ? `${p1}style$${p3}` : match;\n });\n }\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "title": "" }, { "docid": "8b60ba3310964e94e3fa6e346dae61e8", "score": "0.5629021", "text": "async getHtml() {\n return `\n <h1>Welcome back, Raymond</h1>\n <p>\n This is where you learn new languages\n </p>\n <p>\n <a href=\"/posts\" data-link>View recent languages</a>.\n </p>\n `;\n }", "title": "" }, { "docid": "ede7958302620ac63627a24b60d10192", "score": "0.5628277", "text": "function escape (str) {\n return str.replace(SPACE, '&nbsp;')\n .replace(LESS_THAN, '&lt;')\n .replace(MORE_THAN, '&gt;')\n }", "title": "" }, { "docid": "1f39c4cbcf596f8930913b6cb93d86b3", "score": "0.5626358", "text": "function escapeHtml(unsafe) {\n return unsafe\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\")\n .replace(/\\//g, \"&#47;\");\n }", "title": "" }, { "docid": "88ea0e73e46266586e26c42e70f10fad", "score": "0.5624779", "text": "convert(html) {\n const [$h, fragment] = this.getFragment(html);\n\n if (fragment.input !== null) {\n if (fragment.input.type === 'checkbox') {\n this.addCheckboxClasses($h, fragment);\n } else {\n this.addClasses($h, fragment);\n }\n\n const id = $(fragment.input).attr('id');\n $(fragment.label).attr('for', id);\n }\n\n return $h.html();\n }", "title": "" }, { "docid": "44078f92bd45e31890028c23fdec95ae", "score": "0.5607511", "text": "function baynote_removeHtml(raw) {\n\tif (!raw) return;\n\traw = raw.replace(/\\<[^>]*\\>/g, \"\");\n\traw = raw.replace(/\\<.*/, \"\");\n\traw = raw.replace(/\\&nbsp;/g, \" \");\n\traw = raw.replace(/^\\s+/, \"\");\n\traw = raw.replace(/\\s+$/, \"\");\n\traw = raw.replace(/\\n/g, \" \");\n\treturn raw;\n}", "title": "" }, { "docid": "242d65874dcfdf75bb015bd4824cb6bc", "score": "0.5602167", "text": "function escapeHTML(s) {\n return s.replace(rescaper, replacer);\n }", "title": "" }, { "docid": "da9b9bcf410b83c32316173938861828", "score": "0.55979717", "text": "function escape(html) {\n return html.replace(/[<|>|&]/g, function (match) {\n switch (match) {\n case '<': return '&lt;';\n case '>': return '&gt;';\n case '&': return '&amp;';\n default: return match;\n }\n });\n}", "title": "" }, { "docid": "da9b9bcf410b83c32316173938861828", "score": "0.55979717", "text": "function escape(html) {\n return html.replace(/[<|>|&]/g, function (match) {\n switch (match) {\n case '<': return '&lt;';\n case '>': return '&gt;';\n case '&': return '&amp;';\n default: return match;\n }\n });\n}", "title": "" }, { "docid": "46fd225fa290f23d850f503e9ef5f650", "score": "0.5593966", "text": "get template() {\n return Xen.html`&nbsp;`;\n }", "title": "" }, { "docid": "b59d5c8d77eb34eae418076b3411eac4", "score": "0.55876434", "text": "latex(showPlusMinus=false) {\n const leftSide = printNode.latex(this.leftNode, showPlusMinus);\n const rightSide = printNode.latex(this.rightNode, showPlusMinus);\n const comparator = this.comparator;\n\n return `${leftSide} ${comparator} ${rightSide}`;\n }", "title": "" }, { "docid": "a9b9a7c7c804ca0132833c272d52e22a", "score": "0.5586797", "text": "function htmlSpecialChars(str, quote_style)\n{\n\tstr = str.replace(/&/ig,\"&amp;\");\n\tif(!quote_style || quote_style==1)\n\t{\n\t\tstr = str.replace(/\\\"/ig,\"&quot;\")\n\t\tif(quote_style==1)\n\t\t\tstr = str.replace(/\\'/ig,\"&#039;\")\n\t}\n\tstr = str.replace(/\\>/ig,\"&gt;\");\n\tstr = str.replace(/\\</ig,\"&lt;\");\n\treturn str;\n}", "title": "" }, { "docid": "f39eea3768cacba5d7d69bc230d576a4", "score": "0.5586698", "text": "function miscHtml(html) {\n\tvar code = '<div class=\"home\">' + html + '</div>';\n\treturn code;\n}", "title": "" }, { "docid": "308b5fbaf3bea43aa7662a9308d9458d", "score": "0.555603", "text": "getHTML(){const a=this.strings.length-1;let b=\"\",c=!0;for(let d=0;d<a;d++){const a=this.strings[d];b+=a;// We're in a text position if the previous string closed its tags.\n// If it doesn't have any tags, then we use the previous text position\n// state.\nconst e=j(a);c=-1<e?e<a.length:c,b+=c?t:r}return b+=this.strings[a],b}", "title": "" }, { "docid": "29f55a95bb4e75b48f7eb2d1d785da4c", "score": "0.5551592", "text": "function escapeLeftAngleBrackets(str) {\r\n return str.replace(/</g, \"&lt;\");\r\n}", "title": "" }, { "docid": "d07d753b524bf9198cae4ea0821e287e", "score": "0.5549114", "text": "function escapeHtml(str) {\n var div = document.createElement('div');\n div.appendChild(document.createTextNode(str));\n return div.innerHTML;\n }", "title": "" }, { "docid": "f24c23d89f69ce43485e5fd2c5f91612", "score": "0.5546889", "text": "function output(inp) {\n return <pre dangerouslySetInnerHTML={{__html: inp}} />\n}", "title": "" }, { "docid": "38f3351881123fbf3bde96f9cac73951", "score": "0.5543855", "text": "function escapeHtml(html) {\n return html.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&#039;\");\n}", "title": "" }, { "docid": "e300042b4124537f64a22b8f9a85e730", "score": "0.55432", "text": "TeamHTML() {\n\n return `\n <div class=\"grid-container\">\n <div class=\"grid-item\">\n <h2 class=\"Headline\">${this.name}</h2>\n <a href=\"${this.website}\">Team Site</a>\n <a href=\"${this.schedule}\">Schedule</a></br>\n <img src = \"${this.image}\" style=\"width:70px;height:110px;\"></br>\n\n </div></div>\n `\n }", "title": "" }, { "docid": "0ed098c6a36c4244496c95b092dfb812", "score": "0.5535073", "text": "htmlString() {\n\t\t// capitalize first letter to work in URL\n\t\tlet capitalizedType = this.type.charAt(0).toUpperCase() + this.type.slice(1);\n\n\t\tif (this.wet === true) {\n\t\t\tcapitalizedType += 'Wet';\n\t\t};\n\t\t\n\t\tlet htmlResult = \n\t\t\t`<img \n\t\t\t\tclass=\"${this.type} pipe rotate${this.rotation}\"\n\t\t\t\tsrc=\"assets/pipe${capitalizedType}.svg\"\n\t\t\t\talt=\"${capitalizedType} Pipe\"\n\t\t\t>`;\n\n\t\treturn htmlResult;\n\t}", "title": "" }, { "docid": "14c5c0a9c93282559864c242455a25e0", "score": "0.55344915", "text": "render() {\n\t\treturn this.template().replace('>', ` uid=\"${this.uid}\">`);\n\t}", "title": "" }, { "docid": "e50da2b3cbed1559a83922ff874d0aa8", "score": "0.55343753", "text": "function h(text) { return text.replace(/&/g, '&amp;').replace(/</g, '&lt;'); }", "title": "" }, { "docid": "cd13963326e5decc5af47f787a070d15", "score": "0.55217814", "text": "function formatHTMLSelection(html) { \n var rgx = new RegExp('(<)/?[a-z]+[0-9]?[a-z=\"; ]*(>)', 'g');\n return html.replace(rgx, '');\n}", "title": "" }, { "docid": "a006b19f98e41a4af9bad6e6f9c22fb2", "score": "0.5520356", "text": "function escapeHtml(str) {\n\treturn str.replace(/[&<>]/g, function (tag) {\n\t\treturn tagsToReplace[tag] || tag;\n\t});\n}", "title": "" }, { "docid": "bf0a4d5de27ba10ee142b6701e689201", "score": "0.55177283", "text": "_generateMarkup() {\n\t\treturn this._data.map(this._generateMarkupPreview).join(\"\");\n\t}", "title": "" }, { "docid": "1c65137f6f6ae8f717944cb8b75ed4ce", "score": "0.5516328", "text": "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "title": "" }, { "docid": "26ec04d9354dfd2a81ed49994b7b45b3", "score": "0.551482", "text": "function escape_html(text) {\n\t var esc = document.createElement('div');\n\t esc.textContent = text;\n\t return esc.innerHTML;\n\t}", "title": "" }, { "docid": "dc1a9968ddc5fe28ba95267026152e77", "score": "0.5514635", "text": "function createMarkup(markup) {\n return {__html: markup}\n}", "title": "" }, { "docid": "f106a06f2f394e953ebf2f6e64ea9b6a", "score": "0.5511135", "text": "getHTML() {\n return getHTMLFromFragment(this.state.doc, this.schema);\n }", "title": "" }, { "docid": "c9db16e5bfe52efdd6398bf39034162b", "score": "0.5509632", "text": "function toString() {\n return static_1.html(this, this.options);\n}", "title": "" }, { "docid": "2f6d9d0e498206b16e0289eb0be941bd", "score": "0.5506513", "text": "getHtml(i) {\n\t\treturn `\n <button class=\"desktopIcon launchExplorer\" data-class-name=\"${this.classNameToOpen}\" data-corresponding-windo=\"${this.windoClassName}\">\n \n <img draggable=\"true\" class=\"desktop-icon-img\" src=\"${this.img}\" alt=\"\">\n\n <p class=\"item-p\" id=\"${this.classNameToOpen}\">${this.title}</p>\n\n </button>`;\n\t}", "title": "" }, { "docid": "01d88cab7e35f367b3bf9c460bcb809b", "score": "0.55042857", "text": "function escape(html) {\n return String(html)\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "93c51a4c2a4010026d59118b1451af73", "score": "0.5503856", "text": "function toolTipHTML(data) {\n\n var tip = '<h6 class=\"card-title\">' + data.data.prop + '</h6>'\n tip += '<p class=\"card-text\">' + data.data.expression + '</p>';\n\n return tip;\n }", "title": "" }, { "docid": "31755d1aaebf6b7fe794792a90b3aec7", "score": "0.55016476", "text": "formatCrawlString(string) {\n const newString = string.replace(/(?:\\r\\n|\\r|\\n)/g, '<br/>');\n return {__html: newString};\n }", "title": "" }, { "docid": "861a38be42a5737d86a14afc26f32b1c", "score": "0.5499888", "text": "function generateHTML(answers) {\n return `\n # My name is ${answers.username}\n ## I am from ${answers.location}\n [My GitHub username is](${answers.github})\n ## My project title is: ${answers.pTitle}\n ## Description: ${answers.pDescription}\n ## Here is the project's Table of Contents: * ${answers.pToc}\n ## Installation Details: ${answers.iDetails}\n ## User Details: ${answers.uDetails}\n ## License Details: ${answers.license}\n ## How to contribute to the project: ${answers.contribution}\n ## Project testing: ${answers.testing}\n ## Questions about the project: ${answers.questions}\n` }", "title": "" }, { "docid": "6019f24ec7a77b572fbb897ec02a5464", "score": "0.5498633", "text": "toMarkup() {\n let markup = \"<\" + this.type; // Add the attributes\n\n for (const attr in this.attributes) {\n if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {\n markup += \" \" + attr + \"=\\\"\";\n markup += utils.escape(this.attributes[attr]);\n markup += \"\\\"\";\n }\n }\n\n markup += \">\";\n\n for (let i = 0; i < this.children.length; i++) {\n markup += this.children[i].toMarkup();\n }\n\n markup += \"</\" + this.type + \">\";\n return markup;\n }", "title": "" }, { "docid": "5bd015c57930e2cdbd76247282988bac", "score": "0.5496596", "text": "_selctxopenObjToHTML(obj) {\n let input = (obj.input != null) ? \" input='\" + obj.input + \"'\" : \"\";\n // let states = (obj.options != null) ? \" states='\" + obj.options + \"'\" : \"\";\n // let colors = (obj.colors != null) ? \" colors='\" + obj.colors + \"'\" : \"\";\n\n return Translator.htmlTemplates.selctxopen.replace(\"[seq]\", obj.seq)\n .replace(\"[author]\", this.authorAttr)\n .replace(\"[context]\", obj.context)\n .replace(\"[input]\", input);\n /*\n .replace(\"[states]\", states)\n .replace(\"[colors]\", colors);\n */\n }", "title": "" }, { "docid": "1650cece1231464c3af9bed3ee0e3941", "score": "0.54964966", "text": "getHTML() {\n const endIndex = this.strings.length - 1;\n let html = '';\n\n for (let i = 0; i < endIndex; i++) {\n const s = this.strings[i]; // This exec() call does two things:\n // 1) Appends a suffix to the bound attribute name to opt out of special\n // attribute value parsing that IE11 and Edge do, like for style and\n // many SVG attributes. The Template class also appends the same suffix\n // when looking up attributes to create Parts.\n // 2) Adds an unquoted-attribute-safe marker for the first expression in\n // an attribute. Subsequent attribute expressions will use node markers,\n // and this is safe since attributes with multiple expressions are\n // guaranteed to be quoted.\n\n const match = _template.lastAttributeNameRegex.exec(s);\n\n if (match) {\n // We're starting a new bound attribute.\n // Add the safe attribute suffix, and use unquoted-attribute-safe\n // marker.\n html += s.substr(0, match.index) + match[1] + match[2] + _template.boundAttributeSuffix + match[3] + _template.marker;\n } else {\n // We're either in a bound node, or trailing bound attribute.\n // Either way, nodeMarker is safe to use.\n html += s + _template.nodeMarker;\n }\n }\n\n return html + this.strings[endIndex];\n }", "title": "" }, { "docid": "d71a4d115db64cf823952b546eb561d3", "score": "0.5493691", "text": "function text2html(text) {\n if (typeof marked === 'function')\n { return marked(text); }\n return \"<pre>\" + text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/ /g, ' &nbsp;') + \"</pre>\";\n }", "title": "" }, { "docid": "8838dfde791994ce8bd8f2ff2e745bcc", "score": "0.54904044", "text": "constructor(raw) {\n\t\t//\tsupport for el constructor\n\t\tif (typeof raw === \"object\") {\n\t\t\traw = atob(raw.getAttribute(\"data-blanker64\"))\n\t\t}\n\n\t\t//\tbasics\n\t\tthis.raw = raw;\n\t\tthis.ignore_whitespace = true;\t// add syntax option later\n\t\tthis.ignore_case = true;\t\t// add syntax option later\n\n\t\t//\tfilter subscript tag\n\t\twhile (true) {\n\t\t\tvar idx_begin = raw.indexOf(\"<sub>\");\n\t\t\tif (idx_begin == -1) break;\n\t\t\tvar idx_end = raw.indexOf(\"</sub>\", idx_begin);\n\t\t\tif (idx_end == -1) break;\n\t\t\tif (idx_end - idx_begin < 5) break;\n\n\t\t\tvar inside = raw.substring(idx_begin + 5, idx_end);\n\t\t\tinside = to_unicode_subscript(inside);\n\n\t\t\traw = raw.substring(0, idx_begin) + inside + raw.substring(idx_end + 6);\n\t\t}\n\n\t\t//\tfilter superscript tag\n\t\twhile (true) {\n\t\t\tvar idx_begin = raw.indexOf(\"<sup>\");\n\t\t\tif (idx_begin == -1) break;\n\t\t\tvar idx_end = raw.indexOf(\"</sup>\", idx_begin);\n\t\t\tif (idx_end == -1) break;\n\t\t\tif (idx_end - idx_begin < 5) break;\n\n\t\t\tvar inside = raw.substring(idx_begin + 5, idx_end);\n\t\t\tinside = to_unicode_superscript(inside);\n\n\t\t\traw = raw.substring(0, idx_begin) + inside + raw.substring(idx_end + 6);\n\t\t}\n\n\t\t//\tget rid of encoding\n\t\tvar encode_remover = build(\"div\", undefined, undefined, raw);\n\t\traw = encode_remover.innerText;\n\n\t\t//\tremove tags (for simpler life with editors)\n\t\twhile (true) {\n\t\t\tvar idx_begin = raw.indexOf(\"<\");\n\t\t\tif (idx_begin == -1) break;\n\t\t\tvar idx_end = raw.indexOf(\">\", idx_begin);\n\t\t\tif (idx_end == -1) break;\n\t\t\traw = raw.substring(0, idx_begin) + raw.substring(idx_end + 1);\n\t\t}\n\n\t\t//\tdeal with enclosing\n\t\tif (raw.substring(0, 1) === \"*\") raw = raw.substring(1);\n\t\tif (raw.substring(raw.length - 1, raw.length) === \"*\") raw = raw.substring(0, raw.length - 1);\n\n\t\t//\tseparate hint\n\t\tthis.hint = undefined;\n\t\tvar hint_idx = raw.indexOf(\":\");\n\t\tif (hint_idx != -1) {\n\t\t\tthis.hint = raw.substring(hint_idx + 1);\n\t\t\traw = raw.substring(0, hint_idx);\n\t\t}\n\n\t\t//\tseparate options and determine type\n\t\tthis.options = [];\n\t\tthis.type = \"fill_blank\";\n\t\tvar pieces = raw.split(\"/\");\n\t\tfor (var i = 0; i < pieces.length; i++) {\n\t\t\tif (pieces[i].indexOf(\"~\") === pieces[i].length - 1) {\n\t\t\t\tthis.options.push({\n\t\t\t\t\t\"text\" : pieces[i].substring(0, pieces[i].length - 1),\n\t\t\t\t\t\"correct\" : false\n\t\t\t\t});\n\t\t\t\tthis.type = \"multiple_choice\";\n\t\t\t} else {\n\t\t\t\tthis.options.push({\n\t\t\t\t\t\"text\" : pieces[i],\n\t\t\t\t\t\"correct\" : true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d6ae29ff1fe713d422402c6a3095d0a8", "score": "0.5488422", "text": "function getHTMLEscapedMessage(message) {\n\t var str = message;\n str =str.replace(/\\</g, \"&lt;\");\n str =str.replace(/\\>/g, \"&gt;\");\n return str;\n}", "title": "" }, { "docid": "58e5577006dcf01eb9a7dcaac467e38d", "score": "0.54862976", "text": "_generateMarkup() {\n return (\n this._data\n // the DOM elements are converted to string since the render parameter is set to \"false\", which returns markup text\n .map(bookmarks => previewView.render(bookmarks, false))\n .join('')\n );\n }", "title": "" }, { "docid": "5edd1e5e4adda7cbb7ebf171ac89c649", "score": "0.5483688", "text": "function escapeHtml(str) {\n\tif (typeof str !== 'undefined') {\n\t\tvar div = document.createElement('div');\n\t\tdiv.appendChild(document.createTextNode(str));\n\t\treturn div.innerHTML;\n\t}\n else {\n\t\treturn ''\n\t}\n}", "title": "" }, { "docid": "d2da65bd09bea3c23b41133c59e2264f", "score": "0.54678863", "text": "function encodeHTML(value) {\n return $('<div></div>').text(value).html();\n }", "title": "" }, { "docid": "8b624fc7be5a9bd5258df9a07a9924b7", "score": "0.54670453", "text": "function toString() {\n return static_1.html(this, this.options);\n}", "title": "" }, { "docid": "02afdb41a01153e33dd56cb981f3e8d3", "score": "0.5461714", "text": "function toHTML (myString)\r\n{\r\n htmlString = myString.split(\"&lt;\").join(\"<\");\r\n htmlString = htmlString.split(\"&gt;\").join(\">\");\r\n htmlString = htmlString.split(\"&quot;\").join(\"\\\"\");\r\n htmlString = htmlString.split(\"&apos;\").join(\"\\'\");\r\n return htmlString;\r\n} // end function toHTML(myString)", "title": "" } ]
c4f94b49b46d17c8ac380a0a30e8fe3b
Convert the given Analyzer properties to their TypeScript declaration equivalent.
[ { "docid": "8ee5ad1cf7d6fa668ea150cd47d83c81", "score": "0.6621858", "text": "handleProperties(analyzerProperties) {\n const tsProperties = [];\n for (const property of analyzerProperties) {\n if (property.inheritedFrom || property.privacy === 'private' ||\n this.excludeIdentifiers.has(property.name)) {\n continue;\n }\n const p = new ts.Property({\n name: property.name,\n // TODO If this is a Polymer property with no default value, then the\n // type should really be `<type>|undefined`.\n type: closure_types_1.closureTypeToTypeScript(property.type),\n readOnly: property.readOnly,\n });\n p.description = property.description || '';\n tsProperties.push(p);\n }\n return tsProperties;\n }", "title": "" } ]
[ { "docid": "9e37cebec63ef6e48e880d296e1d0874", "score": "0.49037197", "text": "function analyzeProperties(node, document) {\n const analyzedProps = [];\n if (node.type !== 'ObjectExpression') {\n return analyzedProps;\n }\n for (const property of node.properties) {\n const prop = js_utils_1.toScannedPolymerProperty(property, document.sourceRangeForNode(property), document);\n // toScannedPolymerProperty does the wrong thing for us with type. We want\n // type to be undefined unless there's a positive signal for the type.\n // toScannedPolymerProperty will give Object because it infers based on the\n // property declaration.\n prop.type = undefined;\n const typeTag = jsdoc.getTag(prop.jsdoc, 'type');\n if (typeTag) {\n prop.type =\n typeTag.type ? doctrine.type.stringify(typeTag.type) : undefined;\n }\n prop.published = true;\n let isComputed = false;\n if (property.value.type === 'Identifier') {\n // If we've already got a type it's from jsdoc and thus canonical.\n if (!prop.type) {\n prop.type = property.value.name;\n }\n }\n else if (property.value.type !== 'ObjectExpression') {\n continue;\n }\n else {\n /**\n * Parse the expression inside a property object block. e.g.\n * property: {\n * key: {\n * type: String,\n * notify: true,\n * value: -1,\n * readOnly: true,\n * reflectToAttribute: true\n * }\n * }\n */\n for (const propertyArg of property.value.properties) {\n const propertyKey = esutil.objectKeyToString(propertyArg.key);\n switch (propertyKey) {\n case 'type':\n // If we've already got a type, then it was found in the jsdocs,\n // and is canonical.\n if (!prop.type) {\n prop.type = esutil.objectKeyToString(propertyArg.value);\n if (prop.type === undefined) {\n prop.warnings.push(new model_1.Warning({\n code: 'invalid-property-type',\n message: 'Invalid type in property object.',\n severity: model_1.Severity.WARNING,\n sourceRange: document.sourceRangeForNode(propertyArg),\n parsedDocument: document\n }));\n }\n }\n break;\n case 'notify':\n prop.notify = !!astValue.expressionToValue(propertyArg.value);\n break;\n case 'observer':\n const val = astValue.expressionToValue(propertyArg.value);\n prop.observerNode = propertyArg.value;\n const parseResult = expression_scanner_1.parseExpressionInJsStringLiteral(document, propertyArg.value, 'identifierOnly');\n prop.warnings.push(...parseResult.warnings);\n prop.observerExpression = parseResult.databinding;\n if (val === undefined) {\n prop.observer = astValue.CANT_CONVERT;\n }\n else {\n prop.observer = JSON.stringify(val);\n }\n break;\n case 'readOnly':\n prop.readOnly = !!astValue.expressionToValue(propertyArg.value);\n break;\n case 'reflectToAttribute':\n prop.reflectToAttribute =\n !!astValue.expressionToValue(propertyArg.value);\n break;\n case 'computed':\n isComputed = true;\n const computedParseResult = expression_scanner_1.parseExpressionInJsStringLiteral(document, propertyArg.value, 'callExpression');\n prop.warnings.push(...computedParseResult.warnings);\n prop.computedExpression = computedParseResult.databinding;\n break;\n case 'value':\n prop.default =\n JSON.stringify(astValue.expressionToValue(propertyArg.value));\n break;\n default:\n break;\n }\n }\n }\n if (isComputed) {\n prop.readOnly = true;\n }\n prop.type = esutil.CLOSURE_CONSTRUCTOR_MAP.get(prop.type) || prop.type;\n if (!prop.type) {\n prop.warnings.push(new model_1.Warning({\n code: 'no-type-for-property',\n message: 'Unable to determine type for property.',\n severity: model_1.Severity.WARNING,\n sourceRange: document.sourceRangeForNode(property),\n parsedDocument: document\n }));\n }\n analyzedProps.push(prop);\n }\n return analyzedProps;\n}", "title": "" }, { "docid": "83ec47f53678f89cde04de34c7ec083a", "score": "0.48710713", "text": "function cDecl(longhands, values) {\n return values.map((value, index) => ({\n type: \"Declaration\",\n loc: null,\n important: null, // TODO add important\n property: longhands[index],\n value,\n }));\n}", "title": "" }, { "docid": "cc11638edfce5f4a4ecad34d7d411832", "score": "0.45442772", "text": "function staticPropertiesPlugin() {\n return {\n analyzePhase({ts, node, moduleDoc}){\n switch (node.kind) {\n case ts.SyntaxKind.ClassDeclaration: \n const className = node?.name?.getText();\n const currClass = moduleDoc?.declarations?.find(declaration => declaration.name === className);\n \n node?.members?.forEach(member => {\n if (hasStaticKeyword(member) && member.name.text === 'properties') {\n const propertiesObject = getPropertiesObject(member);\n\n propertiesObject?.properties?.forEach(property => {\n\n const classMember = {\n kind: 'field',\n name: property?.name?.getText() || '',\n privacy: 'public',\n };\n\n if (isAlsoAttribute(property)) {\n const attribute = createAttributeFromField(classMember);\n\n /**\n * If an attribute name is provided\n * @example @property({attribute:'my-foo'})\n */\n const attributeName = getAttributeName(property);\n if(attributeName) {\n attribute.name = attributeName;\n }\n currClass.attributes.push(attribute);\n }\n\n currClass.members.push(classMember);\n });\n return;\n }\n });\n\n /** Get default values */\n currClass?.members?.forEach(member => {\n getDefaultValuesFromConstructorVisitor(node, member);\n });\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "91b583b9bf7bcd65aae8c0e9e7eedfc1", "score": "0.4539431", "text": "function analyzerToAst(analysis, config, rootDir) {\n return __awaiter(this, void 0, void 0, function* () {\n const excludeFiles = (config.excludeFiles || config.exclude || defaultExclude)\n .map((p) => new minimatch.Minimatch(p));\n const addReferences = config.addReferences || {};\n const removeReferencesResolved = new Set((config.removeReferences || []).map((r) => path.resolve(rootDir, r)));\n const renameTypes = new Map(Object.entries(config.renameTypes || {}));\n // Map from identifier to the module path that exports it.\n const autoImportMap = new Map();\n if (config.autoImport !== undefined) {\n for (const importPath in config.autoImport) {\n for (const identifier of config.autoImport[importPath]) {\n autoImportMap.set(identifier, importPath);\n }\n }\n }\n const analyzerDocs = [\n ...analysis.getFeatures({ kind: 'html-document' }),\n ...analysis.getFeatures({ kind: 'js-document' }),\n ];\n // We want to produce one declarations file for each file basename. There\n // might be both `foo.html` and `foo.js`, and we want their declarations to be\n // combined into a signal `foo.d.ts`. So we first group Analyzer documents by\n // their declarations filename.\n const declarationDocs = new Map();\n for (const jsDoc of analyzerDocs) {\n // For every HTML or JS file, Analyzer is going to give us 1) the top-level\n // document, and 2) N inline documents for any nested content (e.g. script\n // tags in HTML). The top-level document will give us all the nested\n // features we need, so skip any inline ones.\n if (jsDoc.isInline) {\n continue;\n }\n const sourcePath = analyzerUrlToRelativePath(jsDoc.url, rootDir);\n if (sourcePath === undefined) {\n console.warn(`Skipping source document without local file URL: ${jsDoc.url}`);\n continue;\n }\n if (excludeFiles.some((r) => r.match(sourcePath))) {\n continue;\n }\n const filename = makeDeclarationsFilename(sourcePath);\n let docs = declarationDocs.get(filename);\n if (!docs) {\n docs = [];\n declarationDocs.set(filename, docs);\n }\n docs.push(jsDoc);\n }\n const tsDocs = [];\n const warnings = [...analysis.getWarnings()];\n for (const [declarationsFilename, analyzerDocs] of declarationDocs) {\n const tsDoc = new ts.Document({\n path: declarationsFilename,\n header: makeHeader(analyzerDocs.map((d) => analyzerUrlToRelativePath(d.url, rootDir))\n .filter((url) => url !== undefined)),\n tsLintDisables: [{\n ruleName: 'variable-name',\n why: `Describing an API that's defined elsewhere.`,\n }],\n });\n for (const analyzerDoc of analyzerDocs) {\n if (es_modules_1.isEsModuleDocument(analyzerDoc)) {\n tsDoc.isEsModule = true;\n }\n }\n for (const analyzerDoc of analyzerDocs) {\n const generator = new TypeGenerator(tsDoc, analysis, analyzerDoc, rootDir, config.excludeIdentifiers || []);\n generator.handleDocument();\n warnings.push(...generator.warnings);\n }\n for (const ref of tsDoc.referencePaths) {\n const resolvedRef = path.resolve(rootDir, path.dirname(tsDoc.path), ref);\n if (removeReferencesResolved.has(resolvedRef)) {\n tsDoc.referencePaths.delete(ref);\n }\n }\n for (const ref of addReferences[tsDoc.path] || []) {\n tsDoc.referencePaths.add(path.relative(path.dirname(tsDoc.path), ref));\n }\n for (const node of tsDoc.traverse()) {\n if (node.kind === 'name') {\n const renamed = renameTypes.get(node.name);\n if (renamed !== undefined) {\n node.name = renamed;\n }\n }\n }\n addAutoImports(tsDoc, autoImportMap);\n tsDoc.simplify();\n // Include even documents with no members. They might be dependencies of\n // other files via the HTML import graph, and it's simpler to have empty\n // files than to try and prune the references (especially across packages).\n tsDocs.push(tsDoc);\n }\n const filteredWarnings = warnings.filter((warning) => {\n if (config.hideWarnings && warning.severity !== analyzer.Severity.ERROR) {\n return false;\n }\n const sourcePath = analyzerUrlToRelativePath(warning.sourceRange.file, rootDir);\n return sourcePath !== undefined &&\n !excludeFiles.some((pattern) => pattern.match(sourcePath));\n });\n const warningPrinter = new analyzer.WarningPrinter(process.stderr, { maxCodeLines: 1 });\n yield warningPrinter.printWarnings(filteredWarnings);\n if (filteredWarnings.some((warning) => warning.severity === analyzer.Severity.ERROR)) {\n throw new Error('Encountered error generating types.');\n }\n if (config.googModules) {\n return tsDocs.map((d) => transformToGoogStyle(d, rootDir));\n }\n return tsDocs;\n });\n}", "title": "" }, { "docid": "6d10a85543c11717b58c32184f869d6a", "score": "0.448249", "text": "function transform(rules) {\n var result = {}\n rules.forEach(function (rule) {\n var obj = {};\n if (rule.type === 'rule') {\n rule.declarations.forEach(function (declaration) {\n if (declaration.type === 'declaration') {\n declaration.property = toCamelCase(declaration.property)\n var is_nan = isNaN(Number(declaration.value))\n obj[declaration.property] = is_nan? declaration.value : Number(declaration.value);\n }\n });\n rule.selectors.forEach(function (selector) {\n var name = nameGenerator(selector.trim());\n result[name] = obj;\n });\n }\n });\n return result\n}", "title": "" }, { "docid": "8fdd87f4db2ca6e0ca1a2d846948dac9", "score": "0.4370572", "text": "function createBasicTypes(prefix, types) {\n const res = {};\n Object.keys(types).forEach(property => {\n if (typeof types[property] !== 'number')\n return;\n res[property] = prefix + property;\n });\n return res;\n}", "title": "" }, { "docid": "026ed5ff61ebe77cc318de68677f0684", "score": "0.43635893", "text": "function mergeDeclarations(dest, src, config) {\n dest.name = src.name;\n if (!config.options['output.reverseAttributes']) {\n dest.value = src.value;\n }\n // Keep high-priority properties\n if (!dest.implied) {\n dest.implied = src.implied;\n }\n if (!dest.boolean) {\n dest.boolean = src.boolean;\n }\n if (dest.valueType !== 'expression') {\n dest.valueType = src.valueType;\n }\n return dest;\n }", "title": "" }, { "docid": "ff24ca0a8a2567597df0f783b15e087a", "score": "0.42553845", "text": "function declarationsHandler(astArray, node) {\n switch (node.type) {\n case \"FunctionDeclaration\":\n addAsValue(\n astArray[node.functionScope],\n \"declaredIdentifiers\",\n node.id.name\n );\n break;\n case \"FunctionExpression\":\n if (node.id) {\n addAsValue(\n astArray[node.functionScope],\n \"declaredIdentifiers\",\n node.id.name\n );\n }\n break;\n case \"ClassDeclaration\":\n addAsValue(\n astArray[node.functionScope],\n \"declaredIdentifiers\",\n node.id.name\n );\n break;\n case \"ImportDeclaration\":\n node.specifiers.forEach(specifier => {\n addAsValue(\n astArray[node.functionScope],\n \"declaredIdentifiers\",\n specifier.local.name\n );\n });\n case \"VariableDeclaration\":\n handleVariableDeclaration(astArray, node);\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "014ba57283419f3862952a0b4527dd1b", "score": "0.42509574", "text": "function transformParameterWithPropertyAssignment(node) {\n ts.Debug.assert(ts.isIdentifier(node.name));\n var name = node.name;\n var propertyName = ts.getMutableClone(name);\n ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */);\n var localName = ts.getMutableClone(name);\n ts.setEmitFlags(localName, 1536 /* NoComments */);\n return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1)));\n }", "title": "" }, { "docid": "2bbcf501b763b89489f92a3ddf12cd94", "score": "0.42460036", "text": "function transformParameterWithPropertyAssignment(node) {\n ts.Debug.assert(ts.isIdentifier(node.name));\n var name = node.name;\n var propertyName = ts.getMutableClone(name);\n ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */);\n var localName = ts.getMutableClone(name);\n ts.setEmitFlags(localName, 1536 /* NoComments */);\n return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1)));\n }", "title": "" }, { "docid": "2bbcf501b763b89489f92a3ddf12cd94", "score": "0.42460036", "text": "function transformParameterWithPropertyAssignment(node) {\n ts.Debug.assert(ts.isIdentifier(node.name));\n var name = node.name;\n var propertyName = ts.getMutableClone(name);\n ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */);\n var localName = ts.getMutableClone(name);\n ts.setEmitFlags(localName, 1536 /* NoComments */);\n return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1)));\n }", "title": "" }, { "docid": "1b3b5a921b4256b38828e2c76414968f", "score": "0.42409486", "text": "function generatePropertyAliases(tNode, direction) {\n var tView = getLView()[TVIEW];\n var propStore = null;\n var start = tNode.directiveStart;\n var end = tNode.directiveEnd;\n if (end > start) {\n var isInput = direction === 0 /* Input */;\n var defs = tView.data;\n for (var i = start; i < end; i++) {\n var directiveDef = defs[i];\n var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;\n for (var publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n var internalName = propertyAliasMap[publicName];\n var hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, publicName, internalName) :\n (propStore[publicName] = [i, publicName, internalName]);\n }\n }\n }\n }\n return propStore;\n}", "title": "" }, { "docid": "2944f03ebf7bcc867c2506b73881e37f", "score": "0.42381632", "text": "function tsTypeFields(babel, opts) {\n return {\n visitor: {\n ClassProperty(path) {\n const { node } = path;\n const classNode = path.parentPath.parent;\n\n if (node.value) return;\n\n if (\n opts.all ||\n (opts.derived && classNode.superClass) ||\n (opts.readonly && node.readonly)\n ) {\n node.declare = true;\n }\n }\n }\n };\n}", "title": "" }, { "docid": "7582237c771abd3167b653cedf3e795f", "score": "0.423761", "text": "function varify(ast, stats, allIdentifiers, changes) {\n\t function unique(name) {\n\t assert(allIdentifiers.has(name));\n\t for (var cnt = 0; ; cnt++) {\n\t var genName = name + \"$\" + String(cnt);\n\t if (!allIdentifiers.has(genName)) {\n\t return genName;\n\t }\n\t }\n\t }\n\n\t function renameDeclarations(node) {\n\t if (node.type === \"VariableDeclaration\" && isConstLet(node.kind)) {\n\t var hoistScope = node.$scope.closestHoistScope();\n\t var origScope = node.$scope;\n\n\t // text change const|let => var\n\t changes.push({\n\t start: node.range[0],\n\t end: node.range[0] + node.kind.length,\n\t str: \"var\",\n\t });\n\n\t node.declarations.forEach(function(declarator) {\n\t assert(declarator.type === \"VariableDeclarator\");\n\t var name = declarator.id.name;\n\n\t stats.declarator(node.kind);\n\n\t // rename if\n\t // 1) name already exists in hoistScope, or\n\t // 2) name is already propagated (passed) through hoistScope or manually tainted\n\t var rename = (origScope !== hoistScope &&\n\t (hoistScope.hasOwn(name) || hoistScope.doesPropagate(name)));\n\n\t var newName = (rename ? unique(name) : name);\n\n\t origScope.remove(name);\n\t hoistScope.add(newName, \"var\", declarator.id, declarator.range[1]);\n\n\t origScope.moves = origScope.moves || stringmap();\n\t origScope.moves.set(name, {\n\t name: newName,\n\t scope: hoistScope,\n\t });\n\n\t allIdentifiers.add(newName);\n\n\t if (newName !== name) {\n\t stats.rename(name, newName, getline(declarator));\n\n\t declarator.id.originalName = name;\n\t declarator.id.name = newName;\n\n\t // textchange var x => var x$1\n\t changes.push({\n\t start: declarator.id.range[0],\n\t end: declarator.id.range[1],\n\t str: newName,\n\t });\n\t }\n\t });\n\n\t // ast change const|let => var\n\t node.kind = \"var\";\n\t }\n\t }\n\n\t function renameReferences(node) {\n\t if (!node.$refToScope) {\n\t return;\n\t }\n\t var move = node.$refToScope.moves && node.$refToScope.moves.get(node.name);\n\t if (!move) {\n\t return;\n\t }\n\t node.$refToScope = move.scope;\n\n\t if (node.name !== move.name) {\n\t node.originalName = node.name;\n\t node.name = move.name;\n\n\t if (node.alterop) {\n\t // node has no range because it is the result of another alter operation\n\t var existingOp = null;\n\t for (var i = 0; i < changes.length; i++) {\n\t var op = changes[i];\n\t if (op.node === node) {\n\t existingOp = op;\n\t break;\n\t }\n\t }\n\t assert(existingOp);\n\n\t // modify op\n\t existingOp.str = move.name;\n\t } else {\n\t changes.push({\n\t start: node.range[0],\n\t end: node.range[1],\n\t str: move.name,\n\t });\n\t }\n\t }\n\t }\n\n\t traverse(ast, {pre: renameDeclarations});\n\t traverse(ast, {pre: renameReferences});\n\t ast.$scope.traverse({pre: function(scope) {\n\t delete scope.moves;\n\t }});\n\t}", "title": "" }, { "docid": "8f1638a35e49c235e154ffe71c6733d8", "score": "0.42020962", "text": "function _compile(inputTypes) {\n const types = [];\n const violations = [];\n\n for (let { type, properties } of inputTypes) {\n const dupes = _findDupes(properties.map(p => p.name));\n if (dupes.length > 0) {\n violations.push({\n type,\n message: `Duplicate properties: ${dupes.join(', ')}`\n });\n }\n\n const typeDescriptor = {\n name: type,\n properties: {},\n validate(originalValue = {}) {\n const errors = [];\n const finishedValue = {};\n\n for (let prop of Object.values(typeDescriptor.properties)) {\n finishedValue[prop.name] = originalValue[prop.name];\n\n // if no value, then set to default and don't validate\n if (finishedValue[prop.name] === undefined && prop.defaultValue !== undefined) {\n finishedValue[prop.name] = prop.defaultValue;\n continue;\n }\n // yea, this is pretty clear\n if (finishedValue[prop.name] === undefined && prop.isRequired) {\n errors.push({\n type,\n property: prop.name,\n message: `\"${prop.name}\" is required`\n });\n continue;\n }\n\n const { error, value } = prop.validator.validate(finishedValue[prop.name]);\n if (error) {\n // done with this property since the root prop validator is a type validator\n errors.push({\n type,\n property: prop.name,\n message: error.message\n });\n }\n finishedValue[prop.name] = value;\n\n for (let rule of prop.rules) {\n const { error, value } = rule.validator.validate(finishedValue[prop.name]);\n if (error) {\n errors.push({\n type,\n property: prop.name,\n message: error.message\n });\n } else {\n finishedValue[prop.name] = value;\n }\n }\n }\n\n return {\n errors,\n value: finishedValue\n };\n }\n };\n\n for (let prop of properties) {\n const dataType = DATA_TYPES[prop.dataType];\n\n if (!dataType) {\n violations.push({\n type,\n property: prop.name,\n message: `Unknown data type: ${prop.dataType}`\n });\n } else {\n const propDescriptor = {\n name: prop.name,\n type: prop.dataType,\n isRequired: false,\n defaultValue: undefined,\n rules: [],\n validator: dataType.validator()\n };\n\n Object.defineProperty(propDescriptor, 'validator', {\n enumerable: false\n });\n\n for (let rule of prop.rules) {\n if (rule.property === 'default') {\n propDescriptor.defaultValue = rule.value;\n } else if (rule.property === 'required') {\n propDescriptor.isRequired = rule.value;\n } else {\n if (dataType.getRuleValidator) {\n Object.defineProperty(rule, 'validator', {\n enumerable: false,\n value: dataType.getRuleValidator(rule)\n });\n } else {\n console.log('Data type not implemented:', prop.dataType);\n }\n\n propDescriptor.rules.push(rule);\n }\n }\n\n typeDescriptor.properties[prop.name] = propDescriptor;\n }\n }\n\n types.push(typeDescriptor);\n }\n\n // check for anonymous types when more than 1 type specified\n if (types.length > 1 && types.find(t => t.name === '')) {\n violations.push({\n message: 'Anonymous types are not allowed when there are more than 1 type specified'\n });\n }\n\n return {\n types,\n violations\n };\n}", "title": "" }, { "docid": "94ee74df30b91c51e20f0db98fe16de7", "score": "0.41958338", "text": "function generatePropertyAliases(tNode, direction) {\n var tView = getLView()[TVIEW];\n var propStore = null;\n var start = tNode.directiveStart;\n var end = tNode.directiveEnd;\n if (end > start) {\n var isInput = direction === 0 /* Input */;\n var defs = tView.data;\n for (var i = start; i < end; i++) {\n var directiveDef = defs[i];\n var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;\n for (var publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n var internalName = propertyAliasMap[publicName];\n var hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, internalName) :\n (propStore[publicName] = [i, internalName]);\n }\n }\n }\n }\n return propStore;\n}", "title": "" }, { "docid": "94ee74df30b91c51e20f0db98fe16de7", "score": "0.41958338", "text": "function generatePropertyAliases(tNode, direction) {\n var tView = getLView()[TVIEW];\n var propStore = null;\n var start = tNode.directiveStart;\n var end = tNode.directiveEnd;\n if (end > start) {\n var isInput = direction === 0 /* Input */;\n var defs = tView.data;\n for (var i = start; i < end; i++) {\n var directiveDef = defs[i];\n var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;\n for (var publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n var internalName = propertyAliasMap[publicName];\n var hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, internalName) :\n (propStore[publicName] = [i, internalName]);\n }\n }\n }\n }\n return propStore;\n}", "title": "" }, { "docid": "a5c6d42500a4bd9c4c6bc0150fc79002", "score": "0.41948962", "text": "function JSCompiler_renameProperty(a) {\n return a;\n }", "title": "" }, { "docid": "63ef4deba04e5bd4dacb42b50920953d", "score": "0.41817388", "text": "function generateInitializedPropertyExpressions(properties, receiver) {\n var expressions = [];\n for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) {\n var property = properties_11[_i];\n var expression = transformInitializedProperty(property, receiver);\n ts.startOnNewLine(expression);\n ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));\n ts.setCommentRange(expression, property);\n expressions.push(expression);\n }\n return expressions;\n }", "title": "" }, { "docid": "b7251322db60ca4b9ca841daca890858", "score": "0.41611972", "text": "function generateInitializedPropertyExpressions(properties, receiver) {\n var expressions = [];\n for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) {\n var property = properties_11[_i];\n var expression = transformInitializedProperty(property, receiver);\n ts.startOnNewLine(expression);\n ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));\n ts.setCommentRange(expression, property);\n expressions.push(expression);\n }\n return expressions;\n }", "title": "" }, { "docid": "4df0f745b42fb37292db37c3721e30da", "score": "0.41554818", "text": "function makeLowercaseSetterAliases(object) {\n console.log('making lowercase aliases.')\n const props = Object.getOwnPropertyNames(object)\n for (let prop of props) {\n const lowercaseProp = prop.toLowerCase()\n if (lowercaseProp != prop) {\n const descriptor = Object.getOwnPropertyDescriptor(object, prop)\n if (Object.getOwnPropertyNames(descriptor).includes('set')) { // we care only about the setters.\n Object.defineProperty(object, lowercaseProp, descriptor)\n }\n }\n }\n}", "title": "" }, { "docid": "239d899f3073b7d90728a3351be1bd50", "score": "0.4149414", "text": "convert() {\n var editor = atom.workspace.getActiveTextEditor()\n var txt = editor.getSelectedText()\n var indexOfFirstBracket = txt.trim().indexOf(\"{\")\n var firstline = txt.trim().slice(0, indexOfFirstBracket+1)\n var type = Lib.getObjectType(firstline)\n\n switch (type) {\n case \"declaration\":\n LiteralConverter.convertToLiteral(txt, editor, type, this.getSetting(\"objectKeyword\"))\n break;\n case \"expression\":\n LiteralConverter.convertToLiteral(txt, editor, type, this.getSetting(\"objectKeyword\"))\n break;\n case \"literal\":\n ConstConverter.convertToDeclaration(txt, editor, this.getSetting(\"replaceCommaWithSemicolon\"))\n break;\n default:\n this.diplayWarning()\n break;\n }\n }", "title": "" }, { "docid": "a6ca78dd46c43e765a014871850af688", "score": "0.4138222", "text": "function DeclarationOptions(initializer){ // default constructor\n //properties\n\n //normalizeModeKeepFirstCase: boolean\n\n //pointsTo : Declaration\n\n //type: Grammar.TypeDeclaration\n\n //returnType\n\n //nodeClass: ASTBase\n\n //isForward, isDummy\n //informError: boolean\n //value\n for(prop in initializer) if (initializer.hasOwnProperty(prop)) this[prop]=initializer[prop];}", "title": "" }, { "docid": "ddec039dfbe00e07b157d5d06d5d3723", "score": "0.40829754", "text": "function properties(target,source) {\n\t\tfor(var i in source) if (typeof source[i]!='function') target[i] = source[i];\n\t}", "title": "" }, { "docid": "0def79af6accd90bc82a7d63da7a3fbd", "score": "0.4080653", "text": "function transformAllDecoratorsOfDeclaration(node, container, allDecorators) {\n if (!allDecorators) {\n return undefined;\n }\n var decoratorExpressions = [];\n ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator));\n ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter));\n addTypeMetadata(node, container, decoratorExpressions);\n return decoratorExpressions;\n }", "title": "" }, { "docid": "a1001c33d113e93128c1cf9998848976", "score": "0.40705293", "text": "function generateInitializedPropertyExpressions(properties, receiver) {\n var expressions = [];\n for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) {\n var property = properties_9[_i];\n var expression = transformInitializedProperty(property, receiver);\n expression.startsOnNewLine = true;\n ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));\n ts.setCommentRange(expression, property);\n expressions.push(expression);\n }\n return expressions;\n }", "title": "" }, { "docid": "ce9a1ff8f51c6bdae83bafc7a6414d54", "score": "0.40639496", "text": "function transformAllDecoratorsOfDeclaration(node, container, allDecorators) {\n if (!allDecorators) {\n return undefined;\n }\n var decoratorExpressions = [];\n ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator));\n ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter));\n addTypeMetadata(node, container, decoratorExpressions);\n return decoratorExpressions;\n }", "title": "" }, { "docid": "ce9a1ff8f51c6bdae83bafc7a6414d54", "score": "0.40639496", "text": "function transformAllDecoratorsOfDeclaration(node, container, allDecorators) {\n if (!allDecorators) {\n return undefined;\n }\n var decoratorExpressions = [];\n ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator));\n ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter));\n addTypeMetadata(node, container, decoratorExpressions);\n return decoratorExpressions;\n }", "title": "" }, { "docid": "c85b8235118b564c6c5a4744c9cf36c2", "score": "0.406243", "text": "function CompileDeclarations () {\n function extend (obj, extObj) {\n for (var key in extObj) {\n if (ReservedDeclarationProperies[key] === 2) continue\n\n if (typeof obj[key] === 'undefined') {\n obj[key] = extObj[key]\n } else if (typeof extObj[key] === 'function' && !obj[key]._inheritedDeclFunction) {\n (function (fn, inheritedFn, inheritedDecl) {\n fn._inheritedDeclFunction = function () {\n // Imitate inherited decl context for inner inherited() calls\n var temp = this._decl\n this._decl = inheritedDecl\n inheritedFn.apply(this, arguments)\n this._decl = temp\n }\n })(obj[key], extObj[key], extObj)\n } else if (typeof extObj[key] === 'object' && !Array.isArray(extObj[key])) {\n extend(obj[key], extObj[key])\n }\n }\n }\n\n function compileCommonHandler (commonHandlerName, handlers, decl) {\n if (handlers.length === 0) return\n\n decl[commonHandlerName] = function () {\n for (var i = 0, ii = handlers.length; i < ii; i++) {\n handlers[i].call(this)\n }\n }\n }\n\n function inherit (decl, inheritedDecls, flattenInherits) {\n for (var i = inheritedDecls.length-1; i >= 0; i--) {\n var selector = inheritedDecls[i]\n var inheritedDecl = Declaration[selector]\n\n if (typeof flattenInherits === 'undefined') {\n flattenInherits = []\n }\n flattenInherits.push(selector)\n\n if (inheritedDecl) {\n extend(decl, inheritedDecl)\n\n if (inheritedDecl.inherits) {\n inherit(decl, inheritedDecl.inherits, flattenInherits)\n }\n }\n }\n\n return flattenInherits\n }\n\n for (var selector in Declaration) (function (decl) {\n\n // Extend decl with inherited rules\n if (decl.inherits) {\n var flattenInherits = inherit(decl, decl.inherits)\n decl.flattenInherits = flattenInherits\n }\n\n // Compile expand rules to methods array\n var expandHandlers = []\n if (decl.expand) {\n expandHandlers.unshift(decl.expand)\n }\n if (decl.param) {\n expandHandlers.unshift(function () {\n this.defineParam(decl.param)\n })\n }\n if (decl.mix) {\n expandHandlers.unshift(function () {\n this.mix.apply(this, decl.mix)\n })\n }\n if (flattenInherits) {\n expandHandlers.unshift(function () {\n this.mix.apply(this, flattenInherits)\n })\n }\n if (decl.mod) {\n expandHandlers.unshift(function () {\n this.defineMod(decl.mod)\n })\n }\n if (decl.tag) {\n expandHandlers.unshift(function () {\n this.tag(decl.tag)\n })\n }\n if (decl.noElems) {\n expandHandlers.unshift(function () {\n this.noElems(decl.noElems)\n })\n }\n if (decl.domAttr) {\n expandHandlers.unshift(function () {\n this.domAttr(decl.domAttr)\n })\n }\n if (decl.onMod) {\n expandHandlers.unshift(function () {\n for (var modName in decl.onMod) {\n for (var modValue in decl.onMod[modName]) {\n this.onMod(modName, modValue, decl.onMod[modName][modValue])\n }\n }\n })\n }\n\n // Compile domInit rules to methods array\n var domInitHandlers = []\n if (decl.domInit) {\n domInitHandlers.unshift(decl.domInit)\n }\n if (decl.on) {\n domInitHandlers.unshift(function () {\n for (var events in decl.on) {\n this.on(events, decl.on[events])\n }\n })\n }\n if (decl.onWin) {\n domInitHandlers.unshift(function () {\n for (var events in decl.onWin) {\n this.onWin(events, decl.onWin[events])\n }\n })\n }\n\n // Compile destructor\n if (typeof decl.onRemove === 'undefined') {\n decl.onRemove = function () {}\n }\n\n // Compile common handlers\n compileCommonHandler('commonExpand', expandHandlers, decl)\n compileCommonHandler('commonDomInit', domInitHandlers, decl)\n\n // Extract user methods\n decl.userMethods = {}\n for (var key in decl) {\n if (ReservedDeclarationProperies[key] !== 1) {\n decl.userMethods[key] = decl[key]\n }\n }\n\n })(Declaration[selector])\n}", "title": "" }, { "docid": "76a92c4746348d9522b16dba4e6b1f60", "score": "0.40557286", "text": "function addInitializedPropertyStatements(statements, properties, receiver) {\n for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) {\n var property = properties_10[_i];\n var statement = ts.createStatement(transformInitializedProperty(property, receiver));\n ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));\n ts.setCommentRange(statement, property);\n statements.push(statement);\n }\n }", "title": "" }, { "docid": "8e37e483716cbf866610f8d8d8c03d5a", "score": "0.40405145", "text": "function addInitializedPropertyStatements(statements, properties, receiver) {\n for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) {\n var property = properties_10[_i];\n var statement = ts.createStatement(transformInitializedProperty(property, receiver));\n ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));\n ts.setCommentRange(statement, property);\n statements.push(statement);\n }\n }", "title": "" }, { "docid": "fa2f30b577c992ea91bd0c4a9cc3f4a7", "score": "0.40328616", "text": "function generatePropertyAliases(tNode, direction) {\n var tView = Object(render3_state.m)()[interfaces_view.s], propStore = null, start = tNode.directiveStart, end = tNode.directiveEnd;\n if (end > start) for (var isInput = 0 /* Input */ === direction, defs = tView.data, i = start; i < end; i++) {\n var directiveDef = defs[i], propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;\n for (var publicName in propertyAliasMap) if (propertyAliasMap.hasOwnProperty(publicName)) {\n var internalName = propertyAliasMap[publicName];\n (propStore = propStore || {}).hasOwnProperty(publicName) ? propStore[publicName].push(i, publicName, internalName) : propStore[publicName] = [ i, publicName, internalName ];\n }\n }\n return propStore;\n }", "title": "" }, { "docid": "06233080e80eb4e496f0533c7625526b", "score": "0.40208778", "text": "function transformJsonFieldNames(ticket) {\n for (var property in ticket) {\n var new_property = property.split(' ').join('_').toLowerCase();\n ticket[new_property] = ticket[property];\n delete ticket[property]\n }\n return ticket;\n}", "title": "" }, { "docid": "6805b16106f33583ce29cadaf87a03e2", "score": "0.40192774", "text": "function cfnWebACLWafActionPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_WafActionPropertyValidator(properties).assertSuccess();\n return {\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "df333cd95b7e4fdf888a8bd8dacde19e", "score": "0.4009259", "text": "get_property_lists(properties){\n\t\t//console.log(\"checking properties on:\");\n\t\t//console.log(properties);\n\t\tvar property1_list = []; // list of user friendly titles\n\t\tvar property1_system_list = []; // list internal property id's\n\t\t\n\t\tfor (let prop in properties){\n\t\t\t//console.log(properties[prop]);\n\t\t\tvar title = 'unknown';\n\t\t\tif( properties[prop].hasOwnProperty('title') ){\n\t\t\t\ttitle = properties[prop]['title'];\n\t\t\t}\n\t\t\telse if( properties[prop].hasOwnProperty('label') ){\n\t\t\t\ttitle = properties[prop]['label'];\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tvar system_title = properties[prop]['links'][0]['href'].substr(properties[prop]['links'][0]['href'].lastIndexOf('/') + 1);\n\n\t\t\t// If a property is a number, add it to the list of possible source properties\n\t\t\tif( properties[prop]['type'] == 'integer' || properties[prop]['type'] == 'float' || properties[prop]['type'] == 'number' || properties[prop]['type'] == 'boolean'){\n\t\t\t\t\n\t\t\t\tproperty1_list.push(title);\n\t\t\t\tproperty1_system_list.push(system_title);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn { 'property1_list' : property1_list, 'property1_system_list' : property1_system_list };\n\t}", "title": "" }, { "docid": "2ffe4f55c60d63c7e2b9eaa648e78aab", "score": "0.400098", "text": "function hoistDeclarations(ast) {\n var sequences = {\n TemplateLiteral:function(x) { return x.expressions },\n NewExpression:function(x) { return x.arguments },\n CallExpression:function(x) { return x.arguments },\n SequenceExpression:function(x) { return x.expressions },\n ArrayExpression:function(x) { return x.elements },\n ObjectExpression:function(oe){ return oe.properties.map(function(p){ return p.value })}\n };\n /* Identify SequenceExpressions, Parameter lists and VariableDeclarators that contain assigments and split them up\n to ensure the correct evaluation order */\n\n function containsAssign(ast){\n return contains(ast, function(n){\n return n.type==='AssignmentExpression'\n });\n }\n\n parser.treeWalker(ast, function (node, descend, path) {\n var i ;\n descend() ;\n // Ensure assigments are evaluated before any await expressions, eg:\n // f(a=1, b = await a) --> a=1; f(a,b=await a)\n \n function moveAssignments(dest){\n if (assignments.length) {\n dest.argument = {\n type:'SequenceExpression',\n expressions:assignments.map(function(a){\n var b = cloneNode(a)\n coerce(a,a.left);\n return b ;\n }).concat(dest.argument)\n } ;\n assignments = [] ;\n }\n }\n \n \n if (node.type in sequences && !node.$hoisted) {\n var expr = sequences[node.type](node) ;\n var assignments = [] ;\n var path ;\n for (i=0; i<expr.length;i++) {\n if (examine(expr[i]).isScope)\n continue ;\n \n if (path = containsAwait(expr[i]))\n moveAssignments(path[0].self) ;\n\n if (!containsAwait(expr.slice(i+1)))\n break ;\n\n if (path = containsAssign(expr[i]))\n assignments.push(path[0].self) ;\n }\n } else if (node.type === 'VariableDeclaration') {\n // If any of the VariableDeclarators contain an initial value and are followed by a VariableDeclarator\n // containing an await, split them up into multiple statements\n for (i=node.declarations.length-1; i>0; i--) {\n if (node.declarations[i] && node.declarations[i].init && containsAwait(node.declarations[i].init)) {\n var insert = {\n type:'VariableDeclaration',\n kind: node.kind,\n declarations: node.declarations.splice(i)\n } ;\n var ref = path[0] ;\n if ('index' in ref) {\n ref.parent[ref.field].splice(ref.index+1,0,insert) ;\n } else throw new Error(\"VariableDeclaration not in a block\") ;\n }\n }\n }\n }) ;\n\n /* Hoist declarations */\n function isFreeVariable(kinds) {\n return function(n, path) {\n if (n.type === 'VariableDeclaration' && (n.kind = n.kind || 'var') && kinds.indexOf(n.kind)>=0) {\n var p = path[0] ;\n // Don't hoist the LHS of for (var/let/const _ of/in ... ; ;){}\n if (p.field == \"left\" && (p.parent.type === 'ForInStatement' || p.parent.type === 'ForOfStatement'))\n return false;\n\n // Don't hoist the LHS of for (let/const _ = ... ; ;){}\n if (p.field == \"init\" && p.parent.type === 'ForStatement' && (n.kind===\"const\" || n.kind===\"let\"))\n return false;\n\n return true;\n }\n }\n }\n\n function isHoistableFunction(n, path) {\n // YES: We're a named function, but not a continuation\n if (n.type==='FunctionDeclaration' && n.id) {\n return examine(n).isAsync || !n.$continuation;\n }\n // No, we're not a hoistable function\n return false;\n }\n\n checkConstsNotAssigned(ast) ;\n\n var inStrictBody = false ;\n parser.treeWalker(ast, function (node, descend, path) {\n var prevScope = inStrictBody ;\n inStrictBody = inStrictBody || isStrict(node) ;\n\n if (examine(node).isBlockStatement) {\n if (containsAwait(node)) {\n // For this scope/block, find all the hoistable functions, vars and directives\n var isScope = !path[0].parent || examine(path[0].parent).isScope ;\n\n /* 'const' is highly problematic. In early version of Chrome (Node 0.10, 4.x, 5.x) non-standard behaviour:\n *\n * Node scope multiple-decls\n * v0.1x function SyntaxError\n * v0.1x strict SyntaxError SyntaxError\n * 4/5.x function SyntaxError\n * 4/5.x strict block ok (SyntaxError on duplicate in block)\n * 6.x (as 4/5.x strict)\n *\n * To make these non-standard behaviours work, we treat a single declaration of a const identifier as requiring function scope (which works everywhere),\n * declare as a 'var' and initialize inline.\n * We treat multiple declarations as block-scoped, and let the engine work it out. To make consts blocked-scope, we use 'const' where possible (i.e. before\n * any await expressions), or declare as 'let' after an await. This breaks in non-strict mode in Node 4/5, as 'let' requires strict mode.\n *\n * In summary, what this means is:\n * - const's with a single declaration in the current scope (NOT block) should be hoisted to function level, and defined as 'var'\n * - const's with duplicate declarations in the current scope (NOT block) should be hoisted to block level, and defined as 'let'\n */\n\n var directives, consts, vars, lets, functions ;\n if (isScope) {\n consts = scopedNodes(node, isFreeVariable(['const']),false);\n var names = {}, duplicates = {} ;\n\n // Work out which const identifiers are duplicates\n // Ones that are only declared once can simply be treated as vars, whereas\n // identifiers that are declared multiple times have block-scope and are\n // only valid in node 6 or in strict mode on node 4/5\n consts.forEach(function(d){\n d[0].self.declarations.forEach(function(e){\n getDeclNames(e.id).forEach(function(n){\n if (names[n] || duplicates[n]) {\n delete names[n] ;\n duplicates[n] = e ;\n } else {\n names[n] = e ;\n }\n }) ;\n }) ;\n }) ;\n\n // Change all the declarations into assignments, since consts are always initialized\n consts.forEach(function(d){\n for (var depth=0; depth<d.length; depth++)\n if (examine(d[depth].parent).isBlockStatement)\n break ;\n\n var ref = d[depth] ;\n ref.append({\n type: 'ExpressionStatement',\n expression: {\n type: 'SequenceExpression',\n expressions: d[0].self.declarations.map(function (d) {\n var a = {\n type: 'AssignmentExpression',\n operator: '=',\n left: d.id,\n right: d.init\n };\n d.init = null ;\n return a ;\n })\n }\n });\n var ids = getDeclNames(d[0].self.declarations) ;\n var decls = ids.filter(function(name){ return name in duplicates }) ;\n if (decls.length) {\n d[0].append({\n type:'VariableDeclaration',\n kind:'let',\n declarations: decls.map(function(name){\n return {\n type:'VariableDeclarator',\n id:ident(name)\n }\n })\n }) ;\n }\n\n d[0].self.kind = 'var' ;\n decls = ids.filter(function(name){ return name in names }) ;\n if (decls.length) {\n d[0].self.declarations = decls.map(function(name){\n return {\n type:'VariableDeclarator',\n id:ident(name)\n }\n });\n } else {\n ref.remove() ;\n }\n }) ;\n vars = scopedNodes(node, isFreeVariable(['var']),false);\n lets = [] ;\n } else {\n lets = scopedNodes(node, isFreeVariable(['const']),true);\n }\n lets = lets.concat(scopedNodes(node, isFreeVariable(['let']),true));\n directives = scopedNodes(node, function (n) { return examine(n).isDirective },true);\n functions = scopedNodes(node, isHoistableFunction, inStrictBody);\n\n vars = vars?extractVars(vars,'var'):{duplicates:{},decls:[]} ;\n lets = lets?extractVars(lets,'let'):{duplicates:{},decls:[]} ;\n\n Object.keys(vars.duplicates).forEach(function(id){\n logger(where(vars.duplicates[id]) + \"Duplicate declaration '\" + printNode(vars.duplicates[id]) + \"'\");\n }) ;\n Object.keys(lets.duplicates).forEach(function(id){\n logger(where(lets.duplicates[id]) + \"Duplicate declaration '\" + printNode(lets.duplicates[id]) + \"'\");\n }) ;\n\n functions = functions.map(function (path) {\n var ref = path[0], symName;\n // What is the name of this function (could be async, so check the expression if necessary),\n // and should we remove and hoist, or reference and hoist?\n if (examine(ref.self).isAsync) {\n symName = ref.self.id.name;\n // If we're actually a top-level async FunctionExpression, redeclare as a FunctionDeclaration\n if (examine(ref.parent).isBlockStatement) {\n ref.self.type = 'FunctionDeclaration';\n ref.remove();\n return ref.self;\n }\n // We're an async FunctionExpression\n return ref.replace(ident(symName));\n }\n // We're just a vanilla FunctionDeclaration or FunctionExpression\n symName = ref.self.id.name;\n var movedFn = ref.self.type === 'FunctionDeclaration' ? ref.remove() : ref.replace(ident(symName));\n return movedFn;\n });\n\n directives = directives.map(function (path) {\n var ref = path[0];\n return ref.remove();\n });\n if (directives.length || vars.decls.length || lets.decls.length || functions.length) {\n node.body = directives.concat(vars.decls).concat(lets.decls).concat(functions).concat(node.body);\n }\n }\n inStrictBody = prevScope ;\n }\n\n // Labeled blocks need to be treated as loops that exit on the first iteration if they contain awaits and labelled breaks\n if (node.type==='LabeledStatement' && node.body.type==='BlockStatement' && containsAwait(node.body) && contains(node.body,function(m){\n\t\t \t return m.type === 'BreakStatement' && m.label\n\t \t})) {\n \t node.body.body.push({ type: 'BreakStatement' }) ;\n node.body = {\n type: 'DoWhileStatement',\n test: literal(0),\n body: node.body\n };\n }\n \n descend();\n\n // It makes life easier if labeled loops have the label to hand, so we simply reference them here with a hidden $label\n // and keep a record of how nested the for loop is (since it's transformed top to bottom and counting during\n // transformation is therefore not possible\n if (node.type==='ForOfStatement' || node.type==='ForInStatement' || examine(node).isLoop) {\n var depth = 0 ;\n for (var n=0; n<path.length;n++)\n if (path[n].self.type==='ForOfStatement' || path[n].self.type==='ForInStatement' || examine(path[n].self).isLoop)\n depth += 1 ;\n else if (examine(path[n].self).isFunction)\n break ;\n\n node.$depth = depth ;\n if (path[0].parent.type==='LabeledStatement') {\n node.$label = path[0].parent.label ;\n } else {\n node.$label = null ;\n }\n }\n return true;\n });\n return ast;\n }", "title": "" }, { "docid": "4ec98a4683b6903ad9a1d9be7c76d19d", "score": "0.39994818", "text": "function addInitializedPropertyStatements(statements, properties, receiver) {\n for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) {\n var property = properties_8[_i];\n var statement = ts.createStatement(transformInitializedProperty(property, receiver));\n ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));\n ts.setCommentRange(statement, property);\n statements.push(statement);\n }\n }", "title": "" }, { "docid": "181639ce72646ee3653006ce2dde2687", "score": "0.39973462", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "c33117754d73e9672ae53b2264ce281d", "score": "0.3962621", "text": "static get properties() {\n return {\n prop1: { type: String },\n prop2: { type: Number },\n prop3: { type: Boolean },\n prop4: { type: Array },\n prop5: { type: Object }\n };\n }", "title": "" }, { "docid": "cb162177280ec19b3704568807dc081f", "score": "0.39589685", "text": "function standardizeLets(declars) {\n var _arr = declars;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var declar = _arr[_i];\n delete declar._let;\n }\n}", "title": "" }, { "docid": "0c8e656e09c69a5aa6729be0261d648a", "score": "0.3946799", "text": "function iAmADeclaration() {}", "title": "" }, { "docid": "8c7197cdfcbc7bb8454ed150e4ad81c2", "score": "0.3936549", "text": "function refactorProperties() {\n if (_.isEmpty(wiz.connection))\n return;\n\n if (_.isEmpty(wiz.connection[CONNECTION_KEYS.PROPERTIES]))\n return;\n\n if (! _.isArray(wiz.connection[CONNECTION_KEYS.PROPERTIES]))\n return; // Already refactored nothing to do\n\n var refactoredProps = {};\n for (var i = 0; i < wiz.connection[CONNECTION_KEYS.PROPERTIES].length; ++i) {\n var propObj = wiz.connection[CONNECTION_KEYS.PROPERTIES][i];\n var camelKey = _.camelCase(propObj.name);\n refactoredProps[camelKey] = propObj.value;\n }\n\n wiz.connection[CONNECTION_KEYS.PROPERTIES] = refactoredProps;\n }", "title": "" }, { "docid": "9e2deb2895296d5a98cb6df5276a0c86", "score": "0.3929397", "text": "function resolveAnonymousTypeMembers(type) {\n var symbol = type.symbol;\n if (type.target) {\n var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/false);\n var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);\n var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);\n var stringIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 0 /* String */), type.mapper);\n var numberIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 1 /* Number */), type.mapper);\n setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n } else if (symbol.flags & 2048 /* TypeLiteral */) {\n var members = getMembersOfSymbol(symbol);\n var callSignatures = getSignaturesOfSymbol(members.get(\"__call\" /* Call */));\n var constructSignatures = getSignaturesOfSymbol(members.get(\"__new\" /* New */));\n var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);\n var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);\n setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n } else {\n // Combinations of function, class, enum and module\n var members = emptySymbols;\n var stringIndexInfo = undefined;\n if (symbol.exports) {\n members = getExportsOfSymbol(symbol);\n }\n setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined);\n if (symbol.flags & 32 /* Class */) {\n var classType = getDeclaredTypeOfClassOrInterface(symbol);\n var baseConstructorType = getBaseConstructorTypeOfClass(classType);\n if (baseConstructorType.flags & (65536 /* Object */ | 262144 /* Intersection */ | 1081344 /* TypeVariable */)) {\n members = ts.createSymbolTable(getNamedMembers(members));\n addInheritedMembers(members, getPropertiesOfType(baseConstructorType));\n } else if (baseConstructorType === anyType) {\n stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/false);\n }\n }\n var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined;\n setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);\n // We resolve the members before computing the signatures because a signature may use\n // typeof with a qualified name expression that circularly references the type we are\n // in the process of resolving (see issue #6072). The temporarily empty signature list\n // will never be observed because a qualified name can't reference signatures.\n if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {\n type.callSignatures = getSignaturesOfSymbol(symbol);\n }\n // And likewise for construct signatures for classes\n if (symbol.flags & 32 /* Class */) {\n var classType = getDeclaredTypeOfClassOrInterface(symbol);\n var constructSignatures = getSignaturesOfSymbol(symbol.members.get(\"__constructor\" /* Constructor */));\n if (!constructSignatures.length) {\n constructSignatures = getDefaultConstructSignatures(classType);\n }\n type.constructSignatures = constructSignatures;\n }\n }\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.3924231", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.3924231", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.3924231", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "cce28699a48456bb72f0723a30b104df", "score": "0.39199838", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "cce28699a48456bb72f0723a30b104df", "score": "0.39199838", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "f9feac6d0288facf1b2671b6e8489baa", "score": "0.3915109", "text": "getPropertyTypes() {\n let properties = [];\n for (let part of Object.values(this.parts)) {\n if (part.properties) {\n properties.push(part.properties);\n }\n }\n return properties;\n }", "title": "" }, { "docid": "0de57f61e1b42fd4ab5243f9a36cf4d6", "score": "0.39113453", "text": "function extractTypesFromThreejs() {\n\t\tfor( var property in THREE ){\n\t\t\tif( typeof THREE[ property ] !== 'function' )\tcontinue\n\t\t\t// NOTE: unshift is key here to get proper inheritance\n\t\t\t// - https://github.com/spite/ThreeJSEditorExtension/issues/9\n\t\t\tthreejsClassNames.unshift( property );\n\t\t}\n\t}", "title": "" }, { "docid": "2d1d1091ebe5a69d27af92d0982dd43a", "score": "0.39092544", "text": "function __resolveProperties(sources, propertyNames) {\n var r = {};\n var length = sources.length;\n propertyNames.forEach(function (pn) {\n for (var i = 0; i < length; i++) {\n var src = sources[i];\n if (src) {\n var val = src[pn];\n if (val !== undefined) {\n r[pn] = val;\n break;\n }\n }\n }\n });\n return r;\n}", "title": "" }, { "docid": "2d1d1091ebe5a69d27af92d0982dd43a", "score": "0.39092544", "text": "function __resolveProperties(sources, propertyNames) {\n var r = {};\n var length = sources.length;\n propertyNames.forEach(function (pn) {\n for (var i = 0; i < length; i++) {\n var src = sources[i];\n if (src) {\n var val = src[pn];\n if (val !== undefined) {\n r[pn] = val;\n break;\n }\n }\n }\n });\n return r;\n}", "title": "" }, { "docid": "5b50db14b4ea8a3277f38d3125d8cc04", "score": "0.39080015", "text": "function Declaration(name, options, node){\n // properties\n\n //name: string\n //members: Map string to Declaration\n //parent: Declaration\n\n //nodeDeclared: ASTBase\n //nodeClass //VariableDecl(var&props)|MethodDeclaration|NamespaceDeclaration|ClassDeclaration\n\n//isFunction: boolean // true if nodeDeclared instanceof FunctionDeclaration or this is a global function\n// isClass: boolean // true if nodeDeclared.constructor is ClassDeclaration or this is a core Class\n// isNamespace: boolean // true if nodeDeclared.constructor is NamespaceDeclaration or Module\n// \n\n //normalizeModeKeepFirstCase: boolean\n\n //isScope: boolean\n //isExported: boolean\n\n //type, itemType\n //value\n\n //isForward\n //isDummy\n\n //.name = name.toString()\n this.name = name.toString();\n //.members = new Map // string to Declaration //contained Declarations\n this.members = new Map();\n\n//try to determine nodeClass from node.nodeDeclared\n\n //.nodeDeclared = node\n this.nodeDeclared = node;\n //if node\n if (node) {\n \n //.nodeClass = node.constructor\n this.nodeClass = node.constructor;\n //case .nodeClass\n \n //when\n if (\n (this.nodeClass==Grammar.ImportStatementItem)\n ||(this.nodeClass==Grammar.DeclareStatement)\n ||(this.nodeClass==Grammar.WithStatement)\n ||(this.nodeClass==Grammar.ArrayLiteral)\n ||(this.nodeClass==Grammar.ExceptionBlock)\n ){\n //.nodeClass = Grammar.VariableDecl\n this.nodeClass = Grammar.VariableDecl;\n \n }\n //when\n else if (\n (this.nodeClass==Grammar.ObjectLiteral)\n ||(this.nodeClass==Grammar.FreeObjectLiteral)\n ){\n //.nodeClass = Grammar.NameValuePair\n this.nodeClass = Grammar.NameValuePair;\n \n }\n //when\n else if (\n (this.nodeClass==Grammar.FunctionDeclaration)\n ||(this.nodeClass==Grammar.ClassDeclaration)\n ||(this.nodeClass==Grammar.NamespaceDeclaration)\n ||(this.nodeClass==Grammar.VarStatement)\n ){\n //.isExported = node.hasAdjective('export') and not node.hasAdjective('only')\n this.isExported = node.hasAdjective('export') && !(node.hasAdjective('only'));\n \n };\n };\n\n\n //end if\n\n\n //if options\n \n\n\n //if options\n if (options) {\n \n\n //if options.nodeClass, .nodeClass = options.nodeClass\n if (options.nodeClass) {this.nodeClass = options.nodeClass};\n\n //if options.normalizeModeKeepFirstCase, .normalizeModeKeepFirstCase=true\n if (options.normalizeModeKeepFirstCase) {this.normalizeModeKeepFirstCase = true};\n\n//if it 'points' to another namedecl, it uses other nameDecl's '.members={}'\n//effectively working as a pointer\n\n //if options.pointsTo\n if (options.pointsTo) {\n \n //.members = options.pointsTo.members\n this.members = options.pointsTo.members;\n }\n //if options.pointsTo\n \n else {\n\n //if options.type instanceof Grammar.TypeDeclaration\n if (options.type instanceof Grammar.TypeDeclaration) {\n \n //.setMember('**proto**',options.type.mainType)\n this.setMember('**proto**', options.type.mainType);\n //if options.type.itemType, .setMember('**item type**',options.type.itemType)\n if (options.type.itemType) {this.setMember('**item type**', options.type.itemType)};\n }\n //if options.type instanceof Grammar.TypeDeclaration\n \n else if (options.type) {\n \n //.setMember('**proto**',options.type)\n this.setMember('**proto**', options.type);\n };\n\n //if options.returnType\n if (options.returnType) {\n \n //.setMember('**return type**',options.returnType)\n this.setMember('**return type**', options.returnType);\n };\n\n //if options.value, .setMember('**value**',options.value)\n if (options.value) {this.setMember('**value**', options.value)};\n };\n\n //if options.isForward, .isForward = true\n if (options.isForward) {this.isForward = true};\n //if options.isDummy, .isDummy = true\n if (options.isDummy) {this.isDummy = true};\n\n //if options.isForward or options.isDummy and no .nodeClass, .nodeClass = Grammar.VariableDecl\n if (options.isForward || options.isDummy && !this.nodeClass) {this.nodeClass = Grammar.VariableDecl};\n };\n\n\n//Check for a valid nodeclass\n\n //if no .nodeClass\n if (!this.nodeClass || [Grammar.NamespaceDeclaration, Grammar.ClassDeclaration, Grammar.PropertiesDeclaration, Grammar.NameValuePair, Grammar.FunctionDeclaration, Grammar.MethodDeclaration, Grammar.VariableDecl].indexOf(this.nodeClass)===-1) {\n \n\n //fail with \"new Declaration, nodeClass is undefined or invalid: #{.nodeClass? .nodeClass.name:.nodeClass}\"\n throw new Error(\"new Declaration, nodeClass is undefined or invalid: \" + (this.nodeClass ? this.nodeClass.name : this.nodeClass));\n };\n\n//set .isFunction flag\n\n//if .nodeClass instanceof Grammar.FunctionDeclaration, .isFunction = true //fn, method & constructors\n//\n// if .nodeClass instanceof Grammar.FunctionDeclaration, .isFunction = true //fn, method & constructors\n//\n// case .nodeClass\n// when Grammar.NamespaceDeclaration: .isNamespace = true\n// when Grammar.ClassDeclaration: .isClass = true\n// \n\n//keep a list of all NameDeclarations\n\n //allNameDeclarations.push this\n module.exports.allNameDeclarations.push(this);\n }", "title": "" }, { "docid": "7a180daaeec8fb4446b5a42f82aaa929", "score": "0.3905289", "text": "function inferTypes( rootNode ) { \r\n var allNodes = nodeUtils.getAllNodes(rootNode);\r\n var nodesToProcess = [rootNode];\r\n\r\n // All array types are (for now) called vec[n]\r\n _.chain(allNodes).filter(function(node) {\r\n return node.type == 'ArrayExpression';\r\n }).each(function( node ) {\r\n nodesToProcess = nodesToProcess.concat(setDataType(node, \"vec\" + node.elements.length));\r\n });\r\n\r\n // Use known functions to match up argument and return types\r\n _.chain(allNodes).filter(function(node) {\r\n return node.type == 'CallExpression';\r\n }).each(function( node ) { \r\n var knownFunction = knownFunctions.getKnownFunction(node); \r\n if(knownFunction) { \r\n nodesToProcess = nodesToProcess.concat(knownFunction.inferTypes(node));\r\n }\r\n \r\n if(knownFunction === undefined) { \r\n var astFunctions = _.chain(nodeUtils.getAllNodes(node))\r\n .filter(function (n) {\r\n return n.type == \"FunctionDeclaration\" && n.id.type == \"Identifier\" && n.id.name == node.callee.name && n.params.length == node.arguments.length;\r\n }).each(function(n) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(n, node), \"Matched call to return type of other function\"); \r\n _.each(n.params, function(an,idx) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(an, node.arguments[idx], \"Matched \" + idx + \" argument\") );\r\n });\r\n }).value();\r\n if(astFunctions.length > 1) {\r\n throw new Error(\"Type overloading isn't allowed; not even sure how you did that.\");\r\n }\r\n } \r\n });\r\n \r\n // Mark all index types as ints, mark all indexed values as float\r\n _.chain(allNodes).filter(function(node) {\r\n return node.type == \"MemberExpression\" && node.computed;\r\n }).each(function (node ) { \r\n nodesToProcess = nodesToProcess.concat( setDataType(node.property, 'int') );\r\n nodesToProcess = nodesToProcess.concat( setDataType(node, 'float') );\r\n if(node.property.type == \"Literal\")\r\n node.object.dataTypeAtLeast = node.property.value; \r\n }); \r\n \r\n while(nodesToProcess.length) {\r\n var node = nodesToProcess.pop();\r\n var parentNode = node.parent; \r\n\r\n /***** Push down inferences -- inferences that are based on this node, and push down to its children. */\r\n if(node.type == 'CallExpression') {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(node, node.callee), \"CallExpression has type of called functions return\" ); }\r\n // For unary types, propagate down to the expression\r\n else if(node.type == \"UnaryExpression\" || node.type == 'UpdateExpression') {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(node.argument, node), \"Unary expressions share type\" ); \r\n }\r\n else if(node.type == 'ConditionalExpression') {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(node.alternate, node.consequent, \"Ternary outcomes are equal\") ); \r\n nodesToProcess = nodesToProcess.concat( syncDataType(node, node.consequent, \"Ternary returns same type as outcomes\") );\r\n } \r\n\r\n /***** Push up inferences -- inferences that are based on the parent node, and push up to that parent. */\r\n if(parentNode) {\r\n if(parentNode.type == 'VariableDeclarator' && parentNode.init) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.id, parentNode.init, \"Match var id to initialization\") ); \r\n } else if(parentNode.type == 'CallExpression' && parentNode.callee == node) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(node, parentNode, \"Call expression\") ); \r\n } else if(parentNode.type == 'ConditionalExpression') {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.alternate, parentNode.consequent,\"Ternary outcomes are equal\") );\r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode, parentNode.consequent,\"Ternary returns same type as outcomes\") ); \r\n\t }\r\n // Happens when an argument gets its type processed\r\n else if(parentNode.type == \"FunctionDeclaration\" || parentNode.type == \"FunctionExpression\") {\r\n _.chain( nodeUtils.getNodesWithIdInScope(node, parentNode.id) ).filter(function(node) {\r\n return node.parent.type == 'CallExpression' && node.parent.arguments.length == parentNode.params.length;\r\n }).each(function (calleeIdNode) {\r\n var callExpression = calleeIdNode.parent; \r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.id, callExpression, \"Call has same type as fn\") ); \r\n _.each(parentNode.params, function(an,idx) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(an, callExpression.arguments[idx], \"Argument syncs for \" + idx) );\r\n });\r\n }); \r\n \r\n _.chain(nodeUtils.getAllDescendants(parentNode))\r\n .filter(nodeUtils.hasType(\"ReturnStatement\"))\r\n .each(function(returnStatement) {\r\n if(returnStatement.argument) {\r\n nodesToProcess = nodesToProcess.concat( \r\n\t\t\t\t syncDataType(returnStatement.argument, parentNode.id, \"Fn type must match return argument\") );\r\n }\r\n }); \r\n }\r\n \r\n // If a return statements argument was set, propagate to the function definition its in\r\n else if(parentNode.type == 'ReturnStatement' && parentNode.argument !== undefined) {\r\n var p = parentNode; \r\n while(p !== undefined && p.type != \"FunctionDeclaration\" && p.type != \"FunctionExpression\" ) {\r\n p = p.parent; \r\n } \r\n if(p && p.type == \"FunctionExpression\") {\r\n p = p.parent; \r\n }\r\n \r\n if(p) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(p.id, parentNode.argument), \"Return argument must match function type\" ); \r\n }\r\n else throw new Error(\"Couldn't find matching function statement for return statement\"); \r\n }\r\n \r\n // Anything with a left/right thing has the same type. Also mark the parent Node. \r\n else if(parentNode.left !== undefined && parentNode.right !== undefined) {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.left, parentNode.right, \"left == right for binary expression\") );\r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode, parentNode.left, \"binary expression parent node must equal operands\") );\r\n }\r\n // For unary types, propagate up to the expression node\r\n else if(parentNode.type == \"UnaryExpression\" || parentNode.type == 'UpdateExpression') {\r\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode, node, \"Unary match\") ); \r\n }\r\n \r\n \r\n }\r\n \r\n \r\n /***** Last resort propagation methods */\r\n \r\n // Out of nodes? Solidify the array counts. \r\n if(nodesToProcess.length === 0 ) { \r\n var nodesWithDataTypeMinSizes = _.chain(allNodes).filter(function (node) { \r\n\t\treturn node.dataType === undefined && node.dataTypeAtLeast > 0;\r\n\t }).sortBy(function(node) { \r\n\t\t// Ordering matters for this operation; we start with the things that resolve as the largest types. See comment below.\r\n\t\treturn -node.dataTypeAtLeast;\r\n\t }).value();\r\n\t \r\n\t // We have to bail if nodes get added to process. By starting with the largest, we make sure situations where \r\n\t // you have two unknown sized vecs that are set to be equal, it always ends up assigning the larger size. \r\n\t for(var i = 0;i < nodesWithDataTypeMinSizes.length && nodesToProcess.length === 0;i++) {\r\n\t\tvar nodeWithMinDatatype = nodesWithDataTypeMinSizes[i]; \r\n\t\tLOG( rewrite(nodeWithMinDatatype) + \" max seen index --\" + nodeUtils.getDataTypeForId(nodeWithMinDatatype, nodeWithMinDatatype) ); \r\n nodesToProcess = nodesToProcess.concat( setDataType(nodeWithMinDatatype, nodeUtils.getDataTypeForId(nodeWithMinDatatype, nodeWithMinDatatype)) ); \r\n \t }\r\n }\r\n \r\n // If we are still out of nodes to process, first try applying dataTypeHints\r\n if(nodesToProcess.length === 0 ) {\r\n _.chain(allNodes).filter(function (node) { \r\n return node.dataType === undefined && node.dataTypeHint !== undefined;\r\n }).each(function(node) {\r\n nodesToProcess = nodesToProcess.concat( setDataType(node, node.dataTypeHint) ); \r\n\t\tLOG(\"Setting \" + rewrite(node) + \" to \" + node.dataTypeHint + \" based on hint\");\r\n });\r\n }\r\n\r\n\r\n // Essentially this just guesses 'float' for the rest of the unknowns. This is most likely ok. GLSL needs a type\r\n // and _most_ of the time you want float. In particular, if a variable is just not used, it could be a coin flip\r\n // if it is an int or a float, but since it isn't used either one works and the GLSL compiler will probably just \r\n // yank it out. \r\n if(nodesToProcess.length === 0 ) { \r\n _.chain(allNodes).each(function (node) { \r\n if(node.name && node.type == \"Identifier\" && node.dataType === undefined && isInCallExpression(node) === false) { \r\n\t\t LOG( rewrite(node) + \" best guess\"); \r\n nodesToProcess = nodesToProcess.concat( setDataType(node, nodeUtils.getDataTypeForId(node, node)) ); \r\n }\r\n }); \r\n }\r\n \r\n \r\n }\r\n\r\n _.chain(allNodes).filter(function(node) {\r\n return node.type == \"ForStatement\";\r\n }).each(function (node ) { \r\n\tmarkRHSConstant(node.init);\r\n\tmarkRHSConstant(node.test); \r\n });\r\n\r\n}", "title": "" }, { "docid": "b5fca004fbf7549c764234bc17da8ddd", "score": "0.3905111", "text": "function cfnWebACLActionPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_ActionPropertyValidator(properties).assertSuccess();\n return {\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "3c1d78119a3e3987dbc17ddc7ed1a003", "score": "0.39044407", "text": "function visitTypeScript(node) {\n if (ts.hasModifier(node, 2 /* Ambient */) && ts.isStatement(node)) {\n // TypeScript ambient declarations are elided, but some comments may be preserved.\n // See the implementation of `getLeadingComments` in comments.ts for more details.\n return ts.createNotEmittedStatement(node);\n }\n switch (node.kind) {\n case 83 /* ExportKeyword */:\n case 78 /* DefaultKeyword */:\n // ES6 export and default modifiers are elided when inside a namespace.\n return currentNamespace ? undefined : node;\n case 113 /* PublicKeyword */:\n case 111 /* PrivateKeyword */:\n case 112 /* ProtectedKeyword */:\n case 116 /* AbstractKeyword */:\n case 75 /* ConstKeyword */:\n case 123 /* DeclareKeyword */:\n case 130 /* ReadonlyKeyword */:\n // TypeScript accessibility and readonly modifiers are elided.\n case 163 /* ArrayType */:\n case 164 /* TupleType */:\n case 162 /* TypeLiteral */:\n case 157 /* TypePredicate */:\n case 144 /* TypeParameter */:\n case 118 /* AnyKeyword */:\n case 121 /* BooleanKeyword */:\n case 135 /* StringKeyword */:\n case 132 /* NumberKeyword */:\n case 129 /* NeverKeyword */:\n case 104 /* VoidKeyword */:\n case 136 /* SymbolKeyword */:\n case 160 /* ConstructorType */:\n case 159 /* FunctionType */:\n case 161 /* TypeQuery */:\n case 158 /* TypeReference */:\n case 165 /* UnionType */:\n case 166 /* IntersectionType */:\n case 167 /* ParenthesizedType */:\n case 168 /* ThisType */:\n case 169 /* TypeOperator */:\n case 170 /* IndexedAccessType */:\n case 171 /* MappedType */:\n case 172 /* LiteralType */:\n // TypeScript type nodes are elided.\n case 156 /* IndexSignature */:\n // TypeScript index signatures are elided.\n case 146 /* Decorator */:\n // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration.\n case 230 /* TypeAliasDeclaration */:\n // TypeScript type-only declarations are elided.\n case 148 /* PropertyDeclaration */:\n // TypeScript property declarations are elided.\n return undefined;\n case 151 /* Constructor */:\n return visitConstructor(node);\n case 229 /* InterfaceDeclaration */:\n // TypeScript interfaces are elided, but some comments may be preserved.\n // See the implementation of `getLeadingComments` in comments.ts for more details.\n return ts.createNotEmittedStatement(node);\n case 228 /* ClassDeclaration */:\n // This is a class declaration with TypeScript syntax extensions.\n //\n // TypeScript class syntax extensions include:\n // - decorators\n // - optional `implements` heritage clause\n // - parameter property assignments in the constructor\n // - property declarations\n // - index signatures\n // - method overload signatures\n return visitClassDeclaration(node);\n case 198 /* ClassExpression */:\n // This is a class expression with TypeScript syntax extensions.\n //\n // TypeScript class syntax extensions include:\n // - decorators\n // - optional `implements` heritage clause\n // - parameter property assignments in the constructor\n // - property declarations\n // - index signatures\n // - method overload signatures\n return visitClassExpression(node);\n case 257 /* HeritageClause */:\n // This is a heritage clause with TypeScript syntax extensions.\n //\n // TypeScript heritage clause extensions include:\n // - `implements` clause\n return visitHeritageClause(node);\n case 200 /* ExpressionWithTypeArguments */:\n // TypeScript supports type arguments on an expression in an `extends` heritage clause.\n return visitExpressionWithTypeArguments(node);\n case 150 /* MethodDeclaration */:\n // TypeScript method declarations may have decorators, modifiers\n // or type annotations.\n return visitMethodDeclaration(node);\n case 152 /* GetAccessor */:\n // Get Accessors can have TypeScript modifiers, decorators, and type annotations.\n return visitGetAccessor(node);\n case 153 /* SetAccessor */:\n // Set Accessors can have TypeScript modifiers and type annotations.\n return visitSetAccessor(node);\n case 227 /* FunctionDeclaration */:\n // Typescript function declarations can have modifiers, decorators, and type annotations.\n return visitFunctionDeclaration(node);\n case 185 /* FunctionExpression */:\n // TypeScript function expressions can have modifiers and type annotations.\n return visitFunctionExpression(node);\n case 186 /* ArrowFunction */:\n // TypeScript arrow functions can have modifiers and type annotations.\n return visitArrowFunction(node);\n case 145 /* Parameter */:\n // This is a parameter declaration with TypeScript syntax extensions.\n //\n // TypeScript parameter declaration syntax extensions include:\n // - decorators\n // - accessibility modifiers\n // - the question mark (?) token for optional parameters\n // - type annotations\n // - this parameters\n return visitParameter(node);\n case 184 /* ParenthesizedExpression */:\n // ParenthesizedExpressions are TypeScript if their expression is a\n // TypeAssertion or AsExpression\n return visitParenthesizedExpression(node);\n case 183 /* TypeAssertionExpression */:\n case 201 /* AsExpression */:\n // TypeScript type assertions are removed, but their subtrees are preserved.\n return visitAssertionExpression(node);\n case 180 /* CallExpression */:\n return visitCallExpression(node);\n case 181 /* NewExpression */:\n return visitNewExpression(node);\n case 202 /* NonNullExpression */:\n // TypeScript non-null expressions are removed, but their subtrees are preserved.\n return visitNonNullExpression(node);\n case 231 /* EnumDeclaration */:\n // TypeScript enum declarations do not exist in ES6 and must be rewritten.\n return visitEnumDeclaration(node);\n case 207 /* VariableStatement */:\n // TypeScript namespace exports for variable statements must be transformed.\n return visitVariableStatement(node);\n case 225 /* VariableDeclaration */:\n return visitVariableDeclaration(node);\n case 232 /* ModuleDeclaration */:\n // TypeScript namespace declarations must be transformed.\n return visitModuleDeclaration(node);\n case 236 /* ImportEqualsDeclaration */:\n // TypeScript namespace or external module import.\n return visitImportEqualsDeclaration(node);\n default:\n ts.Debug.failBadSyntaxKind(node);\n return ts.visitEachChild(node, visitor, context);\n }\n }", "title": "" }, { "docid": "485b66da87d2c71b239bd50b3dd8ac1c", "score": "0.39044318", "text": "function generatePropertyAliases(tNodeFlags, direction) {\n var count = tNodeFlags & 4095 /* DirectiveCountMask */;\n var propStore = null;\n if (count > 0) {\n var start = tNodeFlags >> 14 /* DirectiveStartingIndexShift */;\n var end = start + count;\n var isInput = direction === 0 /* Input */;\n var defs = tView.directives;\n for (var i = start; i < end; i++) {\n var directiveDef = defs[i];\n var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs;\n for (var publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n var internalName = propertyAliasMap[publicName];\n var hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, internalName) :\n (propStore[publicName] = [i, internalName]);\n }\n }\n }\n }\n return propStore;\n}", "title": "" }, { "docid": "a487bdefb7019173556384107528904d", "score": "0.39010075", "text": "function inferTypes( rootNode ) { \n var allNodes = nodeUtils.getAllNodes(rootNode);\n var nodesToProcess = [rootNode];\n\n // All array types are (for now) called vec[n]\n _.chain(allNodes).filter(function(node) {\n return node.type == 'ArrayExpression';\n }).each(function( node ) {\n nodesToProcess = nodesToProcess.concat(setDataType(node, \"vec\" + node.elements.length));\n });\n\n // Use known functions to match up argument and return types\n _.chain(allNodes).filter(function(node) {\n return node.type == 'CallExpression';\n }).each(function( node ) { \n var knownFunction = knownFunctions.getKnownFunction(node); \n if(knownFunction) { \n nodesToProcess = nodesToProcess.concat(knownFunction.inferTypes(node));\n }\n \n if(knownFunction === undefined) { \n var astFunctions = _.chain(nodeUtils.getAllNodes(node))\n .filter(function (n) {\n return n.type == \"FunctionDeclaration\" && n.id.type == \"Identifier\" && n.id.name == node.callee.name;\n }).each(function(n) {\n nodesToProcess = nodesToProcess.concat( syncDataType(n, node), \"Matched call to return type of other function\"); \n _.each(n.params, function(an,idx) {\n nodesToProcess = nodesToProcess.concat( syncDataType(an, node.arguments[idx], \"Matched \" + idx + \" argument\") );\n });\n }).value();\n if(astFunctions.length > 1) {\n throw new Error(\"Type overloading isn't allowed; not even sure how you did that.\");\n }\n } \n });\n \n // Mark all index types as ints, mark all indexed values as float\n _.chain(allNodes).filter(function(node) {\n return node.type == \"MemberExpression\" && node.computed;\n }).each(function (node ) { \n nodesToProcess = nodesToProcess.concat( setDataType(node.property, 'int') );\n nodesToProcess = nodesToProcess.concat( setDataType(node, 'float') );\n if(node.property.type == \"Literal\")\n node.object.dataTypeAtLeast = node.property.value; \n }); \n \n while(nodesToProcess.length) {\n var node = nodesToProcess.pop();\n var parentNode = node.parent; \n\n /***** Push down inferences -- inferences that are based on this node, and push down to its children. */\n\n if(node.type == 'CallExpression') {\n nodesToProcess = nodesToProcess.concat( syncDataType(node, node.callee), \"CallExpression has type of called functions return\" ); }\n // For unary types, propagate down to the expression\n else if(node.type == \"UnaryExpression\") {\n nodesToProcess = nodesToProcess.concat( syncDataType(node.argument, node), \"Unary expressions share type\" ); \n }\n else if(node.type == 'ConditionalExpression') {\n nodesToProcess = nodesToProcess.concat( syncDataType(node.alternate, node.consequent, \"Ternary outcomes are equal\") ); \n nodesToProcess = nodesToProcess.concat( syncDataType(node, node.consequent, \"Ternary returns same type as outcomes\") );\n }\n\n /***** Push up inferences -- inferences that are based on the parent node, and push up to that parent. */\n if(parentNode) {\n if(parentNode.type == 'VariableDeclarator' && parentNode.init) {\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.id, parentNode.init, \"Match var id to initialization\") ); \n } else if(parentNode.type == 'CallExpression' && parentNode.callee == node) {\n nodesToProcess = nodesToProcess.concat( syncDataType(node, parentNode, \"Call expression\") ); \n } else if(parentNode.type == 'ConditionalExpression') {\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.alternate, parentNode.consequent,\"Ternary outcomes are equal\") );\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode, parentNode.consequent,\"Ternary returns same type as outcomes\") ); \n\t }\n // Happens when an argument gets its type processed\n else if(parentNode.type == \"FunctionDeclaration\" || parentNode.type == \"FunctionExpression\") {\n _.chain( nodeUtils.getNodesWithIdInScope(node, parentNode.id) ).filter(function(node) {\n return node.parent.type == 'CallExpression';\n }).each(function (calleeIdNode) {\n var callExpression = calleeIdNode.parent; \n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.id, callExpression, \"Call has same type as fn\") ); \n _.each(parentNode.params, function(an,idx) {\n nodesToProcess = nodesToProcess.concat( syncDataType(an, callExpression.arguments[idx], \"Argument syncs for \" + idx) );\n });\n }); \n \n _.chain(nodeUtils.getAllDescendants(parentNode))\n .filter(nodeUtils.hasType(\"ReturnStatement\"))\n .each(function(returnStatement) {\n if(returnStatement.argument) {\n nodesToProcess = nodesToProcess.concat( \n\t\t\t\t syncDataType(returnStatement.argument, parentNode.id, \"Fn type must match return argument\") );\n }\n }); \n }\n \n // If a return statements argument was set, propagate to the function definition its in\n else if(parentNode.type == 'ReturnStatement' && parentNode.argument != undefined) {\n var p = parentNode; \n while(p != undefined && p.type != \"FunctionDeclaration\" && p.type != \"FunctionExpression\" ) {\n p = p.parent; \n } \n if(p && p.type == \"FunctionExpression\") {\n p = p.parent; \n }\n \n if(p) {\n nodesToProcess = nodesToProcess.concat( syncDataType(p.id, parentNode.argument), \"Return argument must match function type\" ); \n }\n else throw new Error(\"Couldn't find matching function statement for return statement\"); \n }\n \n // Anything with a left/right thing has the same type. Also mark the parent Node. \n else if(parentNode.left != undefined && parentNode.right != undefined) {\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode.left, parentNode.right, \"left == right for binary expression\") );\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode, parentNode.left, \"binary expression parent node must equal operands\") );\n }\n // For unary types, propagate up to the expression node\n else if(parentNode.type == \"UnaryExpression\") {\n nodesToProcess = nodesToProcess.concat( syncDataType(parentNode, node, \"Unary match\") ); \n }\n \n \n }\n \n \n /***** Last resort propagation methods */\n \n // Out of nodes? Solidify the array counts. \n if(nodesToProcess.length == 0 ) { \n var nodesWithDataTypeMinSizes = _.chain(allNodes).filter(function (node) { \n\t\treturn node.dataType === undefined && node.dataTypeAtLeast > 0;\n\t }).sortBy(function(node) { \n\t\t// Ordering matters for this operation; we start with the things that resolve as the largest types. See comment below.\n\t\treturn -node.dataTypeAtLeast;\n\t }).value();\n\t \n\t // We have to bail if nodes get added to process. By starting with the largest, we make sure situations where \n\t // you have two unknown sized vecs that are set to be equal, it always ends up assigning the larger size. \n\t for(var i = 0;i < nodesWithDataTypeMinSizes.length && nodesToProcess.length == 0;i++) {\n\t\tvar node = nodesWithDataTypeMinSizes[i]; \n\t\tLOG( rewrite(node) + \" max seen index --\" + nodeUtils.getDataTypeForId(node, node) ); \n nodesToProcess = nodesToProcess.concat( setDataType(node, nodeUtils.getDataTypeForId(node, node)) ); \n \t }\n }\n \n // If we are still out of nodes to process, first try applying dataTypeHints\n if(nodesToProcess.length == 0 ) {\n _.chain(allNodes).filter(function (node) { \n return node.dataType === undefined && node.dataTypeHint !== undefined;\n }).each(function(node) {\n nodesToProcess = nodesToProcess.concat( setDataType(node, node.dataTypeHint) ); \n\t\tLOG(\"Setting \" + rewrite(node) + \" to \" + node.dataTypeHint + \" based on hint\");\n });\n }\n\n\n // Essentially this just guesses 'float' for the rest of the unknowns. This is most likely ok. GLSL needs a type\n // and _most_ of the time you want float. In particular, if a variable is just not used, it could be a coin flip\n // if it is an int or a float, but since it isn't used either one works and the GLSL compiler will probably just \n // yank it out. \n if(nodesToProcess.length == 0 ) { \n _.chain(allNodes).each(function (node) { \n if(node.name && node.type == \"Identifier\" && node.dataType === undefined) { \n\t\t LOG( rewrite(node) + \" best guess\"); \n nodesToProcess = nodesToProcess.concat( setDataType(node, nodeUtils.getDataTypeForId(node, node)) ); \n }\n }); \n }\n \n \n }\n\n _.chain(allNodes).filter(function(node) {\n return node.type == \"ForStatement\";\n }).each(function (node ) { \n\tmarkRHSConstant(node.init);\n\tmarkRHSConstant(node.test); \n });\n\n}", "title": "" }, { "docid": "a7af0cf86f4f2ac0b7a25c9db056deac", "score": "0.38993558", "text": "function getPropertySymbolsFromContextualType(node, checker) {\n var contextualType = checker.getContextualType(node.parent);\n var name = getNameFromObjectLiteralElement(node);\n var symbol = contextualType && name && contextualType.getProperty(name);\n return symbol ? [symbol] :\n contextualType && contextualType.flags & 131072 /* Union */ ? ts.mapDefined(contextualType.types, function (t) { return t.getProperty(name); }) : ts.emptyArray;\n }", "title": "" }, { "docid": "0bdebb08f2607da7ec701a2dff8fe553", "score": "0.3898996", "text": "function varify(ast, stats, allIdentifiers, changes) {\n function unique(name) {\n assert(allIdentifiers.has(name));\n for (var cnt = 0; ; cnt++) {\n var genName = name + \"$\" + String(cnt);\n if (!allIdentifiers.has(genName)) {\n return genName;\n }\n }\n }\n\n function renameDeclarations(node) {\n if (node.type === \"VariableDeclaration\" && isConstLet(node.kind)) {\n var hoistScope = node.$scope.closestHoistScope();\n var origScope = node.$scope;\n\n // text change const|let => var\n changes.push({\n start: node.range[0],\n end: node.range[0] + node.kind.length,\n str: \"var\",\n });\n\n node.declarations.forEach(function(declarator) {\n assert(declarator.type === \"VariableDeclarator\");\n var name = declarator.id.name;\n\n stats.declarator(node.kind);\n\n // rename if\n // 1) name already exists in hoistScope, or\n // 2) name is already propagated (passed) through hoistScope or manually tainted\n var rename = (origScope !== hoistScope &&\n (hoistScope.hasOwn(name) || hoistScope.doesPropagate(name)));\n\n var newName = (rename ? unique(name) : name);\n\n origScope.remove(name);\n hoistScope.add(newName, \"var\", declarator.id, declarator.range[1]);\n\n origScope.moves = origScope.moves || stringmap();\n origScope.moves.set(name, {\n name: newName,\n scope: hoistScope,\n });\n\n allIdentifiers.add(newName);\n\n if (newName !== name) {\n stats.rename(name, newName, getline(declarator));\n\n declarator.id.originalName = name;\n declarator.id.name = newName;\n\n // textchange var x => var x$1\n changes.push({\n start: declarator.id.range[0],\n end: declarator.id.range[1],\n str: newName,\n });\n }\n });\n\n // ast change const|let => var\n node.kind = \"var\";\n }\n }\n\n function renameReferences(node) {\n if (!node.$refToScope) {\n return;\n }\n var move = node.$refToScope.moves && node.$refToScope.moves.get(node.name);\n if (!move) {\n return;\n }\n node.$refToScope = move.scope;\n\n if (node.name !== move.name) {\n node.originalName = node.name;\n node.name = move.name;\n\n if (node.alterop) {\n // node has no range because it is the result of another alter operation\n var existingOp = null;\n for (var i = 0; i < changes.length; i++) {\n var op = changes[i];\n if (op.node === node) {\n existingOp = op;\n break;\n }\n }\n assert(existingOp);\n\n // modify op\n existingOp.str = move.name;\n } else {\n changes.push({\n start: node.range[0],\n end: node.range[1],\n str: move.name,\n });\n }\n }\n }\n\n traverse(ast, {pre: renameDeclarations});\n traverse(ast, {pre: renameReferences});\n ast.$scope.traverse({pre: function(scope) {\n delete scope.moves;\n }});\n}", "title": "" }, { "docid": "0bdebb08f2607da7ec701a2dff8fe553", "score": "0.3898996", "text": "function varify(ast, stats, allIdentifiers, changes) {\n function unique(name) {\n assert(allIdentifiers.has(name));\n for (var cnt = 0; ; cnt++) {\n var genName = name + \"$\" + String(cnt);\n if (!allIdentifiers.has(genName)) {\n return genName;\n }\n }\n }\n\n function renameDeclarations(node) {\n if (node.type === \"VariableDeclaration\" && isConstLet(node.kind)) {\n var hoistScope = node.$scope.closestHoistScope();\n var origScope = node.$scope;\n\n // text change const|let => var\n changes.push({\n start: node.range[0],\n end: node.range[0] + node.kind.length,\n str: \"var\",\n });\n\n node.declarations.forEach(function(declarator) {\n assert(declarator.type === \"VariableDeclarator\");\n var name = declarator.id.name;\n\n stats.declarator(node.kind);\n\n // rename if\n // 1) name already exists in hoistScope, or\n // 2) name is already propagated (passed) through hoistScope or manually tainted\n var rename = (origScope !== hoistScope &&\n (hoistScope.hasOwn(name) || hoistScope.doesPropagate(name)));\n\n var newName = (rename ? unique(name) : name);\n\n origScope.remove(name);\n hoistScope.add(newName, \"var\", declarator.id, declarator.range[1]);\n\n origScope.moves = origScope.moves || stringmap();\n origScope.moves.set(name, {\n name: newName,\n scope: hoistScope,\n });\n\n allIdentifiers.add(newName);\n\n if (newName !== name) {\n stats.rename(name, newName, getline(declarator));\n\n declarator.id.originalName = name;\n declarator.id.name = newName;\n\n // textchange var x => var x$1\n changes.push({\n start: declarator.id.range[0],\n end: declarator.id.range[1],\n str: newName,\n });\n }\n });\n\n // ast change const|let => var\n node.kind = \"var\";\n }\n }\n\n function renameReferences(node) {\n if (!node.$refToScope) {\n return;\n }\n var move = node.$refToScope.moves && node.$refToScope.moves.get(node.name);\n if (!move) {\n return;\n }\n node.$refToScope = move.scope;\n\n if (node.name !== move.name) {\n node.originalName = node.name;\n node.name = move.name;\n\n if (node.alterop) {\n // node has no range because it is the result of another alter operation\n var existingOp = null;\n for (var i = 0; i < changes.length; i++) {\n var op = changes[i];\n if (op.node === node) {\n existingOp = op;\n break;\n }\n }\n assert(existingOp);\n\n // modify op\n existingOp.str = move.name;\n } else {\n changes.push({\n start: node.range[0],\n end: node.range[1],\n str: move.name,\n });\n }\n }\n }\n\n traverse(ast, {pre: renameDeclarations});\n traverse(ast, {pre: renameReferences});\n ast.$scope.traverse({pre: function(scope) {\n delete scope.moves;\n }});\n}", "title": "" }, { "docid": "0bdebb08f2607da7ec701a2dff8fe553", "score": "0.3898996", "text": "function varify(ast, stats, allIdentifiers, changes) {\n function unique(name) {\n assert(allIdentifiers.has(name));\n for (var cnt = 0; ; cnt++) {\n var genName = name + \"$\" + String(cnt);\n if (!allIdentifiers.has(genName)) {\n return genName;\n }\n }\n }\n\n function renameDeclarations(node) {\n if (node.type === \"VariableDeclaration\" && isConstLet(node.kind)) {\n var hoistScope = node.$scope.closestHoistScope();\n var origScope = node.$scope;\n\n // text change const|let => var\n changes.push({\n start: node.range[0],\n end: node.range[0] + node.kind.length,\n str: \"var\",\n });\n\n node.declarations.forEach(function(declarator) {\n assert(declarator.type === \"VariableDeclarator\");\n var name = declarator.id.name;\n\n stats.declarator(node.kind);\n\n // rename if\n // 1) name already exists in hoistScope, or\n // 2) name is already propagated (passed) through hoistScope or manually tainted\n var rename = (origScope !== hoistScope &&\n (hoistScope.hasOwn(name) || hoistScope.doesPropagate(name)));\n\n var newName = (rename ? unique(name) : name);\n\n origScope.remove(name);\n hoistScope.add(newName, \"var\", declarator.id, declarator.range[1]);\n\n origScope.moves = origScope.moves || stringmap();\n origScope.moves.set(name, {\n name: newName,\n scope: hoistScope,\n });\n\n allIdentifiers.add(newName);\n\n if (newName !== name) {\n stats.rename(name, newName, getline(declarator));\n\n declarator.id.originalName = name;\n declarator.id.name = newName;\n\n // textchange var x => var x$1\n changes.push({\n start: declarator.id.range[0],\n end: declarator.id.range[1],\n str: newName,\n });\n }\n });\n\n // ast change const|let => var\n node.kind = \"var\";\n }\n }\n\n function renameReferences(node) {\n if (!node.$refToScope) {\n return;\n }\n var move = node.$refToScope.moves && node.$refToScope.moves.get(node.name);\n if (!move) {\n return;\n }\n node.$refToScope = move.scope;\n\n if (node.name !== move.name) {\n node.originalName = node.name;\n node.name = move.name;\n\n if (node.alterop) {\n // node has no range because it is the result of another alter operation\n var existingOp = null;\n for (var i = 0; i < changes.length; i++) {\n var op = changes[i];\n if (op.node === node) {\n existingOp = op;\n break;\n }\n }\n assert(existingOp);\n\n // modify op\n existingOp.str = move.name;\n } else {\n changes.push({\n start: node.range[0],\n end: node.range[1],\n str: move.name,\n });\n }\n }\n }\n\n traverse(ast, {pre: renameDeclarations});\n traverse(ast, {pre: renameReferences});\n ast.$scope.traverse({pre: function(scope) {\n delete scope.moves;\n }});\n}", "title": "" }, { "docid": "6cea210565f579787a8db33442d6fa7c", "score": "0.3894287", "text": "function visitTypeScript(node) {\n if (ts.hasModifier(node, 2 /* Ambient */) && ts.isStatement(node)) {\n // TypeScript ambient declarations are elided, but some comments may be preserved.\n // See the implementation of `getLeadingComments` in comments.ts for more details.\n return ts.createNotEmittedStatement(node);\n }\n switch (node.kind) {\n case 84 /* ExportKeyword */:\n case 79 /* DefaultKeyword */:\n // ES6 export and default modifiers are elided when inside a namespace.\n return currentNamespace ? undefined : node;\n case 114 /* PublicKeyword */:\n case 112 /* PrivateKeyword */:\n case 113 /* ProtectedKeyword */:\n case 117 /* AbstractKeyword */:\n case 76 /* ConstKeyword */:\n case 124 /* DeclareKeyword */:\n case 131 /* ReadonlyKeyword */:\n // TypeScript accessibility and readonly modifiers are elided.\n case 165 /* ArrayType */:\n case 166 /* TupleType */:\n case 164 /* TypeLiteral */:\n case 159 /* TypePredicate */:\n case 146 /* TypeParameter */:\n case 119 /* AnyKeyword */:\n case 122 /* BooleanKeyword */:\n case 136 /* StringKeyword */:\n case 133 /* NumberKeyword */:\n case 130 /* NeverKeyword */:\n case 105 /* VoidKeyword */:\n case 137 /* SymbolKeyword */:\n case 162 /* ConstructorType */:\n case 161 /* FunctionType */:\n case 163 /* TypeQuery */:\n case 160 /* TypeReference */:\n case 167 /* UnionType */:\n case 168 /* IntersectionType */:\n case 169 /* ParenthesizedType */:\n case 170 /* ThisType */:\n case 171 /* TypeOperator */:\n case 172 /* IndexedAccessType */:\n case 173 /* MappedType */:\n case 174 /* LiteralType */:\n // TypeScript type nodes are elided.\n case 158 /* IndexSignature */:\n // TypeScript index signatures are elided.\n case 148 /* Decorator */:\n // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration.\n case 232 /* TypeAliasDeclaration */:\n // TypeScript type-only declarations are elided.\n return undefined;\n case 150 /* PropertyDeclaration */:\n // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects\n return visitPropertyDeclaration(node);\n case 237 /* NamespaceExportDeclaration */:\n // TypeScript namespace export declarations are elided.\n return undefined;\n case 153 /* Constructor */:\n return visitConstructor(node);\n case 231 /* InterfaceDeclaration */:\n // TypeScript interfaces are elided, but some comments may be preserved.\n // See the implementation of `getLeadingComments` in comments.ts for more details.\n return ts.createNotEmittedStatement(node);\n case 230 /* ClassDeclaration */:\n // This is a class declaration with TypeScript syntax extensions.\n //\n // TypeScript class syntax extensions include:\n // - decorators\n // - optional `implements` heritage clause\n // - parameter property assignments in the constructor\n // - property declarations\n // - index signatures\n // - method overload signatures\n return visitClassDeclaration(node);\n case 200 /* ClassExpression */:\n // This is a class expression with TypeScript syntax extensions.\n //\n // TypeScript class syntax extensions include:\n // - decorators\n // - optional `implements` heritage clause\n // - parameter property assignments in the constructor\n // - property declarations\n // - index signatures\n // - method overload signatures\n return visitClassExpression(node);\n case 263 /* HeritageClause */:\n // This is a heritage clause with TypeScript syntax extensions.\n //\n // TypeScript heritage clause extensions include:\n // - `implements` clause\n return visitHeritageClause(node);\n case 202 /* ExpressionWithTypeArguments */:\n // TypeScript supports type arguments on an expression in an `extends` heritage clause.\n return visitExpressionWithTypeArguments(node);\n case 152 /* MethodDeclaration */:\n // TypeScript method declarations may have decorators, modifiers\n // or type annotations.\n return visitMethodDeclaration(node);\n case 154 /* GetAccessor */:\n // Get Accessors can have TypeScript modifiers, decorators, and type annotations.\n return visitGetAccessor(node);\n case 155 /* SetAccessor */:\n // Set Accessors can have TypeScript modifiers and type annotations.\n return visitSetAccessor(node);\n case 229 /* FunctionDeclaration */:\n // Typescript function declarations can have modifiers, decorators, and type annotations.\n return visitFunctionDeclaration(node);\n case 187 /* FunctionExpression */:\n // TypeScript function expressions can have modifiers and type annotations.\n return visitFunctionExpression(node);\n case 188 /* ArrowFunction */:\n // TypeScript arrow functions can have modifiers and type annotations.\n return visitArrowFunction(node);\n case 147 /* Parameter */:\n // This is a parameter declaration with TypeScript syntax extensions.\n //\n // TypeScript parameter declaration syntax extensions include:\n // - decorators\n // - accessibility modifiers\n // - the question mark (?) token for optional parameters\n // - type annotations\n // - this parameters\n return visitParameter(node);\n case 186 /* ParenthesizedExpression */:\n // ParenthesizedExpressions are TypeScript if their expression is a\n // TypeAssertion or AsExpression\n return visitParenthesizedExpression(node);\n case 185 /* TypeAssertionExpression */:\n case 203 /* AsExpression */:\n // TypeScript type assertions are removed, but their subtrees are preserved.\n return visitAssertionExpression(node);\n case 182 /* CallExpression */:\n return visitCallExpression(node);\n case 183 /* NewExpression */:\n return visitNewExpression(node);\n case 204 /* NonNullExpression */:\n // TypeScript non-null expressions are removed, but their subtrees are preserved.\n return visitNonNullExpression(node);\n case 233 /* EnumDeclaration */:\n // TypeScript enum declarations do not exist in ES6 and must be rewritten.\n return visitEnumDeclaration(node);\n case 209 /* VariableStatement */:\n // TypeScript namespace exports for variable statements must be transformed.\n return visitVariableStatement(node);\n case 227 /* VariableDeclaration */:\n return visitVariableDeclaration(node);\n case 234 /* ModuleDeclaration */:\n // TypeScript namespace declarations must be transformed.\n return visitModuleDeclaration(node);\n case 238 /* ImportEqualsDeclaration */:\n // TypeScript namespace or external module import.\n return visitImportEqualsDeclaration(node);\n default:\n ts.Debug.failBadSyntaxKind(node);\n return ts.visitEachChild(node, visitor, context);\n }\n }", "title": "" }, { "docid": "cf42ea089896c7e31a7311b585111897", "score": "0.38915414", "text": "function resolveAnonymousTypeMembers(type) {\n var symbol = type.symbol;\n if (type.target) {\n var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);\n var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);\n var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);\n var stringIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 0 /* String */), type.mapper);\n var numberIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 1 /* Number */), type.mapper);\n setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n }\n else if (symbol.flags & 2048 /* TypeLiteral */) {\n var members = getMembersOfSymbol(symbol);\n var callSignatures = getSignaturesOfSymbol(members.get(\"__call\" /* Call */));\n var constructSignatures = getSignaturesOfSymbol(members.get(\"__new\" /* New */));\n var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);\n var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);\n setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n }\n else {\n // Combinations of function, class, enum and module\n var members = emptySymbols;\n var stringIndexInfo = undefined;\n if (symbol.exports) {\n members = getExportsOfSymbol(symbol);\n }\n setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined);\n if (symbol.flags & 32 /* Class */) {\n var classType = getDeclaredTypeOfClassOrInterface(symbol);\n var baseConstructorType = getBaseConstructorTypeOfClass(classType);\n if (baseConstructorType.flags & (65536 /* Object */ | 262144 /* Intersection */ | 1081344 /* TypeVariable */)) {\n members = ts.createSymbolTable(getNamedMembers(members));\n addInheritedMembers(members, getPropertiesOfType(baseConstructorType));\n }\n else if (baseConstructorType === anyType) {\n stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false);\n }\n }\n var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined;\n setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);\n // We resolve the members before computing the signatures because a signature may use\n // typeof with a qualified name expression that circularly references the type we are\n // in the process of resolving (see issue #6072). The temporarily empty signature list\n // will never be observed because a qualified name can't reference signatures.\n if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {\n type.callSignatures = getSignaturesOfSymbol(symbol);\n }\n // And likewise for construct signatures for classes\n if (symbol.flags & 32 /* Class */) {\n var classType = getDeclaredTypeOfClassOrInterface(symbol);\n var constructSignatures = getSignaturesOfSymbol(symbol.members.get(\"__constructor\" /* Constructor */));\n if (!constructSignatures.length) {\n constructSignatures = getDefaultConstructSignatures(classType);\n }\n type.constructSignatures = constructSignatures;\n }\n }\n }", "title": "" }, { "docid": "7e545042a250131314258b8f0065cc83", "score": "0.38896623", "text": "function getPropertySymbolsFromContextualType(node, checker) {\n var contextualType = checker.getContextualType(node.parent);\n var name = getNameFromObjectLiteralElement(node);\n var symbol = contextualType && name && contextualType.getProperty(name);\n return symbol ? [symbol] : contextualType && contextualType.flags & 131072 /* Union */ ? ts.mapDefined(contextualType.types, function (t) {\n return t.getProperty(name);\n }) : ts.emptyArray;\n }", "title": "" }, { "docid": "65f1d5ef2952a4aa5f5c3063c75e16c9", "score": "0.38885635", "text": "toString () {\n\t\tvar declarations = map(identity, this.declarations, this.sort)\n\t\treturn declarations.length ? 'var ' + declarations.join('\\n\\t, ') + '\\n' : ''\n\t}", "title": "" }, { "docid": "6fc0b41d495f9fb88f4bd7ea5d36f0c6", "score": "0.38857377", "text": "function importCustomPropertiesFromCSSAST(root) {\n return getCustomProperties(root, {\n preserve: true\n });\n}", "title": "" }, { "docid": "abf20166d14cd0e548da31217b97807e", "score": "0.3884924", "text": "function parsedeclarations(index) { // take a string from the munged array and parse it into an object of property: value pairs\n var str = munged[index].replace(/^{|}$/g, ''); // find the string and remove the surrounding braces\n str = munge(str); // make sure any internal braces or strings are escaped\n var parsed = {};\n $.each(str.split(';'), function (i, decl) {\n decl = decl.split(':');\n if(decl.length < 2) return;\n parsed[restore(decl[0])] = restore(decl.slice(1).join(':'));\n });\n return parsed;\n }", "title": "" }, { "docid": "90d05cf66c067ae4b450052690bd0fd1", "score": "0.38793176", "text": "function getPropertySymbolsFromContextualType(node, typeChecker) {\n var objectLiteral = node.parent;\n var contextualType = typeChecker.getContextualType(objectLiteral);\n var name = getNameFromObjectLiteralElement(node);\n if (name && contextualType) {\n var result_4 = [];\n var symbol = contextualType.getProperty(name);\n if (symbol) {\n result_4.push(symbol);\n }\n if (contextualType.flags & 65536 /* Union */) {\n ts.forEach(contextualType.types, function (t) {\n var symbol = t.getProperty(name);\n if (symbol) {\n result_4.push(symbol);\n }\n });\n }\n return result_4;\n }\n return undefined;\n }", "title": "" }, { "docid": "1fcd1a244e9ab9e1190438b74d905045", "score": "0.38755667", "text": "function axapta(hljs) {\n const BUILT_IN_KEYWORDS = [\n 'anytype',\n 'boolean',\n 'byte',\n 'char',\n 'container',\n 'date',\n 'double',\n 'enum',\n 'guid',\n 'int',\n 'int64',\n 'long',\n 'real',\n 'short',\n 'str',\n 'utcdatetime',\n 'var'\n ];\n\n const LITERAL_KEYWORDS = [\n 'default',\n 'false',\n 'null',\n 'true'\n ];\n\n const NORMAL_KEYWORDS = [\n 'abstract',\n 'as',\n 'asc',\n 'avg',\n 'break',\n 'breakpoint',\n 'by',\n 'byref',\n 'case',\n 'catch',\n 'changecompany',\n 'class',\n 'client',\n 'client',\n 'common',\n 'const',\n 'continue',\n 'count',\n 'crosscompany',\n 'delegate',\n 'delete_from',\n 'desc',\n 'display',\n 'div',\n 'do',\n 'edit',\n 'else',\n 'eventhandler',\n 'exists',\n 'extends',\n 'final',\n 'finally',\n 'firstfast',\n 'firstonly',\n 'firstonly1',\n 'firstonly10',\n 'firstonly100',\n 'firstonly1000',\n 'flush',\n 'for',\n 'forceliterals',\n 'forcenestedloop',\n 'forceplaceholders',\n 'forceselectorder',\n 'forupdate',\n 'from',\n 'generateonly',\n 'group',\n 'hint',\n 'if',\n 'implements',\n 'in',\n 'index',\n 'insert_recordset',\n 'interface',\n 'internal',\n 'is',\n 'join',\n 'like',\n 'maxof',\n 'minof',\n 'mod',\n 'namespace',\n 'new',\n 'next',\n 'nofetch',\n 'notexists',\n 'optimisticlock',\n 'order',\n 'outer',\n 'pessimisticlock',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'readonly',\n 'repeatableread',\n 'retry',\n 'return',\n 'reverse',\n 'select',\n 'server',\n 'setting',\n 'static',\n 'sum',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'ttsabort',\n 'ttsbegin',\n 'ttscommit',\n 'unchecked',\n 'update_recordset',\n 'using',\n 'validtimestate',\n 'void',\n 'where',\n 'while'\n ];\n\n const KEYWORDS = {\n keyword: NORMAL_KEYWORDS.join(' '),\n built_in: BUILT_IN_KEYWORDS.join(' '),\n literal: LITERAL_KEYWORDS.join(' ')\n };\n\n return {\n name: 'X++',\n aliases: ['x++'],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: /\\{/,\n excludeEnd: true,\n illegal: ':',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "1fcd1a244e9ab9e1190438b74d905045", "score": "0.38755667", "text": "function axapta(hljs) {\n const BUILT_IN_KEYWORDS = [\n 'anytype',\n 'boolean',\n 'byte',\n 'char',\n 'container',\n 'date',\n 'double',\n 'enum',\n 'guid',\n 'int',\n 'int64',\n 'long',\n 'real',\n 'short',\n 'str',\n 'utcdatetime',\n 'var'\n ];\n\n const LITERAL_KEYWORDS = [\n 'default',\n 'false',\n 'null',\n 'true'\n ];\n\n const NORMAL_KEYWORDS = [\n 'abstract',\n 'as',\n 'asc',\n 'avg',\n 'break',\n 'breakpoint',\n 'by',\n 'byref',\n 'case',\n 'catch',\n 'changecompany',\n 'class',\n 'client',\n 'client',\n 'common',\n 'const',\n 'continue',\n 'count',\n 'crosscompany',\n 'delegate',\n 'delete_from',\n 'desc',\n 'display',\n 'div',\n 'do',\n 'edit',\n 'else',\n 'eventhandler',\n 'exists',\n 'extends',\n 'final',\n 'finally',\n 'firstfast',\n 'firstonly',\n 'firstonly1',\n 'firstonly10',\n 'firstonly100',\n 'firstonly1000',\n 'flush',\n 'for',\n 'forceliterals',\n 'forcenestedloop',\n 'forceplaceholders',\n 'forceselectorder',\n 'forupdate',\n 'from',\n 'generateonly',\n 'group',\n 'hint',\n 'if',\n 'implements',\n 'in',\n 'index',\n 'insert_recordset',\n 'interface',\n 'internal',\n 'is',\n 'join',\n 'like',\n 'maxof',\n 'minof',\n 'mod',\n 'namespace',\n 'new',\n 'next',\n 'nofetch',\n 'notexists',\n 'optimisticlock',\n 'order',\n 'outer',\n 'pessimisticlock',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'readonly',\n 'repeatableread',\n 'retry',\n 'return',\n 'reverse',\n 'select',\n 'server',\n 'setting',\n 'static',\n 'sum',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'ttsabort',\n 'ttsbegin',\n 'ttscommit',\n 'unchecked',\n 'update_recordset',\n 'using',\n 'validtimestate',\n 'void',\n 'where',\n 'while'\n ];\n\n const KEYWORDS = {\n keyword: NORMAL_KEYWORDS.join(' '),\n built_in: BUILT_IN_KEYWORDS.join(' '),\n literal: LITERAL_KEYWORDS.join(' ')\n };\n\n return {\n name: 'X++',\n aliases: ['x++'],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: /\\{/,\n excludeEnd: true,\n illegal: ':',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "1e4aa79bc60914510bdf3c79d33799df", "score": "0.38755667", "text": "function axapta(hljs) {\n const BUILT_IN_KEYWORDS = [\n 'anytype',\n 'boolean',\n 'byte',\n 'char',\n 'container',\n 'date',\n 'double',\n 'enum',\n 'guid',\n 'int',\n 'int64',\n 'long',\n 'real',\n 'short',\n 'str',\n 'utcdatetime',\n 'var'\n ];\n\n const LITERAL_KEYWORDS = [\n 'default',\n 'false',\n 'null',\n 'true'\n ];\n\n const NORMAL_KEYWORDS = [\n 'abstract',\n 'as',\n 'asc',\n 'avg',\n 'break',\n 'breakpoint',\n 'by',\n 'byref',\n 'case',\n 'catch',\n 'changecompany',\n 'class',\n 'client',\n 'client',\n 'common',\n 'const',\n 'continue',\n 'count',\n 'crosscompany',\n 'delegate',\n 'delete_from',\n 'desc',\n 'display',\n 'div',\n 'do',\n 'edit',\n 'else',\n 'eventhandler',\n 'exists',\n 'extends',\n 'final',\n 'finally',\n 'firstfast',\n 'firstonly',\n 'firstonly1',\n 'firstonly10',\n 'firstonly100',\n 'firstonly1000',\n 'flush',\n 'for',\n 'forceliterals',\n 'forcenestedloop',\n 'forceplaceholders',\n 'forceselectorder',\n 'forupdate',\n 'from',\n 'generateonly',\n 'group',\n 'hint',\n 'if',\n 'implements',\n 'in',\n 'index',\n 'insert_recordset',\n 'interface',\n 'internal',\n 'is',\n 'join',\n 'like',\n 'maxof',\n 'minof',\n 'mod',\n 'namespace',\n 'new',\n 'next',\n 'nofetch',\n 'notexists',\n 'optimisticlock',\n 'order',\n 'outer',\n 'pessimisticlock',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'readonly',\n 'repeatableread',\n 'retry',\n 'return',\n 'reverse',\n 'select',\n 'server',\n 'setting',\n 'static',\n 'sum',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'ttsabort',\n 'ttsbegin',\n 'ttscommit',\n 'unchecked',\n 'update_recordset',\n 'using',\n 'validtimestate',\n 'void',\n 'where',\n 'while'\n ];\n\n const KEYWORDS = {\n keyword: NORMAL_KEYWORDS,\n built_in: BUILT_IN_KEYWORDS,\n literal: LITERAL_KEYWORDS\n };\n\n return {\n name: 'X++',\n aliases: ['x++'],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: /\\{/,\n excludeEnd: true,\n illegal: ':',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "b78fab872d1446d1df1f29b9802b6038", "score": "0.3860042", "text": "toString() {\n let built = ''\n\n for (const prop of Object.keys(this.decls)) {\n let parsed\n\n try {\n parsed = postcss.parse(`${prop}:${this.decls[prop]}`, {\n from: undefined,\n })\n } catch (e) {\n // A declaration that have value it cannot parse will ignore.\n }\n\n if (parsed) {\n parsed.each((node) => {\n if (node.type !== 'decl' || node.prop !== prop) node.remove()\n })\n\n built += `${parsed.toString()};`\n }\n }\n\n return built\n }", "title": "" }, { "docid": "30f25bb193fed0a8ecd9c1c07f7ee339", "score": "0.38565475", "text": "function getProperties(props) {\n var re = [];\n\n jQuery.each(props, function(key) {\n key = jQuery.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = jQuery.transit.propertyMap[key] || jQuery.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if (jQuery.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "59bd8b2bd7ce37994b1e4f790183df09", "score": "0.38532478", "text": "function stringifyProperties(properties) {\n\t var result = [];\n\t var _loop_1 = function (name, value) {\n\t if (value != null) {\n\t if (Array.isArray(value)) {\n\t value.forEach(function (value) {\n\t value && result.push(styleToString(name, value));\n\t });\n\t }\n\t else {\n\t result.push(styleToString(name, value));\n\t }\n\t }\n\t };\n\t for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {\n\t var _a = properties_1[_i], name = _a[0], value = _a[1];\n\t _loop_1(name, value);\n\t }\n\t return result.join(';');\n\t}", "title": "" }, { "docid": "7246f2106bff12680da0363e09f1c3b8", "score": "0.38527972", "text": "function cfnFunctionIAMPolicyDocumentPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_IAMPolicyDocumentPropertyValidator(properties).assertSuccess();\n return {\n Statement: cdk.objectToCloudFormation(properties.statement),\n Version: cdk.stringToCloudFormation(properties.version),\n };\n}", "title": "" }, { "docid": "5057bedd0b471c4133872c71a45969f3", "score": "0.38415304", "text": "visitFunctionDeclaration(tree) {\n this.visitList(tree.annotations);\n }", "title": "" }, { "docid": "f6a4c03d521a455895662143d92a2ffe", "score": "0.38400406", "text": "function convertProperty([key, value]) {\n if (key === 'uppercase') {\n return null;\n }\n\n if (key === 'color' && value in colors) {\n return j.property(\n 'init',\n j.literal(key),\n j.memberExpression(j.identifier('colors'), j.identifier(value)),\n );\n }\n\n return j.property('init', j.identifier(key), j.literal(value));\n }", "title": "" }, { "docid": "e519e386e484c6996f567829bc9a056b", "score": "0.383892", "text": "function to_prop_structure(prop_schema, lang, all) {\n var prop_structure = minimal_prop_structure(prop_schema, lang);\n var ect = prop_schema.expected_type;\n var subprops = ect.properties || [];\n if (subprops.length) {\n prop_structure.properties = [];\n var visible_subprops = h.get_visible_subprops(prop_schema, all);\n visible_subprops.forEach(function(subprop) {\n prop_structure.properties.push(to_prop_structure(subprop, lang));\n });\n }\n return prop_structure;\n}", "title": "" }, { "docid": "4b07018f0635b051151c1e7636491219", "score": "0.38379905", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) {\n re.push(key);\n }\n });\n\n return re;\n }", "title": "" }, { "docid": "8caa02a5682d2f30fc43cb378f594e20", "score": "0.38366905", "text": "function declareAsterixCodes(astlib) \n{\n for (var key in astlib)\n {\n \tif (key.startsWith(\"EXPORT_\"))\n \t{\n \t\tlet str = key.slice(7) + \"=\" + astlib[key];\n \t\teval(str);\n \t}\n }\n}", "title": "" }, { "docid": "1abe035fe1c4497268782427e5f525a0", "score": "0.3836476", "text": "function decoratorDownlevelTransformer(typeChecker, diagnostics) {\n return (context) => {\n const parameterTypeSymbols = new Set();\n /**\n * Converts an EntityName (from a type annotation) to an expression (accessing a value).\n *\n * For a given ts.EntityName, this walks depth first to find the leftmost ts.Identifier, then\n * converts the path into property accesses.\n *\n */\n function entityNameToExpression(name) {\n if (ts.isIdentifier(name)) {\n const typeSymbol = typeChecker.getSymbolAtLocation(name);\n if (typeSymbol) {\n parameterTypeSymbols.add(typeSymbol);\n }\n // Based on TS's strategy to allow the checker to reach this identifier\n // tslint:disable-next-line:max-line-length\n // https://github.com/microsoft/TypeScript/blob/7f47a08a5e9874f0f97a667bd81eebddec61247c/src/compiler/transformers/ts.ts#L2093\n const exp = ts.getMutableClone(name);\n exp.flags &= ~ts.NodeFlags.Synthesized;\n exp.original = undefined;\n exp.parent = ts.getParseTreeNode(name.getSourceFile());\n return exp;\n }\n const ref = entityNameToExpression(name.left);\n if (!ref) {\n return undefined;\n }\n return ts.createPropertyAccess(ref, name.right);\n }\n function classMemberVisitor(node) {\n if (!ts.isConstructorDeclaration(node) || !node.body) {\n return visitor(node);\n }\n const parametersInfo = [];\n for (const param of node.parameters) {\n const paramInfo = { decorators: [], type: null };\n for (const decorator of param.decorators || []) {\n paramInfo.decorators.push(decorator);\n }\n if (param.type) {\n // param has a type provided, e.g. \"foo: Bar\".\n // The type will be emitted as a value expression in entityNameToExpression, which takes\n // care not to emit anything for types that cannot be expressed as a value (e.g.\n // interfaces).\n paramInfo.type = param.type;\n }\n parametersInfo.push(paramInfo);\n }\n if (parametersInfo.length > 0) {\n const ctorProperty = createCtorParametersClassProperty(diagnostics, entityNameToExpression, parametersInfo, typeChecker);\n return [node, ctorProperty];\n }\n else {\n return node;\n }\n }\n function visitor(node) {\n if (ts.isClassDeclaration(node) && node.decorators && node.decorators.length > 0) {\n return ts.updateClassDeclaration(node, node.decorators, node.modifiers, node.name, node.typeParameters, node.heritageClauses, ts.visitNodes(node.members, classMemberVisitor));\n }\n else {\n return ts.visitEachChild(node, visitor, context);\n }\n }\n return (sf) => {\n parameterTypeSymbols.clear();\n return ts.visitEachChild(visitor(sf), function visitImports(node) {\n if ((ts.isImportSpecifier(node) || ts.isNamespaceImport(node) || ts.isImportClause(node)) &&\n node.name) {\n const importSymbol = typeChecker.getSymbolAtLocation(node.name);\n if (importSymbol && parameterTypeSymbols.has(importSymbol)) {\n // Using a clone prevents TS from removing the import specifier\n return ts.getMutableClone(node);\n }\n }\n return ts.visitEachChild(node, visitImports, context);\n }, context);\n };\n };\n}", "title": "" }, { "docid": "ff5a51998066bf8eb38a88b9b57f19c2", "score": "0.3835507", "text": "static get properties() {\n return {\n dataSource: {\n type: String,\n attribute: \"data-source\",\n },\n __auto: {\n type: Boolean,\n },\n data: {\n type: Array,\n },\n method: {\n type: String,\n },\n search: {\n type: String,\n },\n results: {\n type: Array,\n },\n noStopWords: {\n type: Boolean,\n attribute: \"no-stop-words\",\n },\n fields: {\n type: Array,\n },\n indexNoStopWords: {\n type: Object,\n },\n index: {\n type: Object,\n },\n __lunrLoaded: {\n type: Boolean,\n },\n limit: {\n type: Number,\n },\n minScore: {\n type: Number,\n },\n log: {\n type: Boolean,\n },\n demo: {\n type: Boolean,\n reflect: true,\n },\n };\n }", "title": "" }, { "docid": "2b9ce3205a7044ad104d9c761a9c8803", "score": "0.3822983", "text": "function analyzeDeclaration(node) {\n var idToken = node.children[1].value;\n var typeToken = node.children[0].value;\n\n trace(\"Declaration: Adding symbol '\" + idToken.value + \"' of type '\" + typeToken.value + \"'\",\n idToken.line);\n\n try {\n // Replace token with symbol\n node.children[1].value = _scope.addSymbol(idToken.value, typeToken.value, idToken.line);\n } catch (e) {\n // Variable declared twice.\n Compiler.addError(e, idToken.line);\n }\n}", "title": "" }, { "docid": "9794675ab5509ce03d3bb611ad03bc43", "score": "0.38030756", "text": "normalizeAggregateColumns(columns, alias) {\n if (columns.constructor === Object) {\n return Object.keys(columns).reduce((result, key) => {\n const value = columns[key];\n result[key] =\n typeof value === 'string' ? this.resolveKey(value) : this.transformValue(value);\n return result;\n }, {});\n }\n if (!alias) {\n return columns;\n }\n return {\n [alias]: typeof columns === 'string' ? this.resolveKey(columns) : this.transformValue(columns),\n };\n }", "title": "" }, { "docid": "feceb9ee193058ac6c5b9ceb22520033", "score": "0.38006783", "text": "function hastPropertiesToJsxProps(hastProperties, elementName) {\n return Object.keys(hastProperties).reduce((result, hastName) => {\n let value = hastProperties[hastName];\n\n if (value === undefined || (typeof value == 'number' && isNaN(value))) {\n return result;\n }\n\n const htmlName = hastPropertyNameToHtmlName(hastName);\n const info = propertyInformation.find(propertyInformation.html, htmlName);\n const propName = reactAttrConverter(htmlName);\n\n // Transform input values to defaultX props, to allow for changes.\n if (elementName === 'input' && propName === 'value') {\n result.defaultValue = value;\n return result;\n }\n if (elementName === 'input' && propName === 'checked') {\n result.defaultChecked = value;\n return result;\n }\n\n // Transform style string values to JSX-ready objects.\n if (propName === 'style') {\n result.style = cssToJs(value, {\n inlineCharacterLimit: Infinity,\n singleQuotes: false\n });\n return result;\n }\n\n // HAST stores list values as actual arrays, but JSX needs\n // them to be strings. The property-information module\n // provides the information we need to determine how to\n // stringify HAST's arrays.\n if (Array.isArray(value)) {\n const punc = info && info.commaSeparated ? ', ' : ' ';\n value = value.join(punc);\n }\n\n // If a property value is supposed to be numeric but is a string,\n // and we can safely coerce it to a number, do that.\n if (\n info &&\n info.numeric &&\n typeof value === 'string' &&\n isNumberyString(value)\n ) {\n result[propName] = Number(value);\n }\n\n result[propName] = value;\n return result;\n }, {});\n}", "title": "" }, { "docid": "d11b505a003860bb7fff0578a1cb3429", "score": "0.38005576", "text": "function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {\n var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/true);\n if (type) {\n if (reportErrors) {\n reportErrorsFromWidening(declaration, type);\n }\n // During a normal type check we'll never get to here with a property assignment (the check of the containing\n // object literal uses a different path). We exclude widening only so that language services and type verification\n // tools see the actual type.\n if (declaration.kind === 259 /* PropertyAssignment */) {\n return type;\n }\n return getWidenedType(type);\n }\n // Rest parameters default to type any[], other parameters default to type any\n type = declaration.dotDotDotToken ? anyArrayType : anyType;\n // Report implicit any errors unless this is a private property within an ambient declaration\n if (reportErrors && compilerOptions.noImplicitAny) {\n if (!declarationBelongsToPrivateAmbientMember(declaration)) {\n reportImplicitAnyError(declaration, type);\n }\n }\n return type;\n }", "title": "" }, { "docid": "6b3e34814e1d2c1e3ed08fce5646a169", "score": "0.37989247", "text": "function visitTypeScript(node) {\n if (ts.hasModifier(node, 2 /* Ambient */) && ts.isStatement(node)) {\n // TypeScript ambient declarations are elided, but some comments may be preserved.\n // See the implementation of `getLeadingComments` in comments.ts for more details.\n return ts.createNotEmittedStatement(node);\n }\n switch (node.kind) {\n case 84 /* ExportKeyword */:\n case 79 /* DefaultKeyword */:\n // ES6 export and default modifiers are elided when inside a namespace.\n return currentNamespace ? undefined : node;\n case 114 /* PublicKeyword */:\n case 112 /* PrivateKeyword */:\n case 113 /* ProtectedKeyword */:\n case 117 /* AbstractKeyword */:\n case 76 /* ConstKeyword */:\n case 124 /* DeclareKeyword */:\n case 131 /* ReadonlyKeyword */:\n // TypeScript accessibility and readonly modifiers are elided.\n case 165 /* ArrayType */:\n case 166 /* TupleType */:\n case 164 /* TypeLiteral */:\n case 159 /* TypePredicate */:\n case 146 /* TypeParameter */:\n case 119 /* AnyKeyword */:\n case 122 /* BooleanKeyword */:\n case 136 /* StringKeyword */:\n case 133 /* NumberKeyword */:\n case 130 /* NeverKeyword */:\n case 105 /* VoidKeyword */:\n case 137 /* SymbolKeyword */:\n case 162 /* ConstructorType */:\n case 161 /* FunctionType */:\n case 163 /* TypeQuery */:\n case 160 /* TypeReference */:\n case 167 /* UnionType */:\n case 168 /* IntersectionType */:\n case 169 /* ParenthesizedType */:\n case 170 /* ThisType */:\n case 171 /* TypeOperator */:\n case 172 /* IndexedAccessType */:\n case 173 /* MappedType */:\n case 174 /* LiteralType */:\n // TypeScript type nodes are elided.\n case 158 /* IndexSignature */:\n // TypeScript index signatures are elided.\n case 148 /* Decorator */:\n // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration.\n case 232 /* TypeAliasDeclaration */:\n // TypeScript type-only declarations are elided.\n return undefined;\n case 150 /* PropertyDeclaration */:\n // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects\n return visitPropertyDeclaration(node);\n case 237 /* NamespaceExportDeclaration */:\n // TypeScript namespace export declarations are elided.\n return undefined;\n case 153 /* Constructor */:\n return visitConstructor(node);\n case 231 /* InterfaceDeclaration */:\n // TypeScript interfaces are elided, but some comments may be preserved.\n // See the implementation of `getLeadingComments` in comments.ts for more details.\n return ts.createNotEmittedStatement(node);\n case 230 /* ClassDeclaration */:\n // This is a class declaration with TypeScript syntax extensions.\n //\n // TypeScript class syntax extensions include:\n // - decorators\n // - optional `implements` heritage clause\n // - parameter property assignments in the constructor\n // - property declarations\n // - index signatures\n // - method overload signatures\n return visitClassDeclaration(node);\n case 200 /* ClassExpression */:\n // This is a class expression with TypeScript syntax extensions.\n //\n // TypeScript class syntax extensions include:\n // - decorators\n // - optional `implements` heritage clause\n // - parameter property assignments in the constructor\n // - property declarations\n // - index signatures\n // - method overload signatures\n return visitClassExpression(node);\n case 263 /* HeritageClause */:\n // This is a heritage clause with TypeScript syntax extensions.\n //\n // TypeScript heritage clause extensions include:\n // - `implements` clause\n return visitHeritageClause(node);\n case 202 /* ExpressionWithTypeArguments */:\n // TypeScript supports type arguments on an expression in an `extends` heritage clause.\n return visitExpressionWithTypeArguments(node);\n case 152 /* MethodDeclaration */:\n // TypeScript method declarations may have decorators, modifiers\n // or type annotations.\n return visitMethodDeclaration(node);\n case 154 /* GetAccessor */:\n // Get Accessors can have TypeScript modifiers, decorators, and type annotations.\n return visitGetAccessor(node);\n case 155 /* SetAccessor */:\n // Set Accessors can have TypeScript modifiers and type annotations.\n return visitSetAccessor(node);\n case 229 /* FunctionDeclaration */:\n // Typescript function declarations can have modifiers, decorators, and type annotations.\n return visitFunctionDeclaration(node);\n case 187 /* FunctionExpression */:\n // TypeScript function expressions can have modifiers and type annotations.\n return visitFunctionExpression(node);\n case 188 /* ArrowFunction */:\n // TypeScript arrow functions can have modifiers and type annotations.\n return visitArrowFunction(node);\n case 147 /* Parameter */:\n // This is a parameter declaration with TypeScript syntax extensions.\n //\n // TypeScript parameter declaration syntax extensions include:\n // - decorators\n // - accessibility modifiers\n // - the question mark (?) token for optional parameters\n // - type annotations\n // - this parameters\n return visitParameter(node);\n case 186 /* ParenthesizedExpression */:\n // ParenthesizedExpressions are TypeScript if their expression is a\n // TypeAssertion or AsExpression\n return visitParenthesizedExpression(node);\n case 185 /* TypeAssertionExpression */:\n case 203 /* AsExpression */:\n // TypeScript type assertions are removed, but their subtrees are preserved.\n return visitAssertionExpression(node);\n case 182 /* CallExpression */:\n return visitCallExpression(node);\n case 183 /* NewExpression */:\n return visitNewExpression(node);\n case 204 /* NonNullExpression */:\n // TypeScript non-null expressions are removed, but their subtrees are preserved.\n return visitNonNullExpression(node);\n case 233 /* EnumDeclaration */:\n // TypeScript enum declarations do not exist in ES6 and must be rewritten.\n return visitEnumDeclaration(node);\n case 209 /* VariableStatement */:\n // TypeScript namespace exports for variable statements must be transformed.\n return visitVariableStatement(node);\n case 227 /* VariableDeclaration */:\n return visitVariableDeclaration(node);\n case 234 /* ModuleDeclaration */:\n // TypeScript namespace declarations must be transformed.\n return visitModuleDeclaration(node);\n case 238 /* ImportEqualsDeclaration */:\n // TypeScript namespace or external module import.\n return visitImportEqualsDeclaration(node);\n default:\n ts.Debug.failBadSyntaxKind(node);\n return ts.visitEachChild(node, visitor, context);\n }\n }", "title": "" }, { "docid": "f68319098b73d1a62ae8f99239a4545f", "score": "0.37985453", "text": "function getProperties(props) {\n\t var re = [];\n\n\t $.each(props, function(key) {\n\t key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n\t key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n\t key = uncamel(key); // Convert back to dasherized\n\n\t // Get vendor specify propertie\n\t if (support[key])\n\t key = uncamel(support[key]);\n\n\t if ($.inArray(key, re) === -1) { re.push(key); }\n\t });\n\n\t return re;\n\t }", "title": "" }, { "docid": "ba330b6fc57e394c64fcbc189ff5c6af", "score": "0.37971473", "text": "function snapsjot_unify_object_types(type1, type2) {\n\n var type = { \"@final\": true };\n\n if (snapsjot_distinct_object_types(type1, type2))\n return [[type1, type2]];\n\n for (var prop in type1) {\n\n if (prop.charCodeAt(0) !== 0x40 /*@prop*/) {\n\n if (type2.hasOwnProperty(prop)) {\n\n type[prop] = snapsjot_unify_types(type1[prop], type2[prop]);\n\ttype2[prop] = null;\n\n } else if (prop.charCodeAt(prop.length - 1) === 0x3F /*prop?*/) {\n\n var prop2 = prop.substring(0, prop.length - 1);\n\n if (type2.hasOwnProperty(prop2)) {\n\n type[prop] = snapsjot_unify_types(type1[prop], type2[prop2]);\n\t type2[prop2] = null;\n\n\t} else {\n\n\t type[prop] = type1[prop];\n\n\t}\n\n } else {\n\n var prop2 = prop + \"?\";\n\n if (type2.hasOwnProperty(prop2)) {\n\n type[prop2] = snapsjot_unify_types(type1[prop], type2[prop2]);\n\t type2[prop2] = null;\n\n\t} else {\n\n\t type[prop2] = type1[prop];\n\n\t}\n\n }\n\n }\n\n }\n\n for (var prop in type2) {\n\n if (type2.hasOwnProperty(prop) && type2[prop] !== null) {\n\n if (prop.charCodeAt(0) !== 0x40 /*@prop*/) {\n\n\tif (prop.charCodeAt(prop.length - 1) === 0x3F /*prop?*/)\n\t type[prop] = type2[prop];\n\telse\n\t type[prop + \"?\"] = type2[prop];\n\n }\n\n }\n\n }\n\n return type;\n\n}", "title": "" }, { "docid": "a9d5fe9141c27018e92c7ffd210dd5c1", "score": "0.3791166", "text": "function configureAnalyzer(options) {\n const urlResolver = new polymer_analyzer_1.PackageUrlResolver();\n const urlLoader = new polymer_analyzer_1.InMemoryOverlayUrlLoader(new polymer_analyzer_1.FsUrlLoader(options.inDir));\n for (const [url, contents] of special_casing_1.polymerFileOverrides) {\n urlLoader.urlContentsMap.set(urlResolver.resolve(url), contents);\n urlLoader.urlContentsMap.set(urlResolver.resolve(`../polymer/${url}`), contents);\n }\n return new polymer_analyzer_1.Analyzer({\n urlLoader,\n urlResolver,\n });\n}", "title": "" }, { "docid": "0ef957be1b9a267632b69cfb2891acd5", "score": "0.37886983", "text": "function getProperties(props) {\n var re = [];\n\n jQuery.each(props, function(key) {\n key = jQuery.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = jQuery.transit.propertyMap[key] || jQuery.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if (jQuery.inArray(key, re) === -1) {\n re.push(key);\n }\n });\n\n return re;\n }", "title": "" }, { "docid": "dab67b74ff4d41bb754efc11b7b7367f", "score": "0.37833688", "text": "function cfnIntegrationSalesforceSourcePropertiesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnIntegration_SalesforceSourcePropertiesPropertyValidator(properties).assertSuccess();\n return {\n EnableDynamicFieldUpdate: cdk.booleanToCloudFormation(properties.enableDynamicFieldUpdate),\n IncludeDeletedRecords: cdk.booleanToCloudFormation(properties.includeDeletedRecords),\n Object: cdk.stringToCloudFormation(properties.object),\n };\n}", "title": "" }, { "docid": "890ab30b9bb4086d704b40763e21afb7", "score": "0.37750039", "text": "adaptCompilerOptions(source) {\n const compilerOptions = Object.assign({}, source);\n compilerOptions.sourceMap = this.produceSourceMaps;\n compilerOptions.inlineSourceMap = false;\n compilerOptions.declaration = false;\n return compilerOptions;\n }", "title": "" }, { "docid": "734ec75e34299d5385218442eefb4d45", "score": "0.37742653", "text": "function extractNodeProperties(properties, allBaseProperties, loopbackRelations) {\n const nodeProperties = [];\n\n Object.keys(properties).forEach((propertyName) => {\n if (allBaseProperties[propertyName]) {\n return;\n }\n const property = properties[propertyName];\n const nodeProperty = {\n name: propertyName,\n };\n if (Array.isArray(property.type)) {\n if (property.type[0].name === 'ModelConstructor') {\n nodeProperty.type = `${property.type[0].modelName}\\\\[\\\\]`;\n } else {\n // check if it's a referencesMany\n nodeProperty.type = getNodePropertyTypeFromReferencesMany(propertyName, loopbackRelations);\n // if it's not a referencesMany\n if (!nodeProperty.type) {\n nodeProperty.type = `${property.type[0].name}\\\\[\\\\]`;\n }\n }\n } else if (property.type.name === 'ModelConstructor') {\n if (property.type.settings.anonymous) {\n nodeProperty.type = 'null';\n } else {\n /**\n * This is the case of the embedded relations and the unresolved types\n * (i.e. with property.type.settings.unresolved === true)\n */\n nodeProperty.type = property.type.modelName;\n }\n } else {\n nodeProperty.type = property.type.name;\n }\n\n nodeProperties.push(nodeProperty);\n });\n\n return nodeProperties;\n}", "title": "" }, { "docid": "7f3907bfd09ca64aed389c8660f18239", "score": "0.3765386", "text": "upgradeProperties() {\n this.constructor.observedAttributes.forEach(prop => {\n // eslint-disable-next-line no-prototype-builtins\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n if (value) {\n this[prop] = value;\n }\n }\n });\n }", "title": "" }, { "docid": "890ffd57155a1b91ada235e09e24585d", "score": "0.37616298", "text": "function typewriterLibraryProperties(args, cfg = undefined) {\n return __awaiter(this, void 0, void 0, function* () {\n // In CI environments, or if there is no internet, we may not be able to execute the\n // the token script.\n let tokenMethod = undefined;\n try {\n tokenMethod = yield config_1.getTokenMethod(cfg, args.config);\n }\n catch (_a) { }\n // Attempt to read the name of the Tracking Plan from a local `plan.json`.\n // If this fails, that's fine -- we'll still have the id from the config.\n let trackingPlanName = '';\n try {\n if (cfg && cfg.trackingPlans.length > 0) {\n const tp = yield api_1.loadTrackingPlan(args.config, cfg.trackingPlans[0]);\n if (tp) {\n trackingPlanName = tp.display_name;\n }\n }\n }\n catch (_b) { }\n return {\n version: package_json_1.version,\n client: cfg && {\n language: cfg.client.language,\n sdk: cfg.client.sdk,\n },\n command: getCommand(args),\n is_ci: Boolean(process.env.CI),\n token_method: tokenMethod,\n tracking_plan: cfg && cfg.trackingPlans && cfg.trackingPlans.length > 0\n ? {\n name: trackingPlanName,\n id: cfg.trackingPlans[0].id,\n workspace_slug: cfg.trackingPlans[0].workspaceSlug,\n }\n : undefined,\n };\n });\n}", "title": "" }, { "docid": "8e8ae6cf3a4d71b9ff613f56269bd370", "score": "0.3754597", "text": "visitConversionDeclarator(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "4d0c3e534536415dbf345e5866a196a0", "score": "0.37528703", "text": "function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) {\n var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor;\n var ancestorFacts = enterSubtree(0 /* None */, 0 /* None */);\n // To align with source maps in the old emitter, the receiver and property name\n // arguments are both mapped contiguously to the accessor name.\n var target = ts.getMutableClone(receiver);\n ts.setEmitFlags(target, 1536 /* NoComments */ | 32 /* NoTrailingSourceMap */);\n ts.setSourceMapRange(target, firstAccessor.name);\n var propertyName = ts.createExpressionForPropertyName(ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName));\n ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 16 /* NoLeadingSourceMap */);\n ts.setSourceMapRange(propertyName, firstAccessor.name);\n var properties = [];\n if (getAccessor) {\n var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined, container);\n ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor));\n ts.setEmitFlags(getterFunction, 512 /* NoLeadingComments */);\n var getter = ts.createPropertyAssignment(\"get\", getterFunction);\n ts.setCommentRange(getter, ts.getCommentRange(getAccessor));\n properties.push(getter);\n }\n if (setAccessor) {\n var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined, container);\n ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor));\n ts.setEmitFlags(setterFunction, 512 /* NoLeadingComments */);\n var setter = ts.createPropertyAssignment(\"set\", setterFunction);\n ts.setCommentRange(setter, ts.getCommentRange(setAccessor));\n properties.push(setter);\n }\n properties.push(ts.createPropertyAssignment(\"enumerable\", ts.createTrue()), ts.createPropertyAssignment(\"configurable\", ts.createTrue()));\n var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier(\"Object\"), \"defineProperty\"), \n /*typeArguments*/ undefined, [\n target,\n propertyName,\n ts.createObjectLiteral(properties, /*multiLine*/ true)\n ]);\n if (startsOnNewLine) {\n ts.startOnNewLine(call);\n }\n exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, hierarchyFacts & 49152 /* PropagateNewTargetMask */ ? 16384 /* NewTarget */ : 0 /* None */);\n return call;\n }", "title": "" }, { "docid": "434a0d42178479d5a11e489ddde54a7e", "score": "0.37414923", "text": "function resolveAnonymousTypeMembers(type) {\n var symbol = type.symbol;\n if (type.target) {\n var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/false);\n var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);\n var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);\n var stringIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 0 /* String */), type.mapper);\n var numberIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 1 /* Number */), type.mapper);\n setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n } else if (symbol.flags & 2048 /* TypeLiteral */) {\n var members = symbol.members;\n var callSignatures = getSignaturesOfSymbol(members.get(\"__call\"));\n var constructSignatures = getSignaturesOfSymbol(members.get(\"__new\"));\n var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);\n var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);\n setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n } else {\n // Combinations of function, class, enum and module\n var members = emptySymbols;\n var constructSignatures = emptyArray;\n if (symbol.flags & 1952 /* HasExports */) {\n members = getExportsOfSymbol(symbol);\n }\n if (symbol.flags & 32 /* Class */) {\n var classType = getDeclaredTypeOfClassOrInterface(symbol);\n constructSignatures = getSignaturesOfSymbol(symbol.members.get(\"__constructor\"));\n if (!constructSignatures.length) {\n constructSignatures = getDefaultConstructSignatures(classType);\n }\n var baseConstructorType = getBaseConstructorTypeOfClass(classType);\n if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 540672 /* TypeVariable */)) {\n members = createSymbolTable(getNamedMembers(members));\n addInheritedMembers(members, getPropertiesOfType(baseConstructorType));\n }\n }\n var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined;\n setStructuredTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexInfo);\n // We resolve the members before computing the signatures because a signature may use\n // typeof with a qualified name expression that circularly references the type we are\n // in the process of resolving (see issue #6072). The temporarily empty signature list\n // will never be observed because a qualified name can't reference signatures.\n if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {\n type.callSignatures = getSignaturesOfSymbol(symbol);\n }\n }\n }", "title": "" } ]
008424d5ab56e9af699a940bafe2ba33
Generate a random integer between low and hi
[ { "docid": "baa9c9c810a543ff7a0f5c88cae72ce1", "score": "0.8465631", "text": "function random(low, hi) {\n return Math.floor(Math.random() * (hi - low + 1) + low);\n}", "title": "" } ]
[ { "docid": "0556ebf75c58992c7abd4d530867740f", "score": "0.8594964", "text": "function randomInteger(low, high) {\n\t\treturn low + Math.floor(Math.random() * (high - low));\n\t}", "title": "" }, { "docid": "ee79ab0c183337b2b62726697fb2c31a", "score": "0.8565539", "text": "function randomInteger(low, high) {\n return low + Math.floor(Math.random() * (high - low));\n}", "title": "" }, { "docid": "2e8c4672b311374e522944b1a748b962", "score": "0.85233724", "text": "function randomInt(low, high) {\r\n return Math.floor(Math.random() * (high - low) + low)\r\n}", "title": "" }, { "docid": "ded20d8ff5569527d78910bf3ba1337c", "score": "0.8494539", "text": "function intRnd ( low, high )\n{\n\treturn toInt ( Math.random() * (high - low + 1) ) + low \n}", "title": "" }, { "docid": "ff7f6ea0479471c6da81090e83b8f144", "score": "0.84709454", "text": "function randInt(low, high) {\n\t return low + Math.floor(Math.random() * (high - low + 1));\n\t}", "title": "" }, { "docid": "7d414f2035b4ea174b07d5e1c718cc8f", "score": "0.8438091", "text": "function randomInt (low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "7d414f2035b4ea174b07d5e1c718cc8f", "score": "0.8438091", "text": "function randomInt (low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "cfd398a435137931fea351cd6cbad978", "score": "0.84261984", "text": "function randomInt(low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.8396557", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.8396557", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.8396557", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.8396557", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "bb251fe988f188dc21aaed3c4489b2b0", "score": "0.8369456", "text": "function randomInt(hi){\n return Math.floor(Math.random() * hi)\n}", "title": "" }, { "docid": "cbeaa21c0fe295a0fcb9edd0f913786b", "score": "0.83567685", "text": "function getRandomNumber(low, high) {\n return Math.random() * (high - low) + low;\n}", "title": "" }, { "docid": "f67ab9f61d70195f83702a2e781a8a0a", "score": "0.82899445", "text": "function randomNumber(low, high) {\n return(low+Math.floor(Math.random()*(high-low+1)))\n}", "title": "" }, { "docid": "10f03248f8c04722eb46f2a55f5bee0d", "score": "0.8260599", "text": "function randInt( low, high ) {\n\n\t\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n\t}", "title": "" }, { "docid": "b68d42d8b6ad4558db41c5ca31a57038", "score": "0.82458556", "text": "function getRandomNumber(low, high) {\n\tvar r = Math.floor(Math.random() * (high - low + 1)) + low;\n\treturn r;\n}", "title": "" }, { "docid": "1de15ed9532ec56f4159e374cfadf1bb", "score": "0.8214778", "text": "function randomI(low, high) {\n\treturn Math.floor((Math.random() * (high + 1 - low)) + low);\n}", "title": "" }, { "docid": "da482ba1a58cfdf6f0c0ebe0e06fa8f9", "score": "0.8207945", "text": "function randomInt(lower,upper) {\n return Math.floor(Math.random()*(upper-lower))+lower\n}", "title": "" }, { "docid": "f92e0d4a274d8e28d3a74dacb30b12bc", "score": "0.8200342", "text": "function rand(low, high) {\r\n return Math.floor( Math.random() * (high - low + 1) + low );\r\n }", "title": "" }, { "docid": "55af9973d2027836ae154b4f3ec3a36c", "score": "0.81797487", "text": "function randomInt(lower, upper){\r\n\t\treturn Math.round((Math.random() * (upper - lower)) + lower);\r\n\t}", "title": "" }, { "docid": "34d404503c49ead7ed43ecd9f917a8d7", "score": "0.8172183", "text": "function randInt(lower, upper) {\n return Math.floor(Math.random() * (upper - lower)) + lower;\n}", "title": "" }, { "docid": "1a5d15bc74eb58e65748688f1c6158ff", "score": "0.8160182", "text": "function getRndInteger(min, max) {return Math.floor(Math.random() * (max - min) ) + min;}", "title": "" }, { "docid": "641baa74babbd20599c3b9d66265869d", "score": "0.81357247", "text": "function random( low, high ) {\n return low + Math.floor( Math.random() * ( high - low ) );\n}", "title": "" }, { "docid": "58638b3ba2061b46bf6a2506d88139dc", "score": "0.81156445", "text": "function randint(lower, upper)\n{\n\tvar range = upper - lower;\n\treturn lower + Math.round(Math.random() * range);\n}", "title": "" }, { "docid": "256f3a7f82fcecebf0a7aea9d186982e", "score": "0.81121695", "text": "function getRandomInt (upper, lower) {\n\tconst min = Math.ceil(lower || 0);\n\tconst max = Math.floor(upper || 1);\n\treturn Math.floor(Math.random() * (max + 1 - min) + min);\n}", "title": "" }, { "docid": "447be83eacc7d17392d70e4a7c698ce2", "score": "0.8105519", "text": "function random (low, high) {\n return Math.random() * (high - low) + low;\n }", "title": "" }, { "docid": "e5dd5e2f0aeb6e006a084977de605a73", "score": "0.8093881", "text": "function random(low, high){\n return Math.random()*(high-low) + low;\n}", "title": "" }, { "docid": "4c347852e1a92b71443a6c126d74aa8d", "score": "0.80884284", "text": "function rand(lo, hi) {\n return Math.floor((hi - lo) * Math.random()) + lo;\n}", "title": "" }, { "docid": "42e8f94de075c4092854781f0f5368e0", "score": "0.808483", "text": "function rand(lo, hi) {\n return Math.floor(Math.random() * (hi - lo)) + lo;\n}", "title": "" }, { "docid": "460fc2749f5cc55a5e081f4e7e72e140", "score": "0.8081694", "text": "function randRange(lo, hi) {\n return (Math.random() * (hi - lo + 1) << 0) + lo;\n}", "title": "" }, { "docid": "846b0f8264464d6e07dd78a1ab9f23c1", "score": "0.80611306", "text": "function randomInteger (min, max) {\n return ((max - min) * Math.random()) + min;\n \n }", "title": "" }, { "docid": "7561c817c7f5c7f4843164064da84e75", "score": "0.80372596", "text": "function rand(high, low = 0) {\n return Math.floor(Math.random() * (high - low + 1) + low);\n}", "title": "" }, { "docid": "bc3aaad2c0178364a7abd37120b0f962", "score": "0.8000253", "text": "function getRandomInt(range){\n\treturn Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "f3e6e1ffe21535b72927c365ff70f3e3", "score": "0.7993553", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n }", "title": "" }, { "docid": "48a83728431bd470cd36104a0ca1c1eb", "score": "0.7988223", "text": "function randint(from, to) {\n return Math.floor(random(from, to));\n}", "title": "" }, { "docid": "bdb7cdaab2bf7f9f370af47e12a6c446", "score": "0.7988162", "text": "function randomNumberBetween(lo, hi) {\n return Math.floor(lo + Math.random() * (hi - lo));\n }", "title": "" }, { "docid": "48b2ee76c43f41fdd995f9536cb81acb", "score": "0.7978986", "text": "function getRandBetween(lo, hi) {\n return parseInt(Math.floor(Math.random()*(hi-lo+1))+lo, 10);\n}", "title": "" }, { "docid": "79ea96eb894077d524ed64cecd48e337", "score": "0.79767144", "text": "function rand(lo, hi) {\n diff = hi - lo;\n return Math.floor(Math.random() * diff) + lo;\n}", "title": "" }, { "docid": "48eca9e57f5c2521e993fc1cb3fe90d6", "score": "0.79629433", "text": "function myrandint(high){\n\treturn Math.floor((Math.random() * high) + 1)\n}", "title": "" }, { "docid": "dcccd32c3b6cbb394c5696cd8c58c0fa", "score": "0.79574805", "text": "function randomInteger(min, max){\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "daeea92640e077c16f7bfea9fae24feb", "score": "0.7957182", "text": "function getRandomInteger(min,max)\n{\n return Math.floor((max-min+1)*Math.random())+min\n}", "title": "" }, { "docid": "267a8022404dc11da47de3c25b13e0eb", "score": "0.7953206", "text": "function generateRandomInteger(min, max){\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "27f56a6148b54d1a829a28614200a707", "score": "0.79494005", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "415da114e97500590dfc4182bbdd2f64", "score": "0.7937743", "text": "function randomRange(high, low) {\n return Math.random() * (high - low) + low;\n}", "title": "" }, { "docid": "d2fdef1d31b98700b2fd645a787aa6f9", "score": "0.7937518", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "50976af3b6a9836c9d76a14731995b06", "score": "0.793324", "text": "function random(low, high){\n\t\tvar range = high - low\n\n\t\treturn Math.floor(Math.random() * range + low)\n\t}", "title": "" }, { "docid": "10dd9139065ee5fc70140b5afede0ca8", "score": "0.7918095", "text": "static integer(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min)\n }", "title": "" }, { "docid": "e04e997ffc7041e6abdf050b2bb8e9de", "score": "0.79100317", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "b697ff53baccb1af12357b69e1f3d279", "score": "0.7902877", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "568ae9debb6385cea0197fd1484676df", "score": "0.7899373", "text": "function randomInteger(min, max)\n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "8b64874abe82b7c830ac2be51731f441", "score": "0.7893666", "text": "function getRangeRandom(low, high){\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "2aa9c98af7e0e61975c1efb644383eb7", "score": "0.7892406", "text": "function getRangeRandom(low, high){\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "2cf20c9a8c013ed0983a5ab4b5a9cd2a", "score": "0.78917956", "text": "function randBetween(lo, hi){\n\tif(lo>=hi) return 0;\n\t\n\treturn Math.floor( (pRand()*(hi-lo)) + lo);\n\t\n}", "title": "" }, { "docid": "1e997f8d1696697ba3d2486666c72d05", "score": "0.78890663", "text": "getRandomInt (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min\n }", "title": "" }, { "docid": "67c3890bb77cd13d776d8f4fc3b10020", "score": "0.788841", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "bfc4c430f9de9c66f04317a300a0ec49", "score": "0.78824747", "text": "function randint(lower,upper) {\n var distance = upper - lower;\n return Math.round(\n lower+ Math.random() * distance\n );\n}", "title": "" }, { "docid": "0ec9967ab905f05b4a4763d228b9ea1a", "score": "0.7880693", "text": "function getRandomInteger (min, max) {\r\n min = Math.ceil(min);\r\n max = Math.floor(max);\r\n return Math.floor(Math.random() * (max - min+1)) + min;\r\n}", "title": "" }, { "docid": "5ff4b7d4c09d621996751642a2117194", "score": "0.78752196", "text": "function randomInteger(min,max) {\n\treturn Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "44a919e0ca6ca1d627eae0408e376ff8", "score": "0.78645253", "text": "function randomIntBetween(lower, upper) {\r\n\treturn Math.floor(Math.random() * (upper - lower)) + lower;\r\n}", "title": "" }, { "docid": "6b564aa93a2e576e987666d482cb0dfe", "score": "0.7859835", "text": "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "title": "" }, { "docid": "8595cfb854cac955cfab5263c68eace1", "score": "0.78593034", "text": "function getRandomIntBetween(lower, upper){\n\treturn Math.floor((Math.random()*(upper-lower+1))+lower);\n}", "title": "" }, { "docid": "af1f4ae231febc7fbfb198091def614e", "score": "0.7857962", "text": "function randomInteger(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.random() * (max - min);\n}", "title": "" }, { "docid": "f4151b9c4d55ec7e94e56f5425d1e6e7", "score": "0.7857726", "text": "static getRandomInt (min, max) {\n return Math.floor(Math.random() * (max - min)) + min\n }", "title": "" }, { "docid": "8cb719d5767a16e2c6384e160fb8700c", "score": "0.78563166", "text": "function randBetween(low, high){\n\tval = Math.floor(Math.random() * high) + low; \n\treturn val;\n}", "title": "" }, { "docid": "42887015cd78176c3e88fac6e9f9c28c", "score": "0.7853627", "text": "function randomInteger(min, max) {\n\treturn Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "224c299b46656b5d2395b14565414046", "score": "0.78501666", "text": "function randomInteger(low, high, rng) {\n _ch_checkArgs(arguments, 2, \"randomInteger(low, high, <rng>)\");\n\n return Math.min(high, floor(randomReal(low, high + 1, rng)));\n}", "title": "" }, { "docid": "0b2d98aacbe0fdedf8d141facf8fc1a6", "score": "0.7849083", "text": "function random_int(min, max){ \n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "7b707372ff41d90d7b296be5ad83956e", "score": "0.78459924", "text": "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "610c2edbde45186a4190f016656c164f", "score": "0.7844604", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive\n }", "title": "" }, { "docid": "85f5771d9d9d519be948d5555dd16059", "score": "0.7838268", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "909805f1c742d08facda6c2b1b77e472", "score": "0.7833", "text": "function randInRange(lo, hi) {\n if (hi === undefined) {\n hi = lo;\n lo = 0;\n }\n return parseInt(Math.random() * (hi - lo)) + lo;\n}", "title": "" }, { "docid": "7dcf12a168b341868e5f551a45e1a10c", "score": "0.78190535", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "7dcf12a168b341868e5f551a45e1a10c", "score": "0.78190535", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "2fdab6464a9d800c8ac398ba0c774597", "score": "0.781888", "text": "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "2ebe95f3456ab4c4e553a06102ca8cee", "score": "0.78180593", "text": "function getRandomInt(min, max) \n{ \n return Math.floor(Math.random() * (max - min + 1)) + min; \n}", "title": "" }, { "docid": "d9e96eeb8edfde81829477f0e2d1e326", "score": "0.78150725", "text": "function generate_random_integer(min,max) {\n\treturn Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "7d17f6fc5cb14ae8e6818138a2c69a54", "score": "0.7808779", "text": "function randomIntInc (low, high) {\n return Math.floor(Math.random() * (high - low + 1) + low);\n}", "title": "" }, { "docid": "7ab94ed12288e01c363cb907ecf368ee", "score": "0.7804327", "text": "function getRandomint(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "37d9045be5ea4c52175e360bf7f7f656", "score": "0.77979016", "text": "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "title": "" }, { "docid": "f32f52b0e4724cbcf523aa9c30795251", "score": "0.77967215", "text": "function getRandomInt(min, max) {\n    return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "588e81a53e666bf7ea5c4dc2c15c3b96", "score": "0.77946836", "text": "function getRandomInt(a,b){return Math.floor(Math.random()*(b-a+1))+a}", "title": "" }, { "docid": "159819c88c076607932fbe4af6ba0638", "score": "0.77946216", "text": "function getRandomInt(min, max)\n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "fac5b920c6c4eb289dd2cc1f7e1dc002", "score": "0.7792407", "text": "function randomInt(min, max){\r\n min = Math.ceil(min)\r\n max = Math.floor(max)\r\n return Math.floor(Math.random() * (max - min + 1) + min)\r\n}", "title": "" }, { "docid": "b47bc58ad24c34570191b4e873c04f1b", "score": "0.77896905", "text": "function randInt(min, max)\n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "efc0f21daafff59d412a8c1816206b40", "score": "0.7786344", "text": "function getRandomInt(min, max) \n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "970cc68324ef0eb433e4ca72b645443a", "score": "0.77859825", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * max) + min;\n}", "title": "" }, { "docid": "e2f0f055e7b6c3a30f45c725bf7d33cc", "score": "0.7782624", "text": "function getRandomInt(min, max)\r\n{ \r\n\treturn Math.floor(Math.random() * (max - min + 1)) + min; \r\n}", "title": "" }, { "docid": "f96b7ccd605f89286a7c3c97a18bb0fb", "score": "0.7781834", "text": "function randomNumber(high) {\n return Math.floor(Math.random() * (high + 1));\n}", "title": "" }, { "docid": "ac115d53877cd2948ba2c15c544a5c0b", "score": "0.7779478", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "4da51035fdab69eed64be15797d63716", "score": "0.7779434", "text": "function _getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "5d0e8e8868c60d166f759b1fcdb67fa2", "score": "0.77772623", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min\n }", "title": "" }, { "docid": "ac842feaa5d4f206dab6acf13217ef17", "score": "0.7777198", "text": "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "2634e83faf3474d9140d7cab2031d9e7", "score": "0.7767742", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "9e0345512cad5cdd501f8d52efe32120", "score": "0.77673924", "text": "function get_random_integer(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "9e0345512cad5cdd501f8d52efe32120", "score": "0.77673924", "text": "function get_random_integer(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "3dee10625834b0aede96650cc9eb217e", "score": "0.77661705", "text": "function randomInt(from, to) {\n\t\treturn Math.round((Math.random() * (to - from)) + from);\n\t}", "title": "" }, { "docid": "016a3f93a039223750cc1cc19c415617", "score": "0.77659947", "text": "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; \n}", "title": "" }, { "docid": "b785e805a028e6fd04e849b2fd878336", "score": "0.7764759", "text": "function getRandomInteger(min, max) {\n return Math.round(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "b785e805a028e6fd04e849b2fd878336", "score": "0.7764759", "text": "function getRandomInteger(min, max) {\n return Math.round(Math.random() * (max - min)) + min;\n}", "title": "" } ]
f8bb7c2bc880d0dfbb92cae92af391ff
This function is called when someone finishes with the Login Button. See the onlogin handler attached to it in the sample code below.
[ { "docid": "3162a207b296d722c5a901e1afffe8c3", "score": "0.0", "text": "function checkLoginState() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n }", "title": "" } ]
[ { "docid": "b0ceddf32c832a8e9c503f9a15f7d387", "score": "0.7523613", "text": "function onLoginComplete() {\n\tlongPoll();\n\t$('#send-button').on('click', sendText);\n\t$('#input-field').on('keypress', inputKeyPressed);\n}", "title": "" }, { "docid": "d48525dded6c138d4c04bc58394fdda8", "score": "0.7447239", "text": "doneCallback() {\n this.doLogin();\n }", "title": "" }, { "docid": "8af68e44e80d195d64e3bf14d1a268fe", "score": "0.73795927", "text": "function onLoginFailed() {\n\t\tUIState.unauthenticated();\n\t\talert('Login Failed!');\n\t}// Event handler for login form button", "title": "" }, { "docid": "1270f195f0358a6d195fdb596fbf80b9", "score": "0.7296663", "text": "function onLogin()\r\n{\r\n return true;\r\n}", "title": "" }, { "docid": "8767429668e1ac773d8d6d0af60947ed", "score": "0.70586854", "text": "function onLogin(res) {\n if (res.token) {\n http.setJWT(res.token);\n loggedIn = true;\n showPage('event');\n }\n }", "title": "" }, { "docid": "7dd28102739efc558aa151babfc724bc", "score": "0.69727755", "text": "function loginEventHandler() {\n\t$('#login_dive').delegate('#loginbtn', 'click', function() { \n\t\t//alert(\"About to login\");\n\t\tloginUser();\n\t});\n}", "title": "" }, { "docid": "9a3cab096e5ed63eb1ee428b2519fa69", "score": "0.69688964", "text": "function LoginUserCallBack() {\n loginUser();\n }", "title": "" }, { "docid": "eab7a6b73bbb457466f2869db0c4f636", "score": "0.6934726", "text": "function onLogin(data) {\n\t//on message from server for our login request\n\tif (data.success === false) {\n\t\talert(\"Nickname already taken, try with different one:)\");\n\t} else {\n\t\tnickname = data.name;\n\t\tloginStatus = true;\n\t\tconnectionOff = false\n\t\tconfigRTC = data.config\n\t\t//display the call page if login is succesful\n\t\tpageLogin.style.display = \"none\";\n\t\tpageCall.style.display = \"block\";\n\t}\n}", "title": "" }, { "docid": "9efccc3a1fd72d6e56ec49bbd9ccb6c3", "score": "0.686774", "text": "function loginHandler(){\n\tuser.set(\"username\", usernameField.value);\n\tuser.set(\"password\", passwordField.value);\n\tuser.logIn({\n\t\tsuccess:function (user){\n\t\t\tconsole.log(\"login worked\");\n\t\t\tloggedIn();\n\n\t\t}, \n\t\terror: function (user, error){\n\t\t\tconsole.log(\"error \"+ error.code);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "bccf61d688741b6b95ffc75eaaf8916a", "score": "0.6836502", "text": "handleLogin(data) {\r\n this.emit(Events.BaseEvents.LoginResult, data);\r\n }", "title": "" }, { "docid": "e0c979107011066942f54a5f412aadc0", "score": "0.6832805", "text": "function EventLogin() {\n\t\ttop.API.Dat.addEvent(\"GetPersistentDataComplete\", onDatGetPersistentDataComplete);\n top.API.Dat.addEvent(\"GetPersistentDataError\", onDatGetPersistentDataError);\n top.API.Dat.addEvent(\"SetPersistentDataComplete\", onDatSetPersistentDataComplete);\n top.API.Dat.addEvent(\"SetPersistentDataError\", onDatSetPersistentDataError);\n\n top.API.Tcp.addEvent(\"SendFailed\", onTcpSendFailed);\n top.API.Tcp.addEvent(\"OnRecved\", onTcpOnRecved);\n top.API.Tcp.addEvent(\"CompositionDataCompleted\", onCompositionDataCompleted);\n top.API.Tcp.addEvent(\"Timeout\", onTcpTimeout);\n\n top.API.Pin.addEvent('KeyLoaded', onKeyLoaded);\n top.API.Pin.addEvent('KeyLoadFailed', onKeyLoadFailed);\n top.API.Pin.addEvent(\"CryptFailed\", onCryptFailed);\n top.API.Pin.addEvent('DeviceError', onDeviceError);\n\t\ttop.API.Pin.addEvent(\"DecryptComplete\", onDecryptComplete);\n\t\ttop.API.Pin.addEvent(\"DecryptFailed\", onDecryptFailed);\n\n top.API.Pin.addEvent('PrivateKeyDecComplete', onPrivateKeyDecComplete);\n top.API.Pin.addEvent('PrivateKeyDecFailed', onPrivateKeyDecFailed);\n }", "title": "" }, { "docid": "565df803685b0ef3b1f6aad2a23dd303", "score": "0.68283457", "text": "function onLoginButtonClick(event) {\n console.log('Digits login started.');\n Digits.logIn().done(onLogin).fail(onLoginFailure);\n}", "title": "" }, { "docid": "8b190fa8169d0913d648617cbaeb392f", "score": "0.67972034", "text": "function onLogin(loginResponse) {\n console.log('Digits login succeeded.');\n var oAuthHeaders = parseOAuthHeaders(loginResponse.oauth_echo_headers);\n\n setDigitsButton('Signing In…');\n // Nov 2, 2015 In process of changing routes iron:router\n // What is the equivalent in meteor?\n console.log(\"inside onLogin before ajax call\");\n\n //Router.go('digits.rest', {query: 'q='+ oAuthHeaders});\n \n $.ajax({\n type: 'POST',\n url: '/digits',\n data: oAuthHeaders,\n success: onDigitsSuccess\n });\n\n }", "title": "" }, { "docid": "44b6592928ba54807d755d65cfbf260c", "score": "0.67846555", "text": "function onLoginSuccess() {\n\t\tKandyAPI.Phone.updatePresence(0);\n\t\tUIState.authenticated();\n\t\tloadContacts();\n\n\t\t// Checks every 5 seconds for incoming messages\n\t\tsetInterval(receiveMessages, 1000);\n\t}", "title": "" }, { "docid": "123d831c41b3ab45270004450a48e34b", "score": "0.6777355", "text": "function handleUIAfterLogin(){\n //focus user input upon loading chat\n userInput.focus();\n //reset color and name\n randomNumberColor = Math.floor(Math.random() * colors20.length);\n randomColor = colors20[randomNumberColor];\n randomNumberName = Math.floor(Math.random() * names20.length);\n randomName = names20[randomNumberName];\n //change UI to match user color\n chatWindow.style.borderLeft = \"solid\" + randomColor;\n chatWindow.style.borderRight = \"solid\" + randomColor;\n submitButton.style.color = randomColor;\n userInput.style.backgroundColor = randomColor;\n userInput.style.border = randomColor;\n userInput.setAttribute(\"placeholder\", \"Send message as \" + randomName);\n submitButton.removeAttribute(\"hidden\");\n submitButton.style.border = randomColor;\n submitButton.style.border = \"solid\";\n membersOnlineWindow.style.backgroundColor = randomColor;\n membersOnline.style.backgroundColor = randomColor;\n header.style.backgroundColor = randomColor;\n copyRight.style.color = randomColor;\n}", "title": "" }, { "docid": "a2086dd98fa140a0d45b7b538d50dd3a", "score": "0.6775852", "text": "function onLoginSubmit() {\n loginService.login($scope.loginData.userName, $scope.loginData.password).then(function (response) {\n if (response != null && response.data.error != undefined) {\n notificationService.displayError($scope.resourceShared.LoginIncorrect);\n }\n else {\n notificationService.displaySuccess($scope.resourceShared.LoginIsSuccessfully);\n var stateService = $injector.get('$state');\n stateService.go('home');\n $scope.$applyAsync();\n }\n });\n }", "title": "" }, { "docid": "b8012c548177830fc4b678b27ddacc41", "score": "0.6766178", "text": "onLoginButtonPress() {\n console.log('Login pressed');\n}", "title": "" }, { "docid": "cc4cbb3b66f1334380463a9640462875", "score": "0.6757304", "text": "function handleLogin() {\n authClient.signIn();\n}", "title": "" }, { "docid": "1b1ef20025c238ab5dfeaf61dca628d3", "score": "0.674424", "text": "function handleLogin(){\n auth.signInWithPopup(provider)\n .then((result)=>{\n const user = result.user\n setUser(user)\n })\n \n // setLogged(true)\n // console.log(user, \"<--user in Navbar/handleLogin\") \n // console.log(password, \"<--password in Navbar/handleLogin\") \n }", "title": "" }, { "docid": "769a1f578e7f3ae5264dbf8bf35d0e95", "score": "0.6716964", "text": "function org_shaolin_vogerp_herewego_page_Login_Login(eventsource,event) {/* Gen_First:org_shaolin_vogerp_herewego_page_Login_Login */\n\n var UIEntity = this;\n\n this.Submit_OutFunctionName(eventsource);\n }", "title": "" }, { "docid": "0009d3c04375f30db203eedd4c684849", "score": "0.6702849", "text": "function authentication_complete() {\r\n if (lightdm.is_authenticated) {\r\n lightdm.login (lightdm.authentication_user, lightdm.default_session);\r\n } else {\r\n message(\"Authentication failed\", true);\r\n lightdm.cancel_authentication();\r\n }\r\n}", "title": "" }, { "docid": "ae815b16dc4a981429c89ef8b11b6672", "score": "0.67008805", "text": "function authentication_complete()\r\n{\r\n // Clear Password Field On Login Attempt\r\n activeUserListing.querySelector(\".password\").value = \"\";\r\n pendingAuthentication = false;\r\n if (lightdm.is_authenticated)\r\n {\r\n // Display Welcome Screen\r\n let template = document.getElementById(\"welcome-template\");\r\n let welcomeBodyContent = template.content.cloneNode(true);\r\n let mainContent = document.querySelector(\"#main-content\");\r\n mainContent.innerHTML = \"\";\r\n mainContent.appendChild(welcomeBodyContent);\r\n // After Welcome Screen Timeout, Start Session\r\n setTimeout(function() {lightdm.start_session_sync(lightdm.default_session)}, welcomeScreenTimeout);\r\n }\r\n else\r\n {\r\n // Show Error Popup\r\n activeUserListing.querySelector(\".password-error-popup\").classList.add(\"active\");\r\n // Enable Password Input Forms\r\n disablePasswordForms(false);\r\n // Keep User Selected For Another Attempt\r\n pendingAuthentication = true;\r\n lightdm.authenticate(activeUserName);\r\n }\r\n}", "title": "" }, { "docid": "c091646ec0f288ff4ffc223669bb2bdd", "score": "0.6689835", "text": "function onLogOut() {\n // No change on UI\n}", "title": "" }, { "docid": "a2326a38ac82ec546cc4cce28ac26b08", "score": "0.66884124", "text": "function onLogOut() {\n // No UI change\n}", "title": "" }, { "docid": "a157667cde9f4b58939ab5997b1f67b2", "score": "0.6673735", "text": "function notifyOnLoginListener() {\n onLoginListener.forEach((callback) => {\n callback.call(null);\n });\n }", "title": "" }, { "docid": "bff42a007f4058c74f8f6446490463c6", "score": "0.66625565", "text": "function handleLogin(event) {\n event.preventDefault();\n if (email === \"test@htn.com\" && password === \"1234\") {\n props.loginCallbackFromParent(true);\n setLogIn(true);\n } else {\n console.log(\"Incorrect Credentials\");\n }\n }", "title": "" }, { "docid": "2905964edfac0e34b3525fb141b3d8c2", "score": "0.6659282", "text": "function onLogInFailure() {\n // No UI change\n}", "title": "" }, { "docid": "5eec9bf0716db7ceec21bd94a77718f6", "score": "0.6641517", "text": "function loginHandler () {\n userName = qs('input[name=user_name]').value;\n password = qs('input[name=password]').value;\n axios.post('/api/login',{\n userName: userName,\n password: password\n })\n .then(function(response){\n if(response.data.success) {\n hideLogin();\n window.User = userName;\n displayCurrentUserName();\n displayFriends();\n showApp();\n }\n })\n .catch(function(error){\n throw error\n });\n }", "title": "" }, { "docid": "65bc484e37bab2f3e378106362774446", "score": "0.66397357", "text": "async function handleLogin(){\r\n if(email === '' || password === ''){\r\n Alert.alert(\"Opss...\",\"Alguma informação invalida\");\r\n return;\r\n }\r\n //setLoading(true);\r\n singIn(email,password);\r\n //setLoading(false);\r\n }", "title": "" }, { "docid": "2466ca67738c00ab7e17ba72c71f2c62", "score": "0.6634054", "text": "function successfulLogin(data) {\n // Closes modal.\n let modal = document.getElementById(\"login-modal\");\n modal.classList.toggle(\"display-modal\");\n\n // Saves token for user in local storage.\n localStorage.setItem(\"token\", data.token);\n\n // Gets and saves current user ID in local storage.\n getCurrentUserID();\n\n // Refreshes the navigation bar, feed, login and signup modals.\n document.getElementById(\"login-btn\").classList.toggle(\"button-display\");\n document.getElementById(\"logout-btn\").classList.toggle(\"button-display\");\n document.getElementById(\"signup-btn\").classList.toggle(\"button-display\");\n document.getElementById(\"profile-view\").classList.toggle(\"button-display\");\n document.getElementById(\"public-button\").classList.toggle(\"button-display\");\n document.getElementById(\"private-button\").classList.toggle(\"button-display\");\n\n // Switches to the private feed.\n localStorage.setItem(\"currFeed\", \"private\");\n genFeed(\"removeCurrentFeed\");\n document.getElementById(\"post-open-modal\").classList.toggle(\"button-display\");\n genFeed(\"morePrivate\");\n document.getElementById(\"login-username\").value = \"\";\n document.getElementById(\"login-password\").value = \"\";\n}", "title": "" }, { "docid": "ae6fae5c42036e8432ebc2de9ba9ed43", "score": "0.66249585", "text": "function OnLogin(AuthResponse) {\n user.userId = AuthResponse.authResponse.userID\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n user.userName = response.name;\n console.log(\"UserName - \" + user.userName);\n //console.log(response);\n StartFBProcessing(AuthResponse);\n });\n}", "title": "" }, { "docid": "3f75dfc1df6fad70f12d8688eb261583", "score": "0.66194886", "text": "function onLogin() { //this function is called when you login\n //========== Nikifor\n\n //smenq ot login stranica na main menu\n PageSwap('LoginPage', 'Page2');\n}", "title": "" }, { "docid": "a28e02bf424367e9f68077f451c924b5", "score": "0.6612079", "text": "function btnLoginClicked() {\n\n\t$.activityIndicator.show();\n\n \tvar hostIP = $.txtHostIP.value;\n \tvar username = $.txtUserName.value;\n\tvar password = $.txtPassword.value;\n\n\tif($.swcKeepMeSignedIn.value == true){\n\t\tsaveLoginInformationToProperties(username, hostIP);\n\t}\n\t\t\n\tif (Ti.Geolocation.locationServicesEnabled) {\n\t\t\n\t\tTitanium.Geolocation.purpose = 'Get Current Location';\n\t\tTitanium.Geolocation.getCurrentPosition(function(f) {\n\t\t\t\n\t\t\tif (f.error) {\n\t\t\t\t$.activityIndicator.hide();\n\t alert('Error: ' + f.error);\n\t } else {\n\t var latitude = f.coords.latitude;\n\t var longitude = f.coords.longitude;\n\t \n\t Ti.Geolocation.reverseGeocoder(latitude, longitude, function(g) {\n\t \tif (g.error) {\n\t \t\t$.activityIndicator.hide();\n\t \t\tTi.API.error('Error: ' + g.error);\n\t \t\t} else {\n\t \t\t\tvar places = g.places[0]\n\t \t\t\tlogin(hostIP, username, password, places.country_code, places.postalCode);\n\t \t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t} else {\n\t\t$.activityIndicator.hide();\n\t\talert('Please enable location services');\n\t}\n}", "title": "" }, { "docid": "a2208db216d343c36264d90d653dd16c", "score": "0.6597902", "text": "handleWindowCallback() {\n this.authContext.handleWindowCallback();\n const user = this.authContext.getCachedUser();\n if (user && user.userName) {\n document.write(\"login successful\");\n }\n else {\n document.write(\"Could not find the user. Either this method was called before login or login was not successful.\");\n }\n }", "title": "" }, { "docid": "a5b79c5e1d345e5e3e49f943b61f90ce", "score": "0.6580734", "text": "onDismissLoginSuccess() {\n\t\tthis.setState({\n\t\t\tsuccessfullyLoggedIn: false\n\t\t});\n\t}", "title": "" }, { "docid": "82284da4d1edbad185fb1078fa27508f", "score": "0.65607584", "text": "function onLoginFailed() {\n alert('Login Failed');\n }", "title": "" }, { "docid": "3f1a70c6412d3524cf60c5581b67232d", "score": "0.6557604", "text": "function onLoginSuccessful() {\n // Now, save the token in a cookie\n Kaka.set(\"ua_session_token\", UserApp.global.token);\n\n // Redirect the user to the index page\n window.location.href = \"/\";\n showLoader(false);\n }", "title": "" }, { "docid": "7f34fd2107d384e708fd4a4d249c2d16", "score": "0.6550779", "text": "function onPressLogin() {\n if (inputRef != null) {\n // user can loging only when user have enter someting\n setLogin((prevIsLogin) => {\n let tempLogin = prevIsLogin;\n tempLogin = true;\n return tempLogin;\n }); // setting the login state to true\n setId((prevId) => prevId + 1); // updating the couter\n let username = inputRef.current.value; // setting username to the inputRef.\n\n username = inputRef.current.value;\n setName((prevName) => {\n let tempName = prevName;\n tempName = username;\n return tempName;\n }); // setting name for current browser\n addUser(id, username); // adding user to player list or\n // spectator list based on their id number\n setUserType(id); // seting the usertype for the user\n\n socket.emit('login', { username, id });\n }\n }", "title": "" }, { "docid": "905466c4e1d1dc77c781c7b6af1b006d", "score": "0.65389466", "text": "function loginUser() {\n _this.login = true;\n $('#onepush-modal').closeModal();\n }", "title": "" }, { "docid": "4c01f06670c941aaa92d118a45271d95", "score": "0.65316397", "text": "function loginResponse(data) {\n updateLoginTimeout(true);\n log.info(\"Successfully logged in\");\n }", "title": "" }, { "docid": "a766fbea3e916558654e8f1e1b13a838", "score": "0.653053", "text": "function handleLoginStatus() {\n //console.log(\"infotooltipopen\", isInfoToolTipOpen);\n setLoggedIn(!loggedIn); //might need to modify this if used in multiple places\n //setIsInfoToolTipOpen(true);\n //console.log(\"infotooltipopen after reset\", isInfoToolTipOpen);\n }", "title": "" }, { "docid": "cf7710e780e7efbd8d58c1ef51d4cb77", "score": "0.6529579", "text": "function handle_login(e) {\n\t\tlogin_showing = false;\n\t\t$('#modal').modal('hide');\n\t\tconsole.log('logging in');\n\t\tsocket.emit('login', $('#username').val(), $('#password').val());\n\t\treturn false;\n\t}", "title": "" }, { "docid": "30522f74dca415b009c7c48a2b7fb8a0", "score": "0.6519749", "text": "function loginLoad() {\n footer();\n displayUser();\n}", "title": "" }, { "docid": "0c81ec4c88f111fcc7f94ff2459b6890", "score": "0.6517384", "text": "function onSuccessfulLogin(token, userId, username) {\n //disappear quote\n $('.intro').addClass('displayNone');\n\n //disappear landing-page\n $('.landing-page').addClass('displayNone');\n\n //make sure button displays correct text\n $('.show-and-hide-btn').text('show sessions')\n\n //disappear the links that were for signing up and logging in\n signupLink.addClass('displayNone');\n loginLink.addClass('displayNone');\n signupForm.addClass('displayNone');\n loginForm.addClass('displayNone');\n\n //reveal the form for inputting feeling\n feelingsForm.removeClass('displayNone');\n\n //reveal the logout button, since user is now logged in\n logoutBtn.removeClass('displayNone');\n //reveal the 'show all saved sessions' button and 'clear results'\n btnWrapper.removeClass('displayNone');\n\n localStorage.setItem('token', token);\n localStorage.setItem('userId', userId);\n localStorage.setItem('username', username);\n\n}", "title": "" }, { "docid": "db663a634bd049da2d40afbea2994f00", "score": "0.65109503", "text": "function loginWindow_exitHandler() {\n console.log('exit and remove listeners');\n // Handle the situation where the user closes the login window manually before completing the login process\n deferredLogin.reject({error: 'user_cancelled', error_description: 'User cancelled login process', error_reason: \"user_cancelled\"});\n loginWindow.removeEventListener('loadstop', loginWindow_loadStartHandler);\n loginWindow.removeEventListener('exit', loginWindow_exitHandler);\n loginWindow = null;\n console.log('done removing listeners');\n }", "title": "" }, { "docid": "2245c54459e8486ebd242fb44d9681df", "score": "0.65067774", "text": "function _onNavigationComplete() {\n // Trigger update content\n modalLoginView.trigger(mModals.MODAL_UPDATE_CONTENT_EVENT);\n switch (navigator.getActualState()) {\n case LOGIN_FORM:\n currentStateView = \"login\";\n mLoginForm.init();\n _setModalSize('modal-xs');\n toggleNavigationHeader(headerTranslations.LOGIN_FORM);\n // Reset form setup\n commonFormSetup.init();\n break;\n case RECOVER_PASSWORD:\n currentStateView = \"recover\";\n _setModalSize('modal-xs');\n mLoginRecoverPassword.init();\n toggleNavigationHeader(headerTranslations.RECOVER_PASSWORD);\n // Reset form setup\n commonFormSetup.init();\n break;\n case RECOVER_PASSWORD_CONFIRMATION:\n currentStateView = \"recover_confirmation\";\n _setModalSize('modal-xs');\n mLoginRecoverPasswordConfirmation.init();\n break;\n case LOGIN_SIGNUP_FORM:\n currentStateView = \"signup\";\n mLoginForm.init();\n _setModalSize('modal-xs');\n toggleNavigationHeader(headerTranslations.LOGIN_FORM);\n // Reset form setup\n commonFormSetup.init();\n break;\n }\n }", "title": "" }, { "docid": "799e561ac256a6de3f73712ced51e434", "score": "0.6495877", "text": "function loginComplete(data)\n {\n userID = data.id;\n userType = data.type;\n\n if ((userID == -1) || (userType == -1)) {\n var btnOk = Ext.getCmp('btnOk');\n btnOk.setDisabled(false);\n showInfo(\"Ошибка авторизации!\");\n return;\n }\n win.close();\n var txtRole = getUserType(userType);\n switch (userType) {\n case 0:\n CreateCooksTab(tabs);\n CreateGoodsTab(tabs);\n break;\n case 1:\n CreateMerchTab(tabs);\n break;\n case 2:\n CreatePraporTab(tabs);\n break;\n case 3:\n CreateUsersTab(tabs);\n CreateGoodsTab(tabs);\n break;\n }\n showInfo(\"Авторизация прошла успешно, роль: \" + txtRole + \".\");\n user = data;\n }", "title": "" }, { "docid": "1545c3c96e6dac7884ca47c7329c2f33", "score": "0.64950216", "text": "doLogin() {\n if (!this.isNavigating) {\n this.isNavigating = true;\n // implement systemService.xAuth();\n this.isNavigating = false;\n }\n }", "title": "" }, { "docid": "7206115cf0aedd68ecd11a97cac4a94b", "score": "0.6475963", "text": "onLogIn() {\n dispatch(userLogIn())\n }", "title": "" }, { "docid": "060475b18b0ee80b96d70b7b9280fc80", "score": "0.64703596", "text": "_handleLogin() {\r\n if (this.$.login.validate()) {\r\n let password = this.$.password.value;\r\n let sapId = this.$.sapId.value;\r\n this._makeAjaxCall(`${window.BaseUrl}/users?sapId=${sapId}&&password=${password}`, 'get', null);\r\n\r\n }\r\n }", "title": "" }, { "docid": "df03f7fdd459682c05824484683d603c", "score": "0.64543486", "text": "onAppEventLogin(evt, data) {\n this.refresh();\n }", "title": "" }, { "docid": "d803a040b603f2af68e021930c53d3e9", "score": "0.64400023", "text": "function after_login(){\r\n\t$('#login').hide();\r\n\tdocument.getElementById('lblPlayer').value = cur_user;\r\n\tpre_game_settings();\r\n}", "title": "" }, { "docid": "4f5667db44c0e2dbfae5a8c65818dcd8", "score": "0.6438964", "text": "function logInModeClicked() {\n console.log(\"User tried to log in\");\n userNav.currentMode = \"login\";\n updateDisplay('full');\n}", "title": "" }, { "docid": "a2aef5f0eae741422801a88373640798", "score": "0.643786", "text": "function checkLogin() {\n if (loggedIn) {\n showAccount();\n } else {\n loginPageTransition();\n }\n}", "title": "" }, { "docid": "c4449b92b576c9d3a95586d433484d3a", "score": "0.6421699", "text": "function onFacebookLogin()\n{\n console.log(\"onFacebookLogin\");\n FB.login(function(response) {\n\tif (response.authResponse) {\n\t AuthResponse = response.authResponse;\n\t console.log(response.authResponse);\n\t\n\t showtick();\n\t}\n\tFB.getLoginStatus(function(response) {\n\t statusChangeCallback(response);\n\t return;\n\t});\n });\n}", "title": "" }, { "docid": "bdd8c541e5f4c644e1995c58c05936e4", "score": "0.6404515", "text": "function handleLogin(e){\n e.preventDefault()\n Meteor.loginWithPassword(username.value, password.value, err => {\n err ? setError(err.reason) : location.reload();\n })\n }", "title": "" }, { "docid": "c5dd86df9568f1043c66fc1b3a809dbb", "score": "0.6403019", "text": "function ShowLoginDialog( reason, on_login ) {\n\tm_on_login = on_login;\n\tbrains.Dialog.Show( \"login\" );\n\tInitLoginDialog( reason );\n}", "title": "" }, { "docid": "29554973225d881d72ac4b22473102ae", "score": "0.64021546", "text": "function handleLoginMsg() {\n openLink(buildUrl(\"/login\"));\n}", "title": "" }, { "docid": "581bc2528d018f87d8392e15486d9f04", "score": "0.63989323", "text": "_handleLogin() {\n const email = this.email.value;\n const password = this.password.value;\n\n if (!email) {\n this.email.reportValidity();\n }\n\n if (!password) {\n this.password.reportValidity();\n }\n\n if (this.email.checkValidity() && this.password.checkValidity()) {\n this._dispatchEvent('handler-spinner', 'open');\n this.service.login({ email, password });\n }\n }", "title": "" }, { "docid": "3bc8153f13618c42c7d2b368e7bb4fab", "score": "0.6373866", "text": "function clickLogin() {\n\tvar authLogin = isAuthLogin();\n\t// Ti.API.info('auth login : ' + authLogin);\n\t// if (authLogin) {\n\t// openMainScreen();\n\t// } else {\n\t// alert('Please check Username and Password');\n\t// }\n}", "title": "" }, { "docid": "4b3ae464cd9028123e183bb73c40a189", "score": "0.6371712", "text": "function login(e) {\n\t//check if user is authorized. If authorized, load user info, and create datastore if not yet existed.\n\tconsole.log(\"main.js:: login/logout: JSON.stringify(e)\" +JSON.stringify(e));\n\tif (e.source.title == \"LOGIN\" || e.source.title == \"REFRESH\") {\n\t\t$.login_button.title=\"\";\n\t\t$.main_window.add(loadingView);\n\t\tgoogleAuthSheet.isAuthorized(function() {\t\t\t\n\t\t\t$.login_activity.show();\t\n\t\t\tfunction AuthorizeActivity(){\n\t\t\t\tconsole.log('Access Token: ' + googleAuthSheet.getAccessToken());\n\t\t\t}\t\n\t\t\t//setTimeout(AuthorizeActivity(),2000); // wait 2 secs\t\n\t\t\tAuthorizeActivity();\n\t\t\t$.login_activity.hide();\n\t\t\tTitanium.App.Properties.setString('needAuth',\"false\");\n\t\t\t$.login_button.title=\"LOGOUT\";$.logout_button.title=\"\"; //RightNav is a logout now. Hide LeftNav button.\n\t\t\tsomeInfo.set({\"namecolor\": \"#13CA13\"});\n\t\t\tAlloy.Globals.getMaster(); // Load user info\n\t\t\tgetEmail();\n\t\t\tAlloy.Globals.initialUserSetup(); //setup datastore if it is not yet done\n\t\t\tvar emailid = Titanium.App.Properties.getString('emailid');\t\t\n\t\t\t$.main_window.login=\"yes\";\n\t\t\t$.status_view.height=\"1\";\n\t\t\t$.status_view.backgroundColor=\"green\";\n\t\t\tif (emailid != null){\n\t\t\t\tvar name = emailid.split('@')[0].trim();\n\t\t\t\tTitanium.App.Properties.setString('name',\"\");\n\t\t\t\t$.lastcredit_row.name=name;\n\t\t\t\t$.lastdebit_row.name=name;\n\t\t\t\tAlloy.Globals.getCreditDebitSID(name);\n\t\t\t\t$.studentid.color=\"#336600\";\n\t\t\t\t$.lastcredit_row.backgroundColor=\"white\";\n\t\t\t\t$.lastdebit_row.backgroundColor=\"white\";\n\t\t\t\t$.bal_row.backgroundColor=\"white\";\n\t\t\t\t$.name_row.backgroundColor=\"white\";\n\t\t\t\t$.transaction_view.backgroundColor=\"white\";\n\t\t\t} else {\n\t\t\t\t$.studentid.color=\"red\";\n\t\t\t\tRefResh();\n\t\t\t} \t\n\t\t\t//change display name based on googe info\n\t\t\t someInfo.set({\"id\":\"1234\",\n\t\t\t\t\"name\": Titanium.App.Properties.getString('firstname',\" \") +\" \"+Titanium.App.Properties.getString('lastname',\" \"),\n\t\t\t\t\"emailid\": emailid\n\t\t\t});\n\t\t\tsomeInfo.fetch();\n\t\t\tsetTimeout(function(){$.main_window.remove(loadingView);},2000);\t//after 5 secs load back main screen\t\n\t\t}, function() {\n\t\t\t$.login_activity.show();\n\t\t\t$.main_window.add(refreshView);\n\t\t\tgoogleAuthSheet.authorize();\n\t\t\tconsole.log('isAuthorized:NOT:Fr AlloyGlobal Authorized first, see next window: '+(new Date()));\n\t\t\tTitanium.App.Properties.setString('needAuth',\"true\");\n\t\t\tfunction gettingEmailID(){\t\t\n\t\t\t\tgetEmail();\n\t\t\t\tvar emailid = Titanium.App.Properties.getString('emailid');\n\t\t\t\treturn emailid;\n\t\t\t}\n\t\t\tvar emailid = gettingEmailID();\t\t\n\t\t\tconsole.log(\"main.js b4 checking emailid\");\t\t\n\t\t\tif (!emailid) {\n\t\t\t\tconsole.log(\"main.js:: emailid is empty, execute it again\");\t\n\t\t\t\t//setTimeout(gettingEmailID(),3000); // wait 2 secs\n\t\t\t\tgettingEmailID();\n\t\t\t} else console.log(\" main.js:: emailis is: \"+emailid);\n\t\t\t$.login_activity.hide();\t\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t\t$.main_window.remove(refreshView);\n\t\t\t\t$.main_window.remove(loadingView);\n\t\t\t\t//Orange\n\t\t\t\tRefResh();\n\t\t\t},10000);\t//after 5 secs load back main screen\n\t\t\t}\n\t\t);\n\t} else {\n\t\tTi.API.info('Logout: ');\n\t\tgoogleAuthSheet.deAuthorize();\n\t\t$.login_button.title=\"LOGIN\";\n\t\tsomeInfo.set({\"namecolor\": \"red\"});\n\t\tAlloy.Globals.resetVar();\n\t}\n\n}", "title": "" }, { "docid": "b331302a7b218f998397ff48365d5b0c", "score": "0.63588434", "text": "function loginOnClick(e) {\n e.preventDefault();\n handleLogin();\n}", "title": "" }, { "docid": "778631742823a573c0eca57736dec661", "score": "0.63515717", "text": "function onLoginFailure() {\n $(\"#loginError\").show();\n $(\"#loginButton\").prop(\"disabled\", false);\n }", "title": "" }, { "docid": "d2750cc9666596144bdbd13bb49fceec", "score": "0.6337422", "text": "loginPromptEvent(e) {\n this._loginUserRoutine({\n u: e.detail.u,\n p: e.detail.p,\n });\n }", "title": "" }, { "docid": "bda70daf148ceffabf4a26af0a7d9c01", "score": "0.6336167", "text": "async function handleLogin(e) {\n try {\n e.preventDefault();\n await login(email, password);\n onSuccess();\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "1021fc49f718944b72008f300c38c3b4", "score": "0.63354534", "text": "function buttonHandler(){\n alert(\"Cerrado Sesion\");\n setEstadoLogin(0);\n \n }", "title": "" }, { "docid": "eb99e9cee13faa530a2fc6322a1ccd8a", "score": "0.63260925", "text": "_handlerLoginFinally() {\n this._dispatchEvent('handler-spinner', 'close');\n }", "title": "" }, { "docid": "3de2c3ceb8f2b4fc10ed2b36346832ca", "score": "0.63058835", "text": "function handleClientLoad() {\n loginUser();\n}", "title": "" }, { "docid": "a5c8dd125d78a697373e12e779fff97d", "score": "0.6304503", "text": "function backToLoginView() {\n divDisplay.innerHTML = loginDesplay\n //adding event listner to login butoon.\n let loginButton = document.querySelector(\"#login\");\n loginButton.addEventListener(\"click\", loginnFunction);\n }", "title": "" }, { "docid": "101fdf1af019728b7a26ca2fa9de1ca8", "score": "0.6295785", "text": "function login() {\n //Stop spinner\n document.getElementById(\"loginBtnIcon\").classList.remove(\"fas\",\"fa-spinner\",\"fa-spin\");\n\n //Enable menu button:\n toggleEnable(document.getElementById(\"menuBtn\"))\n\n //Show bottom bar buttons and highlight feed mode button\n itemBlock(document.getElementById(\"bottomBar\"))\n \n //Change title bar to that of app start page\n itemHide(document.getElementById(\"topBarTitleWelcome\"))\n itemBlock(document.getElementById(\"topBarTitleData\"))\n \n // Make sure correct menu button icon is displayed\n itemBlock(document.getElementById(\"menuBtn\"))\n itemHide(document.getElementById(\"menuBtnAlt\"))\n \n //Show only the menu items for current mode\n setBlock([...document.getElementsByClassName(\"dataMenuItem\")])\n\n //hide login screen and show feed screen\n itemHide(document.getElementById(\"loginModeDiv\"))\n itemBlock(document.getElementById(\"homepage\"))\n var id_slot = document.getElementById(\"userID\")\n id_slot.append(window.localStorage.getItem(\"userID\"))\n\n //Save the current user name to local storage\n console.log(\"Storing: \", document.getElementById(\"emailInput\").value, \" In local storage \")\n window.localStorage.setItem(\"UserName\", document.getElementById(\"emailInput\").value)\n\n var id_slot = document.getElementById(\"userID\")\n id_slot.innerHTML = window.localStorage.getItem(\"UserName\")\n\n loggedInUser = document.getElementById(\"emailInput\").value\n\n establishLogoClickEvent()\n showDefaultTableStructures()\n //Set mode to current mode\n mode = \"dataMode\"\n}", "title": "" }, { "docid": "1f60188a32b2d5171c27e8d76d82561e", "score": "0.6291677", "text": "function onLogOut() {\n clearHeaderUI();\n\n renderLogOutUI();\n}", "title": "" }, { "docid": "f65b25841c329cb36dc777f86a184e3d", "score": "0.6269152", "text": "function ClickLogin(){ clicked=true }", "title": "" }, { "docid": "97fb57c8fe1d56a0256c7ab11812206b", "score": "0.6268901", "text": "function loginDone(userData) {\n return {\n type: LOG_IN_SUCCESS,\n payload: userData\n }\n}", "title": "" }, { "docid": "d50b85e586e89ac8f26c6940900cd801", "score": "0.6266505", "text": "async function handleRedirectAfterLogin() {\n await session.handleIncomingRedirect(window.location.href);\n if (session.info.isLoggedIn) {\n // Update the page with the status.\n document.getElementById(\n \"labelStatus\"\n ).innerHTML = `Your session is logged in with the WebID [<a target=\"_blank\" href=\"${session.info.webId}\">${session.info.webId}</a>].`;\n document.getElementById(\"labelStatus\").setAttribute(\"role\", \"alert\");\n document.getElementById(\"webID\").value = session.info.webId;\n }\n }", "title": "" }, { "docid": "bd2782067f01c09c58fd15b0d9c84fc0", "score": "0.62617916", "text": "async function submitLogin() {\n await login(showLoader, loginModel.getCurrentUserObj());\n }", "title": "" }, { "docid": "a460d696731da9a25a8e9b5a5734978a", "score": "0.62614316", "text": "function handleCreateLogin() {\n var $inputs = $('#login-form :input');\n var values = captureFormData($inputs);\n\n // submitRequest(values, url)\n\n window.location = './onboard-integration.html'\n}", "title": "" }, { "docid": "63aebc865ad2ea732fe1b34585171437", "score": "0.6260036", "text": "afterLogin(context, func, eventType = 'login', ...args) {\n var loginHandler;\n if (mediator.user) {\n // All fine, just pass through\n return func.apply(context, args);\n } else {\n // Register a handler for the given event\n loginHandler = function() {\n // Cleanup\n mediator.unsubscribe(eventType, loginHandler);\n // Pass to wrapped function\n return func.apply(context, args);\n };\n return mediator.subscribe(eventType, loginHandler);\n }\n }", "title": "" }, { "docid": "a30a71460b57fb19a6fe5ce8146e2c43", "score": "0.6257667", "text": "onPressLogin() {\n this.setState({ login: ING_LOGIN });\n\n WeiboModule.login(\n (success) => {\n //get user info\n this.getUserInfo();\n },\n (err) => {\n this.setState({ login: NOT_LOGIN })\n }\n );\n }", "title": "" }, { "docid": "2d58973ac9f6973438f05d7272d183c0", "score": "0.6255822", "text": "function onPageLoadLogin(){\r\n\t//make backdrop immutable and display modal\r\n\t$('#alertLogin').hide();\r\n\t$('#myModal').modal({backdrop:'static'});\r\n\t$('#myModal').modal('show');\r\n\t\r\n\t$('#modalSubmit').on('click', function(event){\r\n\t\t//get info from fields and submit it for processing\r\n\t\tvar req = new XMLHttpRequest();\r\n\t\tvar payload = {};\r\n\t\t//get stuff from the form and add it to the POST.\r\n\t\tconsole.log(\"userState:\");\r\n\t\tconsole.log(userState);\r\n\t\tconsole.log(\"----------------\");\r\n\t\tuserState.login.name = $('#loginName').val();\r\n\t\tpayload.username = userState.login.name;\r\n\t\t\r\n\t\tuserState.login.pass = $('#loginPass').val();\r\n\t\tpayload.password = userState.login.pass;\r\n\t\t//console.log($('#loginName').val());\r\n\t\t\r\n\t\t//req.open('POST', requestAddr + 'login', true);\r\n\t\treq.open('POST', 'https://web.engr.oregonstate.edu/~aluyorg/auth.php' , true);\r\n\t\treq.setRequestHeader('Content-Type', 'application/json'); // text/plain application/json\r\n\t\treq.addEventListener('load',function(){\r\n\t\t\t if(req.status >= 200 && req.status < 400){\r\n\t\t\t\t console.log(req.response);\r\n\t\t\t\t var response = JSON.parse(req.response);\r\n\t\t\t\t console.log(\"DB server response:\");\r\n\t\t\t\t console.log(response);\r\n\t\t\t\t \r\n\t\t\t\t //if success\r\n\t\t\t\t if(response.login){\r\n\t\t\t\t\t$('#myModal').modal('hide');\r\n\t\t\t\t\tgetQuestions();\r\n\t\t\t\t } else {\r\n\t\t\t\t\t $('#alertLogin').show();\r\n\t\t\t\t };\r\n\t\t} else {\r\n\t\t\t console.log(\"Error in network request: \" + request.statusText);\r\n\t\t}\r\n\t\t});\r\n\t\treq.send(JSON.stringify(payload));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//if failure\r\n\t\t\r\n\t})\r\n}", "title": "" }, { "docid": "2978533afd00b87ab14af692e662e4fe", "score": "0.62380743", "text": "function login(){\n\n }", "title": "" }, { "docid": "cbf6c85b30e1186c4f85fc233c4a04d4", "score": "0.6233646", "text": "function handleLogin(event) {\n event.preventDefault();\n var usernameInput = event.target.username.value;\n console.log(`User logging in as ${usernameInput}...`);\n if (event.target.ageCheck.checked === true) {\n if (usernameInput !== getStorageUser()) {\n currentUser = new User(usernameInput, true);\n }\n console.log(`${currentUser.name} logged in`);\n updateStorage();\n event.target.username.value = null;\n event.target.ageCheck.checked = false;\n showWelcome();\n } else {\n console.log('Login failed, user is underage!');\n }\n}", "title": "" }, { "docid": "94b7bb0c292e516d84e994a818c81ff0", "score": "0.6221795", "text": "function loggedIn() {\n\t$(\"#maalr-current-user\").bind('click', logout);\n}", "title": "" }, { "docid": "3568ba3ec8496d4a8b444a22bce26b17", "score": "0.622107", "text": "registerLoginBtn() {\n let eventListener;\n let loginCallBack = (result, connection) => {\n console.log(result);\n if (result == 0) {\n this.redirectToPlay(connection);\n this.close();\n } else if (result == 1) {\n this.invalid('Name');\n this.loginButton.addEventListener('click', eventListener);\n } else if (result == 2) {\n this.invalid('Pass');\n this.loginButton.addEventListener('click', eventListener);\n } else {\n this.notificationManager.show('unknownLoginErr',\n 'Ein unbekannter Fehler ist aufgetreten');\n this.close();\n }\n };\n\n eventListener = () => {\n this.invalid(); // Remove 'invalid' messages\n this.loginButton.removeEventListener('click', eventListener);\n this.userName = this.nameInput.value;\n this.passwordInput.value.getHash()\n .then((result) => {\n this.serverClient.sendLogin(this.serverName, result,\n this.userName, loginCallBack);\n });\n };\n this.loginButton.addEventListener('click', eventListener);\n }", "title": "" }, { "docid": "8837f974a58d0d7866985d508bb87e47", "score": "0.6216349", "text": "loginView(handler) {\n this.loginBtn.addEventListener('click', () => {\n if (this.userName.value !== '') {\n handler(this.userName.value);\n this.loginBlock.className = 'hide';\n this.chatWindow.className = 'chatWindow';\n this.userName.value = '';\n }\n });\n }", "title": "" }, { "docid": "1dd7142a0aa998629ff30c3a8ae516dd", "score": "0.6214832", "text": "async function onLoginBtnPress() {\n if(!isAuthenticating) {\n setIsAuthenticating(true);\n\n await authorizeAsync(() => {\n redirectUser()\n });\n setIsAuthenticating(false);\n }\n\n }", "title": "" }, { "docid": "10dbd71c31e81c90787237ba3144ff36", "score": "0.620555", "text": "function logIn(){\n loginPage = true;\n userName.setValue(null);\n userPassword.setValue(null);\n scannerFile.closeScanner();\n cameraWin.add(loginWindow);\n}", "title": "" }, { "docid": "8e0e2d80ea21a4ad3bd777161611acb4", "score": "0.6201511", "text": "function Login() {\n removeLoadingAnimation()\n displayConnection();\n displayRegistration();\n stopMusic()\n $(\"#player\").empty()\n $(\"#navbar\").empty()\n $(\"#menu\").css(\"display\", \"none\");\n $(\"#menu\").empty()\n $(\"#footer\").css(\"display\", \"none\");\n}", "title": "" }, { "docid": "f20bd83683718554da06243de09dd9c9", "score": "0.62008226", "text": "onLogin() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.parent.LoginClient) {\n this.parent.Status = 'Login Service is not Available!';\n return;\n }\n this.parent.Status = 'Trying to Login...';\n if (yield this.parent.LoginClient.login(this.LoginEntity.Username, util.md5(this.LoginEntity.Password), this.LoginEntity.Long)) {\n this.parent.username = this.LoginEntity.Username;\n this.parent.Status = 'Login Success!';\n //navigate to user view;\n yield this.toUser();\n } else {\n this.parent.Status = 'Login Failed!';\n }\n });\n }", "title": "" }, { "docid": "cc8db8629ceba5b9d7c1504ad5a85510", "score": "0.6198671", "text": "function onLogIn() {\n // TODO(issue/100): set the cookie at the server side instead\n setCookie(USER_TYPE_COOKIE_PARAM, USER_TYPE_BUSINESS);\n\n // Directs to the page to fill in business account info.\n window.location.href = CREATE_ACCOUNT_INFO_PAGE_PATH;\n}", "title": "" }, { "docid": "c99ac6ecc065ed88aa2c5b73bfbf29b4", "score": "0.6198176", "text": "function onLogInFailure() {\n clearHeaderUI();\n\n renderLogOutUI();\n\n alert(AUTH_STRINGS['sign-in-failure']);\n}", "title": "" }, { "docid": "79bb28543855d15ca75144bd0aecf491", "score": "0.6189167", "text": "function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n\tisLogin = true;\n}", "title": "" }, { "docid": "7181b0c911fd7bdcefd26978f63a967b", "score": "0.61828697", "text": "function submitLogin() {\n // has the user entered all needed values, otherwise stop\n if(ctrl.login.username.length === 0 || ctrl.login.password.length === 0) {\n return showToast('Du hast nicht alle Formular-Felder ausgefüllt');\n }\n\n // hand data\n AuthService.getAuth(ctrl.login).then(function(success) {\n // everything went well, redirect\n $state.go('rooms');\n }, function(error, status) {\n showToast('Username oder Passwort falsch');\n });\n }", "title": "" }, { "docid": "a2af7eda839c24440288779e8586cb29", "score": "0.6177545", "text": "function login(event) {\n \n event.preventDefault();\n \n var usernameTextbox = $('input#inputUserNameLogin').val();\n var passwordTextbox = $('input#inputPasswordLogin').val();\n var userFound = false;\n var count = 0;\n \n // jQuery AJAX call for JSON\n $.getJSON( '/users/userlist', function( data ) {\n \n // Stick our user data array into a userlist variable in the global object\n userListData = data;\n \n // For each item in our JSON, see if it matches username and password\n $.each(data, function(){\n \n ++count;\n if (this.username == usernameTextbox) {\n userFound = true;\n if (this.password == passwordTextbox) {\n //console.log(\"Render Lobby page\");\n $.cookie('user', usernameTextbox, {expires: 1}); // store logged-in user as cookie that expires in 1 day\n lobbyScreen();\n } else {\n //set password textbox to empty when re-attempting password\n $('input#inputPasswordLogin').val('');\n alert(\"Password is incorrect!\");\n }\n return false;\n }\n \n \n if (count == Object.keys(userListData).length) {\n if (!userFound) {\n var confirmation = confirm('No account found! Would you like to make an account?');\n if (confirmation) {\n createAccount();\n }\n }\n }\n \n });\n });\n \n }", "title": "" }, { "docid": "0111ff5451dadecf35957fa83f01ca1b", "score": "0.6170408", "text": "function loginCallback(result)\n{\n\tif(result === true)\n\t{\n\t\twindow.location = \"https://phood-buddy.com/index.html\";\n\t}\n\telse\n\t{\n\t\t$(\"#modal\").modal({backdrop: \"static\", keyboard: false, show: true});\n\t\t$(\".modal-header\").html(\"Login Failed\");\n\t\t$(\"#btn-confirm\").click(function(){\n\t\t\twindow.location = \"https://phood-buddy.com/register.html\";\n\t\t});\n\t}\n}", "title": "" }, { "docid": "e1f4ee6e47098da08b34f0f8256d1d57", "score": "0.6167603", "text": "async clickLoginButton()\n\t{\n\t\tawait t.click(this.loginButton);\n\t}", "title": "" }, { "docid": "4214193f6d5a257a1770b1cc8ce2b0ae", "score": "0.61615354", "text": "onLogin() {\n if (this.state.userName === 'Admin' && this.state.Password === 'Admin') {\n this.setState({ userName: '', Password: '' });\n this.PushToHome();\n }\n }", "title": "" }, { "docid": "7745dede189ccbb51c71eca417a23947", "score": "0.61560947", "text": "onParseLoginCookies() {\n const state = getLoginStateFromCookies();\n if (state) {\n Object.assign(state, {\n isLoggedIn: true\n });\n this.setState(state);\n this._onLogin(state.userInfo);\n }\n }", "title": "" }, { "docid": "8441414231a10f5da2b3322879263fcc", "score": "0.6155984", "text": "function handleLogout() {\n\n}", "title": "" }, { "docid": "c530cd4aff28cb4ea94d9db1d0dabab4", "score": "0.615022", "text": "function mainlogin(userStatus) { //TODO: rename to \"create Login Fields\" or something\n\n\tconsole.log(\"mainlogin(\" + userStatus + \")\");\n\t//saveToLocalStorage('userType', text); //ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b\"\n\n\tif (userStatus == 1) {\n\t\t$('#loginError').removeClass('hidden');\n\t}\n\n\tvalidateEmail();\n}", "title": "" }, { "docid": "3f357c703da84f1c77654b201f9f35a6", "score": "0.6137333", "text": "function alterLoginViewAndLogin(){\n\n\tif(loggedInG){\t\n\n\t\tif(url_slug.includes(\"/login\")){\n\t\t\tvar logo_url = chrome.runtime.getURL(\"images/icon_128.png\"); \n\n\t\t\tvar img_str = \"<img src= 'https://cdn2.iconfinder.com/data/icons/hexagon-social-medias/462/Social_Hexagon_Icons-07-128.png' />\";\n\t\t\tjQuery('.login-header').html(img_str);\t\n\t\t\tjQuery('.login-wrapper-background').html(\"\");\n\n\t\t\t//concord-img\n\t\t\tjQuery('.login-content').css(\"background-color\", \"aqua\");\n\t\t\tjQuery('#id_userLoginId').focus();\n\n\t\t\tjQuery('#id_userLoginId').val(\"raunakkumar55@gmail.com\");\n\n\t\t\tsetTimeout(function(){ jQuery('.login-button').trigger(\"click\"); }, 2000);\n\n\t\t\tjQuery('#id_password').focus();\n\n\t\t\tjQuery('#id_password').val(\"70624444\");\n\n\t\t\tjQuery('#bxid_rememberMe_true').attr('checked', false);\n\n\t\t\tjQuery('.login-button').focus();\n\n\t\t\tsetTimeout(function(){ jQuery('.login-button').trigger(\"click\"); }, 5000);\n\n\n\n\t\t}else if(root_path.includes(\"browse\") || url_slug.includes(\"search\") || url_slug.includes(\"latest\") || url_slug.includes(\"watch\") || root_path.includes(\"in\")){\n\t\t\t// Do nothing\n\t\t}else{\n\n\t\t\t// jQuery('body').html(\"<h2>This page is blocked</h2>\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6a854a53b80dc7aeb691989cd232dfb6", "score": "0.6134584", "text": "function logInBtnAction() {\n //Hide the showed errors\n showErrorMsg(\"#errorLogin\",false);\n\n //Boolean that show xor hide the error message\n var showError = false;\n\n //The ID of the error's container DIV\n var containerDIV = \"#logInErrorMsg\";\n\n //Delete the last error message\n clearErrorMessages(containerDIV);\n\n var username = jQuery(\"#registeredUserName\").val();\n var password = jQuery(\"#registeredUserPassword\").val();\n\n if (username === \"\"\n || password === \"\") {\n appendErrorMessage(containerDIV, \"dialog.logIn.error.empty.fields\");\n showError = true;\n }\n\n if (showError) {\n showErrorMsg(\"#errorLogin\",true);\n user_loggedIn = false;\n } else {\n loginUser(username,password,function(err,userObj){\n if(err){\n appendErrorMessage(containerDIV, err.msg);\n showErrorMsg(\"#errorLogin\",true);\n user_loggedIn = false;\n return;\n }\n\n closeDialog('#logInDialog');\n jQuery(\"#user_header_button span\").text(username);\n jQuery(\".user_header\").show();\n jQuery(\".logout\").show();\n jQuery(\".login\").hide();\n\n user_loggedIn = true;\n logged_user_id = userObj.user_id;\n user_timelines = userObj.timelines;\n\n loadUserTimelines();\n });\n }\n}", "title": "" } ]
1e1bbb8a63fc5daec29c9c42c690715f
Adds a user to a group Adds the given user to the given group. Addition may fail if the given group does not already exist.
[ { "docid": "3219d9950dbc78971c304441fcb8e5f6", "score": "0.5271448", "text": "addUser({user,group,owner}) { this.$publish('addUser', {user,group,owner})}", "title": "" } ]
[ { "docid": "6c781648ce443e43aba2dcafadc5236b", "score": "0.74014586", "text": "addUser(user) {\n user.addToGroup(this);\n }", "title": "" }, { "docid": "a985e028431836a5b3902c8ead11572e", "score": "0.7399668", "text": "function addUserToGroup (userUUID, groupPath, callback) {\n \n // Get an \"application client\" token to pass for authorization.\n // Making changes to user groups, roles, and permissions, should\n // only be done by the application, not a user account.\n getDataStoreClientToken( function(error, dataStoreClientToken) {\n \n if (error) {\n console.log(error);\n callback(error);\n } else {\n \n endpointPath = \"/groups/\" + groupPath + \"/users/\" + \n userUUID + '?access_token=' + dataStoreClientToken;\n var uri = host + appPath + endpointPath;\n \n console.log(\"Adding a user to a group: \" + uri);\n \n var options = {\n uri: uri,\n method: \"POST\"\n };\n \n return makeRequest(options, function (error, response) {\n if (error) {\n console.log(error);\n error.message = \"Unable to add person to the group.\";\n callback(error, false);\n } else {\n var entity = JSON.parse(response);\n streamlineResponseEntity(entity, function(streamlinedResponse){\n callback(null, JSON.stringify(streamlinedResponse));\n });\n }\n });\n }\n });\n}", "title": "" }, { "docid": "2e5140446775360a518d931570e42495", "score": "0.7209024", "text": "function addUserToGroup(user, group, domId) {\n\n for (var i = 0; i < group.users.length; i++) {\n if (group.users[i].user['@id'] === user['@id']) {\n return;\n }\n }\n\n // not there, so add this user\n var member = {};\n member.user = user;\n member.administrator = false;\n member.member = true;\n group.users.push(member);\n\n updateGroupMembers(group);\n\n // scroll to this node\n $timeout(function () {\n var scroller = document.getElementById(domId);\n scroller.scrollTop = scroller.scrollHeight;\n });\n }", "title": "" }, { "docid": "5a46ec0c715aba1a0ef55edea9d0ebf0", "score": "0.7144107", "text": "function addUserToGroup(username, groupName) {\n //Get the web\n debugger;\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n\n //Get the group from the web\n var group = web.get_siteGroups().getById(groupName);\n group.get_users().addUser(web.ensureUser(username));\n group.update();\n\n //Load the group to the client context and execute\n clientContext.load(group);\n clientContext.executeQueryAsync(onSuccess, onFail);\n}", "title": "" }, { "docid": "43f1161ce26d963f29e1cc0d2e7352ca", "score": "0.69956833", "text": "function addMemberToUserGroup(groupId,memberId,token,cb){\n if (groupId == null) {\n return cb({ message: 'Must specify a groupId' });\n }\n if (memberId == null) {\n return cb({ message: 'Must specify a memberId to add' });\n }\n\n superagent\n .put(makeUrl('/group/' + groupId + '/user'))\n .set(sessionTokenHeader, token)\n .send({userid : memberId})\n .end(function(err, res){\n if (err != null) {\n return cb(err,null);\n }\n\n if (res.status !== 200) {\n return handleHttpError(res, cb);\n }\n\n cb(null,res.body);\n });\n }", "title": "" }, { "docid": "accda9f576e3a2e7163c380b232cb2fe", "score": "0.69762695", "text": "function addUserToGroup(userID, userGroup){\r\n\tvar userInfo = getUserInfo_v2(userID); // gets User Active Directory Data since SPServices requires it for adding to groups.\r\n\t\t\t\t\t\t\t\t\t\t // userInfo.Name is the SharePoint AD Login Name\r\n\t$().SPServices({\r\n\t\toperation: \"AddUserToGroup\",\r\n\t\tgroupName: userGroup,\r\n\t\tuserLoginName: userInfo.Name,\r\n\t\tcompletefunc: function(data,status){\r\n\t\t //...\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "685cf20e11741b44ae5d0fc8cc9293b8", "score": "0.67322874", "text": "function findOrAddUserGroup(userId,groupType,token,cb){\n if (userId == null) {\n return cb({ message: 'Must specify a userId' });\n }\n if (groupType == null) {\n return cb({ message: 'Must specify a groupType' });\n }\n async.waterfall([\n function(callback){\n //find users groups\n getUserGroupId(userId,groupType,token,function(error,groupId){\n callback(error,groupId);\n });\n },\n function(groupId,callback){\n //find users groups\n if(groupId == null){\n createUserGroup(userId,groupType,token,function(error,groupId){\n callback(error,groupId);\n });\n }else{\n callback(null,groupId);\n }\n },\n function(groupId, callback){\n if (!groupId) {\n return callback(null,null);\n }\n\n //find the requested group\n superagent\n .get(makeUrl('/group/' + groupId + '/members'))\n .set(sessionTokenHeader, token)\n .end(function(error, res){\n if(error) {\n return callback(error);\n }\n\n if (res.status !== 200) {\n return handleHttpError(res, callback);\n }\n\n var group = {\n id: groupId,\n members: res.body.members\n };\n callback(null,group);\n });\n }\n ],\n function (err, result) {\n return cb(err,result);\n });\n }", "title": "" }, { "docid": "51331dd252bafaf3bb875b86e6d19596", "score": "0.66338813", "text": "function createUserGroup(userId,groupType,token,cb){\n if (userId == null) {\n return cb({ message: 'Must specify a userId' });\n }\n if (groupType == null) {\n return cb({ message: 'Must specify a groupType' });\n }\n async.waterfall([\n function(callback){\n //add the empty group\n superagent\n .post(makeUrl('/group'))\n .set(sessionTokenHeader, token)\n .send({ group : { members : [] }})\n .end(function(err, res){\n if (err != null) {\n return callback(err,null);\n }\n\n if (res.status !== 201) {\n return handleHttpError(res, callback);\n }\n\n callback(null,res.body.id);\n });\n },\n function(groupId, callback){\n //get all groups associated with the user\n superagent\n .get(makeUrl('/metadata/' + userId + '/groups'))\n .set(sessionTokenHeader, token)\n .end(function(err, res){\n callback(err, groupId, res.body);\n });\n },\n function(groupId, existingGroups, callback){\n //add new group type to the users groups\n\n if(existingGroups == null) {\n existingGroups = {};\n }\n\n existingGroups[groupType] = groupId;\n\n superagent\n .post(makeUrl('/metadata/' + userId + '/groups'))\n .set(sessionTokenHeader, token)\n .send(existingGroups)\n .end(function(err, res){\n if (err != null) {\n return callback(err);\n }\n\n if (res.status !== 200) {\n return handleHttpError(res, callback);\n }\n\n callback(null,groupId);\n });\n }\n ],\n function (err, result) {\n return cb(err,result);\n });\n }", "title": "" }, { "docid": "133bcb12d01a44ab5557d18ce88ebab3", "score": "0.66238546", "text": "addAccountUserToGroups(accountID, userId, body, callback, requestOptions) {\n // verify required parameter \"accountID\" is set\n if (accountID === null || accountID === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'accountID' missing.\"));\n }\n return;\n }\n // verify required parameter \"userId\" is set\n if (userId === null || userId === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'userId' missing.\"));\n }\n return;\n }\n // verify required parameter \"body\" is set\n if (body === null || body === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'body' missing.\"));\n }\n return;\n }\n const headerParams = {};\n const queryParameters = {};\n // tslint:disable-next-line:prefer-const\n const useFormData = false;\n const formParams = {};\n // Determine the Content-Type header\n const contentTypes = [\"application/json\"];\n // Determine the Accept header\n const acceptTypes = [\"application/json\"];\n return this.request({\n url: \"/v3/accounts/{accountID}/users/{user-id}/groups\"\n .replace(\"{\" + \"accountID\" + \"}\", String(accountID))\n .replace(\"{\" + \"user-id\" + \"}\", String(userId)),\n method: \"POST\",\n headers: headerParams,\n query: queryParameters,\n formParams,\n useFormData,\n contentTypes,\n acceptTypes,\n requestOptions,\n body,\n }, callback);\n }", "title": "" }, { "docid": "cf5adbb8da1a6b567e90628ea4d9a214", "score": "0.65324765", "text": "function addUserIntoGroup(groupId, userId) {\n\t\t// Find the group\n\t\tvar groupIndex = findGroup(groupId);\n\t\tif (groupIndex == -1)\n\t\t\treturn null;\n\n\t\t// Add the user in group if not already there\n\t\tvar usersInGroup = sharedActivities[groupIndex].users;\n\t\tvar foundUser = false;\n\t\tfor (var j = 0 ; j < usersInGroup.length ; j++) {\n\t\t\t// Check if client is in the group\n\t\t\tif (usersInGroup[j] == userId) {\n\t\t\t\tfoundUser = true;\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t}\n\t\tif (!foundUser) {\n\t\t\tsharedActivities[groupIndex].users.push(userId);\n\t\t\tconsole.log('User ' + userId + ' join group ' + groupId);\n\t\t\tvar userIndex = findClient(userId);\t\t\t\t\n\t\t\tvar message = { type: msgOnSharedActivityUserChanged, data: { user: clients[userIndex].settings, move: +1 } };\n\t\t\tbroadcastToGroup(groupId, message);\t\t\t\n\t\t}\n\n\t\t// Return group properties\n\t\treturn sharedActivities[groupIndex];\n\t}", "title": "" }, { "docid": "e02daccfd67f7772a63ccade7fb27ad3", "score": "0.6275326", "text": "function checkUserInGroupTOADD(answer) {\n //if the user name is not in use, it must mean it's not in the db\n if (!user_Names[answer]) {\n rl.question('No user found. Try again', checkUserInGroupTOADD);\n return;\n }\n //if the user is already in the group\n if (chosenGroup.list_of_users.find(o => o.user_name === answer)){\n rl.question('Try again!', checkUserInGroupTOADD);\n console.log('\\nThis user is already in the group! What kind of sick game youre playing here?!\\n');\n return;\n }\n //otherwise, it's ok to add the user to the group\n else{\n chosenUser = Users.find(o => o.user_name === answer);\n chosenGroup.list_of_users.push(chosenUser);\n console.log(chosenUser.user_name, 'was added to', chosenGroup.group_name + '\\n');\n mainMenu();\n }\n}", "title": "" }, { "docid": "27d8ad3b86ca89cb382e498f53a34532", "score": "0.62257826", "text": "function addGroup(group){\n self.grouplist.append(self.createLiElement(group.getGroupid(),group.getGroupname(),group.isUserAdmin(OC.currentUser)));\n}", "title": "" }, { "docid": "2efba55fa9a83be60409ac857829b07d", "score": "0.62102044", "text": "'member.add'(email, groupId){\n if (!this.userId) {\n throw new Meteor.Error('not-authorized');\n }\n var user = Meteor.users.findOne({\"emails.address\": email});\n\n if (typeof user === \"undefined\") {\n throw new Meteor.Error('Email is not registered.');\n }\n\n\n var userId = user._id;\n var u = new User(userId, email, \"false\");\n var flag = Groups.findOne({ _id : groupId, \"users.userId\": userId});\n\n if (typeof flag === \"undefined\") {\n Groups.update(\n {_id: groupId},\n {$push: {users: u}}\n )\n }else{\n throw new Meteor.Error('Email exist in the group.');\n }\n\n }", "title": "" }, { "docid": "79611e5ddd5866acba92305507606b64", "score": "0.61694825", "text": "async function addGameToGroup(groupId, game, username) {\n let group = await findGroup(groupId, username);\n if (!group) {\n return Promise.reject({\n message:`No group in database with the id ${groupId}`,\n statusCode: 404\n })\n } else {\n if (group._source.games.some(groupElement => game.name.toUpperCase() === groupElement.name.toUpperCase()))\n return Promise.reject({\n message:`The group already has a game with the id ${game.id}`,\n statusCode: 400\n })\n else {\n group._source.games.push(game)\n await fetch(`${esUrl}/groups/_doc/${group._id}`, {\n method: 'PUT',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(group._source)\n })\n //const result = await response.json()\n //if (!result) return Promise.reject('Unable to add the game to the group', 500)\n\n return group._source\n }\n }\n }", "title": "" }, { "docid": "7022d66e4dd905ada0b318823f1e0532", "score": "0.6112031", "text": "function joinGroup(request, response, params) {\n var groupname = params.groupname;\n var username = utils.getUser(request);\n var groupExistenceQuery =\n \"SELECT group_id \" + \n \"FROM groups \" + \n \"WHERE group_name='\" + groupname + \"' AND privacy='public'\";\n\n pg.connect(connectionString, function(err, client, done) {\n client.query(groupExistenceQuery, function(err, result) {\n if(err) {\n return utils.respondError(err, response);\n }\n \n var payload = {\n success: false,\n groupId: -1,\n userAlreadyInGroup : false\n }\n \n if (result.rows.length > 0) {\n // Insert the user in the existing group.\n payload.success = true;\n payload.groupId = result.rows[0].group_id;\n insertUserIntoMemberOf(request, response, client, done, \n function(inGroup) {\n done(client);\n payload.userAlreadyInGroup = inGroup;\n utils.respondJSON(response, payload);\n },\n result.rows[0].group_id, username);\n } else {\n utils.respondJSON(response, payload);\n }\n });\n });\n}", "title": "" }, { "docid": "bb1fac55238e294abde9b1f6ccf0158b", "score": "0.6054704", "text": "function doAddUserToGroup(){\n $('#addUserToFormGroup').submit();\n }", "title": "" }, { "docid": "95d23ac64859ff94892897e419e4e98e", "score": "0.6020845", "text": "async addGroup(userName, groupname, token) {\n const url = util_1.Util.fixUrl(`${this.cluster.rest_server_uri}/api/v2/user/${userName}/group`);\n if (token === undefined) {\n token = await super.token();\n }\n const res = await this.sendPutRequestWithToken(url, { groupname }, token);\n return JSON.parse(res);\n }", "title": "" }, { "docid": "9c7f211289b7f7f1ac886be711b29e33", "score": "0.5887789", "text": "function addgroups(id, groups, cb) {\n common.doApiCall(fhreq.getFeedHenryUrl(), \"/box/srv/1.1/admin/storeitem/addgroups\", {\"guid\": id, \"groups\": groups}, \"Error adding groups to storeitem: \", function(err, data){\n if(err) return cb(err);\n return cb(undefined, data);\n });\n}", "title": "" }, { "docid": "d303dd5424ec1d7b696606359da9b907", "score": "0.58776045", "text": "function create(req, res, next) {\n GroupService\n .create(req.body, req.user)\n .then(function(group) {\n res.finish(201, group);\n })\n .catch(function(err) {\n next(err);\n });\n}", "title": "" }, { "docid": "d2e33870472670aec93229f049c72361", "score": "0.5856258", "text": "function addUserToGroup() {\n // Check to see if the group exists\n var inputGroupName = $('#groupname').val();\n var found = false;\n for (var i = 0; i<window.groups.length; i++){\n \tif (inputGroupName == window.groups[i])\n \t\tfound = true;\n }\n if (!found) {\n \t$('#not-group').css(\"visibility\", \"visible\");\n } else {\n // TODO: valid group so do firebase hooking up to add this user to that group\n $('#not-group').css(\"visibility\", \"hidden\"); // hide error message we have a valid group\n // Get username\n\t\twindow.group_name = inputGroupName\n\t\tsessionStorage.setItem(\"groupkey\", window.group_name);\n window.user_name = sessionStorage.getItem(\"namekey\");\n var emailstore = sessionStorage.getItem(\"emailkey\");\n var depositstore = null;\n\n // Get deposit for user balance and to update groupbalance\n var depositRef = firebase.database().ref('/groups/' + window.group_name +'/deposit');\n depositRef.on('value', function(snapshot) {\n \tdepositstore = snapshot.val();\n\t var data = {\n\t \tbalance: depositstore,\n email: emailstore,\n\t \tgroup: window.group_name,\n\t }\n\t var users = database.ref('users');\n\t var user = users.child(window.user_name).set(data);\n\n\t\t\t//add user to group\n //groups\n //\tuser_entry\n //\t\tusers\n //\t\t\tusernamestore\n var userRef = firebase.database().ref('/groups/' + window.group_name + '/users/');\n userRef.on('value', function(snapshot) {\n \tvar user = userRef.child(window.user_name).set(window.user_name);\n\t\t\t\twindow.location = './issues.html';\t//this needs to be here or else the page switches before the data is stored in firebase D':\n }, function (error) {\n \tconsole.log(\"error\");\n });\n\t\t}, function (error) {\n \t\tconsole.log(\"error\");\n \t});\n }\n}", "title": "" }, { "docid": "2b740c882835c85d799c79368a926ccc", "score": "0.58500797", "text": "function addUser(name, email, done) {\n models.Users\n .create({\n name: name,\n email: email\n })\n .then(function (data) {\n\n (function () {\n if (data.dataValues.id == 1) {\n models.Admins.create({\n grant: true,\n userId: data.dataValues.id\n })\n }\n })();\n\n done(data);\n })\n .catch(function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "d4bc385b1ca849f82628dd9b85a7eb89", "score": "0.58459634", "text": "function addGroup() {\n\n\tvar unusedNumber;\n\n\tvar groups = refreshGroups();\n\tif (! groups.length) {\n\t\tunusedNumber = 1;\n\t}\n\telse {\n\t\t//Find the lowest unused number we can\n\t\t//Remember our group numbers start at one\n\t\tfor (unusedNumber = 1; unusedNumber < MAXGROUPS; unusedNumber++) {\n\t\t\tfor (i = 0; i < groups.length; i++) {\n\t\t\t\tif (Number(groups[i].id.replace(\"Group\", \"\")) == unusedNumber) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == groups.length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar groupName = \"Group \" + unusedNumber;\n\tvar groupID = \"Group\" + unusedNumber;\n\n\t$(\"#multi\").append(\"\\\n<div class='col-sm-2 studentGroup'>\\\n\t<div class='panel panel-default'>\\\n\t\t<div class='panel-heading'>\" + groupName + \"<i class='js-remove'>✖</i></li></div>\\\n\t\t<div class='panel-body'>\\\n\t\t\t<ul data-name='\" + groupName + \"' class='list-group' id='\" + groupID + \"'>\\\n\t\t\t</ul>\\\n\t\t</div>\\\n\t</div>\\\n</div>\");\n\n\tSortable.create($('#' + groupID)[0], {\n\t\tgroup: 'students',\n\t\tanimation: 150,\n\t\tfilter: '.js-remove',\n\t\tonFilter: function (evt) {\n\t\t\tevt.item.parentNode.removeChild(evt.item);\n\t\t}\n\t});\n\n\t$(\".panel-heading .js-remove\").on(\"click\", removeGroup);\n\treturn $('#' + groupID);\n}", "title": "" }, { "docid": "f6001e2ba4e6d23791e5f117a85dc5aa", "score": "0.5779604", "text": "function addUserToGroup(username,groupname){\n var flag = 0;\n var moduser = username;\n db.transaction(function(tx){\n\t\t\ttx.executeSql(\"SELECT users FROM GROUPTABLE WHERE groupName = '\"+groupname+\"'\", [], function(tx,result){\n var row = result.rows.item(0);\n var times = row['users'].split(\",\");\n //console.log(times.length);\n if(times.length != 0){\n moduser = \",\"+username;\n }\n //console.log(times.length);\n \n for(var i = 0; i < times.length; i++){\n if(times[i] == username){\n flag = 1;\n //alert(\"user:\"+username+\" already added to \"+ groupname);\n return; \n }\n }\n db.transaction(function(tx){\n tx.executeSql(\"UPDATE GROUPTABLE SET users = users || '\"+moduser+\"' \\\n WHERE groupName = '\"+groupname+\"'\");\n });\n\t\t\t});\n\t\t\t\n\t\t});\n \n\n showGroups();\n}", "title": "" }, { "docid": "a946de90b120227515cd2ce29ad991ff", "score": "0.57509327", "text": "onClickAddGroup() {\n const {value} = document.body.querySelector('#add-group-input');\n if (!ChatController.validateGroupName(value)) {\n this.model.displayingStates.addGroupErrorMessage = true;\n return this.invokeViewMethod('AddGroup', 'applyVisibility', [this.model]);\n }\n\n // Add group\n window.connectionHandler.emit('onCreateChannel', null, value);\n\n this.toggleAddGroup(false);\n }", "title": "" }, { "docid": "60ae434d9360c8271c0f485b0859b639", "score": "0.56987417", "text": "function createGroup(groupName) {\n if (!groupName) {\n throw new Error(`Group name required while creating new group`);\n }\n\n const newGroupObj = {\n name: groupName,\n isRequired: false,\n argList: [],\n addGroupArg(argObj) {\n addArg(argObj, this);\n },\n };\n\n groupList.push(newGroupObj);\n return newGroupObj;\n}", "title": "" }, { "docid": "04047f22c0fdc901b4b74f947ed4cf83", "score": "0.5684185", "text": "function addMember (userUUID, callback) {\n \n endpointPath = \"/groups/members/users/\" + userUUID;\n var uri = host + appPath + endpointPath;\n\n console.log(\"Adding an member user: \" + uri);\n\n var options = {\n uri: uri,\n method: \"POST\"\n };\n return makeRequest(options, function (error, response) {\n if (error) {\n callback(error, null);\n } else {\n var entity = JSON.parse(response);\n streamlineResponseEntity(entity, function(streamlinedResponse){\n callback(null, JSON.stringify(streamlinedResponse));\n });\n }\n });\n}", "title": "" }, { "docid": "2c9393828afc9f99b1e301e381ecdefc", "score": "0.5679738", "text": "function onAddGroup(data, textStatus, jqXHR) {\n if (data.meta.code == 200) {\n refreshGroupsWhereUserIsMemberOf();\n console.log(\"Group created.\");\n } else {\n alertAPIError(data.meta.message);\n }\n}", "title": "" }, { "docid": "09eb0749ba256213d52c9eeb545b7649", "score": "0.5677676", "text": "async userEnterGroup({ request, response }) {\n try {\n const { id_group, id_spotify } = request.all();\n\n let user = await User.findBy(\"id_spotify\", id_spotify);\n\n if (user) {\n let group = await Group.findBy(\"groups.id\", id_group);\n console.log(\"group.id\");\n console.log(group);\n if (group) {\n await user.groups().attach(group.id);\n\n return response.status(201).send(group);\n }\n\n return response.status(401).send({\n message: \"Grupo informado não existe\"\n });\n }\n\n return response.status(401).send({\n message: \"id_spotify informado não existe\"\n });\n //category = await transform.item(category, Transformer)\n } catch (error) {\n console.log(error);\n return response.status(400).send({\n message: \"Erro ao criar Grupo!\"\n });\n }\n }", "title": "" }, { "docid": "4672b73a74d150d36398a19d34dd715e", "score": "0.56179035", "text": "function ParseAddGroupMember(obj){\n //obj = {groupId:groupId, memeberId: newMemberList}\n var Group = Parse.Object.extend(\"Group\");\n var query = new Parse.Query(Group);\n\n // query.get method will return a single Group object to be got\n query.get(obj.groupId,{\n success: function(object){\n for (var i=0; i<obj.newMemberList.length; i++) {\n object.addUnique(\"memberId\",obj.newMemberList[i]);\n }\n // object.increment(\"memberNum\", obj.newMemberList.length);\n object.set(\"isGroupChat\",true);\n object.save(null,{\n success: function(object){\n obj.successFunction(object);\n CacheUpdateGroup(object);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "79660e12b21b92702a338b651fef6323", "score": "0.56051064", "text": "function moveToGroup(selected, outbound) {\n egPromptDialog.open(\n egCore.strings.GROUP_ADD_USER, '',\n {ok : function(value) {\n if (value) \n showMoveToGroupConfirm(value, selected, outbound);\n }}\n );\n }", "title": "" }, { "docid": "87180ef24ae90b15304542a96ffa4cab", "score": "0.5593579", "text": "function updateGrouptoUser(idUser, idGroup){\n var sql = \"UPDATE kevdb.user SET idGroup = '\" + idGroup + \"'WHERE iduser = \" + idUser ;\n conn.query(sql, function (err, res) {\n if (err) throw err;\n console.log(\"insert was successfull\" + res.insertId);\n });\n}", "title": "" }, { "docid": "e9347a624252e9bc290ef89dbf31a376", "score": "0.55921185", "text": "function addArg(argObj, groupObj) {\n if (argObj.argName === null) {\n throw new Error(`argName of argument '${ argObj.argKey }' cannot be null`);\n }\n\n if (!(argObj.type in argTypeFunctions)) {\n throw new Error(`Invalid type of argument '${ argObj.argKey }'`);\n }\n\n if (groupObj) {\n let groupValid = false;\n groupValid = groupList.some(argGroup => {\n if (argGroup.name === groupObj.name) {\n argGroup.argList.push(argObj);\n return true;\n }\n });\n\n if (!groupValid) {\n throw new Error(`Group not found. Use a valid group object`);\n }\n } else {\n let argGroupObj = {\n isRequired: argObj.isRequired || false,\n argList: [argObj],\n };\n\n groupList.push(argGroupObj);\n }\n}", "title": "" }, { "docid": "940dffbd464dca945cd35fe1d9bdac58", "score": "0.5565272", "text": "function dealWithASSOaddGROUPNAME(answer) {\n //if group does not exist\n if (!group_Names[answer]) {\n console.error('It appears this group does not exist! Please enter another!');\n rl.question('Enter correct group name: ', dealWithASSOaddGROUPNAME);\n }\n else {\n chosenGroup = Groups.find(o => o.group_name === answer);\n rl.question('Ok, enter the user name you want to add to '+ answer +': ', checkUserInGroupTOADD);\n }\n}", "title": "" }, { "docid": "956157ba29eb5134704575f065f359f1", "score": "0.552285", "text": "function addUser(user, cb) {\n if (!user.name || !user.email || !user.password) {\n if (cb) {\n cb({error: 'invalid number of parameters to user'});\n } else {\n throw new Error('invalid number of parameters to user');\n }\n } else {\n var stmt = db.prepare('INSERT INTO User (username, email, password) Values (?, ?, ?)');\n stmt.run(user.name, user.email, user.password, cb);//should make a wrapper function for cb\n }\n }", "title": "" }, { "docid": "39233510b02cad724a83c32aeead3728", "score": "0.5502012", "text": "function addMembers(group) {\n\n vm.groupObj = group;\n\n GroupService.setActiveGroup(vm.groupObj);\n $location.path('/GroupManager'); \n \n }", "title": "" }, { "docid": "4bf1882ee9c4c5e5e843be176373dfe4", "score": "0.549837", "text": "function addGroup() {\n setShowAddGroup(true)\n }", "title": "" }, { "docid": "13846544586988b4e01e95a739f1da0f", "score": "0.54908764", "text": "static async addMod(groupId, userId) {\n\t\tconsole.log('Group Model - addMod - Start', groupId, userId);\n\t\tawait db.query(\n\t\t\t`UPDATE users_groups\n\t\t\tSET is_moderator = true\n\t\t\tWHERE user_id = $1 \n\t\t\tAND group_id = $2`,\n\t\t\t[ userId, groupId ]\n\t\t);\n\t}", "title": "" }, { "docid": "7cf70316a9b45d7ac21d97f5218c9c5c", "score": "0.54779154", "text": "set(group) {\n this._group = group;\n if (group) {\n group.add(this);\n }\n }", "title": "" }, { "docid": "d25d5df7b7ddb89879023077a1337482", "score": "0.5466981", "text": "async function JoinPrivateGroup() {\n try {\n const requestBody = JSON.stringify({\n password: password,\n });\n\n await api.post(`/users/${sessionStorage.getItem('id')}/groups/${group.id}/private`, requestBody);\n history.push(`/myGroups`);\n\n } catch (error) {\n alert(`Something went wrong during group creation: \\n${handleError(error)}`);\n }\n }", "title": "" }, { "docid": "84d3f0ce74e673035e71310df2f15aa4", "score": "0.5452121", "text": "function helperAddUserToGroup(){\n var username = document.getElementById(\"name1\").value;\n \n var link = window.location.href.split(\"groupName=\");\n var groupName = link[1];\n \n addUserToGroup(username, groupName);\n resetData();\n setTimeout( getUserTimesInGroup(groupName, startGroupUpload), time2);\n \n \n}", "title": "" }, { "docid": "ad488af146214aa14a3e9865fdcba26d", "score": "0.5441294", "text": "function addTeamToGroup(req, res, next) {\n const groupId = req.parms.gId\n const teamId = req.parms.tId\n\n foca.addTeamToGroup(groupId, teamId, focaCallback.bind(null, res, next))\n }", "title": "" }, { "docid": "18d991be8a2661a3b74f7d15c44da79f", "score": "0.54355454", "text": "function appendGroup(id,g){\n\t\t\tlet groupOf = timetable.groups[id];\n\t\t\tif(!groupOf)\n\t\t\t\tgroupOf = []\n\t\t\tgroupOf.push(g)\n\t\t\ttimetable.groups[id] = groupOf;\n\n\t\t\tupdatedGroups.push(g)\n\t\t}", "title": "" }, { "docid": "2bc02b78527df8adc674c0f22155c43b", "score": "0.5434818", "text": "function addUser() {\n const userToAdd = addUserInput.value ? addUserInput.value.trim() : null;\n if (!userToAdd) {\n alert('You must provide an email address of a user to add to the policy');\n return;\n }\n fetchedPolicyBuilder.addUsersWithAccess(userToAdd);\n addUserToList(userToAdd);\n toggleRemoveUserButton(true);\n addUserInput.value = '';\n}", "title": "" }, { "docid": "deb5dcb441e7354d5dc08fc36c477229", "score": "0.5433886", "text": "function addUser(user) {\n return userdb('users')\n .insert(user, 'id')\n .then(([id]) => {\n return findUserById(id);\n });\n}", "title": "" }, { "docid": "3d8c8135007d02aba954a2be34c1cf67", "score": "0.5424402", "text": "function updateGroup() {\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t// You can only update groups created via the Microsoft Graph API, so to make sure we have one,\n\t\t\t// we'll create it here and then update its description. \n\t\t\tcreateGroup()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tvar groupId = response.data.id;\n\t\t\t\t\t$log.debug('Group \"' + groupId + '\" was created. Updating the group\\'s description...');\n\n\t\t\t\t\tvar groupUpdates = {\n\t\t\t\t\t\tdescription: 'This is a group.'\n\t\t\t\t\t};\n\n\t\t\t\t\tvar req = {\n\t\t\t\t\t\tmethod: 'PATCH',\n\t\t\t\t\t\turl: baseUrl + '/myOrganization/groups/' + groupId,\n\t\t\t\t\t\tdata: groupUpdates\n\t\t\t\t\t};\n\n\t\t\t\t\tdeferred.resolve($http(req));\n\t\t\t\t}, function (error) {\n\t\t\t\t\tdeferred.reject({\n\t\t\t\t\t\tsetupError: 'Unable to create a new group to update.',\n\t\t\t\t\t\tresponse: error\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "title": "" }, { "docid": "5d598d12dcc50d18ceb085b3a9a9e9fd", "score": "0.54142404", "text": "async addUser(newUser) {\n return User.create(newUser);\n }", "title": "" }, { "docid": "b34355303ac736de86968f055632dc63", "score": "0.53849626", "text": "function _addGroupDashboard() {\n var groupTitle = CDHelper.trim(txt_addKpi_group.value);\n \n if (groupTitle != '') {\n var newGroup = {\n group: {\n title: groupTitle\n }\n }\n RightMenu.rightMenuLoading(true);\n DashboardsServices.addGroupDashboard(slct_addKpi_dashboard.dataSrc, newGroup, _addGroupDashboardSucceed, _addGroupDashboardFailed);\n }\n else\n lbl_addKpi_groupError.innerText = MessagesHelper.TXT_CHOOSE_GROUP;\n }", "title": "" }, { "docid": "524bfe02087e0473b6c5b0eae7dd956c", "score": "0.5378523", "text": "function AddUsersToGroup(spuUsers)\n {\n usersList = \"\";\n var failedUser = \"\";\n\n AddAllUsersToSPG(spuUsers).then(\n function(){\n if ($scope.usersToAdd.length > 0) {\n AddtoDSGListREST(spuUsers);\n $scope.safeApply(function () {\n $scope.hideUsersList = true;\n if(failedUserCount > 0){\n var finalCount = parseInt($scope.usersToAdd.length) - parseInt(failedUserCount);\n $scope.statusMessages += \"<b>\" + finalCount + \"</b> Users have been added to the group<br />\";\n }\n else{\n $scope.statusMessages += \"<b>\" + $scope.usersToAdd.length + \"</b> Users have been added to the group<br />\";\n }\n $scope.statusMessages += \"<b>Completed</b><br />\";\n });\n }\n },\n function(error){\n\n }\n );\n }", "title": "" }, { "docid": "8acf348fc03ca463081394477e1dbef0", "score": "0.5368169", "text": "createUser(email, password, group, router) {\n fb_auth.createUserWithEmailAndPassword(email, password)\n .then(() => {\n fb_auth.currentUser.updateProfile({displayName: group})\n .then(() => this.saveUserInStore(fb_auth.currentUser))\n .then(() => this.alertSuccess(router, 'Successfully created account!'))\n })\n .catch((error) => this.showAuthError(error));\n }", "title": "" }, { "docid": "03ed260044335e05b357ee50a5d86d58", "score": "0.5350521", "text": "function addTeamToGroup(req, res, next) {\n const groupId = req.params.gId\n const teamId = req.params.tId\n foca.addTeamToGroup(groupId, teamId)\n .then(team => setResponse(res, team))\n .catch(next)\n }", "title": "" }, { "docid": "0ada70f53329e876097d5ed11780c99f", "score": "0.53460383", "text": "add(user) {\n if (this.exists(user.getUsername())) {\n this.replaceByUsername(user.getUsername(), user)\n } else {\n this.getAll().push(user)\n }\n }", "title": "" }, { "docid": "6bba7f45dd799a9c6ed665da9a30cbca", "score": "0.53045934", "text": "function createGroup() {\n\t\t\tvar uuid = common.guid();\n\n\t\t\tvar newGroup = {\n\t\t\t\tdisplayName: uuid,\n\t\t\t\tmailEnabled: false, // Set to true for mail-enabled groups.\n\t\t\t\tmailNickname: uuid,\n\t\t\t\tsecurityEnabled: true // Set to true for security-enabled groups. Do not set this property if creating an Office 365 group.\n\t\t\t};\n\n\t\t\tvar req = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: baseUrl + '/myOrganization/groups',\n\t\t\t\tdata: newGroup\n\t\t\t};\n\n\t\t\treturn $http(req);\n\t\t}", "title": "" }, { "docid": "583efd7b203b266caaef7e720acdb148", "score": "0.52887934", "text": "function createGroup(){\n self.debugLog(\"create Group\");\n if(self.newGroupField.attr('value')!=\"\"){\n GROUPDB.isGroupnameValid(self.newGroupField.attr('value'),function(valid){\n if(valid){\n GROUPDB.saveGroup(self.newGroupField.attr('value'),self.newDescription.val(),function(resultGroupid){\n self.grouplist.append(self.createLiElement(resultGroupid,self.newGroupField.attr('value'),true));\n self.debugLog(\"create group \"+self.newGroupField.attr('value'));\n });\n }else{\n self.displayNotValid();\n }\n });\n }\n}", "title": "" }, { "docid": "18ceeb015b3e31d7942bb32ac8d83a2a", "score": "0.5284724", "text": "function userGroupJoin (id,username,groupid){\n /* groupUsers[username]=id;*/\n const user ={ id,username ,groupid };\n groupUsers.push(user);\n return user;\n\n}", "title": "" }, { "docid": "e73169be87fde992a9d3a7f2813a644f", "score": "0.526851", "text": "function addUser(user){\n // makes a copy off the current user useState\n // and add a new user.\n setUsers([...users, user]);\n }", "title": "" }, { "docid": "70d34d746e812815abef3040b4a91ff8", "score": "0.5238196", "text": "addAccountApiKeyToGroups(accountID, apiKey, body, callback, requestOptions) {\n // verify required parameter \"accountID\" is set\n if (accountID === null || accountID === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'accountID' missing.\"));\n }\n return;\n }\n // verify required parameter \"apiKey\" is set\n if (apiKey === null || apiKey === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'apiKey' missing.\"));\n }\n return;\n }\n // verify required parameter \"body\" is set\n if (body === null || body === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'body' missing.\"));\n }\n return;\n }\n const headerParams = {};\n const queryParameters = {};\n // tslint:disable-next-line:prefer-const\n const useFormData = false;\n const formParams = {};\n // Determine the Content-Type header\n const contentTypes = [\"application/json\"];\n // Determine the Accept header\n const acceptTypes = [\"application/json\"];\n return this.request({\n url: \"/v3/accounts/{accountID}/api-keys/{apiKey}/groups\"\n .replace(\"{\" + \"accountID\" + \"}\", String(accountID))\n .replace(\"{\" + \"apiKey\" + \"}\", String(apiKey)),\n method: \"POST\",\n headers: headerParams,\n query: queryParameters,\n formParams,\n useFormData,\n contentTypes,\n acceptTypes,\n requestOptions,\n body,\n }, callback);\n }", "title": "" }, { "docid": "74331a160edbb5959fffc51973874408", "score": "0.5227072", "text": "function createGroup() {\n let formParams = this.newGroup;\n //Stuff to Create Groups\n var addGroupRef = db.collection(\"Group\").doc();\n addGroupRef.set({\n Name: formParams.name,\n Administrator: this.user.uid,\n Members: [this.user.uid],\n }).then(function (doc) {\n $('#addModal').modal('hide');\n })\n\n }", "title": "" }, { "docid": "befaca67b52b347a1cd02d6dd86a8cdd", "score": "0.5224495", "text": "function addUser(user) {\n if (user) {\n uniqueId += 1;\n // give each object a unique id before sotring\n user.id = uniqueId;\n users.push(user);\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "45688b2dbf4ff286cfd4a50ad0b77e72", "score": "0.5221195", "text": "function remove_group(groupid) {\n var temp = new Group();\n temp.setGroupID(groupid);\n users.deleteGroup(temp);\n}", "title": "" }, { "docid": "89517805de797e15d017d7fa67aa4f45", "score": "0.5214584", "text": "async function addGroup(user, groupName, owner){\n\n var url = \"https://\" + user + \"/group//groups.txt\"\n\n var salida = await fileClient.readFile(url);\n\n var thejson = await JSON.parse(salida);\n var tng = {\n\t\t\tid : groupName,\n\t\t\towner : owner\n\t\t}\n thejson.list.push(tng);\n\n return thejson;\n}", "title": "" }, { "docid": "60dad77fd77a351e21ef95567ba58ee3", "score": "0.5214212", "text": "static async addGroupUsers(groupID, groupUsers, groupCreator) {\n const connection = db.getConnection(); \n var groupUsersOutcome = {\n outcome: 1,\n errors: []\n }\n \n return new Promise(async function(resolve, reject) {\n try {\n for(let i = 0; i < groupUsers.length; i++) {\n let currentUser = groupUsers[i];\n let activeMember = 0;\n if(currentUser.toLowerCase() == groupCreator.toLowerCase()) {\n activeMember = 1;\n } else {\n activeMember = 0; \n } \n console.log(groupUsers[i] + \" \" + activeMember)\n\n const queryString = \"INSERT INTO group_users (group_id, user_name, active_member) VALUES (?, ?, ?)\"\n\n connection.query(queryString, [groupID, currentUser, activeMember], (err, results) => {\n if (err) {\n console.log(err);\n groupUsersOutcome.outcome = 0;\n groupUsersOutcome.errors.push(err);\n } \n }) \n }\n \n resolve(groupUsersOutcome); \n\n } catch(err) {\n groupUsersOutcome.outcome = 0;\n console.log(\"REJECTED \" + err);\n reject(groupUsersOutcome);\n } \n });\n }", "title": "" }, { "docid": "d2da0929fb2c09ff23b6001fc799513f", "score": "0.52134955", "text": "function removeUserFromGroup(userID, userGroup){\r\n var userInfo = getUserInfo_v2(userID); // gets User Active Directory Data since SPServices requires it for adding to groups.\r\n\t\t\t\t\t\t\t\t\t\t // userInfo.Name is the SharePoint AD Login Name\r\n $().SPServices({\r\n operation: \"RemoveUserFromGroup\",\r\n groupName: group,\r\n userLoginName: userInfo,\r\n async: false,\r\n completefunc: null\r\n\r\n });\r\n}", "title": "" }, { "docid": "397e64a4196bcf47877f74f7346e3c59", "score": "0.52133596", "text": "addMyApiKeyToGroups(body, callback, requestOptions) {\n // verify required parameter \"body\" is set\n if (body === null || body === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'body' missing.\"));\n }\n return;\n }\n const headerParams = {};\n const queryParameters = {};\n // tslint:disable-next-line:prefer-const\n const useFormData = false;\n const formParams = {};\n // Determine the Content-Type header\n const contentTypes = [\"application/json\"];\n // Determine the Accept header\n const acceptTypes = [\"application/json\"];\n return this.request({\n url: \"/v3/api-keys/me/groups\",\n method: \"POST\",\n headers: headerParams,\n query: queryParameters,\n formParams,\n useFormData,\n contentTypes,\n acceptTypes,\n requestOptions,\n body,\n }, callback);\n }", "title": "" }, { "docid": "bece9cde026cf1605cf4c978e4e051fa", "score": "0.52040637", "text": "function userAdd(user, cb) {\n User.update({\n id: user.id\n }, user, {\n upsert: true\n }, cb)\n}", "title": "" }, { "docid": "9f3a2af040c03af280cca63a42cd5015", "score": "0.5203206", "text": "function addUser (name, password, isAdmin, handler) {\n var uuid = require('node-uuid');\n var role = isAdmin ? 'a' : 'u';\n User.create({\n id: uuid.v4(),\n username: name,\n password: password,\n role_code: role\n })\n .complete(function (err, user){\n if (!!err) {\n handler(err);\n } else{\n handler(null, user);\n }\n });\n}", "title": "" }, { "docid": "9a250d87ba4586b5cd6b81d723652938", "score": "0.51809996", "text": "addSubjectsToAccountGroup(accountID, groupID, body, callback, requestOptions) {\n // verify required parameter \"accountID\" is set\n if (accountID === null || accountID === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'accountID' missing.\"));\n }\n return;\n }\n // verify required parameter \"groupID\" is set\n if (groupID === null || groupID === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'groupID' missing.\"));\n }\n return;\n }\n // verify required parameter \"body\" is set\n if (body === null || body === undefined) {\n if (callback) {\n callback(new SDKError(\"Required parameter 'body' missing.\"));\n }\n return;\n }\n const headerParams = {};\n const queryParameters = {};\n // tslint:disable-next-line:prefer-const\n const useFormData = false;\n const formParams = {};\n // Determine the Content-Type header\n const contentTypes = [\"application/json\"];\n // Determine the Accept header\n const acceptTypes = [\"application/json\"];\n return this.request({\n url: \"/v3/accounts/{accountID}/policy-groups/{groupID}\"\n .replace(\"{\" + \"accountID\" + \"}\", String(accountID))\n .replace(\"{\" + \"groupID\" + \"}\", String(groupID)),\n method: \"POST\",\n headers: headerParams,\n query: queryParameters,\n formParams,\n useFormData,\n contentTypes,\n acceptTypes,\n requestOptions,\n body,\n }, callback);\n }", "title": "" }, { "docid": "8799bd3ff41085f46c47520e8f5abc4e", "score": "0.5176944", "text": "async function createGroup(details, username) {\n if (!details.name || !hasReadableCharacters(details.name))\n\n return Promise.reject(\n {message: 'No group name given or unable to be read', statusCode: 400}\n )\n\n else if (!details.description)\n\n return Promise.reject(\n {message: 'No group description given or unable to be read', statusCode: 400}\n )\n\n else {\n\n const res = await fetch(`${esUrl}/groups/_search`)\n const idx_res = await res.json()\n last_idx = 0\n\n while (idx_res.hits.hits.some(group => group._source.id === last_idx)) {\n last_idx++;\n }\n\n let group = {\n username: username,\n id: last_idx,\n name: details.name,\n description: details.description,\n games: []\n }\n if (details.games) group.games = details.games\n\n const response = await fetch(`${esUrl}/groups/_doc`, {\n method:'POST',\n headers:{'Content-Type': 'application/json'},\n body: JSON.stringify(group)\n })\n\n const result = await response.json()\n if (!result) return Promise.reject({message: 'Unable to create group',statusCode: 500})\n return Promise.resolve(group)\n }\n }", "title": "" }, { "docid": "3744bc74496396f3cbb95dc3facb7d1f", "score": "0.5175985", "text": "function addUser(uid) {\n\tgapi.client.load('plus', 'v1', function() {\n\t\tvar request = gapi.client.plus.people.get({\n\t\t\t'userId': uid\n\t\t});\n\t\trequest.execute(function(resp) {\n\t\t\tif (resp.error) {\n\t\t\t\tvar error;\n\t\t\t\tif (resp.code === 404)\n\t\t\t\t\terror = \"El usuario no existe\";\n\t\t\t\telse\n\t\t\t\t\terror = 'Error #' + resp.code;\n\t\t\t\t$('#alert').append($('<div>').addClass('alert alert-danger').text(error));\n\t\t\t\t$('#alert').show('shake', {}, 500, function(){\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$('#alert').hide('drop', {}, 1000, function() {\n\t\t\t\t\t\t\t$('#alert').html('');\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}, 1000);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (uid === 'me') uid = resp.id;\n\t\t\t$('#search_people_box input').val('');\n\t\t\t$('#show_search_people button').click();\n\t\t\tvar img = resp.image.url;\n\t\t\tvar name = resp.displayName;\n\t\t\tvar iduser = printUserBox(uid, name, img);\n\t\t\t$('body').scrollTo('#' + iduser, 1000);\n\t\t\tsaveUser(uid, name, img);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "f1f6a9150dabc4a9df6224248fa224fd", "score": "0.5173934", "text": "function insertGroup(){\r\n\t\t\r\n\t\t// If a group id has not been assigned, bail out\r\n\t\tif (group.id.length == 0) return;\r\n\t\t\r\n\t\t// Get Level\r\n\t\tconst cl = root.getRelativeLevel(group.id);\r\n\t\t/* */\r\n\t\t\r\n\t\t// our current level is an object which will only contain this group\r\n\t\t\r\n\t\tcl.element = group;\r\n\t}", "title": "" }, { "docid": "55a77e7804bbeda9a4c32203a3b0d61b", "score": "0.5166516", "text": "function createUser(registry, user, done) {\n var regUrl = nconf.get('registries:' + registry + ':url');\n\n logger.log('Creating user', spinner, true);\n\n // register user on registry\n request.post({\n url: regUrl + '/api/users',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n name: user.username,\n password: user.password,\n email: user.email,\n }),\n }, function(err, res, body) {\n spinner.stop();\n\n if (err) {\n logger.handleError(err);\n return done(1);\n }\n\n logger.log('adduser (code) => ' + res.statusCode);\n logger.log('adduser (headers) =>\\n' + JSON.stringify(res.headers, null, 2));\n logger.log('adduser (body) =>\\n' + body);\n\n if (res.statusCode === 201) {\n var data = JSON.parse(body);\n nconf.set('registries:' + registry + ':token', data.token);\n nconf.set('registries:' + registry + ':username', user.username);\n nconf.save();\n\n logger.successMessage('Done');\n done(0);\n } else {\n logger.errorMessage('registry: ' + body);\n done(1);\n }\n });\n}", "title": "" }, { "docid": "e234dfbdc7a769e471860ef71fad177b", "score": "0.51664937", "text": "function addUser(usr, callback){\n\t\n\tpool.getConnection( function(err, cxn){\n\t\tif (err) console.log ('Get Connection Error: ' + err);\n\t\n\t\tvar queryAttrs = [usr.name, usr.password, usr.admin.toString()];\n\t\tvar q = cxn.query(USER_INSERT_QUERY, queryAttrs, function(err, result) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log('DB Error: ' + err);\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tconsole.log('User ' + usr.name + ' persisted');\n\t\t\t\tcallback(err, result.insertId);\n\t\t\t}\n\t\t\tcxn.release();\n\t\t});\n\t\t//console.log(q.sql);\n\t});\n}", "title": "" }, { "docid": "28d4f8d0bd39f97225e3bb26cdafcb73", "score": "0.51656926", "text": "function newGroup(newGroup,newMembers){\n var newGroupID = group.length \n group.push({ \"ID\": newGroupID, \"name\":newGroup , \"members\" :[newMembers]});\n console.log(\"new group update\" + group);\nsetInfo();\n}", "title": "" }, { "docid": "fbe88b56d8644df753964a36aa18463a", "score": "0.5163612", "text": "function addGroup() {\n var groupName = $(\"#newGroupName\").val();\n var url = config.server.address + \"/groups/addgroup\";\n var newGroup = {\n name: groupName,\n creator_id: user.citylife.id\n };\n\n $.ajax({\n url: url,\n data: newGroup,\n dataType: \"json\",\n type: \"POST\",\n success: onAddGroup,\n error: function(jqXHR, errorstatus, errorthrown) {\n console.log(\"Error: \" + errorstatus + \" -- \" + jqXHR.responseText);\n }\n });\n}", "title": "" }, { "docid": "85a6ffd5db28da25f83b4603a0c7039b", "score": "0.51612175", "text": "group(groupType) {\n this.groups.push(groupType);\n if (this.scene != null)\n this.scene._groupEntity(this, groupType);\n }", "title": "" }, { "docid": "05569b841cbeae9ec045be5760072842", "score": "0.5160336", "text": "function addUser(id, name, room) {\n if (!name && !room) return new Error('Username and room are required');\n if (!name) return new Error('Username is required');\n if (!room) return new Error('Room is required');\n users.set(id, {user: name, room});\n}", "title": "" }, { "docid": "21cf6aed9c08b2e621a7b59ada9a3c10", "score": "0.5146896", "text": "function open_group_adding()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tinit_dialog_error();\r\n\t\t\t\r\n\t\t\tdata = {\r\n\t\t\t\t\t'type': '2'\r\n\t\t\t\t\t};\r\n\t\t\t\r\n\t\t\t$(\"#wizard_add_group\").dialog({title: 'Add Group',autoOpen: false ,modal: false,width:350});\r\n\t\t\t\r\n\t\t\t$.get(url_open_add_group,data,function(result)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//alert(result.status);\r\n\t\t\t\t\t\tif (result.status == \"success\")\r\n\t\t\t\t\t\t{\t\t\t\t\r\n\t\t\t\t\t\t\t$(\"#wizard_content_add_group\").html(\"\");\r\n\t\t\t\t\t\t\t$(\"#wizard_content_add_group\").html(result.form);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tobj_group = $(\"#wizard_content_add_group\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tobj_type = obj_group.find(\"#id_type\");\r\n\t\t\t\t\t\t\t$(obj_type).val(\"2\");\r\n\t\t\t\t\t\t\t$(obj_type).attr('disabled','disabled');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbttsave = obj_group.find(\".save_button.save\");\r\n\t\t\t\t\t\t\tbttcancel = obj_group.find(\".save_button.cancel\");\r\n\t\t\t\t\t\t\tbttaddicon = obj_group.find(\".img_add.proxynow.addicon\"); \r\n\t\t\t\t\t\t\tbttlistuser = obj_group.find(\".img_folder.proxynow.foldericon\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(bttsave).click(function(){ save_form_group('add');});\r\n\t\t\t\t\t\t\t$(bttcancel).click(function(){ cancel_form_group();});\r\n\t\t\t\t\t\t\t$(bttaddicon).click(function(){ open_members_adding();})\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//$(bttlistuser).click(function(){wizard_open_listuser(); });\r\n\t\t\t\t\t\t\t$(bttlistuser).bind('click',function(){\r\n\t\t\t\t\t\t\t\tattach_search_list_panel_event(\"#wizard_list_panel_user\", \"#wizard_list_panel_content_user\", profile_users, \"0\");\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\t$(\"#wizard_add_group\").dialog(\"open\");\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (result.status == \"error\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tshow_error_dialog(result.error_info);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(error)\r\n\t\t{\r\n\t\t\tshow_error_dialog(error.message);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1c4166d290d3789835b74fd486b51e0d", "score": "0.5140436", "text": "function addNewUserToDatabase(userId, email, username) {\n\tlet userUpdates = {};\n\n\t// give the user their own DB tree\n\tuserUpdates[`users/${userId}`] = { email, username };\n\n\t// add their username to the usernames list\n\tuserUpdates[`usernames/${username}`] = { email };\n\n\tdb.ref().update(userUpdates).then(() => {\n\t\tconsole.log('add new user to DB success');\n\t}).catch((error) => {\n\t\tconsole.log('add new user to DB error');\n\t});\n}", "title": "" }, { "docid": "feac2a28821136fe26a46a02bf40032e", "score": "0.51397884", "text": "function createGroups(req, res){\n\tlet newGroup = {_id: new ObjectId(), admins: [req.body.email], members: [req.body.email], name: req.body.name, open: req.body.open, icon: req.body.icon, created_at: new Date()};\n\treq.Db.collection('groups').insertOne(newGroup)\n\t\t.then(function(result){\n\t\t\tif(result == null){\n\t\t\t\tres.status(501).send(\"No result\");\n\t\t\t}\n\t\t\tres.status(200).send(newGroup);\n\t\t}).catch(function(err){\n\t\t\tres.status(500).send(\"Not found\");\n\t\t});\n}", "title": "" }, { "docid": "616df11b49c50b002372db00e99732dc", "score": "0.51378065", "text": "async function checkUserGroupExists (userGroup) {\n return new Promise(async (resolve, reject) => {\n try {\n // ---- Search for User Group ----\n let userGroupId = await knex.raw(`\n SELECT id FROM \"${global.POSTGRES_SCHEMA}\".\"user_groups\" \n WHERE name = ?;\n `, [userGroup])\n // ---- Resolve if exists ----\n if (userGroupId.rows.length === 0) throw new UserGroupNotFoundAuthError()\n return resolve(userGroupId.rows[0].id) // Resolve User Group ID value\n } catch (error) {\n return reject(error) // Reject error\n }\n })\n}", "title": "" }, { "docid": "56c648cdf729d7677bb78b613ef527d0", "score": "0.5126666", "text": "function removeUserFromGroup(username, groupName) {\n //Get the web\n debugger;\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n\n //Get the group from the web\n var group = web.get_siteGroups().getById(groupName);\n\n group.get_users().remove(web.ensureUser(username));\n group.update();\n\n //Load the group to the client context and execute\n clientContext.load(group);\n clientContext.executeQueryAsync(onSuccess, onFail);\n}", "title": "" }, { "docid": "9be8aa37668c6bcb92bd001d14628676", "score": "0.5123183", "text": "function addUserToProject(user) {\n\t\t\tvar project;\n\n\t\t\tfor (var i = 0; i < vm.allprojects.length; i++) {\n if (vm.allprojects[i].title == user.project) {\n project = vm.allprojects[i];\n }\n }\n\n\t\t\t// Check user isnt already part of the project (should not happen)\n\t\t\tvar exists = false;\n\t\t\tfor (var j = 0; j < project.members.length; j++) {\n if (project.members[j] == user.email) {\n exists = true;\n\t\t\t\t\tbreak;\n }\n }\n\t\t\tif(!exists) {\n\t\t\t\tproject.members_detailed.push(user.firstName + \" \" + user.lastName);\n\t\t\t\tproject.members.push(user.email);\n\t\t\t\tProjectService.editProject(project, project._id);\n\t\t\t\t// Refresh projects panel\n\t\t\t\tvm.tabledata_p = JSON.stringify(vm.filteredprojects);\n\t\t\t\tvm.tabledata_p = eval(vm.tabledata_p);\n\t\t\t}\n }", "title": "" }, { "docid": "23fb97d5c704888c219e952d54333092", "score": "0.5121872", "text": "function addUser(user){\n\n}", "title": "" }, { "docid": "7a110c8b97e59ab80ec5cebb3bf62547", "score": "0.5111942", "text": "function addGroupMember()\n {\n if(DEBUG_VERBOSE)\n console.log('addGroupMember()');\n\n var tableBody = document.getElementById('newgroup_members_tbody');\n var usernameField = document.getElementById('newgroup_membersearch');\n var candidate = usernameField.value;\t\t\t\t\t\t// Not admitted until proven unique to list\n var admittedMembers = [];\t\t\t\t\t\t\t\t\t// List of all members in group so far\n var i;\n var newString;\t\t\t\t\t\t\t\t\t\t\t\t// Has to be added all at once\n\n if(candidate.length > 0)\t\t\t\t\t\t\t\t\t// Don't bother with an empty string\n {\n for(i = 0; i < tableBody.rows.length; i++)\t\t\t\t// Build list of admitted group members\n {\n if(admittedMembers.indexOf(tableBody.rows[i].cells[0].innerHTML) < 0)\n admittedMembers.push(tableBody.rows[i].cells[0].innerHTML);\n }\n\n if(admittedMembers.indexOf(candidate) < 0)\n {\n newString = '<tr>';\n newString += '<td>' + candidate + '</td>';\n newString += '<td>';\n newString += '<a href=\"javascript:;\" onclick=\"removeGroupMember(' + (admittedMembers.length) + ');\">';\n newString += '<img src=\"./img/minus.png\" alt=\"Remove from group\"/>';\n newString += '</a></td>';\n newString += '</tr>';\n\n tableBody.innerHTML += newString;\n }\n\n usernameField.value = '';\t\t\t\t\t\t\t\t// Blank the entry field\n }\n }", "title": "" }, { "docid": "9e72b4b43a535289838420e5a6247c6d", "score": "0.5110275", "text": "function newGroup(newGroup,newMembers){\n var newGroupID = group.length \n group.push({ \"ID\": newGroupID, \"name\":newGroup , \"members\" :[newMembers]});\n console.log(\"new group update\" + group);\nsetInfo();\n}", "title": "" }, { "docid": "5da214564dc7ddfd8906c9195c5eff4e", "score": "0.51065224", "text": "function registerUser() {\n addUser();\n }", "title": "" }, { "docid": "37a4d44c48b662a32f43050b53043d96", "score": "0.5106043", "text": "function findByUserGroupId(user_id, group_id) {\n return db(\"group_participants\").where({\n user_id: user_id,\n group_id: group_id\n });\n}", "title": "" }, { "docid": "8ebff595d0ca47354e737ced9e874b6d", "score": "0.51014644", "text": "function addUser(usr, pss) {\n if (backend.getUser(usr)) {\n console.log(\"USER ALREADY EXISTS\");\n return null;\n }\n else {\n console.log(\"123 \" + pss);\n return backend.addUser(usr, pss);\n\n // hash(pss, function(err, salt, hash){\n // if (err) throw err;\n // // store the salt & hash in the \"db\"\n // users.usr.salt = salt;\n // users.usr.hash = hash.toString();\n }\n}", "title": "" }, { "docid": "9b76a90655cd5af6e97193fecc3ae0fd", "score": "0.5096854", "text": "function addOwner (userUUID, callback) {\n \n endpointPath = \"/groups/owners/users/\" + userUUID;\n var uri = host + appPath + endpointPath;\n\n console.log(\"Adding an owner user: \" + uri);\n\n var options = {\n uri: uri,\n method: \"POST\"\n };\n return makeRequest(options, function (error, response) {\n if (error) {\n callback(error, null);\n } else {\n var entity = JSON.parse(response);\n streamlineResponseEntity(entity, function(streamlinedResponse){\n callback(null, JSON.stringify(streamlinedResponse));\n });\n }\n });\n}", "title": "" }, { "docid": "41523eaf705d5fb8cc351121f90e9d21", "score": "0.5080345", "text": "async addUser(userId) {\n try {\n const newUser = await this.musicUsers.create({\n user: userId\n });\n } catch {\n throw 'User is already in Database.';\n }\n }", "title": "" }, { "docid": "221d2f9f2afb4c47b3b8a1fcc5fd678d", "score": "0.5079269", "text": "async function addUser(newUser) {\n const [newId] = await db(\"users\").insert(newUser).returning(\"id\");\n return getUsersById(newId);\n}", "title": "" }, { "docid": "101b150889f1baad004c5bb9a2cb2e6e", "score": "0.5078009", "text": "function addGroupToList(group, list) {\n if (!group) {\n return list;\n }\n\n if (group.length > 1) {\n list.push(group);\n } else {\n list = list.concat(group);\n }\n\n return list;\n }", "title": "" }, { "docid": "5a8ed99dc35ce1bd935d1941f9171955", "score": "0.5076539", "text": "async function updateGroup(groupId, details, username) {\n let group = await findGroup(groupId, username)\n if (!group) {\n return Promise.reject({\n message: `No group in database with the name ${groupId}`,\n statusCode: 404\n\n })\n } else {\n if (details.name && hasReadableCharacters(details.name)) group._source.name = details.name\n if (details.description) group._source.description = details.description\n\n await fetch(`${esUrl}/groups/_doc/${group._id}`,{\n method: 'PUT',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(group._source)\n })\n return Promise.resolve(group._source)\n }\n }", "title": "" }, { "docid": "6b476ca8b3105f66c705a8d3ddde11b1", "score": "0.50709695", "text": "addMember(userUID=null){\n if(userUID && this.org.uid){\n /* add this user to the member list for this organization*/\n firebase.database().ref(`${this.orgDataPath}/members/${userUID}`).set(true)\n /* update the organization roles within this user's profile */\n const userRole = {\n isMember: true,\n isPending:false,\n name: this.org.name,\n logoURL: this.org.logoURL\n }\n const ownerProfile = new UserProfile(userUID);\n const userOrgRef = ownerProfile.getOrgRef(this.org.uid);\n userOrgRef.update(userRole);\n }\n }", "title": "" }, { "docid": "493ddb9f379817d282538b9a17890756", "score": "0.50671566", "text": "async store({ request, response, auth }) {\n const { name, description, members } = request.body;\n // make sure a name is provided\n if (name) {\n const newGroup = await Group.create({\n name,\n description,\n creator: auth.user.id\n });\n // attach the group's members\n const groupMembers = await newGroup\n .members()\n .attach([auth.user.id, ...members]);\n // send back the group with the members\n return {\n ...newGroup.$attributes,\n groupMembers\n };\n }\n // if a name isn't provided, send a 400\n response.status(400).json({\n success: false,\n message: 'Please provide a name for your group'\n });\n }", "title": "" }, { "docid": "3e7186ecf37851fff3fd5ae972696e7a", "score": "0.5063523", "text": "function addGroup(groupName){\r\n\t\tgrp = document.getElementById(\"id_\" + groupName);\r\n\t\tif(grp){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(groupName != \"Offline\"){\r\n\t\t\tgrpList = document.getElementById(\"s_pnl_grouplist\").getElementsByTagName(\"tbody\")[0];\r\n\t\t\ttrGroupList = document.createElement(\"tr\");\r\n\t\t\ttrGroupList.id = \"gl_\" + groupName;\r\n\t\t\ttdGroupList = document.createElement(\"td\");\r\n\t\t\ttdGroupList.innerHTML = groupName;\r\n\t\t\ttrGroupList.appendChild(tdGroupList);\r\n\t\t\tgrpList.appendChild(trGroupList);\r\n\t\t\ttrGroupList.onmouseover = set;\r\n\t\t\ttrGroupList.onmouseout = unset;\r\n\t\t\ttrGroupList.onclick = setLov;\r\n\t\t}\r\n\t\ttrGroup = document.createElement(\"tr\");\r\n\t\ttrGroup.id = \"g_id_\" + groupName;\r\n\t\ttrGroup.groupName = groupName;\r\n\t\ttrGroup.onclick = showHide;\r\n\t\ttd1 = document.createElement(\"td\");\r\n\t\ttd1.width = \"15\";\r\n\t\timgTd = document.createElement(\"img\");\r\n\t\timgTd.src = \"img/arrow-bottom.gif\";\r\n\t\ttd1.appendChild(imgTd);\r\n\r\n\t\ttd2 = document.createElement(\"td\");\r\n\t\ttd2.innerHTML = \"<b>\" + groupName + \"</b>\";\r\n\t\ttd2.onmouseover = setNewGroup;\r\n\t\ttd2.onmouseout = unsetNewGroup;\r\n\r\n\t\ttrGroup.appendChild(td1);\r\n\t\ttrGroup.appendChild(td2);\r\n\t\ttrUserGroup = document.createElement(\"tr\");\r\n\t\ttrUserGroup.id = \"id_\" + groupName;\r\n\t\ttrUserGroup.style.display = 'none';\r\n\t\ttd1 = document.createElement(\"td\");\r\n\t\ttd1.innerHTML = \"&nbsp;\";\r\n\r\n\t\ttd2 = document.createElement(\"td\");\r\n\r\n\t\ttbl = document.createElement(\"table\");\r\n\t\ttbl.cellpadding = 0;\r\n\t\ttbl.cellspacing = 1;\r\n\t\ttbl.className = \"groupFriend\";\r\n\r\n\t\ttbdy = document.createElement(\"tbody\");\r\n\t\ttbl.appendChild(tbdy);\r\n\r\n\t\ttd2.appendChild(tbl);\r\n\r\n\t\ttrUserGroup.appendChild(td1);\r\n\t\ttrUserGroup.appendChild(td2);\r\n\t\ttbdy = document.getElementById(\"panel_friendlist\").getElementsByTagName('tbody')[0];\r\n\t\ttempTr = tbdy.childNodes;\r\n\t\ttempTr1 = null;\r\n\t\ttempTr2 = null;\r\n\t\tl = tempTr.length;\r\n\t\tif(l>=2 && document.getElementById(\"id_Offline\") && groupName!=\"Offline\"){\r\n\t\t\ttempTr1 = tempTr[tempTr.length - 2];\r\n\t\t\ttempTr2 = tempTr[tempTr.length - 1];\r\n\t\t\t\ttbdy.removeChild(tempTr1);\r\n\t\t\t\ttbdy.removeChild(tempTr2);\r\n\t\t}\r\n\t\ttbdy.appendChild(trGroup);\r\n\t\ttbdy.appendChild(trUserGroup);\r\n\t\t\ttrGroup.childNodes[1].width = 170;\r\n\t\tif(tempTr1){\r\n\t\t\ttbdy.appendChild(tempTr1);\r\n\t\t\ttbdy.appendChild(tempTr2);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "c7fb118b690407f761e9cce2a91fbe94", "score": "0.5054164", "text": "addSender(group, number) {\n if (this.senders[group] === undefined || !this.isCorrectNumber(number) || group === 'Me')\n return false;\n if (!this.senders[group].includes(number)) {\n this.senders[group].push(number);\n fs.writeFileSync(this.sendersFileName, JSON.stringify(this.senders));\n }\n return true;\n }", "title": "" }, { "docid": "bd8d4974742f2f69aeecd77e700471b6", "score": "0.50437945", "text": "function createUser(uid,name){\n var newTextField = $('<textfield>');\n newTextField.attr('id',uid);\n newTextField.text(name);\n newTextField.addClass(\"userBox\");\n newTextField.click(function(){\n GROUPDB.getGroupWithId(self.getSelectedGroupid(),function(group){\n if(group.isUserAdmin(OC.currentUser)){\n self.addMember(uid,name,false,true);\n if(group.isMember(uid)){\n self.displayError(\"User is already member of this group\");\n }else{\n GROUPDB.addMember(group.getGroupid(),uid,function(result){\n if(result){\n self.debugLog(\"add user:\"+uid+\" to group \"+group.getGroupid()+\" was successful\");\n }else{\n self.debugLog(\"add user error\");\n }\n });\n }\n }\n });\n });\n return newTextField;\n}", "title": "" }, { "docid": "fc1ee0f1c72ef40cdf26d3b8ad2f1306", "score": "0.5043114", "text": "addOptionGroup(id, data) {\n\t var hashed_id;\n\t data[this.settings.optgroupValueField] = id;\n\n\t if (hashed_id = this.registerOptionGroup(data)) {\n\t this.trigger('optgroup_add', hashed_id, data);\n\t }\n\t }", "title": "" }, { "docid": "b9fefc7c45997715fd97fbbaa394104f", "score": "0.5034901", "text": "addAdministrator(userUID=null){\n if(userUID && this.org.uid){\n /* update organanization records to indicate new administrator */\n firebase.database().ref(`${this.orgDataPath}/administrators/${userUID}`).set(true)\n\n /* make sure this user is in the members list for this organization. they should be already- just precaution */\n firebase.database().ref(`${this.orgDataPath}/members/${userUID}`).set(true)\n\n /* remove user from pending list. again, another precaution */\n firebase.database().ref(`${this.orgDataPath}/requests/${userUID}`).remove();\n\n /* update the organization roles within this user's profile */\n const userRole = {\n isOwner:false,\n isMember: true,\n isAdministator: true,\n isPending: false,\n name: this.org.name,\n logoURL: this.org.logoURL\n }\n const ownerProfile = new UserProfile(userUID);\n const userOrgRef = ownerProfile.getOrgRef(this.org.uid);\n userOrgRef.update(userRole);\n }else{\n //TODO throw an error message\n }\n }", "title": "" }, { "docid": "b84385bfca73ec70020cabdecc1386f6", "score": "0.50328004", "text": "function updateUserGroup(data, callback) {\n utils.l.d(\"updateUserGroup::\",data)\n var clanName = utils._.isInvalidOrBlank(data.clanName)?\"\":data.clanName\n var clanImageUrl = utils._.isInvalidOrBlank(data.clanImageUrl)?\"\":data.clanImageUrl\n models.user.updateUser({id: data.id, clanId: data.clanId, clanName:clanName, clanImageUrl:clanImageUrl}, true, callback)\n}", "title": "" } ]
795aeb6bc9f85b39d12a12478e7f160e
Second of the inherent scene functions which adds game physics and handles the socket connections from the opposing client.
[ { "docid": "d0bee996beb8b239374b853257c21a65", "score": "0.61024404", "text": "function create () {\n //Save scene reference.\n scene = this;\n\n //Add the background.\n this.background = this.add.image(0,0,'background').setOrigin(0,0);\n\n //Add the ground.\n this.ground = this.physics.add.staticGroup();\n this.ground.create(640, 710, 'ground');\n\n //Add the wall.\n this.wall = this.physics.add.staticGroup();\n this.wall.create(640, 610, 'wall');\n\n //Physics groups for tanks and shells.\n this.tanks = this.physics.add.group();\n this.shells = this.physics.add.group();\n\n //Tanks collide with ground and walls.\n this.physics.add.collider(this.tanks, this.ground);\n this.physics.add.collider(this.tanks, this.wall);\n\n //Shells are destroyed when colliding with the ground, not on walls.\n this.physics.add.collider(this.shells, this.wall);\n this.physics.add.collider(this.shells, this.ground, function(shell, ground) {\n shell.destroy();\n });\n\n //Shell and tank collide, deal damage and destroy shell.\n this.physics.add.overlap(this.tanks, this.shells, function(tank, shell) {\n tank.myref.damage(shell.myref.getDamage());\n shell.destroy();\n });\n\n //Create GameManager and Player.\n socket = io();\n gm = new GameManager(this, socket);\n player = new LightTank(this, 'player', 'red-tank', 100, 540);\n\n //Get my socket id.\n socket.on('connect', (id) => {\n ids['player'] = id;\n });\n\n //Handles connecting the two players.\n socket.on('playerJoined', (params) => {\n if(params['firstToJoin'] == false) {\n gm.setState('PlayerTurn');\n socket.emit('playerJoined', {'firstToJoin': true, 'id': ids['player']});\n } else {\n gm.setState('OpponentTurn');\n }\n\n ids['opponent'] = params['id'];\n opponent = new LightTank(scene, 'opponent', 'blue-tank', 1180, 540);\n })\n\n //Incoming tank moves are handled here.\n socket.on('sendTankMove', (move) => {\n gm.handleBroadcast('sendTankMove', move);\n console.log('sent move');\n });\n\n //Handle opponent firing shell.\n socket.on('fireTankShell', (angle, power) => {\n gm.handleFireBroadcast('fireTankShell', angle, power);\n console.log('shots fired');\n gm.setState('PlayerTurn');\n });\n\n socket.on('shellSwitch', (shell) => {\n gm.handleShellChangeBroadcast(shell);\n });\n }", "title": "" } ]
[ { "docid": "146af7bcf1f6a54565330b6ef9301846", "score": "0.69093", "text": "create() {\n\t\tconst scene = this;\n\t\tthis.music = this.sound.add(\"music\", {\n\t\t\tvolume: 0.05,\n\t\t\tloop: true\n\t\t});\n\t\tthis.music.play();\n\n\t\tthis.clamClick = this.sound.add(\"clamClick\", { volume: 2 });\n\t\tthis.shrimpClick = this.sound.add(\"shrimpClick\", { volume: 0.6 });\n\t\tthis.countdown = this.sound.add(\"countdown\", { volume: 1 });\n\t\tthis.click = this.sound.add(\"click\", {\n\t\t\tvolume: 0.5,\n\t\t\tloop: true,\n\t\t\trate: 0.7\n\t\t}); //needs work with clam\n\t\tthis.infoBubble = this.sound.add(\"infoBubble\", { volume: 6 });\n\t\tthis.nextLevel = this.sound.add(\"nextLevel\", { volume: 9 });\n\n\t\t//launch the socket connection\n\t\tthis.socket = io();\n\t\t//connect the socket connection to IntoScene\n\t\tthis.scene.launch(\"IntroScene\", {\n\t\t\tsocket: this.socket\n\t\t});\n\t\tthis.scene.launch(\"ChatScene\", { socket: this.socket });\n\n\t\tlet link;\n\t\tthis.socket.on(\"gameCreated\", gameKey => {\n\t\t\tlink = this.addUrl(gameKey);\n\t\t});\n\n\t\tlet waitingForHost, scores;\n\n\t\tthis.socket.on(\"startedCountdown\", async seconds => {\n\t\t\tif (waitingForHost) waitingForHost.destroy();\n\n\t\t\tthis.scene.stop(\"Instructions\");\n\t\t\tconst currentTimer = this.add.text(400, 200, `${seconds}`, {\n\t\t\t\tfontSize: 50\n\t\t\t});\n\n\t\t\twhile (seconds > 0) {\n\t\t\t\tcurrentTimer.setText(`${seconds}`);\n\t\t\t\tthis.countdown.play();\n\t\t\t\tawait this.sleep(1000);\n\t\t\t\tseconds--;\n\t\t\t}\n\t\t\tthis.scubaDiver.waiting = false;\n\t\t\tcurrentTimer.setText(\"swim!\");\n\n\t\t\tthis.scene.launch(\"Timer\", {\n\t\t\t\tcurrentTime: new Date(),\n\t\t\t\tavatar: this.scubaDiver.avatar,\n\t\t\t\tsocket: scene.socket,\n\t\t\t\tscubaDiver: scene.scubaDiver,\n\t\t\t\tplayerFriends: scene.playerFriends\n\t\t\t});\n\n\t\t\tawait this.sleep(1000);\n\t\t\tthis.countdown.stop();\n\t\t\tcurrentTimer.destroy();\n\t\t\tthis.score = this.add\n\t\t\t\t.text(50, 50, `${this.scubaDiver.avatar}: ${this.scubaDiver.score}`, {\n\t\t\t\t\tfill:\n\t\t\t\t\t\tthis.scubaDiver.avatar === \"scubaPurple\"\n\t\t\t\t\t\t\t? \"#A37CFD\"\n\t\t\t\t\t\t\t: this.scubaDiver.avatar === \"scubaGreen\"\n\t\t\t\t\t\t\t? \"#00FF00\"\n\t\t\t\t\t\t\t: \"#FFB1EE\",\n\t\t\t\t\tfontSize: 20,\n\t\t\t\t\tfontStyle: \"bold\"\n\t\t\t\t})\n\t\t\t\t.setScrollFactor(0);\n\t\t\tscores = this.friendsScores(scene.playerFriends);\n\n\t\t\t//add clams and shrimps to game\n\t\t\tscene.state.questionsLevel1.forEach(question => {\n\t\t\t\tscene.createClam(scene, 1, question, \"clam\");\n\t\t\t});\n\t\t\tscene.state.factsLevel1.forEach(fact => {\n\t\t\t\tscene.createShrimp(scene, fact, \"shrimp\");\n\t\t\t});\n\n\t\t\t//INSTRUCTIONS BUBBLE\n\t\t\tscene.instructionsBubble = scene.add\n\t\t\t\t.image(734, 545, \"instructions\")\n\t\t\t\t.setScale(0.15)\n\t\t\t\t.setScrollFactor(0);\n\n\t\t\tscene.instructionsBubble.setInteractive();\n\t\t\tscene.showInstructions = false;\n\t\t\tscene.instructionsBubble.on(\"pointerdown\", () => {\n\t\t\t\tif (!scene.showInstructions) {\n\t\t\t\t\tscene.showInstructions = !scene.showInstructions;\n\t\t\t\t\tthis.infoBubble.play();\n\t\t\t\t\tscene.scene.launch(\"Instructions\");\n\t\t\t\t} else if (scene.showInstructions) {\n\t\t\t\t\tscene.showInstructions = !scene.showInstructions;\n\t\t\t\t\tthis.infoBubble.play();\n\t\t\t\t\tscene.scene.stop(\"Instructions\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//Volume\n\t\t\tthis.volumeOn = this.add\n\t\t\t\t.image(700, 50, \"volumeOn\")\n\t\t\t\t.setScrollFactor(0)\n\t\t\t\t.setScale(0.09);\n\t\t\tthis.volumeUp = this.add\n\t\t\t\t.image(750, 50, \"volumeUp\")\n\t\t\t\t.setScrollFactor(0)\n\t\t\t\t.setScale(0.07);\n\t\t\tthis.volumeDown = this.add\n\t\t\t\t.image(650, 50, \"volumeDown\")\n\t\t\t\t.setScrollFactor(0)\n\t\t\t\t.setScale(0.07);\n\n\t\t\tthis.volumeOn.setInteractive();\n\t\t\tthis.volumeUp.setInteractive();\n\t\t\tthis.volumeDown.setInteractive();\n\n\t\t\tthis.volumeUp.on(\"pointerdown\", () => {\n\t\t\t\tthis.volumeUp.setTint(0xc2c2c2);\n\t\t\t\tlet newVol = this.sound.volume + 0.1;\n\t\t\t\tthis.sound.setVolume(newVol);\n\t\t\t\tif (this.sound.volume < 0.1) {\n\t\t\t\t\tthis.volumeOn.setTexture(\"volumeOn\");\n\t\t\t\t}\n\t\t\t\tif (this.sound.volume >= 1.5) {\n\t\t\t\t\tthis.volumeUp.setTint(0x056ff1);\n\t\t\t\t\tthis.volumeUp.disableInteractive();\n\t\t\t\t} else {\n\t\t\t\t\tthis.volumeDown.clearTint();\n\t\t\t\t\tthis.volumeDown.setInteractive();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.volumeDown.on(\"pointerdown\", () => {\n\t\t\t\tthis.volumeDown.setTint(0xc2c2c2);\n\t\t\t\tlet newVol = this.sound.volume - 0.1;\n\t\t\t\tthis.sound.setVolume(newVol);\n\t\t\t\tif (this.sound.volume <= 0.1) {\n\t\t\t\t\tthis.volumeDown.setTint(0x056ff1);\n\t\t\t\t\tthis.volumeDown.disableInteractive();\n\t\t\t\t\tthis.volumeSpeaker.setTexture(\"volumeOff\");\n\t\t\t\t} else {\n\t\t\t\t\tthis.volumeUp.clearTint();\n\t\t\t\t\tthis.volumeUp.setInteractive();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.volumeDown.on(\"pointerup\", () => {\n\t\t\t\tthis.volumeDown.clearTint();\n\t\t\t});\n\t\t\tthis.volumeUp.on(\"pointerup\", () => {\n\t\t\t\tthis.volumeUp.clearTint();\n\t\t\t});\n\n\t\t\tthis.volumeOn.on(\"pointerdown\", () => {\n\t\t\t\tif (this.volumeOn.texture.key === \"volumeOn\") {\n\t\t\t\t\tthis.volumeOn.setTexture(\"volumeOff\");\n\t\t\t\t\tthis.sound.setMute(true);\n\t\t\t\t} else {\n\t\t\t\t\tthis.volumeOn.setTexture(\"volumeOn\");\n\t\t\t\t\tthis.sound.setMute(false);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t//set background\n\t\tconst map = this.make.tilemap({ key: \"bigOcean\" });\n\t\tconst tileset = map.addTilesetImage(\"big-ocean-tilesheet\", \"tiles\");\n\n\t\t//background layers\n\t\tmap.createStaticLayer(\"gradient\", tileset);\n\t\tmap.createStaticLayer(\"stone\", tileset);\n\t\tmap.createStaticLayer(\"stone2\", tileset);\n\t\tmap.createStaticLayer(\"foam\", tileset);\n\n\t\t// const displayPlay = this.displayPlayButton;\n\t\tif (window.location.pathname.length <= 1) {\n\t\t\tconst display = this.add.text(\n\t\t\t\t170,\n\t\t\t\t590,\n\t\t\t\t\"when yOu are ready tO plunge, click\"\n\t\t\t);\n\n\t\t\tconst playButton = this.add.text(520, 590, \"< start >\", {\n\t\t\t\tfontFamily: \"menlo\"\n\t\t\t});\n\n\t\t\tplayButton.setInteractive();\n\t\t\tplayButton.on(\"pointerdown\", () => {\n\t\t\t\tplayButton.setVisible(false);\n\t\t\t\tdisplay.setVisible(false);\n\t\t\t\tlink.destroy();\n\t\t\t\tthis.socket.emit(\"startCountdown\", {\n\t\t\t\t\tseconds: 5,\n\t\t\t\t\tkey: this.state.key\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\twaitingForHost = this.add.text(\n\t\t\t\t170,\n\t\t\t\t590,\n\t\t\t\t\"waiting fOr hOst tO start game...\"\n\t\t\t);\n\t\t}\n\n\t\t//makes friends visibel\n\t\tscene.playerFriends = this.physics.add.group();\n\t\tscene.clamsLevel1 = this.physics.add.group();\n\t\tscene.clamsLevel2 = this.physics.add.group();\n\t\tscene.clamsLevel3 = this.physics.add.group();\n\t\tscene.clamsLevel4 = this.physics.add.group();\n\t\tscene.clamsLevel5 = this.physics.add.group();\n\t\tscene.shrimps = this.physics.add.group();\n\n\t\t//set world bounds\n\t\tthis.physics.world.setBounds(0, 320, 1088, 1216);\n\t\t//set up camera\n\t\tthis.cameras.main.setBounds(0, 0, 1088, 4800);\n\n\t\t//add the playerGroup of scubaDivers to collider\n\t\tthis.playerGroup = this.physics.add.group();\n\t\t//add rocks\n\t\tthis.decorations = this.physics.add.staticGroup();\n\t\tthis.platform = this.add\n\t\t\t.sprite(60, 550, \"rock-sand-1\")\n\t\t\t.setScale(0.2)\n\t\t\t.setAngle(30);\n\t\tthis.decorations.add(this.platform);\n\n\t\t//create rocks\n\t\tthis.createRock(this, \"rock-sand-1\", 25, 500, 0.28, 20);\n\t\tthis.createRock(this, \"rock-sand-2\", 135, 550, 0.25);\n\t\tthis.createRock(this, \"rock-sand-2\", 600, 650, 0.2, -50);\n\t\tthis.createRock(this, \"rock-sand-1\", 300, 900, 0.15);\n\t\tthis.createRock(this, \"rock-sand-1\", 1000, 860, 0.4);\n\t\tthis.createRock(this, \"rock-sand-2\", 935, 780, 0.3, -130);\n\t\tthis.createRock(this, \"rock-brown-2\", 20, 900, 0.35, 90);\n\t\tthis.createRock(this, \"rock-sand-2\", 100, 910, 0.3);\n\t\tthis.createRock(this, \"rock-sand-1\", 170, 870, 0.2);\n\t\tthis.createRock(this, \"rock-brown-2\", 1050, 1360, 0.6, -90);\n\t\tthis.createRock(this, \"rock-sand-2\", 835, 1180, 0.3, 0);\n\t\tthis.createRock(this, \"rock-brown-1\", 1035, 1500, 0.5, -90);\n\t\tthis.createRock(this, \"rock-brown-3\", 760, 1470, 0.2);\n\t\tthis.createRock(this, \"rock-brown-3\", 350, 1300, 0.5);\n\t\tthis.createRock(this, \"rock-brown-2\", 150, 1500, 0.3);\n\t\tthis.createRock(this, \"rock-brown-1\", 330, 1520, 0.2);\n\t\tthis.createRock(this, \"rock-gray-3\", 250, 1550, 0.4);\n\t\tthis.createRock(this, \"rock-brown-1\", 500, 1700, 0.3);\n\t\tthis.createRock(this, \"rock-gray-1\", 370, 1600, 0.35);\n\t\tthis.createRock(this, \"rock-brown-3\", 900, 2000, 0.4, -50);\n\t\tthis.createRock(this, \"rock-gray-1\", 835, 2100, 0.2, -120);\n\t\tthis.createRock(this, \"rock-gray-1\", 435, 2150, 0.25, 120);\n\t\tthis.createRock(this, \"rock-gray-2\", 505, 2100, 0.3, 20);\n\t\tthis.createRock(this, \"rock-brown-1\", 475, 2200, 0.35, 0);\n\t\tthis.createRock(this, \"rock-gray-3\", 100, 1800, 0.55, -90);\n\t\tthis.createRock(this, \"rock-brown-3\", 835, 2500, 0.6, 0);\n\n\t\tlet depths = [1216, 2112, 3008, 3904];\n\n\t\tthis.seaweed = [[], [], [], []];\n\n\t\tfor (let level = 0; level < 4; level++) {\n\t\t\tfor (let x = 0; x <= 1088; x += 70) {\n\t\t\t\tthis.seaweed[level].push(\n\t\t\t\t\tthis.createWaterPlant(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\"waterPlant\",\n\t\t\t\t\t\tx, //x\n\t\t\t\t\t\tdepths[level], //y\n\t\t\t\t\t\tthis.size, //scale\n\t\t\t\t\t\t0 //angle\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.physics.add.collider(\n\t\t\tthis.playerGroup,\n\t\t\tthis.decorations,\n\t\t\tfunction () {}\n\t\t);\n\n\t\t//create navigation and animation for scuba divers\n\t\tthis.cursors = this.input.keyboard.addKeys({\n\t\t\tup: Phaser.Input.Keyboard.KeyCodes.UP,\n\t\t\tdown: Phaser.Input.Keyboard.KeyCodes.DOWN,\n\t\t\tleft: Phaser.Input.Keyboard.KeyCodes.LEFT,\n\t\t\tright: Phaser.Input.Keyboard.KeyCodes.RIGHT\n\t\t});\n\n\t\t// this.createPlayer(gameInfo.players[socketId])\n\t\tthis.socket.on(\n\t\t\t\"setState\",\n\t\t\tfunction ({\n\t\t\t\tkey,\n\t\t\t\tplayers,\n\t\t\t\tavatars,\n\t\t\t\tlevel,\n\t\t\t\tquestionsLevel1,\n\t\t\t\tquestionsLevel2,\n\t\t\t\tquestionsLevel3,\n\t\t\t\tquestionsLevel4,\n\t\t\t\tquestionsLevel5,\n\t\t\t\tfactsLevel1,\n\t\t\t\tfactsLevel2,\n\t\t\t\tfactsLevel3,\n\t\t\t\tfactsLevel4,\n\t\t\t\tfactsLevel5,\n\t\t\t\tcount\n\t\t\t}) {\n\t\t\t\tscene.state = {\n\t\t\t\t\tkey,\n\t\t\t\t\tplayers,\n\t\t\t\t\tavatars,\n\t\t\t\t\tlevel,\n\t\t\t\t\tquestionsLevel1,\n\t\t\t\t\tquestionsLevel2,\n\t\t\t\t\tquestionsLevel3,\n\t\t\t\t\tquestionsLevel4,\n\t\t\t\t\tquestionsLevel5,\n\t\t\t\t\tfactsLevel1,\n\t\t\t\t\tfactsLevel2,\n\t\t\t\t\tfactsLevel3,\n\t\t\t\t\tfactsLevel4,\n\t\t\t\t\tfactsLevel5,\n\t\t\t\t\tcount\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\n\t\tthis.socket.on(\"currentPlayers\", function ({ players, numPlayers }) {\n\t\t\tscene.state.numPlayers = numPlayers;\n\t\t\tObject.keys(players).forEach(function (id) {\n\t\t\t\tif (players[id].playerId === scene.socket.id) {\n\t\t\t\t\tscene.createPlayer(scene, players[id]);\n\t\t\t\t} else {\n\t\t\t\t\tscene.addFriends(scene, players[id]);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t//listen to add new player to scene\n\t\tthis.socket.on(\"newPlayer\", function ({ newPlayer, numPlayers }) {\n\t\t\tchatContainer.classList.remove(\"chat-hidden\");\n\t\t\tscene.addFriends(scene, newPlayer);\n\t\t\tscene.state.numPlayers = numPlayers;\n\t\t});\n\n\t\tthis.socket.on(\"friendMoved\", function (friend) {\n\t\t\tscene.playerFriends.getChildren().forEach(function (playerFriend) {\n\t\t\t\tif (friend.playerId === playerFriend.playerId) {\n\t\t\t\t\tconst previousX = playerFriend.x;\n\t\t\t\t\tconst previousY = playerFriend.y;\n\n\t\t\t\t\tconst previousAngle = playerFriend.angle;\n\t\t\t\t\tconst previousFaceRight = playerFriend.faceRight;\n\n\t\t\t\t\tif (previousX !== friend.position.x) {\n\t\t\t\t\t\tplayerFriend.x = friend.position.x;\n\t\t\t\t\t}\n\t\t\t\t\tif (previousY !== friend.position.y) {\n\t\t\t\t\t\tplayerFriend.y = friend.position.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (previousAngle !== friend.position.angle) {\n\t\t\t\t\t\tplayerFriend.angle = friend.position.angle;\n\t\t\t\t\t}\n\t\t\t\t\tif (previousFaceRight !== friend.position.faceRight) {\n\t\t\t\t\t\tplayerFriend.flipX = !playerFriend.flipX;\n\t\t\t\t\t\tplayerFriend.faceRight = friend.position.faceRight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis.socket.on(\"QuestionOpened\", ({ question, level }) => {\n\t\t\tswitch (level) {\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.openQuestion(scene.clamsLevel1, question);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.openQuestion(scene.clamsLevel2, question);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.openQuestion(scene.clamsLevel3, question);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.openQuestion(scene.clamsLevel4, question);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.openQuestion(scene.clamsLevel5, question);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n\t\tthis.socket.on(\"someoneScored\", ({ friend, question, level }) => {\n\t\t\tif (level === 1) {\n\t\t\t\tthis.scoreChange(scene, scene.clamsLevel1, question);\n\t\t\t}\n\t\t\tif (level === 2) {\n\t\t\t\tthis.scoreChange(scene, scene.clamsLevel2, question);\n\t\t\t}\n\t\t\tif (level === 3) {\n\t\t\t\tthis.scoreChange(scene, scene.clamsLevel3, question);\n\t\t\t}\n\t\t\tif (level === 4) {\n\t\t\t\tthis.scoreChange(scene, scene.clamsLevel4, question);\n\t\t\t}\n\t\t\tif (level === 5) {\n\t\t\t\tthis.scoreChange(scene, scene.clamsLevel5, question);\n\t\t\t}\n\n\t\t\tscores.forEach(score => {\n\t\t\t\tscore.destroy();\n\t\t\t});\n\t\t\tscene.playerFriends.getChildren().forEach(function (playerFriend) {\n\t\t\t\tif (friend.playerId === playerFriend.playerId) {\n\t\t\t\t\tplayerFriend.score = friend.score;\n\t\t\t\t}\n\t\t\t});\n\t\t\tscores = this.friendsScores(scene.playerFriends);\n\t\t});\n\n\t\tthis.socket.on(\"nextLevel\", level => {\n\t\t\tscene.state.level = level;\n\t\t\tthis.nextLevel.play();\n\n\t\t\tthis.scene.stop(\"Timer\");\n\n\t\t\tthis.scene.launch(\"Timer\", {\n\t\t\t\tcurrentTime: new Date(),\n\t\t\t\tavatar: this.scubaDiver.avatar,\n\t\t\t\tsocket: scene.socket,\n\t\t\t\tscubaDiver: scene.scubaDiver,\n\t\t\t\tplayerFriends: scene.playerFriends\n\t\t\t});\n\n\t\t\tif (scene.state.level === 2) {\n\t\t\t\t//all weeds for level\n\t\t\t\tthis.levelChange(scene, scene.state.level, scene.state.questionsLevel2, scene.state.factsLevel2, scene.seaweed[0])\n\t\t\t\tscene.physics.world.setBounds(0, 320, 1088, 2112);\n\t\t\t}\n\t\t\tif (scene.state.level === 3) {\n\t\t\t\tthis.levelChange(scene, scene.state.level, scene.state.questionsLevel3, scene.state.factsLevel3, scene.seaweed[1])\n\t\t\t\tscene.physics.world.setBounds(0, 320, 1088, 3008);\n\t\t\t}\n\t\t\tif (scene.state.level === 4) {\n\t\t\t\tthis.levelChange(scene, scene.state.level, scene.state.questionsLevel4, scene.state.factsLevel4, scene.seaweed[2])\n\t\t\t\tscene.physics.world.setBounds(0, 320, 1088, 3904);\n\t\t\t}\n\t\t\tif (scene.state.level === 5) {\n\t\t\t\tthis.levelChange(scene, scene.state.level, scene.state.questionsLevel5, scene.state.factsLevel5, scene.seaweed[3])\n\t\t\t\tscene.physics.world.setBounds(0, 320, 1088, 4800);\n\t\t\t}\n\n\t\t\tif (scene.state.level === 6) {\n\t\t\t\tscene.scene.launch(\"WinScene\", {\n\t\t\t\t\tscubaDiver: scene.scubaDiver,\n\t\t\t\t\tplayerFriends: scene.playerFriends\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tthis.socket.on(\"disconnected\", function ({ playerId, numPlayers }) {\n\t\t\tscene.state.numPlayers = numPlayers;\n\t\t\tscene.playerFriends.getChildren().forEach(function (friend) {\n\t\t\t\tif (playerId === friend.playerId) {\n\t\t\t\t\tfriend.destroy();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (numPlayers < 2) {\n\t\t\t\tchatContainer.classList.add(\"chat-hidden\");\n\t\t\t}\n\t\t});\n\t\t\n\t\t//mouse bubbles\n\t\tvar particles = this.add.particles(\"littlebubble\");\n\n\t\tvar emitter = particles.createEmitter({\n\t\t\tspeed: 100,\n\t\t\tscale: { start: 1, end: 0 },\n\t\t\tblendMode: \"ADD\"\n\t\t});\n\n\t\tthis.input.on(\"pointermove\", function (pointer) {\n\t\t\temitter.setPosition(pointer.x, pointer.y);\n\t\t});\n\t}", "title": "" }, { "docid": "bd57f7c45ec39cfd89b4ab033f34ed09", "score": "0.6593685", "text": "function connectToServer() {\n \n\t// ports can be set here //\n\tsocket = io.connect( { transports: ['websocket'], upgrade:false });\n \n\t// incoming //\n\tsocket.on(\"connect\", function () {\n\t\t\n\t\t// if reply is success from server //\n console.log(\"connction estaplished successfully\");\n \n\t\t// incoming // server sends id\n socket.on(\"uniqueSocketId\", function (data) { \n \n\t\t\t// id stored in game object for modeling details\n\t\t\tGame.id = data.id;\n\t\t\tsid = data.id;\n\t\t\t// new details assigned to player and game starts //\n newGame(); //startGame\n\t\t\t\n\t\t\t// outgoing // handshake with confirmation\n socket.emit(\"Appreciated\", {}); \n });\n\n// incoming // making the car by server assigned location\n socket.on(\"enemiesCar\", function (data) { \n makeCar(scene, data);\n });\n\t\t\n// incoming // getting all the details of position of other player connected\n socket.on(\"enemiesPosition\", function (data) { \n\t\t\t// storing enemies details in array, as can be many players need their own details saved\n var car = enemies[data.id];\n\t\t\t\n\t\t\t// model view model to get the details for the enemies rendered\n car.setState(data); // tank.setState\n \n });\n\n// incoming // getting details of x and y position of car to fire the ball\n socket.on(\"details to fire ball\", function (data) { \n console.log(data); // log for debug\n\t\t\t\n\t\t\t// method that creates balls shooting\n fireCannonBalls(this.scene, data);\n \n });\n\n\t\t// when windows is closed this method triggers and sends details to server to remove game instance\n window.onbeforeunload = function () {\n\t\t\t\t// outgoing //\n socket.emit(\"Left\", Game.id); // sending id to delete from server\n socket.disconnect();// generic socket disconnect method\n }\n\n// incoming // delete all enemies which are leaving game, as they needed to deleted from rendering and array\n socket.on(\"enemiesLeft\", function (data) { \n \n var car = enemies[data.id];\n car.dispose();\n delete enemies[data.id];\n \n });\n\t\t\n\t\t\t// outgoing // this tells the server that client trying to connect\n\t\tsocket.emit('join', 'Client Joined');\n\t});\n\n// incoming // this is used to communicate in chat messages\n\tsocket.on('broad', function(data) {\n\t\t\n\t\t//jquery getting the details from element id in html\n\t\t$('#future').append(\"<b style='color:green;'>\" + data + \"</b><br/>\");\n\t});\n\n\t// when user hits send this fuction triggers and send the elements from id as text to server\n\t$('form').submit(function(e){\n\t\te.preventDefault();\t\t\n\t\tvar message = $('#chat_input').val();\n\t\tvar name = $('#name').val();\n\t\t\t// outgoing // this is to send message to server for displaying to other clients\n\t\tsocket.emit('messages', \"<font style='color:red;'>\" + name + \"</font> <b>:</b> \" + message);\n\n\t\t});\n\t\t\t\t\n\n\t}", "title": "" }, { "docid": "e2a2a36876d86b79a36c80cac806f69a", "score": "0.64343905", "text": "function initGame() {\n stage = new createjs.Stage('gamecanvas');\n createjs.Touch.enable(stage);\n stage.enableMouseOver(20);\n\n stage.canvas.width = window.innerWidth;\n stage.canvas.height = window.innerHeight;\n\n /* Set preloading text */\n var title = new createjs.Text('Loading..',(stage.canvas.width * 0.06) + 'px Arial','black');\n bounds = title.getBounds();\n title.x = (stage.canvas.width * 0.5) - (bounds.width / 2);\n title.y = stage.canvas.height * 0.25;\n stage.addChild(title);\n\n // Set initial game data in session object\n socket.on('_setInitialGameData', function(data) {\n // Fill static game data\n staticGameData = data.staticGameData;\n shangrila = new Shangrila();\n shangrila.inLobby = false;\n shangrila.inSplash = true;\n shangrila.guilds = staticGameData.guilds;\n shangrila.villages = staticGameData.villagePositions;\n shangrila.villageWidth = staticGameData.villageWidth;\n shangrila.villageHeight = staticGameData.villageHeight;\n shangrila.bridges = staticGameData.bridgePositions;\n shangrila.neighbours = staticGameData.neighbours;\n shangrila.colorNames = staticGameData.colorNames;\n shangrila.colors = staticGameData.colors;\n shangrila.numberOfActiveMessages = staticGameData.numberOfActiveMessages;\n shangrila.messageHistory = staticGameData.messageHistory;\n shangrila.autoSetupRound = staticGameData.autoSetupRound;\n shangrila.presetStartingPositions = staticGameData.presetStartingPositions;\n\n // Fill state machine data\n stateMachine = data.stateMachine;\n shangrila.activePlayers = stateMachine.activePlayers;\n shangrila.playerOrder = stateMachine.playerOrder;\n });\n\n socket.on('_updateGameData', function(data) {\n if(typeof data.bridges != 'undefined') {\n shangrila.bridges = data.bridges;\n }\n if(typeof data.villages != 'undefined') {\n shangrila.villages = data.villages;\n }\n });\n\n // Client functions\n socket.on('_removeBridge', function (data) {\n shangrila.removeBridge(data);\n });\n\n socket.on('_placeMaster', function (data) {\n shangrila.placeMaster(data);\n });\n\n socket.on('_updateGuildShield', function (data) {\n shangrila.updateGuildShield(data);\n });\n\n socket.on('_showSplashScreen', function() {\n shangrila.splashScreen();\n });\n\n socket.on('_initNewGame', function (){\n shangrila.initNewGame();\n });\n\n socket.on('_updateStateMachineValue', function(data) {\n for(var index in data) {\n shangrila[index] = data[index];\n console.log('State machine in var shangrila.' + index + ' is set to ' + data[index]);\n if(index == 'currentPlayer') {\n shangrila.updateCurrentPlayer();\n }\n if(index == 'villages' || index == 'neighbours') {\n stateMachine[index] = data[index];\n }\n }\n });\n\n socket.on('_showMessage', function (data) {\n shangrila.showMessage(data);\n });\n\n socket.on('message', function(data) {\n shangrila.showMessage(data);\n });\n}", "title": "" }, { "docid": "076a8e1e3958d622d2e97086f0fe76c4", "score": "0.63891006", "text": "constructor()\n {\n this.ws = new WebSocket(\"ws://149.153.106.114:8080/wstest\");\n this.ctx = {};\n \n this.boundRecursiveUpdate = this.update.bind(this);\n this.boundDraw = this.draw.bind(this);\n\n \n this.initWorld();\n this.sceneManager = new SceneManager();\n this.menuScene = new MenuScene(\"Menu Scene\",\"blue\", this, this.ws);\n this.playingScene = new PlayingScene(\"Playing Scene\",\"white\", this);\n this.multiplayScene = new Multiplaying(\"Multiplay Scene\", \"white\", this, this.ws);\n this.gameoverScene = new GameoverScene(\"Game Over Scene\",\"yellow\", this);\n this.nextlevelScene = new NextLevelScene(\"Next level\",\"purple\");\n this.optionsScene = new OptionScene(\"Options\",\"grey\");\n \n this.sceneManager.addScene(this.menuScene);\n this.sceneManager.addScene(this.playingScene);\n this.sceneManager.addScene(this.multiplayScene);\n this.sceneManager.addScene(this.gameoverScene);\n this.sceneManager.addScene(this.nextlevelScene);\n this.sceneManager.addScene(this.optionsScene);\n\n this.sceneManager.goToScene(this.menuScene.title);\n this.sceneManager.render(this.ctx);\n\n }", "title": "" }, { "docid": "9dcca71facefc1173b688c987afa8c23", "score": "0.63246727", "text": "create () {\n\t\tconsole.log('creating');\n\t\tlet self = this; // to store the current context\n\n\t\tthis.otherPlayers = this.physics.add.group(); // hold a group of game objects inside phaser\n\n\t\t// this.socket = io(); // assign the io to socket\n\n\t\tsocket.emit('start');\n\n\t\t// recieved when first connecting to the server so you get positions and colors of all current players\n\t\tsocket.on('currentPlayers', players => {\n\t\t\tObject.keys(players).forEach(id => { // loops through those players\n\t\t\t\tif (players[id].playerId === socket.id) { // if that player is this client, run func\n\t\t\t\t\tthis.addPlayers(self, players[id]);\n\t\t\t\t} else {\n\t\t\t\t\tthis.addOtherPlayers(self, players[id]) // all other players get this function\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// if a new player joins the server\n\t\tsocket.on('newPlayer', player => {\n\t\t\tthis.addOtherPlayers(self, player);\n\t\t});\n\n\t\t// if someone disconnects\n\t\tsocket.on('disconnect', playerId => {\n\t\t\tself.otherPlayers.getChildren().forEach(child => {\n\t\t\t\tif (playerId === child.playerId)\n\t\t\t\t\tchild.destroy();\n\t\t\t})\n\t\t});\n\n\t\t// called whenever the server says someone moved\n\t\tsocket.on('playerMoved', playerInfo => {\n\t\t\tself.otherPlayers.getChildren().forEach(player => {\n\t\t\t\tif (playerInfo.playerId === player.playerId){\n\t\t\t\t\tplayer.setPosition(playerInfo.x, playerInfo.y);\n\t\t\t\t}\n\t\t\t});\n\t\t});\t\t\n\n\t\tsocket.on('startGame', () => this.switchScenes());\n\n\t\t// add the sky background\n\t\tthis.add.image(0, 0, 'sky').setOrigin(0, 0);\n\t\tthis.scoreText = this.add.text(16, 16, 'Score: 0', {fontSize: '32px', fill: '#fff'}) // adds the score Text (top left)\n\n\t\tthis.platforms = this.physics.add.staticGroup(); // adds the platforms as a non moving (static) group\n\n\t\t// adds the stars in a movable group with different starting coordinates (70px away in the x)\n\t this.stars = this.physics.add.group({\n\t \tkey: 'star', repeat: 11, setXY: {x: 12, y: 0, stepX: 70}\n\t });\n\n\t // creates all the platforms for the game\n\t this.platforms.create(400, 568, 'ground').setScale(2).refreshBody();\n\t this.platforms.create(600, 400, 'ground');\n\t this.platforms.create(50, 250, 'ground');\n\t this.platforms.create(750, 220, 'ground');\n\n\t // ready button\n\t this.ready = this.add.text(700, 560, 'Not Ready', {fontFamily: 'Roboto', color: '#fff', backgroundColor: '#C42953'}).setInteractive();\n\t this.ready.on('pointerdown', () => {\n\t \tthis.ready.setText('Ready')\n\t\t\t \t .setBackgroundColor('#28CA4A')\n\t\t\t \t .setColor('#000');\n\t\t\tsocket.emit('ready');\n\t });\n\n\t // add random bounce amounts to each star\n\t this.stars.children.iterate(child => child.setBounceY(Phaser.Math.FloatBetween(0.6, 1)));\n\n\t // make stars collide with platforms\n\t\tthis.physics.add.collider(this.stars, this.platforms);\n\n\t\t// get keyboard vals\n\n\t\t// this.keyboard = this.input.keyboard.createCursorKeys();\n\t\tthis.keyboard = this.input.keyboard.addCapture('UP', 'LEFT', 'RIGHT');\n\t\tthis.keyUP = this.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.UP);\n\t\tthis.keyLEFT = this.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.LEFT);\n\t\tthis.keyRIGHT = this.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.RIGHT);\n\n\t}", "title": "" }, { "docid": "5201359b40938cd0710a46dcdf3d96d9", "score": "0.6323008", "text": "function newGame(){\n socket.emit(\"newGame\");\n init(); //Run init function when screen loads\n}", "title": "" }, { "docid": "ff0773773bf946a33d1f8af00aa2b3e1", "score": "0.62516445", "text": "function VisClient( aOptions ) {\n var self = this;\n\n var options = {\n type: 'vis',\n name: 'default-vis',\n showNames: true\n };\n\n ////////////////////////////////////////////////////////////////////////////\n // Private Data\n ////////////////////////////////////////////////////////////////////////////\n // Create node to show state in JSON\n self.stateTextNode = document.createTextNode( \"No state yet\" );\n document.body.appendChild( self.stateTextNode );\n\n // Create node to show bottom boundary\n self.verticalBoundaryNode = document.createElement( 'div' );\n self.verticalBoundaryNode.className = 'boundary';\n self.verticalBoundaryNode.style.width = 800;\n self.verticalBoundaryNode.style.height = 100;\n self.verticalBoundaryNode.style.left = 0;\n document.body.appendChild( self.verticalBoundaryNode );\n\n // Create node to show right boundary\n self.horizontalBoundaryNode = document.createElement( 'div' );\n self.horizontalBoundaryNode.className = 'boundary';\n self.horizontalBoundaryNode.style.width = 100;\n self.horizontalBoundaryNode.style.height = 400;\n self.horizontalBoundaryNode.style.top = 0;\n document.body.appendChild( self.horizontalBoundaryNode );\n\n // Init audio library & load sounds\n if( WebAudio.isAvailable ) {\n var webAudio = new WebAudio();\n self.playerShootSound = webAudio.createSound().load( 'resources/sound/shoot.wav' );\n self.playerAccelerateSound = webAudio.createSound().load( 'resources/sound/accelerate.wav' ).volume(0.3);\n self.playerDeadSound = webAudio.createSound().load( 'resources/sound/player-dead.wav' );\n self.playerSpawnSound = webAudio.createSound().load( 'resources/sound/player-spawn.wav' );\n self.damagedSound = webAudio.createSound().load( 'resources/sound/damage.wav' );\n }\n\n // Game Objects being drawn, indexed by guid\n self.gameObjs = {};\n\n ////////////////////////////////////////////////////////////////////////////\n // Handlers\n ////////////////////////////////////////////////////////////////////////////\n\n ////////////////////////////////////////////////////////////////////////////\n // Handle connect event\n ////////////////////////////////////////////////////////////////////////////\n self.onConnect = function() {\n self.socket.emit( 'player-type', options.type );\n self.socket.emit( 'player-name', options.name );\n }; // End onConnect()\n\n ////////////////////////////////////////////////////////////////////////////\n // Handle disconnect event\n ////////////////////////////////////////////////////////////////////////////\n self.onDisconnect = function() {\n\n // Clean up objects\n for( var guid in self.gameObjs ) {\n document.body.removeChild( self.gameObjs[guid].getElement() );\n self.gameObjs[guid].destroy();\n }\n self.gameObjs = {};\n\n self.stateTextNode.nodeValue = \"Disconnected!\";\n }; // End onDisconnect()\n\n ////////////////////////////////////////////////////////////////////////////\n // Toggle whether or not names are shown above players\n ////////////////////////////////////////////////////////////////////////////\n self.onToggleShowNames = function( aKeyState ) {\n if( aKeyState.toggleShowNames === 1 ) {\n options.showNames = !options.showNames;\n\n for( var guid in self.gameObjs ) {\n var obj = self.gameObjs[guid];\n\n if( obj.state.type === 'player' ) {\n obj.showName( options.showNames );\n }\n }\n }\n }; // End toggleShowNames()\n\n ////////////////////////////////////////////////////////////////////////////\n // Handle state update message\n ////////////////////////////////////////////////////////////////////////////\n self.onStateUpdate = function( aState ) {\n\n // Update displayed JSON\n // self.stateTextNode.nodeValue = JSON.stringify( aState );\n self.stateTextNode.nodeValue = \"\";\n\n // Update boundaries\n self.verticalBoundaryNode.style.width = aState.xMax;\n self.verticalBoundaryNode.style.top = aState.yMax;\n\n self.horizontalBoundaryNode.style.height = aState.yMax + 100;\n self.horizontalBoundaryNode.style.left = aState.xMax;\n\n // Update local gameobjects with new state\n self.updateObjects( self.gameObjs, aState.objs, {\n 'player': { objClass: 'player-red', showName: options.showNames, showHealth: true, createSound: self.playerSpawnSound, deadSound: self.playerDeadSound, accelerateSound: self.playerAccelerateSound },\n 'asteroid': { objClass: 'asteroid-small', showName: false, showHealth: true, damagedSound: self.damagedSound, deadSound: self.damagedSound },\n 'bullet': { objClass: 'bullet', showName: false, showHealth: false, createSound: self.playerShootSound }\n });\n\n // Schedule a new frame draw in 15ms\n setTimeout( self.predictMotion, 15, 15 );\n\n }; // End onStateUpdate()\n\n ////////////////////////////////////////////////////////////////////////////\n // Private Functions\n ////////////////////////////////////////////////////////////////////////////\n\n ////////////////////////////////////////////////////////////////////////////\n // Update aLocalObjects to match the state in aStateList, create new objects\n // with the options in aNewObjOptions\n ////////////////////////////////////////////////////////////////////////////\n self.updateObjects = function( aLocalObjects, aStateList, aNewObjOptionsMap ) {\n // Mark all objects as not seen in this update\n for( var guid in aLocalObjects ) {\n aLocalObjects[guid].seen = false;\n }\n\n // For each object in the new state, update the local object or create a new local object\n for( var i = 0; i < aStateList.length; ++i ) {\n var obj = aLocalObjects[aStateList[i].guid];\n\n // If the we don't have a local representation of this object, create one\n if( obj === undefined ) {\n var type = aStateList[i].type;\n var objectOptions = aNewObjOptionsMap[type];\n\n // Create object with options for the type of the remote object\n if( objectOptions !== undefined ) {\n obj = new GameObj( aStateList[i], objectOptions );\n\n // Add object to local state\n document.body.appendChild( obj.getElement() );\n aLocalObjects[obj.state.guid] = obj;\n }\n else {\n console.warn( \"Unknown game object type'\" + type + \"' received.\" );\n }\n }\n\n // Update local object with remote state\n if( obj !== undefined ) {\n obj.update( aStateList[i] );\n obj.seen = true;\n }\n }\n\n // Remove objects that were not seen in this update\n for( var guid in aLocalObjects ) {\n if( !aLocalObjects[guid].seen ) {\n document.body.removeChild( aLocalObjects[guid].getElement() );\n aLocalObjects[guid].destroy();\n delete aLocalObjects[guid];\n }\n }\n }; // End updateObjects()\n\n ////////////////////////////////////////////////////////////////////////////\n // Run the same simulation as the server to predict where something would be\n // between frames for higher framerate than server tickrate\n ////////////////////////////////////////////////////////////////////////////\n self.predictMotion = function( aTime ) {\n // Move GameObjs\n for( var guid in self.gameObjs ) {\n var obj = self.gameObjs[guid].state;\n\n // Change velocity according to acceleration\n obj.v.x = obj.v.x + obj.a.x * aTime;\n obj.v.y = obj.v.y + obj.a.y * aTime;\n\n // Apply velocity limits\n var v = Math.sqrt( obj.v.x * obj.v.x + obj.v.y * obj.v.y );\n if( v > obj.vMax ) {\n var uVx = obj.v.x / v;\n var uVy = obj.v.y / v;\n\n obj.v.x = uVx * obj.vMax;\n obj.v.y = uVy * obj.vMax;\n }\n\n // Apply friction if the object isn't accelerating\n if( obj.friction > 0 && obj.a.x === 0 && obj.a.y === 0 ) {\n\n if( v > 0.0025 ) {\n var uVx = obj.v.x / v;\n var uVy = obj.v.y / v;\n v = v - obj.friction * aTime;\n\n obj.v.x = uVx * v;\n obj.v.y = uVy * v;\n }\n else {\n obj.v.x = 0;\n obj.v.y = 0;\n }\n }\n\n // Change position according to velocity\n obj.pos.x = obj.pos.x + obj.v.x * aTime;\n obj.pos.y = obj.pos.y + obj.v.y * aTime;\n\n // Wrap position\n if( obj.pos.x < 0 ) {\n obj.pos.x += self.xMax;\n }\n if( obj.pos.y < 0 ) {\n obj.pos.y += self.yMax;\n }\n obj.pos.x %= self.xMax;\n obj.pos.y %= self.yMax;\n\n // Update visually\n self.gameObjs[guid].update( obj );\n }\n }; // End predictMotion()\n\n ////////////////////////////////////////////////////////////////////////////\n // Action!\n ////////////////////////////////////////////////////////////////////////////\n\n // Merge default options with incoming options\n merge( options, aOptions );\n\n // Connect to server\n self.socket = io.connect();\n\n // Connect our handlers\n self.socket.on( 'connect', self.onConnect );\n self.socket.on( 'disconnect', self.onDisconnect );\n self.socket.on( 'state-update', self.onStateUpdate );\n\n // Set up KeyboardManager\n self.keyboardManager = new KeyboardManager( {\n keyBinding: {\n 'N': 'toggleShowNames'\n },\n\n onKeyStateChange: self.onToggleShowNames\n });\n} // End VisClient()", "title": "" }, { "docid": "dca47af6f40d57852cf537bb6a7b4413", "score": "0.6237101", "text": "function listenToServer(self){\n\tself.socket = io();\n\t//listens for the currentPlayers event\n\tself.socket.on('currentPlayers', \n\t\tfunction (players) {\n\t\t\t//to loop through the players, we use Object.keys() to create an array of all the keys in the Object that is passed in\n\t\t\t//we use forEach() method to loop through each item in the array.\n\t\t\tObject.keys(players).forEach(\n\t\t\t\tfunction (id) {\n\t\t\t\t\tif (players[id].playerId === self.socket.id) {\n\t\t\t\t\t\t//passes it the current player’s information, and a reference to the current scene.\n\t\t\t\t\t\taddPlayer(self, players[id]);\n\t\t\t\t\t} else {//if players[id] is not the current player.\n\t\t\t\t\t\taddOtherPlayers(self, players[id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\t//add the new player to our game when newPlayer event is fired.\n\tself.socket.on('newPlayer',\n\t\tfunction(playerInfo) {\n\t\t\taddOtherPlayers(self, playerInfo);\n\t\t}\n\t);\n\t//When the disconnect event is fired, we take that player’s id and we remove that player’s soldier from the game.\n\tself.socket.on('disconnect', \n\t\tfunction (playerId) {\n\t\t\t//The getChildren() method will return an array of all the game objects that are in othePlayers group\n\t\t\tself.otherPlayers.getChildren().forEach(\n\t\t\t\tfunction(otherSoldier) {\n\t\t\t\t\tif (playerId === otherSoldier.playerId) {\n\t\t\t\t\t\t//to remove that game object from the game\n\t\t\t\t\t\totherSoldier.destroy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\t//using Phaser’s built-in keyboard manager\n\t/*\n\tthis will populate the cursors object with \n\tour four main Key objects (up, down, left, and \n\tright), which will bind to those arrows on the keyboard. \n\tThen, we just need to see if these keys are being held down \n\tin the update function.\n\t*/\n\tself.cursors = self.input.keyboard.createCursorKeys();\n\t\n\t//when playerMoved event is emitted, we will need to update that player’s sprite in the game\n\tself.socket.on('playerMoved', function (playerInfo) {\n\t self.otherPlayers.getChildren().forEach(function (otherSoldier) {\n\t\t \n\t\tif (playerInfo.playerId === otherSoldier.playerId) {\n\t\t\t//Set the position\n\t\t\totherSoldier.setPosition(playerInfo.x, playerInfo.y +8); //hacky way of synchronizing Y location\n\t\t\t//Setting velocity info for generating animation:\n\t\t\t//NOTE: \n\t\t\t//At the moment I'm handling otherPlayers animation by sending the velocity info\n\t\t\t//over the network and depending on xVelocity's sign I'm handling the animation in the update\n\t\t\t//function\n\t\t\t//IMPROVEMENT OPPORTUNITY:\n\t\t\t//There seem to be some delay in the animation. Perhaps it's better to handle\n\t\t\t//animation of otherPlayers based on change of location of their sprite in the client side\n\t\t\t//and not to send velocity info over the network\n\t\t\totherSoldier.xVelocity = playerInfo.xVelocity;\n\t\t\totherSoldier.yVelocity = playerInfo.yVelocity;\n\t\t}\n\t });\n\t});\n\n\t//when we recieve a shooting msg from the server (can be this player's bullet or someone else's)\n\tself.socket.on('shoot',\n\t\tfunction (bulletInfo) {\n\t\t\taddOtherPlayersBullet(self, bulletInfo);\n\t\t}\n\t);\n\n\tself.socket.on('playerGotShotImpact',\n\t\tfunction (playerInfo){\n\t\t// console.log(\"HERE2:\" + playerInfo);\n\t\t\tif (playerInfo == self.player1.soldierContainer.playerId){\n\t\t\t\t//self.soldier.destroy();\n\t\t\t\tself.physics.pause();\n\t\t\t\tself.player1.scoreText.setText('Game Over');\n\t\t\t}else{\n\t\t\t\tself.otherPlayers.getChildren().forEach(function (otherSoldier) {\n\n\t\t\t\t\tif (playerInfo == otherSoldier.playerId) {\n\t\t\t\t\t\t// console.log(\"HERE3:\" + playerInfo );\n\t\t\t\t\t\totherSoldier.destroy();\n\t\t\t\t\t\t//bullet.destroy();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t);\n\n}", "title": "" }, { "docid": "4ee30e9f5d6d10bfd4be31a9a106b6ed", "score": "0.6186816", "text": "function init(){\n socket = io();\n\n initMenus();\n initMaps();\n initShips();\n initProjectiles();\n initKeys();\n initChat();\n initParticles();\n\n socket.on('id', function(id, v){\n self.id = id;\n if(v) version = v;\n if(v) document.getElementById('version').innerHTML = v;\n });\n\n socket.on('update', function(ppos, spos, objectives, time, population, rankings){\n if(self.joined){\n ctx.clearRect(0, 0, canvas.width, canvas.height); // clear canvas\n tctx.clearRect(0, 0, canvas.width, canvas.height);\n update(ppos, spos);\n drawBackground();\n drawObjectives(objectives);\n drawSelf();\n drawProjectiles();\n drawParticles();\n if(mapdata) drawMap();\n drawLighting();\n drawPlayers();\n drawHUD(time, population, rankings, objectives);\n drawMinimap(objectives)\n }\n });\n}", "title": "" }, { "docid": "4fa8367d1dd2884b6f9af281e76dc54f", "score": "0.61803734", "text": "function startGameScene() {\n\n /**\n * periodically called model updater used when the game is running. Mostly\n * has to deal with collision detection in this game.\n *\n * @see startGameScene\n */\n function gameUpdate(msDuration) {\n gamejs.sprite.groupCollide(rocketGroup, planetGroup, true, true);\n\n var checkShipCollide = function(item) {\n if (gamejs.sprite.collideRect(item, ship)) {\n ship.kill();\n return true;\n }\n return false;\n }\n\n // ship hit planet\n planetGroup.sprites().forEach(checkShipCollide);\n // ship hit by shuriken\n shurikenGroup.sprites().forEach(checkShipCollide);\n\n // ship hit diamonds?\n diamondGroup.sprites().forEach(function(diamond) {\n if (gamejs.sprite.collideRect(diamond, ship)) {\n scoreGroup.add(new tysprites.Scorepoints(diamond.rect.center, 250));\n gui.diamondScore += 250;\n diamond.kill();\n }\n });\n\n return;\n };\n\n /**\n * event handling function when game is running\n * @see startGameScene\n */\n function gameDoEvents(event) {\n if (event.type == gamejs.event.KEY_DOWN) {\n if (event.key == gamejs.event.K_LEFT) {\n ship.rotateDir = -1;\n } else if (event.key == gamejs.event.K_RIGHT) {\n ship.rotateDir = 1;\n } else if (event.key == gamejs.event.K_DOWN) {\n ship.speed = 1;\n } else if (event.key == gamejs.event.K_UP) {\n ship.speed = 2;\n var now = Date.now();\n if (now - msLastBoost > 5000) {\n ship.speed = 120;\n }\n } else if (event.key == gamejs.event.K_SPACE) {\n var now = Date.now();\n if (now - msLastRocket > 500) {\n // shoot rocket\n var rocket = new tysprites.Rocket(scene, ship.rect.center, ship.heading);\n rocketGroup.add(rocket);\n if (false) (new gamejs.mixer.Sound(\"sounds/rocket.ogg\")).play();\n msLastRocket = now;\n }\n }\n } else if (event.type == gamejs.event.KEY_UP) {\n if ([gamejs.event.K_LEFT, gamejs.event.K_RIGHT].indexOf(event.key) > -1) {\n ship.rotateDir = 0;\n } else if (event.key === gamejs.event.K_m) {\n //PLAY_SOUNDS = !PLAY_SOUNDS;\n }\n }\n };\n\n scene.stop();\n scene.background = gamejs.image.load('images/starbackground.png');\n\n // for rocket that will be created during game\n var rocketGroup = new gamejs.sprite.Group();\n scene.addGroup(rocketGroup);\n\n // diamonds created by planet explosions\n var diamondGroup = new gamejs.sprite.Group();\n scene.addGroup(diamondGroup)\n\n // for explosions by anyone\n var explosionGroup = new gamejs.sprite.Group();\n scene.addGroup(explosionGroup);\n\n // group for rockets shot by planets\n var shurikenGroup = new gamejs.sprite.Group();\n scene.addGroup(shurikenGroup);\n\n // score various\n var scoreGroup = new gamejs.sprite.Group();\n scene.addGroup(scoreGroup);\n\n // player ship\n var ship = new tysprites.Ship(explosionGroup, scene);\n ship.turnBy(45);\n scene.sprites.push(ship);\n\n // add a couple of planets at random position\n var planetGroup = new gamejs.sprite.Group();\n scene.addGroup(planetGroup);\n while (planetGroup.sprites().length < 10) {\n var planet = new tysprites.Planet([\n (screenRect.width - 110) * Math.random() + 100,\n (screenRect.height - 110) * Math.random() + 100\n ],\n ship,\n shurikenGroup,\n explosionGroup,\n diamondGroup,\n scoreGroup,\n scene\n );\n planetGroup.add(planet);\n }\n\n /**\n * the gui is just a sprite\n */\n var gui = new tysprites.Gui(scene, ship, planetGroup, startGameOverScene);\n scene.sprites.push(gui);\n var msLastRocket = 0;\n var msLastBoost = 0;\n // event handling & model updating per frame is\n // extracted into seperate functions\n scene.doEvents = gameDoEvents;\n scene.update = gameUpdate;\n scene.start(30);\n return;\n }", "title": "" }, { "docid": "089ee03a3d01fd4eaf40722ffdd8f65a", "score": "0.61311907", "text": "function OnNetworkLoadedLevel()\n{\n\t// This is where you would expect all the cycles to be spawned. Well, you'd be right, but\n\t// the code to do that is actually in a GameRules component. To support different modes\n\t// of game play, all the work must be done in a component in the same object as the Game\n\t// Director, but not in the Game Director component.\n\t\n\t// In a network game, the server set up its instance of the rules, and starts its game here.\n\t// The client will wait from a buffered message from the server with the game rules enumeration.\n\t// Then it will start its game.\n\tif (inputDirector.IsHosting())\n\t{\n\t\t// Before we do anything, we must first see if there are enough players to actually\n\t\t// start a game.\n\t\t\n\t\t// Figure out how many actual cycles we're spawning\n\t\tvar cycleCount : int = GetStartingCycleCount();\n\t\t// If there are less than two cycles, then we will be in \"Waiting for players\" mode\n\t\tif (cycleCount < 2)\n\t\t{\n\t\t\tDebug.Log(\"Waiting for players.\");\n\t\t\tgameMode = GameDirectorMode.WaitingForPlayers;\n\t\t\t// Send out a message to all players (including self) that we're in \"Waiting mode\"\n\t\t\tinputDirector.BroadcastBufferedCommand(\"OnSetGameMode\", GameDirectorMode.WaitingForPlayers);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If there are two or more cycles, it's go time.\n\t\t\tDebug.Log(\"Game is hot.\");\n\t\t\tvar gameRules : GameRuleTypes = ConfigurationDirector.GetGameRules();\n\t\t\n\t\t\t// Inform the server and the clients of the game rules. It's important to do it now before \n\t\t\t// any other buffered messages (like spawning AI cycles) happens, or else unpredictable things \n\t\t\t// can happen.\n\t\t\tif (inputDirector.IsNetworking()) {\n\t\t\t\tinputDirector.BroadcastBufferedCommand(\"OnDefineGameRules\", gameRules);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "208208b9d3ce77aa23f07fa4d082f3eb", "score": "0.6092352", "text": "setup(\n game // game.js/Game: Your Game!\n ) {\n this.game = game;\n game.room = null;\n game.roomJoined = false;\n game.cursors = null;\n game.width = 0;\n game.height = 0;\n game.scales = {};\n game.front_layer = game.add.group();\n // ADDS AN EVENT TO ALLOW FOR CLICKING\n document.addEventListener('click', function (e) {\n if (\n !e.path.includes(document.getElementById('input-overlay')) &&\n game.click\n ) {\n const moveX = e.clientX - window.innerWidth / 2;\n const moveY = e.clientY - window.innerHeight / 2;\n game.click(\n game.cameras.main.scrollX + window.innerWidth / 2 + moveX,\n game.cameras.main.scrollY + window.innerHeight / 2 + moveY\n );\n }\n });\n // ADDS AN EVENT TO ALLOW FOR MOUSEMOVE\n document.addEventListener('mousemove', function (e) {\n if (game.mousemove) {\n const moveX = e.clientX - window.innerWidth / 2;\n const moveY = e.clientY - window.innerHeight / 2;\n game.mousemove(\n game.cameras.main.scrollX + window.innerWidth / 2 + moveX,\n game.cameras.main.scrollY + window.innerHeight / 2 + moveY\n );\n }\n });\n linkMethods(this, clientMethods);\n }", "title": "" }, { "docid": "0115d52535797ecd03d1e8327cdd1f80", "score": "0.60847104", "text": "function initSocketConnection() {\n console.log(\"Initializing socket.io...\");\n socket = io();\n\n socket.on(\"connect\", () => {});\n\n //On connection server sends the client his ID and a list of all keys\n socket.on(\"introduction\", (_id, _clientNum, _ids, _iceServers) => {\n // keep local copy of ice servers:\n console.log(\"Received ICE server credentials from server.\");\n iceServerList = _iceServers;\n\n // keep a local copy of my ID:\n console.log(\"My socket ID is: \" + _id);\n id = _id;\n\n // for each existing user, add them as a client and add tracks to their peer connection\n for (let i = 0; i < _ids.length; i++) {\n if (_ids[i] != id) {\n addClient(_ids[i]);\n callUser(_ids[i]);\n }\n }\n });\n\n // when a new user has entered the server\n socket.on(\"newUserConnected\", (clientCount, _id, _ids) => {\n console.log(clientCount + \" clients connected\");\n\n let alreadyHasUser = false;\n for (let i = 0; i < Object.keys(clients).length; i++) {\n if (Object.keys(clients)[i] == _id) {\n alreadyHasUser = true;\n break;\n }\n }\n\n if (_id != id && !alreadyHasUser) {\n console.log(\"A new user connected with the id: \" + _id);\n addClient(_id);\n }\n });\n\n socket.on(\"userDisconnected\", (clientCount, _id, _ids) => {\n // Update the data from the server\n\n if (_id != id) {\n console.log(\"A user disconnected with the id: \" + _id);\n glScene.removeClient(_id);\n removeClientVideoElementAndCanvas(_id);\n delete clients[_id];\n }\n });\n\n // Update when one of the users moves in space\n socket.on(\"userPositions\", (_clientProps) => {\n glScene.updateClientPositions(_clientProps);\n });\n\n // Update when one of the users is animating\n socket.on(\"userAnimations\", (_clientProps) => {\n glScene.updateClientAnimations(_clientProps);\n });\n\n socket.on(\"call-made\", async (data) => {\n console.log(\"Receiving call from user \" + data.socket);\n\n // set remote session description to incoming offer\n await clients[data.socket].peerConnection.setRemoteDescription(\n new RTCSessionDescription(data.offer)\n );\n\n // create answer and set local session description to that answer\n const answer = await clients[data.socket].peerConnection.createAnswer();\n await clients[data.socket].peerConnection.setLocalDescription(\n new RTCSessionDescription(answer)\n );\n\n // send answer out to caller\n socket.emit(\"make-answer\", {\n answer,\n to: data.socket,\n });\n });\n\n socket.on(\"answer-made\", async (data) => {\n console.log(\"Answer made by \" + data.socket);\n\n // set the remote description to be the incoming answer\n await clients[data.socket].peerConnection.setRemoteDescription(\n new RTCSessionDescription(data.answer)\n );\n\n // what is this for?\n if (!clients[data.socket].isAlreadyCalling) {\n callUser(data.socket);\n clients[data.socket].isAlreadyCalling = true;\n }\n });\n\n socket.on(\"iceCandidateFound\", (data) => {\n clients[data.socket].peerConnection.addIceCandidate(data.candidate);\n });\n}", "title": "" }, { "docid": "a8e47cc5c786de74c89fe1a0e004be7b", "score": "0.60793966", "text": "function serverStart() {\n\tconsole.log('connecting...');\n\tconsole.log('game room: ' + gameRoom);\n\tvar socket = io.connect('/game/' + gameRoom);\n\n\t//setting up \n\tsocket.on('setup', function(playersPositions, playerid){\n\t\t// console.log('setting up...');\n\t\t// renderBots(bots);\\\n\t\tif (playerId === undefined ) {\n\t\t\tplayerId = playerid;\n\t\t}\n\t\trenderPlayers(playersPositions);\n\t});\n\n\t//when a player modves\n\tfunction sendMove (dir) {\n\t\tsocket.emit('playerMove', dir, playerId);\n\t\tconsole.log('playerId: ' + playerId);\n\t\tconsole.log('sending Move');\n\t}\n\n\tsocket.on('playerMoved', function (playersPositions) {\n\t\tconsole.log('receiving Move');\n\t\trenderPlayers(playersPositions);\n\t})\n\n\n\t//Emit Events\n\n\n\t//receive events \n\t// socket.on('changedObj', function (data) {\n\t// \tsideBarSetup();\n\t// \tobjArr = data.drawings;\n\t// })\n\n\tlet returnObj = {\n\t\tsendMove : sendMove\n\t}\n\n\treturn returnObj;\n}", "title": "" }, { "docid": "cbc8dc22f1278ec34fc7b5c8299a7829", "score": "0.6076599", "text": "function joinGame(menuChoices) {\n\n //switch state\n state = 'load';\n\n //connect socket to server\n socket = io({\n //no reconnection allowed\n reconnection:false,\n });\n\n //capture socket errors\n socket.once('connect_error', function (error) {\n console.log('connect_error', error);\n errors.displayError('Server Connection Error', 5000);\n restartMenus();\n socket.close();\n });\n socket.once('connect_timeout', function (timeout) {\n console.log('connect_timeout', timeout);\n errors.displayError('Server Connection Timeout', 5000);\n restartMenus();\n socket.close();\n });\n socket.on('error', function (error) {\n console.log('error', error);\n errors.displayError('Socket Error', 5000);\n });\n\n //return to server menu if disconnected\n socket.once('disconnect', function (reason) {\n console.log('disconnect', reason);\n if(!errors.active) {\n errors.displayError('Server Disconnected', 5000);\n }\n restartMenus();\n socket.close();\n })\n\n //attempt to join game\n socket.emit(\n 'join_game', \n menuChoices.roomId, \n menuChoices.name\n );\n\n //if socket rejected, send back to menu and display reason error\n socket.once('rejection', function (reason) {\n console.log('rejection', reason);\n errors.displayError(`REJECTED: ${reason}`, 5000);\n restartMenus();\n socket.close();\n });\n\n //confirm room joining\n socket.once('joined', function (newId) {\n\n //set global roomId\n roomId = newId;\n\n //Start controls (controls.js)\n startControls(socket);\n\n //remove error message if shown\n errors.hideError();\n\n //change state\n state = 'game';\n\n //recieve player info from server\n socket.on ('game_update', function (serverData) {\n //save to objects (game.js)\n gameData = serverData.roomData;\n playingData = serverData.playerData.playing;\n waitingData = serverData.playerData.waiting;\n shotData = serverData.shotData;\n enemyShotData = serverData.enemyShotData;\n pickupData = serverData.pickupData;\n enemyData = serverData.enemyData;\n zoneData = serverData.zoneData;\n });\n });\n}", "title": "" }, { "docid": "1601d4974920266f30252d0cb47db6a3", "score": "0.6059163", "text": "function scene (){\n \tcreateScene(audio);\n\n \tfunction audio (){\n // init audio support\n createAudio(room);\n\n function room() {\n\n \tcreateRoom(controls);\n \tfunction controls() {\n\n \t // add the objects and lights - replace those functions as you please\n \t initControls(startLoop);\n\n \t function startLoop () {\n // renderer.render(scene, camera);\n \t\t\t\t\t// start a loop that will update the objects' positions\n \t\t\t\t\t// and render the scene on each frame\n \t\t\t\t\tloop(); \t\t\t\t\t\n \t\t\t\t} \n\n \t\t\t}\n \t\t}\n \t}\n }", "title": "" }, { "docid": "840debf3c3e1ab4de37eecb1a04d8fa9", "score": "0.6058942", "text": "function onlineSetup() {\r\n // This is an online game.\r\n localGame = false;\r\n // Socket io is need for an online gmae.\r\n socket = io();\r\n // A message was recieved from the server. Display it.\r\n socket.on(\"whisper\", function (dataFromServer) {\r\n gameMessage(dataFromServer);\r\n });\r\n // The game has ended properly. Close the socket, and show the results screen.\r\n socket.on(\"gameOver\", function (endGame) {\r\n exitGame();\r\n endGameScreen(endGame);\r\n });\r\n // The other player left the game. Close the socket, return to game select, and inform player.\r\n socket.on(\"playerDC\", function () {\r\n // Close the socket.\r\n exitGame();\r\n // Show the game type selection screen.\r\n reveal(\"#selectGame\");\r\n // Tell the player that the other player left.\r\n alert(\"The other player disconnected.\");\r\n });\r\n // The sever has sent an updated board to the client. Display it.\r\n socket.on(\"boardUpdate\", function (boardFromServer) {\r\n gB = boardFromServer;\r\n printBoardObj(gB);\r\n });\r\n}", "title": "" }, { "docid": "c9582ed94666d646777a4f9e067be18a", "score": "0.6055266", "text": "function updateScene()\n\t{\n\t\tupdateWells();\n\t\tcreateNewSuns();\n\t\tcreateNewSatellites();\n\t\tpanScene();\n\t\tscaleScene();\n\t}", "title": "" }, { "docid": "c128734cb1006b3e7acdbe085f4ba818", "score": "0.6025581", "text": "create ()\r\n {\r\n infoArray1 = [0.0, 0.0, 0.0, 0.0, 0.0, 500.0, 350.0];\r\n infoArray2 = [0.0, 0.0, 0.0, 0.0, 0.0, 400.0, 350.0];\r\n\tif(connection != null && connection != undefined){\r\n\t\tconnection.close();\r\n\t}\r\n\tsceneChangeIncoming = true;\r\n\t//web.updateScene(web.scene.manager.getScene(nextSceneKey));\r\n\tthis.game.online = false;\r\n\tvar actualScene = this;\r\n\t// Variable que indica si se está cambiando de escena.\r\n\tisChangingScene = false;\r\n\r\n\t// Añadimos los sonidos a la escena.\r\n\thoverSound = this.sound.add('menuHover');\r\n\tselectedSound = this.sound.add('menuSelected');\r\n\r\n // Añadimos el background y el título.\r\n this.add.image(960/2, 540/2, 'interfazBg');\r\n\tthis.add.image(960/2, 540/2, 'interfazTitle');\r\n\r\n\t// Añadimos las luces que indicaran que boton del menu esta activo. Hacemos tambien un fade con la camara.\r\n\tcam = this.cameras.main;\r\n\tcam.fadeIn(1000);\r\n\r\n \tbuttonArray = [ // Este parametro recibe una funcion que se ejecuta al presionar el boton.\r\n \t\tnew Button(this, 960/2, 214, 'light', function() {\r\n \t\t\tselectedSound.play({ volume: this.scene.game.soundVolume });\r\n \t\t\tweb.getServerInfoMenu();\r\n \t\t\t/*isChangingScene = true;\r\n \t\t\tthis.scene.game.customTransition(this.scene, 'nameScreen', 1000);\r\n \t\t\tcam.fadeOut(1000);*/\r\n \t\t}),\r\n \t\tnew Button(this, 960/2, 284, 'light', function() {\r\n\t\t\tselectedSound.play({ volume: this.scene.game.soundVolume });\r\n\t\t\tisChangingScene = true;\r\n\t\t\tthis.scene.game.customTransition(this.scene, 'level1', 1000);\r\n\t\t\tcam.fadeOut(1000);\r\n \t\t}),\r\n \t\tnew Button(this, 960/2, 354, 'light', function() {\r\n\t\t\tselectedSound.play({ volume: this.scene.game.soundVolume });\r\n\t\t\tisChangingScene = true;\r\n\t\t\tthis.scene.game.customTransition(this.scene, 'options', 1000);\r\n\t\t\tcam.fadeOut(1000);\r\n \t\t}),\r\n \t\tnew Button(this, 960/2, 420, 'light', function() {\r\n\t\t\tselectedSound.play({ volume: this.scene.game.soundVolume });\r\n\t\t\tisChangingScene = true;\r\n\t\t\tthis.scene.game.customTransition(this.scene, 'credits', 1000);\r\n\t\t\tcam.fadeOut(1000);\r\n\t\t },),\r\n\t\tnew Button(this, 960/2, 486, 'light', function() {\r\n\t\t\tselectedSound.play({ volume: this.scene.game.soundVolume });\r\n\t\t\tisChangingScene = true;\r\n\t\t\tthis.scene.game.customTransition(this.scene, 'menuTutorial', 1000);\r\n\t\t\tcam.fadeOut(1000);\r\n\t\t},)\r\n\t];\r\n\r\n \t// Hacemos a todas las luces invisibles al inicio de la escena.\r\n \tfor (var i = 0; i < buttonArray.length; i++) {\r\n \t\tbuttonArray[i].alpha = 0;\r\n\t }\r\n\r\n \t// Añadimos los textos de los botones.\r\n \tthis.add.image(960/2, 214, 'text_online');\r\n \tthis.add.image(960/2, 284, 'text_local');\r\n \tthis.add.image(960/2, 354, 'text_options');\r\n\tthis.add.image(960/2, 420, 'text_credits');\r\n\tthis.add.image(960/2, 486, 'text_tutorial');\r\n\r\n \t// Añadimos la funcion que se ejecutara al presionar el boton izquierdo del raton.\r\n \t// Indica que funcion hay que ejecutar segun la opcion seleccionada en el menu.\r\n \tthis.input.on('pointerdown', function () {\r\n\t\tfor (var i = 0; i < buttonArray.length; i++) {\r\n\t\t\tif (!isChangingScene && buttonArray[i].isActive) {\r\n\t\t\t\tbuttonArray[i].Behaviour();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n }", "title": "" }, { "docid": "78b7fee240996593a3c158b5efe8bfe5", "score": "0.60097134", "text": "function drawserver() {\n if (ashxari_verj == true) {\n\n\n for (var i in grassArr) {\n grassArr[i].mul();\n grassinit++;\n }\n for (var i in grasseaterArr) {\n grasseaterArr[i].move();\n grasseaterinit++;\n\n }\n for (var i in predatorArr) {\n predatorArr[i].move();\n gishatichinit++;\n }\n for (var i in lightningArr) {\n lightningArr[i].eat();\n }\n for (var i in rivArr) {\n rivArr[i].mul();\n }\n //matrixy uxarkum en clientin\n io.sockets.emit(\"matrix\", matrix);\n }\n}", "title": "" }, { "docid": "6edd79c2cb8108867c1dfcb5e70d20db", "score": "0.5990752", "text": "function startGameOnConnect() {\n console.log(\"socketIO is working. Starting Game!\");\n // creating a player game object\n var player = new component(60, 50, \"./assets/js/Character.png\", 400, 300, \"image\", id);\n // passing the player object to the server\n socket.emit(\"addPlayer\", player);\n // request players list from the server\n socket.emit(\"getPlayers\");\n\n // set list of players that the server has to the local list of players\n socket.on(\"initPlayers\", function(p){\n //iterate through each player in the server's list\n Object.keys(p).forEach((key, index) =>{\n if(id != key){\n console.log(\"key: \" + key + \" index: \" + index);\n let pServ = p[key];\n\n //create a new component based on what we recieved from the server.\n locP = new component(pServ.width, pServ.height, pServ.color, pServ.x + xOffset, pServ.y + yOffset, pServ.type, pServ.id)\n\n //store that component in a local list of players\n players[key] = locP;\n //update will draw the component to the screen.\n locP.update();\n }\n\n });\n });\n\n //create a background\n myBackground = new component(900, 900, \"./assets/js/ground.jpg\", 0, 0, \"image\", id);\n socket.on(\"recieveWorld\", function(p){\n // console.log(p);\n //empty our local array of players\n obstacles = {};\n //refill the array from the servers array\n Object.keys(p).forEach((key, index) =>{\n let pServ = p[key];\n locO = new component(pServ.width, pServ.height, pServ.color, pServ.x + xOffset, pServ.y + yOffset, pServ.type, pServ.id);\n locO.worldPos.x = locO.x;\n locO.worldPos.y = locO.y;\n obstacles[pServ.id] = locO;\n })\n });\n //create an obstacle\n z = new component(30, 30, \"red\", 20, 20, \"color\", \"lolol\");\n wall = new component(30, 30, \"blue\", 300, 300, \"color\", id);\n wall.worldPos.x = 300;\n wall.worldPos.y = 300;\n\n socket.emit(\"updateLoc\", id, localPos.x, localPos.y);\n myGameArea.start();\n\n}", "title": "" }, { "docid": "96612ec8e2b907200df7e7c67d67406a", "score": "0.59586143", "text": "function main(){\n\t// SceneGraphRoot object create.\n\tvar sgroot = new SceneGraphRoot();\n\tsgroot.gameTime = 5300;\n\tstart(sgroot);\n}", "title": "" }, { "docid": "983ca82414cecaa17133142214fe6d5b", "score": "0.5956149", "text": "constructor() {\n // constructor(): Scenes begin by populating initial values like the Shapes and Materials they'll need.\n super();\n this.program_state;\n this.sway = 0;\n this.thrown = false;\n this.player_turn = false;\n this.players_turn_over = 0;\n this.reset_state = false;\n this.colliders = [\n {intersect_test: Body.intersect_sphere, points: new defs.Subdivision_Sphere(3), leeway: .2},\n {intersect_test: Body.intersect_sphere, points: new defs.Subdivision_Sphere(6), leeway: .1},\n {intersect_test: Body.intersect_cube, points: new defs.Cube(), leeway: 0.05}\n ];\n this.collider_selection = 0;\n\n // ** Shapes **\n this.shapes = {\n axis: new defs.Axis_Arrows(),\n board: new defs.Capped_Cylinder(5, 100, [0, 1]),\n background: new defs.Square(),\n dart: new Shape_From_File('./assets/dart.obj'),\n numbers: new Text_Line(3),\n board_square: new defs.Square(),\n board_circle: new defs.Regular_2D_Polygon(2, 2)\n };\n\n // ** Materials **\n this.materials = {\n phong: new Material(new defs.Phong_Shader(), {\n ambient: 0.5, color: hex_color(\"#ffffff\"),\n }),\n dart_texture: new Material(new defs.Textured_Phong(), {\n color: color(0, 0, 0, 1),\n ambient: 0.5,\n diffusivity: .5,\n specularity: .5,\n diffuseMap: 3,\n stupid: 4,\n texture: new Texture(\"assets/gold.jpg\")\n }),\n dartboard_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 1, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/dartboard.png\")\n }),\n background_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/opponent_background.png\")\n }),\n wall_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/wall.png\")\n }),\n floor_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/floor.jpg\")\n }),\n ceiling_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/ceiling.jpg\")\n }),\n nums_texture: new Material(new defs.Textured_Phong(1), {\n ambient: 1, diffusivity: 0, specularity: 0, texture: new Texture(\"assets/numbers.png\")\n }),\n bright: new Material(new defs.Phong_Shader(1), {color: color(0, 1, 0, .5), ambient: 1}),\n invisible: new Material(new defs.Phong_Shader(1), {color: color(1, 1, 1, 0), ambient: 1}),\n power_meter: new Material(new defs.Textured_Phong(1), {\n ambient: 1, diffusivity: 0, specularity: 0, texture: new Texture(\"assets/red.png\")\n })\n };\n\n this.initial_camera_location = Mat4.look_at(vec3(0, 10, 20), vec3(0, 0, 0), vec3(0, 1, 0));\n this.spin_angle = 0;\n this.num_left = 6;\n this.thrown = false;\n this.player_score = 0;\n this.opponent_score = 0;\n this.board_center = 1.03\n this.board_values = []\n this.power_scale = 1;\n this.show_background = true\n this.view_collisions = false\n }", "title": "" }, { "docid": "2a08a61f0f7e3abbda6f44bb8873a018", "score": "0.5925063", "text": "function setup() {\n\n //create a new canvas\n var new_width = 0.98*windowWidth;\n var new_height = 0.80*windowHeight; //used to be .748 >> .88 >> .8\n var canv = createCanvas(new_width, new_height);\n canv.parent('canvas-holder');\n background(255,255,255);\n\n //create a clear button\n var clear_button = createButton(\"Clear\");\n clear_button.parent('controls');\n clear_button.mousePressed(resetSketch);\n //function that clears sketch server then client side\n function resetSketch(){\n socket.emit('clearCanvas');\n clear();\n }\n \n //randomly select a color\n lineColor = [random(1,255), random(1,255), random(1,255)];\n //socket = io();\n //create a rgb and thickness slider\n rSlider = createSlider(0, 255, lineColor[0]);\n rSlider.parent('red');\n gSlider = createSlider(0, 255, lineColor[1]);\n gSlider.parent('green');\n bSlider = createSlider(0, 255, lineColor[2]);\n bSlider.parent('blue');\n tSlider = createSlider(5, 40, 20);\n tSlider.parent('thickness');\n\t\n\t\n //scroll lock for mobile devices\n document.ontouchmove = function(event){\n event.preventDefault();\n }\n\n //prompt user for room name and checks for null and empty input\n socket = io();\n var room = prompt(\"Please enter a room name :)\");\n while(room==null || room==''){\n room = prompt(\"Please enter a room name :)\"); \n }\n\n socket.emit('sessionID',room);\n\n socket.on('mouse', newDrawing);\n\n socket.on('userJoin',function(){\n\n $('.row').html('<div class=\"alert alert-success col-md-2 col-md-offset-2\" align=\"center\">New User Joined!</div>')\n setTimeout(function(){\n $(\"div.alert\").remove();\n }, 3000);\n });\n\n\n //server sends message to client telling it to clear the canvas locally\n socket.on('serverClear',function(){\n clear()\n });\n\n\n\n\n}", "title": "" }, { "docid": "9a7be5f4a55b55c025472a991c869faf", "score": "0.5902733", "text": "bootstrap(iniObj) {\n// console.warn('NO CONTENT MODE');\n// this.FFClientManager.sendMessage({message: 'test message from VLab'});\n// return;\n /* VLab Inventory */\n this.Inventory = new VLabInventory({\n vLab: this\n });\n\n /* Valter scene */\n this.SceneDispatcher.addScene({\n class: ValterScene,\n natureURL: './scenes/valter.scene/resources/vlab.scene.nature.json',\n /**\n * Set active: true for default VLabScene\n */\n active: true\n });\n /* First scene */\n this.SceneDispatcher.addScene({\n class: FirstScene,\n natureURL: './scenes/first.scene/resources/vlab.scene.nature.json',\n autoload: false,\n });\n /* Second scene */\n this.SceneDispatcher.addScene({\n class: SecondScene,\n natureURL: './scenes/second.scene/resources/vlab.scene.nature.json',\n autoload: false\n });\n /* Third scene */\n this.SceneDispatcher.addScene({\n class: ThirdScene,\n natureURL: './scenes/third.scene/resources/vlab.scene.nature.json',\n autoload: false\n });\n /* RightArm Scene */\n this.SceneDispatcher.addScene({\n class: RightArmScene,\n natureURL: './scenes/right.arm.scene/resources/vlab.scene.nature.json',\n autoload: false\n });\n\n\n\n\n\n // let self = this;\n // setTimeout(() => {\n // /* Activate Second Scene */\n // self.SceneDispatcher.activateScene({\n // class: SecondScene\n // }).then((vLabScene) => { console.log(vLabScene.name + ' activated from ' + this.initObj.name); });\n // }, 10000);\n\n // setTimeout(() => {\n // /* Activate FirstScene Scene */\n // self.SceneDispatcher.activateScene({\n // class: FirstScene\n // });\n // }, 20000);\n\n // setTimeout(() => {\n // /* Activate ThirdScene Scene */\n // self.SceneDispatcher.activateScene({\n // class: ThirdScene\n // });\n // }, 30000);\n\n // setTimeout(() => {\n // /* Activate FirstScene Scene */\n // self.SceneDispatcher.activateScene({\n // class: FirstScene\n // });\n // }, 40000);\n\n console.log(this);\n\n this.vLabQuiz = new VLabQuiz({\n vLab: this\n });\n this.vLabQuiz.initialize()\n .then(() => {\n\n this.vLabQuiz.quizData.description = 'Test Quiz description............';\n this.vLabQuiz.quizData.questions.push(\n {\n type: 'select',\n text: 'Question 1 text',\n data: [\n {\n label: 'Answer1',\n value: 'answer1'\n },\n {\n label: 'Answer2',\n value: 'answer2'\n },\n {\n label: 'Answer3',\n value: 'answer3'\n },\n {\n label: 'Answer4',\n value: 'answer4'\n }\n ],\n correct: 3\n },\n {\n type: 'select',\n text: 'Question 2 text',\n data: [\n {\n label: 'Answer1',\n value: 'answer1'\n },\n {\n label: 'Answer2',\n value: 'answer2'\n },\n {\n label: 'Answer3',\n value: 'answer3'\n },\n {\n label: 'Answer4',\n value: 'answer4'\n }\n ],\n correct: 3\n }\n );\n\n this.vLabQuiz.startTimedOut();\n });\n\n this.EventDispatcher.subscribe({\n subscriber: this,\n events: {\n VLabQuiz: {\n quizTimedOut: this.onQuizTimedOut\n }\n }\n });\n }", "title": "" }, { "docid": "80018446c80ca651e27ae90cbd2542b8", "score": "0.5898367", "text": "function setUpSocket() {\n // Start socket connection to the server\n socket = io.connect('https://localhost:8000');\n // Update event called 'update' to updateCanva\n socket.on('updateMsg', updateMsgHandler);\n // Listerner to set room for socket and startGame\n socket.on('roomMsg', roomMsgHandler);\n // Listener when other player is done with Turn\n socket.on('doneTurnMsg', doneTurnMsgHandler);\n // Start Game Msg\n socket.on('startGameMsg', startGameMsgHandler);\n // Game Over message\n socket.on('gameOverMsg', gameOverMsgHandler);\n // Automatic win message\n socket.on('defaultWinMsg', defaultWinMsgHandler);\n // User has disconnected Msg\n socket.on('userDiscMsg', userDiscMsgHandler);\n // other User has reconnected msg\n socket.on('otherUserReCntMsg', otherUserReCntMsgHandler);\n // user reconnected Msg\n socket.on('userRecntMsg', userReCntMsgHandler);\n // Send out message to try to start new game, this user is ready to play\n socket.emit('newGameMsg', {username: username});\n console.log(\"Emitting new game\");\n\n}", "title": "" }, { "docid": "b1905a63aabeaa36269376335d6af3ad", "score": "0.5880177", "text": "function setup() {\n frameRate(0);\n socket = io.connect();\n\n socket.on('matrix', function (mtx) {\n matrix = mtx;\n createCanvas(160 * side, 102 * side);\n noLoop();\n\n socket.on('redraw', function (mtx) {\n matrix = mtx;\n redraw();\n });\n socket.on(\"MyStats\", function (Statistics) {\n Stat = Statistics;\n });\n socket.on(\"Procent\",function(procentZang)\n {\n proc = procentZang;\n }\n )\n\n \n // socket.on(\"\",function(){});\n // socket.on(\"\",function(){})\n // socket.on(\"\",function(){})\n // socket.on(\"\",function(){})\n // socket.on(\"\",function(){})\n\n });\n\n\n}", "title": "" }, { "docid": "cec05f8439d9d617f40b198197577a0b", "score": "0.58801514", "text": "function setupScene() \r\n{\r\n\tvar tube = gameState.scene.getObjectByName(\"cylinder\");\r\n\tvar torus = gameState.scene.getObjectByName(\"torus\");\r\n\tvar block = gameState.scene.getObjectByName(\"cube\");\r\n\t\r\n\t// scatter copies of each object around the scene\r\n\tfor (var i = 0; i < 20; i++) {\r\n\t\tmakeRandomClone(tube);\r\n\t}\r\n\tfor (var i = 0; i < 40; i++) {\r\n\t\tmakeRandomClone(block);\r\n\t}\r\n\tmakeRandomClone(torus);\r\n\t\r\n\t// make debug text white\r\n\tdocument.getElementById(engine.DEBUG_CONTAINER_ID).style.color = 'white';\r\n\t\r\n\t// create blocking div\r\n\tvar blocker = document.createElement('div');\r\n\tblocker.id = 'blocker';\r\n\tblocker.style.position = 'relative';\r\n\tblocker.style.width = '100%';\r\n\tblocker.style.height = '100%';\r\n\tblocker.style.backgroundColor = 'rgba(0,0,0,0.5)';\r\n\tblocker.style.fontSize = '40px';\r\n\tblocker.innerHTML = \"Game Paused\";\r\n\t//document.getElementById(engine.GAME_CONTAINER_ID).appendChild(blocker);\r\n\t\r\n\t// create instructions div\r\n\tvar instructions = document.createElement('div');\r\n\tinstructions.id = 'instructions';\r\n\t\r\n\tvar instructionSpan = document.createElement('span');\r\n\tinstructionSpan.style.fontSize = '40px';\r\n\tinstructionSpan.innerHTML = \"Click to play\";\r\n\tinstructions.appendChild(instructionSpan);\r\n\t\r\n\tvar brHTML = document.createElement('br');\r\n\tinstructions.appendChild(brHTML);\r\n\tinstructions.innerHTML += \"(W, A, S, D = Move, MOUSE = Look around)\";\r\n\tdocument.getElementById(engine.GAME_CONTAINER_ID).appendChild(instructions);\r\n}", "title": "" }, { "docid": "331e73e6e67f9e2976828a6c8c9ebd24", "score": "0.58761925", "text": "function scene_tp3(){\n engine=new Engine();\n var gravity = new Vector(0,6);\n var wind = new Vector(10,0);\n gen1 = new GeneratorBox();\n /*Cadre de l'apparition*/\n gen1.min.setXY(100,100);\n gen1.max.setXY(100,100);\n /*vitesse*/\n gen1.vMin.setXY(-15,-15);\n gen1.vMAx.setXY(15,15);\n /*force*/\n gen1.Allforce.push(gravity);\n\n var gen2 = new GeneratorBox();\n gen2.min.setXY(400,150);\n gen2.max.setXY(400,150);\n gen2.vMin.setXY(-15,-15);\n gen2.vMAx.setXY(15,15);\n gen2.Allforce.push(gravity);\n\n engine.particleManager.generatorList.push(gen1,gen2); // ajoute au tableau generatorList\n\n var obs1=new Circle(new Vector(100,100),50);\n var obs2=new Circle(new Vector(250,200),20);\n engine.obstacleManager.all.push(obs1,obs2);\n\n engine.start();\n}", "title": "" }, { "docid": "c9848b5a6752ed33395d5ce204844fd9", "score": "0.5871879", "text": "function createPhysics(Scene,GameObjects,map)\n{\n items = GameObjects.items;\n items.setFrame(3);\n player = GameObjects.player;\n //bombs = GameObjects.bombs;\n shots = GameObjects.shots;\n //items= GameObjects.items;\n enemies = GameObjects.enemies;\n collisionLayer = map.Layers.collisionLayer;\n slowLayer = map.Layers.slowLayer; \n fastLayer = map.Layers.fastLayer;\n \n fastLayer.setTileIndexCallback(0, normal, Scene);\n slowLayer.setTileIndexCallback(0, normal, Scene);\n\n fastLayer.setTileIndexCallback(70, faster, Scene);\n slowLayer.setTileIndexCallback(79, slower, Scene);\n\n \n Scene.physics.add.collider(player, collisionLayer, collisionWithCollisionLayer);\n Scene.physics.add.overlap(player, slowLayer);\n Scene.physics.add.overlap(player, fastLayer);\n \n Scene.physics.add.collider(enemies, collisionLayer,OrcCollision);\n Scene.physics.add.overlap(enemies, fastLayer);\n Scene.physics.add.overlap(enemies, fastLayer);\n\n Scene.physics.add.collider(player, enemies, Die, null, this);\n Scene.physics.add.collider(shots, enemies, destroyEnemy, null, this);\n\n Scene.physics.add.overlap(player, items, pickItem);\n Scene.physics.add.collider(enemies, enemies);\n\n\n Scene.physics.add.collider(shots, collisionLayer,ShotCollider);\n}", "title": "" }, { "docid": "8383b3cf07c5482f21c38b34cbb70017", "score": "0.58641744", "text": "function render(){\n \n // clear the canvas\n drawRect(0, 0, canvas.width, canvas.height, \"#000\");\n \n // draw the user score to the left\n //drawText(user.score,canvas.width/4,canvas.height/5);\n \n // draw the COM score to the right\n //drawText(com.score,3*canvas.width/4,canvas.height/5);\n \n //ajouter par med\n\n drawText(players[0].score,canvas.width/4,canvas.height/5);\n drawText(players[1].score,3*canvas.width/4,canvas.height/5); \n // draw the net\n drawNet();\n \n // draw the user's paddle\n //drawRect(user.x, user.y, user.width, user.height, user.color);\n movePlayer()\n drawPlayers() \n \n\n // draw the COM's paddle\n //drawRect(com.x, com.y, com.width, com.height, com.color);\n \n // draw the ball\n /* drawArc(ball.x, ball.y, ball.radius, ball.color);\n if(player[1].id!=''){\n socket.emit('ball',ball)\n }*/\n /* socket.on('ball-remote',function (ball_recu) {\n maball=ball_recu;\n drawArc(maball.x, maball.y, maball.radius, maball.color);\n }) */\n \n}", "title": "" }, { "docid": "c3687e72e3bbd7466f96b94240d35379", "score": "0.5863531", "text": "function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.Clean();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE_STATE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.INFO:\n console.log(\"switch to Instructions Scene\");\n currentScene = new scenes.Instructions();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n case scenes.State.EXIT:\n console.log(\"switch to Exit Game Scene\");\n currentScene = new scenes.ExitGame();\n break;\n }\n currentSceneState = config.Game.SCENE_STATE;\n stage.addChild(currentScene);\n soundManager.AddObjectsToScene(currentScene);\n }", "title": "" }, { "docid": "b1232e62fabb0f26c1de59137eac1d02", "score": "0.58536947", "text": "function draw() {\r\n if (backgroundImg) {\r\n background(backgroundImg);\r\n }\r\n\r\n Engine.update(userEngine);\r\n\r\n //diplay ground \r\n ground.display();\r\n platform.display();\r\n\r\n bird.display();\r\n //display of catapult with sling. Body of bird will be attached to the sling.\r\n catapult.display();\r\n\r\n //display of layer1 using matter.js\r\n box1.display();\r\n box2.display();\r\n pig1.display();\r\n log1.display();\r\n\r\n //display of layer2 using matter.js\r\n box3.display();\r\n box4.display();\r\n pig2.display();\r\n log2.display();\r\n\r\n //display of layer3 using matter.js\r\n box5.display();\r\n log3.display();\r\n log4.display();\r\n\r\n \r\n //calculation of score\r\n if (gameState == \"detached\") {\r\n //trigger score based on visibility of each object of PIG class\r\n pig1.score();\r\n pig2.score();\r\n }\r\n\r\n // display score\r\n textSize(27);\r\n fill(\"white\");\r\n noStroke();\r\n text(\"Score: \" + score, 900, 50);\r\n\r\n displayRunnerPoofs();\r\n\r\n\r\n //display game over message\r\n if (timesPlayed == 4 && gameState != \"WIN\") {\r\n noStroke();\r\n textSize(100);\r\n fill(\"white\");\r\n text(\"GAME OVER\", width / 2 - 100, height / 2);\r\n }\r\n\r\n //display winning message\r\n if (pig1.visibility <= 0 && pig2.visibility <= 0) {\r\n gameState = \"WIN\";\r\n noStroke();\r\n textSize(100);\r\n fill(\"white\");\r\n text(\"YOU WIN\", width / 2 - 100, height / 2);\r\n }\r\n\r\n}", "title": "" }, { "docid": "73d87ca4c06a411684e809669fee7efa", "score": "0.584899", "text": "function startSockets(server, connection){\n\n\tvar iosocket = io.listen(server),\n\t\tconnections = new Connections(),\n\t\tgameExchange = connection.exchanges['gameExchange'];\n\t\n\tiosocket.configure('development', function(){\n\t\tiosocket.set('log level', '2');\n\t});\n\t\n\t// on a new client connection\n\tiosocket.sockets.on('connection', function(socket){\n\t\t\n\t\tconsole.log(' [+] Socket connection established');\n\t\tvar socketID = socket.id;\n\n\t\t// on 'init' message from client\n\t\tsocket.on('init', function(){\n\n\t\t\tconnections.add(socketID);\n\t\t\tvar connectionID = connections.getID(socketID);\n\n\t\t\t// create a new AMQP queue for the client's connection\n\t\t\tconnection.queue(connectionID+'Q', function(queue){\n\t\t\t\tqueue.bind('gameExchange', 'game.output.'+connectionID);\t\n\t\t\t\tqueue.subscribe(function(message){\n\t\t\t\t\tsocket.emit('message', message );\n\t\t\t\t});\n\n\t\t\t});\n\t\t\t\n\t\t\tsocket.emit('init', {id:connectionID});\n\t\t\t// publish connection message to gane server\n\t\t\tgameExchange.publish('game.input.connect', {key: 'game.input.connect', id:connectionID});\n\n\t\t});\n\n\t\t// on 'message' received from client\n\t\tsocket.on('message', function(message){\n\t\t\tmessage.id = connections.getID(socketID);\n\t \t\tgameExchange.publish(message.key, message);\n\t\t});\n\n\t\tsocket.on('disconnect', function(){\n\t\t\tconsole.log(\" [+] disconnecting\")\n\t\t\tvar targetID = connections.getID(socketID);\n\t\t\tconnections.remove(socketID);\n\t\t\tvar routeKey = 'game.input.disconnect'\n\t\t\tgameExchange.publish(routeKey, {key:routeKey, id: targetID});\n\t\t});\n\t\n\t});\n\n\t// message listener for the 'outQ' queue of the 'gameExchange' exchange\n\tconnection.queues['outQ'].subscribe(function(message){\n\n\t\tswitch(message.key){\n\n\t\t\tcase 'game.output.snapshot':\n\t\t\tiosocket.sockets.emit('message',message);\n\t\t\tbreak;\n\n\t\t\tcase 'game.output.shapeSnapshot':\n\t\t\tiosocket.sockets.emit('message', message);\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t});\n\n\treturn iosocket;\n}", "title": "" }, { "docid": "ec6103c21c7d83f051025a52d2a549c4", "score": "0.5845122", "text": "function newGame() {\n socket.emit(\"newGame\");\n initializeGameWindow();\n}", "title": "" }, { "docid": "64b3071ae325dce5e18b11a56e0cc5eb", "score": "0.5841655", "text": "function scene(){}", "title": "" }, { "docid": "a512ccaf8531ecf87117b5fc8b851121", "score": "0.58399874", "text": "function createThirdScene() {\n makeRect(0,0,200,100,\"bisque\",1);\n makeRect(25,25,150,100, \"lightgreen\")\n makeLine(28,28,28,97, \"white\")\n makeLine(172,28,172,97, \"white\")\n makeLine(28,28,172,28, \"white\")\n makeLine(28,97,172,97, \"white\")\n makeCircle(100,63,10, \"white\")\n makeCircle(100,63,9, \"lightgreen\")\n makeLine(100,28,100,97, \"white\")\n makeLine(28,50,40,50, \"white\")\n makeLine(28,75,40,75, \"white\")\n makeLine(28,40,50,40, \"white\")\n makeLine(28,85,50,85, \"white\")\n makeLine(150,40,172,40, \"white\")\n makeLine(150,85,172,85, \"white\")\n makeLine(160,50,172,50, \"white\")\n makeLine(160,75,172,75, \"white\")\n makeCircle(50,63,9, \"white\")\n makeCircle(50,63,8, \"lightgreen\")\n makeCircle(150,63,9, \"white\")\n makeCircle(150,63,8, \"lightgreen\")\n makeLine(50,40,50,85, \"white\")\n makeLine(40,50,40,75, \"white\")\n makeLine(150,40,150,85, \"white\")\n makeLine(160,50,160,75, \"white\")\n makeRect(41,50,8.5,30, \"lightgreen\")\n makeRect(150.5,50,8.5,30, \"lightgreen\")\n makeText('Soccer', 73,20,20,\"Pangolin\",\"blue\")\n var jdcool = Math.random();\n if( jdcool >0.5 ){ \n makeCircle(40,63,2, \"blue\")\n makeCircle(50,63,2, \"blue\")\n makeCircle(55,43,2, \"blue\")\n makeCircle(55,83,2, \"blue\")\n makeCircle(70,90,2, \"blue\")\n makeCircle(70,70,2, \"blue\")\n makeCircle(70,50,2, \"blue\")\n makeCircle(70,35,2, \"blue\")\n makeCircle(85,83,2, \"blue\")\n makeCircle(85,43,2, \"blue\")\n makeCircle(85,63,2, \"blue\")\n makeCircle(160,63,2, \"red\")\n makeCircle(150,63,2, \"red\")\n makeCircle(115,63,2, \"red\")\n makeCircle(145,43,2, \"red\")\n makeCircle(145,83,2, \"red\")\n makeCircle(130,90,2, \"red\")\n makeCircle(130,35,2, \"red\")\n makeCircle(115,83,2, \"red\")\n makeCircle(115,43,2, \"red\")\n makeCircle(130,50,2, \"red\")\n makeCircle(130,73,2, \"red\")\n \n}\n}", "title": "" }, { "docid": "eb34be7a10f52878ca8fc5bdd5c0eb50", "score": "0.5831206", "text": "function afterConnect() {\n //DISCONENECT DO JOGO\n socket.on(\"disconnect\", function () {\n console.log(\"Disconnected from server.\");\n $(\"#game\").hide();\n });\n\n //CHAT\n socket.on(\"chat\", function (msg) {\n $(\"#messages\").append(\n \"<li><strong>\" + msg.name + \":</strong> \" + msg.message + \"</li>\"\n );\n $(\"#messages-list\").scrollTop($(\"#messages-list\")[0].scrollHeight);\n });\n\n // NOTIFICA QUE SAIU DO JOGO\n socket.on(\"notification\", function (msg) {\n $(\"#messages\").append(\"<li>\" + msg.message + \"</li>\");\n $(\"#messages-list\").scrollTop($(\"#messages-list\")[0].scrollHeight);\n });\n\n //NOTIFICAÇÃO PARA O UTILIZADOR QUE GANHOU\n socket.on(\"opponentleft\", function (msg) {\n $(\"#messages\").append(\"<li>\" + msg.message + \"</li>\");\n $(\"#messages-list\").scrollTop($(\"#messages-list\")[0].scrollHeight);\n socket.emit(\"opponentleft\", { id: socket.id });\n });\n\n //ACABA O JOGO\n socket.on(\"gameover\", function (isWinner) {\n if (isWinner) {\n $(\"#messages\").append(\"<li> Congratulations you won the game </li>\");\n $(\"#messages\").append(\"<li> You Won the game and 100 points</li>\");\n\n $(\"#messages-list\").scrollTop($(\"#messages-list\")[0].scrollHeight);\n\n socket.emit(\"opponentleft\", { id: socket.id });\n } else {\n $(\"#messages\").append(\"<li> You lost </li>\");\n $(\"#messages-list\").scrollTop($(\"#messages-list\")[0].scrollHeight);\n }\n });\n\n //ENVIAR MENSAGEM\n $(\"#message-form\").submit(function () {\n socket.emit(\"chat\", $(\"#message\").val());\n $(\"#message\").val(\"\");\n return false;\n });\n\n //UPDATE GRID THEM\n socket.on(\"updateGrid\", function (data) {\n changeTh(data);\n });\n //UPDATE GRID ME\n socket.on(\"updateGridMe\", function (data) {\n changeMe(data);\n });\n }", "title": "" }, { "docid": "2dab66d97394bb530f622043f511f249", "score": "0.58220285", "text": "function newConnection(socket){\n var session=new Session(socket);\n sessions.push(session);\n console.log(\"New connection, session:\"+session.id+\" socket:\"+socket.id);\n console.log(\"Num sessions:\"+sessions.length);\n //socket.on('mouse', mouseMsg);\n socket.on('disconnect', clientDisconnect);\n socket.on('join',joiner);\n socket.on('unjoin',unjoiner);\n// socket.on('blob',blobMsg);\n socket.on('attach',attacher);\n socket.on('permit',permitReceived);\n socket.on('offerAccepted',offerAccepted);\n socket.on('console',setConsole);\n socket.on('monitor', setMonitor);\n socket.on('newBlob',blobFromClient);\n socket.on('blobUpdate',updateBlob);\n socket.on('detach', detacher);\n socket.on('echo', logEcho);\n socket.on('themeKiller', themeKiller);\n socket.on('gimmeTheme', gimmeTheme);\n socket.on('getServerThemes', sendThemesToClient);\n socket.on('soundControl', soundControl);\n socket.on('showMeta', showMeta);\n socket.on('resetThemes', resetThemes);\n socket.on('themeOnOff', themeOnOff);\n socket.on('themeDuration', themeDuration);\n socket.on('newRingCode', newRingCode);\n socket.on('consoleCommand', consoleCommand);\n\n function consoleCommand(data){\n\t\tif(data.command==\"detach\"){\n\t\t\tconsole.log(\"Detach dev \"+data.id);\n\t\t\tring.detacher(data);\n\t\t} else if(data.command==\"disconnect\"){\n\t\t\tvar sessionToEnd=findSession(data.id);\n\t\t\tconsole.log(\"Disconnect dev \"+data.id);\n\t\t\t// clientDisconnect(sessionToEnd);\n\t\t}else if(data.command==\"permit\"){\n\t\t\tvar sessionToPermit=findSession(data.id);\n\t\t\tconsole.log(\"Send permit from dev \"+data.id);\n\t\t\tif(sessionToPermit){\n\t\t\t\tif(sessionToPermit.socket){\n\t\t\t\t\tsessionToPermit.socket.emit('issuePermit',{});\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(data.command==\"clearBlobs\"){\n\t\t\tconsole.log(\"clear all blobs\");\n\t\t\tring.clearBlobs();\n\t\t} else if(data.command==\"stopServer\"){\n\t\t\tstopServer();\n\t\t}\n }\n\n function stopServer(){\n\t\tconsole.log(\"\\n\\n************************************\");\n\t\tconsole.log(\"Stopping server in 1s, initaiated from console\");\n\t\tconsole.log(\"************************************\\n\\n\");\n\t\tstatusLights.clear();\n\t\tsetTimeout(function(){\n\t\t\tstatusLights.clear();\n\t\t\tconsole.log(\"\\n\\n************************************\");\n\t\t\tconsole.log(\"Stopping server now!\");\n\t\t\tconsole.log(\"************************************\\n\\n\");\n\t\t\tprocess.exit(1);\n\t\t},1000);\n }\n\n function newRingCode(){\n\t\tringCode.generate();\n }\n\n function themeDuration(data){\n\t\tthemes.themeDuration(data.index, data.duration);\n }\n\n function themeOnOff(data){\n \tthemes.themeOnOff(data.index, data.status);\n }\n\n function sendThemesToClient(data){\n \tconsole.log(\"Sending Themes to client\");\n \tvar themeList=themes.themeLoader;\n \tsocket.emit('serverThemes', {themes: themeList});\n }\n\n function resetThemes(data){\n \tring.resetThemes(data);\n }\n\n function soundControl(data){\n \tcurrentSoundControl=data;\n \tio.sockets.emit('soundControl', data); \n }\n\n function showMeta(data){\n \tcurrentShowMeta=data.showMeta;\n \tio.sockets.emit('showMeta', data); \n }\n\n function gimmeTheme(data){\n\t\tring.gimmeTheme(data);\n }\n\n function themeKiller(data){\n\t\tring.themeKiller(data);\n }\n\n function logEcho(data){\n\t\tring.logEcho(data);\n }\n\n function detacher(data){\n\t\tring.detacher(data);\n }\n\n function updateBlob(data){\n\t\tring.updateBlob(data);\n }\n\n function blobFromClient(data){\n\t\tring.clientBlob(data);\n }\n\n function offerAccepted(data){\n\t\tring.offerAccepted(data);\n }\n \n function attacher(data){\n\t\tring.attachRequested(data);\n }\n\n function permitReceived(data){\n\t\tring.permitReceived(data);\n }\n\n function joiner(data){\n \tif(true){//data.nickName.toLowerCase()===ringCode.ringCode){\n \t\tconsole.log(\"Device Joining with correct code\");\n \t\tsocket.emit('joinApproved',{approved:true});\n\t\t\tvar newUnAttached=new ringMod.DeviceShadow(session, data.id, data.width, data.height, data.nickName);\n\t\t\tunattached.joinNewDevShadow(newUnAttached);\n\t\t\tif(currentSoundControl){\n\t\t\t\t io.sockets.emit('soundControl', currentSoundControl);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"Incorrect code, not joining\");\n \t\tsocket.emit('joinApproved',{approved:false});\n\t\t}\n\t}\n\n\tfunction unjoiner(data){\n\t\tunattached.unjoinRing(data.id);\n\t\t//remove device shadow?????\n\t}\n\n\tfunction setConsole(data){\n\t\tconsoleSession=findSession(data.consoleid);\n\t\tring.setConsole(consoleSession);\n\t\tconsole.log(\"Console identified as: \"+consoleSession.id);\n\t}\n\n\tfunction setMonitor(data){\n\t\tmonitorSession=findSession(data.monitorid);\n\t\tring.setMonitor(monitorSession);\n\t\tconsole.log(\"Monitor identified as: \"+monitorSession.id);\n\t}\n\n function clientDisconnect(){\n\t//need to handle the effect of disconnect on lobby and rings\n\t\t// var sessionToFind=false;\n\t\t// if(thisSession){\n\t\t// \tsessionToFind=thisSession;\n\t\t// } else {\n\t\t// \tsessionToFind=session;\n\t\t// }\n\t\t// if(sessionToFind.id){\n\t\t\tvar i=sessions.forEach(function(sesh,index){\n\t\t\t\tif(sesh.id==session.id) return index;\n\t\t\t});\n\t\t\tsessions.splice(i,1);\n\t\t\tconsole.log(\"Removed disconnected session: \"+session.id+\" socket:\"+session.socket.id);\n\t\t\tconsole.log(\"Num sessions:\"+sessions.length);\n\t\t\tring.unjoinRing(session.id);\n\t\t\tconsole.log(\"disconnected device unjoined from ring\");\n\t\t// }\n\t}\n}", "title": "" }, { "docid": "49c973b1f42f8f14c7109b0c2d11fa3c", "score": "0.58027947", "text": "function main(){\n\n\t// Generates an empty object to attach things to\n\tvar state = new_state();\n\n\t/* -- SETUP INPUT -- */\n\tregister_input(state);\n\n\t/* -- SETUP MAP -- */\n\n\t// Attaches EasleJS Stage to State Object.\n\tregister_render_to_state(state);\n\t\n\t// Get a new Background into State (Cheats! Also adds itself to renderer)\n\tnew_background(state);\n\n\t/* -- SETUP PLAYERS -- */\n\n\t// Attach 2 players to State\n\tnew_num_players(state, 2);\n\n\t/* -- SETUP GAME -- */\n\tsetup_game(state); // See generation/game/rules.js\n\n\t// For Debugging!\n\tconsole.log(state)\n\n\t/* SETUP LOOP */\n\t// handles canvas updates\n\tfunction update(event){\n\t\tstate.event = event\n\t\t// Tasks or Systems (resolves)\n\t\tresolve_input(state);\n resolve_ai(state);\n\t\tresolve_movable(state);\n\t\tresolve_player_action(state);\n\t\tresolve_spawn(state);\n\t\tresolve_lifetime(state);\n\t\tresolve_collision(state);\n\t\tresolve_collision_effect(state);\n\t\tresolve_render(state);\n\t\tresolve_death(state);\n\n\n\t\t// Check Exit Condition\n\t\tresolve_exit(state);\n\t\tif(state.exit){\n\t\t\twindow.close();\n\t\t}\n\t}\n\tcreatejs.Ticker.setFPS(40);\n createjs.Ticker.addEventListener(\"tick\", update);\n}", "title": "" }, { "docid": "04c7fe846f58e26ff73f112450e2c937", "score": "0.5797722", "text": "function drawScene(whichScene) {\n switch (currentState) {\n case sceneState.INTRO:\n background(190 + sin(frameCount * 0.06) * 40, 130, 150 + sin(frameCount * 0.05) * 30);\n fill(255);\n textSize(80);\n textFont('Courier New');\n textAlign(CENTER, CENTER);\n text(\"welcome to the\\nPong Colliders\\n\\\"Game\\\"\", width/2, height/2);\n break;\n case sceneState.TUTORIAL:\n if (millis() > tutorialTimer + timeForTutorial) {\n background(150, 180, 180);\n fill(0);\n textSize(48);\n textAlign(CENTER, CENTER);\n text(\"HOW TO PLAY...\", width/2, height/2 - 100);\n textSize(32);\n text(\"Everytime you press KEYs\\nCollider number increases\", width/2, height/2);\n\n textSize(24);\n text(\"Different Collider appears every 3 points\\nPlayer who first reaches 15 points will be the WINNER!\", width/2, height/2 + 120);\n text(\"OK now you can hit a key\", width/2, height/2 + 190);\n } else {\n background(160, 220, 250);\n fill(0);\n textSize(48);\n textAlign(CENTER, CENTER);\n text(\"HOW TO PLAY...\", width/2, height/2 - 100);\n textSize(32);\n text(\"Everytime you press KEYs\\nCollider number increases\", width/2, height/2);\n\n textSize(24);\n text(\"Different Collider appears every 3 points\\nPlayer who first reaches 15 points will be the WINNER!\", width/2, height/2 + 120);\n }\n \n break;\n case sceneState.LEVEL01:\n if (keyOn) {\n \n colliders.push(new Bryan());}\n // var timeLeft = (timeForGame - (millis() - gameTimer))/1000;\n // background(map(timeLeft, 5, 0, 255, 0), 250, 150);\n // fill(0);\n // textSize(164);\n // textAlign(CENTER, CENTER);\n // text(timeLeft.toFixed(1), width/2, height/2);\n break;\n case sceneState.LEVEL02:\n if (keyOn) {\n colliders.shift();\n colliders.push(new AlyssaForrest());\n }\n \n // background(127 + sin(frameCount * 0.05) * 127, 127 + sin(frameCount * 0.06) * 127, 127 + sin(frameCount * 0.07) * 127);\n // fill(0);\n // textSize(64);\n // textAlign(CENTER, CENTER);\n // text(\"You WIN!\\n\" + \"result: \" + gameTimePressed, width/2, height/2 - 70);\n // textSize(24);\n // text(\"Press any key to return to title\", width/2, height - 100);\n // fill(255);\n // textSize(64);\n // text(\"You WIN!\\n\" + \"result: \" + gameTimePressed, width/2 + 5, height/2 - 75);\n // textSize(24);\n // text(\"Press any key to return to title\", width/2 + 2, height - 102);\n break;\n case sceneState.LEVEL03:\n \n if (keyOn) {\n colliders.shift();\n colliders.push(new MaddyRed());\n colliders.push(new MaddyGreen());\n colliders.push(new MaddyBlue());}\n \n break;\n case sceneState.LEVEL04:\n\n if (keyOn) {\n colliders.shift();\n colliders.push(new Jackie());\n \n\n }\n break;\n case sceneState.LEVEL05:\n if (keyOn) {\n colliders.shift();\n colliders.push(new Yanwen());\n }\n break;\n case sceneState.END:\n // background(255, 179, 179);\n colliders.shift();\n textSize(64);\n textAlign(CENTER, CENTER);\n fill(100 + sin(frameCount * 0.05) * 50, 100 + sin(frameCount * 0.06) * 50, 100 + sin(frameCount * 0.07) * 50)\n if(p1Score>p2Score){text('Win!', width / 2 - 100, 150);\n }else{\n text('Win!', width / 2 + 100, 150);\n }\n // text(p1Score, width/2-50, 70);\n // text(p2Score, width/2+50, 70);\n textAlign(CENTER, CENTER);\n fill(0);\n textSize(24);\n text(\"Press any key to try again\", width/2, height - 100);\n default:\n break;\n }\n}", "title": "" }, { "docid": "80e442721d807587868ceeecb678f5dc", "score": "0.5778071", "text": "function newGame() {\n socket.emit('newGame');\n init();\n}", "title": "" }, { "docid": "36f3a731507f7a9ebc4b5f39083f65e6", "score": "0.5774846", "text": "function initGame(){\n // nodesLocation = [\n // [200,410,20],\n // [200,410,21],\n // [250,330,1],\n // [290,229,2],\n // [338,137,3],\n // [579,263,22],\n // [599,155,4],\n // [579,263,5],\n // [570,395,6],\n // [905,375,23],\n // [905,375,7],\n // [860,225,8],\n // [837,130,9],\n // [960,130,10]\n // ];\n nodesLocation = [\n [200,410,20],\n [200,410,21],\n [250,330,1],\n [290,229,22],\n [290,229,2],\n [338,137,3],\n [599,155,4],\n [579,263,23],\n [579,263,5],\n [570,395,6],\n [905,375,24],\n [905,375,7],\n [860,225,8],\n [837,130,9],\n [960,130,10]\n ];\n // world = me.sceneArgs;\n // console.log(world);\n\n rocket = createSprite(960,130);\n rocket.addAnimation(\"rocket3\", R1);\n //check to see which world was passed and load correct questions, board, and rocket.\n if(me.sceneArgs == \"World3\"){\n // rocket.addAnimation(\"rocket1\", R3);\n puzzle = new Puzzle(world3Questions);\n wm = me.sceneManager.worldMap3;\n }\n else if(me.sceneArgs == \"World2\"){\n //rocket.addAnimation(\"rocket2\", R2);\n puzzle = new Puzzle(world2Questions);\n wm = me.sceneManager.worldMap2;\n }\n else{\n console.log(\"wrold1 was selected\");\n //rocket.addAnimation(\"rocket3\", R1);\n puzzle = new Puzzle(world1Questions);\n wm = me.sceneManager.worldMap1;\n }\n\n correct=true;\n\n\n\n mouseIsPressed=false;\n player.visible=true;\n rocket.visible = true;\n\n\n player.addAnimation(\"normal\", p1);\n\n rocket.scale = .25;\n //set max speed for when sprite moves.\n player.maxSpeed = 5;\n player.scale = 1.2;\n player.depth=2;\n rocket.depth = 1;\n //sets player collition detection point to be smaller then the actual sprite to.\n player.setCollider(\"circle\", 0,0,15);\n rocket.setCollider(\"circle\",0,0,1);\n playstate = 0;\n // playstate = 10;\n\n //set velocity to 0 to make sure its not moving.\n\n player.velocity.y = 0;\n player.velocity.x = 0;\n player.position.x = nodesLocation[playstate][0];\n player.position.y = nodesLocation[playstate][1];\n\n\n\n //puzzle = new Puzzle(world1Questions);//gives the puzzle class the set of world questions\n var buttonArray = [];\n\n console.log(\"init \"+nodesLocation[playstate][2]);\n xpos=nodesLocation[playstate][0];\n ypos=nodesLocation[playstate][1];\n puzzle.initializeQuestion(nodesLocation[playstate][2]);\n //puzzle.initializeQuestion(nodesLocation[playstate+20][2]);//tells puzzle what question to display\n display = false;\n }", "title": "" }, { "docid": "c7f04147f98dfd2abc05e07bd25b3dbd", "score": "0.5771206", "text": "function init(){\n initPhysijs();\n\t\t\tscene = initScene();\n\t\t\tinitRenderer();\n\t\t\tcreateWinScene();\n\t\t\tcreateLoseScene();\n\t\t\tcreateMainScene();\n\t\t}", "title": "" }, { "docid": "9f25ea0287d815be29839e3ee8834ce2", "score": "0.57691383", "text": "setup_physics(){\n this.physics.add.collider(this.player,this.layer); //add that the player and layer collide\n this.physics.add.collider(this.player,this.door);\n this.physics.add.overlap(this.player,this.keys,this.key_take,null,this);\n //When the player overlap the helpers(question marks) then show_story() handles the rest\n this.physics.add.overlap(this.player,this.helpers,this.hud.show_story,null,this.hud);\n this.physics.add.overlap(this.player,this.weapons,this.player.weapon_handling,null,this.player);\n this.physics.add.overlap(this.player,this.weapons1,this.player.weapon_handling,null,this.player);\n this.physics.add.overlap(this.player,this.monsters,this.player.monster_handling,null,this.player);\n this.physics.add.overlap(this.player,this.monsters1,this.player.monster_handling,null,this.player);\n this.physics.add.overlap(this.player,this.monsters2,this.player.monster_handling,null,this.player);\n this.physics.add.overlap(this.player,this.monsters3,this.player.monster_handling,null,this.player);\n\n\n }", "title": "" }, { "docid": "d3bc1fd4cbba1a3d7124e32d0a32ab54", "score": "0.57645535", "text": "function startGame(){\n\t\t\t\tmoney=0;\n\t\t\t\tMoneycontrol.innerHTML=money;\n\t\t\t\tQ.scene(\"level1\",function(stage) {\n\t\t\t\t\tvar cx,cy;\n\t\t\t\t\tn=map['map0'].field.length;\n\t\t\t\t\tc=map['map0'].field;\n\t\t\t\t \tvar player = new Array(n);\n\t\t\t\t \tfor (var k=0;k<n;k++){\n\t\t\t\t \t\tcx=50*(c[k]%10)+25;\n\t\t\t\t \t\tcy=50*Math.floor(c[k]/10)+65;\n\t\t\t\t \t\tplayer[k]=stage.insert(new Q.Square({x:cx,y:cy}))\n\t\t\t\t \t}\n\t\t\t\t \t/*for (var k=0;k<10;k++){\n\t\t\t\t \t\tplayer[k]=new Array();\n\t\t\t\t \t\tfor (var j=0;j<10;j++){\n\t\t\t\t \t\t\tif (j==5&&k<9||(k==8&&j<5))\n\t\t\t\t \t\t\t\tcontinue;\n\t\t\t\t \t\t\tvar c_x=50*k+25;\n\t\t\t\t \t\t\tvar c_y=50*j+25+40;\n\t\t\t\t \t\t\tplayer[k][j]=stage.insert(new Q.Square({x:c_x,y:c_y}))\n\t\t\t\t \t\t}\t\n\t\t\t\t \t}*/\n\t\t\t\t \tstage.insert(new Q.UI.Button({\n\t\t\t\t\tlabel: \"A Button\",\n\t\t\t\t\ty: 20,\n\t\t\t\t\tx: 30,\n\t\t\t\t\tw:20,\n\t\t\t\t\th:10\n\t\t\t\t\t}, function() {\n\t\t\t\t\t\tvar cx,cy;\n\t\t\t\t\t\tcx=50*(defaultE%10)+25;\n\t\t\t\t\t\tcy=50*Math.floor(defaultE/10)+65;\n\t\t\t\t\t//if (this.p.label == \"Pressed\";\n\t\t\t\t\t\tconsole.log(\"Pressed\");\n\t\t\t\t\t\tstage.insert(new Q.Soldier({x:cx,y:cy,direct:defaultD,belong:playerID}));\n\t\t\t\t\t\tsocket.emit('update', { 'playerID': rivalID,'type':0,'x':cx,'y':cy,'direct':defaultD,'belong':playerID});\n\t\t\t\t\t}));\n\t\t\t\t \t//stage.insert(new Q.Soldier({x:30,y:275}));\n\t\t\t\t \t//stage.insert(new Q.Soldier({x:100,y:275}));\n\t\t\t\t \t//stage.insert(new Q.Soldier({x:170,y:275}));\n\t\t\t\t\t/*for (var i = 0; i < 3; i++) {\n\t\t\t\t\t\tvar t=setTimeout(create,1000);\n\t\t\t\t\t\tconsole.log(\"Plus 1\");\n\t\t\t\t\t};*/\n\t\t\t\t\t\n\t\t\t\t\t//stage.insert(new Q.Soldier({x:-100,y:275}));\n\t\t\t\t\tsetUp(stage);\n\t\t\t\t});\n\t\t\t\tQ.stageScene(\"level1\");\n\t\t\t \tQ.debug = true;\n\t\t\t}", "title": "" }, { "docid": "1b64bf1d9770a687e9a390c8750d2c5e", "score": "0.5763006", "text": "function createScene(atoms) {\n\t \n\t o3djs.require('o3djs.util');\n\t o3djs.require('o3djs.rendergraph');\n\t o3djs.require('o3djs.material');\n\t o3djs.require('o3djs.primitives');\n\t o3djs.require('o3djs.arcball');\n\t o3djs.require('o3djs.picking');\n\t o3djs.require('o3djs.math');\n\t o3djs.require('o3djs.quaternions');\n\n\t //new requires\n\t o3djs.require('o3djs.pack');\n\t o3djs.require('o3djs.arcball');\n\t o3djs.require('o3djs.scene');\n\t o3djs.require('o3djs.debug');\n\n\t // global variables\n\t var g_o3dElement;\n\t var g_client;\n\t var g_o3d;\n\t var g_math;\n\t var g_quaternions;\n\t var g_pack;\n\t var g_viewInfo;\n\t var g_sceneRoot;\n\t var g_eyeView;\n\t var g_cubeShape;\n\t var g_cylinderShape;\n\t var g_prismShape;\n\t var g_material;\n\t var g_aball;\n\t var g_thisRot;\n\t var g_lastRot;\n\t var g_zoomFactor;\n\t var g_dragging = false;\n\t var g_treeInfo; // information about the transform graph.\n\t var g_statusInfoElem;\n\n\t // Animation globals.\n\t var g_flashTimer;\n\t var g_moveTimer;\n\t var g_moveDuration;\n\t var g_oldFlashTimer;\n\n\t // Checkers globals.\n\t var g_board;\n\t var g_boardSize;\n\t var g_boardSquare;\n\t var g_boardHeight;\n\t var g_pieceHeight;\n\t var g_selectedPiece;\n\t var g_selectedSquare;\n\t var g_player;\n\t var g_canJump;\n\n\t //Lattice globals.\n\t var symbol;\n\t var name;\n\t var mass;\n\t var sym2no = {};\n\t var name2no = {}\n\t var symlower=[];\n\t var mass2no = {}\n\t var color;\n\t var color1 = [] // colors scaled to 0-1\n\t var rvdw;\n\t var radius = rvdw;\n\t var rcov;\n\n\t //var tableLattice=['lattice', [[5,0,0],[-1,5,0],[0,0,5]]];\n\t var tableLattice = [[5,0,0],[-1,5,0],[0,0,5]];\n\t var tableAtom = [['Fe', [0.5,0.5,0.5]], ['C', [2.5,2.5,2.5]]];\n\t var tableBond = [ [[0.5,0.5,0.5],[2.5,2.5,2.5]]];\n\t var sizeX=1;//expand of the supercell along X\n\t var sizeY=1;//expand of the supercell along Y\n\t var sizeZ=1;//expand of the supercell along Z\n\t var latticeParameterX;\n\t var latticeParameterY;\n\t var latticeParameterZ;\n\n\t var g_lattice; //table with all the informations of the lattice\n\t var g_selectedAtom=[];\n\t var g_selectedBond=[];\n\n\t //functions to initialize ------------------------------------------------------------------------------------\n\t /**\n\t * Creates the client area.\n\t */\n\t function initClient() {\n\t window.g_finished = false; // for selenium testing.\n\n\t // Runs the sample in V8. Comment out this line to run it in the browser\n\t // JavaScript engine, for example if you want to debug it.\n\t //o3djs.util.setMainEngine(o3djs.util.Engine.V8);\n\n\t o3djs.util.makeClients(main);\n\t }\n\n\t /**\n\t * Initializes global variables, positions camera, draws the 3D chart.\n\t * @param {Array} clientElements Array of o3d object elements.\n\t */\n\t function main(clientElements) {\n\t \t// Init global variables.\n\t \tinitGlobals(clientElements);\n\n\t \t// Set up the view and projection transformations.\n\t \tinitContext();\n\n\t \t// Add the checkers board to the transform hierarchy.\n\t \t//createCheckersBoard();\n\t \t \n\t \t//lattice environment\n\t \t\n\t \t//drawlattice(tableLattice, tableAtoms, tableBonds, sizeX, sizeY, sizeZ);\n\t \tcreateLattice(sizeX, sizeY, sizeZ, tableLattice, tableAtom, tableBond)\n\t \t\t \n\t \t// Register mouse events handlers\n\t \to3djs.event.addEventListener(g_o3dElement, 'mousedown', startDragging);\n\t \to3djs.event.addEventListener(g_o3dElement, 'mousemove', drag);\n\t \to3djs.event.addEventListener(g_o3dElement, 'mouseup', stopDragging);\n\t \to3djs.event.addEventListener(g_o3dElement, 'wheel', scrollMe);\n\n\t \t// Set the rendering callback\n\t \tg_client.setRenderCallback(onrender);\n\n\t \twindow.g_finished = true; // for selenium testing.\n\t }\n\n\t /**\n\t * Initializes global variables and libraries.\n\t */\n\t function initGlobals(clientElements) {\n\t // init o3d globals.\n\t g_o3dElement = clientElements[0];\n\t window.g_client = g_client = g_o3dElement.client;\n\t g_o3d = g_o3dElement.o3d;\n\t g_math = o3djs.math;\n\t g_quaternions = o3djs.quaternions;\n\n\t // Create an arcball.\n\t g_aball = o3djs.arcball.create(g_client.width, g_client.height);\n\n\t // Create a pack to manage the objects created.\n\t g_pack = g_client.createPack();\n\n\t // Create a transform node to act as the 'root' of the scene.\n\t // Attach it to the root of the transform graph.\n\t g_sceneRoot = g_pack.createObject('Transform');\n\t g_sceneRoot.parent = g_client.root;\n\n\t // Create the render graph for the view.\n\t var clearColor = [.98, .98, .98, 1];\n\t g_viewInfo = o3djs.rendergraph.createBasicView(\n\t g_pack,\n\t g_client.root,\n\t g_client.renderGraphRoot,\n\t clearColor);\n\n\t // Create a material for the objects rendered.\n\t g_material = o3djs.material.createBasicMaterial(\n\t g_pack,\n\t g_viewInfo,\n\t [1, 1, 1, 1]);\n\n\t // Initialize checkers piece and square data.\n\t g_boardSize = 8;\n\t g_boardSquare = 10;\n\t g_boardHeight = g_boardSquare / 5;\n\t g_pieceHeight = g_boardHeight * 0.75;\n\t g_selectedPiece = null;\n\t g_selectedSquare = null;\n\n\t // Create a cube shape for the board squares.\n\t g_cubeShape = o3djs.primitives.createCube(\n\t g_pack,\n\t g_material,\n\t 1);\n\n\t // Create a cylinder shape for the checkers pieces.\n\t g_cylinderShape = o3djs.primitives.createCylinder(\n\t g_pack,\n\t g_material,\n\t g_boardSquare / 2 - 1, // Radius.\n\t g_pieceHeight, // Depth.\n\t 100, // Number of subdivisions.\n\t 1);\n\n\t // use an extruded polygon to create a 'crown' for the king piece.\n\t var polygon = [[0, 0], [1, 0], [1.5, 1.5], [0.5, 0.5],\n\t [0, 2], [-0.5, 0.5], [-1.5, 1.5], [-1, 0]];\n\n\t // use the 'prism' primitive for the crown.\n\t g_prismShape = o3djs.primitives.createPrism(\n\t g_pack,\n\t g_material,\n\t polygon, // The profile polygon to be extruded.\n\t 1); // The depth of the extrusion.\n\n\t // Get the status element.\n\t g_statusInfoElem = o3djs.util.getElementById('statusInfo');\n\n\t // Initialize player data.\n\t g_player = 1; // red player starts first.\n\t g_canJump = false;\n\n\t // Initialize various animation globals.\n\t g_flashTimer = 0;\n\t g_moveTimer = 0;\n\t g_moveDuration = 1.3;\n\t g_oldFlashTimer = 0;\n\t \n\t //initialize lattice variables\n\t initlatticeVariables();\n\t \n\t }\n\n\t /**\n\t * Initialize the original view of the scene.\n\t */\n\t function initContext() {\n\t g_eyeView = [-5, 120, 100];\n\t g_zoomFactor = 1.03;\n\t g_dragging = false;\n\t g_sceneRoot.identity();\n\t g_lastRot = g_math.matrix4.identity();\n\t g_thisRot = g_math.matrix4.identity();\n\n\t // Set up a perspective transformation for the projection.\n\t g_viewInfo.drawContext.projection = g_math.matrix4.perspective(\n\t Math.PI * 40 / 180, // 30 degree frustum.\n\t g_o3dElement.clientWidth / g_o3dElement.clientHeight, // Aspect ratio.\n\t 1, // Near plane.\n\t 10000); // Far plane.\n\n\t // Set up our view transformation to look towards the axes origin.\n\t g_viewInfo.drawContext.view = g_math.matrix4.lookAt(\n\t g_eyeView, // eye\n\t [0, 0, 0], // target\n\t [0, 1, 0]); // up\n\t }\n\n\t /**\n\t *this function is used to initialize the variables of the lattice\n\t */\n\t function initlatticeVariables(){\n\t \tsymbol = ['X','H', 'He','Li','Be','B', 'C', 'N', 'O', 'F' ,'Ne','Na','Mg','Al','Si','P', 'S', 'Cl','Ar','K','Ca','Sc','Ti','V', 'Cr','Mn','Fe','Co','Ni','Cu','Zn','Ga','Ge','As','Se','Br','Kr','Rb','Sr','Y', 'Zr','Nb','Mo','Tc','Ru','Rh','Pd','Ag','Cd','In','Sn','Sb','Te','I', 'Xe','Cs','Ba','La','Ce','Pr','Nd','Pm','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu','Hf','Ta','W', 'Re','Os','Ir','Pt','Au','Hg','Tl','Pb','Bi','Po','At','Rn','Fr','Ra','Ac','Th','Pa','U', 'Np','Pu','Am','Cm','Bk','Cf','Es','Fm','Md','No','Lr','Rf','Db','Sg','Bh','Hs','Mt','Ds','Rg'];\n\t \tname = ['dummy','hydrogen','helium','lithium','berylium','boron','carbon','nitrogen','oxygen','fluorine','neon','sodium','magnesium','aluminum','silicon','phosphorus','sulphur','chlorine','argon','potassium','calcium','scandium','titanium','vanadium','chromium','manganese','iron','cobalt','nickel','copper','zinc','gallium','germanium','arsenic','selenium','bromine','krypton','rubidium','strontium','yttrium', 'zirconium','niobium','molybdenum','tecnitium','rubidium','rhodium','palladium','silver','cadmium','indium','tin','antimony','tellurium','iodine','xenon','caesium','barium','lanthanum','cerium','praseodymium','neodymium','promethium','samarium','europium','gadolinium','terbium','dysprosium','holmium','erbium','thulium','ytterbium','lutetium','hafnium','tantalum','tungsten','rhenium','osmium','iridium','platinum','gold','mercury','thallium','lead','bismuth','polonium','astatine','radon','francium','radium','actinium','thorium','protactinium','uranium','neptunium','plutonium','americium','curium','berkelium','californium','einsteinium','fermium','mendelvium','nobelium','lawrencium','rutherfordium','dubnium','seaborgium','bohrium','hassium','meitnerium','darmstadtium','roentgenium'];\n\t \tmass = [0.00,1.0008, 4.0026,6.941,9.0122,10.811,12.011,14.007,15.999,18,998,20.179,22.990,24.305,26.982,28.086,30.974,32.066,35.453,39.948,39.098, 40.078,44.9559, 47.867, 50.9415, 51.9961, 54.938, 55.845, 58.9332, 58.6934, 63.546,65.39, 69.723, 72.61, 74.9216, 78.96, 79.904, 83.80, 85.4678, 87.62, 88.90686, 91.224, 92.90638, 95.94, 98, 101.07, 102.90550, 106.42, 107.8682, 112.411, 114.818, 118.710, 121.760, 127.60, 126.90447, 131.29];\n\t \t\n\t \tfor( var i=0; i<symbol.length; i++){\n\t \t\tsym2no[symbol[i]] = i ;\n\t \t\tsym2no[symbol[i].toLowerCase()] = i ;\n\t \t}\n\t \t\n\t \tfor(i=0; i<name.length; i++){\n\t \t\tname2no[name[i]] = i;\n\t \t\tname2no[name[i].toLowerCase()] = i;\n\t \t}\n\t \t\n\t \tfor(i=0; i<symbol.length; i++){\n\t \t\tsymlower[i]=symbol[i].toLowerCase();\n\t \t}\n\t \t\n\t \tfor(i=0; i<mass.length; i++){\n\t \t\tmass2no[Math.round(mass[i])] = i;\n\t \t}\n\t \t\n\t \tcolor = [\n\t [0,0,0], // dummy\n\t [250,235,215], // H, 1 \n\t [255,192,203], // He, 2 \n\t [178,34,34], // Li, 3\n\t [34,139,34], // Be, 4\n\t [0,255,0], // B, 5\n\t [112,128,144], // C, 6\n\t [0,191,255], // N, 7\n\t [255,0,0], // O, 8\n\t [218,165,32], // F, 9\n\t [255,105,180], // Ne, 10\n\t [0,0,255], // Na, 11\n\t [34,139, 34], // Mg, 12\n\t [190,190,190], // Al, 13\n\t [218,165,32], // Si, 14\n\t [255,165,0], // P, 15\n\t [255,255,0], // S, 16\n\t [0,255,0], // Cl, 17\n\t [255,192,203], // Ar, 18\n\t [255,20,147], // K, 19\n\t [128,128,128], // Ca, 20\n\t [190,190,190], // Sc, 21\n\t [190,190,190], // Ti, 22\n\t [190,190,190], // V, 23\n\t [190,190,190], // Cr, 24\n\t [190,190,190], // Mn, 25\n\t [255,165,0], // Fe, 26\n\t [165,42,42], // Co, 27\n\t [165,42,42], // Ni, 28\n\t [165,42,42], // Cu, 29\n\t [165,42,42], // Zn, 30\n\t [165,42,42], // Ga, 31\n\t [85,107,47], // Ge, 32\n\t [253,245,230], // As, 33\n\t [152,251,152], // Se, 34\n\t [165,42,42], // Br, 35\n\t [50,205,50], // Kr, 36\n\t [165,42,42], // Rb, 37\n\t [190,190,190], // Sr, 38\n\t [190,190,190], // Y, 39\n\t [190,190,190], // Zr, 40\n\t [190,190,190], // Nb, 41\n\t [255,127,80], // Mo, 42\n\t [190,190,190], // Tc, 43\n\t [190,190,190], // Ru, 44\n\t [190,190,190], // Rh, 45\n\t [190,190,190], // Pd, 46\n\t [190,190,190], // Ag, 47\n\t [255,140,0], // Cd, 48\n\t [190,190,190], // In, 49\n\t [190,190,190], // Sn, 50\n\t [190,190,190], // Sb, 51\n\t [190,190,190], // Te, 52\n\t [160,32,240], // I, 53\n\t [255,105,180], // Xe, 54\n\t [165,42,42], // Cs, 55\n\t [190,190,190], // Ba, 56\n\t [190,190,190], // La, 57\n\t [190,190,190], // Ce, 58\n\t [190,190,190], // Pr, 59\n\t [190,190,190], // Nd, 60\n\t [190,190,190], // Pm, 61\n\t [190,190,190], // Sm, 62\n\t [190,190,190], // Eu, 63\n\t [190,190,190], // Gd, 64\n\t [190,190,190], // Tb, 65\n\t [190,190,190], // Dy, 66\n\t [190,190,190], // Ho, 67\n\t [190,190,190], // Er, 68\n\t [190,190,190], // Tm, 69\n\t [190,190,190], // Yb, 70\n\t [190,190,190], // Lu, 71\n\t [190,190,190], // Hf, 72\n\t [190,190,190], // Ta, 73\n\t [64,224,208], // W, 74\n\t [190,190,190], // Re, 75\n\t [190,190,190], // Os, 76\n\t [190,190,190], // Ir, 77\n\t [190,190,190], // Pt, 78\n\t [255,215,0], // Au, 79\n\t [190,190,190], // Hg, 80\n\t [190,190,190], // Tl, 81\n\t [190,190,190], // Pb, 82\n\t [255,181,197], // Bi, 83\n\t [190,190,190], // Po, 84\n\t [190,190,190], // At, 85\n\t [190,190,190], // Rn, 86\n\t [190,190,190], // Fr, 87\n\t [190,190,190], // Ra, 88\n\t [190,190,190], // Ac, 89\n\t [190,190,190], // Th, 90\n\t [190,190,190], // Pa, 91\n\t [90,90,90], // U, 92\n\t [190,190,190], // Np, 93\n\t [190,190,190], // Pu, 94\n\t [190,190,190], // Am, 95\n\t [190,190,190], // Cm, 96\n\t [190,190,190], // Bk, 97\n\t [190,190,190], // Cf, 98\n\t [190,190,190], // Es, 99\n\t [190,190,190], // Fm, 100\n\t [190,190,190], // Md, 101\n\t [190,190,190], // No, 102\n\t [190,190,190], // Lr, 103\n\t [190,190,190], // Rf, 104\n\t [190,190,190], // Db, 105\n\t [190,190,190], // Sg, 106\n\t [190,190,190], // Bh, 107\n\t [190,190,190], // Hs, 108\n\t [190,190,190], // Mt, 109\n\t [190,190,190], // Ds, 110\n\t [190,190,190]]; // Rg, 111\n\t \t\n\t \tfor(i=0; i<color.length; i++){\n\t \t\tcolor[i]=[color[i][0]/255., color[i][1]/255., color[i][2]/255.];\n\t \t}\n\n\t \trvdw = [\n\t 1.0000, // dummy\n\t 1.2000, // H, 1 \n\t 1.4000, // He, 2 \n\t 1.8200, // Li, 3\n\t 1.3725, // Be, 4\n\t 0.7950, // B, 5\n\t 1.7000, // C, 6\n\t 1.5500, // N, 7\n\t 1.5200, // O, 8\n\t 1.4700, // F, 9\n\t 1.5400, // Ne, 10\n\t 2.2700, // Na, 11\n\t 1.7300, // Mg, 12\n\t 1.7000, // Al, 13\n\t 2.1000, // Si, 14\n\t 1.8000, // P, 15\n\t 1.8000, // S, 16\n\t 1.7500, // Cl, 17\n\t 1.8800, // Ar, 18\n\t 2.7500, // K, 19\n\t 2.4500, // Ca, 20\n\t 1.3700, // Sc, 21\n\t 1.3700, // Ti, 22\n\t 1.3700, // V, 23\n\t 1.3700, // Cr, 24\n\t 1.3700, // Mn, 25\n\t 1.4560, // Fe, 26\n\t 0.8800, // Co, 27 \n\t 0.6900, // Ni, 28\n\t 0.7200, // Cu, 29\n\t 0.7400, // Zn, 30\n\t 1.3700, // Ga, 31\n\t 1.9500, // Ge, 32\n\t 1.8500, // As, 33\n\t 1.9000, // Se, 34 \n\t 1.8500, // Br, 35\n\t 2.0200, // Kr, 36\n\t 1.5800, // Rb, 37\n\t 2.1510, // Sr, 38\n\t 1.8010, // Y, 39\n\t 1.6020, // Zr, 40\n\t 1.4680, // Nb, 41 \n\t 1.5260, // Mo, 42\n\t 1.3600, // Tc, 43\n\t 1.3390, // Ru, 44\n\t 1.3450, // Rh, 45\n\t 1.3760, // Pd, 46\n\t 1.2700, // Ag, 47\n\t 1.4240, // Cd, 48 \n\t 1.6630, // In, 49\n\t 2.1000, // Sn, 50\n\t 2.0500, // Sb, 51\n\t 2.0600, // Te, 52\n\t 1.9800, // I, 53\n\t 2.0000, // Xe, 54\n\t 1.8400, // Cs, 55 \n\t 2.2430, // Ba, 56\n\t 1.8770, // La, 57\n\t null, // Ce, 58\n\t null, // Pr, 59\n\t null, // Nd, 60\n\t null, // Pm, 61\n\t null, // Sm, 62\n\t null, // Eu, 63\n\t null, // Gd, 64\n\t null, // Tb, 65\n\t null, // Dy, 66\n\t null, // Ho, 67\n\t null, // Er, 68\n\t null, // Tm, 69\n\t null, // Yb, 70\n\t 2.1700, // Lu, 71\n\t 1.5800, // Hf, 72\n\t 1.4670, // Ta, 73\n\t 1.5340, // W, 74\n\t 1.3750, // Re, 75\n\t 1.3530, // Os, 76 \n\t 1.3570, // Ir, 77\n\t 1.7500, // Pt, 78\n\t 1.6600, // Au, 79\n\t 1.5500, // Hg, 80\n\t 1.9600, // Tl, 81\n\t 2.0200, // Pb, 82\n\t 2.1500];// Bi, 83\n\t // Po, 84\n\t // At, 85\n\t // Rn, 86\n\t // Fr, 87\n\t // Ra, 88\n\t // Ac, 89\n\t // Th, 90\n\t // Pa, 91\n\t // U, 92\n\t // Np, 93\n\t // Pu, 94\n\t // Am, 95\n\t // Cm, 96\n\t // Bk, 97\n\t // Cf, 98\n\t // Es, 99\n\t // Fm, 100\n\t // Md, 101\n\t // No, 102\n\t // Lr, 103\n\t // Rf, 104\n\t // Db, 105\n\t // Sg, 106\n\t // Bh, 107\n\t // Hs, 108\n\t // Mt, 109\n\t // Ds, 110\n\t // Rg, 111\n\t \trcov = [null, 0.32, 0.93, 1.23, 0.90, 0.82, 0.77, 0.75, 0.73, 0.72, 0.71,\n\t 1.54, 1.36, 1.18, 1.11, 1.06, 1.02, 0.99, 0.98, 2.03, 1.74, 1.44,\n\t 1.32, 1.22, 1.18, 1.17, 1.17, 1.16, 1.15, 1.17, 1.25, 1.26, 1.22,\n\t 1.20, 1.16, 1.14, 1.12, 2.16, 1.91, 1.62, 1.45, 1.34, 1.30, 1.27,\n\t 1.25, 1.25, 1.28, 1.34, 1.48, 1.44, 1.41, 1.40, 1.36, 1.33, 1.31,\n\t 2.35, 1.98, 1.69, null, null, null, null, null, null, null, null,\n\t null, null, null, null, null, 1.60, 1.44, 1.34, 1.30, 1.28, 1.26,\n\t 1.27, 1.30, 1.34, 1.49, 1.48, 1.47, 1.46];\n\t \t\t\n\t \t\t\n\t \tlatticeParameterX=Math.sqrt(Math.pow(tableLattice[0][0],2)+Math.pow(tableLattice[0][1],2)+Math.pow(tableLattice[0][2],2));\n\t \tlatticeParameterY=Math.sqrt(Math.pow(tableLattice[1][0],2)+Math.pow(tableLattice[1][1],2)+Math.pow(tableLattice[1][2],2));\n\t \tlatticeParameterZ=Math.sqrt(Math.pow(tableLattice[2][0],2)+Math.pow(tableLattice[2][1],2)+Math.pow(tableLattice[2][2],2));\n\t }\n\t //--------------------------------------------------------------------------------------------------------------\n\n\n\t //converted\n\t /**\n\t * Creates a cellInfo object to hold board information.\n\t * @private\n\t * @constructor\n\t * @param {number} x X coordinate of the cell.\n\t * @param {number} y Y coordinate of the cell.\n\t * @param {number} z Z coordinate of the cell.\n\t */\n\t function CellInfo(x,y,z){\n\t \tthis.x=x;\n\t \tthis.y=y;\n\t \tthis.z=z;\n\t \tthis.tableAtomCell=[];\n\t \tthis.tableBondCell=[];\n\t \tthis.tableAtomTransform=[];\n\t \tthis.tableBondTransform=[];\n\t }\n\n\n\t /**\n\t * Creates the checkers board.\n\t */\n\t function createLattice(sizeX, sizeY, sizeZ, tableLattice, tableAtom, tableBond) {\n\t \tg_lattice = [];\n\t \t\n\t \t//create the atoms and the bonds inside each unitcell\n\t \tfor (var indexX = 0; indexX < sizeX; indexX++) {//duplicate the cell along the X axis\n\t \t\tg_lattice[indexX] = [];\n\t \t\tfor (var indexY = 0; indexY < sizeY; indexY++) {//duplicate the cell along the Y axis\n\t \t\t\tg_lattice[indexX][indexY]=[];\n\t \t\t\tfor(var indexZ=0; indexZ<sizeZ; indexZ++){\n\t \t\t\t\t//create the info in the lattice table\n\t \t\t\t\tg_lattice[indexX][indexY][indexZ] = new CellInfo(indexX, indexY, indexZ);\n\t \t\t\t\t\n\t \t\t\t\t//create the atoms inside the cell\n\t \t\t\t\tfor(var indexTableAtom=0; indexTableAtom<tableAtom.length; indexTableAtom++){\n\t \t\t\t\t\t//create the transform for the atom\n\t \t\t\t\t\tvar atom=g_pack.createObject('Transform');\n\t \t\t\t\t\tatom.parent=g_sceneRoot;\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\tatom.addShape(createSphereShapeBySymbol(tableAtom[indexTableAtom][0]));\n\t \t\t\t\t\tatom.cull = true;\n\t \t\t\t\t\t\n\t \t\t\t\t\t//translate the atom relatively to the position of the cell\n\t \t\t\t\t\tvar atomTranslation=translation(tableAtom[indexTableAtom][1], tableLattice[0], indexX);//translation along X with the X vector of the lattice\n\t \t\t\t\t\tatomTranslation=translation(atomTranslation, tableLattice[1], indexY);//translation along Y with the Y vector of the lattice\n\t \t\t\t\t\tatomTranslation=translation(atomTranslation, tableLattice[2], indexZ);//translation along Z with the Z vector of the lattice\n\t \t\t\t\t\t\t\t\t\n\t \t\t\t\t\t//translate the atom realtively to the center of the supercell\n\t \t\t\t\t\tatomTranslation=translation(atomTranslation, tableLattice[0], -sizeX/2);\n\t \t\t\t\t\tatomTranslation=translation(atomTranslation, tableLattice[1], -sizeY/2);\n\t \t\t\t\t\tatomTranslation=translation(atomTranslation, tableLattice[2], -sizeZ/2);\n\t \t\t\t\t\t\n\t \t\t\t\t\t//translation for the transform\n\t \t\t\t\t\tatom.translate(atomTranslation);\n\n\t \t\t\t\t\t//create an additionnal parameter for blinking\n\t \t\t\t\t\tvar indexOfElement=sym2no[tableAtom[indexTableAtom][0]];\n\t \t\t\t\t\tatom.createParam('diffuse', 'ParamFloat4').value = color[indexOfElement];\n\t \t\t\t\t\t\n\t \t\t\t\t\t// add this atom and its info to the lattice.\n\t \t\t\t\t\tg_lattice[indexX][indexY][indexZ].tableAtomCell.push(tableAtom[indexTableAtom]);\n\t \t\t\t\t\tg_lattice[indexX][indexY][indexZ].tableAtomTransform.push(atom);\n\t \t\t\t\t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t//create the bonds inside the cell\n\t \t\t\t\tfor(var indexTableBond=0; indexTableBond<tableBond.length; indexTableBond++){\n\t \t\t\t\t\t//create the transform for the bond\n\t \t\t\t\t\tvar bond=g_pack.createObject('Transform');\n\t \t\t\t\t\tbond.parent=g_sceneRoot;\n\t \t\t\t\t\tbond.addShape(createBondShape(tableBond[indexTableBond][0],tableBond[indexTableBond][1]) );\n\t \t\t\t\t\tbond.cull = true;\n\t \t\t\t\t\t\n\t \t\t\t\t\t//translate the bond relatively to the middle of the two points\n\t \t\t\t\t\tvar bondTranslation=getTranslation(tableBond[indexTableBond][0],tableBond[indexTableBond][1]);\n\t \t\t\t\t\t\n\t \t\t\t\t\t//translate the bond relatively to the position of the cell\n\t \t\t\t\t\tbondTranslation=translation(bondTranslation, tableLattice[0], indexX);//translation along X with the X vector of the lattice\n\t \t\t\t\t\tbondTranslation=translation(bondTranslation, tableLattice[1], indexY);//translation along Y with the Y vector of the lattice\n\t \t\t\t\t\tbondTranslation=translation(bondTranslation, tableLattice[2], indexZ);//translation along Z with the Z vector of the lattice\n\t \t\t\t\t\t\n\t \t\t\t\t\t//translate the bond realtively to the cneter of the supercell\n\t \t\t\t\t\tbondTranslation=translation(bondTranslation, tableLattice[0], -sizeX/2);\n\t \t\t\t\t\tbondTranslation=translation(bondTranslation, tableLattice[1], -sizeY/2);\n\t \t\t\t\t\tbondTranslation=translation(bondTranslation, tableLattice[2], -sizeZ/2);\n\t \t\t\t\t\t\n\t \t\t\t\t\t//translate for the transform\n\t \t\t\t\t\tbond.translate(bondTranslation);\n\t \t\t\t\t\t\n\t \t\t\t\t\t//rotate the bond\n\t \t\t\t\t\tvar bondRotation=[getAlpha(tableBond[indexTableBond][0],tableBond[indexTableBond][1]), getBeta(tableBond[indexTableBond][0],tableBond[indexTableBond][1]), 0];\n\t \t\t\t\t\t\n\t \t\t\t\t\t//rotate the transform\n\t \t\t\t\t\tbond.rotateZYX(bondRotation);\n\t \t\t\t\t\t\n\t \t\t\t\t\t//create an additionnal parameter for the blinking\n\t \t\t\t\t\tbond.createParam('diffuse', 'ParamFloat4').value = [0,0,1,1];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t// add this atom and its info to the lattice.\n\t \t\t\t\t\tg_lattice[indexX][indexY][indexZ].tableBondCell.push(tableBond[indexTableBond]);\n\t \t\t\t\t\tg_lattice[indexX][indexY][indexZ].tableBondTransform.push(bond);\n\t \t\t\t\t\t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \t\n\t \t//create the supercell lattice\n\t \tvar transformTableSupercell=createTransformTableSupercell(tableLattice, sizeX, sizeY, sizeZ);\n\t \tfor(var indexTableSupercell=0; indexTableSupercell<transformTableSupercell.length; indexTableSupercell++){\n\t \t\tvar line=g_pack.createObject('Transform');\n\t \t\tline.parent=g_sceneRoot;\n\t \t\tline.addShape( transformTableSupercell[indexTableSupercell].shape );\n\t \t\tline.cull = true;\n\t \t\n\t \t}\n\t \t\n\t \t\n\t \t// Update our tree info.\n\t \tupdateTreeInfo();\n\t \t\n\t }\n\n\t /**\n\t * Checks if a piece has become a 'king' piece and updates it.\n\t *\n\t * @param {number} x X coordinate on the checkers board.\n\t * @param {number} y Y coordinate on the checkers board.\n\t */\n\t function checkAndUpdateKing(x, y) {\n\t // if the piece is not on the king row, nothing to do.\n\t if ( y > 0 && y < g_boardSize - 1 ) return;\n\n\t // ignore if no piece or the piece is already king\n\t var selSquare = g_board[x][y];\n\t if (!selSquare.piece || selSquare.king) return;\n\n\t // change the king piece color.\n\t selSquare.king = true;\n\n\t // create the crown shape.\n\t var crown = g_pack.createObject('Transform');\n\t crown.parent = selSquare.piece;\n\t crown.addShape(g_prismShape);\n\t var crownSize = g_pieceHeight;\n\t crown.scale(crownSize, crownSize, crownSize);\n\t crown.translate(0, g_pieceHeight / 2, 0);\n\t crown.createParam('diffuse', 'ParamFloat4').value = [1, 1, 0, 0];\n\t }\n\n\t /**\n\t * Updates the transform tree info.\n\t */\n\t function updateTreeInfo() {\n\t if (!g_treeInfo) {\n\t g_treeInfo = o3djs.picking.createTransformInfo(g_client.root, null);\n\t }\n\t g_treeInfo.update();\n\t }\n\n\t //converted\n\t function detectSelectionCell(e){\n\t \tvar worldRay = o3djs.picking.clientPositionToWorldRay(e.x,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\te.y,\n\t g_viewInfo.drawContext,\n\t g_client.width,\n\t g_client.height);\n\t \t// check if we picked any objects.\n\t \tvar pickInfo = g_treeInfo.pick(worldRay);\n\t \tif (pickInfo) {\n\t \t\t// get the parent transform of this object.\n\t \t\tvar pickTrans = pickInfo.shapeInfo.parent.transform;\n\n\t \t\t//find if the piece selected exists\n\t \t\tfor (var indexX=0; indexX < g_lattice.length; indexX++) {\n\t \t\t\tfor (var indexY=0; indexY < g_lattice[indexX].length; indexY++) {\n\t \t\t\t\tfor(var indexZ=0; indexZ < g_lattice[indexX][indexY].length; indexZ++){\n\t \t\t\t\t\t\n\t \t\t\t\t\tvar tableAtomTrans=g_lattice[indexX][indexY][indexZ].tableAtomTransform;\n\t \t\t\t\t\t\n\t \t\t\t\t\tfor(var indexTableAtomTrans=0; indexTableAtomTrans<tableAtomTrans.length; indexTableAtomTrans++){\n\t \t\t\t\t\t\tif(pickTrans==tableAtomTrans[indexTableAtomTrans]){\n\t \t\t\t\t\t\t\tSelectAtom(indexX,indexY,indexZ,indexTableAtomTrans);\n\t \t\t\t\t\t\t\treturn;\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\tvar tableBondTrans=g_lattice[indexX][indexY][indexZ].tableBondTransform;\n\t \t\t\t\t\t\n\t \t\t\t\t\tfor(var indexTableBondTrans=0; indexTableBondTrans<tableBondTrans.length; indexTableAtomTrans++){\n\t \t\t\t\t\t\tif(pickTrans==tableBondTrans[indexTableBondTrans]){\n\t \t\t\t\t\t\t\tSelectBond(indexX,indexY,indexZ,indexTableBondTrans);\n\t \t\t\t\t\t\t\treturn;\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t }\n\n\t //converted\n\t function SelectAtom(x,y,z,index){\n\t \tg_selectedAtom.push([g_lattice[x][y][z].tableAtomTransform[index], g_lattice[x][y][z].tableAtomCell[index]]);//we store the transform and the information about the atom in the table of selected Atoms\n\t \tvar atomSymbol=g_lattice[x][y][z].tableAtomCell[index][0];\n\t \t//update status\n\t \tupdateStatus('Selected '+'atom'+':'+atomSymbol+' at ('+x+','+y+','+z+')');\n\t }\n\n\t //converted\n\t function SelectBond(x,y,z, index){\n\t \tg_selectedBond.push([g_lattice[x][y][z].tableBondTransform[index],g_lattice[x][y][z].tableBondCell[index]]);////we store the transform and the information about the atom in the table of selected Atoms\n\t \t\t\n\t \tvar point1=g_lattice[x][y][z].tableBondCell[index][0];\n\t \tvar point2=g_lattice[x][y][z].tableBondCell[index][1];\n\t \tupdateStatus('Selected '+'bond'+': ['+point1+' , '+point2+' ]');\n\t }\n\n\t /**\n\t * Return the color for the given piece type.\n\t *\n\t * @param {number} type Type of the checkers piece.\n\t * @return {Array} Array representing the color.\n\t */\n\t function getPieceColor(type) {\n\t return (type == 1) ? [1, 0.15, 0.15, 1] : [1, 1, 1, 1];\n\t }\n\n\t //must be converted\n\t /**\n\t * Called every frame.\n\t * @param {o3d.RenderEvent} renderEvent Rendering Information.\n\t */\n\t function onrender(renderEvent) {\n\t \tg_flashTimer += renderEvent.elapsedTime;\n\t \tg_flashTimer = g_flashTimer % 0.5;\n\t \t\n\t \tif(g_selectedAtom.length>0){\n\t \t\tfor(var indexAtomSelectedTable=0; indexAtomSelectedTable<g_selectedAtom.length; indexAtomSelectedTable++){\n\t \t\t\tvar indexOfElement=sym2no[g_selectedAtom[indexAtomSelectedTable][1][0]];\n\t \t\t\tvar origColorAtom = color[indexOfElement];\n\t \t\t\t// flash highlight the selected piece as long as selected.\n\t \t\t\tif (g_oldFlashTimer > g_flashTimer ) {\n\t \t\t\t\tg_selectedAtom[indexAtomSelectedTable][0].getParam('diffuse').value = [0.6, 1, 1, 1];\n\t \t\t\t}\n\t \t\t\telse if (g_flashTimer >= 0.25 && g_oldFlashTimer < 0.25) {\n\t \t\t\t\tg_selectedAtom[indexAtomSelectedTable][0].getParam('diffuse').value = origColorAtom;\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \t\n\t \tif(g_selectedBond.length>0){\n\t \t\tfor(var indexBondSelectedTable=0; indexBondSelectedTable<g_selectedBond.length; indexBondSelectedTable++){\n\t \t\t\tvar origColorBond = [0,0,1,1];\n\t \t\t\t// flash highlight the selected piece as long as selected.\n\t \t\t\tif (g_oldFlashTimer > g_flashTimer ) {\n\t \t\t\t\tg_selectedBond[indexBondSelectedTable][0].getParam('diffuse').value = [0.6, 1, 1, 1];\n\t \t\t\t}\n\t \t\t\telse if (g_flashTimer >= 0.25 && g_oldFlashTimer < 0.25) {\n\t \t\t\t\tg_selectedBond[indexBondSelectedTable][0].getParam('diffuse').value = origColorBond;\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \t\n\t \n\t g_oldFlashTimer = g_flashTimer;\n\t }\n\n\n\n\t //functions for building the lattice----------------------------------------------------\n\t //functions to draw the lattice\n\t function drawlattice(tableLattice, tableAtoms, tableBonds, sizeX, sizeY, sizeZ){\n\n\t \t//creation of the group transform--------------------------------------------------------------------\n\t \tg_pack = g_client.createPack();\n\n\t \t//creation of the lattice shapes---------------------------------------------------------------------\n\t \t\n\t \t//addition of the atoms to the display\n\t \tvar transformTableElements=createTransformTableForlattice(tableAtoms);\n\t \tfor (var indexTableElements = 0; indexTableElements < transformTableElements.length; ++indexTableElements) {\n\t \t\tvar transformEle = g_pack.createObject('Transform');\n\t \t\ttransformEle.parent = g_sceneRoot;\n\t \t\t// Turn on culling\n\t \t\ttransformEle.cull = true;\n\t \t\ttransformEle.addShape(transformTableElements[indexTableElements].shape);\n\t \t\t//transform.boundingBox = atomSphere.boundingBox;\n\t \t\ttransformEle.translate(transformTableElements[indexTableElements].translation);\n\t \t}\n\t \t\n\t \t//addition of the bonds to the display\n\t \tvar transformTableBonds=createTransformTableBonds(tableBonds);\n\t \tfor (var indexTableBonds = 0; indexTableBonds < transformTableBonds.length; ++indexTableBonds) {\n\t \t\tvar transformBonds = g_pack.createObject('Transform');\n\t \t\ttransformBonds.parent = g_sceneRoot;\n\t \t\t// Turn on culling\n\t \t\ttransformBonds.cull = true;\n\t \t\t\n\t \t\ttransformBonds.addShape(transformTableBonds[indexTableBonds].shape);\n\t \t\t//transform.boundingBox = atomSphere.boundingBox;\n\t \t\ttransformBonds.translate(transformTableBonds[indexTableBonds].translation);\n\t \t\ttransformBonds.rotateZYX(transformTableBonds[indexTableBonds].rotation);\n\t \t}\n\t \t\n\t \t//addition of the supercell to the display\n\t \tvar transformTableSupercell=createTransformTableSupercell(tableLattice, sizeX, sizeY, sizeZ);\n\t \t\n\t \tfor (var indexTableSupercell = 0; indexTableSupercell < transformTableSupercell.length; ++indexTableSupercell) {\n\t \t\tvar transformSupercell = g_pack.createObject('Transform');\n\t \t\ttransformSupercell.parent = g_sceneRoot;\n\t \t\t// Turn on culling\n\t \t\ttransformSupercell.cull = true;\n\t \t\ttransformSupercell.addShape(transformTableSupercell[indexTableSupercell].shape);\n\t \t}\n\t \tupdateTreeInfo();\n\t }\n\n\t //new graphics functions\n\t /**\n\t * Creates a material based on the given single color.\n\t * @param {!o3djs.math.Vector4} baseColor A 4-component vector with\n\t * the R,G,B, and A components of a color.\n\t * @return {!o3d.Material} A phong material whose overall pigment is\n\t * baseColor.\n\t */\n\t function createMaterial(baseColor) {\n\t // Create a new, empty Material object.\n\t return o3djs.material.createBasicMaterial(g_pack, g_viewInfo, baseColor);\n\t }\n\n\t //functions to create the atoms for the lattice\n\t /**\n\t *@param string : symbol of the chemical element\n\t *this function returns the sphere shape associated with this element\n\t */\n\t function createSphereShapeBySymbol(symbol){\n\t \tvar indexOfElement=sym2no[symbol];\n\t \tvar colorOfElement=color[indexOfElement];\n\t \tcolorOfElement[3]=1;\n\t \tvar radiusOfElement=rvdw[indexOfElement];\n\t \t\n\t \tvar sphere = o3djs.primitives.createSphere(g_pack,\n\t \t\t\t\t\t\t\t\t\t\t\t\tcreateMaterial(colorOfElement),\n\t \t\t\t\t\t\t\t\t\t\t\t\tradiusOfElement, // Radius of the sphere.\n\t \t\t\t\t\t\t\t\t\t\t\t\t30, // Number of meridians.\n\t \t\t\t\t\t\t\t\t\t\t\t\t20); // Number of parallels.\n\t \treturn sphere;\n\t }\n\n\t /**\n\t * @param example: first is the symbol of the chemical element, secondly is the position in the lattice\n\t * [ ['Fe',[0.5,0.5,0.5]] , ['Fe', [0.3,0.4,0.3]] ]\n\t * this function returns a transformTable with the different shapes for the elements of the lattice\n\t */\n\t function createTransformTableForlattice(tableAtom){\n\t \tvar transformTable = [];\n\t \t\n\t \tfor( var i=0; i<tableAtom.length; i++){\n\t \t\tvar symbolEle=tableAtom[i][0];\n\t \t\tvar sphereShape=createSphereShapeBySymbol(symbolEle);\n\t \t\tvar elementPosition=tableAtom[i][1];\n\t \t\ttransformTable[i]={shape: sphereShape, translation: elementPosition};\n\t \t}\n\t \t\n\t \treturn transformTable;\n\t }\n\n\t /**\n\t *@param example: first is the symbol of the chemical element, secondly is the position in the lattice\n\t * [ ['Fe',[0.5,0.5,0.5]] , ['Fe', [0.3,0.4,0.3]] ]\n\t * this function displays the elements and the bonds of the lattice\n\t */\n\t function displayLatticeElement(tableAtom){\n\t \t//elements\t\n\t \tvar transformTableElements=createTransformTableForlattice(tableAtom);\n\t \t\t\n\t \tfor (var tt = 0; tt < transformTableElements.length; ++tt) {\n\t \t\tvar transformEle = g_pack.createObject('Transform');\n\t \t\ttransformEle.addShape(transformTableElements[tt].shape);\n\t \t\ttransformEle.translate(transformTableElements[tt].translation);\n\t \t\ttransformEle.parent = g_client.root;\n\t \t}\n\t }\n\n\t //functions needed to create bonds for the lattice\n\t /**\n\t *@param a=[.,.,.], b=[.,.,.] are the limits of the bonds\n\t *This function is used to calculate the lengh of the bond between two points\n\t */\n\t function getLengthBond(a,b){\n\t \tvar length=Math.sqrt(Math.pow((a[0]-b[0]),2)+Math.pow((a[1]-b[1]),2)+Math.pow((a[2]-b[2]),2));\n\t \treturn length;\t\n\t }\n\n\t /**\n\t *@param a=[.,.,.], b=[.,.,.] are the limits of the bonds\n\t *this function is used to calculate the translation needed to place the bond\n\t */\n\t function getTranslation(a,b){\n\t \tvar translation=[ (b[0]+a[0])/2, (b[1]+a[1])/2, (b[2]+a[2])/2 ];\n\t \treturn translation;\n\t }\n\n\t /**\n\t *@param a=[.,.,.], b=[.,.,.] are the limits of the bonds\n\t *this function is used to calculate the angle alpha (around the X axis) for the rotation of the bond\n\t */\n\t function getAlpha(a,b){\n\t \tvar normYZ=Math.sqrt( Math.pow( b[1]-a[1],2)+Math.pow( b[2]-a[2],2) );\n\t \tvar normXZ=Math.sqrt( Math.pow( b[0]-a[0],2)+Math.pow( b[2]-a[2],2) );\n\t \t\t\t\n\t \tif(normYZ==0){\n\t \t\treturn Math.PI/2;\n\t \t}\n\t \telse{\n\t \t\tif(normXZ==0){\n\t \t\t\treturn 0;\n\t \t\t}\n\t \t\telse{\n\t \t\t\tvar alpha=Math.acos((b[1]-a[1])/getLengthBond(a,b));\n\t \t\t\tif( (b[2]-a[2])<0 ){\n\t \t\t\t\treturn alpha+Math.PI;\n\t \t\t\t}\n\t \t\t\telse{\n\t \t\t\t\treturn alpha;\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \t\n\t \t/**\n\t \tif((b[1]-a[1])==0){\n\t \t\treturn Math.PI/2;\n\t \t}\n\t \telse{\n\t \t\tvar alpha=Math.atan((Math.sqrt(Math.pow(b[0]-a[0],2) + Math.pow(b[2]-a[2],2) ))/(b[1]-a[1]));\n\t \t\treturn alpha;\n\t \t}\n\t \t*/\n\t }\n\n\t /**\n\t *@param a=[.,.,.], b=[.,.,.] are the limits of the bonds\n\t *this function is used to calculate the angle beta (around the Y axis) for the rotation of the bond\n\t */\n\t function getBeta(a,b){\n\t \tvar normXZ=Math.sqrt( Math.pow( b[0]-a[0],2)+Math.pow( b[2]-a[2],2) );\n\t \tvar normYZ=Math.sqrt( Math.pow( b[1]-a[1],2)+Math.pow( b[2]-a[2],2) );\n\t \t\t\n\t \tif(normXZ==0){\n\t \t\treturn 0;\n\t \t}\n\t \telse{\n\t \t\tif(normYZ==0){\n\t \t\t\treturn Math.PI/2;\n\t \t\t}\n\t \t\telse{\n\t \t\t\tvar beta=Math.acos((b[0]-a[0])/normXZ);\n\t \t\t\tif( (b[2]-a[2])<0 ){\n\t \t\t\t\treturn Math.PI/2+beta;\n\t \t\t\t}\n\t \t\t\telse{\n\t \t\t\t\treturn Math.PI/2-beta;\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \t\n\t \t/**\n\t \tif((b[0]-a[0])==0){\n\t \t\treturn 0;\n\t \t}\n\t \telse{\n\t \t\tvar beta=Math.atan((b[2]-a[2])/(b[0]-a[0])); \n\t \t\treturn -( Math.PI/2-beta );\n\t \t}\n\t \t*/\n\t }\n\n\t //functions to create bonds for the lattice\n\t /**\n\t *\n\t */\n\t function createBondShape(a,b){\n\t \tvar length=getLengthBond(a,b);\n\t \t\n\t \tvar cylinder = o3djs.primitives.createCylinder(\n\t g_pack,\n\t createMaterial([0,0,1,1]),\n\t 0.1, // Radius.\n\t length, // Height.\n\t 20, // Number of radial subdivisions.\n\t 20); // Number of vertical subdivisions.\n\t \t\n\t \treturn cylinder;\n\t }\n\n\t /**\n\t *\n\t */\n\t function createTransformTableBonds(tableBonds){\n\t \tvar transformTableBonds = [];\n\t \t\n\t \tfor( var i=0; i<tableBonds.length; i++){\n\t \t\t\n\t \t\tvar a=tableBonds[i][0];\n\t \t\tvar b=tableBonds[i][1];\n\t \t\t\n\t \t\tvar bondShape=createBondShape(a,b);\n\t \t\tvar bondTranslation=getTranslation(a,b);\n\t \t\tvar bondRotation=[getAlpha(a,b), getBeta(a,b), 0];\n\t \t\t\n\t \t\ttransformTableBonds[i]={shape: bondShape, translation: bondTranslation, rotation: bondRotation};\n\t \t}\n\t \t\n\t \treturn transformTableBonds;\n\t }\n\n\n\t //functions to create the supercell\n\n\t //not used anymore\n\t /**\n\t *\n\t */\n\t function createSuperCell(sizeX, sizeY, sizeZ, tableLattice, tableAtom, tableBonds){\n\t \tvar expandTableAtom=[];\n\t \tvar expandTableBonds=[];\n\t \t\n\t \tfor(var expandX=0; expandX<sizeX; expandX++){\n\t \t\tfor(var expandY=0; expandY<sizeY; expandY++){\n\t \t\t\tfor(var expandZ=0; expandZ<sizeZ; expandZ++){\n\t \t\t\t\t//expansion of the table Atom\n\t \t\t\t\tfor(var indexTableAtom=0; indexTableAtom<tableAtom.length; indexTableAtom++){\n\t \t\t\t\t\tvar positionAtom=tableAtom[indexTableAtom][1];//initial position of the atom\n\t \t\t\t\t\tpositionAtom=translation(positionAtom, tableLattice[0],expandX);//translation along the X axis\n\t \t\t\t\t\tpositionAtom=translation(positionAtom, tableLattice[1],expandY);//translation along the Y axis\n\t \t\t\t\t\tpositionAtom=translation(positionAtom, tableLattice[2],expandZ);//translation along the Z axis\n\t \t\t\t\t\n\t \t\t\t\t\texpandTableAtom.push([tableAtom[indexTableAtom][0], positionAtom]);//positionAtom+translationVectorX*expandX+translationVectorY*expandY+translationVectorZ*expandZ\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t//expansion of the table Bonds\n\t \t\t\t\tfor(var indexTableBonds=0; indexTableBonds<tableBonds.length; indexTableBonds++){\n\t \t\t\t\t\tvar positionBond1=tableBonds[indexTableBonds][0];\n\t \t\t\t\t\tvar positionBond2=tableBonds[indexTableBonds][1];\n\t \t\t\t\t\t\n\t \t\t\t\t\tpositionBond1=translation(positionBond1, tableLattice[0],expandX);//translation along the X axis\n\t \t\t\t\t\tpositionBond1=translation(positionBond1, tableLattice[1],expandY);//translation along the Y axis\n\t \t\t\t\t\tpositionBond1=translation(positionBond1, tableLattice[2],expandZ);//translation along the Z axis\n\t \t\t\t\t\t\n\t \t\t\t\t\tpositionBond2=translation(positionBond2, tableLattice[0],expandX);//translation along the X axis\n\t \t\t\t\t\tpositionBond2=translation(positionBond2, tableLattice[1],expandY);//translation along the Y axis\n\t \t\t\t\t\tpositionBond2=translation(positionBond2, tableLattice[2],expandZ);//translation along the Z axis\n\t \t\t\t\t\t\n\t \t\t\t\t\texpandTableBonds.push([positionBond1,positionBond2]);\n\t \t\t\t\t}\t\t\t\t\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \treturn [expandTableAtom, expandTableBonds];\n\t }\n\n\t /**\n\t *this function is used to calculate the new position after a translation\n\t */\n\t function translation(point, vector, multiple){\n\t \tvar newPosition=[point[0]+vector[0]*multiple, point[1]+vector[1]*multiple, point[2]+vector[2]*multiple];\n\t \treturn newPosition;\n\t }\n\n\t //need to be updated\n\t /**\n\t *\n\t */\n\t function createTablePointsSupercell(tableLattice,sizeX, sizeY, sizeZ){\n\t \tvar tablePointsSupercell=[];\n\t \t\n\t \tfor(var indexY=0; indexY<sizeY+1; indexY++){\n\t \t\tfor(var indexZ=0; indexZ<sizeZ+1; indexZ++){\n\t \t\t\tvar point1=translation([0,0,0], tableLattice[1], indexY);\n\t \t\t\tpoint1=translation(point1, tableLattice[2], indexZ);\n\t \t\t\t\n\t \t\t\t//translation to the center of the lattice\n\t \t\t\tpoint1=translation(point1, tableLattice[0], -sizeX/2);\n\t \t\t\tpoint1=translation(point1, tableLattice[1], -sizeY/2);\n\t \t\t\tpoint1=translation(point1, tableLattice[2], -sizeZ/2);\n\t \t\t\t\n\t \t\t\tvar point2=translation([0,0,0], tableLattice[0], sizeX);\n\t \t\t\tpoint2=translation(point2, tableLattice[1], indexY);\n\t \t\t\tpoint2=translation(point2, tableLattice[2], indexZ);\n\t \t\t\t\n\t \t\t\t//translation to the center of the lattice\n\t \t\t\tpoint2=translation(point2, tableLattice[0], -sizeX/2);\n\t \t\t\tpoint2=translation(point2, tableLattice[1], -sizeY/2);\n\t \t\t\tpoint2=translation(point2, tableLattice[2], -sizeZ/2);\n\t \t\t\t\n\t \t\t\ttablePointsSupercell.push([point1, point2]);\n\t \t\t}\n\t \t}\n\t \t\n\t \tfor(var indexX=0; indexX<sizeX+1; indexX++){\n\t \t\tfor(var indexY=0; indexY<sizeY+1; indexY++){\n\t \t\t\tvar point1=translation([0,0,0], tableLattice[0], indexX);\n\t \t\t\tpoint1=translation(point1, tableLattice[1], indexY);\n\t \t\t\t\n\t \t\t\t//translation to the center of the lattice\n\t \t\t\tpoint1=translation(point1, tableLattice[0], -sizeX/2);\n\t \t\t\tpoint1=translation(point1, tableLattice[1], -sizeY/2);\n\t \t\t\tpoint1=translation(point1, tableLattice[2], -sizeZ/2);\n\t \t\t\t\t\t\t\n\t \t\t\tvar point2=translation([0,0,0], tableLattice[2], sizeZ);\n\t \t\t\tpoint2=translation(point2, tableLattice[0], indexX);\n\t \t\t\tpoint2=translation(point2, tableLattice[1], indexY);\n\t \t\t\t\n\t \t\t\t//translation to the center of the lattice\n\t \t\t\tpoint2=translation(point2, tableLattice[0], -sizeX/2);\n\t \t\t\tpoint2=translation(point2, tableLattice[1], -sizeY/2);\n\t \t\t\tpoint2=translation(point2, tableLattice[2], -sizeZ/2);\n\t \t\t\t\t\t\t\n\t \t\t\ttablePointsSupercell.push([point1, point2]);\n\t \t\t}\n\t \t}\n\t \t\n\t \tfor(var indexX=0; indexX<sizeX+1; indexX++){\n\t \t\tfor(var indexZ=0; indexZ<sizeZ+1; indexZ++){\n\t \t\t\tvar point1=translation([0,0,0], tableLattice[0], indexX);\n\t \t\t\tpoint1=translation(point1, tableLattice[2], indexZ);\n\t \t\t\t\n\t \t\t\t//translation to the center of the lattice\n\t \t\t\tpoint1=translation(point1, tableLattice[0], -sizeX/2);\n\t \t\t\tpoint1=translation(point1, tableLattice[1], -sizeY/2);\n\t \t\t\tpoint1=translation(point1, tableLattice[2], -sizeZ/2);\n\t \t\t\t\t\t\t\n\t \t\t\tvar point2=translation([0,0,0], tableLattice[1], sizeY);\n\t \t\t\tpoint2=translation(point2, tableLattice[0], indexX);\n\t \t\t\tpoint2=translation(point2, tableLattice[2], indexZ);\n\t \t\t\t\n\t \t\t\t//translation to the center of the lattice\n\t \t\t\tpoint2=translation(point2, tableLattice[0], -sizeX/2);\n\t \t\t\tpoint2=translation(point2, tableLattice[1], -sizeY/2);\n\t \t\t\tpoint2=translation(point2, tableLattice[2], -sizeZ/2);\n\t \t\t\t\t\t\t\n\t \t\t\ttablePointsSupercell.push([point1, point2]);\n\t \t\t}\n\t \t}\n\t \t\n\t \treturn tablePointsSupercell;\n\t }\n\n\t /**\n\t *this function creates a red line between two given points\n\t */\n\t function createShapeForSupercellLine(point1,point2){\n\t \tvar pack=g_pack;\n\t \tvar colorOrTexture=[1,0,0,1];\n\t \t\t\n\t \tvar material=o3djs.material.createConstantMaterial(g_pack,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\tg_viewInfo,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorOrTexture);\n\t \tvar vertices = [\n\t \t\tpoint1[0], point1[1], point1[2],// vertex 0\n\t \t\tpoint2[0], point2[1], point2[2]//vertex 1\n\t ];\n\t \t\n\t \tvar indices = [\n\t 0, 1 // line 1\n\t \t];\n\t \t\n\t \tvar shape = o3djs.debug.createLineShape(\n\t \t\t\t\t\tg_pack,\n\t material,\n\t vertices,\n\t indices);\n\t \treturn shape;\n\t }\n\n\t /**\n\t *\n\t */\n\t function createTransformTableSupercell(tableLattice, sizeX, sizeY, sizeZ){\n\t \tvar transformTableSupercell = [];\n\t \t\n\t \tvar tablePointsSupercell=createTablePointsSupercell(tableLattice, sizeX, sizeY, sizeZ);\n\t \t\n\t \tfor( var i=0; i<tablePointsSupercell.length; i++){\n\t \t\t\n\t \t\tvar point1=tablePointsSupercell[i][0];\n\t \t\tvar point2=tablePointsSupercell[i][1];\n\t \t\t\n\t \t\tvar lineShape=createShapeForSupercellLine(point1,point2);\n\t \t\t\n\t \t\ttransformTableSupercell[i]={shape: lineShape};\n\t \t}\n\t \t\n\t \treturn transformTableSupercell;\n\t \t\n\t }\n\n\t //functions for the management of the user----------------------------------------------\n\t /**\n\t * Zooms the scene in / out by changing the viewpoint.\n\t * @param {number} zoom zooming factor.\n\t */\n\t function ZoomInOut(zoom) {\n\t for (var i = 0; i < g_eyeView.length; i += 1) {\n\t g_eyeView[i] = g_eyeView[i] / zoom;\n\t }\n\n\t g_viewInfo.drawContext.view = g_math.matrix4.lookAt(\n\t g_eyeView, // eye.\n\t [0, 0, 0], // target.\n\t [0, 1, 0]); // up.\n\t }\n\n\t /**\n\t * Start mouse dragging.\n\t * @param {event} e event.\n\t */\n\t function startDragging(e) {\n\t detectSelectionCell(e);\n\t g_lastRot = g_thisRot;\n\n\t g_aball.click([e.x, e.y]);\n\t g_dragging = true;\n\t }\n\n\t /**\n\t * Use the arcball to rotate the scene.\n\t * Computes the rotation matrix.\n\t * @param {event} e event.\n\t */\n\t function drag(e) {\n\t if (g_dragging) {\n\t var rotationQuat = g_aball.drag([e.x, e.y]);\n\t var rot_mat = g_quaternions.quaternionToRotation(rotationQuat);\n\n\t g_thisRot = g_math.matrix4.mul(g_lastRot, rot_mat);\n\t var m = g_sceneRoot.localMatrix;\n\t g_math.matrix4.setUpper3x3(m, g_thisRot);\n\t g_sceneRoot.localMatrix = m;\n\t }\n\t }\n\n\t /**\n\t * Stop dragging.\n\t * @param {event} e event.\n\t */\n\t function stopDragging(e) {\n\t g_dragging = false;\n\t }\n\n\t /**\n\t * Using the mouse wheel zoom in and out of the scene.\n\t * @param {event} e event.\n\t */\n\t function scrollMe(e) {\n\t var zoom = (e.deltaY < 0) ? 1 / g_zoomFactor : g_zoomFactor;\n\t ZoomInOut(zoom);\n\t g_client.render();\n\t }\n\t \n\t /**\n\t * Removes any callbacks so they don't get called after the page has unloaded.\n\t */\n\t function uninit() {\n\t if (g_client) {\n\t g_client.cleanup();\n\t }\n\t }\n\t \n function createViewContainer() {\n var table = tag('table'); table.addClass('o3d-scence-container');\n table.width(800); table.height(800);\n \n var tr = tag('tr'); table.append(tr);\n\n var td = tag('td'); tr.append(td);\n td.css('height', '100%');\n \n var div = tag('div', {id:'o3d'}); td.append(div);\n div.css('width', '100%');\n div.css('height', '100%');\n\n var loading = tag('div', {id:'loading'}); td.append(loading);\n loading.css('color', 'red');\n return table;\n }\n\n var container = createViewContainer();\n container.bind('append', initClient);\n container.unload(uninit);\n //var body = $('body');\n //body.load(init); body.unload(uninit);\n return container;\n }", "title": "" }, { "docid": "97bb440237ce9ad9c230252612ea093b", "score": "0.5753555", "text": "Main() {\n this.addChild(this._platform);\n //this.addChild(this._badguy);\n this._sonic = new objects.Hero(this.assetManager, 1 * 18);\n this.player = this._sonic;\n this.addChild(this._sonic);\n this._sonic.myScene = this;\n this._sonic.x = this._rx;\n this._sonic.y = this._ry;\n this.collisionmanager = new managers.Collision();\n //this._platform = new objects.Platform(this.assetManager);\n //this._badguy = new objects.Enemy(this.assetManager);\n this.bulletobjectpool = new Array();\n for (var i = 0; i < 150; i++) {\n var b;\n b = new objects.Bullet(this.assetManager);\n this.bulletobjectpool.push(b);\n this.addChild(b);\n //console.log (\"created bullet\");\n }\n this.enemybulletobjectpool = new Array();\n for (var i = 0; i < 150; i++) {\n var eb;\n eb = new objects.eBullet(this.assetManager);\n this.enemybulletobjectpool.push(eb);\n this.addChild(eb);\n //console.log (\"created ebullet\");\n }\n }", "title": "" }, { "docid": "496fa69273f80eab799259c7cf7bf0c3", "score": "0.57497305", "text": "function initNavControl() {\n var currentImg = null;\n var imageSendingPaused = false;\n\n app.get(\"/image/:id\", function(req, res) {\n res.writeHead(200, {\n \"Content-Type\": \"image/png\"\n });\n return res.end(currentImg, \"binary\");\n });\n\n // Drone client\n var drone = require(\"ar-drone\").createClient();\n drone.config('general:navdata_demo', 'TRUE');\n drone.animateLeds('blinkRed', 5, 2);\n\n // Socket\n var io = require('socket.io')(http);\n\n io.on('connection', function(socket) {\n console.log('a user connected');\n\n socket.on(\"move\", function(cmd) {\n var _name;\n console.log(\"move\", cmd);\n return typeof drone[_name = cmd.action] === \"function\" ? drone[_name](cmd.speed) : void 0;\n });\n socket.on(\"animate\", function(cmd) {\n console.log('animate', cmd);\n return drone.animate(cmd.action, cmd.duration);\n });\n socket.on(\"command\", function(cmd) {\n var _name;\n console.log('drone command: ', cmd);\n return typeof drone[_name = cmd.action] === \"function\" ? drone[_name]() : void 0;\n });\n drone.on('navdata', function(data) {\n return io.emit(\"navdata\", data);\n });\n drone.createPngStream().on(\"data\", function(frame) {\n currentImg = frame;\n if (imageSendingPaused) {\n return;\n }\n io.emit(\"image\", \"/image/\" + (Math.random()));\n imageSendingPaused = true;\n return setTimeout((function() {\n return imageSendingPaused = false;\n }), 100);\n });\n\n socket.on('disconnect', function() {\n console.log('user disconnected');\n });\n });\n}", "title": "" }, { "docid": "1d442505fbb62261094208aec37a0b52", "score": "0.5735782", "text": "function crearSocket(scene) {\n scene.socket = io();\n scene.socket.on(\"tweet_player_1\", (tweet) => {\n console.log(tweet.screenName);\n scene.cervezas.player1.subir(40);\n crearChancho(scene, tweet.screenName);\n });\n scene.socket.on(\"tweet_player_2\", (tweet) => {\n console.log(tweet.screenName);\n scene.cervezas.player1.subir(40);\n crearChancho(scene, tweet.screenName);\n });\n }", "title": "" }, { "docid": "5f9a4bcbb92b05e16dd5c91b1b010751", "score": "0.5727317", "text": "function SocketHandler() {\n // Add the event handler for mouse , movement.\n window.addEventListener('mousemove', updateMousePos, false);\n // key up event, que a input with state and key.\n\n document.onkeydown = function(event) {\n queueInput(event.keyCode, 1);\n }\n\n // key down event, que a input with state and key.\n document.onkeyup = function(event) {\n queueInput(event.keyCode, 0);\n }\n\n document.onmouseup = function(event) {\n queueInput(-2, 0);\n }\n\n document.onmousedown = function(event) {\n queueInput(-2, 1);\n }\n\n\n socket.onmessage = function(message) {\n let str = new TextDecoder('utf-8').decode(message.data);\n let data = JSON.parse(str);\n // The value of Data.t denotes the type of message.\n\n // Type: 'd' -> Game canvas draw message.\n if (data.t === 'd') {\n renderFrame(data.d, data.p);\n playSoundQueue(data.s);\n }\n // Type: 't' -> Draw Text-string message.\n else if (data.t == 't') {\n drawText(data.s, data.f, data.k, data.c, data.p[0], data.p[1]);\n }\n // Type : 's' -> Play-sound message.\n else if (data.t === 's') {\n playSound(data.s);\n }\n // Type: 'c' -> Clear Text-string message.\n else if (data.t === 'c') {\n clearText(data.k);\n }\n // Type: 'b' -> Background Image message. \n else if (data.t === 'b') {\n setBackground(data.i);\n }\n // Type 'x' -> Stop Sound message.\n else if (data.t === 'x') {\n stopSound(data.s);\n }\n // Type: 'g' -> Background gradient message. \n else if (data.t === 'g') {\n setGradient(data.c1, data.c2);\n }\n // Type: 'K' -> Save Levle message.\n else if (data.t === 'k') {\n alert(data.m);\n }\n else if (data.t === 'm') {\n musicOn = !musicOn;\n }\n\n /*\n TODO add more message types here... Sounds, ect.\n i.e: \n else if (data.t === 's') {\n playSound(data.d);\n }\n */\n\n }\n}", "title": "" }, { "docid": "4909e8f97454a93adbee288347032e3e", "score": "0.5724417", "text": "function mainGame(gameData){\n\n //Init game scene\n Crafty.init(720, 720, document.getElementById('game'));\n $('#game').addClass('gameGo');\n $('body').prepend($('<div></div>').attr({id: 'UI'}));\n\n //Init map Here\n mapGenerator();\n\n //Init all player entities once all sprites are loaded\n Crafty.load(sprites, function(){\n $('#splashImage1').attr({hidden: true});\n addPlayers(gameData.playerData);\n //Add client event listeners\n handlePlayerInput();\n\n //updateNonEventCausedPlayerMovement();\n socket.on('playerMovement', function(data){\n updatePlayerPositions(data);\n });\n\n socket.on('playerJumper', function(data){\n PLAYER_ENTITIES[data.playerID].jump();\n });\n\n socket.on('playerClicked', function(data){\n PLAYER_ENTITIES[data.playerID].fireWeaponAt(data.x, data.y);\n });\n\n socket.on('playerConfirmHit', function(data){\n PLAYER_ENTITIES[data.playerID].onDamage(data.health);\n });\n\n socket.on('playerDead', function(data){\n PLAYER_ENTITIES[data.playerID].die();\n });\n\n socket.on('EndGame', function(data){\n gameOver(data.winnerID);\n });\n\n });\n\n}", "title": "" }, { "docid": "a6e390e834316ec2d08e3cc34b68f63d", "score": "0.57237285", "text": "function draw() {\n // Receiving server messages\n socket.on(\"id\", function(data) {\n myId = data;\n })\n socket.on(\"ships\", function(data) {\n otherShips = data;\n for (var i = 0; i < otherShips.length; i++) {\n otherShips[i].pos = createVector(otherShips[i].x, otherShips[i].y);\n }\n })\n socket.on(\"shots\", function(data) {\n otherShots = [];\n for (var i = 0; i < data.length; i++) {\n otherShots.push(data[i]);\n }\n })\n socket.on(\"asteroids\", function(data) {\n asteroids = [];\n for (var i = 0; i < data.length; i++) {\n asteroids.push(new Asteroid(data[i]));\n }\n })\n socket.on(\"playerHit\", function(data) {\n if (data == myId) {\n ship.exploded = true;\n }\n })\n // Client functions\n background(0, 0, 0);\n for (var i = 0; i < asteroids.length; i++) {\n asteroids[i].show();\n asteroids[i].update();\n asteroids[i].checkEdges();\n if (ship.hits(asteroids[i])) {\n ship.exploded = true;\n }\n }\n shotsData = [];\n for (var i = shots.length - 1; i >= 0; i--) {\n if (!shots[i].toRemove) {\n shotsData.push({\n id: myId,\n x: shots[i].pos.x,\n y: shots[i].pos.y\n });\n shots[i].show();\n shots[i].update();\n shots[i].checkEdges();\n for (var j = asteroids.length - 1; j >= 0; j--) {\n if (shots[i].hits(asteroids[j])) {\n shots[i].toRemove = true;\n var points = floor(map(asteroids[j].r, 64, 8, 1, 10));\n score += points;\n socket.emit(\"asteroids\", j);\n break;\n }\n }\n for (var k = otherShips.length - 1; k >= 0; k--) {\n if (shots[i].hits(otherShips[k]) && otherShips[k].id != myId) {\n shots[i].toRemove = true;\n score += 25;\n socket.emit(\"playerHit\", otherShips[k].id);\n break;\n }\n }\n } else {\n shots.splice(i, 1);\n }\n }\n for (var i = 0; i < otherShots.length; i++) {\n if (otherShots[i].id != myId) {\n showOtherShot(otherShots[i]);\n }\n }\n for (var i = 0; i < otherShips.length; i++) {\n if (!otherShips[i].exploded && otherShips[i].id != myId) {\n showOtherShip(otherShips[i]);\n }\n }\n for (var i = 0; i < asteroids.length; i++) {\n asteroids[i].show();\n asteroids[i].update();\n asteroids[i].checkEdges();\n }\n if (!ship.exploded) {\n ship.show();\n ship.update();\n ship.checkEdges();\n }\n fill(255);\n textSize(width / 32);\n text(\"Score: \" + score.toString(), 0, 0, 100);\n var data = {\n ship: {\n x: ship.pos.x,\n y: ship.pos.y,\n r: ship.r,\n heading: ship.heading,\n exploded: ship.exploded,\n boosting: ship.boosting\n },\n shots: shotsData\n };\n socket.emit(\"update\", data);\n}", "title": "" }, { "docid": "ef7aa74cf69403e655f7a49d4494cba7", "score": "0.5717541", "text": "function initGame()\n{\n\tconsole.log(\"-=Loading Copland OS Enterprise=-\");\n\t//Init classes.\n\tconsole.log(\"Initializing classes...\");\n\tinitClasses();\n\t\n\tEntities.push(new Player());\n\tEntities.push(new BackgroundFireball());\n\tEntities.push(new BackgroundFireball());\n\tEntities.push(new BackgroundFireball());\n\t\n\tconsole.log(\"Starting game loop...\");\n\tsetInterval(GameLoop, 10);\n\t\n\t//Get canvas element.\n\tconsole.log(\"Retrieving canvas element...\");\n\tGameCanvas = document.getElementById(\"GameCanvas\");\n\tGameCanvasCxt = GameCanvas.getContext('2d');\n\t\n\t//Add keyboard event listeners.\n\tconsole.log(\"Adding keyboard event listeners...\");\n\tdocument.addEventListener(\"keydown\", readControlsDown, false);\n\tdocument.addEventListener(\"keyup\", readControlsUp, false);\n\t\n\tGameCanvasCxt.imageSmoothingEnabled = false;\n\tGameCanvasCxt.fillStyle = \"#FF0000\";\n\tGameCanvasCxt.fillRect(0, 0, GameCanvas.width, GameCanvas.height);\n\t\n\tGameCanvasCxt.fillStyle = \"#0000FF\";\n\tGameCanvasCxt.font = \"30px Arial\";\n\tGameCanvasCxt.fillText(\"HELLO, NAVI.\", 10, 50);\n\t\n\tGameCanvasCxt.drawImage(Entities[0].getSprite(), 0, 0);\n\tconsole.log(\"Login accepted. Hello, Lain.\");\n\t//generateLevel();\n\t\n\tRRSound = new Audio(\"Audio/RRNoise.ogg\");\n\t\n\t/*\n\t<!--Thanks to shooting_sparks on StackOverflow for this one!-->\n\tRRSound.addEventListener(\"timeupdate\", function() {\n\t\tvar buffer = 1;\n\t\tif (this.currentTime > this.duration - buffer)\n\t\t{\n\t\t\tthis.currentTime = 0;\n\t\t\tthis.play();\n\t\t}\t\n\t}, false);\n\tdocument.getElementById(\"GameMusic\").addEventListener(\"timeupdate\", function() {\n\t\tvar buffer = 1;\n\t\tif (this.currentTime > this.duration - buffer)\n\t\t{\n\t\t\tthis.currentTime = 0;\n\t\t\tthis.play();\n\t\t}\t\n\t}, false);\n\t*/\n\tEntities.push(new SNR());\n\t\n\t//RRSound.play();\n\t\n\t//AudioGen.type = \"square\";\n\t//AudioGen.frequency.value = 440;\n\t//AudioGen.connect(AudioVol);\n\t//AudioVol.gain.value = 0.05;\n\t//AudioVol.connect(AudioCtx.destination);\n\t//AudioGen.start();\n\t\n\t//TODO: Create initSurvival function.\n}", "title": "" }, { "docid": "dfe07ba444a38288504ad2d4898d0032", "score": "0.5717435", "text": "function joinGame(){\n socket.emit('joinGame');\n }", "title": "" }, { "docid": "f65741cf9a1686a4e2319e965256c00a", "score": "0.5716481", "text": "openConnection() {\n this.app.post('/initializeConnection', (req, res) => {\n let newPlayer = new Player(req.body.name);\n newPlayer.setupPlayer(this.game.board);\n this.game.players.push(newPlayer);\n this.game.board.markMoveOnBoard(newPlayer);\n this.updateBrowser();\n this.eventEmitter.on('emitGameStart', (msg) => {\n res.send(true);\n });\n });\n this.app.get('/getCurrentState', (req, res) => {\n res.send(JSON.stringify(this.game));\n });\n this.app.post('/move', (req, res) => {\n let playerName = req.body.name;\n let playerMove = req.body.input;\n let stillInGame = true;\n this.game.players.forEach((player) => {\n stillInGame = player.isInGame;\n player.name == playerName ? player.direction = playerMove : \"\";\n });\n res.send(stillInGame);\n });\n\n this.io.on('connection', (socket) => {\n socket.on('gameStart', (data) => {\n this.emitEvent('emitGameStart');\n this.changeGameState(\"RUNNING\");\n this.logMesssage(`Game started, number of players: ${this.game.players.length}`);\n this.nextTurn();\n });\n });\n }", "title": "" }, { "docid": "ea632584a82a6dfc93bb8b074d142a18", "score": "0.5713191", "text": "function main() {\n game = new createjs.Container();\n menus = new states.menu();\n play = new states.Play();\n gameover = new states.gameover();\n stage.addChild(game);\n}", "title": "" }, { "docid": "676fd1f1c217713e075dceb1681921ae", "score": "0.57027656", "text": "_updatePhysics() {\n const players = this.omitTeam(Room.Teams.SPECTATORS);\n const entities = _.concat(players, this.balls);\n\n // Socket data [x, y, r, flag, mouse_position_x, mouse_position_y]\n let packSize = 6,\n socketData = new Float32Array(entities.length * packSize);\n\n _.each(entities, (entity, index) => {\n let circle = entity.body.circle,\n v = entity.body.v,\n isBall = entity.body.type === BoardBody.TYPES.BALL;\n // isMedic = entity.body.type === Medic;\n // isJacinda = entity.body.type === Jacinda;\n // Hack change, change back when class types are defined\n var isMedic = false;\n var isJacinda = false;\n\n // Check collisions between players\n if (!isBall) this._checkPlayerCollisions(entities, index);\n\n // Check collisions between balls and players/balls\n if (isBall) this._checkBallCollisions(entities, index);\n\n // Check collisions with goals\n\n // // If its colliding with goal\n // if(collidingGoal) {\n // this._addGoal(collidingGoal);\n // return false;\n // }\n // }\n\n // Check collisions with borders\n this._calcBordersCollisions(entity.body, !isBall && 64);\n\n // Update physics\n circle.add(v);\n v.mul(0.95);\n\n // Data structure: 0FFFFBRR\n let flags = entity.team | (isBall && 1 << 2) | (entity.flags << 3);\n\n let mouse_pos_x = entity.mouse_position_x || 0.0;\n let mouse_pos_y = entity.mouse_position_y || 0.0;\n socketData.set(\n [\n /** position */\n circle.x,\n circle.y,\n circle.r,\n flags,\n mouse_pos_x,\n mouse_pos_y /** todo: More flags */,\n ],\n index * packSize\n );\n //\n ///**\n // * Data in buffer is compressed, player must\n // * know which from the list is player\n // * todo: Fix it, merge with roomSettings\n // */\n //player.socket(\"roomPlayerIndex\", index);\n });\n\n // Broadcast\n this.broadcast(\"roomUpdate\", socketData.buffer);\n }", "title": "" }, { "docid": "b07edb09404c47ad0ff9edaf4317444e", "score": "0.57010376", "text": "onHost() {\n console.log('attemtping to host new game');\n IO.socket.emit('hostCreateGame');\n }", "title": "" }, { "docid": "2b8efb4e5b38b5000789dc537510a183", "score": "0.5700433", "text": "scenechange(){\n\t\tif(this.posArray==0 && this.check){\n\t\t\tthis.scene.start('CharapterSelection');\n\t\t}else if(this.posArray==1 && this.check){\n\t\t\tthis.scene.start('Lobby');\n\t\t}else if(this.posArray==2 && this.check){\n\t\t\tthis.scene.start('ControlGuide');\n\t\t}\n\t}", "title": "" }, { "docid": "89bd60ab1dedda7a483687fbadd792fd", "score": "0.56940013", "text": "function setUpMessages()\n{\n\tconsole.log(\"registering socket callbacks...\");\n\tmixer.socket.on('event', function(message) {\n\t\t//\tjust echo whatever we got\n\t\tvar txt = \"*** EVENT: \" + message.code;\n\t\tif (message.variant)\n\t\t\ttxt += \" + \" + message.variant;\n\t\tscreenLog(txt);\n\t\t\n\t\t//console.log(message);\n\t});\n\t\n\tmixer.socket.on('onSceneUpdate', function(message){\n\t\tscreenLog(\"*** scene update\");\n\t});\n\n\tmixer.socket.on('onParticipantUpdate', function(message){\n\t\tvar pe = message.participants[0];\n\t\t\n\t\tscreenLog(\"*** PARTICIPANT update: -> clicks from me: \" + pe.clicks);\n\t\t\n\t\t//console.log(pe);\n\t});\n\t\n\tmixer.socket.on('onParticipantJoin', function(message){\n\t\tscreenLog(\"*** participant join\");\n\t});\n\t\t\t\t \n\tmixer.socket.on('onControlUpdate', function(message) {\n\t\tscreenLog(\"*** CONTROL update\");\n\t\tvar controlList = message.controls;\n\t\tconsole.log(\" \" + controlList.length);\n\t\tfor (var i = 0; i < controlList.length; i++)\n\t\t{\n\t\t\tvar c = controlList[i];\n\t\t\tconsole.log(\" id : \" + c.controlID);\n\t\t\tif (c.controlID === 'anchor')\n\t\t\t{\n\t\t\t\tif (c.numGlobalClicks)\t//\tif there's anything stored there.\n\t\t\t\t{\n\t\t\t\t\tscreenLog(\" -> num global clicks: \" + c.numGlobalClicks);\n\t\t\t\t}\n\t\t\t} else if (c.controlID === 'my_first_button')\n\t\t\t{\n\t\t\t\tconsole.log(\"**************************** GRR! OVERWRITTEN DEFAULT CONTROLS\");\n\t\t\t}\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "0135972760fbc657be11f3dd502e2429", "score": "0.569073", "text": "function initScene(){\n\tinitSceneOptions();\n\tinitCamera();\n\tinitElementArrays();\n\tinitLight();\n\tinitColours();\n\tinitSceneObjects();\n\tbuildObjects();\n\tinitFaces();\n\tinitMovingPoints();\n\tinitCustom();\n}", "title": "" }, { "docid": "67e18e97b4c13b44699ca2826156ba27", "score": "0.5686393", "text": "function configureGameController ( io ) {\n\n let currentColor = 'white';\n\n io.on('connection', socket => {\n console.log('A user is connected');\n\n socket.on('join-game', username => {\n socket.username = username;\n\n if (playersQueue.length == 0) {\n playersQueue.push(socket);\n return;\n } \n \n let player1 = playersQueue.shift(),\n player2 = socket,\n\t\t gameSessionId = uuidv4();\n\t\t\n if (!player1.connected) {\n playersQueue.push(player2);\n return;\n }\n\n player1.join(gameSessionId);\n player2.join(gameSessionId);\n\n pendingGameSessions.set(gameSessionId, false);\n\n io.to(player1.id).emit('game-ready', {\n gameSessionId: gameSessionId,\n color: 0\n });\n\n io.to(player2.id).emit('game-ready', {\n gameSessionId: gameSessionId,\n color: 1\n });\n \n });\n\n socket.on('init-board', data => {\n let initBoard = pendingGameSessions.get(data.gameSessionId);\n if (initBoard) {\n \n io.to(data.gameSessionId).emit('board', {\n board: initBoard,\n turn: 0\n });\n\n io.to(data.gameSessionId).emit('message', {\n from: 'system',\n text: 'Game start. White\\'s turn.',\n type: 'notification',\n gameSessionId: data.gameSessionId\n });\n\n pendingGameSessions.delete(data.gameSessionId);\n } else {\n pendingGameSessions.set(data.gameSessionId, data.board);\n }\n });\n \n io.to(socket.id).emit('set-color', currentColor);\n currentColor = currentColor === 'white' ? 'black' : 'white';\n\n socket.on('send-board', data => {\n console.log(`New board: ${ JSON.stringify(data) }`);\n io.to(data.gameSessionId).emit('board', data);\n\n io.to(data.gameSessionId).emit('message', {\n from: 'system',\n text: `${ data.turn ? 'Black' : 'White' }'s turn.`,\n type: 'notification',\n gameSessionId: data.gameSessionId\n });\n\n });\n\n socket.on('make-move', move => {\n console.log(`Move made: ${ move }`);\n io.emit('move-piece', move);\n });\n\n socket.on('new-message', msg => {\n console.log(`New message: ${ msg }`);\n io.to(msg.gameSessionId).emit('message', {from: socket.username, ...msg});\n });\n\n socket.on('disconnect', () => {\n console.log('User disconnected.');\n });\n });\n\n}", "title": "" }, { "docid": "7c4953afbdc0aa1b4288662592ef7238", "score": "0.56794506", "text": "start () { this.connection.emit(\"game:start\"); }", "title": "" }, { "docid": "6b3825f78ae4ed0f624adc32ce3cf1ac", "score": "0.5670574", "text": "function changeScene() {\n // Launch various scenes\n switch (scene) {\n case config.Scene.MENU:\n // show the MENU scene\n stage.removeAllChildren();\n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n break;\n case config.Scene.INSTRUCTION:\n // show the INSTRUCTION scene\n stage.removeAllChildren();\n instruction = new scenes.Instruction();\n currentScene = instruction;\n console.log(\"Starting INSTRUCTION Scene\");\n break;\n case config.Scene.LEVEL1:\n // show the LEVEL1 scene\n stage.removeAllChildren();\n level1 = new scenes.Level1();\n currentScene = level1;\n console.log(\"Starting LEVEL1 Scene\");\n break;\n case config.Scene.LEVEL2:\n // show the LEVEL2 scene\n stage.removeAllChildren();\n level2 = new scenes.Level2();\n currentScene = level2;\n console.log(\"Starting LEVEL2 Scene\");\n break;\n case config.Scene.LEVEL3:\n // show the LEVEL3 scene\n stage.removeAllChildren();\n level3 = new scenes.Level3();\n currentScene = level3;\n console.log(\"Starting LEVEL3 Scene\");\n break;\n case config.Scene.END:\n // show the END scene\n stage.removeAllChildren();\n end = new scenes.End();\n currentScene = end;\n console.log(\"Starting END Scene\");\n break;\n case config.Scene.VICTORY:\n // show the END scene\n stage.removeAllChildren();\n victory = new scenes.Victory();\n currentScene = victory;\n console.log(\"Starting VICTORY Scene\");\n break;\n }\n}", "title": "" }, { "docid": "ab9317c7fa4160c7659ece3915e009a0", "score": "0.5665435", "text": "function sceneManager () {\n switch (scene) {\n case \"titleScreen\":\n // scene = \"introScene\";\n // touchToContinue();\n break;\n \n\n case \"intro\":\n displayText = grammar.flatten(\"#opening#\");\n // touchToContinue();\n backgroundAudio(\"play\");\n displayText = textFilter(displayText);\n scene = \"sceneOne\";\n break;\n \n\n case \"sceneOne\":\n continueButton.hide();\n userInput();\n displayText = grammar.flatten(\"#sceneOne#\");\n displayText = textFilter(displayText);\n scene = \"questionOne\";\n break;\n\n case \"sceneTwo\":\n displayText = grammar.flatten(\"#sceneThree#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneThree\";\n break;\n \n case \"sceneThree\":\n displayText = grammar.flatten(\"#sceneFour#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneFour\";\n break;\n\n case \"sceneFour\":\n displayText = grammar.flatten(\"#sceneFive#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneFive\";\n break;\n\n case \"sceneFive\":\n continueButton.hide();\n input.show();\n displayText = grammar.flatten(\"#questionFour#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"questionFour\";\n break;\n\n case \"sceneSix\":\n displayText = grammar.flatten(\"#sceneSeven#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneSeven\";\n break;\n\n case \"sceneSeven\":\n displayText = grammar.flatten(\"#sceneEight#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneEight\";\n break;\n\n case \"sceneEight\":\n displayText = grammar.flatten(\"#sceneNine#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneNine\";\n break;\n\n case \"sceneNine\":\n displayText = grammar.flatten(\"#sceneTen#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"sceneTen\";\n break;\n\n case \"sceneTen\":\n displayText = grammar.flatten(\"#endingOne#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText += \"\\n\" + \"\\n\" + \"Run\";\n displayText = textFilter(displayText);\n scene = \"endingOne\";\n break;\n\n case \"endingOne\":\n displayText = grammar.flatten(\"#endingTwo#\");\n wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText += \"\\n\" + \"\\n\" + \"GET OUT NOW\";\n displayText = textFilter(displayText);\n scene = \"endingTwo\";\n break;\n\n case \"endingTwo\":\n continueButton.hide();\n input.show();\n displayText = grammar.flatten(\"#endingQuestion#\");\n // wholeStory += displayText + \"\\n\" + \"\\n\";\n displayText = textFilter(displayText);\n scene = \"endingQuestion\";\n break;\n\n case \"endingThree\":\n continueButton.hide();\n saveStoryButton();\n displayText = grammar.flatten(\"#endingFour#\");\n displayText = textFilter(displayText);\n // wholeStory += displayText + \"\\n\" + \"\\n\";\n // scene = \"endingFour\";\n break;\n\n case 6:\n displayText = grammar.flatten(\"#dreamSequence#\");\n scene = 7;\n break;\n\n case 7:\n continueButton.hide();\n displayText = grammar.flatten(\"#beginning#\");\n saveStoryButton();\n break;\n\n case 50:\n displayText = grammar.flatten(\"#warning#\");\n scene = 51;\n break;\n\n case 51:\n displayText = grammar.flatten(\"#warning.capitalize#\");\n scene = 52;\n break;\n\n case 52:\n displayText = grammar.flatten(\"#warning.capitalizeAll#\");\n scene = 53;\n break;\n \n default:\n }\n }", "title": "" }, { "docid": "067b01610e0ce829afb7a939a6fd6d81", "score": "0.5661961", "text": "function updateClients() {\n if (gameInProgress) {\n for (var id in clientSockets) {\n gameState = {\n players : players, \n items : getRelevantItems(items, players[id]),\n bullets_list: bullet_list,\n t : new Date().getTime(),\n };\n clientSockets[id].emit('newGameState', gameState);\n }\n }\n}", "title": "" }, { "docid": "8e17901e381c22ee06609e69175f67e1", "score": "0.5660345", "text": "async _main() {\n await this._goToStart();\n\n // render loop to render the scene\n this._engine.runRenderLoop(() => {\n switch (this._state) {\n case State.START:\n this._scene.render();\n break;\n case State.LOADING:\n this._scene.render();\n break;\n case State.INSTRUCTIONS:\n this._scene.render();\n break;\n case State.GAME:\n this._scene.render();\n break;\n case State.LOSE:\n this._scene.render();\n break;\n default: break;\n }\n });\n\n // make game responsive based on the user screen size\n window.addEventListener('resize', () => {\n this._engine.resize();\n });\n }", "title": "" }, { "docid": "3270c6297879cb0027ae0a96b0ad3ccf", "score": "0.5659327", "text": "function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.Clean();\n currentScene.removeAllChildren();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.INSTRUCTION:\n console.log(\"switch to Instruction Scene\");\n currentScene = new scenes.Instruction();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.ENDLESS:\n console.log(\"switch to Endless Scene\");\n currentScene = new scenes.Endless();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n case scenes.State.EXIT:\n console.log(\"switch to Exit Scene\");\n currentScene = new scenes.Exit();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }", "title": "" }, { "docid": "b15deb4bf5c791989b108d8b13910d49", "score": "0.5651131", "text": "initConnexion() {\n client.getSocket().on('table', (msg) => {\n console.log(msg);\n });\n\n client.getSocket().on('start-question', (msg) => {\n this.loadQuestionScreen_par();\n });\n client.getSocket().on('result', (msg) => {\n console.log('result');\n $('#app').load('src/questionnaire/result.html', () => {\n\n for (let q of msg.data.good_answers) {\n $('#paneBot').append('<div class=\"pane\"><p>' + q + '</p></div>');\n $('#paneTop').append('<div class=\"pane\"><p>' + q + '</p></div>');\n }\n $('#butBot').click(() => terminerBot());\n $('#butTop').click(() => terminerTop());\n });\n });\n\n client.getSocket().on('terminer', (msg) => {\n this.loadMainScreen('rouge');\n const tabOfTeamSequence = this.getLongQSequence(msg.data);\n this.playingSequence = new playingSequence(tabOfTeamSequence, this);\n this.playingSequence.start();\n });\n\n client.getSocket().on('all-answered', (msg) => {\n console.log('all-answered');\n const paneBot = $(\"#paneBot\");\n const paneTop = $(\"#paneTop\");\n paneBot.empty();\n paneTop.empty();\n\n paneBot.append('<p ><br><br>Observez bien la vidéo</p>');\n paneTop.append('<p ><br><br>Observez bien la vidéo</p>');\n\n $(\"#butBot\").text(\"Continuer\");\n $(\"#butTop\").text(\"Continuer\");\n $(\"#butBot\").on(\"click\", () => playB());\n $(\"#butTop\").on(\"click\", () => playT());\n $('#videoTop').on('ended', endTop);\n $('#videoBot').on('ended', endBot);\n });\n client.getSocket().on('start-question-collectif', (message) => {\n console.log(message);\n // toQuestionnaireView();\n });\n client.getSocket().on('indivQuestion', (msg) => {\n console.log(msg);\n //that.loadMainScreen();\n });\n client.getSocket().on('returningPlayer', (msg) => {\n this.actualScreen.addPlayerCard(msg.data.team, msg.data.pseudo);\n });\n client.getSocket().on('listen-user-login', (msg) => {\n console.log(msg.data);\n this.actualScreen.addPlayerCard(msg.data.team, msg.data.pseudo);\n });\n\n client.getSocket().on('returningPlayer', (msg) => {\n console.log(msg.data);\n });\n\n client.getSocket().on('indivQuestionResponse', (msg) => {\n console.error(\"play order\");\n console.error(msg.data);\n client.getSocket().emit('indivQuestionTest', { data: true });\n const tabOfTeamSequence = this.getTeamSequence(msg.data);\n this.loadScoreScreen(tabOfTeamSequence);\n setTimeout(() => {\n this.loadMainScreen();\n this.playingSequence = new playingSequence(tabOfTeamSequence, this);\n this.playingSequence.start();\n }, 11000);\n\n });\n\n client.getSocket().on('startTeam', (msg) => {\n console.log(msg.data);\n this.startingTeam = msg.data.team;\n });\n\n client.getSocket().on('start-of-new-question', (msg) => {\n if (msg.data === 1) {\n this.loadWaitingScreen();\n }\n // gerer les autres questions\n });\n }", "title": "" }, { "docid": "5ed3404e95ddfa13fe49485d891b868b", "score": "0.5650879", "text": "function startGame() {\n road.inicialize();\n car.inicialize();\n}", "title": "" }, { "docid": "287a75b57b782d3e476aa2dee60646ab", "score": "0.5646351", "text": "function listen( client )\n{\n\tclient.emit('welcome' , \"You have established an connection\");\n\tclient.on('login' , serverCommands.VerifyLogin );\n\t\n\tclient.on('re_establish' , \n\t\tfunction( message ) {\n\t\tclientSocketTable[ message.user_name ] = this;\n\t\tconsole.log(\"re-established \" + message.user_name );\n\t\tmessage.portfolio_name = message.user_name;\n\t\tserverCommands.serveFormula( message, serverCommands.servePlayerInfo, serverCommands.serveMyTrending );\n\t\tserverCommands.serveTrending( message );\n\t\tserverCommands.serveLeaderBoard( message );\n\t\tserverCommands.serveFriends( message );\n\t\tserverCommands.serveFriendRequests( message );\t\t\n\t});\n\tclient.on('tag_page_request' , serverCommands.serveTagPage );\n\tclient.on('create_login' , serverCommands.VerifyCreate );\n\tclient.on('buy_hash' , serverCommands.serveBuyHash );\n\tclient.on('sell_hash' , serverCommands.serveSellHash );\n\tclient.on('trending_request' , serverCommands.serveTrending );\n\tclient.on('top_tags_request' , serverCommands.serveTop );\n\tclient.on('my_investments_request' , serverCommands.serveMyTrending );\n\tclient.on('player_info_request' , serverCommands.servePlayerInfo);\n\tclient.on('friend_table_request' , serverCommands.serveFriends);\n\tclient.on('friend_request_request' , serverCommands.serveFriendRequests);\n\tclient.on('friend_button_request' , serverCommands.serveFriendButton);\n\tclient.on('accept_friend' , serverCommands.serveAcceptFriend);\n\tclient.on('decline_friend' , serverCommands.serveDeclineFriend);\n\tclient.on('leader_request' , serverCommands.serveLeaderBoard );\n client.on('search_username' , serverCommands.serveSearchUser );\n\tclient.on('search_user_email' , serverCommands.serveSearchEmail );\n\tclient.on('logout' , serverCommands.serveLogout );\n\tclient.on('chart_request' , serverCommands.serveChart );\n\tclient.on('make_friend_request' , serverCommands.serveMakeFriend );\n\tclient.on('challenges_request' , serverCommands.serveChallenges );\n\tclient.on('accept_challenge' , serverCommands.serveAcceptChallenge );\n\tclient.on('challenge_setup_request' , serverCommands.serveChallengeSetup );\n}", "title": "" }, { "docid": "6b58f9f03bd0f879d87c6f3b0f6bebe0", "score": "0.5645319", "text": "function listen(game) {\n\n console.log(game);\n\n if (!game) {\n $('body').html('404');\n return;\n }\n\n function C(i, game) {\n return {\n type: 'hidden',\n click: cellClicked,\n cells: game.boards[i]\n }\n }\n\n let divs = [$('#myNavy'), $('#enemyNavy')];\n\n divs.map((e, i) => e.find('.nick')\n .html(game.players[i].slice(8)));\n\n // create a sketch for each players\n boards = divs.map((e, i) => createSketch(C(i, game), e[0]));\n\n\n socket.on(game._id, function(req, res) {\n\n boards[req.target].set(req.x, req.y, res.hit ? SHIP : GAP);\n\n // make adjacent cells into gaps on kill\n if (res.kill) {\n res.kill.adj.map(\n c => boards[req.target].set(c.x, c.y, GAP))\n }\n })\n}", "title": "" }, { "docid": "4d86328f7b1f78a7240becc50f3b440f", "score": "0.56435096", "text": "function displayScene() {\r\n\tclear();\r\n\tfor(var i = 1; i<CONNECTIONS.length; i++) {\r\n\t\tCONNECTIONS[i].update();\r\n\t}\r\n\tfor(var i = 0; i<ARRAY_OF_HEAPBOXES.length; i++) {\r\n\t\tARRAY_OF_HEAPBOXES[i].update();\r\n\t\tARRAY_OF_HEAPS[i].update();\r\n\t}\r\n}", "title": "" }, { "docid": "dee706e15835d0d025b0e89ea36a2269", "score": "0.5642665", "text": "initializeSocket() {\n this.socket.onopen = function(e) {\n console.log(\"[open] Connection established\");\n };\n \n this.socket.onclose = function(e) {\n console.log(\"[close] Connection closed\");\n };\n \n this.socket.onmessage = function(e) {\n var data = JSON.parse(e.data)['message']\n if (data.origin === client) {\n game.makeCirc(data.x, data.y)\n }\n }\n }", "title": "" }, { "docid": "176a49c4b0c3b9fc76914733b94dde52", "score": "0.56410575", "text": "function setup() {\n\n var socket = io();\n\n var side = 30;\n\n \n\n\n var ground = loadImage('img/Ground.png');\n var bomb = loadImage('img/bomb.png');\n var grass = loadImage('img/Grass.png');\n var cow = loadImage('img/Cow.png');\n var wolf = loadImage('img/Wolf.png');\n var alien = loadImage('img/alien.png');\n var rock = loadImage('img/Rock.png');\n\n //! Getting DOM objects (HTML elements)\n let grassCountElement = document.getElementById('grassCount');\n let grassEaterCountElement = document.getElementById('grassEaterCount');\n let predatorCountElement = document.getElementById('predatorCount');\n let alienCounttElement = document.getElementById('alienCount');\n let bombCountElement = document.getElementById('bombCount');\n let rockCountElement = document.getElementById('rockCount');\n let Body = document.body;\n let WeatherTxT = document.getElementById('WeatherH2');\n //! adding socket listener on \"data\" <-- name, after that fire 'drawCreatures' function \n \n socket.on(\"data\", drawCreatures);\n\n function drawCreatures(data) {\n //! after getting data pass it to matrix variable\n matrix = data.matrix;\n grassCountElement.innerText = data.grassCounter;\n grassEaterCountElement.innerText = data.grassEaterCounter;\n predatorCountElement.innerText = data.predatorCounter;\n alienCounttElement.innerText = data.alienCounter;\n bombCountElement.innerText = data.bombCounter;\n rockCountElement.innerText = data.rockCounter;\n\n\n //grassEaterArr = data.grassEaterArrRev;\n //predatorArr = data.predatorArrRev;\n\n\n //! Every time it creates new Canvas woth new matrix size\n createCanvas(matrix[0].length * side, matrix.length * side)\n //! clearing background by setting it to new grey color\n background('green');\n //! Draw grassCount and grassEaterCount to HTML (use DOM objects to update information, yes, and use .innerText <- function)\n\n //! Drawing and coloring RECTs\n for (var i = 0; i < matrix.length; i++) {\n for (var j = 0; j < matrix[i].length; j++) {\n if (matrix[i][j] == 1) {\n //fill(\"green\");\n image(grass,j * side, i * side, side, side)\n //rect(j * side, i * side, side, side);\n } else if (matrix[i][j] == 2) {\n // fill(\"orange\");\n // rect(j * side, i * side, side, side);\n image(cow,j * side, i * side, side, side)\n\n } else if (matrix[i][j] == 0) {\n // fill('#acacac');\n // rect(j * side, i * side, side, side);\n image(ground,j * side, i * side, side, side)\n } else if (matrix[i][j] == 3) {\n // fill('red');\n // rect(j * side, i * side, side, side);\n image(wolf,j * side, i * side, side, side)\n } else if (matrix[i][j] == 4) {\n // fill('blue');\n // rect(j * side, i * side, side, side);\n image(alien,j * side, i * side, side, side)\n } else if (matrix[i][j] == 5) {\n // fill('yellow');\n // rect(j * side, i * side, side, side);\n image(bomb,j * side, i * side, side, side)\n }\n else if (matrix[i][j] == 6) {\n // fill('yellow');\n // rect(j * side, i * side, side, side);\n image(rock,j * side, i * side, side, side)\n }\n }\n }\n if(data.weatherIndex == 0 ) { Body.style.background = \"#757a9f\"; WeatherTxT.innerText = \"Եղանակ։Ձմեռ\";}\n if(data.weatherIndex == 1 ) { Body.style.background = \"#b8e08d\"; WeatherTxT.innerText = \"Եղանակ։Գարուն\";}\n if(data.weatherIndex == 2 ) { Body.style.background = \"#FFFE6F\"; WeatherTxT.innerText = \"Եղանակ։Ամառ\";}\n if(data.weatherIndex == 3 ) { Body.style.background = \"#e59d34\"; WeatherTxT.innerText = \"Եղանակ։Աշուն\";}\n\n }\n\n let ReverseButton = document.getElementById(\"Rev\");\n ReverseButton.addEventListener(\"click\", rev);\n\n let RemoveRocksButton = document.getElementById(\"RemoveRocks\");\n RemoveRocksButton.addEventListener(\"click\", RemoveRocks);\n \n let SpawnRocks = document.getElementById(\"SpawnRocks\");\n SpawnRocks.addEventListener(\"click\", AddRock);\n\n let GrassEaterAdderButton = document.getElementById(\"GrassEaterAdder\");\n GrassEaterAdderButton.addEventListener(\"click\", AddGrassEater);\n\n function rev(){\n socket.emit(\"matrixy pokhi\");\n }\n function RemoveRocks(){\n socket.emit(\"RemoveAllRocks\");\n }\n function AddGrassEater(){\n socket.emit(\"AddRandomGrassEater\");\n }\n function AddRock(){\n socket.emit(\"AddNewRock\");\n }\n\n\n}", "title": "" }, { "docid": "b966c79e5eee55efab677dfa3e0eab9f", "score": "0.562959", "text": "function setup() {\r\n\t\t// create a scene, that will hold all our elements such as objects, cameras and lights.\r\n\t\tvar scene = new THREE.Scene();\t\t\t\t\r\n\t\t\r\n\t\t// create a camera, which defines where we're looking at.\r\n\t\tvar camera = new THREE.PerspectiveCamera(45, 800/ 500, 0.1, 1000);\r\n\t\tcamera.position.set(0,0,50);\r\n\t\tscene.add(camera);\r\n\r\n\t\t// create a render and set the size\r\n\t\tvar renderer = new THREE.WebGLRenderer({ antialias: true} );\r\n\t\trenderer.setClearColor(new THREE.Color(0x000000, 0.0));\r\n\t\t//set the size\r\n\t\tvar Width,Height;\r\n\t\t//Width\t\t\r\n\t\tif(window.innerWidth > 900) Width = 750;\r\n\t\telse Width = window.innerWidth*0.85;\r\n\t\t//Height\r\n\t\tif(window.innerHeight > 900) Height = 775;\r\n\t\telse Height = window.innerHeight*0.69;\r\n\t\t//Set the Render Size\r\n\t\trenderer.setSize(Width, Height);\r\n\t\t\r\n\t\t//Later change this back to false\r\n\t\tvar endGame = true; //The Game is over and you'll have to restart\t\t\t\r\n\t\t\r\n\t\tvar controls = new THREE.TrackballControls( camera );\r\n\t\tcontrols.rotateSpeed = 1.0;\r\n\t\tcontrols.zoomSpeed = 1.2;\r\n\t\tcontrols.panSpeed = 0.8;\r\n\t\tcontrols.noZoom = false;\r\n\t\tcontrols.noPan = false;\r\n\t\tcontrols.staticMoving = true;\r\n\t\tcontrols.dynamicDampingFactor = 0.3; \r\n\t\t\t\r\n\t\t//Sockets\r\n\t\t//socket = io.connect('http://localhost:9000');\r\n\t\tsocket = io.connect('ec2-34-205-146-82.compute-1.amazonaws.com:9000');\r\n\t\t\r\n\t\t//Receive the Countdown until the beginning of the Game\r\n\t\tPac.on('Countdown', function(data) {\r\n\t\t\t\tif(GameStatus == \"IDLE\"){\r\n\t\t\t\t\tGameCountDown = data.count;\r\n\t\t\t\t\tCountDown.parameters.text= \"Count Down: \"+data.count+\" seconds\"; //CHANGED\r\n\t\t\t\t\t//P1Score=P2Score=P3Score=P4Score=0;\r\n\t\t\t\t\t//https://www.w3schools.com/jsref/prop_style_color.asp\r\n\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\tif(data.count > 26){\r\n\t\t\t\t\t\tCountDown.parameters.fillStyle= \"Green\"; //Light Green\r\n\t\t\t\t\t\tCountDown.update();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(data.count > 18){\r\n\t\t\t\t\t\tCountDown.parameters.fillStyle= \"Yellow\"; //Yellow\r\n\t\t\t\t\t\tCountDown.update();\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse if(data.count > 10){\r\n\t\t\t\t\t\tCountDown.parameters.fillStyle= \"Orange\"; //Orange \r\n\t\t\t\t\t\tCountDown.update();\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse if(data.count > 0){\r\n\t\t\t\t\t\tCountDown.parameters.fillStyle= \"Red\"; //Dark Red\r\n\t\t\t\t\t\tCountDown.update();\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tPac.emit('Pellets');\r\n\t\t\t\t\t\tCountDown.parameters.text= \"\";\r\n\t\t\t\t\t\tscene.remove(CountDown);\r\n\t\t\t\t\t\tconsole.log(\"PlayerMesh: \");\r\n\t\t\t\t\t\tscene.add(PlayerMesh);\r\n\t\t\t\t\t\tGameStatus = \"Start\";\r\n\t\t\t\t\t\tload_Pac();\r\n\t\t\t\t\t\tload_Ghost();\r\n\t\t\t\t\t\tconsole.log(\"Num: \"+data.numberOfPlayers);\r\n\t\t\t\t\t\tGameCountDown = -1;\r\n\t\t\t\t\t\t//Add the score for Player 1\r\n\t\t\t\t\t\tconsole.log(\"P1 Status Prior: \"+pacs[0].Status);\r\n\t\t\t\t\t\tif(data.numberOfPlayers >= 1){\r\n\t\t\t\t\t\t\tscene.add( P1Mesh );\r\n\t\t\t\t\t\t\tscene.add( P1 );\r\n\t\t\t\t\t\t\tP1.position.set(-8,-5,35);\r\n\t\t\t\t\t\t\tpacs[0].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t\t\t\t\tconsole.log(\"P1 Status: \"+pacs[0].Status);\r\n\t\t\t\t\t\t\tconsole.log(\"P1 Mesh:\"+P1Mesh);\r\n\t\t\t\t\t\t\tconsole.log(\"Added P1\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Add the score for Player 2\r\n\t\t\t\t\t\tif(data.numberOfPlayers >= 2){\r\n\t\t\t\t\t\t\tscene.add( P2Mesh );\r\n\t\t\t\t\t\t\tscene.add( P2 );\r\n\t\t\t\t\t\t\tP2.position.set(8,-5,35);\r\n\t\t\t\t\t\t\tpacs[1].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t\t\t\t\tconsole.log(\"Added P2\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Add the score for Player 3\r\n\t\t\t\t\t\tif(data.numberOfPlayers >= 3){\r\n\t\t\t\t\t\t\tscene.add( P3Mesh );\r\n\t\t\t\t\t\t\tscene.add( P3 );\r\n\t\t\t\t\t\t\tP3.position.set(-8,3,35);\r\n\t\t\t\t\t\t\tpacs[2].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t\t\t\t\tconsole.log(\"Added P3\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Add the score for Player 4\r\n\t\t\t\t\t\tif(data.numberOfPlayers >= 4){\r\n\t\t\t\t\t\t\tscene.add( P4Mesh );\r\n\t\t\t\t\t\t\tscene.add( P4 );\r\n\t\t\t\t\t\t\tP4.position.set(8,3,35);\r\n\t\t\t\t\t\t\tpacs[3].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t\t\t\t\tconsole.log(\"Added P4\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\r\n\t\tPac.on('Proceed To The Game Level', function(){\r\n\t\t\t\tloading_Level_1();\r\n\t\t\t\tGameStatus = \"IDLE\";\r\n\t\t\t\tload_Score();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Upload the CountDown\r\n\t\t\t\tCountDown = new THREEx.DynamicText2DObject();\r\n\t\t\t\tCountDown.parameters.text= \"\"; //CHANGED\r\n\t\t\t\tCountDown.parameters.font= \"bolder 185px Arial\";\r\n\t\t\t\tCountDown.parameters.fillStyle= \"white\";\r\n\t\t\t\tCountDown.parameters.align = \"center\";\r\n\t\t\t\tCountDown.dynamicTexture.canvas.width = 4096;\r\n\t\t\t\tCountDown.position.set(0,-2,37);\r\n\t\t\t\tCountDown.scale.set(18,3,1);\r\n\t\t\t\tCountDown.update();\r\n\t\t\t\tscene.add(CountDown);\r\n\t\t});\r\n\t\t\r\n\t\t//Update the scores according to the server!\r\n\t\tPac.on('scores',function(data) {\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\tif(data.P1 != -1){\r\n\t\t\t\t\ttext = \"Player 1: \"+data.P1;\r\n\t\t\t\t\tP1Texture.clear('Black').drawText(text, 12, 306, 'Red');\r\n\t\t\t\t\tP1Mesh.material.map = P1Texture.texture;\r\n\t\t\t\t}\t\t\r\n\t\t\t\tif(data.P2 != -1){\r\n\t\t\t\t\ttext = \"Player 2: \"+data.P2;\r\n\t\t\t\t\tP2Texture.clear('Black').drawText(text, 12, 306, 'DeepSkyBlue');\r\n\t\t\t\t\tP2Mesh.material.map = P2Texture.texture;\r\n\t\t\t\t}\r\n\t\t\t\tif(data.P3 != -1){\r\n\t\t\t\t\ttext = \"Player 3: \"+data.P3;\r\n\t\t\t\t\tP3Texture.clear('Black').drawText(text, 12, 306, 'Lime');\r\n\t\t\t\t\tP3Mesh.material.map = P3Texture.texture;\r\n\t\t\t\t}\r\n\t\t\t\tif(data.P4 != -1){\r\n\t\t\t\t\ttext = \"Player 4: \"+data.P3;\r\n\t\t\t\t\tP4Texture.clear('Black').drawText(text, 12, 306, 'DarkViolet');\r\n\t\t\t\t\tP4Mesh.material.map = P4Texture.texture;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the Pinky Ghost Target Node\r\n\t\tPac.on('Wait!',function(data) {\r\n\t\t\t\tload_StartScreen();\r\n\t\t\t\tGameStatus = \"StartScreen\";\r\n\t\t\t\talert(\"A Game is already in progress, you'll have to wait\")\r\n\t\t\t//console.log(\"Updated Pinky!!!\");\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//Change the sign at the bottom left of the screen letting the Player know which player they are\r\n\t\tPac.on('PlayerInfo',function(sendData) {\r\n\t\t\t\tconsole.log(\"Player info received.....\");\r\n\t\t\t\tplayer = sendData.playerNo;\r\n\t\t\t\t\r\n\t\t\t\t//console.log(\"This is player \"+player+ \" and we are ready to go!!!\");\r\n\t\t\t\t\r\n\t\t\t\tPlayerMesh = new THREEx.DynamicText2DObject();\r\n\t\t\t\tPlayerMesh.parameters.text= \"\";\r\n\t\t\t\tPlayerMesh.parameters.font= \"35px Arial\";\r\n\t\t\t\t\r\n\t\t\t\tif(player == 1){\r\n\t\t\t\t\tPlayerMesh.parameters.fillStyle= \"Red\";\r\n\t\t\t\t\tPlayerMesh.parameters.text= \"You are Player 1 (Red)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(player == 2){\r\n\t\t\t\t\tPlayerMesh.parameters.fillStyle= \"DeepSkyBlue\";\r\n\t\t\t\t\tPlayerMesh.parameters.text= \"You are Player 2 (Blue)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(player == 3){\r\n\t\t\t\t\tPlayerMesh.parameters.fillStyle= \"Lime\";\r\n\t\t\t\t\tPlayerMesh.parameters.text= \"You are Player 3 (Green)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(player == 4){\r\n\t\t\t\t\tPlayerMesh.parameters.fillStyle= \"DarkViolet\";\r\n\t\t\t\t\tPlayerMesh.parameters.text= \"You are Player 4 (Purple)\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerMesh.parameters.align = \"center\";\r\n\t\t\t\tPlayerMesh.dynamicTexture.canvas.width = 512;\r\n\t\t\t\tPlayerMesh.position.set(-5.35,-6.87,35);\r\n\t\t\t\tPlayerMesh.scale.set(8,5,1);\r\n\t\t\t\tPlayerMesh.update();\r\n\t\t\t\t//scene.add(PlayerMesh);\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t/**\r\n\t\tPac.on('Whose Playing',function(sendData){\r\n\t\t\tconsole.log(\"Players: \"+sendData.numberOfPlayers);\r\n\t\t\tnumberOfPlayers = sendData.numberOfPlayers;\r\n\t\t\t//Add the score for Player 1\r\n\t\t\tif(sendData.numberOfPlayers >= 1){\r\n\t\t\t\tscene.add( P1Mesh );\r\n\t\t\t\tpacs[0].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t}\r\n\t\t\t//Add the score for Player 2\r\n\t\t\tif(sendData.numberOfPlayers >= 2){\r\n\t\t\t\tscene.add( P2Mesh );\r\n\t\t\t\tpacs[1].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t}\r\n\t\t\t//Add the score for Player 3\r\n\t\t\tif(sendData.numberOfPlayers >= 3){\r\n\t\t\t\tscene.add( P3Mesh );\r\n\t\t\t\tpacs[2].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t}\r\n\t\t\t//Add the score for Player 4\r\n\t\t\tif(sendData.numberOfPlayers >= 4){\r\n\t\t\t\tscene.add( P4Mesh );\r\n\t\t\t\tpacs[3].Status = \"Normal\"; //Changed from Died to Normal\r\n\t\t\t}\r\n\t\t});\r\n\t\t**/\r\n\t\t\r\n\t\t//Incoming report that a player has died\r\n\t\tPac.on('Player Died', function (newData){\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\tconsole.log(\"A player has died.\");\r\n\t\t\t\tif(newData.player == 1){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tscene.remove(P1);\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\tconsole.log(\"Player \"+newData.player+\" Pac-man sprite (P1) has already been removed\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(newData.player == 2){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tscene.remove(P2);\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\tconsole.log(\"Player \"+newData.player+\" Pac-man sprite (P2) has already been removed\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(newData.player == 3){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tscene.remove(P3);\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\tconsole.log(\"Player \"+newData.player+\" Pac-man sprite (P3) has already been removed\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{ //newData.player == 4\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tscene.remove(P4);\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\tconsole.log(\"Player \"+newData.player+\" Pac-man sprite (P4) has already been removed\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//Incoming Report... The Game is Over!!\r\n\t\tPac.on('Game Over', function (newData){\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\tpacs[0].Status == \"Died\";\r\n\t\t\t\tpacs[1].Status == \"Died\";\r\n\t\t\t\tpacs[2].Status == \"Died\";\r\n\t\t\t\tpacs[3].Status == \"Died\";\r\n\t\t\t\tGameStatus = \"Game Over\";\r\n\t\t\t\tconsole.log(GameStatus);\r\n\t\t\t\t//Adding Title\r\n\t\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\tloader.crossOrigin = true;\r\n\t\t\t\tvar T = loader.load( 'Images/Game Over.png' );\r\n\t\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\t\tvar T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\t\tGameOver = new THREE.Sprite(T1);\r\n\t\t\t\tscene.add(GameOver);\r\n\t\t\t\tGameOver.position.set(0,-1.25,38);\r\n\t\t\t\tGameOver.scale.set(15.5,4,1);\r\n\t\t\t\t\r\n\t\t\t\tT = loader.load( 'Images/PlayAgain.png' );\r\n\t\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\t\tT1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\t\tPlayAgain = new THREE.Sprite(T1);\r\n\t\t\t\tscene.add(PlayAgain);\r\n\t\t\t\tPlayAgain.position.set(0,-3.25,38);\r\n\t\t\t\tPlayAgain.scale.set(8,2,1);\r\n\t\t\t\t\r\n\t\t\t\t//Function\r\n\t\t\t\tPlayAgain.callback = function() {\r\n\t\t\t\t\t\tif(GameStatus == \"Game Over\"){\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tscene.remove(PlayAgain); \r\n\t\t\t\t\t\t\t\tscene.remove(GameOver);\r\n\t\t\t\t\t\t\t\tscene.remove(Blinky);\r\n\t\t\t\t\t\t\t\tscene.remove(Pinky);\r\n\t\t\t\t\t\t\t\tscene.remove(Inky);\r\n\t\t\t\t\t\t\t\tscene.remove(Clyde);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tGameStatus = \"IDLE\";\r\n\t\t\t\t\t\t\t\tload_Score();\r\n\t\t\t\t\t\t\t\tresetGhost();\r\n\t\t\t\t\t\t\t\tPac.emit('Start Count to the Next Game');\r\n\t\t\t\t\t\t\t\tconsole.log(\"start the Countdown!!!\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Upload the CountDown\r\n\t\t\t\t\t\t\t\tCountDown = new THREEx.DynamicText2DObject();\r\n\t\t\t\t\t\t\t\tCountDown.parameters.text= \"\"; //CHANGED\r\n\t\t\t\t\t\t\t\tCountDown.parameters.font= \"bolder 185px Arial\";\r\n\t\t\t\t\t\t\t\tCountDown.parameters.fillStyle= \"white\";\r\n\t\t\t\t\t\t\t\tCountDown.parameters.align = \"center\";\r\n\t\t\t\t\t\t\t\tCountDown.dynamicTexture.canvas.width = 4096;\r\n\t\t\t\t\t\t\t\tCountDown.position.set(0,-2,37);\r\n\t\t\t\t\t\t\t\tCountDown.scale.set(18,3,1);\r\n\t\t\t\t\t\t\t\tCountDown.update();\r\n\t\t\t\t\t\t\t\tscene.add(CountDown);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twhile(PelletsList.length > 0){\r\n\t\t\t\t\t\t\t\t\tscene.remove(PelletsList[0].Pellet);\r\n\t\t\t\t\t\t\t\t\tPelletsList.splice(0,1);\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\tscene.remove(P1);\r\n\t\t\t\t\t\t\t\tscene.remove(P2);\r\n\t\t\t\t\t\t\t\tscene.remove(P3);\r\n\t\t\t\t\t\t\t\tscene.remove(P4);\r\n\t\t\t\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\r\n\t\t\t\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t\t\t\t\tscene.remove(P4);\r\n\t\t\t\t\t\t\t\tscene.remove(P3);\r\n\t\t\t\t\t\t\t\tscene.remove(P2);\r\n\t\t\t\t\t\t\t\tscene.remove(P1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tclickable.push(PlayAgain);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the Blinky Ghost Target Node\r\n\t\tPac.on('Blinky',function(data) {\r\n\t\t\t//if(GameStatus == \"Start\")\r\n\t\t\t\tghosts[0].currentNode = data.futureNode;\r\n\t\t\t//console.log(\"Updated Blinky!!!\");\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the Pinky Ghost Target Node\r\n\t\tPac.on('Pinky',function(data) {\r\n\t\t\t//if(GameStatus == \"Start\")\r\n\t\t\t\tghosts[1].currentNode = data.futureNode;\r\n\t\t\t//console.log(\"Updated Pinky!!!\");\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the Inky Ghost Target Node\r\n\t\tPac.on('Inky',function(data) {\r\n\t\t\t//if(GameStatus == \"Start\")\r\n\t\t\t\tghosts[2].currentNode = data.futureNode;\r\n\t\t\t//console.log(\"Updated Inky!!!\");\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the Clyde Ghost Target Node\r\n\t\tPac.on('Clyde',function(data) {\r\n\t\t\t//if(GameStatus == \"Start\")\r\n\t\t\t\tghosts[3].currentNode = data.futureNode;\r\n\t\t\t//console.log(\"Updated Clyde!!!\");\r\n\t\t});\r\n\t\t\r\n\t\t//Inserts fruits into the game and remove any fruits that might be there already\r\n\t\tPac.on('insert Fruit',function(data) {\r\n\t\t\t/*List of Fruits\r\n\t\t\t\tFruit 0 - Apple\r\n\t\t\t\tFruit 1 - Banana\r\n\t\t\t\tFruit 2 - Cherry\r\n\t\t\t\tFruit 3 - Orange\r\n\t\t\t\tFruit 4 - Pear\r\n\t\t\t\tFruit 5 - Pretzel\r\n\t\t\t\tFruit 6 - Strawberry\r\n\t\t\t\tFruit 7 - Grape\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t//He HE HE don't say a word if errors happen and.. try again (-.-)*\r\n\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t}\r\n\t\t\t\tFruit.material = Fruits[data.fruitNo];\r\n\t\t\t\tFruit.position.set(nodes[data.node].x, nodes[data.node].y, 34.8);\r\n\t\t\t\tscene.add(Fruit);\r\n\t\t\t\tFruit.scale.set(0.8,0.75,1);\r\n\t\t\t\t//if(pacs[0].Speed == 1)pacs[0].Speed = 2;\r\n\t\t\t\t//else pacs[0].Speed = 1;\r\n\t\t\t\t//console.log(\"Fruit Loaded!!!!!\");\r\n\t\t\t\t//console.log(\"Fruit No.:\"+data.fruitNo+\" Node:\"+data.node);\r\n\t\t\t\t//console.log(\"Node x:\"+nodes[data.node].x+\" Node y:\"+nodes[data.node].y);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t//Receives the List of nodes to places the pellets. It places them from one node to another\r\n\t\tPac.on('insert Pellets',function(sendData) {\r\n\t\t\t\r\n\t\t\t//console.log(\"Pellets received.....\");\r\n\t\t\t//console.log(sendData);\r\n\t\t\t//console.log(sendData.pelletsList[\"0\"].start +\" \"+sendData.pelletsList[\"0\"].end);\r\n\t\t\t//console.log(sendData.pelletsList[2].start +\" \"+sendData.pelletsList[2].end);\r\n\t\t\t//.pelletsList[\"0\"].start\r\n\t\t\tif(GameStatus == \"Start\")\t\t\t\t\r\n\t\t\t\tfor(var x = 0; x < sendData.pelletsList.length; x++)\r\n\t\t\t\t\tinsertPellets(sendData.pelletsList[x].start,sendData.pelletsList[x].end,sendData.pelletsList[x].superPellet);\r\n\t\t\t\t//console.log(x+\". \"+sendData.pelletsList[x].superPellet);\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the P1 Pac-man\r\n\t\tPac.on('P1 Updates',function(data) {\r\n\t\t\t//if(GameStatus == \"Start\"){\r\n\t\t\t\tif(pacs[0].currentNode == 40){\r\n\t\t\t\t\tpacs[0].currentNode =36;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pacs[0].currentNode == 41){\r\n\t\t\t\t\tpacs[0].currentNode =11;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(pacs[0].currentNode != data.node){\r\n\t\t\t\t//console.log(\"P1 Old: \"+pacs[0].oldNode+\" Prev: \"+pacs[0].previousNode+\r\n\t\t\t\t//\" Curr: \"+pacs[0].currentNode+\" Now to Node: \"+data.node);\r\n\t\t\t\r\n\t\t\t\t\tpacs[0].oldNode = pacs[0].previousNode;\r\n\t\t\t\t\tpacs[0].previousNode = pacs[0].currentNode;\r\n\t\t\t\t\tpacs[0].currentNode = data.node;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the P2 Pac-man\r\n\t\tPac.on('P2 Updates',function(data) {\r\n\t\t\t//if(GameStatus == \"Start\"){\r\n\t\t\t\tif(pacs[1].currentNode == 40){\r\n\t\t\t\t\tpacs[1].currentNode =36;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pacs[1].currentNode == 41){\r\n\t\t\t\t\tpacs[1].currentNode =11;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(pacs[1].currentNode != data.node){\r\n\t\t\t\t\tpacs[1].oldNode = pacs[1].previousNode;\r\n\t\t\t\t\tpacs[1].previousNode = pacs[1].currentNode;\r\n\t\t\t\t\tpacs[1].currentNode = data.node;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t});\r\n\t\t\r\n\t\t//Updates the P3 Pac-man\r\n\t\tPac.on('P3 Updates',function(data) {\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\tif(pacs[2].currentNode == 40){\r\n\t\t\t\t\tpacs[2].currentNode =36;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pacs[2].currentNode == 41){\r\n\t\t\t\t\tpacs[2].currentNode =11;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(pacs[2].currentNode != data.node){\r\n\t\t\t\t\tpacs[2].oldNode = pacs[2].previousNode;\r\n\t\t\t\t\tpacs[2].previousNode = pacs[2].currentNode;\r\n\t\t\t\t\tpacs[2].currentNode = data.node;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//Updates the P4 Pac-man\r\n\t\tPac.on('P4 Updates',function(data) {\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\tif(pacs[3].currentNode == 40){\r\n\t\t\t\t\tpacs[3].currentNode =36;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pacs[3].currentNode == 41){\r\n\t\t\t\t\tpacs[3].currentNode =11;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(pacs[3].currentNode != data.node){\r\n\t\t\t\t\tpacs[3].oldNode = pacs[3].previousNode;\r\n\t\t\t\t\tpacs[3].previousNode = pacs[3].currentNode;\r\n\t\t\t\t\tpacs[3].currentNode = data.node;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//If a player at a fruit, the special properties are activated for that Players\r\n\t\tPac.on('Update Players', function(data){\r\n\t\t\t/*List of Fruits\r\n\t\t\t\tFruit 0 - Apple\r\n\t\t\t\tFruit 1 - Banana\r\n\t\t\t\tFruit 2 - Cherry\r\n\t\t\t\tFruit 3 - Orange\r\n\t\t\t\tFruit 4 - Pear\r\n\t\t\t\tFruit 5 - Pretzel\r\n\t\t\t\tFruit 6 - Strawberry\r\n\t\t\t\tFruit 7 - Grape\r\n\t\t\t\tItem 8\t- Pellet\r\n\t\t\t\tItem 9 \t- Super Pellet\r\n\t\t\t*/\r\n\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\t\t\r\n\t\t\t\tvar sendData = {Player: data.player, score: 10};\r\n\t\t\t\t\r\n\t\t\t\tif (data.fruit == 0){//Apple\r\n\t\t\t\t\tsendData.score = 50;\r\n\t\t\t\t}\r\n\t\t\t\telse if (data.fruit == 1){//Banana\t\t\t\r\n\t\t\t\t\tpacs[data.player].Speed = 2;\r\n\t\t\t\t\tpacs[data.player].speedCD = 75;\r\n\t\t\t\t\tpacs[data.player].speedB = true;\r\n\t\t\t\t\tsendData.score = 10;\r\n\t\t\t\t}\r\n\t\t\t\telse if (data.fruit == 2){//Cherry\r\n\t\t\t\t\tsendData.score = 100;\r\n\t\t\t\t} \r\n\t\t\t\telse if (data.fruit == 3){//Orange\t\t\t\t\r\n\t\t\t\t\tpacs[data.player].Speed = 0.75;\r\n\t\t\t\t\tpacs[data.player].speedCD = 50;\r\n\t\t\t\t\tpacs[data.player].speedB = true;\r\n\t\t\t\t\tsendData.score = 250;\r\n\t\t\t\t} \r\n\t\t\t\t//Just for fun lets make 4 & 5 make you grow or shrink for now lol\r\n\t\t\t\telse if (data.fruit == 4){//Pear\r\n\t\t\t\t\t//P1.scale.set(1.25,.75,0);\r\n\t\t\t\t\t//pacs[data.player].Speed = 1;\r\n\t\t\t\t\t//pac[0].sizeCD = 100; \r\n\t\t\t\t\tsendData.score = 50;\r\n\t\t\t\t}\r\n\t\t\t\telse if (data.fruit == 5){//Pretzel\r\n\t\t\t\t\t//increase Player Score\r\n\t\t\t\t\tsendData.score = 50;\r\n\t\t\t\t\t/**\r\n\t\t\t\t\tif(SuperPellets.name= \"Super\";)\r\n\t\t\t\t\tP1.scale.set(1.75,1.25,0);\r\n\t\t\t\t\tpacs[data.player].Speed = 1.25;\r\n\t\t\t\t\tpacs[0].sizeCD = 120;\r\n\t\t\t\t\tpacs[0].speedCD = 120;\r\n\t\t\t\t\tpacs[0].sizeB = true;\r\n\t\t\t\t\tpacs[0].speedB = true;\r\n\t\t\t\t\t**/\r\n\t\t\t\t}\r\n\t\t\t\telse if (data.fruit == 6){//Strawberry\r\n\t\t\t\t\tsendData.score = 150;\r\n\t\t\t\t} \r\n\t\t\t\telse if (data.fruit == 7){//Grapes lol Drunkard\r\n\t\t\t\t\tpacs[data.player].Speed = 1.4;\r\n\t\t\t\t\tpacs[data.player].speedCD = 50;\r\n\t\t\t\t\tpacs[data.player].speedB = true;\r\n\t\t\t\t\tsendData.score = 200;\r\n\t\t\t\t}\r\n\t\t\t\telse if (data.fruit == 8){//Pellet\r\n\t\t\t\t} \r\n\t\t\t\telse if (data.fruit == 9){//Super Pellet\r\n\t\t\t\t\tP1.scale.set(1.75,1.25,0);\r\n\t\t\t\t\tpacs[data.player].Speed = 1.25;\r\n\t\t\t\t\tpacs[data.player].sizeCD = 120;\r\n\t\t\t\t\tpacs[data.player].speedCD = 120;\r\n\t\t\t\t\tpacs[data.player].sizeB = true;\r\n\t\t\t\t\tpacs[data.player].speedB = true;\r\n\t\t\t\t}\r\n\t\t\t\ttry{\r\n\t\t\t\t\tFruit.position.set(6, 6, 34.8);\r\n\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t}\r\n\t\t\t\tcatch(e){\r\n\t\t\t\t\t//Try again....\r\n\t\t\t\t\tFruit.position.set(6, 6, 34.8);\r\n\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tPac.emit('Update Scores',sendData);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/**Audio\r\n\t\t\tvar wingFlap = new Audio('FlapPyBird-master/assets/audio/wing.ogg');\r\n\t\t\twingFlap.volume=0.1;\r\n\t\t\t*/\t\r\n\t\t\r\n\t\t//Keyboard Functions\r\n\t\tvar onKeyDown = function(event) {\r\n\t\t\tif (event.keyCode == 27 && GameStatus == \"SplashScreen\") { //when 'esc' is pressed\r\n\t\t\t\tGameStatus = \"Splash_Screen_Transition\";\r\n\t\t\t\tload_StartScreen();\r\n\t\t\t}\r\n\t\t\telse if (event.keyCode == 145) { //when 'SCROLL LOCK' is pressed\r\n\t\t\t\t\t//scene.add(Courage);\r\n\t\t\t\t\t//Courage.position.set(0,0,35);\r\n\t\t\t\t\t//Courage.scale.set(1.25,.75,0);\r\n\t\t\t}\r\n\t\t\telse if (event.keyCode == 17 && step >wait && GameStatus == \"Start\") { //when 'ctrl' is pressed\r\n\t\t\t\t\t\t\t//wait = step + 5;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Pac.emit('Fruits');\r\n\t\t\t\t\t\t\t//console.log(\"Pellets List Length \"+PelletsList.length);\r\n\t\t\t\t\t\t}\r\n\t\t\telse if (event.keyCode == 32 && step >wait && GameStatus == \"IDLE\" && GameCountDown > 8 ) { //when 'Space Bar' is pressed and \r\n\t\t\t\twait = step + 0.7;\r\n\t\t\t\tPac.emit(\"Lower Count\");\r\n\t\t\t}\r\n\t\t\telse if (((event.keyCode >= 37 && event.keyCode <= 40) ||\r\n\t\t\t\t(\r\n\t\t\t\t\tevent.keyCode == 65 ||\r\n\t\t\t\t\tevent.keyCode == 68 ||\r\n\t\t\t\t\tevent.keyCode == 83 ||\r\n\t\t\t\t\tevent.keyCode == 87\r\n\t\t\t\t)) && step >wait && GameStatus == \"Start\") { //when an 'Arrow' key is pressed\r\n\t\t\t\t\r\n\t\t\t\twait = step + 0.03;\r\n\t\t\t\tvar data = { direction:\"South\"};//default South\r\n\t\t\t\tif (event.keyCode == 37 || event.keyCode == 65) //when 'Left Arrow' or 'A' is pressed\r\n\t\t\t\t\t\tdata.direction=\"West\";\r\n\t\t\t\telse if (event.keyCode == 38 || event.keyCode == 87) //when 'Up Arrow' or 'W' is pressed\r\n\t\t\t\t\t\tdata.direction=\"North\";\r\n\t\t\t\telse if (event.keyCode == 39 || event.keyCode == 68 ) //when 'Right Arrow' or 'D' is pressed\r\n\t\t\t\t\t\tdata.direction=\"East\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tPac.emit(\"player \"+player,data);\r\n\t\t\t\t//Arrow Keys\r\n\t\t\t\t//37- Left\r\n\t\t\t\t//38- Up\r\n\t\t\t\t//39- Right\r\n\t\t\t\t//40- Down\r\n\t\t\t\t\r\n\t\t\t\t//WASD\r\n\t\t\t\t//W- 87\r\n\t\t\t\t//A- 65\r\n\t\t\t\t//S- 83\r\n\t\t\t\t//D- 68\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t}; \r\n\t\tdocument.addEventListener('keydown', onKeyDown, false);\t\t\t\r\n\t\t\r\n\t\traycaster = new THREE.Raycaster();\r\n\t\tmouse = new THREE.Vector2();\r\n\t\t\r\n\t\t/** gg**/\r\n\t\t//Mouse Click Event\r\n\t\tfunction onDocumentMouseDown (event){\r\n\t\t\tif(GameStatus == \"SplashScreen\") { //when 'esc' is pressed\r\n\t\t\t\tGameStatus = \"Splash_Screen_Transition\";\r\n\t\t\t\tload_StartScreen();\r\n\t\t\t}\r\n\t\t\telse if(GameStatus == \"StartScreen\" || GameStatus == \"About\" ||\r\n\t\t\t GameStatus == \"Credits\" || GameStatus == \"Game Over\"){\r\n\t\t\t\tconsole.log(\"yes\");\r\n\t\t\t\t\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\tmouse.x = ( event.clientX / renderer.domElement.clientWidth ) * 2 - 1.5;\r\n\t\t\t\t//mouse.y = - ( event.clientY / renderer.domElement.clientHeight ) * 2 + 1;\r\n\t\t\t\tmouse.y = - ( event.clientY / renderer.domElement.clientHeight ) * 2 + 1.35;\r\n\t\t\t\tconsole.log(\"M.x: \"+mouse.x+\" M.y:\"+mouse.y);\r\n\t\t\t\t\r\n\t\t\t\traycaster.setFromCamera( mouse, camera );\r\n\r\n\t\t\t\tvar intersects = raycaster.intersectObjects( clickable ); \r\n\r\n\t\t\t\tif ( intersects.length > 0 ) {\r\n\t\t\t\t\t intersects[0].object.callback();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(GameStatus == \"Start\"){\r\n\t\t\t\t\tconsole.log(\"pressed\");\r\n\t\t\t}\r\n\t\t\t//https://stackoverflow.com/questions/12800150/catch-the-click-event-on-a-specific-mesh-in-the-renderer\r\n\t\t}\r\n\t\trenderer.domElement.addEventListener('mousedown', onDocumentMouseDown, false)\r\n\t\t\r\n\t\t//console.log(renderer);\r\n\t\t\r\n\t\t//Window Resize Event\r\n\t\tfunction onWindowResize(){\r\n\t\t\tvar Width,Height;\r\n\t\t\tif(window.innerWidth > 900) Width = 750;\r\n\t\t\telse Width = window.innerWidth*0.85;\r\n\t\t\t\t\r\n\t\t\tif(window.innerHeight > 900) Height = 775;\r\n\t\t\telse Height = window.innerHeight*0.69;\r\n\t\t\t\r\n\t\t\trenderer.setSize(Width, Height);\r\n\t\t\tcamera.aspect = renderer.domElement.width/renderer.domElement.height;\r\n\t\t}\r\n\t\twindow.addEventListener('resize', onWindowResize, false);\r\n\t\t//https://stackoverflow.com/questions/20290402/three-js-resizing-canvas?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa\r\n\t\t\r\n\t\t//From Pacman 3D- Creates/Returns the Pellets\r\n\t\tvar createDot = function () {\r\n\t\t\treturn function () {\r\n\t\t\t\t//Pellets lol I made this one too!!! :D\r\n\t\t\t\t//Loader for Sprites\r\n\t\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\tloader.crossOrigin = true;\r\n\t\t\t\tvar Texture00 = loader.load( 'Images/Fruits/pellets.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tvar Pells = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tPellets = new THREE.Sprite(Pells);\t\r\n\t\t\t\tPellets.scale.set(0.5,0.25,1);\r\n\t\t\t\treturn Pellets;\r\n\t\t\t};\r\n\t\t}();\r\n\t\t\r\n\t\t//From Pacman 3D- Creates/Returns the Super Pellets\r\n\t\tvar superDot = function () {\t\r\n\t\t\treturn function () {\r\n\t\t\t\t//Pellets lol I made this one too!!! :D\r\n\t\t\t\t//Loader for Sprites\r\n\t\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\tloader.crossOrigin = true;\r\n\t\t\t\tvar Texture00 = loader.load( 'Images/Fruits/pellets.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tvar Pells = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tSuperPellets = new THREE.Sprite(Pells);\t\r\n\t\t\t\tSuperPellets.scale.set(0.75,0.5,1);\r\n\t\t\t\tSuperPellets.name = \"Super\";\r\n\t\t\t\treturn SuperPellets;\r\n\t\t\t};\r\n\t\t}();\r\n\t\t\r\n //add spotlight for the shadows\r\n\t\tvar spotLight = new THREE.SpotLight(0xffffff);\r\n\t\tspotLight.position.set(0, 50, 150);\r\n\t\tspotLight.castShadow = false;\r\n\t\tspotLight.intensity = 2;\r\n\t\tscene.add(spotLight);\r\n\t\t\r\n\t\t/**\r\n\t\t//Alex helped me out with the button!!\r\n\t\tvar canvas2 = document.getElementById(\"WebGL-output\");\r\n\t\t//*[@id=\"WebGL-output\"]/canvas\r\n\t\tconsole.log(canvas2);\r\n\t\t//var context = canvas2.getContext(\"2D\");\r\n\t\t\r\n\t\t//This should solve the context\r\n\t\t//https://stackoverflow.com/questions/5808162/getcontext-is-not-a-function\r\n\t\tvar context2 = canvas2.getContext(\"webgl\");\r\n\t\t//var ctxt = document.getElementById(\"WebGL-output\").getContext('2d');\r\n\t\tvar origRect2 = canvas.getBoundingClientRect();\r\n\t\t//var textWidth = context.measureText(buttonText).width;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcanvas2.onclick = function(event){\r\n\t\t\t//console.log(canvas);\r\n\t\t\t\r\n\t\t\tif(GameStatus == \"SplashScreen\") { //when 'esc' is pressed\r\n\t\t\t\tGameStatus = \"Splash_Screen_Transition\";\r\n\t\t\t\tload_StartScreen();\r\n\t\t\t}\r\n\t\t\telse if(GameStatus != \"IDLE\" || GameStatus != \"Start\") {\r\n\t\t\t\tvar rect = event.currentTarget.getBoundingClientRect();\r\n\t\t\t\tvar mouseX = event.pageX - rect.left;\r\n\t\t\t\tvar mouseY = event.pageY - rect.top;\r\n\t\t\t\t\r\n\t\t\t\t//We'll customize the length here for each of the five buttons\r\n\t\t\t\t//Start, About, Credits, Close and PlayAgain\r\n\t\t\t\tvar textX = rect.width * startPercentW;\r\n\t\t\t\tvar textY = (rect.height * startPercentH) - rect.width*0.5;\r\n\t\t\t\tconsole.log(\"1-\"+rect.width*0.5);\r\n\t\t\t\t//textY = (rect.height * startPercentH) - renderer.domElement.width*0.5;\r\n\t\t\t\t//console.log(\"2-\"+renderer.domElement.width*0.5);\r\n\t\t\t\t//console.log(renderer);\r\n\t\t\t\t//var textY = (rect.height * startPercentH) - getFontSize(rect);\r\n\t\t\t\t\r\n\t\t\t\tvar maxX = textX + (200 * (rect.width/origRect.width));\r\n\t\t\t\tvar maxY = rect.height * startPercentH;\r\n\t\t\t\t\r\n\t\t\t\tif(mouseY > textY && mouseY <= maxY &&\r\n\t\t\t\t mouseX >= textX && mouseX <= maxX){\r\n\t\t\t\t\t //console.log(AboutMesh);\r\n\t\t\t\t\t //console.log(AboutMesh.material.map.image.width);\r\n\t\t\t\t\t console.log(\"Start\");\r\n\t\t\t\t }\r\n\t\t\t\t console.log(\"____________\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//console.log(canvas);\r\n\t\t**/\r\n\t\t\r\n\t\t//add the output of the renderer to the html element\r\n\t\tdocument.getElementById(\"WebGL-output\").appendChild(renderer.domElement);\r\n //call the render function\r\n\t\trenderer.render(scene, camera);\r\n\t\t\r\n\t\t//call the render function\r\n\t\tvar step = 0;\t\t\r\n\t\trenderScene();\r\n\t\tload_Fruits();\r\n\t\tload_GhostSprite();\r\n\t\tload_SplashScreen();\r\n\t\tload_Nodes();\r\n\t\tvar ghostRadiusX = 1.1;\r\n\t\tvar ghostRadiusY = 0.55;\r\n\t\t\r\n\t\t//Animation Loop\r\n\t\tfunction renderScene(){\r\n\t\t\ttry{\r\n\t\t\t\t//Render steps\r\n\t\t\t\t\tstep += 0.1;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//render using requestAnimationFrame\r\n\t\t\t\t\trequestAnimationFrame(renderScene);\r\n\t\t\t\t\trenderer.render(scene, camera);\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Move all the players\r\n\t\t\t\t\tscene.traverse(function (e) {\r\n\t\t\t\t\t\t//When the Game Started\r\n\t\t\t\t\t\tif(GameStatus == \"Start\"){\r\n\t\t\t\t\t\t\t//Ghosts\r\n\t\t\t\t\t\t\t//Blinky Actions\r\n\t\t\t\t\t\t\tif (e == Blinky){\t\t\r\n\t\t\t\t\t\t\t\tif ((e.position.y - nodes[ghosts[0].currentNode].y) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y -= 0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[0].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[0].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyD1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyD2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[0].currentNode].y) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\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\tif(ghosts[0].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[0].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[0].currentNode].x) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x -=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[0].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[0].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[0].currentNode].x) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[0].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[0].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\tghosts[0].oldNode = ghosts[0].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[0].previousNode = ghosts[0].currentNode;\r\n\t\t\t\t\t\t\t\t\tvar sendData;\r\n\t\t\t\t\t\t\t\t\tPac.emit('Blinky Arrived', sendData={Player:player,status:\"Arrived@\"+ghosts[0].previousNode, arrived:ghosts[0].previousNode});\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\tif(e.position.y >3.3){\r\n\t\t\t\t\t\t\t\t\tghosts[0].oldNode = ghosts[0].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[0].previousNode = 40;\r\n\t\t\t\t\t\t\t\t\tghosts[0].currentNode = 36;\r\n\t\t\t\t\t\t\t\t\te.position.y = -5.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(e.position.y <-5.3){\r\n\t\t\t\t\t\t\t\t\tghosts[0].oldNode = ghosts[0].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[0].previousNode = 41;\r\n\t\t\t\t\t\t\t\t\tghosts[0].currentNode = 11;\r\n\t\t\t\t\t\t\t\t\te.position.y = 3.2;\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\r\n\t\t\t\t\t\t\t\t//console.log(\"ff\");\r\n\t\t\t\t\t\t\t\t//P1 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P1.position.y)<ghostRadiusY && Math.abs(e.position.x-P1.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P1,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P2 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P2.position.y)<ghostRadiusY && Math.abs(e.position.x-P2.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P2,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P3 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P3.position.y)<ghostRadiusY && Math.abs(e.position.x-P3.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P3,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P4 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P4.position.y)<ghostRadiusY && Math.abs(e.position.x-P4.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P4,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//Pinky Actions\r\n\t\t\t\t\t\t\telse if (e == Pinky){\r\n\t\t\t\t\t\t\t\tif(ghosts[1].timer > step){\r\n\t\t\t\t\t\t\t\t\tif(ghosts[1].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[1].currentNode].y) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y -= 0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[1].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyD1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyD2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[1].currentNode].y) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\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\tif(ghosts[1].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[1].currentNode].x) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x -=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[1].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[1].currentNode].x) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[1].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\tghosts[1].oldNode = ghosts[1].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[1].previousNode = ghosts[1].currentNode;\r\n\t\t\t\t\t\t\t\t\tvar sendData;\r\n\t\t\t\t\t\t\t\t\tPac.emit('Pinky Arrived', sendData={Player:player,status:\"Arrived @ \"+ghosts[1].previousNode, arrived:ghosts[1].previousNode});\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\tif(e.position.y >3.3){\r\n\t\t\t\t\t\t\t\t\tghosts[1].oldNode = ghosts[1].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[1].previousNode = 40;\r\n\t\t\t\t\t\t\t\t\tghosts[1].currentNode = 36;\r\n\t\t\t\t\t\t\t\t\te.position.y = -5.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(e.position.y <-5.3){\r\n\t\t\t\t\t\t\t\t\tghosts[1].oldNode = ghosts[1].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[1].previousNode = 41;\r\n\t\t\t\t\t\t\t\t\tghosts[1].currentNode = 11;\r\n\t\t\t\t\t\t\t\t\te.position.y = 3.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//P1 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P1.position.y)<ghostRadiusY && Math.abs(e.position.x-P1.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P1,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P2 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P2.position.y)<ghostRadiusY && Math.abs(e.position.x-P2.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P2,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P3 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P3.position.y)<ghostRadiusY && Math.abs(e.position.x-P3.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P3,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P4 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P4.position.y)<ghostRadiusY && Math.abs(e.position.x-P4.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P4,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//Inky Actions\r\n\t\t\t\t\t\t\telse if (e == Inky){\t\t\r\n\t\t\t\t\t\t\t\tif(ghosts[2].timer > step){\r\n\t\t\t\t\t\t\t\t\tif(ghosts[2].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[2].currentNode].y) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y -= 0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[2].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyD1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyD2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[2].currentNode].y) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\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\tif(ghosts[2].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[2].currentNode].x) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x -=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[2].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[2].currentNode].x) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[2].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\tghosts[2].oldNode = ghosts[2].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[2].previousNode = ghosts[2].currentNode;\r\n\t\t\t\t\t\t\t\t\tvar sendData;\r\n\t\t\t\t\t\t\t\t\tPac.emit('Inky Arrived', sendData={Player:player,status:\"Arrived@\"+ghosts[2].previousNode, arrived:ghosts[2].previousNode});\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\tif(e.position.y >3.3){\r\n\t\t\t\t\t\t\t\t\tghosts[2].oldNode = ghosts[2].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[2].previousNode = 40;\r\n\t\t\t\t\t\t\t\t\tghosts[2].currentNode = 36;\r\n\t\t\t\t\t\t\t\t\te.position.y = -5.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(e.position.y <-5.3){\r\n\t\t\t\t\t\t\t\t\tghosts[2].oldNode = ghosts[2].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[2].previousNode = 41;\r\n\t\t\t\t\t\t\t\t\tghosts[2].currentNode = 11;\r\n\t\t\t\t\t\t\t\t\te.position.y = 3.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//P1 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P1.position.y)<ghostRadiusY && Math.abs(e.position.x-P1.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Inky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P1,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P2 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P2.position.y)<ghostRadiusY && Math.abs(e.position.x-P2.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P2,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P3 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P3.position.y)<ghostRadiusY && Math.abs(e.position.x-P3.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P3,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P4 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P4.position.y)<ghostRadiusY && Math.abs(e.position.x-P4.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P4,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//Clyde Actions\r\n\t\t\t\t\t\t\telse if (e == Clyde){\t\t\r\n\t\t\t\t\t\t\t\tif(ghosts[3].timer > step){\r\n\t\t\t\t\t\t\t\t\tif(ghosts[3].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[3].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[3].currentNode].y) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y -= 0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[3].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[3].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeD1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeD2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[ghosts[3].currentNode].y) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.y +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\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\tif(ghosts[3].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[3].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[3].currentNode].x) > 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x -=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[3].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[3].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[ghosts[3].currentNode].x) < 0 ){\r\n\t\t\t\t\t\t\t\t\te.position.x +=0.05;\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(ghosts[3].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[3].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = ClydeR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[3].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\tghosts[3].oldNode = ghosts[3].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[3].previousNode = ghosts[3].currentNode;\r\n\t\t\t\t\t\t\t\t\tvar sendData;\r\n\t\t\t\t\t\t\t\t\tPac.emit('Clyde Arrived', sendData={Player:player,status:\"Arrived@\"+ghosts[3].previousNode, arrived:ghosts[3].previousNode});\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\tif(e.position.y >3.3){\r\n\t\t\t\t\t\t\t\t\tghosts[3].oldNode = ghosts[3].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[3].previousNode = 40;\r\n\t\t\t\t\t\t\t\t\tghosts[3].currentNode = 36;\r\n\t\t\t\t\t\t\t\t\te.position.y = -5.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(e.position.y <-5.3){\r\n\t\t\t\t\t\t\t\t\tghosts[3].oldNode = ghosts[3].previousNode;\r\n\t\t\t\t\t\t\t\t\tghosts[3].previousNode = 41;\r\n\t\t\t\t\t\t\t\t\tghosts[3].currentNode = 11;\r\n\t\t\t\t\t\t\t\t\te.position.y = 3.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//P1 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P1.position.y)<ghostRadiusY && Math.abs(e.position.x-P1.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Clyde Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P1,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P2 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P2.position.y)<ghostRadiusY && Math.abs(e.position.x-P2.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P2,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P3 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P3.position.y)<ghostRadiusY && Math.abs(e.position.x-P3.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Pinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P3,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//P4 Collision\r\n\t\t\t\t\t\t\t\tif((Math.abs(e.position.y-P4.position.y)<ghostRadiusY && Math.abs(e.position.x-P4.position.x)<ghostRadiusX) && collisionON){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"Blinky Hit!!\");\r\n\t\t\t\t\t\t\t\t\tCollision(P4,e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//Courage Actions\r\n\t\t\t\t\t\t\telse if (e == Courage && GameStatus == \"Start\"){\r\n\t\t\t\t\t\t\t\t//dOWN\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == false && ghosts[4].direction==1){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageD1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageD2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == true && ghosts[4].direction==1){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_D1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_D2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//uP\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == false && ghosts[4].direction==0){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageU1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageU2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == true && ghosts[4].direction==0){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//lEFT\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == false && ghosts[4].direction==2){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == true && ghosts[4].direction==2){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_L1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_L2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//Right\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == false && ghosts[4].direction==3){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = CourageR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(ghosts[4].Delay < step && cry == true && ghosts[4].direction==3){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[4].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_R1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = Courage_R2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[4].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Pac-mans\r\n\t\t\t\t\t\t\t//Player 1-4 Pacmans\r\n\t\t\t\t\t\t\telse if ((e == P1||e == P2||e == P3 ||e == P4) && !stop && GameStatus == \"Start\"){\t\r\n\t\t\t\t\t\t\t\t\tvar PacNumber = 0; //P1\r\n\t\t\t\t\t\t\t\t\tif(P2 != null && e == P2) PacNumber = 1; //P2\r\n\t\t\t\t\t\t\t\t\tif(P3 != null && e == P3) PacNumber = 2; //P3\r\n\t\t\t\t\t\t\t\t\tif(P4 != null && e == P4) PacNumber = 3; //P3\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ((e.position.y - nodes[pacs[PacNumber].currentNode].y) > 0 ){ // South\r\n\t\t\t\t\t\t\t\t\tif(Math.abs(e.position.y - nodes[pacs[PacNumber].currentNode].y) > (0.05 * pacs[PacNumber].Speed))\r\n\t\t\t\t\t\t\t\t\t\te.position.y -= 0.06 * pacs[PacNumber].Speed;\r\n\t\t\t\t\t\t\t\t\telse e.position.y = nodes[pacs[PacNumber].currentNode].y\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[PacNumber].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber == 0) e.material = P1D1;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\telse if(PacNumber == 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P4U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\tpacs[PacNumber].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber == 0) e.material = P1D2;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\telse if(PacNumber == 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P4U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\tpacs[PacNumber].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.y - nodes[pacs[PacNumber].currentNode].y) < 0 ){ // North\r\n\t\t\t\t\t\t\t\t\tif(Math.abs(e.position.y - nodes[pacs[PacNumber].currentNode].y) > (0.05 * pacs[PacNumber].Speed))\r\n\t\t\t\t\t\t\t\t\t\te.position.y +=0.06 * pacs[PacNumber].Speed;\r\n\t\t\t\t\t\t\t\t\telse e.position.y = nodes[pacs[PacNumber].currentNode].y\r\n\t\t\t\t\t\t\t\t\te.position.y = Math.round(e.position.y*100)/100;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber == 0) e.material = P1U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\telse if(PacNumber == 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P4U1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\tpacs[PacNumber].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber == 0) e.material = P1U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\telse if(PacNumber == 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P4U2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\tpacs[PacNumber].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[pacs[PacNumber].currentNode].x) > 0 ){ // \r\n\t\t\t\t\t\t\t\t\tif(Math.abs(e.position.x - nodes[pacs[PacNumber].currentNode].x) > (0.05 * pacs[PacNumber].Speed))\r\n\t\t\t\t\t\t\t\t\t\te.position.x -=0.06 * pacs[PacNumber].Speed;\r\n\t\t\t\t\t\t\t\t\telse e.position.x = nodes[pacs[PacNumber].currentNode].x\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber == 0) e.material = P1L1;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2R1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3R1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\tpacs[PacNumber].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber==0) e.material = P1L2;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2R2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3R2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=Math.PI;\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\tpacs[PacNumber].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ((e.position.x - nodes[pacs[PacNumber].currentNode].x) < 0 ){\r\n\t\t\t\t\t\t\t\t\tif(Math.abs(e.position.x - nodes[pacs[PacNumber].currentNode].x) > (0.05 * pacs[PacNumber].Speed))\r\n\t\t\t\t\t\t\t\t\t\te.position.x +=0.06 * pacs[PacNumber].Speed;\r\n\t\t\t\t\t\t\t\t\telse e.position.x = nodes[pacs[PacNumber].currentNode].x\t\t\r\n\t\t\t\t\t\t\t\t\te.position.x = Math.round(e.position.x*100)/100;\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\tif(pacs[PacNumber].Model == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber==0)e.material = P1R1;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2R1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3R1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\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}\r\n\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(PacNumber==0)e.material = P1R2;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse if(PacNumber == 1){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P2R2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\telse if(PacNumber == 2){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material = P3R2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\te.material.rotation=0;\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\tpacs[PacNumber].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\tvar sendData;\r\n\t\t\t\t\t\t\t\t\t\t//Pac.emit('Pac 1 Arrived', sendData={Player:player,status:\"Arrived@\"+pacs[0].currentNode});\r\n\t\t\t\t\t\t\t\t\t\tPac.emit('Pac '+(PacNumber+1)+' Arrived', sendData={Player:player,status:\"Arrived@\"+pacs[PacNumber].currentNode});\r\n\t\t\t\t\t\t\t\t\t//Pac.emit('Pac 1 Drunk Arrived', sendData={Player:player,status:\"Arrived@\"+pacs[0].currentNode});\r\n\t\t\t\t\t\t\t\t\t//console.log(\"P1 Arrived Curr: \"+pacs[0].currentNode);\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//Passes 11 heading to node 40 but before it reaches 40 we port it to 36\r\n\t\t\t\t\t\t\t\tif(e.position.y >3.35){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"P1 Curr was \"+pacs[0].currentNode+\" but now it's node 36\");\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].oldNode = pacs[PacNumber].previousNode;\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].previousNode = 40;\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].currentNode = 36;\r\n\t\t\t\t\t\t\t\t\te.position.y = -5.2;\r\n\t\t\t\t\t\t\t\t\t//wait += 0.2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//Passes 36 heading to node 41 but before it reaches 41 we port it to 11\r\n\t\t\t\t\t\t\t\telse if(e.position.y <-5.35){\r\n\t\t\t\t\t\t\t\t\t//console.log(\"P1 Curr was \"+pacs[0].currentNode+\" but now it's node 11\");\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].oldNode = pacs[PacNumber].previousNode;\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].previousNode = 41;\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].currentNode = 11;\r\n\t\t\t\t\t\t\t\t\te.position.y = 3.2;\r\n\t\t\t\t\t\t\t\t\t//wait += 0.2;\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//Checks for Pellets\r\n\t\t\t\t\t\t\t\tfor(var p = 0; p < PelletsList.length; p++)\r\n\t\t\t\t\t\t\t\t\tif(PelletsList[p] != null && (Math.abs(e.position.y-PelletsList[p].y)<0.5 && Math.abs(e.position.x-PelletsList[p].x)<1)){\r\n\t\t\t\t\t\t\t\t\t\t//console.log(p+\". \"+PelletsList[p].name);\r\n\t\t\t\t\t\t\t\t\t\t//console.log(PelletsList[p]);\r\n\t\t\t\t\t\t\t\t\t\tif(PelletsList[p].name != \"Super\"){\r\n\t\t\t\t\t\t\t\t\t\t\t//P1Score+=10;\r\n\t\t\t\t\t\t\t\t\t\t\t//text = \"Player 1: \"+P1Score;\r\n\t\t\t\t\t\t\t\t\t\t\t//P1Texture.clear('Black').drawText(text, 12, 306, 'Red');\r\n\t\t\t\t\t\t\t\t\t\t\t//P1Mesh.material. map= P1Texture.texture;\r\n\t\t\t\t\t\t\t\t\t\t\tvar data = {\r\n\t\t\t\t\t\t\t\t\t\t\t\tPlayer: (player-1),\r\n\t\t\t\t\t\t\t\t\t\t\t\tscore: 10\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif(PacNumber == (player-1))\r\n\t\t\t\t\t\t\t\t\t\t\t\tPac.emit('Update Scores',data);\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\t\t\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\t\t\te.scale.set(1.75,1.25,0);\r\n\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].Speed = 1.25;\r\n\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].sizeCD = 120;\r\n\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].speedCD = 120;\r\n\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].sizeB = true;\r\n\t\t\t\t\t\t\t\t\t\t\tpacs[PacNumber].speedB = true;\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(pacs[P1.material.name].Status);\r\n\t\t\t\t\t\t\t\t\t\t\tpacs[P1.material.name].Status = \"Super\";\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(pacs[P1.material.name].Status);\r\n\t\t\t\t\t\t\t\t\t\t\t//Pac.emit('Update Scores',data);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tscene.remove(PelletsList[p].Pellet);\r\n\t\t\t\t\t\t\t\t\t\tPelletsList.splice(p,1);\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif(PelletsList.length == 0) Pac.emit('Pellets');\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Effects and Boosts Timers/CountDown\r\n\t\t\t\t\t\t\t\t//Size\r\n\t\t\t\t\t\t\t\tif(pacs[PacNumber].sizeB == true && pacs[PacNumber].sizeCD > 0){\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].sizeCD -= 0.1;\r\n\t\t\t\t\t\t\t\t\t//console.log(\"size: \"+pacs[0].sizeCD+\"/100\")\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse if(pacs[PacNumber].sizeB == true) {\r\n\t\t\t\t\t\t\t\t\te.scale.set(1.25,.75,0);\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].sizeB = false;\r\n\t\t\t\t\t\t\t\t\tconsole.log(\"size returns to normal\")\r\n\t\t\t\t\t\t\t\t\tpacs[P1.material.name].Status = \"Normal\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//Speed\r\n\t\t\t\t\t\t\t\tif(pacs[PacNumber].speedB == true && pacs[PacNumber].speedCD > 0){\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].speedCD -= 0.1;\r\n\t\t\t\t\t\t\t\t\t//console.log(\"speed: \"+pacs[0].speedCD+\"/100\")\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse if(pacs[PacNumber].speedB == true){\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].Speed = 1;\r\n\t\t\t\t\t\t\t\t\tpacs[PacNumber].speedB = false;\r\n\t\t\t\t\t\t\t\t\tconsole.log(\"speed returns to normal\")\r\n\t\t\t\t\t\t\t\t\tpacs[P1.material.name].Status = \"Normal\";\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}\r\n\t\t\t\t\t\t//Going from SplashScreen to StartScreen\t\r\n\t\t\t\t\t\t//GameStatus = \"StartScreen\";\r\n\t\t\t\t\t\telse if(GameStatus == \"Splash_Screen_Transition\"){\r\n\t\t\t\t\t\t\tif(e == Title && e.position.y < 4.25)\r\n\t\t\t\t\t\t\t\te.position.y += 0.25;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Just so that it will wait until the Title fully moves up to activate the start screen\r\n\t\t\t\t\t\t\tif(e == Title && e.position.y >= 4.25)\r\n\t\t\t\t\t\t\t\tGameStatus = \"StartScreen\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//StartScreen\r\n\t\t\t\t\t\telse if(GameStatus == \"StartScreen\"){\r\n\t\t\t\t\t\t\t//Title Positioning\r\n\t\t\t\t\t\t\tif(e == Title && e.position.y < 4.25)\r\n\t\t\t\t\t\t\t\te.position.y += 0.25;\r\n\t\t\t\t\t\t\t//Start Game Positioning\r\n\t\t\t\t\t\t\tif(e == StartGameMesh && e.position.y > 0.25)\r\n\t\t\t\t\t\t\t\te.position.y -= 0.1;\r\n\t\t\t\t\t\t\t//About Positioning\r\n\t\t\t\t\t\t\tif(e == AboutMesh && e.position.y > -4.5)\r\n\t\t\t\t\t\t\t\te.position.y -= 0.1;\r\n\t\t\t\t\t\t\tif(e == AboutMesh && e.position.x > -5)\r\n\t\t\t\t\t\t\t\te.position.x -= 0.1;\r\n\t\t\t\t\t\t\tif(e == AboutMesh && e.position.y < -4.5)\r\n\t\t\t\t\t\t\t\te.position.y += 0.1;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Credits Positioning\r\n\t\t\t\t\t\t\tif(e == CreditsMesh && e.position.y > -4.5)\r\n\t\t\t\t\t\t\t\te.position.y -= 0.1;\r\n\t\t\t\t\t\t\tif(e == CreditsMesh && e.position.x < 5)\r\n\t\t\t\t\t\t\t\te.position.x += 0.1;\r\n\t\t\t\t\t\t\tif(e == CreditsMesh && e.position.y < -4.5)\r\n\t\t\t\t\t\t\t\te.position.y += 0.1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//For the About Section\r\n\t\t\t\t\t\telse if(GameStatus == \"About\"){\r\n\t\t\t\t\t\t\tif(e == AboutMesh){\r\n\t\t\t\t\t\t\t\tif(e.position.y<3) e.position.y+=0.1;\r\n\t\t\t\t\t\t\t\tif(e.position.x<0) e.position.x+=0.1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(e == StartGameMesh && e.position.y<8){\r\n\t\t\t\t\t\t\t\te.position.y+=0.1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(e == CreditsMesh && e.position.y>-8){\r\n\t\t\t\t\t\t\t\te.position.y-=0.1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(e == groupMesh && e.position.y<7.5){\r\n\t\t\t\t\t\t\t\t//e.position.y+=0.1;\r\n\t\t\t\t\t\t\t\t//console.log(\"Y: \"+groupMesh.position.y);\r\n\t\t\t\t\t\t\t\te.position.y+=0.1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(e == closeMesh && e.position.y<-5.5){\r\n\t\t\t\t\t\t\t\te.position.y+=0.1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//For the About Section\r\n\t\t\t\t\t\telse if(GameStatus == \"Credits\"){\r\n\t\t\t\t\t\t\tif(e == CreditsMesh){\r\n\t\t\t\t\t\t\t\tif(e.position.y<3) e.position.y+=0.1;\r\n\t\t\t\t\t\t\t\tif(e.position.x>0) e.position.x-=0.1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(e == StartGameMesh && e.position.y<8)\r\n\t\t\t\t\t\t\t\te.position.y+=0.1;\r\n\t\t\t\t\t\t\telse if(e == AboutMesh && e.position.y>-8)\r\n\t\t\t\t\t\t\t\te.position.y-=0.1;\r\n\t\t\t\t\t\t\telse if(e == closeMesh && e.position.y<-5.5)\r\n\t\t\t\t\t\t\t\te.position.y+=0.1;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if((GameStatus == \"StartScreen\" || GameStatus == \"SplashScreen\") && (e == startGhost1 || e == startGhost2 || e == startGhost3\r\n\t\t\t\t\t\t\t\t|| e == startGhost4 || e == startGhost5 || e == startGhost6 ||e == startGhost7|| e == startGhost8)){\r\n\t\t\t\t\t\t\t\t\tif(e.position.x<11 && e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\te.position.x+=0.08;\r\n\t\t\t\t\t\t\t\t\t\tif(e.position.x > 11 && GameStatus == \"SplashScreen\") e.position.x = -10;\r\n\t\t\t\t\t\t\t\t\t\telse if(e.position.x > 11) scene.remove(e);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if(e.position.x > -11 && e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\te.position.x-=0.04;\r\n\t\t\t\t\t\t\t\t\t\tif(e.position.x < -11 && GameStatus == \"SplashScreen\") e.position.x = 10;\r\n\t\t\t\t\t\t\t\t\t\telse if(e.position.x < -11) scene.remove(e);\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\tif((e == startGhost1) || (e == startGhost5)){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[0].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\t\tif(ghosts[0].Model == 0 && e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(ghosts[0].Model == 0 && e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = BlinkyL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[0].Delay = step + 1;\r\n\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\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if( e == startGhost2 || e == startGhost6){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\t\tif(ghosts[1].Model == 0 && e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(ghosts[1].Model == 0 && e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = PinkyL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\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\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if( e == startGhost3){\r\n\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Delay < step){\r\n\t\t\t\t\t\t\t\t\t\t\tif(ghosts[2].Model == 0 && e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyR1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[1].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(e.position.y > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyR2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(ghosts[2].Model == 0 && e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyL1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse if(e.position.y < 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\te.material = InkyL2;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Model = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tghosts[2].Delay = step + 1;\r\n\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\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\telse if( e == groupMesh || e== closeMesh)\r\n\t\t\t\t\t\t\tscene.remove(e);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t}catch(e){\r\n\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t//He HE HE don't say a word if errors happen\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Loading Nodes\r\n\t\tfunction load_Nodes(){\r\n\t\t\t// Node Data includes, x and y positioning,\r\n\t\t\t//NODE 0\r\n\t\t\tvar connection = [1,6];\r\n\t\t\tvar node = {x:-8, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:1,South:6,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 1\r\n\t\t\tvar connection = [0,2,4];\r\n\t\t\tvar node = {x:-5, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:2,South:4,West:0};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 2\r\n\t\t\tvar connection = [1,5];\r\n\t\t\tvar node = {x:-2, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:-1,South:5,West:1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 3\r\n\t\t\tvar connection = [4,7];\r\n\t\t\tvar node = {x:-6, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:4,South:7,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 4\r\n\t\t\tvar connection = [1,3,5];\r\n\t\t\tvar node = {x:-5, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:1, East:5,South:-1,West:3};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 5\r\n\t\t\tvar connection = [2,4,11,21];\r\n\t\t\tvar node = {x:-2, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:2, East:11,South:21,West:4};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 6\r\n\t\t\tvar connection = [0,7,22];\r\n\t\t\tvar node = {x:-8, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:0, East:7,South:22,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 7\r\n\t\t\tvar connection = [3,6,18];\r\n\t\t\tvar node = {x:-6, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:3, East:-1,South:18,West:6};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 8\r\n\t\t\tvar connection = [9,12];\r\n\t\t\tvar node = {x:2, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:9,South:12,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 9\r\n\t\t\tvar connection = [8,10,14];\r\n\t\t\tvar node = {x:6, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:10,South:14,West:8};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 10\r\n\t\t\tvar connection = [9,15];\r\n\t\t\tvar node = {x:8, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:-1,South:15,West:9};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 11--left off here!!! it needs the Upward node\r\n\t\t\tvar connection = [5,12,40];\r\n\t\t\tvar node = {x:0, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:40, East:12,South:-1,West:5};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 12\r\n\t\t\tvar connection = [8,11,16];\r\n\t\t\tvar node = {x:2, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:8, East:-1,South:16,West:11};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 13\r\n\t\t\tvar connection = [14,17];\r\n\t\t\tvar node = {x:5, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:14,South:17,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 14\r\n\t\t\tvar connection = [9,13,15];\r\n\t\t\tvar node = {x:6, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:9, East:15,South:-1,West:13};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 15\r\n\t\t\tvar connection = [10,14,29];\r\n\t\t\tvar node = {x:8, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:10, East:-1,South:29,West:14};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 16\r\n\t\t\tvar connection = [12,17,31];\r\n\t\t\tvar node = {x:2, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:12, East:17,South:31,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 17\r\n\t\t\tvar connection = [13,16];\r\n\t\t\tvar node = {x:5, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:13, East:-1,South:-1,West:16};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 18\r\n\t\t\tvar connection = [7,19];\r\n\t\t\tvar node = {x:-6, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:7, East:19,South:-1,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 19\r\n\t\t\tvar connection = [18,23];\r\n\t\t\tvar node = {x:-5, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:-1,South:23,West:18};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 20\r\n\t\t\tvar connection = [21,24];\r\n\t\t\tvar node = {x:-3, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:21,South:24,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 21\r\n\t\t\tvar connection = [5,20,30];\r\n\t\t\tvar node = {x:-2, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:5, East:30,South:-1,West:20};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 22\r\n\t\t\tvar connection = [6,23,25];\r\n\t\t\tvar node = {x:-8, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:6, East:23,South:25,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 23\r\n\t\t\tvar connection = [19,22,24,26];\r\n\t\t\tvar node = {x:-5, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:19, East:24,South:26,West:22};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 24\r\n\t\t\tvar connection = [20,23,27];\r\n\t\t\tvar node = {x:-3, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:20, East:-1,South:27,West:23};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 25\r\n\t\t\tvar connection = [22,26];\r\n\t\t\tvar node = {x:-8, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:22, East:26,South:-1,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 26\r\n\t\t\tvar connection = [23,25,27];\r\n\t\t\tvar node = {x:-5, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:23, East:27,South:-1,West:25};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 27\r\n\t\t\tvar connection = [24,26,36];\r\n\t\t\tvar node = {x:-3, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:24, East:36,South:-1,West:26};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 28\r\n\t\t\tvar connection = [29,34];\r\n\t\t\tvar node = {x:6, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:29,South:34,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 29\r\n\t\t\tvar connection = [15,28,35];\r\n\t\t\tvar node = {x:8, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:15, East:-1,South:35,West:28};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 30\r\n\t\t\tvar connection = [21,31,36];\r\n\t\t\tvar node = {x:0, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:31,South:36,West:21};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 31\r\n\t\t\tvar connection = [16,30,32];\r\n\t\t\tvar node = {x:2, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:16, East:-1,South:32,West:30};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 32\r\n\t\t\tvar connection = [31,33];\r\n\t\t\tvar node = {x:2, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:31, East:33,South:-1,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 33\r\n\t\t\tvar connection = [32,34,37];\r\n\t\t\tvar node = {x:3, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:-1, East:34,South:37,West:32};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 34\r\n\t\t\tvar connection = [28,33,35,38];\r\n\t\t\tvar node = {x:6, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:28, East:35,South:38,West:33};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 35\r\n\t\t\tvar connection = [29,34,39];\r\n\t\t\tvar node = {x:8, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:29, East:-1,South:39,West:34};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 36\r\n\t\t\tvar connection = [27,30,37,41];\r\n\t\t\tvar node = {x:0, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:30, East:37,South:41,West:27};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 37\r\n\t\t\tvar connection = [36,33];\r\n\t\t\tvar node = {x:3, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:33, East:-1,South:-1,West:36};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 38\r\n\t\t\tvar connection = [34,39];\r\n\t\t\tvar node = {x:6, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:34, East:39,South:-1,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 39\r\n\t\t\tvar connection = [38,35];\r\n\t\t\tvar node = {x:8, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:35, East:-1,South:-1,West:38};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 40// This node is meant for the Ghost to be lead upward\r\n\t\t\t//var connection = [11,42]; to much to remove..gonna just leave it\r\n\t\t\tvar connection = [36];\r\n\t\t\tvar node = {x:0, y:5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:41, East:-1,South:11,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t\t//NODE 41// This node is meant for the Ghost to be lead downward\r\n\t\t\t//var connection = [11]; No connections cause it's for moving\r\n\t\t\tvar connection = [11];\r\n\t\t\tvar node = {x:0, y:-7.5, Connectednodes:connection,\r\n\t\t\t\t\t\tNorth:36, East:-1,South:40,West:-1};\r\n\t\t\tnodes.push(node);\r\n\t\t}\r\n\t\t\r\n\t\t//RadomDirections\r\n\t\tfunction RandomDirection(gNum){ //gNum the number of the ghosts\r\n\t\t\t//Randomly finds a new direction from before\r\n\t\t\tdirection = (Math.floor(Math.random()*20))%4;\r\n\t\t\t\r\n\t\t\t//Blinky\r\n\t\t\tif (direction == 0 && ghosts[gNum].Name == \"Blinky\") {\r\n\t\t\t\tghosts[gNum].direction = 0;\r\n\t\t\t\tBlinky.material = BlinkyU1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 1 && ghosts[gNum].Name == \"Blinky\") {\r\n\t\t\t\tghosts[gNum].direction = 1;\r\n\t\t\t\tBlinky.material = BlinkyD1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 2 && ghosts[gNum].Name == \"Blinky\") {\r\n\t\t\t\tghosts[gNum].direction = 2;\r\n\t\t\t\tBlinky.material = BlinkyL1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 3 && ghosts[gNum].Name == \"Blinky\") {\r\n\t\t\t\tghosts[gNum].direction = 3;\r\n\t\t\t\tBlinky.material = BlinkyR1;\r\n\t\t\t}\r\n\t\t\t//Pinky\r\n\t\t\telse if (direction == 0 && ghosts[gNum].Name == \"Pinky\") {\r\n\t\t\t\tghosts[gNum].direction = 0;\r\n\t\t\t\tPinky.material = PinkyU1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 1 && ghosts[gNum].Name == \"Pinky\") {\r\n\t\t\t\tghosts[gNum].direction = 1;\r\n\t\t\t\tPinky.material = PinkyD1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 2 && ghosts[gNum].Name == \"Pinky\") {\r\n\t\t\t\tghosts[gNum].direction = 2;\r\n\t\t\t\tPinky.material = PinkyL1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 3 && ghosts[gNum].Name == \"Pinky\") {\r\n\t\t\t\tghosts[gNum].direction = 3;\r\n\t\t\t\tPinky.material = PinkyR1;\r\n\t\t\t}\r\n\t\t\t//Inky\r\n\t\t\telse if (direction == 0 && ghosts[gNum].Name == \"Inky\") {\r\n\t\t\t\tghosts[gNum].direction = 0;\r\n\t\t\t\tInky.material = InkyU1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 1 && ghosts[gNum].Name == \"Inky\") {\r\n\t\t\t\tghosts[gNum].direction = 1;\r\n\t\t\t\tInky.material = InkyD1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 2 && ghosts[gNum].Name == \"Inky\") {\r\n\t\t\t\tghosts[gNum].direction = 2;\r\n\t\t\t\tInky.material = InkyL1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 3 && ghosts[gNum].Name == \"Inky\") {\r\n\t\t\t\tghosts[gNum].direction = 3;\r\n\t\t\t\tInky.material = InkyR1;\r\n\t\t\t}\r\n\t\t\t//Clyde\r\n\t\t\telse if (direction == 0 && ghosts[gNum].Name == \"Clyde\") {\r\n\t\t\t\tghosts[gNum].direction = 0;\r\n\t\t\t\tClyde.material = ClydeU1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 1 && ghosts[gNum].Name == \"Clyde\") {\r\n\t\t\t\tghosts[gNum].direction = 1;\r\n\t\t\t\tClyde.material = ClydeD1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 2 && ghosts[gNum].Name == \"Clyde\") {\r\n\t\t\t\tghosts[gNum].direction = 2;\r\n\t\t\t\tClyde.material = ClydeL1;\r\n\t\t\t}\r\n\t\t\telse if (direction == 3 && ghosts[gNum].Name == \"Clyde\") {\r\n\t\t\t\tghosts[gNum].direction = 3;\r\n\t\t\t\tClyde.material = ClydeR1;\r\n\t\t\t}\r\n\t\t\tghosts[gNum].Step = step+1;\r\n\t\t}\r\n\t\t\r\n\t\t//Loading Level 1\r\n\t\tfunction loading_Level_1(){\r\n\t\t\t//GameStatus = \"Start\";\r\n\t\t\t//console.log(GameStatus);\r\n\t\t\t//BoxGeometry(width : Float, height : Float, depth : Float, widthSegments : Integer, heightSegments : Integer, depthSegments : Integer)\r\n\t\t\t//width — Width of the sides on the X axis. Default is 1.\r\n\t\t\t//height — Height of the sides on the Y axis. Default is 1.\r\n\t\t\t//depth — Depth of the sides on the Z axis. Default is 1.\r\n\t\t\t//widthSegments — Optional. Number of segmented faces along the width of the sides. Default is 1.\r\n\t\t\t//heightSegments — Optional. Number of segmented faces along the height of the sides. Default is 1.\r\n\t\t\t//depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1.\r\n\t\t\t\r\n\t\t\tMyScore = 0;\r\n\t\t\t//Never Change\r\n\t\t\tvar material = new THREE.MeshBasicMaterial( {color: 0x0000ff} );\r\n\t\t\t//Outer Walls\r\n\t\t\t//Left Wall\r\n\t\t\tvar geometry = new THREE.BoxGeometry( 0.5, 9.5, 0 );\r\n\t\t\tvar material = new THREE.MeshBasicMaterial( {color: 0x0000ff} );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-9, -1, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\t\t\t\r\n\t\t\t//Right Wall\r\n\t\t\tvar geometry = new THREE.BoxGeometry( 0.5, 9.5, 0 );\r\n\t\t\tvar material = new THREE.MeshBasicMaterial( {color: 0x0000ff} );\r\n\t\t\tvar cube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(9, -1, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Top Left Wall\r\n\t\t\tgeometry = new THREE.BoxGeometry( 8, 0.5, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-4.75, 3.75, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Top Right Wall\r\n\t\t\tgeometry = new THREE.BoxGeometry( 8, 0.5, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(4.75, 3.75, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Bottom Left Wall\r\n\t\t\tgeometry = new THREE.BoxGeometry( 8, 0.5, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-4.75, -5.75, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Bottom Right Wall\r\n\t\t\tgeometry = new THREE.BoxGeometry( 8, 0.5, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(4.75, -5.75, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Blocks for the game\r\n\t\t\t//B1\r\n\t\t\tgeometry = new THREE.BoxGeometry( 0.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-7, 1.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B2\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-6.5, 2, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B3\r\n\t\t\tgeometry = new THREE.BoxGeometry( 0.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-1, 2.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B4\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-3.5, 2, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B5\r\n\t\t\tgeometry = new THREE.BoxGeometry( 2.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-4, 0, 35);\r\n\t\t\tscene.add( cube );\t\t\r\n\t\t\tLevel.push(cube);\t\t\t\r\n\t\t\t//B6\r\n\t\t\tgeometry = new THREE.BoxGeometry( 0.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(1, 2.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B7\r\n\t\t\tgeometry = new THREE.BoxGeometry( 2.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(4, 2, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B8\r\n\t\t\tgeometry = new THREE.BoxGeometry( .5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(7, 2, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B9\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(3.5, 1, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B10\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(6.5, 0, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B11\r\n\t\t\tgeometry = new THREE.BoxGeometry( 0.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-7, -1.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B12\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-6.5, -2, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B13\r\n\t\t\tgeometry = new THREE.BoxGeometry( 0.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-4, -1.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B14\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-3.5, -1, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B15\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-1.5, -3.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B16\r\n\t\t\tgeometry = new THREE.BoxGeometry( .5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-4, -4, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\t\t\t\r\n\t\t\t//B17\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(-6.5, -4, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B18\r\n\t\t\tgeometry = new THREE.BoxGeometry( 2.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(4, -1.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B19\r\n\t\t\tgeometry = new THREE.BoxGeometry( .5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(7, -2, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B20\r\n\t\t\tgeometry = new THREE.BoxGeometry( 0.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(1, -3.5, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B21\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(1.5, -4, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B22\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(4.5, -4.5, 35);\r\n\t\t\tscene.add( cube );\t\t\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B23\r\n\t\t\tgeometry = new THREE.BoxGeometry( .5, 1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(7, -4, 35);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//B24\r\n\t\t\tgeometry = new THREE.BoxGeometry( 4.77, 0.1, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(5.3, -0.5, 34);\r\n\t\t\tscene.add( cube );\t\t\r\n\t\t\tLevel.push(cube);\r\n\t\t\t\r\n\t\t\t//Ghost Yard\r\n\t\t\t//Outer Court\r\n\t\t\tvar material = new THREE.MeshBasicMaterial( {color: 0x456099} );\r\n\t\t\tgeometry = new THREE.BoxGeometry( 2.75, 2.25, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(0, -0.5, 34);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Inner Court\r\n\t\t\tvar material = new THREE.MeshBasicMaterial( {color: 0x556B2F} );\r\n\t\t\tgeometry = new THREE.BoxGeometry( 2.5, 2, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(0, -0.5, 34);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t\t//Court Door\r\n\t\t\tvar material = new THREE.MeshBasicMaterial( {color: 0x556B2F} );\r\n\t\t\tgeometry = new THREE.BoxGeometry( 1.5, 0.5, 0 );\r\n\t\t\tcube = new THREE.Mesh( geometry, material );\r\n\t\t\tcube.position.set(0, 0.4, 34);\r\n\t\t\tscene.add( cube );\r\n\t\t\tLevel.push(cube);\r\n\t\t}\r\n\t\t\r\n\t\t//Loads the Fruits Sprites Sheet\r\n\t\tfunction load_Fruits(){\r\n\t\t\t//Loader for Sprites\r\n\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\tloader.crossOrigin = true;\r\n\t\t\t\r\n\t\t\t/*List of Fruits\r\n\t\t\t\tFruit 0 - Apple\r\n\t\t\t\tFruit 1 - Banana\r\n\t\t\t\tFruit 2 - Cherry\r\n\t\t\t\tFruit 3 - Orange\r\n\t\t\t\tFruit 4 - Pear\r\n\t\t\t\tFruit 5 - Pretzel\r\n\t\t\t\tFruit 6 - Strawberry\r\n\t\t\t\tFruit 7 - Grape\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\t//Apple-0\r\n\t\t\tvar Texture00 = loader.load( 'Images/Fruits/Apple.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tApple = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Apple);\r\n\t\t\t//Banana-1\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Banana.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tBanana = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Banana);\r\n\t\t\t//Cherry-2\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Cherry.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tCherry = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Cherry);\r\n\t\t\t//Orange-3\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Orange.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tOrange = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Orange);\r\n\t\t\t//Pear-4\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Pear.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tPear = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Pear);\r\n\t\t\t//Pretzel-5\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Pretzel.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tPretzel = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Pretzel);\r\n\t\t\t//Strawberry-6\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Strawberry.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tStrawberry = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Strawberry);\t\t\r\n\t\t\t//Grapes lol I made this one!!! :D-7\r\n\t\t\tTexture00 = loader.load( 'Images/Fruits/Grapes.png' );\r\n\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\tGrapes = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\tFruits.push(Grapes);\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tFruit = new THREE.Sprite();\r\n\t\t\t//Fruit.scale.set(0.8,0.8,1);\t\r\n\t\t\t//scene.add(Fruit);\r\n\t\t\t//Fruit.position.set(-8.25,-5.25,34);\r\n\t\t\t\r\n\t\t\t////Pellets lol I made this one too!!! :D\r\n\t\t\t//Texture00 = loader.load( 'Images/Fruits/Pellets.png' );\r\n\t\t\t//Texture00.minFilter = THREE.LinearFilter;\r\n\t\t\t//var Pells = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t//Pellets = new THREE.Sprite(Pells);\t\r\n\t\t\t//Pellets.scale.set(1,0.75,1);\t\r\n\t\t\t//scene.add(Pellets);\r\n\t\t}\r\n\t\t\r\n\t\t//Insert Pellets\r\n\t\tfunction insertPellets(startNode, endNode,superPelletBoolean){\r\n\t\t\t//Pellets - Vertical Insertion\r\n\t\t\t//There should be a gap of a 0.5\r\n\t\t\t\r\n\t\t\t//Pellets - Horizontal Insertion\r\n\t\t\t//There should be a gap of a 1.0\r\n\t\t\t\r\n\t\t\t// Lesser number is always the first Node\r\n\t\t\t// Greater number is always the second Node\r\n\t\t\t\r\n\t\t\tif(startNode > endNode){\r\n\t\t\t\tvar temp = startNode;\r\n\t\t\t\tstartNode = endNode;\r\n\t\t\t\tendNode = temp;\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(Math.abs(nodes[startNode].x - nodes[endNode].x)!=0){\r\n\t\t\t\t//Horizontal Pellets Insertion\r\n\t\t\t\tfor(var p = 0; (nodes[startNode].x + p) <= nodes[endNode].x; p++){\r\n\t\t\t\t\tvar superP =\"pellet\";\r\n\t\t\t\t\t/**\r\n\t\t\t\t\tif(p==0 && superPelletBoolean == true){\r\n\t\t\t\t\t\tvar obj = superDot();\r\n\t\t\t\t\t\tsuperP =\"Super\";\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\telse**/\r\n\t\t\t\t\t\tvar obj = createDot();\r\n\t\t\t\t\tobj.position.set(nodes[startNode].x + p,nodes[startNode].y,35);\r\n\t\t\t\t\tscene.add(obj);\r\n\t\t\t\t\tvar pel = {\r\n\t\t\t\t\tPellet:obj,\r\n\t\t\t\t\tx:nodes[startNode].x + p,\r\n\t\t\t\t\ty:nodes[startNode].y,\r\n\t\t\t\t\tname: superP\r\n\t\t\t\t}\r\n\t\t\t\tPelletsList.push(pel);\r\n\t\t\t\t}\r\n\t\t\t\t//console.log(\"Pellets from Start Node: \"+startNode+\" End Node: \"+endNode);\r\n\t\t\t}\r\n\t\t\telse if(Math.abs(nodes[startNode].y - nodes[endNode].y)!=0){\r\n\t\t\t\t//Vertical Pellet Insertion\r\n\t\t\t\tfor(var p = 0; (nodes[startNode].y - p*0.5) >= nodes[endNode].y; p++){\r\n\t\t\t\t\tvar superP =\"pellet\";\r\n\t\t\t\t\t/**\r\n\t\t\t\t\tif(p==0 && superPelletBoolean == true){\r\n\t\t\t\t\t\tvar obj = superDot();\r\n\t\t\t\t\t\tsuperP =\"Super\";\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\telse**/\r\n\t\t\t\t\tvar obj = createDot();\r\n\t\t\t\t\tobj.position.set(nodes[startNode].x,nodes[startNode].y - p*0.5,35);\r\n\t\t\t\t\tscene.add(obj);\r\n\t\t\t\t\tvar pel = {\r\n\t\t\t\t\tPellet:obj,\r\n\t\t\t\t\tx:nodes[startNode].x,\r\n\t\t\t\t\ty:nodes[startNode].y - p*0.5,\r\n\t\t\t\t\tname: superP\r\n\t\t\t\t\t}\r\n\t\t\t\t\tPelletsList.push(pel);\r\n\t\t\t\t}\r\n\t\t\t\t//console.log(\"Pellets from Start Node: \"+startNode+\" End Node: \"+endNode);\r\n\t\t\t}\r\n\t\t\telse console.log(\"ERROR with Pellets Start: \"+startNode+\" End: \"+endNode+\" Bool: \"+superPelletBoolean);\r\n\t\t}\r\n\t\t\r\n\t\t//Loads the Score at the top\r\n\t\tfunction load_Score(){\r\n\t\t\t//2D Text\r\n\t\t\t\r\n\t\t\t//Player 1 Score\r\n\t\t\tP1Score=0;\r\n\t\t\ttext = \"Player 1: \"+P1Score;\r\n\t\t\tP1Texture = new THREEx.DynamicTexture(512,512)\r\n\t\t\tP1Texture.context.font\t= \"bolder 37px Verdana\";\r\n\t\t\tP1Texture.clear('Black').drawText(text, 12, 306, 'Red');\r\n\t\t\t//Adding Texture to the Scene\r\n\t\t\tDyGeometry = new THREE.PlaneGeometry( 7, 5, 1);\r\n\t\t\tDyMaterial = new THREE.MeshBasicMaterial({\r\n\t\t\t\tmap\t: P1Texture.texture\r\n\t\t\t});\r\n\t\t\tP1Mesh = new THREE.Mesh( DyGeometry, DyMaterial );\r\n\t\t\tP1Mesh.position.set(-5.9,4.65,35);\r\n\t\t\t//scene.add( P1Mesh );\r\n\t\t\t\r\n\t\t\t//Player 2 Score\r\n\t\t\tP2Score=0;\r\n\t\t\ttext = \"Player 2: \"+P2Score;\r\n\t\t\tP2Texture = new THREEx.DynamicTexture(512,512)\r\n\t\t\tP2Texture.context.font\t= \"bolder 37px Verdana\";\r\n\t\t\tP2Texture.clear('Black').drawText(text, 12, 306, 'DeepSkyBlue');\r\n\t\t\t//Adding Texture to the Scene\r\n\t\t\tDyGeometry = new THREE.PlaneGeometry( 7, 5, 1);\r\n\t\t\tDyMaterial = new THREE.MeshBasicMaterial({\r\n\t\t\t\tmap\t: P2Texture.texture\r\n\t\t\t});\r\n\t\t\tP2Mesh = new THREE.Mesh( DyGeometry, DyMaterial );\r\n\t\t\tP2Mesh.position.set(-1,4.65,35);\r\n\t\t\t//scene.add( P2Mesh );\r\n\t\t\t\r\n\t\t\t//Player 3 Score\r\n\t\t\tP3Score=0;\r\n\t\t\ttext = \"Player 3: \"+P3Score;\r\n\t\t\tP3Texture = new THREEx.DynamicTexture(512,512)\r\n\t\t\tP3Texture.context.font\t= \"bolder 37px Verdana\";\r\n\t\t\tP3Texture.clear('Black').drawText(text, 12, 306, 'Lime');\r\n\t\t\t//Adding Texture to the Scene\r\n\t\t\tDyGeometry = new THREE.PlaneGeometry( 7, 5, 1);\r\n\t\t\tDyMaterial = new THREE.MeshBasicMaterial({\r\n\t\t\t\tmap\t: P3Texture.texture\r\n\t\t\t});\r\n\t\t\tP3Mesh = new THREE.Mesh( DyGeometry, DyMaterial );\r\n\t\t\tP3Mesh.position.set(3.75,4.65,35);\r\n\t\t\t//scene.add( P3Mesh );\r\n\t\t\t\r\n\t\t\t//Player 4 Score\r\n\t\t\tP4Score=0;\r\n\t\t\ttext = \"Player 4: \"+P4Score;\r\n\t\t\tP4Texture = new THREEx.DynamicTexture(512,512)\r\n\t\t\tP4Texture.context.font\t= \"bolder 37px Verdana\";\r\n\t\t\tP4Texture.clear('Black').drawText(text, 12, 306, 'DarkViolet');\r\n\t\t\t//Adding Texture to the Scene\r\n\t\t\tDyGeometry = new THREE.PlaneGeometry( 7, 5, 1);\r\n\t\t\tDyMaterial = new THREE.MeshBasicMaterial({\r\n\t\t\t\tmap\t: P4Texture.texture\r\n\t\t\t});\r\n\t\t\tP4Mesh = new THREE.Mesh( DyGeometry, DyMaterial );\r\n\t\t\tP4Mesh.position.set(8.5,4.65,35);\r\n\t\t\t//scene.add( P4Mesh );\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\ttext = \"Player 1: 1\";\r\n\t\t\tdynamicTexture.clear('Black').drawText(text, 12, 306, 'Red')\r\n\t\t\tP1Mesh.material. map= dynamicTexture.texture;\r\n\t\t\t**/\r\n\t\t\t//Source for 2D Text\r\n\t\t\t//http://learningthreejs.com/blog/2014/05/02/easy-to-use-dynamic-texture-to-write-text-in-your-3d-object-with-threex-dot-dynamictexture-game-extensions-for-three-dot-js/\r\n\t\t\t//https://github.com/jeromeetienne/threex.dynamictexture\r\n\t\t}\r\n\t\t\r\n\t\t//Loads the Ghost Sprite Sheets\r\n\t\tfunction load_GhostSprite(){\r\n\t\t\t//Sprites\t\t\t\r\n\t\t\t\t//Loader for sprites\r\n\t\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\tloader.crossOrigin = true;\r\n\t\t\t\t\r\n\t\t\t\t//Full Blinky\r\n\t\t\t\tvar Texture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyL1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyL1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyL2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyL2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyU1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyU1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyU2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyU2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyR1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyR1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyR2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyR2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyD1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyD1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Blinky/BlinkyD2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tBlinkyD2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tBlinky = new THREE.Sprite(BlinkyL1);\t\r\n\t\t\t\t\r\n\t\t\t\t//Full Pinky\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyL1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyL1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyL2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyL2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyU1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyU1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyU2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyU2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyR1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyR1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyR2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyR2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyD1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyD1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Pinky/PinkyD2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tPinkyD2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tPinky = new THREE.Sprite(PinkyL1);\r\n\t\t\t\t\r\n\t\t\t\t//Full Inky\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyL1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyL1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyL2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyL2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyU1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyU1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyU2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyU2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyR1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyR1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyR2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyR2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyD1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyD1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Inky/InkyD2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tInkyD2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tInky = new THREE.Sprite(InkyL1);\r\n\t\t\t\t\r\n\t\t\t\t//Full Clyde\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeL1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeL1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeL2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeL2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeU1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeU1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeU2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeU2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeR1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeR1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeR2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeR2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeD1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeD1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Clyde/ClydeD2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tClydeD2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tClyde = new THREE.Sprite(ClydeL1);\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageD1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageD1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageD2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageD2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageU1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageU1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageU2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageU2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageL1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageL1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageL2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageL2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageR1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageR1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/CourageR2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourageR2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!D1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_D1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!D2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_D2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!U1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_U1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!U2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_U2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!L1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_L1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!L2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_L2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!R1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_R1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tTexture00 = loader.load( 'Images/Ghosts/Courage/Courage!R2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tCourage_R2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tCourage = new THREE.Sprite(CourageD1);\t\r\n\t\t\t\t\r\n\t\t\t\tghosts= [];\t\t\t\t\t\r\n\t\t\t\t//Blinky\r\n\t\t\t\tvar G1 = {Status: \"Chase\", Name:\"Blinky\", Delay:0, direction : 0, Model:0, Node:[], \r\n\t\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:1};\r\n\t\t\t\tghosts.push(G1);\r\n\t\t\t\t//Pinky\r\n\t\t\t\tvar G2 = {Status: \"Chase\", Name:\"Pinky\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:40};\r\n\t\t\t\tghosts.push(G2);\r\n\t\t\t\t//Inky\r\n\t\t\t\tvar G3 = {Status: \"Chase\", Name:\"Inky\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:80};\r\n\t\t\t\tghosts.push(G3);\r\n\t\t\t\t//Cylde\r\n\t\t\t\tvar G4 = {Status: \"Chase\", Name:\"Clyde\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:120};\r\n\t\t\t\tghosts.push(G4);\r\n\t\t\t\t//Courage\r\n\t\t\t\tvar G5 = {Status: \"Chase\", Name:\"Courage\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , futureNode:5, timer:500};\r\n\t\t\t\tghosts.push(G5);\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Load the Players Pac-Man Sprite\r\n\t\tfunction load_Pac(){\r\n\t\t\t//For this example my PlayerNo is 1 for Player 1\r\n\t\t\t\tPlayerNo =0;\r\n\t\t\t//Sprites\t\t\t\r\n\t\t\t\t//Loader for sprites\r\n\t\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\tloader.crossOrigin = true;\r\n\t\t\t\t\r\n\t\t\t\t//Full Player 1 Pac-Man\r\n\t\t\t\tvar Texture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_R1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1R1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_R2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1R2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_L1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1L1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_L2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1L2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_U1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1U1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_U2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1U2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_D1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1D1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P1/P1_D2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP1D2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } );\r\n\t\t\t\t\r\n\t\t\t\tP1 = new THREE.Sprite(P1R1);\r\n\t\t\t\t//P1.position.set(-8,-5,35);\r\n\t\t\t\tP1.position.set(-8,-8,35);\r\n\t\t\t\tP1.scale.set(1.25,.75,0);\t\t\r\n\t\t\t\tP1.material.name = 0;\r\n\t\t\t\tP1.name = 0;\r\n\t\t\t\tif(numberOfPlayers >= 1)scene.add( P1 );\r\n\t\t\t\t\r\n\t\t\t\t//Full Player 2 Pac-Man\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P2/P2_U1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP2U1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P2/P2_U2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP2U2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P2/P2_R1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP2R1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P2/P2_R2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP2R2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\t\r\n\t\t\t\tP2 = new THREE.Sprite(P2U1);\r\n\t\t\t\t//P2.position.set(8,-5,35);\r\n\t\t\t\tP2.position.set(-8,-8,35);\r\n\t\t\t\tP2.scale.set(1.25,.75,0);\t\t\r\n\t\t\t\tP2.material.name = 1;\r\n\t\t\t\tP2.name = 1;\r\n\t\t\t\tif(numberOfPlayers >= 2)scene.add( P2 );\r\n\t\t\t\t\r\n\t\t\t\t//Full Player 3 Pac-Man\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P3/P3_U1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP3U1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P3/P3_U2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP3U2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P3/P3_R1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP3R1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P3/P3_R2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP3R2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\t\r\n\t\t\t\tP3 = new THREE.Sprite(P3U1);\r\n\t\t\t\t//P3.position.set(-8,3,35);\r\n\t\t\t\tP3.position.set(-8,-8,35);\r\n\t\t\t\tP3.scale.set(1.25,.75,0);\t\t\r\n\t\t\t\tP3.material.name = 2;\r\n\t\t\t\tP3.name = 2;\r\n\t\t\t\tif(numberOfPlayers >= 3)scene.add( P3 );\r\n\t\t\t\t\r\n\t\t\t\t//Full Player 4 Pac-Man\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P4/P4_U1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP4U1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P4/P4_U2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP4U2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P4/P4_R1.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP4R1 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\tTexture00 = loader.load( 'Images/Pac-Man Sprites/P4/P4_R2.png' );\r\n\t\t\t\tTexture00.minFilter = THREE.LinearFilter;\r\n\t\t\t\tP4R2 = new THREE.SpriteMaterial( { map: Texture00, color: 0xffffff } )\r\n\t\t\t\t\r\n\t\t\t\tP4 = new THREE.Sprite(P4U1);\r\n\t\t\t\tP4.position.set(-8,-8,35);\r\n\t\t\t\tP4.scale.set(1.25,.75,0);\t\t\r\n\t\t\t\tP4.material.name = 3;\r\n\t\t\t\tP4.name = 3;\r\n\t\t\t\tif(numberOfPlayers >= 4)scene.add( P4 );\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tpacs= [];\t\t\t\t\t\r\n\t\t\t\t//P1 at spot 0\r\n\t\t\t\t//CD stands for CountDown\r\n\t\t\t\t//B stands for Boost and it is a true or false variable\r\n\t\t\t\tvar Player1 = {Player:\"P1\", direction : \"North\", intendedDirection: \"North\",Model:0,\r\n\t\t\t\t\t\t\tStatus:\"Died\", Speed:1, Density:1, Delay:0,\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:25, currentNode:22,\r\n\t\t\t\t\t\t\tsizeCD:0,speedCD:0, densityCD:0, effectCD:0,\r\n\t\t\t\t\t\t\tsizeB: false, speedB: false, densityB:false, effectB:false};\r\n\t\t\t\tpacs.push(Player1);\r\n\t\t\t\t\r\n\t\t\t\t//P2 at spot 1\r\n\t\t\t\tvar Player2 = {Player:\"P2\", direction : \"North\", intendedDirection: \"North\",Model:0,\r\n\t\t\t\t\t\t\tStatus:\"Died\", Speed:1, Density:1, Delay:0,\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:39, currentNode:35,\r\n\t\t\t\t\t\t\tsizeCD:0,speedCD:0, densityCD:0, effectCD:0,\r\n\t\t\t\t\t\t\tsizeB: false, speedB: false, densityB:false, effectB:false};\r\n\t\t\t\tpacs.push(Player2);\r\n\t\t\t\t//P3 at spot 2\r\n\t\t\t\tvar Player3 = {Player:\"P3\", direction : \"South\", intendedDirection: \"South\",Model:0,\r\n\t\t\t\t\t\t\tStatus:\"Died\", Speed:1, Density:1, Delay:0,\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:0, currentNode:6,\r\n\t\t\t\t\t\t\tsizeCD:0,speedCD:0, densityCD:0, effectCD:0,\r\n\t\t\t\t\t\t\tsizeB: false, speedB: false, densityB:false, effectB:false};\r\n\t\t\t\tpacs.push(Player3);\r\n\t\t\t\t//P4 at spot 3\r\n\t\t\t\tvar Player4 = {Player:\"P4\", direction : \"South\", intendedDirection: \"South\",Model:0,\r\n\t\t\t\t\t\t\tStatus:\"Died\", Speed:1, Density:1, Delay:0,\r\n\t\t\t\t\t\t\toldNode:-1, previousNode:10, currentNode:15,\r\n\t\t\t\t\t\t\tsizeCD:0,speedCD:0, densityCD:0, effectCD:0,\r\n\t\t\t\t\t\t\tsizeB: false, speedB: false, densityB:false, effectB:false};\r\n\t\t\t\tpacs.push(Player4);\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Insert the Ghost into the Level\r\n\t\tfunction load_Ghost(){\r\n\t\t\tscene.add(Blinky);\r\n\t\t\tBlinky.position.set(0,0,35);\r\n\t\t\tBlinky.scale.set(1.25,.75,0);\r\n\t\t\tghosts[0].timer = step+5;\r\n\t\t\t\t\r\n\t\t\tscene.add(Pinky);\r\n\t\t\tPinky.position.set(0,0,35);\r\n\t\t\tPinky.scale.set(1.25,.75,0);\r\n\t\t\t//ghosts[1].timer = step+50;\r\n\t\t\tghosts[1].timer = step+25;\r\n\t\t\t\t\r\n\t\t\tscene.add(Inky);\r\n\t\t\tInky.position.set(0,-0.5,35);\r\n\t\t\tInky.scale.set(1.25,.75,0);\r\n\t\t\t//ghosts[2].timer = step+100;\r\n\t\t\tghosts[2].timer = step+45;\r\n\t\t\t\r\n\t\t\tscene.add(Clyde);\r\n\t\t\tClyde.position.set(0,-1,35);\r\n\t\t\tClyde.scale.set(1.25,.75,0);\r\n\t\t\t//ghosts[3].timer = step+150;\r\n\t\t\tghosts[3].timer = step+55;\r\n\t\t\t\t\r\n\t\t\t//scene.add(Courage);\r\n\t\t\t//Courage.position.set(0,5,35);\r\n\t\t\t//Courage.scale.set(1.25,.75,0);\r\n\t\t}\r\n\t\t\r\n\t\t//Instructions for if a Player and a Ghost Collide\r\n\t\tfunction Collision(player,ghost){\r\n\t\t\t\r\n\t\t\t//A player has died\r\n\t\t\tconsole.log(player);\r\n\t\t\tconsole.log(\"P\"+(player.name+1)+\"-died!!!!\");\r\n\t\t\tpacs[player.name].Status = \"Died\";\r\n\t\t\tconsole.log(player.name+\" Status:\"+pacs[player.name].Status);\r\n\t\t\tvar data = {\r\n\t\t\t\tplayer : player.name+1\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\tif(pacs[0].Status == \"Died\" && pacs[1].Status == \"Died\" && pacs[2].Status == \"Died\" && pacs[3].Status == \"Died\"){\r\n\t\t\t\t\tGameStatus = \"Game Over\";\r\n\t\t\t\t\tconsole.log(GameStatus);\r\n\t\t\t\t\t//Adding Title\r\n\t\t\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\t\tloader.crossOrigin = true;\r\n\t\t\t\t\tvar T = loader.load( 'Images/Game Over.png' );\r\n\t\t\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\t\t\tvar T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\t\t\tGameOver = new THREE.Sprite(T1);\r\n\t\t\t\t\tscene.add(GameOver);\r\n\t\t\t\t\tGameOver.position.set(0,-1.25,38);\r\n\t\t\t\t\tGameOver.scale.set(15.5,4,1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tT = loader.load( 'Images/PlayAgain.png' );\r\n\t\t\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\t\t\tT1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\t\t\tPlayAgain = new THREE.Sprite(T1);\r\n\t\t\t\t\tscene.add(PlayAgain);\r\n\t\t\t\t\tPlayAgain.position.set(0,-3.25,38);\r\n\t\t\t\t\tPlayAgain.scale.set(8,2,1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Function\r\n\t\t\t\t\tPlayAgain.callback = function() {\r\n\t\t\t\t\t\t\tif(GameStatus == \"Game Over\"){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tscene.remove(PlayAgain); \r\n\t\t\t\t\t\t\t\t\tscene.remove(GameOver);\r\n\t\t\t\t\t\t\t\t\tscene.remove(Blinky);\r\n\t\t\t\t\t\t\t\t\tscene.remove(Pinky);\r\n\t\t\t\t\t\t\t\t\tscene.remove(Inky);\r\n\t\t\t\t\t\t\t\t\tscene.remove(Clyde);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tGameStatus = \"IDLE\";\r\n\t\t\t\t\t\t\t\t\tresetGhost();\r\n\t\t\t\t\t\t\t\t\tPac.emit('Start Count to the Next Game');\r\n\t\t\t\t\t\t\t\t\tPlayerMesh.parameters.text= \"\";\r\n\t\t\t\t\t\t\t\t\tPlayerMesh.update();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//Removes Pellets\r\n\t\t\t\t\t\t\t\t\twhile(PelletsList.length > 0){\r\n\t\t\t\t\t\t\t\t\t\tscene.remove(PelletsList[0].Pellet);\r\n\t\t\t\t\t\t\t\t\t\tPelletsList.splice(0,1);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//Removes Level\r\n\t\t\t\t\t\t\t\t\twhile(Level.length > 0){\r\n\t\t\t\t\t\t\t\t\t\tscene.remove(Level[0]);\r\n\t\t\t\t\t\t\t\t\t\tLevel.splice(0,1);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tscene.remove(PlayerMesh);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P1); \r\n\t\t\t\t\t\t\t\t\tscene.remove(P2);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P3);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P4);\r\n\t\t\t\t\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\r\n\t\t\t\t\t\t\t\t\tscene.remove(Fruit);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P4);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P3);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P2);\r\n\t\t\t\t\t\t\t\t\tscene.remove(P1);\r\n\t\t\t\t\t\t\t\t\tscene.remove(PlayerMesh);\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};\r\n\t\t\t\t\tclickable.push(PlayAgain);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tPac.emit('A Player Died',data);\t\t\t\t\t\r\n\t\t\t\t\tPac.emit('Game Over');\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tplayer.position.set(0,-8,35);\r\n\t\t\t\t\tscene.remove(player);\r\n\t\t\t\t\tPac.emit('A Player Died',data);\t\r\n\t\t\t\t}\t\r\n\t\t\t}catch(e){\r\n\t\t\t\t//Error\r\n\t\t\t\tscene.remove(player);\r\n\t\t\t\tpacs[player.material.name].Status = \"Died\";\r\n\t\t\t\tplayer.position.set(0,-8,35);\r\n\t\t\t\tconsole.log(\"GAME OVER\")\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Resets the Ghost to their original status\r\n\t\tfunction resetGhost(){\r\n\t\t\tghosts= [];\t\t\t\t\t\r\n\t\t\t//Blinky\r\n\t\t\tvar G1 = {Status: \"Chase\", Name:\"Blinky\", Delay:0, direction : 0, Model:0, Node:[], \r\n\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:1};\r\n\t\t\tghosts.push(G1);\r\n\t\t\t//Pinky\r\n\t\t\tvar G2 = {Status: \"Chase\", Name:\"Pinky\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:40};\r\n\t\t\tghosts.push(G2);\r\n\t\t\t//Inky\r\n\t\t\tvar G3 = {Status: \"Chase\", Name:\"Inky\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:80};\r\n\t\t\tghosts.push(G3);\r\n\t\t\t//Cylde\r\n\t\t\tvar G4 = {Status: \"Chase\", Name:\"Clyde\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , timer:120};\r\n\t\t\tghosts.push(G4);\r\n\t\t\t//Courage\r\n\t\t\tvar G5 = {Status: \"Chase\", Name:\"Courage\", Delay:0, direction : 0, Model:0, Node:[],\r\n\t\t\t\t\t\toldNode:-1, previousNode:-1, currentNode:11 , futureNode:5, timer:500};\r\n\t\t\tghosts.push(G5);\t\r\n\t\t}\r\n\t\t\r\n\t\t//Loads the Start Screen\r\n\t\tfunction load_StartScreen(){\r\n\t\t\t\r\n\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\tloader.crossOrigin = true;\r\n\t\t\t\r\n\t\t\t//Start Game\r\n\t\t\tvar T = loader.load( 'Images/StartGame.png' );\r\n\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\tvar T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\tStartGameMesh = new THREE.Sprite(T1);\r\n\t\t\tscene.add(StartGameMesh);\r\n\t\t\tStartGameMesh.position.set(1,0.25,35);\r\n\t\t\tStartGameMesh.scale.set(15,3.25,1);\r\n\t\t\tStartGameMesh.callback = function() {\r\n\t\t\t\t\tif(GameStatus == \"StartScreen\"){\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tscene.remove(StartGameMesh);\r\n\t\t\t\t\t\t\tscene.remove(AboutMesh);\r\n\t\t\t\t\t\t\tscene.remove(CreditsMesh);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tPac.emit('Start Count to the Next Game');\r\n\t\t\t\t\t\t\tconsole.log(\"Start the Countdown!!!\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tscene.remove(startGhost1); \r\n\t\t\t\t\t\t\tscene.remove(startGhost2);\r\n\t\t\t\t\t\t\tscene.remove(startGhost3);\r\n\t\t\t\t\t\t\tscene.remove(startGhost4);\r\n\t\t\t\t\t\t\tscene.remove(startGhost5);\r\n\t\t\t\t\t\t\tscene.remove(startGhost6);\r\n\t\t\t\t\t\t\tscene.remove(startGhost7);\r\n\t\t\t\t\t\t\tscene.remove(startGhost8);\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\r\n\t\t\t\t\t\t\tconsole.log(e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tclickable.push(StartGameMesh);\r\n\t\t\t\r\n\t\t\t//About Button\r\n\t\t\tvar T = loader.load( 'Images/About2.png' );\r\n\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\tvar T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\tAboutMesh = new THREE.Sprite(T1);\r\n\t\t\tscene.add(AboutMesh);\r\n\t\t\tAboutMesh.position.set(-5,-4.5,35);\r\n\t\t\tAboutMesh.scale.set(7.75,2.75,1);\r\n\t\t\tAboutMesh.callback = function() {\r\n\t\t\t\t\tif(GameStatus == \"StartScreen\"){\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tscene.remove(startGhost1); \r\n\t\t\t\t\t\t\tscene.remove(startGhost2);\r\n\t\t\t\t\t\t\tscene.remove(startGhost3);\r\n\t\t\t\t\t\t\tscene.remove(startGhost4);\r\n\t\t\t\t\t\t\tscene.remove(startGhost5);\r\n\t\t\t\t\t\t\tscene.remove(startGhost6);\r\n\t\t\t\t\t\t\tscene.remove(startGhost7);\r\n\t\t\t\t\t\t\tscene.remove(startGhost8);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tGameStatus = \"About\";\r\n\t\t\t\t\t\t\tvar text1 = \"I have received a great deal of \";\r\n\t\t\t\t\t\t\tvar text2 = \"inspiration from the Pac-Man \"\r\n\t\t\t\t\t\t\tvar text3 = \"Battle Royale arcade game at \";\r\n\t\t\t\t\t\t\tvar text4 = \"Barcade in Downtown New Haven, CT\";\r\n\t\t\t\t\t\t\tconsole.log(text1+text2+text3);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tgroupMesh = new THREE.Group();\r\n\t\t\t\t\t\t\t//https://threejs.org/docs/#api/objects/Group\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\t//Text1 Entry\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(2048,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Comic Sans MS\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text1, 12, 125, 'White');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry( 18,0.75, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\ttextfieldMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\ttextfieldMesh.position.set(0,-7.5,35);\r\n\t\t\t\t\t\t\tgroupMesh.add( textfieldMesh );\r\n\t\t\t\t\t\t\t//Text2 Entry\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(2048,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Comic Sans MS\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text2, 12, 125, 'White');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry( 18,0.75, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\ttextfieldMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\ttextfieldMesh.position.set(0,-8,35);\r\n\t\t\t\t\t\t\tgroupMesh.add( textfieldMesh );\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Text3 Entry\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(2048,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Comic Sans MS\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text3, 12, 125, 'White');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry( 18,0.75, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\ttextfieldMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\ttextfieldMesh.position.set(0,-8.5,35);\r\n\t\t\t\t\t\t\tgroupMesh.add( textfieldMesh );\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Text4 Entry\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(2048,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Comic Sans MS\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text4, 12, 125, 'White');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry( 18,0.75, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\ttextfieldMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\ttextfieldMesh.position.set(0,-9,35);\r\n\t\t\t\t\t\t\tgroupMesh.add( textfieldMesh );\r\n\t\t\t\t\t\t\t//Add Group to the scene\r\n\t\t\t\t\t\t\tscene.add( groupMesh );\r\n\t\t\t\t\t\t\t//console.log(\"X: \"+groupMesh.position.x);\r\n\t\t\t\t\t\t\t//console.log(\"Y: \"+groupMesh.position.y);\r\n\t\t\t\t\t\t\t//groupMesh.position.y =5;\r\n\t\t\t\t\t\t\t//console.log(\"Y: \"+groupMesh.position.y);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Close Mesh\r\n\t\t\t\t\t\t\ttext = \"Close About\";\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(1024,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Arial\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text, 50, 125, 'crimson');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry(5,1, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tcloseMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\tcloseMesh.position.set(0,-13,35);\r\n\t\t\t\t\t\t\tscene.add( closeMesh );\r\n\t\t\t\t\t\t\tcloseMesh.callback = function() {\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tscene.remove(closeMesh);\r\n\t\t\t\t\t\t\t\t\tscene.remove(groupMesh);\r\n\t\t\t\t\t\t\t\t\tconsole.log(\"Closed About!!!\")\r\n\t\t\t\t\t\t\t\t\tGameStatus = \"StartScreen\";\r\n\t\t\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\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};\r\n\t\t\t\t\tclickable.push(closeMesh);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\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};\r\n\t\t\tclickable.push(AboutMesh);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t//Credits Button\r\n\t\t\ttext = \"Credits\";\r\n\t\t\tvar Credits_Texture = new THREEx.DynamicTexture(1024,256);\r\n\t\t\tCredits_Texture.context.font\t= \"bolder 250px Verdana\";\r\n\t\t\tCredits_Texture.clear('Black').drawText(text,20, 220, 'Gold');\r\n\t\t\t//Adding Texture to the Scene\r\n\t\t\tgeometry = new THREE.PlaneGeometry( 7, 1, 1);\r\n\t\t\tmaterial = new THREE.MeshBasicMaterial({\r\n\t\t\t\tmap\t: Credits_Texture.texture\r\n\t\t\t});\r\n\t\t\tCreditsMesh = new THREE.Mesh( geometry, material );\r\n\t\t\tCreditsMesh.position.set(5,-6.5,35);\r\n\t\t\t//scene.add( CreditsMesh );\r\n\t\t\tCreditsMesh.callback = function() {\r\n\t\t\t\t\tif(GameStatus == \"StartScreen\"){\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tscene.remove(startGhost1); \r\n\t\t\t\t\t\t\tscene.remove(startGhost2);\r\n\t\t\t\t\t\t\tscene.remove(startGhost3);\r\n\t\t\t\t\t\t\tscene.remove(startGhost4);\r\n\t\t\t\t\t\t\tscene.remove(startGhost5);\r\n\t\t\t\t\t\t\tscene.remove(startGhost6);\r\n\t\t\t\t\t\t\tscene.remove(startGhost7);\r\n\t\t\t\t\t\t\tscene.remove(startGhost8);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tGameStatus = \"Credits\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Close Mesh\r\n\t\t\t\t\t\t\ttext = \"Close About\";\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(1024,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Arial\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text, 50, 125, 'crimson');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry(5,1, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tcloseMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\tcloseMesh.position.set(0,-13,35);\r\n\t\t\t\t\t\t\tscene.add( closeMesh );\r\n\t\t\t\t\t\t\tcloseMesh.callback = function() {\r\n\t\t\t\t\t\t\tif(GameStatus == \"Credits\"){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tscene.remove(closeMesh);\r\n\t\t\t\t\t\t\t\t\tconsole.log(\"Closed About!!!\")\r\n\t\t\t\t\t\t\t\t\tGameStatus = \"StartScreen\";\r\n\t\t\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\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};\r\n\t\t\t\t\tclickable.push(closeMesh);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tclickable.push(CreditsMesh);\r\n\t\t\t**/\r\n\t\t\t\r\n\t\t\t//Credits Button\r\n\t\t\tvar T = loader.load( 'Images/Credits.png' );\r\n\t\t\tT.minFilter = THREE.LinearFilter;\r\n\t\t\tvar T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\r\n\t\t\tCreditsMesh = new THREE.Sprite(T1);\r\n\t\t\tscene.add(CreditsMesh);\r\n\t\t\tCreditsMesh.position.set(5,-4.5,35);\r\n\t\t\tCreditsMesh.scale.set(7.75,1.5,1);\r\n\t\t\t//Function\r\n\t\t\tCreditsMesh.callback = function() {\r\n\t\t\t\t\tif(GameStatus == \"StartScreen\"){\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tscene.remove(startGhost1); \r\n\t\t\t\t\t\t\tscene.remove(startGhost2);\r\n\t\t\t\t\t\t\tscene.remove(startGhost3);\r\n\t\t\t\t\t\t\tscene.remove(startGhost4);\r\n\t\t\t\t\t\t\tscene.remove(startGhost5);\r\n\t\t\t\t\t\t\tscene.remove(startGhost6);\r\n\t\t\t\t\t\t\tscene.remove(startGhost7);\r\n\t\t\t\t\t\t\tscene.remove(startGhost8);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tGameStatus = \"Credits\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Close Mesh\r\n\t\t\t\t\t\t\ttext = \"Close About\";\r\n\t\t\t\t\t\t\tvar textboxTexture = new THREEx.DynamicTexture(1024,256);\r\n\t\t\t\t\t\t\ttextboxTexture.context.font\t= \" 120px Arial\";\r\n\t\t\t\t\t\t\ttextboxTexture.clear('black').drawText(text, 50, 125, 'crimson');\r\n\t\t\t\t\t\t\tvar geometry = new THREE.PlaneGeometry(5,1, 1);\r\n\t\t\t\t\t\t\tvar material = new THREE.MeshBasicMaterial({\r\n\t\t\t\t\t\t\t\tmap\t: textboxTexture.texture\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tcloseMesh = new THREE.Mesh( geometry, material );\r\n\t\t\t\t\t\t\tcloseMesh.position.set(0,-13,35);\r\n\t\t\t\t\t\t\tscene.add( closeMesh );\r\n\t\t\t\t\t\t\tcloseMesh.callback = function() {\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tscene.remove(closeMesh);\r\n\t\t\t\t\t\t\t\t\tconsole.log(\"Closed About!!!\")\r\n\t\t\t\t\t\t\t\t\tGameStatus = \"StartScreen\";\r\n\t\t\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\t\tclickable.push(closeMesh);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\t//functionToHandleError(e);\t\t\r\n\t\t\t\t\t\t\t//He HE HE don't say a word if errors happen\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};\r\n\t\t\tclickable.push(CreditsMesh);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Loads the Splash Screen\r\n\t\tfunction load_SplashScreen(){\r\n\t\t\tGameStatus = \"SplashScreen\";\r\n\t\t\t//Adding Title\r\n\t\t\tvar loader = new THREE.TextureLoader();\r\n\t\t\t\tloader.crossOrigin = true;\r\n\t\t\tvar HTP01 = loader.load( 'Images/Title.png' );\r\n\t\t\t\tHTP01.minFilter = THREE.LinearFilter;\r\n\t\t\tplaneGeometry = new THREE.PlaneBufferGeometry (4, 1,0);\r\n\t\t\tplaneMaterial = new THREE.MeshBasicMaterial( { map: HTP01, color: 0xffffff } );\r\n\t\t\t//var planeMaterial = new THREE.MeshLambertMaterial({color: 0x2ff33c}); //RGB\t\r\n\t\t\tTitle = new THREE.Mesh(planeGeometry, planeMaterial);\r\n\t\t\tscene.add(Title);\r\n\t\t\tTitle.position.set(0,-0.25,38); \r\n\t\t\tTitle.scale.set(3.75,1,1); \r\n\t\t\t\r\n\t\t\t//Adding the Ghost!!\r\n\t\t\tstartGhost1 = Blinky.clone();\r\n\t\t\tstartGhost1 = new THREE.Sprite(BlinkyL1);\t\r\n\t\t\tscene.add(startGhost1);\r\n\t\t\tstartGhost1.position.set(-10,-1.5,35);\r\n\t\t\tstartGhost1.scale.set(1.25,.75,0);\r\n\t\t\t\r\n\t\t\tstartGhost2 = Pinky.clone();\r\n\t\t\tscene.add(startGhost2);\r\n\t\t\tstartGhost2.position.set(-6,0.75,35);\r\n\t\t\tstartGhost2.scale.set(1.25,.75,0);\r\n\t\t\t\r\n\t\t\tstartGhost3 = Inky.clone();\r\n\t\t\tscene.add(startGhost3);\r\n\t\t\tstartGhost3.position.set(-6,-1.5,35);\r\n\t\t\tstartGhost3.scale.set(1.25,0.75,0);\r\n\t\t\t\r\n\t\t\tstartGhost4 = Clyde.clone();\r\n\t\t\tscene.add(startGhost4);\r\n\t\t\tstartGhost4.position.set(-2,-1.5,35);\r\n\t\t\tstartGhost4.scale.set(1.25,0.75,0);\r\n\t\t\t\r\n\t\t\tstartGhost5 = Blinky.clone();\r\n\t\t\tscene.add(startGhost5);\r\n\t\t\tstartGhost5.position.set(3,0.75,35);\r\n\t\t\tstartGhost5.scale.set(1.25,.75,0);\r\n\t\t\t\r\n\t\t\tstartGhost6 = Pinky.clone();\r\n\t\t\tscene.add(startGhost6);\r\n\t\t\tstartGhost6.position.set(2,-1.5,35);\r\n\t\t\tstartGhost6.scale.set(1.25,.75,0);\r\n\t\t}\r\n\t\t\r\n\t\t// Socket Functions\r\n\t\tfunction sendScore(){\r\n\t\t\tvar data = { score: 75 };\r\n\t\t\tsocket.emit('sendScore',data);\r\n\t\t}\r\n\r\n}", "title": "" }, { "docid": "ce84a16b178feca58c8e505bcbbe25d0", "score": "0.562544", "text": "function E3D_onTick_scene() {\n E3D_DEBUG_RENDER_NB_ELEMENTS = 0;\n E3D_DEBUG_RENDER_NB_ENTITIES = 0;\n\n if (CB_processInputs) CB_processInputs();\n if (CB_processCamera) CB_processCamera();\n if (CB_processAnimations) CB_processAnimations();\n // Render\n if (SCENE.state == E3D_ACTIVE) {\n SCENE.preRender();\n if (CB_processPreRender) CB_processPreRender();\n SCENE.render();\n if (CB_processRender) CB_processRender();\n SCENE.postRender();\n if (CB_processPostRender) CB_processPostRender();\n }\n}", "title": "" }, { "docid": "aa6cc8d1051f55cd1692c2627ce27413", "score": "0.5625426", "text": "function onLoad() {\n var mainCanvas, mainContext, entities, scene, lastTime, renderVisitor;\n\n //this function will initialise our variables\n function initialiseCanvasContext() {\n console.log(\"initialise started\");\n \n //find the canvas element using its id\n mainCanvas = document.getElementById('mainCanvas');\n //if it cant be found\n if (!mainCanvas) {\n //make an error message pop up\n alert('Error: I cannot find the canvas element!');\n return;\n }\n\n //Get the 2D canvas context\n mainContext = mainCanvas.getContext('2d');\n if (!mainContext) {\n alert('Error: Failed to get context!');\n return;\n }\n\n //create the render visitor\n renderVisitor = new RenderVisitor(mainContext);\n\n //create an list of entities\n entities = [];\n\n //create a list of positions to spawn shapes at\n toSpawn = [];\n\n var y, x;\n var orangeDoor = false;\n var houseNumber = 0;\n var entitiesToAdd = [];\n\n //instanciate all of the houses\n for (y = -200; y < 300; y += 200) {\n for (x = -300; x < 400; x += 200) {\n houseNumber++;\n var housePosition = new Vector(x, y);\n if (houseNumber === 12) {\n entitiesToAdd.push(new House(housePosition, new Vector(1 , 1, 1), 0, '#FFFFFF'));\n }\n else if (orangeDoor === false) {\n entitiesToAdd.push(new House(housePosition, new Vector(1, 1, 1), 0, '#FF0000'));\n orangeDoor = true;\n }\n else {\n entitiesToAdd.push(new House(housePosition, new Vector(1, 1, 1), 0, '#FF4500'));\n orangeDoor = false;\n }\n }\n }\n\n var circle = new PhysicsCircle(new Vector(0, 0), 20);\n entitiesToAdd.push(circle);\n\n var box = new PhysicsBox(50, 50, new Vector(20, 0));\n entitiesToAdd.push(box);\n\n //create the scenegraph\n createSceneGraph();\n //add objects to a list of entities, their nodes are passed onto the scene graph\n addToEntities(entitiesToAdd);\n\n console.log(\"initialise completed\");\n }\n\n function animationLoop() {\n\n var thisTime = Date.now();\n var deltaTime = (thisTime - lastTime) / 1000;\n\n update(deltaTime);\n\n draw();\n\n lastTime = thisTime;\n\n requestAnimationFrame(animationLoop);\n }\n\n function update(deltaTime) {\n //use deltaTime to update the game\n\n //rotate the screen\n //angle += Math.PI / 16 * deltaTime;\n //var rotateTemp = Matrix.createRotation(angle);\n //rotateNode.setLocal(rotateTemp);\n\n //generate the shapes from positions decided by mouse clicks\n if (toSpawn.length > 0) {\n var entitiesToAdd = ShapeGenerator.generateNewShapes(toSpawn);\n //empty the \"toSpawn\" list to prevent endlessly spawning shapes\n toSpawn = [];\n\n addToEntities(entitiesToAdd);\n }\n\n for (var i = 0; i < entities.length; i += 1) {\n entities[i].update(deltaTime);\n }\n\n updateCollision(deltaTime);\n }\n\n function draw() {\n // set the draw fill style colour to black\n mainContext.fillStyle = '#ccccb3';\n\n originNode.getLocal().setTransform(mainContext);\n\n //fill the canvas with black\n mainContext.fillRect(-400, -300, mainCanvas.width, mainCanvas.height); //this needs adding to scenegraph\n\n //draw the scene\n renderVisitor.visit(scene);\n \n }\n\n function updateCollision(deltaTime) {\n var tempEntities = [];\n\n for (var i = entities.length - 1; i > -1; i -= 1) {\n var objectChecking = entities[i];\n //console.log(\"i: \" + i);\n\n //check collision with all other entities\n for (var j = 0; j < entities.length - 1; j += 1) {\n //console.log(\"j: \" + j);\n objectChecking.collisionCheck(entities[j]);\n }\n\n //move to other list\n tempEntities.push(objectChecking);\n entities.pop();\n }\n\n entities = tempEntities;\n entities.reverse(); //if the order matters\n //console.log(\"tempEnt length: \" + tempEntities.length);\n //console.log(\"entities length: \" + entities.length);\n //console.log(\"stop\");\n }\n\n function createSceneGraph() {\n originVector = new Vector(mainCanvas.width / 2, mainCanvas.height / 2, 1);\n angle = 0;\n scale = new Vector(1, 1, 1);\n\n scene = SceneGraphBranchCreator.createTree(scale,\n angle,\n originVector,\n );\n\n originNode = scene;\n rotateNode = originNode.getChild(0);\n scaleNode = rotateNode.getChild(0);\n } \n\n function addToEntities(pObjects) {\n //add object to a list of updatables\n for (var objectNum = 0; objectNum < pObjects.length; objectNum += 1) {\n entities.push(pObjects[objectNum]); //breaks\n }\n\n addToTree(pObjects);\n\n //console.log(\"number of entities: \" + entities.length);\n //console.log(\"number of children of scale: \" + scaleNode.getChildCount());\n }\n\n function addToTree(pObjects) {\n for (var objectNum = 0; objectNum < pObjects.length; objectNum += 1) {\n //get the top node of the object\n var topNode = pObjects[objectNum].getTopNode();\n\n //add the top node of the object to the scene graph\n scaleNode.addChild(topNode);\n }\n }\n\n initialiseCanvasContext();\n lastTime = Date.now();\n animationLoop();\n}", "title": "" }, { "docid": "077d10d61851660cdee718277a218b34", "score": "0.562354", "text": "function setup() {\r\n var canvas = createCanvas(1200, 400);\r\n\r\n userEngine = Engine.create();\r\n userWorld = userEngine.world;\r\n\r\n ground = new Ground(600, height, 1200, 20);\r\n platform = new Ground(150, 305, 300, 170);\r\n\r\n bird = new Bird(200, 100);\r\n console.log(bird)\r\n\r\n //creation of catapult with sling. Body of bird will be attached to the sling.\r\n catapult = new SlingShot(bird.body, { x: 200, y: 50 });\r\n\r\n //construction of layer1 using matter.js\r\n box1 = new Box(700, 320, 70, 70);\r\n box2 = new Box(920, 320, 70, 70);\r\n pig1 = new Pig(810, 350);\r\n log1 = new Log(810, 260, 300, PI / 2);\r\n\r\n //construction of layer2 using matter.js\r\n box3 = new Box(700, 240, 70, 70);\r\n box4 = new Box(920, 240, 70, 70);\r\n pig2 = new Pig(810, 220);\r\n log2 = new Log(810, 180, 300, PI / 2);\r\n\r\n //construction of layer3 using matter.js\r\n box5 = new Box(810, 160, 70, 70);\r\n log3 = new Log(760, 120, 150, PI / 7);\r\n log4 = new Log(870, 120, 150, -PI / 7);\r\n\r\n score = 0;\r\n\r\n gameState = \"onSlingShot\";\r\n\r\n timesPlayed = 0;\r\n\r\n}", "title": "" }, { "docid": "7166704f30c9f0e0c2ae6efbf6f82001", "score": "0.56214225", "text": "function draw(){\n socket.emit(\"makeDraw\", {});\n}", "title": "" }, { "docid": "33cea8d9592be17474d4672ad5007ac2", "score": "0.5612286", "text": "function receive(msg){\n\t\n\t\t// THIS IS NOT A SOLUTION.\n\t\t// TCP IS RELIABLE, YET THIS STOPS HALF GAME EVENTS FROM COMING THROUGH!\n\t\n\t\t//if(debugging){\n\t\t//\tif(tag < 2){\n\t\t//\t\ttag++;\n\t\t//\t\treturn;\n\t\t//\t}else{\n\t\t//\t\ttag = 0;\n\t\t//\t}\n\t\t//}\n\t\n\t\tif(typeof msg.status !== 'undefined'){\n\t\t\tglworld.texts[\"status\"].text = msg.status;\n\t\t}else if(typeof msg.connect !== 'undefined'){\n\t\t\t\n\t\t}else if(typeof msg.disconnect !== 'undefined'){\n\t\t\tdelete glworld.objects[msg.disconnect + \"tank\"];\n\t\t}else if(typeof msg.explode !== 'undefined'){\n\t\t\t\n\t\t\t// Clear old explosion.\n\t\t\t\n\t\t\tif(msg.explode + \"l1\" in glworld.objects){\n\t\t\t\tdelete glworld.objects[msg.explode + \"l1\"];\n\t\t\t}\n\t\t\tif(msg.explode + \"r1\" in glworld.objects){\n\t\t\t\tdelete glworld.objects[msg.explode + \"r1\"];\n\t\t\t}\n\t\t\tif(msg.explode + \"l2\" in glworld.objects){\n\t\t\t\tdelete glworld.objects[msg.explode + \"l2\"];\n\t\t\t}\n\t\t\tif(msg.explode + \"r2\" in glworld.objects){\n\t\t\t\tdelete glworld.objects[msg.explode + \"r2\"];\n\t\t\t}\n\t\t\n\t\t\t// Create an explosion.\n\t\t\n\t\t\tglworld.create_object(msg.explode + \"l1\", leftTankChunk,\n\t\t\t\tglworld.objects[msg.explode].x,\n\t\t\t\tglworld.objects[msg.explode].y,\n\t\t\t\tglworld.objects[msg.explode].color, 1.0, 1.0,\n\t\t\t\tglworld.objects[msg.explode].rotation);\n\t\t\tglworld.objects[msg.explode + \"l1\"].owned = true;\n\t\t\tglworld.objects[msg.explode + \"l1\"].text = null;\n\t\t\t\n\t\t\tglworld.objects[msg.explode + \"l1\"].timed_animation(\"x\",\n\t\t\t\tglworld.objects[msg.explode].x\n\t\t\t\t- 75 * Math.cos(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"l1\"].timed_animation(\"y\",\n\t\t\t\tglworld.objects[msg.explode].y\n\t\t\t\t- 75 * -1 * Math.sin(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"l1\"].timed_animation(\"rotation\",\n\t\t\t\tglworld.objects[msg.explode].rotation + Math.PI * 2, 1000);\n\t\t\t\n\t\t\tglworld.create_object(msg.explode + \"r1\", rightTankChunk,\n\t\t\t\tglworld.objects[msg.explode].x,\n\t\t\t\tglworld.objects[msg.explode].y,\n\t\t\t\tglworld.objects[msg.explode].color, 1.0, 1.0,\n\t\t\t\tglworld.objects[msg.explode].rotation);\n\t\t\tglworld.objects[msg.explode + \"r1\"].owned = true;\n\t\t\tglworld.objects[msg.explode + \"r1\"].text = null;\n\t\t\t\n\t\t\tglworld.objects[msg.explode + \"r1\"].timed_animation(\"x\",\n\t\t\t\tglworld.objects[msg.explode].x\n\t\t\t\t+ 75 * Math.cos(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"r1\"].timed_animation(\"y\",\n\t\t\t\tglworld.objects[msg.explode].y\n\t\t\t\t- 75 * -1 * Math.sin(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"r1\"].timed_animation(\"rotation\",\n\t\t\t\tglworld.objects[msg.explode].rotation + Math.PI * 2, 1000);\n\t\t\t\n\t\t\tglworld.create_object(msg.explode + \"l2\", leftTankChunk,\n\t\t\t\tglworld.objects[msg.explode].x,\n\t\t\t\tglworld.objects[msg.explode].y,\n\t\t\t\tglworld.objects[msg.explode].color, 1.0, 1.0,\n\t\t\t\tglworld.objects[msg.explode].rotation + Math.PI);\n\t\t\tglworld.objects[msg.explode + \"l2\"].owned = true;\n\t\t\tglworld.objects[msg.explode + \"l2\"].text = null;\n\t\t\t\n\t\t\tglworld.objects[msg.explode + \"l2\"].timed_animation(\"x\",\n\t\t\t\tglworld.objects[msg.explode].x\n\t\t\t\t+ 75 * Math.cos(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"l2\"].timed_animation(\"y\",\n\t\t\t\tglworld.objects[msg.explode].y\n\t\t\t\t+ 75 * -1 * Math.sin(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"l2\"].timed_animation(\"rotation\",\n\t\t\t\tglworld.objects[msg.explode].rotation + Math.PI * 2, 1000);\n\t\t\t\n\t\t\tglworld.create_object(msg.explode + \"r2\", rightTankChunk,\n\t\t\t\tglworld.objects[msg.explode].x,\n\t\t\t\tglworld.objects[msg.explode].y,\n\t\t\t\tglworld.objects[msg.explode].color, 1.0, 1.0,\n\t\t\t\tglworld.objects[msg.explode].rotation + Math.PI);\n\t\t\tglworld.objects[msg.explode + \"r2\"].owned = true;\n\t\t\tglworld.objects[msg.explode + \"r2\"].text = null;\n\t\t\t\n\t\t\tglworld.objects[msg.explode + \"r2\"].timed_animation(\"x\",\n\t\t\t\tglworld.objects[msg.explode].x\n\t\t\t\t- 75 * Math.cos(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"r2\"].timed_animation(\"y\",\n\t\t\t\tglworld.objects[msg.explode].y\n\t\t\t\t+ 75 * -1 * Math.sin(glworld.objects[msg.explode].rotation - Math.PI / 4), 1000);\n\t\t\tglworld.objects[msg.explode + \"r2\"].timed_animation(\"rotation\",\n\t\t\t\tglworld.objects[msg.explode].rotation + Math.PI * 2, 1000);\n\t\t\t\n\t\t\tdelete glworld.objects[msg.explode];\n\t\t\t\n\t\t\texplode.play();\n\t\t}else if(typeof msg.players !== 'undefined'){\n\t\t\tif(debugging){\n\t\t\t\tglworld.texts[\"state\"].text = \"Server State: \" + JSON.stringify(msg);\n\t\t\t\tglworld.texts[\"client_state\"].text = \"Client State: \" + JSON.stringify(glworld.objects);\n\t\t\t}\n\t\t\tfor(playerH in msg.players){\n\t\t\t\tfor(tankH in glworld.objects){\n\t\t\t\t\tif(glworld.objects[tankH].owned && !(tankH in msg.players)){\n\t\t\t\t\t//\tdelete glworld.objects[tankH];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(playerH in glworld.objects){\n\t\t\t\t\tglworld.objects[playerH].i = msg.players[playerH].i;\n\t\t\t\t\tglworld.objects[playerH].x = parseFloat(msg.players[playerH].x);\n\t\t\t\t\tglworld.objects[playerH].y = parseFloat(msg.players[playerH].y);\n\t\t\t\t\tglworld.objects[playerH].s = parseFloat(msg.players[playerH].s);\n\t\t\t\t\tglworld.objects[playerH].ts = parseFloat(msg.players[playerH].ts);\n\t\t\t\t\tglworld.objects[playerH].rotation = parseFloat(msg.players[playerH].r);\n\t\t\t\t}else{\n\t\t\t\t\tglworld.create_object(playerH, tank, msg.players[playerH].x, msg.players[playerH].y);\n\t\t\t\t\t\n\t\t\t\t\tglworld.objects[playerH].i = \"nn\";\n\t\t\t\t\tglworld.objects[playerH].s = 0;\n\t\t\t\t\tglworld.objects[playerH].ts = 0;\n\t\t\t\t\tglworld.objects[playerH].rotation = parseFloat(msg.players[playerH].r);\n\n\t\t\t\t\tglworld.objects[playerH].textX = 45.0;\n\t\t\t\t\tglworld.objects[playerH].textY = 45.0;\n\t\t\t\t\tglworld.objects[playerH].text = playerH;\n\t\t\t\t\tglworld.objects[playerH].owned = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\tconsole.log(JSON.stringify(msg));\n\t\t\t//console.log(\"Received junk?\");\n\t\t}\n\t}", "title": "" }, { "docid": "0501bda84a32b2ed066eb13ba5e58a53", "score": "0.5612075", "text": "function stateUpdate(event) {\n //console.log(socket);\n //console.log(event.data);\n var gameState = JSON.parse(event.data);\n //var game2State = event.data;\n if (typeof gameState !== \"undefined\") {\n //console.log(game2State);\n if (gameState[\"id\"] !== \"undefined\" && socketID === \"\") {\n socketID = gameState[\"id\"];\n //console.log(socketID);\n }\n var i = 0;\n while (typeof gameState[i] !== \"undefined\") {\n //console.log(game2State[i]);\n if (typeof gameState[i][\"Map\"] !== \"undefined\") {\n console.log(gameState[i][\"Map\"]);\n var width = gameState[i][\"Map\"][\"width\"];\n var height = gameState[i][\"Map\"][\"height\"];\n var j = 0;\n var x;\n var y;\n var val;\n var cell;\n while (typeof gameState[i][\"Map\"][\"cells\"][j] !== \"undefined\") {\n x = gameState[i][\"Map\"][\"cells\"][j][\"x\"];\n y = gameState[i][\"Map\"][\"cells\"][j][\"y\"];\n val = gameState[i][\"Map\"][\"cells\"][j][\"val\"];\n if (gameState[i][\"Map\"][\"cells\"][j][\"val\"] == 1) {\n terrain.innerHTML += \"<div id='cell\" + x + \"_\" + y + \"' class='cell wall\" + val + \"'></div>\";\n cell = document.getElementById(\"cell\" + x + \"_\" + y);\n cell.style.left = x * ($(\".cell\").width() + 2) + \"px\";\n cell.style.top = y * ($(\".cell\").height() + 2) + \"px\";\n }\n j++;\n }\n terrain.style.width = width * ($(\".cell\").width + 2) + \"px\";\n terrain.style.height = height * ($(\".cell\").height() + 2) + \"px\";\n //game2.style.width = width * ($(\".cell\").width() + 2) + \"px\";\n\n scene.style.width = width * ($(\".cell\").width() + 2) + \"px\";\n scene.style.height = height * ($(\".cell\").height() + 2) + \"px\";\n\n //terrain.style.height = height * ($(\".cell\").height() + 2) + \"px\";\n //game2.style.height = height * ($(\".cell\").height() + 2) + \"px\";\n } else if (typeof gameState[i][\"Player\"] !== \"undefined\") {\n //console.log(gameState[i][\"Player\"]);\n var id = gameState[i][\"Player\"][\"id\"];\n var destroy = gameState[i][\"Player\"][\"super\"][\"Entity\"][\"super\"][\"State\"][\"destroy\"];\n var leave = gameState[i][\"Player\"][\"leave\"];\n var dead = gameState[i][\"Player\"][\"dead\"];\n var health = gameState[i][\"Player\"][\"health\"];\n var healthMax = gameState[i][\"Player\"][\"healthMax\"];\n var x = gameState[i][\"Player\"][\"super\"][\"Entity\"][\"x\"];\n var y = gameState[i][\"Player\"][\"super\"][\"Entity\"][\"y\"];\n var team = gameState[i][\"Player\"][\"team\"];\n playerTeam[id] = team;\n var player = document.getElementById(\"player\" + id);\n if (player === null) {\n var name = id.substr(0, 4);\n entities.innerHTML += \"<div id='player\" + id + \"' class='player'><div id='player\" + id + \"-healthbar' class='healthbar'><div id='player\" + id + \"-name' class='name'>\" + name + \"</div>\";\n player = document.getElementById(\"player\" + id);\n }\n player.style.left = x * ($(\".cell\").width() + 2) + 1 + \"px\";\n player.style.top = y * ($(\".cell\").height() + 2) + 1 + \"px\";\n playerHealthbar = document.getElementById(\"player\" + id + \"-healthbar\");\n playerHealthbar.style.width = health * 24 / healthMax + \"px\";\n if (dead) {\n player.style.zIndex = \"1\";\n player.style.backgroundImage = \"url('images/blood.png')\";\n player.style.backgroundColor = \"rgba(0,0,0,0)\";\n } else {\n player.style.zIndex = \"2\";\n player.style.backgroundImage = \"url('images/brujo.png')\";\n if (id === socketID) {\n player.style.backgroundColor = \"green\";\n } else {\n player.style.backgroundColor = $(\".team\" + team).css(\"color\");//\"#\" + ((1 << 24) * Math.random() | 0).toString(16);\n }\n }\n if (leave) {\n player.style.display = \"none\";\n } else {\n player.style.display = \"block\";\n }\n if (destroy) {\n $(\"#player\" + id).remove();\n playerTeam[id] = \"\";\n }\n //players.innerHTML += game2State[i][\"Player\"][\"id\"] + \",\" + game2State[i][\"Player\"][\"x\"] + \",\" + game2State[i][\"Player\"][\"y\"] + \"<br>\";\n } else if (typeof gameState[i][\"Projectile\"] !== \"undefined\") {\n //console.log(game2State[i][\"Projectile\"]);\n var id = gameState[i][\"Projectile\"][\"id\"];\n var number = gameState[i][\"Projectile\"][\"number\"];\n var destroy = gameState[i][\"Projectile\"][\"super\"][\"Entity\"][\"super\"][\"State\"][\"destroy\"];\n var x = gameState[i][\"Projectile\"][\"super\"][\"Entity\"][\"x\"];\n var y = gameState[i][\"Projectile\"][\"super\"][\"Entity\"][\"y\"];\n var xVelocity = gameState[i][\"Projectile\"][\"xVelocity\"];\n var yVelocity = gameState[i][\"Projectile\"][\"yVelocity\"];\n var team = gameState[i][\"Projectile\"][\"team\"];\n var projectile = document.getElementById(\"projectile\" + id + \"-\" + number);\n if (projectile === null) {\n entities.innerHTML += \"<div id='projectile\" + id + \"-\" + number + \"' class='arrow'></div>\";\n projectile = document.getElementById(\"projectile\" + id + \"-\" + number);\n if (id === socketID) {\n projectile.style.backgroundColor = \"green\";\n } else {\n projectile.style.backgroundColor = $(\".team\" + team).css(\"color\");\n }\n\n }\n projectile.style.left = x * ($(\".cell\").width() + 2) + 1 + ($(\".cell\").width() + 2) / 2 - $(\".arrow\").width() / 2 + \"px\";\n projectile.style.top = y * ($(\".cell\").height() + 2) + 1 + ($(\".cell\").height() + 2) / 2 - $(\".arrow\").height() / 2 + \"px\";\n if (destroy) {\n $(\"#projectile\" + id + \"-\" + number).remove();\n }\n //players.innerHTML += game2State[i][\"Player\"][\"id\"] + \",\" + game2State[i][\"Player\"][\"x\"] + \",\" + game2State[i][\"Player\"][\"y\"] + \"<br>\";\n } else if (typeof gameState[i][\"Tower\"] !== \"undefined\") {\n //console.log(gameState[i][\"Tower\"]);\n var id = gameState[i][\"Tower\"][\"id\"];\n var destroy = gameState[i][\"Tower\"][\"super\"][\"Entity\"][\"super\"][\"State\"][\"destroy\"];\n var dead = gameState[i][\"Tower\"][\"dead\"];\n var team = gameState[i][\"Tower\"][\"team\"];\n var health = gameState[i][\"Tower\"][\"health\"];\n var healthMax = gameState[i][\"Tower\"][\"healthMax\"];\n var width = gameState[i][\"Tower\"][\"width\"];\n var height = gameState[i][\"Tower\"][\"height\"];\n var x = gameState[i][\"Tower\"][\"super\"][\"Entity\"][\"x\"];\n var y = gameState[i][\"Tower\"][\"super\"][\"Entity\"][\"y\"];\n var team = gameState[i][\"Tower\"][\"team\"];\n var tower = document.getElementById(\"tower\" + id);\n if (tower === null) {\n entities.innerHTML += \"<div id='tower\" + id + \"' class='tower'><div id='tower\" + id + \"-healthbar' class='healthbar'></div></div>\";\n tower = document.getElementById(\"tower\" + id);\n tower.style.backgroundColor = $(\".team\" + team).css(\"color\");\n }\n tower.style.left = x * ($(\".cell\").width() + 2) + 1 - (Math.floor(width / 2) * $(\".cell\").width()) + \"px\";\n tower.style.top = y * ($(\".cell\").height() + 2) + 1 - (Math.floor(height / 2) * $(\".cell\").width()) + \"px\";\n towerHealthbar = document.getElementById(\"tower\" + id + \"-healthbar\");\n towerHealthbar.style.width = health * width * 24 / healthMax + \"px\";\n towerHealthbar.style.left = -8 + \"px\";\n if (dead) {\n tower.style.zIndex = \"1\";\n tower.style.backgroundImage = \"url('images/rubble.png')\";\n tower.style.backgroundColor = \"rgba(0,0,0,0)\";\n }\n if (destroy) {\n $(\"#tower\" + id).remove();\n }\n } else if (typeof gameState[i][\"Spawn\"] !== \"undefined\") {\n var x = gameState[i][\"Spawn\"][\"x\"];\n var y = gameState[i][\"Spawn\"][\"y\"];\n terrain.innerHTML += \"<div id='spawn\" + x + \"_\" + y + \"' class='cell spawn'></div>\";\n spawn = document.getElementById(\"spawn\" + x + \"_\" + y);\n spawn.style.left = x * ($(\".cell\").width() + 2) + \"px\";\n spawn.style.top = y * ($(\".cell\").height() + 2) + \"px\";\n } else if (typeof gameState[i][\"Match\"] !== \"undefined\") {\n //console.log(game2State[i][\"Match\"]);\n var round = gameState[i][\"Match\"][\"round\"];\n document.getElementById(\"round\").innerHTML = round;\n var countRounds = gameState[i][\"Match\"][\"countRounds\"];\n document.getElementById(\"countRounds\").innerHTML = countRounds;\n var endGame = gameState[i][\"Match\"][\"endGame\"];\n var endRound = gameState[i][\"Match\"][\"endRound\"];\n var startGame = gameState[i][\"Match\"][\"startGame\"];\n var teamAttacker = gameState[i][\"Match\"][\"teamAttacker\"];\n var sizeTeam = gameState[i][\"Match\"][\"sizeTeam\"];\n var players = gameState[i][\"Match\"][\"players\"];\n var ready = gameState[i][\"Match\"][\"ready\"];\n var playersDOM = document.getElementById(\"players\");\n playersDOM.innerHTML = \"<tr><th>ID</th><th>Ready</th></tr>\";\n for (var p = 0; p < players.length; p++) {\n var found = false;\n var r = 0;\n var playerReady = null;\n while (!found && r < ready.length) {\n if (ready[r] === players[p]) {\n playerReady = ready[r];\n found = true;\n }\n r++;\n }\n var checked = playerReady ? \"checked\" : \"\";\n var team = playerTeam[players[p]];\n if (team === \"undefined\") {\n team = \"\";\n }\n playersDOM.innerHTML += \"<tr><td class='team\" + team + \"'>\" + players[p] + \"</td><td><input id='ready\" + player + \"' type='checkbox' disabled \" + checked + \"/></td></tr>\";\n }\n var teamPoints = gameState[i][\"Match\"][\"teamPoints\"];\n var teamPointsDOM = document.getElementById(\"teamPoints\");\n teamPointsDOM.innerHTML = \"\";\n for (var p = 0; p < teamPoints.length; p++) {\n teamPointsDOM.innerHTML += \"<span class='team\" + p + \"'>\" + teamPoints[p] + \"</span> \";\n }\n }\n i++;\n }\n }\n }", "title": "" }, { "docid": "cfe2c73884af3610b628a74f480e9873", "score": "0.56026274", "text": "function computer_player() {\n var vehicle_body1, vehicle2, input2;\n\n scene.addEventListener(\n 'update',\n function() {\n\n if (input2 && vehicle2) {\n if (input2.direction !== null) {\n input2.steering += input2.direction / 50;\n if (input2.steering < -0.6) input2.steering = -0.6;\n if (input2.steering > 0.6) input2.steering = 0.6;\n }\n vehicle2.setSteering(input2.steering, 0);\n vehicle2.setSteering(input2.steering, 1);\n\n if (input2.power === true) {\n vehicle2.applyEngineForce(200);\n\n } else if (input2.power === false) {\n count++;\n \n vehicle2.applyEngineForce(-650);\n\n \n } else {\n vehicle2.applyEngineForce(0);\n }\n }\n\n scene.simulate(undefined, 2);\n physics_stats.update();\n }\n );\n var json_loader = new THREE.JSONLoader();\n\n json_loader.load(Vehicle2.firstPlayer(), function(car, car_materials) {\n json_loader.load(\"js/models/mustang_wheel.js\", function(wheel, wheel_materials) {\n var mesh = new Physijs.BoxMesh(\n car,\n new THREE.MeshFaceMaterial(car_materials)\n );\n mesh.position.y = 2;\n mesh.position.x = 128.90;\n mesh.position.z = 33.07;\n mesh.rotation.y = -Math.PI;\n mesh.castShadow = mesh.receiveShadow = true;\n\n\n\n vehicle2 = new Physijs.Vehicle(mesh, new Physijs.VehicleTuning(\n\n 5.88,\n 0.83,\n 0.88,\n 500,\n 10.5,\n 10000\n ));\n scene.add(vehicle2);\n var wheel_material = new THREE.MeshFaceMaterial(wheel_materials);\n\n for (var i = 0; i < 4; i++) {\n vehicle2.addWheel(\n wheel,\n wheel_material,\n new THREE.Vector3(\n i % 2 === 0 ? -1.6 : 1.6, -1,\n i < 2 ? 3.3 : -3.2\n ),\n new THREE.Vector3(0, -1, 0),\n new THREE.Vector3(-1, 0, 0),\n 0.5,\n 0.7,\n i < 2 ? false : true\n );\n }\n\n input2 = {\n power: null,\n direction: null,\n steering: 0\n };\n\n function forward() {\n input2.power = true;\n }\n\n function backwards() {\n input2.power = false;\n }\n\n function left() {\n input2.direction = 1;\n }\n\n function right() {\n input2.direction = -1;\n }\n\n function forwardnull() {\n input2.power = null;\n }\n\n function backwardsnull() {\n input2.power = null;\n }\n\n function leftnull() {\n input2.direction = null;\n input2.steering = 0;\n }\n\n function rightnull() {\n input2.direction = null;\n input2.steering = 0;\n }\n\n\n var setTimer0 = setInterval(function() {\n forward();\n console.log(\"ivantimer0\");\n clearInterval(setTimer0);\n }, 1000);\n\n var setTimer1 = setInterval(function() {\n left();\n console.log(\"ivantimer1\");\n clearInterval(setTimer1);\n }, 5400);\n\n var setTimer2 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer2\");\n clearInterval(setTimer2);\n }, 6190);\n //========================================================================================\n var setTimer3 = setInterval(function() {\n forwardnull();\n console.log(\"ivantimer3\");\n clearInterval(setTimer3);\n }, 11500);\n\n var setTimer4 = setInterval(function() {\n left();\n console.log(\"ivantimer4\");\n clearInterval(setTimer4);\n }, 12500);\n var setTimer5 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer5\");\n clearInterval(setTimer5);\n }, 12900);\n var setTimer6 = setInterval(function() {\n left();\n console.log(\"ivantimer6\");\n clearInterval(setTimer6);\n }, 13400);\n var setTimer7 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer7\");\n clearInterval(setTimer7);\n }, 14000);\n var setTimer8 = setInterval(function() {\n left();\n console.log(\"ivantimer8\");\n clearInterval(setTimer8);\n }, 14500);\n var setTimer9 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer9\");\n clearInterval(setTimer9);\n }, 14800);\n var setTimer10 = setInterval(function() {\n left();\n console.log(\"ivantimer10\");\n clearInterval(setTimer10);\n }, 18000);\n var setTimer11 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer11\");\n clearInterval(setTimer11);\n }, 18800);\n\n var setTimer12 = setInterval(function() {\n left();\n console.log(\"ivantimer12\");\n clearInterval(setTimer12);\n }, 19500);\n var setTimer13 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer13\");\n clearInterval(setTimer13);\n }, 19900);\n\n var setTimer14 = setInterval(function() {\n right();\n forwardnull();\n console.log(\"ivantimer14\");\n clearInterval(setTimer14);\n }, 21900);\n var setTimer15 = setInterval(function() {\n rightnull();\n forward();\n console.log(\"ivantimer15\");\n clearInterval(setTimer15);\n }, 22500);\n var setTimer16 = setInterval(function() {\n right();\n console.log(\"ivantimer16\");\n clearInterval(setTimer16);\n }, 22700);\n var setTimer17 = setInterval(function() {\n rightnull();\n forward();\n console.log(\"ivantimer17\");\n clearInterval(setTimer17);\n }, 23100);\n var setTimer18 = setInterval(function() {\n left();\n forwardnull();\n console.log(\"ivantimer18\");\n clearInterval(setTimer18);\n }, 26000);\n var setTimer19 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer19\");\n clearInterval(setTimer19);\n }, 26700);\n var setTimer20 = setInterval(function() {\n left();\n\n console.log(\"ivantimer20\");\n clearInterval(setTimer20);\n }, 27100);\n var setTimer21 = setInterval(function() {\n leftnull();\n forward();\n console.log(\"ivantimer21\");\n clearInterval(setTimer21);\n }, 27900);\n\n\n\n\n });\n });\n requestAnimationFrame(render);\n scene.simulate();\n }", "title": "" }, { "docid": "e4d6ec45c21c950ce9bb07658b9cd883", "score": "0.56016546", "text": "function main() {\n titleScene = new TitleScene();\n rectangleScene = new RectangleScene();\n endScene = new EndScene();\n\n titleScene.next = rectangleScene;\n rectangleScene.next = endScene;\n endScene.next = titleScene;\n\n allScenes.push(titleScene);\n allScenes.push(rectangleScene);\n allScenes.push(endScene);\n\n //Setup our prefabs\n var ball = new GameObject(\"Ball\");\n var ballGeometry = new Circle(.5);\n ball.components.push(new GeometryComponent(ballGeometry));\n var renderer = new GeometryRendererComponent(\"red\", ballGeometry);\n ball.components.push(renderer);\n ball.renderer = renderer;\n ball.components.push(new BallBehavior(this.hierarchy));\n ball.components.push(new Collider(ballGeometry));\n Prefabs.addPrefab(ball);\n\n var ball = new GameObject(\"Ball2\");\n var ballGeometry = new Circle(.5);\n ball.components.push(new GeometryComponent(ballGeometry));\n var renderer = new GeometryRendererComponent(\"gray\", ballGeometry);\n ball.components.push(renderer);\n ball.renderer = renderer;\n ball.components.push(new BallBehavior(this.hierarchy));\n ball.components.push(new Collider(ballGeometry));\n Prefabs.addPrefab(ball);\n\n ball = new GameObject(\"Bullet\");\n ballGeometry = new Circle(.1);\n ball.components.push(new GeometryComponent(ballGeometry));\n renderer = new GeometryRendererComponent(\"yellow\", ballGeometry);\n ball.components.push(renderer);\n ball.renderer = renderer;\n ball.components.push(new BulletBehavior(this.hierarchy));\n ball.components.push(new Collider(ballGeometry));\n Prefabs.addPrefab(ball);\n\n ball = new GameObject(\"BadBullet\");\n ballGeometry = new Circle(.1);\n ball.components.push(new GeometryComponent(ballGeometry));\n renderer = new GeometryRendererComponent(\"azure\", ballGeometry);\n ball.components.push(renderer);\n ball.renderer = renderer;\n ball.components.push(new BadBulletBehavior(this.hierarchy));\n ball.components.push(new Collider(ballGeometry));\n Prefabs.addPrefab(ball);\n\n var ball = new GameObject(\"Baddie\");\n var ballGeometry = new Circle(.5);\n ball.components.push(new GeometryComponent(ballGeometry));\n renderer = new GeometryRendererComponent(\"red\", ballGeometry);\n ball.components.push(renderer);\n ball.renderer = renderer;\n ball.components.push(new BaddieBehavior(this.hierarchy));\n ball.components.push(new Collider(ballGeometry));\n Prefabs.addPrefab(ball);\n\n var wall = new GameObject(\"MainPlayer\");\n wall.transform.position = new Vector2(0, -4);\n wall.transform.rotation = 0;\n var wallGeometry = new AxisAlignedRectangle(1, 1);\n wall.components.push(new GeometryComponent(wallGeometry));\n var wallRenderer = new GeometryRendererComponent(\"white\", wallGeometry);\n wall.components.push(wallRenderer);\n wall.renderer = wallRenderer;\n wall.components.push(new Collider(wallGeometry));\n wall.components.push(new MainPlayer());\n Prefabs.addPrefab(wall);\n\n var wall = new GameObject(\"Spice\");\n wall.transform.position = new Vector2(-4,-4);\n var wallGeometry = new AxisAlignedRectangle(2, 2);\n wall.components.push(new GeometryComponent(wallGeometry));\n var wallRenderer = new GeometryRendererComponent(\"green\", wallGeometry);\n wall.components.push(wallRenderer);\n wall.renderer = wallRenderer;\n wall.components.push(new Collider(wallGeometry));\n Prefabs.addPrefab(wall);\n\n var particleSystem = new GameObject(\"ParticleSystem\");\n var particleSystemComponent = new ParticleSystemComponent();\n particleSystem.components.push(particleSystemComponent);\n Prefabs.addPrefab(particleSystem);\n\n\n SceneManager.loadScene(titleScene);\n\n setInterval(timer, msBetweenFrames); //Start the main timer to be called 30 times a second (every 33.3ms)\n\n\n}", "title": "" }, { "docid": "319382abb28e7076bd757f78ae7c0b51", "score": "0.55993104", "text": "function setupScene() {\n\tgl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n\t\n\tfor (var ii=0;ii<1000;ii++){\n\t\trandomMats.push(convert_quats_to_4matrix(random_quat_pair(), mat4.create()));\n\t}\n\t\n\tmat4.identity(playerCamera);\t//not sure why have 2 matrices here...\n\t//bung extra quaternion stuff onto this for quick test\n\tplayerCamera.qPair = [[1,0,0,0],[1,0,0,0]];\n\t\n\t//start player off outside of boxes\n\txyzmove4mat(playerCamera,[0,0.7,-1.0]);\n\t\n\ttargetMatrix = cellMatData.d16[0];\n}", "title": "" }, { "docid": "9083f0ec473f2a52bce2dbfa593c5940", "score": "0.55986756", "text": "function setup() {\n createCanvas(WIDTH, HEIGHT);\n clearScreen();\n \n if(DEV) { // if currently developing, connect to localhost\n socket = io.connect(\"http://localhost:8000\");\n } else {\n socket = io.connect(\"https://addonwebgame.herokuapp.com/\");\n }\n if(socket != null) {\n // setup callbacks from server\n socket.on('otherMouse', drawOther); // setup other players drawing\n socket.on('clearScreen', clearScreen);\n console.log(\"connected to server successfully\");\n }\n \n lastMouseX = mouseX;\n lastMouseY = mouseY;\n}", "title": "" }, { "docid": "b53b03bc1c2fd30e06e597678c81bac4", "score": "0.5596806", "text": "function setup() {\n\tcreateCanvas(600, 600);\n\n\tsocket = io.connect('http://localhost:3000');\n\t//socket.on('mouse', newDrawing);\n\n\tshape = new Shape(random(width), random(height), 100, 0, 9);\n\n\tvar data = {\n\t\tx: shape.pos.x,\n\t\ty: shape.pos.y,\n\t\thealth: shape.health,\n\t\texp: shape.exp,\n\t\tsides: shape.sides\n\t}\n\tsocket.emit('start_shape', data);\n\n\tsocket.on('heartbeat_shapes',\n\t\tfunction(data) {\n\t\t\tshapes = data;\n\t\t\t//console.log(data);\n\t\t}\n\t);\n\n\n\tfor (var i = 0; i < 50; i++) {\n\t\tvar x = random(-width, width);\n\t\tvar y = random(-height, height);\n\t\texps[i] = new Exp(x, y, 16);\n\t\tvar expData = {\n\t\t\texpX: exps[i].pos.x,\n\t\t\texpY: exps[i].pos.y,\n\t\t\texpSize: exps[i].size\n\t\t}\n\t\tsocket.emit('start_exp', expData);\n\t}\n}", "title": "" }, { "docid": "e34a34cd00e4afed74664055080ed46a", "score": "0.5583492", "text": "function connect() {\n connectToRoom(room);\n easyrtc.setPeerListener(dispatchIncomingData);\n easyrtc.setRoomOccupantListener(generateRoomOccupants);\n if (room === \"default\" && firstConnect === true) {\n easyrtc.connect(\"multichat\", loginSuccess, loginFailure);\n firstConnect = false;\n }\n //pouchDB\n console.log(room);\n updateRoomListIndex();\n connectToDb(room);\n //vis.js\n generateGraph(room);\n\n $(\"#sendStuff\")\n .on(\"click\", function () {\n sendStuffWS();\n })\n .html(\"Send to room: \" + room);\n\n\n}", "title": "" }, { "docid": "e07547b99b8b4cb6c6a72dc30f3552df", "score": "0.55829215", "text": "function cl_msg_dispatch() {\n //console.log(\"msg dispatch called, CMD - \" + LOCAL_STATE.CMD);\n\n if (my_name && !document.title.startsWith(my_name + \": \")) {\n if (document.title.indexOf(\":\") > -1) {\n document.title = my_name + \": \" + document.title.substring(document.title.indexOf(':') + 2);\n }\n else {\n document.title = my_name + \": \" + document.title;\n }\n }\n\n if (LOCAL_STATE.CMD == \"new player added\") {\n cl_write_all_players();\n //to work correctly this needs to recover and draw current state of things\n gui_write_basic_general(LOCAL_STATE.current_bet_amount);\n return;\n }\n\n else if (LOCAL_STATE.CMD == \"game response\") {\n gui_write_game_response(\"<font size=+2><b>\" + LOCAL_STATE.CMD_PARMS + \"</b></font>\");\n }\n\n else if (LOCAL_STATE.CMD == \"update player status\") {\n cl_write_all_players();\n }\n\n else if ((LOCAL_STATE.CMD == \"start hand\") || (LOCAL_STATE.CMD == \"request next hand\") ||\n (LOCAL_STATE.CMD == \"request new game\")) {\n cl_new_round();\n //cl_show_board();\n gui_place_dealer_button(LOCAL_STATE.button_index);\n //cl_write_all_players();\n LOCAL_STATE.CMD = \"next player to act\";\n }\n\n if (LOCAL_STATE.CMD == \"next player to act\") {\n cl_write_all_players();\n //cl_show_board();\n cl_get_action();\n cl_write_player(LOCAL_STATE.current_bettor_index, 1, 0);\n gui_write_basic_general(cl_get_pot_size());\n gui_write_game_response(\"<font size=+2><b>Next to Act: \" +\n LOCAL_STATE.players[LOCAL_STATE.current_bettor_index].name);\n if (LOCAL_STATE.CMD_PARMS == \"deal flop\") {\n cl_deal_flop();\n }\n else if (LOCAL_STATE.CMD_PARMS == \"deal fourth\") {\n cl_deal_fourth();\n }\n else if (LOCAL_STATE.CMD_PARMS == \"deal fifth\") {\n cl_deal_fifth();\n }\n }\n else if (LOCAL_STATE.CMD == \"end of round\") {\n cl_deal_flop();\n setTimeout(cl_deal_fourth, 2000);\n setTimeout(cl_deal_fifth, 2500);\n gui_hide_quick_raise();\n gui_hide_fold_call_click();\n gui_hide_betting_click();\n cl_write_all_players();\n cl_check_for_busts();\n setTimeout(gui_write_game_response, 2500, LOCAL_STATE.CMD_PARMS);\n var sound = document.getElementById(\"tada\");\n sound.volume = 0.1;\n sound.play();\n internal_le_button(buttons, 'away-button', cl_away_func);\n internal_le_button(buttons, 'return-button', cl_away_func);\n var seat = cl_get_my_seat();\n if ((LOCAL_STATE.players[seat].bankroll < (LOCAL_STATE.STARTING_BANKROLL / 4)) ||\n (LOCAL_STATE.players[seat].status == \"BUST\")) {\n internal_le_button(buttons, 'rebuy-button', cl_rebuy);\n }\n if (cl_i_am_host()) {\n setTimeout(internal_le_button, 5000, buttons, 'deal-button', cl_request_next_hand);\n var accounting = 0;\n for (var n = 0; n < LOCAL_STATE.players.length; n++) {\n accounting +=\n LOCAL_STATE.players[n].bankroll - LOCAL_STATE.players[n].totalbank;\n }\n accounting += LOCAL_STATE.global_pot_remainder;\n if (accounting) {\n console.log(\"House account is off by $\" + (accounting / 100).toFixed(2));\n }\n }\n }\n\n if (cl_away) {\n internal_hide(document.getElementById('away-button'));\n internal_show(document.getElementById('return-button'));\n }\n else if (LOCAL_STATE.players[my_seat] && !cl_is_player_in_hand(LOCAL_STATE.players[my_seat])) {\n internal_hide(document.getElementById('return-button'));\n internal_show(document.getElementById('away-button'));\n }\n else {\n internal_hide(document.getElementById('return-button'));\n internal_hide(document.getElementById('away-button'));\n }\n}", "title": "" }, { "docid": "cad9391e26bca547b50fa250264a4554", "score": "0.5569109", "text": "function initScene() {\n\n\tspeech.text = \" \";\n\tspeechSynthesis.speak(speech); // workaround for allowing us to use text to speech at a later stage without needing another click event\n\t\n\tdocument.querySelector('.modal:not(.hide)').classList.add('hide'); // hide current view\n\tdocument.body.classList.add('playing'); // present sceneview\n\t\n\tfetch(\"scene.json\") // load scene data\n\t .then(response => response.json())\n\t .then(json => playScene(json));\n}", "title": "" }, { "docid": "924decf973b1ccb7bd705f3999e53104", "score": "0.5565146", "text": "onGraphLoaded() {\n if(this.graphs.length == 2) { \n this.graph = this.graphs[0];\n this.Current_Graph = this.graph.name;\n this.prev_graph = this.Current_Graph;\n this.Mode = \"Player vs Player\";\n this.Difficulty = 1;\n this.time_to_play = 450;\n this.currentBoard = null;\n\n for(let i = 0; i < this.graph.primitives.length; i++)\n {\n if(this.graph.primitives[i].type == \"board\")\n this.currentBoard = this.graph.primitives[i].obj;\n }\n\n this.New_Game = function() {\n this.currentBoard.newGame(this.Mode, this.Difficulty, this.time_to_play);\n };\n\n this.Quit_Game = function(){\n this.currentBoard.quitGame();\n };\n\n this.Undo = function() {\n this.currentBoard.undo(false);\n };\n\n this.game_film = function() {\n this.playVideo();\n };\n\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.setGlobalAmbientLight(this.graph.ambient.r, this.graph.ambient.g, this.graph.ambient.b, this.graph.ambient.a);\n this.gl.clearColor(this.graph.background.r, this.graph.background.g, this.graph.background.b, this.graph.background.a);\n\n var d = this.graph.defaultView;\n if(this.graph.defaultView.type == \"perspective\")\n this.camera = new CGFcamera(d.angle * Math.PI/180.0, d.near, d.far, d.from, d.to);\n else\n this.camera = new CGFcameraOrtho(d.left, d.right, d.bottom, d.top, d.near, d.far, d.from, d.to, vec3.fromValues(0, 1, 0));\n\n this.prev_camera = null;\n \n this.initLights();\n\n this.interface.addPlayOptionsGroup();\n\n // Adds looks group.\n this.interface.addLookGroup(this.graphs);\n \n this.interface.addNewGameButton();\n\n this.interface.addUndoButton();\n\n this.interface.addFilmButton();\n\n this.sceneInited = true;\n }\n }", "title": "" }, { "docid": "137be836e7dbbd0b6587032b4084b965", "score": "0.55643207", "text": "initScene(){\n this.scene = new BABYLON.Scene(this.engine);\n const camera = this.setCamera();\n const sphere = BABYLON.MeshBuilder.CreateSphere('', { diameter: .0001 }, this.scene);\n\t\t\n\t\t// Enable Physics (gravity)\n\t\tthis.scene.enablePhysics(null, new BABYLON.OimoJSPlugin());\n\t\t\n\t\t// Adding light\n\t\tvar light = new BABYLON.PointLight(\"dir01\", new BABYLON.Vector3(0, 5, 5), this.scene);\n\t\tlight.diffuse = new BABYLON.Color3(1, 1, 1);\n\t\tlight.specular = new BABYLON.Color3(0, 0, 0);\n\t\tthis.scene.ambientColor = new BABYLON.Color3(0.3, 0.3, 0.3);\n\t\t\n\t\t// Added Ground\n\t\tvar ground = BABYLON.Mesh.CreateGround(\"ground\", 1000, 1000, 1, this.scene, false);\n\t\tvar groundMaterial = new BABYLON.StandardMaterial(\"ground\", this.scene);\n\t\tgroundMaterial.diffuseColor = new BABYLON.Color3(0.2, 0.2, 0.2);\n\t\tgroundMaterial.specularColor = new BABYLON.Color3(0, 0, 0);\n\t\tground.material = groundMaterial;\n\t\tground.receiveShadows = true;\n\t\tground.checkCollisions = true;\n\t\tground.physicsImpostor = new BABYLON.PhysicsImpostor(ground, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0, friction: 0.5, restitution: 0.7}, this.scene);\n\t\t\n\t\t\n BABYLON.SceneLoader.ImportMesh(\"\", `/dist/Scenes/Dude/`, modelName, this.scene, (newMeshes, particleSystems, skeletons) => {\n const mesh = newMeshes[0];\n const skeleton = skeletons[0];\n var head_bone;\n\t\t\tvar right_shoulder_bone, right_arm_bone, right_hip_bone, right_knee_bone;\n\t\t\tvar left_shoulder_bone, left_arm_bone, left_hip_bone, left_knee_bone;\n\t\t\t\n\t\t\t// Enable gravity on mesh\n\t\t\tmesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0 }, this.scene);\n\t\t\tmesh.applyGravity = true;\n\t\t\tmesh.checkCollisions = true;\n\t\t\t\n\t\t\tif(modelName == \"Dude.babylon\") {\n\t\t\t\tmesh.scaling = new BABYLON.Vector3(0.1, 0.1, 0.1);\n\t\t\t\tmesh.position = new BABYLON.Vector3(0, 0, 0);\n\t\t\t\t\n\t\t\t\t/* Bone setup for Dude model */\n\t\t\t\t// Head\n\t\t\t\thead_bone = skeleton.bones[7];\n\t\t\t\t\n\t\t\t\t// Right Arm\n\t\t\t\tright_shoulder_bone = skeleton.bones[13];\n\t\t\t\tright_arm_bone = skeleton.bones[14];\n\t\t\t\t\n\t\t\t\t// Right Leg\n\t\t\t\tright_hip_bone = skeleton.bones[50];\n\t\t\t\tright_knee_bone = skeleton.bones[51];\n\t\t\t\t\n\t\t\t\t// Left Arm\n\t\t\t\tleft_shoulder_bone = skeleton.bones[32];\n\t\t\t\tleft_arm_bone = skeleton.bones[33];\n\t\t\t\t\n\t\t\t\t// Left Leg\n\t\t\t\tleft_hip_bone = skeleton.bones[54];\n\t\t\t\tleft_knee_bone = skeleton.bones[55];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmesh.scaling = new BABYLON.Vector3(4, 4, 4);\n\t\t\t\tmesh.position = new BABYLON.Vector3(0, 0, 0);\n\t\t\t\t\n\t\t\t\t/* Bone setup for Blue Humanoid Model */\n\t\t\t\t// Head\n\t\t\t\thead_bone = skeleton.bones[4];\n\t\t\t\t\n\t\t\t\t// Right Arm\n\t\t\t\tright_shoulder_bone = skeleton.bones[34]; // RightArm\n\t\t\t\tright_arm_bone = skeleton.bones[35];\t// RightForeArm\n\t\t\t\t\n\t\t\t\t// Right Leg\n\t\t\t\tright_hip_bone = skeleton.bones[57];\t// RightUpLeg\n\t\t\t\tright_knee_bone = skeleton.bones[58];\t// RightLeg\n\t\t\t\t\n\t\t\t\t// Left Arm\n\t\t\t\tleft_shoulder_bone = skeleton.bones[10]; // LeftArm\n\t\t\t\tleft_arm_bone = skeleton.bones[11];\t// LeftForeArm\n\t\t\t\t\n\t\t\t\t// Left Leg\n\t\t\t\tleft_hip_bone = skeleton.bones[62];\t// LeftUpLeg\n\t\t\t\tleft_knee_bone = skeleton.bones[63];\t// LeftLeg\n\t\t\t}\t\t\t\t\n\n const lookAtCtl = new BABYLON.BoneLookController(mesh, head_bone, sphere.position, { adjustYaw: Math.PI * .5, adjustRoll: Math.PI * .5 });\n\n this.scene.registerBeforeRender(() => {\n\n const { data } = this.joints;\n\n\t\t\t\tif(modelName == \"Dude.babylon\") {\n\t\t\t\t\tsphere.position.x = 0 + data.head.x;\n\t\t\t\t\tsphere.position.y = 6 + data.head.y;\n\t\t\t\t\tsphere.position.z = 5;\n\n\t\t\t\t\tlookAtCtl.update();\n\t\t\t\t\t\n\t\t\t\t\t// Right Arm\n\t\t\t\t\tright_shoulder_bone.rotation = new BABYLON.Vector3(0, data.rightShoulder, 0); // Changed by Sid from 1.5 to 1\n\t\t\t\t\tright_arm_bone.rotation = new BABYLON.Vector3(0, data.rightElbow, 0);\n\t\t\t\t\t\n\t\t\t\t\t// Right Leg\n\t\t\t\t\tright_hip_bone.rotation = new BABYLON.Vector3(0, data.rightHip, 0);\n\t\t\t\t\tright_knee_bone.rotation = new BABYLON.Vector3(0, data.rightKnee, 0);\n\t\t\t\t\t\n\t\t\t\t\t// Left Arm\n\t\t\t\t\tleft_shoulder_bone.rotation = new BABYLON.Vector3(0, data.leftShoulder, 0); // Changed by Sid from -1.5 to -1\n\t\t\t\t\tleft_arm_bone.rotation = new BABYLON.Vector3(0, data.leftElbow, 0);\n\t\t\t\t\t\n\t\t\t\t\t// Left Leg\n\t\t\t\t\tleft_hip_bone.rotation = new BABYLON.Vector3(0, data.leftHip, 0);\n\t\t\t\t\tleft_knee_bone.rotation = new BABYLON.Vector3(0, data.leftKnee, 0);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsphere.position.x = 0 + data.head.x;\n\t\t\t\t\tsphere.position.y = 20 + data.head.y;\n\t\t\t\t\tsphere.position.z = 0;\n\n\t\t\t\t\tlookAtCtl.update();\n\t\t\t\t\t\n\t\t\t\t\t// Right Arm\n\t\t\t\t\tright_shoulder_bone.rotation = new BABYLON.Vector3(0, 0, -data.rightShoulder); // Changed by Sid from 1.5 to 1\n\t\t\t\t\tright_arm_bone.rotation = new BABYLON.Vector3(0, data.rightElbow, 0);\n\t\t\t\t\t\n\t\t\t\t\t// Right Leg\n\t\t\t\t\tright_hip_bone.rotation = new BABYLON.Vector3(0, 0, data.rightHip - Math.PI);\n\t\t\t\t\tright_knee_bone.rotation = new BABYLON.Vector3(0, 0, data.rightKnee);\n\t\t\t\t\t\n\t\t\t\t\t// Left Arm\n\t\t\t\t\tleft_shoulder_bone.rotation = new BABYLON.Vector3(0, 0, -data.leftShoulder); // Changed by Sid from -1.5 to -1\n\t\t\t\t\tleft_arm_bone.rotation = new BABYLON.Vector3(0, data.leftElbow, 0);\n\t\t\t\t\t\n\t\t\t\t\t// Left Leg\n\t\t\t\t\tleft_hip_bone.rotation = new BABYLON.Vector3(0, 0, data.leftHip - Math.PI);\n\t\t\t\t\tleft_knee_bone.rotation = new BABYLON.Vector3(0, 0, data.leftKnee);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Check if user has followed current pose\n\t\t\t\t//if(!this.isPerson && this.reactApp.posesDone<2) {\n\t\t\t\tif(!this.isPerson && window.posesDone<2) {\n\t\t\t\t\t//Check if pose matched!\n\t\t\t\t\tif(this.checkIfPoseMatched()) {\n\t\t\t\t\t\talert(\"Great! You completed pose index: \"+this.reactApp.posesDone + \"\\nNamed: \"+this.joints.data['asanaName']);\n\t\t\t\t\t\tthis.reactApp.posesDone = this.reactApp.posesDone + 1;\n\t\t\t\t\t\tthis.reactApp.show_recorded_pose_having_index(this.reactApp.posesDone);\n\t\t\t\t\t}\n\t\t\t\t}\n });\n });\n }", "title": "" }, { "docid": "098f4c5643ad719d3574dedeac837d0c", "score": "0.5563208", "text": "function Main() {\n console.log(`%c Switching Scenes`, \"color: green; font-size:16px;\");\n // cleanup\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.removeAllChildren();\n stage.removeAllChildren();\n }\n // state machine\n switch (config.Game.SCENE_STATE) {\n case scenes.State.START:\n currentScene = new scenes.Start();\n break;\n case scenes.State.INSTRUCTION:\n currentScene = new scenes.Instruction();\n break;\n case scenes.State.PLAY:\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n currentScene = new scenes.End();\n break;\n case scenes.State.WINNER:\n currentScene = new scenes.Winner();\n break;\n }\n // add the scene to the stage and setup the current scene\n stage.addChild(currentScene);\n currentSceneState = config.Game.SCENE_STATE;\n }", "title": "" }, { "docid": "c6ae78cdc606862a2937cf3b6fb4c244", "score": "0.5562495", "text": "function setup(){\n\n //Set size from window of user.\n createCanvas(1000, 1000);\n\n head = new Segment(50, 50, true, user.color)\n\n UserSnakeSegments.push(head)\n\n UserSnake = new Snake(\"1667030a-b01a-4967-b1b3-b4be2b9012bd\", 50, 50, false, user.color, 0, UserSnakeSegments);\n\n\n var socket = new SockJS('/server');\n\n stompClient = Stomp.over(socket);\n\n stompClient.connect({}, function(frame) {\n \n console.log('Connected: ' + frame);\n\n stompClient.subscribe('/sync/players', function(message) {\n\n players = JSON.parse(message.body)\n\n for (let i = 0; i < players.length; i++){\n Snakes[i] = new Snake(players[i].clientId, players[i].fposition.x, players[i].fposition.y, false, players[i].color, players[i].score, UserSnakeSegments);\n }\n\n });\n\n stompClient.subscribe('/sync/player', function(message) {\n message = JSON.parse(message.body);\n });\n\n stompClient.subscribe('/sync/join', function(message) {\n \n if (ClientId == \"1667030a-b01a-4967-b1b3-b4be2b9012bd\") \n {\n\n\n ClientId = JSON.parse(message.body);\n UserSnake.clientId = JSON.parse(message.body);\n Snakes.push(UserSnake);\n\n \n }\n else \n {\n return;\n }\n\n });\n\n });\n\n //sendMessage();\n\n //Snakes[1] = new Snake(width/2, height/2, true, 'red');\n //Snakes[2] = new Snake(width/2, height/2, true, 'yellow');\n //Snakes[1] = new Snake(width/2, height/2, true, 'purple');\n\n //Parse color from Thabiso's landing page\n //let colors = ['crimson','mediumvioletred','steelblue','lightgreen', 'blue'];\n\n\n //Get all player snakes's from server through Socket\n //Something like loop through json response ---@1\n\n apple = new Apple();\n\n leaderboard = new Leaderboard()\n\n // ---@1\n // for (let i = 1; i < 2; i++){\n // Snakes[i] = new Snake(random(width), random(height), true, getColor(colors));\n // }\n}", "title": "" }, { "docid": "47e642a73ea645e04e728a78ebbc3d19", "score": "0.55590546", "text": "create ()\r\n {\r\n\t \tvar actualScene = this;\r\n\r\n // Variable que indica si se está cambiando de escena.\r\n isChangingScene = false;\r\n\r\n // Añadimos los sonidos a la escena.\r\n hoverSound = this.sound.add('menuHover');\r\n selectedSound = this.sound.add('menuSelected');\r\n\r\n // Añadimos el background y el titulo.\r\n this.add.image(960/2, 540/2, 'interfazBg');\r\n this.add.image(960/2, 540/2, 'interfazTitle');\r\n\r\n // Añadimos el texto que indica cuantos jugadores quedan.\r\n waitingPlayersText = this.add.text(960/2, 240, \"\", { fontFamily: 'Impact', fontSize: '32px', fill: '#fff', align: 'center', }).setDepth(1);\r\n waitingPlayersText.setStroke('rgba(0,0,0,1)', 4);\r\n\r\n // Añadimos las luces que indicaran que boton del menu esta activo. Hacemos tambien un fade con la camara.\r\n cam = this.cameras.main;\r\n cam.fadeIn(1000);\r\n\r\n buttonArray = [\r\n new Button(this, 960/2, 500, 'light', function() {\r\n selectedSound.play({ volume: this.scene.game.soundVolume });\r\n isChangingScene = true;\r\n\r\n cam.fadeOut(1000);\r\n web.loopServerInfoStop();\r\n web.loopChatStop();\r\n this.scene.game.customTransition(this.scene, 'menu', 1000);\r\n },)\r\n ];\r\n\r\n // Hacemos a todas las luces invisibles al inicio de la escena.\r\n for (var i = 0; i < buttonArray.length; i++) {\r\n buttonArray[i].alpha = 0;\r\n }\r\n\r\n // Añadimos los textos de los botones.\r\n this.add.image(960/2, 500, 'text_back');\r\n\r\n // Añadimos la funcion que se ejecutara al presionar el boton izquierdo del raton.\r\n // Indica que funcion hay que ejecutar segun la opcion seleccionada en el menu.\r\n this.input.on('pointerdown', function () {\r\n for (var i = 0; i < buttonArray.length; i++) {\r\n \tif (!isChangingScene && buttonArray[i].isActive) {\r\n \t\tbuttonArray[i].Behaviour();\r\n \t}\r\n }\r\n });\r\n\r\n web.loopChatStart();\r\n web.loopServerInfoStart();\r\n }", "title": "" }, { "docid": "aefef787c25d67ae5519370b1f41ea35", "score": "0.5558599", "text": "function canvasApp() {\t\n\t// UNMUTE FOR BACKGROUND MUSIC\n\t//audioElement.muted = true;\n\n\taudioElement.play();\n\taudioElement.loop = true;\n\taudioElement.volume = 0.5;\n\n\t// Shuffle the tile deck\n\tshuffleArray(terrainDist);\n\n\t// Adding meshes to scene\n\tdrawBackground();\n\tdrawSidePanel();\n\tdrawTitle();\n\n\t// TODO\n\t// SOLIDIFY ANIMATION FLOW\n\tdrawPlayerNumPrompt();\n\t\n\t// GAMELOOP\n\tvar render = function() {\n\t\t//i++;\n\t\t//console.log('inside render iter: ' + i);\n\t\t\n\t\t//Logic for correct display BASED ON STATES\n\t\t// AND THEN Graphics based on that logic\n\t\tif (idling) {\n\t\t\t// NO LOGIC\n\t\t\t// GRAPHICS\n\t\t\t// remove choose player meshes\n\t\t\tif (button1Mesh) {\n\t\t\t\tscene.remove(button1Mesh);\n\t\t\t\tbutton1Mesh = undefined;\n\n\t\t\t\tscene.remove(button2Mesh);\n\t\t\t\tbutton2Mesh = undefined;\n\n\t\t\t\tscene.remove(button3Mesh);\n\t\t\t\tbutton3Mesh = undefined;\n\n\t\t\t\tscene.remove(button4Mesh);\n\t\t\t\tbutton4Mesh.geometry.dispose();\n\t\t\t\tbutton4Mesh.material.dispose();\n\t\t\t\tbutton4Mesh = undefined;\n\n\t\t\t\tscene.remove(playersMesh);\n\t\t\t\tplayersMesh.geometry.dispose();\n\t\t\t\tplayersMesh.material.dispose();\n\t\t\t\tplayersMesh = undefined;\n\n\t\t\t\tscene.remove(howManyPMesh);\n\t\t\t\thowManyPMesh.geometry.dispose();\n\t\t\t\thowManyPMesh.material.dispose();\n\t\t\t\thowManyPMesh = undefined;\n\t\t\t\t\n\t\t\t\tdrawDeck();\n\t\t\t\t// add new player turn mesh\n\t\t\t\tdrawPlayerTurn(currPlayer);\n\t\t\t\t// add new tile counter\n\t\t\t\tdrawTileCounter();\n\t\t\t// On new player turn\n\t\t\t} else if (doneBuilding) {\n\t\t\t\tdoneBuilding = false;\n\t\t\t\t// remove prev player turn\n\t\t\t\tscene.remove(playerTurnMesh);\n\t\t\t\tplayerTurnMesh.geometry.dispose();\n\t\t\t\tplayerTurnMesh.material.dispose();\n\t\t\t\tplayerTurnMesh = undefined;\n\n\t\t\t\t// add new player turn mesh\n\t\t\t\tdrawPlayerTurn(currPlayer);\n\t\t\t} else if (badTilePlacement) {\n\t\t\t\tbadTilePlacement = false;\n\t\t\t\t\n\t\t\t\t// remove prev tile counter\n\t\t\t\tscene.remove(tileCountMesh);\n\t\t\t\ttileCountMesh.geometry.dispose();\n\t\t\t\ttileCountMesh.material.dispose();\n\t\t\t\ttileCountMesh = undefined;\n\t\t\t\t// add new tile counter\n\t\t\t\tdrawTileCounter();\n\n\t\t\t\t// REMOVE new tile on deck\n\t\t\t\tscene.traverse (function (object) {\n\t\t\t\t\tif (object instanceof THREE.Mesh) {\n\n\t\t\t\t\t\tvar topString = 'topDeckHex' + (remainingTiles+1).toString();\n\t\t\t\t\t\tvar leftString = 'leftDeckHex' + (remainingTiles+1).toString();\n\t\t\t\t\t\tvar rightString = 'rightDeckHex' + (remainingTiles+1).toString();\n\t\t\t\t\t\tif (object.name === topString) {\n\t\t\t\t\t\t\tconsole.log('deleting object.name = ' + object.name);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tscene.remove(object);\n\t\t\t\t\t\t\tobject = undefined;\n\n\t\t\t\t\t\t} else if (object.name === leftString) {\n\t\t\t\t\t\t\tconsole.log('deleting object.name = ' + object.name);\n\n\t\t\t\t\t\t\tscene.remove(object);\n\t\t\t\t\t\t\tobject = undefined;\n\n\t\t\t\t\t\t} else if (object.name === rightString) {\n\t\t\t\t\t\t\tconsole.log('deleting object.name = ' + object.name);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tscene.remove(object);\n\t\t\t\t\t\t\tobject = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\tterrDistIndex--;\n\t\t\t\tremainingTiles = TILE_NUM - terrDistIndex;\n\n\t\t\t\tdrawDeck();\n\t\t\t}\n\t\t\t\t\n\t\t} else if (holdingTile) {\n\t\t\tconsole.log(\"holding Tile in render\");\n\n\t\t\tif (justGrabbedTile) {\n\t\t\t\tjustGrabbedTile = false;\n\n\t\t\t\t// remove prev tile counter\n\t\t\t\tscene.remove(tileCountMesh);\n\t\t\t\ttileCountMesh.geometry.dispose();\n\t\t\t\ttileCountMesh.material.dispose();\n\t\t\t\ttileCountMesh = undefined;\n\t\t\t\t// add new tile counter\n\t\t\t\tdrawTileCounter();\n\t\t\t\t// add new deck underneath\n\t\t\t\tdrawDeck();\t\n\t\t\t\tfirstDraw = false; // unused\t\n\t\t\t}\n\t\t\telse if (tryingTilePlacement) {\n\t\t\t\ttryingTilePlacement = false;\n\n\t\t\t\tconsole.log(\"clicked board mouse3DVector: (\" + \n\t\t\t\tmouse3DVector.x + \",\" + mouse3DVector.y + \",\" + mouse3DVector.z + \")\");\n\t\t\t\t\n\t\t\t\t//var raycaster = projector.pickingRay(mouse3DVector, camera);\n\t\t\t\traycaster.setFromCamera(mouse3DVector, camera); \n\t\t\t\tvar pos = raycaster.ray.intersectPlane(zPlane);\n\t\t\t\t\n\t\t\t\tconsole.log(\"clicked board pos: (\" + \n\t\t\t\t\tpos.x + \",\" + pos.y + \",\" + pos.z + \")\");\n\n\t\t\t\t// Draw a new tile at appropriate coordinates\n\t\t\t\tvar tileRow = getTopRow(pos.x, pos.y);\n\t\t\t\tvar tileCol = getLeftmostCol(pos.x, pos.y, tileRow);\n\t\t\t\tconsole.log(\"top tile row clicked: \" + tileRow + \", leftmost tile col clicked: \" + tileCol);\n\t\t\t\tif (tileFlipped) {\n\t\t\t\t\tvar bottomIndex, leftIndex, rightIndex;\n\t\t\t\t\tconsole.log(\"tile angle: \" + tileAngle);\n\t\t\t\t\t// Change to access terrainDist Array\n\t\t\t\t\tif (tileAngle < 100 * (Math.PI/180)) { // 60\n\t\t\t\t\t\tbottomIndex = 2;\n\t\t\t\t\t\tleftIndex = 1;\n\t\t\t\t\t\trightIndex = 0;\n\t\t\t\t\t} else if (tileAngle < 200 * (Math.PI/180)) { // 180\n\t\t\t\t\t\tbottomIndex = 0;\n\t\t\t\t\t\tleftIndex = 2;\n\t\t\t\t\t\trightIndex = 1;\n\t\t\t\t\t} else { // 300\n\t\t\t\t\t\tbottomIndex = 1;\n\t\t\t\t\t\tleftIndex = 0;\n\t\t\t\t\t\trightIndex = 2;\n\t\t\t\t\t}\n\t\t\t\t\t// USED TO BE FORR HOLDINGTILE\n\t\t\t\t\t//var newCenterHex = new HexState(tileRow+1, tileCol, 1, terrainDist[terrDistIndex][bottomIndex-1], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tvar newCenterHex = new HexState(tileRow+1, tileCol, 1, terrainDist[terrDistIndex][bottomIndex], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tconsole.log(\"to add boardState[\" + (tileRow+1) + \"][\" + (tileCol+Math.floor((ROWS-1)/2)) + \"] = \" + newCenterHex);\n\t\t\t\t\t\n\t\t\t\t\tvar newLeftHex = new HexState(tileRow, tileCol, 1, terrainDist[terrDistIndex][leftIndex], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tconsole.log(\"to add boardState[\" + tileRow + \"][\" + (tileCol+Math.floor((ROWS-1)/2)) + \"] = \" + newLeftHex);\n\t\t\t\t\t\n\t\t\t\t\tvar newRightHex = new HexState(tileRow, tileCol+1, 1, terrainDist[terrDistIndex][rightIndex], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tconsole.log(\"to add boardState[\" + tileRow + \"][\" + (tileCol+1+Math.floor((ROWS-1)/2)) + \"] = \" + newRightHex);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tvar topIndex, leftIndex, rightIndex;\n\t\t\t\t\tconsole.log(\"tile angle: \" + tileAngle);\n\t\t\t\t\tif (tileAngle < 100 * (Math.PI/180)) { // 0\n\t\t\t\t\t\ttopIndex = 0;\n\t\t\t\t\t\tleftIndex = 1;\n\t\t\t\t\t\trightIndex = 2;\n\t\t\t\t\t} else if (tileAngle < 200 * (Math.PI/180)) { // 120\n\t\t\t\t\t\ttopIndex = 1;\n\t\t\t\t\t\tleftIndex = 2;\n\t\t\t\t\t\trightIndex = 0;\n\t\t\t\t\t} else { // 240\n\t\t\t\t\t\ttopIndex = 2;\n\t\t\t\t\t\tleftIndex = 0;\n\t\t\t\t\t\trightIndex = 1;\n\t\t\t\t\t}\n\t\t\t\t\tvar newCenterHex = new HexState(tileRow, tileCol+1, 1, terrainDist[terrDistIndex][topIndex], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tconsole.log(\"to add boardState[\" + tileRow + \"][\" + (tileCol+1+Math.floor((ROWS-1)/2)) + \"] = \" + newCenterHex);\n\n\t\t\t\t\tvar newLeftHex = new HexState(tileRow+1, tileCol, 1, terrainDist[terrDistIndex][leftIndex], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tconsole.log(\"to add boardState[\" + (tileRow+1) + \"][\" + (tileCol+Math.floor((ROWS-1)/2)) + \"] = \" + newLeftHex);\n\t\t\t\t\t\n\t\t\t\t\tvar newRightHex = new HexState(tileRow+1, tileCol+1, 1, terrainDist[terrDistIndex][rightIndex], tileAngle, currPlayer, 0, 0, 0, false);\n\t\t\t\t\tconsole.log(\"to add boardState[\" + (tileRow+1) + \"][\" + (tileCol+1+Math.floor((ROWS-1)/2)) + \"] = \" + newRightHex);\n\t\t\t\t}\n\n\t\t\t\tif (isTileValid(tileRow, tileCol, newCenterHex, newLeftHex, newRightHex, boardState)) {\n\t\t\t\t\tdrawableBoardHexagons.push(newCenterHex, newLeftHex, newRightHex);\n\t\t\t\t\tif (tileFlipped) {\n\t\t\t\t\t\t// Add boardstate offsets\n\t\t\t\t\t\tboardState[tileRow+1][tileCol+Math.floor((ROWS-1)/2)] = newCenterHex;\n\t\t\t\t\t\tboardState[tileRow][tileCol+Math.floor((ROWS-1)/2)] = newLeftHex;\n\t\t\t\t\t\tboardState[tileRow][tileCol+1+Math.floor((ROWS-1)/2)] = newRightHex;\n\n\t\t\t\t\t\t// GRAPHICS\n\t\t\t\t\t\ttranslateAndMoveHexMesh(tileRow+1, tileCol);\n\t\t\t\t\t\ttranslateAndMoveHexMesh(tileRow, tileCol);\n\t\t\t\t\t\ttranslateAndMoveHexMesh(tileRow, tileCol+1);\n\n\t\t\t\t\t\ttileFlipped = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tboardState[tileRow][tileCol+1+Math.floor((ROWS-1)/2)] = newCenterHex;\n\t\t\t\t\t\tboardState[tileRow+1][tileCol+Math.floor((ROWS-1)/2)] = newLeftHex;\n\t\t\t\t\t\tboardState[tileRow+1][tileCol+1+Math.floor((ROWS-1)/2)] = newRightHex;\n\n\t\t\t\t\t\tconsole.log('moving meshes - successful placement');\n\t\t\t\t\t\t// GRAPHICS\n\t\t\t\t\t\ttranslateAndMoveHexMesh(tileRow, tileCol+1, 'topDeckHex' + (remainingTiles+1).toString());\n\t\t\t\t\t\ttranslateAndMoveHexMesh(tileRow+1, tileCol, 'leftDeckHex' + (remainingTiles+1).toString());\n\t\t\t\t\t\ttranslateAndMoveHexMesh(tileRow+1, tileCol+1, 'rightDeckHex' + (remainingTiles+1).toString());\n\n\n\t\t\t\t\t}\n\t\t\t\t\t// STATE CHANGE\n\t\t\t\t\tholdingTile = false;\n\n\t\t\t\t\tbuildingTime = true;\n\t\t\t\t\t// substate\n\t\t\t\t\tstartedBuilding = true;\n\t\t\t\t\t\n\t\t\t\t\theldOverPlaced = false;\n\n\t\t\t\t\t//drawDeck();\n\t\t\t\n\t\t\t\t\t// Player elimination if no building options left\n\t\t\t\t\tif (remainingTiles < (TILE_NUM-1) && noBuildingOptionsLeft()) {\n\t\t\t\t\t\t// Eliminate player\n\t\t\t\t\t\tswitch(currPlayer) {\n\t\t\t\t\t\tcase PlayerEnum.ONE:\n\t\t\t\t\t\t\tplayerIndex = 0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PlayerEnum.TWO:\n\t\t\t\t\t\t\tplayerIndex = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PlayerEnum.THREE:\n\t\t\t\t\t\t\tplayerIndex = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PlayerEnum.FOUR:\n\t\t\t\t\t\t\tplayerIndex = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplayers[playerIndex] = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// For elimination\n\t\t\t\t\t\tvar playerCount= 0;\n\t\t\t\t\t\tfor (var i = 0; i < players.length; i++) {\n\t\t\t\t\t\t\tif (players[i] === 1) {\n\t\t\t\t\t\t\t\tplayerCount++;\n\t\t\t\t\t\t\t\tlastPlayerAlive = i + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (playerCount === 1) {\n\t\t\t\t\t\t\tonePlayerLeft = true;\n\t\t\t\t\t\t\tgameOver = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//drawScreen();\n\t\t\t\t\t/*if (tileAngle !== 0) {\n\t\t\t\t\t\ttileAngle = 0;\n\t\t\t\t\t}*/\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"ILLEGAL PLACEMENT\");\n\t\t\t\t\tif (tileFlipped) { tileFlipped = false; }\n\t\t\t\t\t// STATE CHANGE\n\t\t\t\t\tholdingTile = false;\n\t\t\t\t\t\n\t\t\t\t\t// STATE CHANGE\n\t\t\t\t\tidling = true;\n\n\t\t\t\t\tbadTilePlacement = true;\n\n\t\t\t\t\t// Put tile back in deck\n\t\t\t\t\t//terrDistIndex--;\n\t\t\t\t\t//remainingTiles = TILE_NUM - terrDistIndex;\n\t\t\t\t\t//drawScreen();\n\t\t\t\t}\n\t\t\t\t//render();\n\t\t\t\tif (tileAngle !== 0) {\n\t\t\t\t\ttileAngle = 0;\n\t\t\t\t}\n\t\t\t\t//return;\n\t\t\t}\n\n\t\t\t//ANIMATE HOLDING TILE\n\t\t\traycaster.setFromCamera(mouse3DVector, camera); \n\t\t\tvar pos = raycaster.ray.intersectPlane(zPlane);\n\t\t\tconsole.log(\"hovering board pos: (\" + \n\t\t\t\tpos.x + \",\" + pos.y + \",\" + pos.z + \")\");\t\t\n\t\t\t\n\t\t\t// If mouse position has changed\n\t\t\t//if (prevMouseX !== mouse.x || prevMouseY !== mouse.y) {\n\t\t\tconsole.log(\"about to traverse objects\");\n\t\t\tscene.traverse (function (object) {\n\t\t\t\tif (object instanceof THREE.Mesh) {\n\t\t\t\t\t//console.log(\"Mesh detected. Object.name = \" + object.name);\n\t\t\t\t\t\n\t\t\t\t\tvar topString = 'topDeckHex' + (remainingTiles+1).toString();\n\t\t\t\t\tvar leftString = 'leftDeckHex' + (remainingTiles+1).toString();\n\t\t\t\t\tvar rightString = 'rightDeckHex' + (remainingTiles+1).toString();\n\t\t\t\t\tif (object.name === topString) {\n\t\t\t\t\t\tconsole.log('object.name = ' + object.name);\n\t\t\t\t\t\tobject.position.z = 3*BOARD_HEIGHT;\n\t\t\t\t\t\tobject.position.x = pos.x;\n\t\t\t\t\t\tobject.position.y = pos.y + SIZE;\n\t\t\t\t\t\t//object.position.set(mouse.x, mouse.y + SIZE, 3*BOARD_HEIGHT); \n\t\t\t\t\t\tconsole.log(\"topHex position: \" + object.position.x + \" \" + object.position.y + \" \" + object.position.z);\n\t\t\t\t\t} else if (object.name === leftString) {\n\t\t\t\t\t\tconsole.log('object.name = ' + object.name);\n\t\t\t\t\t\tobject.position.z = 3*BOARD_HEIGHT;\n\t\t\t\t\t\tobject.position.x = pos.x - (WIDTH / 2);\n\t\t\t\t\t\tobject.position.y = pos.y - (SIZE / 2);\n\n\t\t\t\t\t\t//object.position.set(mouse.x - (WIDTH / 2), mouse.y - (SIZE / 2), 3*BOARD_HEIGHT); \n\t\t\t\t\t\tconsole.log(\"leftHex position: \" + object.position.x + \" \" + object.position.y + \" \" + object.position.z);\n\n\t\t\t\t\t} else if (object.name === rightString) {\n\t\t\t\t\t\tconsole.log('object.name = ' + object.name);\n\t\t\t\t\t\tobject.position.z = 3*BOARD_HEIGHT;\n\t\t\t\t\t\tobject.position.x = pos.x + (WIDTH / 2);\n\t\t\t\t\t\tobject.position.y = pos.y - (SIZE / 2);\n\t\t\t\t\t\t//object.position.set(mouse.x + (WIDTH / 2), mouse.y - (SIZE / 2), 3*BOARD_HEIGHT);\n\n\t\t\t\t\t\t/*console.log(\"rightHex position: \" + object.position.x + \" \" + object.position.y + \" \" + object.position.z);\n\t\t\t\t\t\tconsole.log('');\n\t\t\t\t\t\tconsole.log(\"mouse.x: \" + mouse.x + \", mouse.y: \" + mouse.y);\n\t\t\t\t\t\tconsole.log('');*/\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t} else if (buildingTime) {\n\t\t\tconsole.log(\"In building logic\");\n\t\t\t\n\t\t\t// todo\n\t\t\tif (startedBuilding) {\n\t\t\t\tstartedBuilding = false;\n\t\t\t\tdrawHutsTemplesAndTowers();\n\t\t\t\tif (hutsLeft() && buildingTime) {\n\t\t\t\t\taddExpandButtonMesh();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (holdingHut) {\n\t\t\t// todo\n\t\t\tdrawHutsTemplesAndTowers();\n\t\t\tif (hutsLeft() && buildingTime) {\n\t\t\t\taddExpandButtonMesh();\n\t\t\t}\n\t\t} else if (holdingTower) {\n\t\t\t// todo\n\t\t\tdrawHutsTemplesAndTowers();\n\t\t\tif (hutsLeft() && buildingTime) {\n\t\t\t\taddExpandButtonMesh();\n\t\t\t}\n\t\t} else if (holdingTemple) {\n\t\t\t// todo\n\t\t\tdrawHutsTemplesAndTowers();\n\t\t\tif (hutsLeft() && buildingTime) {\n\t\t\t\taddExpandButtonMesh();\n\t\t\t}\n\t\t} else if (gameOver) {\n\t\t\taddGameOverMesh();\n\t\t\tcomposer.render();\n\t\t\t//renderer.render(scene, camera);\n\t\t\treturn;\n\t\t\t// After players chosen\n\t\t} else {\n\t\t\t// code to remove meshes\n\t\t\t/*scene.remove(myMesh);\n\t\t\tmyMesh.geometry.dispose();\n\t\t\tmyMesh.material.dispose();\n\t\t\tmyMesh = undefined;\n\t\t\t*/\n\n\t\t}\n\t\tprevMouseX = mouse.x;\n\t\tprevMouseY = mouse.y;\n\t\t//console.log('rendering scene');\n\t\tcomposer.render();\n\t\t//renderer.render(scene, camera);\n\t\trequestAnimationFrame(render);\n\t\t//requestAnimationFrame(animate);\n\t}\n\trender();\n}", "title": "" }, { "docid": "80a84eef8468a20441918e320f0c55c1", "score": "0.5555774", "text": "function main() {\n\n var now = Date.now(),\n duration,\n color,\n start_opacity,\n end_opacity,\n dt = (now - lastTime) / 1000.0;\n //TODO: this state machine logic is quite convoluted and impractical. Needs refactoring.\n switch (gameState.current) {\n case gameState.type.IN_GAME:\n update(dt);\n render();\n renderUI();\n var timeout = timeOut(now);\n var playerdied = playerDied();\n\n var gameover = timeout || playerdied;\n\n var playerwon = didPlayerWin();\n\n if (gameover || playerwon)\n {\n if(isticking) {\n sfx.stop(\"tictac\");\n }\n\n sfx.fadeOut(\"music\");\n gameState.current = gameState.type.GAME_FINISHED;\n genericTimeStamp = now;\n\n if(timeout) {\n sfx.play(\"buzzer\");\n } else if(playerdied) {\n sfx.play(\"gameover\");\n } else {\n sfx.play(\"win\");\n }\n } else {\n var elapsed = (now - gameStartTime - player.timebonus)/1000;\n var remaining = timer - elapsed;\n if((remaining < 15) && !isticking) {\n isticking=true;\n sfx.play(\"tictac\");\n } else if ((remaining > 15) && isticking) {\n isticking=false;\n sfx.stop(\"tictac\");\n }\n }\n\n break;\n case gameState.type.GAME_FINISHED:\n start_opacity = 0;\n end_opacity = 0.9;\n duration = 3;\n color = 'black';\n\n render();\n update(dt);\n\n if (renderFade(genericTimeStamp, duration, start_opacity, end_opacity, color)) {\n initGameMenu();\n }\n\n break;\n\n case gameState.type.GAME_MENU:\n color= 'black';\n start_opacity = 0.9;\n duration = 0.5;\n render();\n update(dt);\n renderSquare(0,0, canvas.width, canvas.height, color, null, 0, start_opacity);\n break;\n\n case gameState.type.GAME_MENU_HIDE:\n color= 'black';\n start_opacity = 0.9;\n duration = 0.5;\n render();\n update(dt);\n renderSquare(0,0, canvas.width, canvas.height, color, null, 0, start_opacity);\n if(Date.now() - genericTimeStamp > 500) {\n gameState.current = gameState.type.GAME_MENU_FADEIN;\n genericTimeStamp = now;\n sfx.fadeIn('music');\n }\n\n break;\n\n case gameState.type.GAME_MENU_FADEIN:\n start_opacity = 0.9;\n end_opacity = 1;\n color = 'black';\n duration = 1;\n\n render();\n update(dt);\n\n if (renderFade(genericTimeStamp, duration, start_opacity, end_opacity, color)) {\n reset();\n genericTimeStamp = now;\n gameState.current = gameState.type.GAME_MENU_FADEOUT;\n }\n break;\n\n case gameState.type.GAME_MENU_FADEOUT:\n start_opacity = 1;\n end_opacity =0;\n color = 'black';\n duration = 2;\n render();\n\n if (renderFade(genericTimeStamp, duration, start_opacity, end_opacity, color)) {\n gameStartTime = now;\n gameState.current = gameState.type.IN_GAME;\n }\n\n break;\n }\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "e183ef36e5b134cdba1f1985e98ed1d5", "score": "0.55535525", "text": "function setupScene() \r\n{\t\r\n\tgameState.scene.background = new THREE.Color().setHSL( 0.6, 0.6, 0.8 );\r\n\t\r\n\t// make debug text white\r\n\tdocument.getElementById(constants.PREGEN_DEBUG_CONTAINER_ID).style.color = 'white';\r\n\t\r\n\t// create blocking div\r\n\tvar blocker = document.createElement('div');\r\n\tblocker.id = 'blocker';\r\n\tblocker.style.position = 'absolute';\r\n\tblocker.style.width = '100%';\r\n\tblocker.style.height = '100%';\r\n\tblocker.style.fontSize = '40px';\r\n\tblocker.style.zIndex = '100';\r\n\tblocker.style.top = '550px';\r\n\tblocker.innerHTML = 'Game Paused';\r\n\tdocument.getElementById('centerFrame').appendChild(blocker);\r\n\t\r\n\t// create instructions div\r\n\tvar instructions = document.createElement('div');\r\n\tinstructions.id = 'instructions';\r\n\t\r\n\tvar instructionSpan = document.createElement('span');\r\n\tinstructionSpan.style.fontSize = '40px';\r\n\tinstructionSpan.innerHTML = \"Click to play\";\r\n\tinstructions.appendChild(instructionSpan);\r\n\t\r\n\tvar brHTML = document.createElement('br');\r\n\tinstructions.appendChild(brHTML);\r\n\tinstructions.innerHTML += \"Arrow keys = Move\";\r\n\tinstructions.appendChild(brHTML);\r\n\tinstructions.innerHTML += \"Number keys = Change camera\";\r\n\tdocument.getElementById('centerFrame').appendChild(instructions);\r\n\t\r\n\tgameState.rings = [\r\n\t\tgameState.scene.getChildByName(\"ring1\"),\r\n\t\tgameState.scene.getChildByName(\"ring2\"),\r\n\t\tgameState.scene.getChildByName(\"ring3\"),\r\n\t\tgameState.scene.getChildByName(\"ring4\")\r\n\t]\r\n\tgameState.nextRing = gameState.scene.getChildByName(\"ring1\");\r\n\tgameState.nextRing.material.color.setHex( 0xffff00 );\r\n}", "title": "" }, { "docid": "814c82894e388d922fa53f1b3d1350ee", "score": "0.5548198", "text": "function _on_scene_loaded(url, nodes, protos, error) {\n var success = (error == '');\n _an_api.is_loaded = false;\n\n if(success) {\n \tvar e = _an_api.cortona.Engine;\n \te.ValidateNodes = 1;\n \te.AutoRefresh = 1;\n \tif (nodes.Count > 0) {\n \t\ttry {\n \t e.RootNodes.Clear();\n \te.RootNodes.Add(nodes);\n\t _an_api.control_script = e.Nodes.Item('VCR_CONTROL_SCRIPT');\n\t\t\tvar usedskin = _an_api.cortona.skin;\n\t\t\t_an_api.cortona.skin=\"{1706B265-E103-4332-9871-7FEE6C37C699}\"; //Default Skin\n\t\t\t_an_api.cortona.refresh();\n\t\t\t_an_api.cortona.skin=usedskin;\n\t _an_api.id_procedure = _an_api.get_procedure_id();\n\t\t\t_an_api.id_step = _an_api.get_step_id();\n\t\t\t_an_api.id_substep = _an_api.get_substep_id();\n\t\t\t_an_api.is_loaded = true;\n \t\t} catch(exception) {\n \t\t e.RootNodes.Clear();\n \t\t}\n \t\ttry {\n \t\t if(typeof(_an_api.ignore_viewpoint_changes) == 'undefined')\n \t\t _an_api.ignore_viewpoint_changes = false;\n \t\t\t_an_api.control_script.Fields.Item('set_ignore_viewpoints').Value = _an_api.ignore_viewpoint_changes;\n \t\t} catch(exception) {}\n \t}\n }\n if('on_simulation_load' in _an_api){\n\t\t_an_api.on_simulation_load(_an_api.is_loaded);\n\t\t_an_api._advise_events();\n\t}\n}", "title": "" } ]
a2db9c4a325a750f81699d7f4d35f569
datepicker script / hkid validation script
[ { "docid": "1918cbb7746832c2e2a3cc1bde5673b6", "score": "0.0", "text": "function IsHKID(str) {\n var strValidChars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n // basic check length\n if (str.length < 8)\n return false;\n\n // handling bracket\n if (str.charAt(str.length - 3) == '(' && str.charAt(str.length - 1) == ')')\n str = str.substring(0, str.length - 3) + str.charAt(str.length - 2);\n\n // convert to upper case\n str = str.toUpperCase();\n\n // regular expression to check pattern and split\n var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/;\n var matchArray = str.match(hkidPat);\n\n // not match, return false\n if (matchArray == null)\n return false;\n\n // the character part, numeric part and check digit part\n var charPart = matchArray[1];\n var numPart = matchArray[2];\n var checkDigit = matchArray[3];\n\n // calculate the checksum for character part\n var checkSum = 0;\n if (charPart.length == 2) {\n checkSum += 9 * (10 + strValidChars.indexOf(charPart.charAt(0)));\n checkSum += 8 * (10 + strValidChars.indexOf(charPart.charAt(1)));\n } else {\n checkSum += 9 * 36;\n checkSum += 8 * (10 + strValidChars.indexOf(charPart));\n }\n\n // calculate the checksum for numeric part\n for (var i = 0, j = 7; i < numPart.length; i++, j--)\n checkSum += j * numPart.charAt(i);\n\n // verify the check digit\n var remaining = checkSum % 11;\n var verify = remaining == 0 ? 0 : 11 - remaining;\n\n return verify == checkDigit || (verify == 10 && checkDigit == 'A');\n}", "title": "" } ]
[ { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.7025868", "text": "function Datepicker() {}", "title": "" }, { "docid": "d39e613ed2c7974e606f1dce7338e94a", "score": "0.6813377", "text": "function d(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=p(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "552438d45223803c2740758e3259f271", "score": "0.6799822", "text": "function validateDate1(vDateName)\r\n{\r\n// vDateName form Element\r\nvar mDay = vDateName.value.substr(0,2);\r\nvar mMonth = vDateName.value.substr(3,2);\r\nvar mYear = vDateName.value.substr(6,4)\r\n\r\nvar sd= new Date();\r\n \r\nvar mon=sd.getMonth()+1;\r\nvar dt=sd.getDate();\r\nvar yr=sd.getYear();\r\nif(mYear<yr | (mYear == yr && mMonth<=mon && mDay <dt))\r\n {\r\n\t//alert(\"Invalid Date\\nPlease Re-Enter\");\r\n\tvDateName.value = \"\";\r\n\tvDateName.focus();\r\n\treturn true;\r\n }\r\n}", "title": "" }, { "docid": "26dac6c0d0782b1cbf499ef963c4488d", "score": "0.6759455", "text": "function checkdate(input){\nvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ //Basic check for format validity\nvar returnval=false\nif (!validformat.test(input.value))\nalert(\"Invalid Date Format. Please correct and submit again.\")\nelse{ //Detailed check for valid date ranges\nvar dayfield=input.value.split(\"/\")[0]\nvar monthfield=input.value.split(\"/\")[1]\nvar yearfield=input.value.split(\"/\")[2]\nvar dayobj = new Date(yearfield, monthfield-1, dayfield)\nif ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))\nalert(\"Invalid Day, Month, or Year range detected. Please correct and submit again.\")\nelse\nreturnval=true\n}\nif (returnval==false) input.select()\nreturn returnval\n}", "title": "" }, { "docid": "6f41ca79e630913fe21fbcf52476752f", "score": "0.67329675", "text": "function checkForm() {\r\n\tvar d = document.getElementById(\"dd\").value;\r\n\tvar m = parseInt(document.getElementById(\"mm\").value) + 1; \t\r\n\tvar y = parseInt(document.getElementById(\"yyyy\").value) + 1900;\r\n\t\r\n\tvar errorField = document.getElementById(\"dateRequired\");\r\n\tif (!validate(d, m, y)) {\r\n\t\terrorField.innerText = \"No day selected\";\r\n\t\treturn false;\r\n\t}\r\n\terrorField.innerText = \"\";\r\n\treturn true;\r\n}", "title": "" }, { "docid": "7e4672ef666fbd637920010db47927d6", "score": "0.6726734", "text": "function checkForm02() {\r\n\tvar d = document.getElementById(\"dd\").value;\r\n\tvar m = parseInt(document.getElementById(\"mm\").value) + 1; \t\r\n\tvar y = parseInt(document.getElementById(\"yyyy\").value) + 1900;\r\n\t\r\n\tvar errorField = document.getElementById(\"dateRequired\");\r\n\tif (!validate(d, m, y)) {\r\n\t\terrorField.innerText = \"No dates selected\";\r\n\t\treturn false;\r\n\t}\r\n\terrorField.innerText = \"\";\r\n\treturn true;\r\n}", "title": "" }, { "docid": "65f51733532598fe5d0819c98cf92a13", "score": "0.6715585", "text": "function c(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=d(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "fe4eaae57bc8dc86a35421ea05cae37a", "score": "0.66955215", "text": "function handleDatePick() {\n \n}", "title": "" }, { "docid": "6f59cd1a4f6592530f6701abe5c9a8e7", "score": "0.6687401", "text": "function a(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=l(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "973eebbeb5f4100e537bbc75a985d434", "score": "0.66445726", "text": "function dateValidator() {\n\tvar selectedDate = document.getElementById('contractForm:valid').value;\n\n\tvar now = new Date();\n\tvar now_year = now.getFullYear();\n\tvar now_month = now.getMonth() + 1;\n\tvar now_day = now.getDate();\n\n\tvar daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];\n\tif ((!(now_year % 4) && now_year % 100) || !(now_year % 400)) {\n\t\tdaysInMonth[1] = 29;\n\t}\n\n\tvar temp = selectedDate.split('-');\n\tvar temp_year = temp[0];\n\tvar temp_month = temp[1];\n\tvar temp_day = temp[2];\n\n\tif (temp_day[0] == 0) {\n\t\ttemp_day = temp_day[1];\n\t}\n\n\tif (temp_month > 12 || temp_month == 00) {\n\t\t$.growl.error({\n\t\t\tmessage : \"The date is not valid\"\n\t\t});\n\t\tfail = true;\n\t\treturn;\n\t}\n\tif (temp_day > daysInMonth[now_month - 1] || temp_day == 00) {\n\t\t$.growl.error({\n\t\t\tmessage : \"The date is not valid\"\n\t\t});\n\t\tfail = true;\n\t\treturn;\n\t}\n\n\tif (temp_year < 1800) {\n\t\t$.growl.error({\n\t\t\tmessage : \"The year must be between 1800 and \" + now_year\n\t\t});\n\t\tfail = true;\n\t\treturn;\n\t}\n\n\tif (temp_year < now_year\n\t\t\t|| (temp_year == now_year && temp_month < now_month)\n\t\t\t|| (temp_year == now_year && temp_month == now_month && temp_day < now_day)) {\n\t\t$.growl.error({\n\t\t\tmessage : \"The date must be in the future\"\n\t\t});\n\t\tfail = true;\n\t\treturn;\n\t}\n\n}", "title": "" }, { "docid": "e87edb6bff98ac8f3b36d87db1ccd8ad", "score": "0.6615359", "text": "function checkBillForm() {\r\n\tvar d = document.getElementById(\"dd\").value;\r\n\tvar m = parseInt(document.getElementById(\"mm\").value) + 1; \t\r\n\tvar y = parseInt(document.getElementById(\"yyyy\").value) + 1900;\r\n\tvar hour = parseInt(document.getElementById(\"hour\").value);\r\n\tvar minute = parseInt(document.getElementById(\"minute\").value);\r\n\t\r\n\tvar dateErrorField = document.getElementById(\"dateRequired\");\r\n\tif (!validate(d, m, y)) {\r\n\t\tdateErrorField.innerText = \"No dates selected\";\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n \tdateErrorField.innerText = \"\";\r\n\t}\r\n\r\n\tvar timeErrorField = document.getElementById(\"timeRequired\");\r\n\tif (hour < 0 || minute < 0) {\r\n\t\ttimeErrorField.innerText = \"No dates selected\";\r\n\t\treturn false;\r\n\t} else {\r\n\t\ttimeErrorField.innerText = \"\";\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "e4815afd55001169b330cca08bf5b156", "score": "0.65729725", "text": "function validateDate(inputID , description)\r\n{\r\n\tif(!valDate($(\"#\"+inputID), description, true)) // true means the alert is hidden\r\n\t{\r\n\t\tif (this.valid) focusItem = $(\"#\"+inputID);\r\n\t\tthis.valid = false;\r\n\t\tif (description) {\r\n\t\t\tthis.errMsg += description + \"\\n\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.errMsg += inputID + \"\\n\";\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "e14668b2e8208eabe74618f33a117ac7", "score": "0.6496597", "text": "function datevalidation (dateElement,errorElement){\n var currentDate= new Date();\n let dueDate = new Date(dateElement.value);\n if (dueDate ==\"\"){\n dueDate.value = new Date().toISOString().slice(0,10);\n checkValidDate = true;\n \n }\n else if (dueDate < currentDate){\n errorElement.innerHTML = \"*Please choose a date from today\";\n errorElement.style.color = \"red\";\n dateElement.focus();\n checkValidDate = false; \n } \n else if (dueDate >= currentDate){\n errorElement.innerHTML= \" \"\n checkvalidDate=true; \n }\n }", "title": "" }, { "docid": "c8b56569dc9e5ba5845518eeb3961d95", "score": "0.6490242", "text": "function datevalidation() {\n var date = $('#dateid').val();\n\n\n if (date == \"\") {\n $('#dateerror').html(\"*Enter valid date\");\n $('#dateid').focus();\n $('#dateid').css(\"background-color\", \"#fff68f\");\n $('#dateerror').css(\"color\", \"#cd0000\");\n return false;\n } else {\n $('#dateid').css(\"background-color\", \"white\");\n $('#dateerror').css(\"display\", \"none\");\n return true;\n }\n}", "title": "" }, { "docid": "780c2db8b8dd1d49e0a007e61ed0bfbc", "score": "0.64876926", "text": "function d(){this._curInst=null,// The current instance in use\nthis._keyEvent=!1,// If the last event was a key event\nthis._disabledInputs=[],// List of date picker inputs that have been disabled\nthis._datepickerShowing=!1,// True if the popup picker is showing , false if not\nthis._inDialog=!1,// True if showing within a \"dialog\", false if not\nthis._mainDivId=\"ui-datepicker-div\",// The ID of the main datepicker division\nthis._inlineClass=\"ui-datepicker-inline\",// The name of the inline marker class\nthis._appendClass=\"ui-datepicker-append\",// The name of the append marker class\nthis._triggerClass=\"ui-datepicker-trigger\",// The name of the trigger marker class\nthis._dialogClass=\"ui-datepicker-dialog\",// The name of the dialog marker class\nthis._disableClass=\"ui-datepicker-disabled\",// The name of the disabled covering marker class\nthis._unselectableClass=\"ui-datepicker-unselectable\",// The name of the unselectable cell marker class\nthis._currentClass=\"ui-datepicker-current-day\",// The name of the current day marker class\nthis._dayOverClass=\"ui-datepicker-days-cell-over\",// The name of the day hover marker class\nthis.regional=[],// Available regional settings, indexed by language code\nthis.regional[\"\"]={// Default regional settings\ncloseText:\"Done\",// Display text for close link\nprevText:\"Prev\",// Display text for previous month link\nnextText:\"Next\",// Display text for next month link\ncurrentText:\"Today\",// Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],// Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],// For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],// For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],// For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],// Column headings for days starting at Sunday\nweekHeader:\"Wk\",// Column header for week of the year\ndateFormat:\"mm/dd/yy\",// See format options on parseDate\nfirstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:!1,// True if right-to-left language, false if left-to-right\nshowMonthAfterYear:!1,// True if the year select precedes month, false for month then year\nyearSuffix:\"\"},this._defaults={// Global defaults for all the date picker instances\nshowOn:\"focus\",// \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\",// Name of jQuery animation for popup\nshowOptions:{},// Options for enhanced animations\ndefaultDate:null,// Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\",// Display text following the input box, e.g. showing the format\nbuttonText:\"...\",// Text for trigger button\nbuttonImage:\"\",// URL for trigger button image\nbuttonImageOnly:!1,// True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:!1,// True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:!1,// True if date formatting applied to prev/today/next links\ngotoCurrent:!1,// True if today link goes back to current selection instead\nchangeMonth:!1,// True if month can be selected directly, false if only prev/next\nchangeYear:!1,// True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\",// Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:!1,// True to show dates in other months, false to leave blank\nselectOtherMonths:!1,// True to allow selection of dates in other months, false for unselectable\nshowWeek:!1,// True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week,// How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\",// Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null,// The earliest selectable date, or null for no limit\nmaxDate:null,// The latest selectable date, or null for no limit\nduration:\"fast\",// Duration of display/closure\nbeforeShowDay:null,// Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null,// Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null,// Define a callback function when a date is selected\nonChangeMonthYear:null,// Define a callback function when the month or year is changed\nonClose:null,// Define a callback function when the datepicker is closed\nnumberOfMonths:1,// Number of months to show at a time\nshowCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1,// Number of months to step back/forward\nstepBigMonths:12,// Number of months to step back/forward for the big links\naltField:\"\",// Selector for an alternate field to store selected dates into\naltFormat:\"\",// The date format to use for the alternate field\nconstrainInput:!0,// The input is constrained by the current date format\nshowButtonPanel:!1,// True to show button panel, false to not show it\nautoSize:!1,// True to size the input for the date format, false to leave as is\ndisabled:!1},a.extend(this._defaults,this.regional[\"\"]),this.regional.en=a.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=a.extend(!0,{},this.regional.en),this.dpDiv=e(a(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "a881a4e0bc0698b6d2beedb5031d0215", "score": "0.64815044", "text": "function checkdate(input){\n //var validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ //Basic check for format validity\n var validformat=/\\b\\d{1,2}[\\/-]\\d{1,2}[\\/-]\\d{4}\\b/;\n var returnval=false\n if (!validformat.test(input.value))\n alert(\"Invalid Date Format. Please correct and submit again in format MM/DD/YYYY..\")\n else{ //Detailed check for valid date ranges\n var monthfield=input.value.split(\"/\")[0]\n var dayfield=input.value.split(\"/\")[1]\n var yearfield=input.value.split(\"/\")[2]\n var dayobj = new Date(yearfield, monthfield-1, dayfield)\n if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))\n alert(\"Invalid Day, Month, or Year range detected. Please correct and submit again in format MM/DD/YYYY.\")\n else\n returnval=true\n }\n if (returnval==false) input.select()\n return returnval\n }", "title": "" }, { "docid": "47790d92f58ba68563d15143e4fb0268", "score": "0.6469162", "text": "function checkSDate()\r\n{\r\n\tvar dateEntered1=$('#Sdate').val();\r\n if(CheckDateFormat(dateEntered1))\r\n {\r\n $('#sdate_error').hide();\r\n\t $('#sdate_error').html(\" \");\r\n\t SdateFlag=0;\r\n }\r\n else\r\n {\r\n $('#sdate_error').show();\r\n $('#sdate_error').html(\"Required Format:YYYY-MM-DD \");\r\n SdateFlag=1;\r\n }\r\n\r\n}", "title": "" }, { "docid": "73f9e8dd825bb7cbd3a0b372dd313745", "score": "0.64382994", "text": "function valida_envia() {\n\t\t\t\n\t\n\n\t//radios dificultad\n\tvar opciones = document.getElementsByName(\"dificultad\");\n\tvar seleccionado = false;\n\tfor(var i=0; i<opciones.length; i++) {\t\n\t if(opciones[i].checked) {\n\t seleccionado = true;\n\t ocultaEtiqueta('adv_radio');\n\t break;\n\t }\n\t}\n \n\tif(!seleccionado) {\n\t muestraEtiqueta('adv_radio');\n\t}\n\n\n\t//select categoria\n\tif (document.getElementById(\"e1\").selectedIndex == 0 ) { \n\t\tmuestraEtiqueta(\"adv_categoria\");\n\t} \n\telse\n\t ocultaEtiqueta(\"adv_categoria\");\n\n\n\n\n\t//CALENDARIOS\n\n\t\n\t// fecha de inicio\n\tif ($(\"#datepicker\").datepicker(\"getDate\") == null) {\n\t\tmuestraEtiqueta('adv_fechaInicio');\n\t} else {\n\t\tocultaEtiqueta('adv_fechaInicio');\n\t\tvar fechaArr = $(\"#datepicker\").val().split('-');\n\t\tvar dia = fechaArr[0];\n\t\tvar mes = fechaArr[1] - 1;//mes = 0 -->enero\n\t\tvar anio = fechaArr[2];\n\t\tvar fecha = new Date();\n\t\tfecha.setFullYear(anio, mes, dia);\n\t\tvar fechaActual = new Date();\n\n\t\tvar milisegFecha1 = fecha.getTime();\n\t\tvar milisegFecha2 = fechaActual.getTime();\n\t\tvar difMiliseg = milisegFecha1 - milisegFecha2;\n\t\tvar numero_dias = (((difMiliseg / 1000) / 60) / 60) / 24;\n\t\t\n\t\t//si numero_dias < 0 --> se selecciono una fecha anterior como inicio\n\t\t//si numero_dias = 0 --> se selecciono la fecha actual como inicio\n\t\t//si numero_dias > 0 --> se selecciono una fecha posterior como inicio\t\n\t\tconsole.log(numero_dias);\n\t\t if (numero_dias>0) {\n\t\t\tocultaEtiqueta(\"adv_fechaInicioMal\");\n\t\t} else {\n\t\t\tmuestraEtiqueta(\"adv_fechaInicioMal\");\n\t\t}\n\t}\t\n\n\n\t// fecha de fin \t\n\tif ($(\"#datepicker2\").datepicker(\"getDate\") == null) {\n\t\tmuestraEtiqueta('adv_fechaFin');\n\n\t} else {\n\t\t\n\t\tocultaEtiqueta('adv_fechaFin');\n\t\t\n\t\tvar fechaArr = $(\"#datepicker2\").val().split('-');\n\t\tvar dia = fechaArr[0];\n\t\tvar mes = fechaArr[1]-1;//mes = 0 -->enero\n\t\tvar anio = fechaArr[2];\n\t\tvar fecha = new Date();\n\t\tfecha.setFullYear(anio, mes, dia);\n\t\tvar fechaActual = new Date();\n\n\t\tvar milisegFecha1 = fecha.getTime();\n\t\tvar milisegFecha2 = fechaActual.getTime();\n\t\tvar difMiliseg = milisegFecha1 - milisegFecha2;\n\t\tvar numero_dias = (((difMiliseg / 1000) / 60) / 60) / 24;\n\t\t\n\t\t//si numero_dias < 0 --> se selecciono una fecha anterior como fin\n\t\t//si numero_dias = 0 --> se selecciono la fecha actual como fin\n\t\t//si numero_dias > 0 --> se selecciono una fecha posterior como fin\t\n\t\tconsole.log(numero_dias);\n\t\t if (numero_dias>0) {\n\t\t\tocultaEtiqueta(\"adv_fechaFinMal\");\n\t\t} else {\n\t\t\tmuestraEtiqueta(\"adv_fechaFinMal\");\n\t\t}\n\t}\n\n\n\t\ndocument.listarConcursos.submit(); \n}", "title": "" }, { "docid": "4fbda6336f9f4a12a365ed2bdc375fe4", "score": "0.64231354", "text": "function createDatePicker(controlId, options, disabled) {\n var fieldId = jQuery(\"#\" + controlId).closest(\"div[data-role='InputField']\").attr(\"id\");\n jQuery(function () {\n var datePickerControl = jQuery(\"#\" + controlId);\n datePickerControl.datepicker(options);\n datePickerControl.datepicker('option', 'onClose',\n function () {\n getValidationData(jQuery(\"#\" + fieldId)).messagingEnabled = true;\n jQuery(this).trigger(\"focusout\");\n jQuery(this).trigger(\"focus\");\n });\n datePickerControl.datepicker('option', 'beforeShow',\n function () {\n getValidationData(jQuery(\"#\" + fieldId)).messagingEnabled = false;\n });\n\n //KULRICE-7310 can't change only month or year with picker (jquery limitation)\n datePickerControl.datepicker('option', 'onChangeMonthYear',\n function (y, m, i) {\n var d = i.selectedDay;\n jQuery(this).datepicker('setDate', new Date(y, m - 1, d));\n });\n\n //KULRICE-7261 fix date format passed back. jquery expecting mm-dd-yy\n if (options.dateFormat == \"mm-dd-yy\" && datePickerControl[0].getAttribute(\"value\").indexOf(\"/\") != -1) {\n datePickerControl.datepicker('setDate', new Date(datePickerControl[0].getAttribute(\"value\")));\n }\n if (disabled === true) {\n datePickerControl.datepicker('disable');\n datePickerControl.next(\"div\").css({\"cursor\":\"not-allowed\"}).children(\".ui-datepicker-trigger\")\n .addClass(kradVariables.DISABLED_CLASS).css({\"backgroundColor\":\"#eee\"});\n }\n });\n\n // in order to compensate for jQuery's \"Today\" functionality (which does not actually return the date to the input box), alter the functionality\n jQuery.datepicker._gotoToday = function (id) {\n var target = jQuery(id);\n var inst = this._getInst(target[0]);\n if (this._get(inst, 'gotoCurrent') && inst.currentDay) {\n inst.selectedDay = inst.currentDay;\n inst.drawMonth = inst.selectedMonth = inst.currentMonth;\n inst.drawYear = inst.selectedYear = inst.currentYear;\n }\n else {\n var date = new Date();\n inst.selectedDay = date.getDate();\n inst.drawMonth = inst.selectedMonth = date.getMonth();\n inst.drawYear = inst.selectedYear = date.getFullYear();\n }\n this._notifyChange(inst);\n this._adjustDate(target);\n\n // The following two lines are additions to the original jQuery code\n this._setDateDatepicker(target, new Date());\n this._selectDate(id, this._getDateDatepicker(target));\n }\n}", "title": "" }, { "docid": "f3b710057ac1fcf7b1f248a3fb7245d0", "score": "0.6415382", "text": "onPickDate() {\n if (this.$node.attr('data-form-submit') && this.$node.val()) {\n jQ(this.$node.attr('data-form-submit')).submit();\n }\n }", "title": "" }, { "docid": "2c35fa02cbd8ff8cc27d89160c2646f2", "score": "0.64056915", "text": "function validate_datepicker($t,shakeEnable) {\n var required = $t.hasClass('creativecontactform_required') ? true : false;\n var value = $.trim( $t.val() );\n if((!required && value == '') || value.length > 0)\n $t.parents('.creativecontactform_field_box').removeClass('creativecontactform_error');\n else {\n $t.parents('.creativecontactform_field_box').addClass('creativecontactform_error');\n if(shakeEnable) {\n var form_id = $t.parents('.creativecontactform_wrapper').find(\".creativecontactform_send\").attr(\"roll\");\n var creativecontactform_shake_count = creativecontactform_shake_count_array[form_id];\n var creativecontactform_shake_distanse = creativecontactform_shake_distanse_array[form_id];\n var creativecontactform_shake_duration = creativecontactform_shake_duration_array[form_id];\n $t.parents('.creativecontactform_input_element').shake({'shakes': creativecontactform_shake_count,'distance': creativecontactform_shake_distanse,'duration':creativecontactform_shake_duration});\n }\n }\n\n create_validation_effects($t.parents('.creativecontactform_wrapper'));\n }", "title": "" }, { "docid": "aa84d64833fb3d985445afb70648a97c", "score": "0.6402929", "text": "function eventDatePickerInputChange()\n{\n\tvar oldValue = dhtml.getElementById(\"text_birthday\").value.trim();\n\t/**\n\t * Split date string in to sub parts to get value\n\t * German language ->\t\tdd.mm.yyyy\n\t * English US language ->\tdd/mm/yyyy\n\t * Other languages ->\t\tdd-mm-yyyy\n\t */\n\tvar valueArr = oldValue.split(/[-.//]/);\n\n\tif(valueArr.length > 0 && valueArr[0] != \"\"){\t\n\t\tvar result = checkDateValidation(valueArr[0], valueArr[1], valueArr[2]);\n\t\tif(result){\n\t\t\tdhtml.getElementById(\"text_birthday\").value = oldValue;\n\t\t}else{\n\t\t\talert(_(\"You must specify a valid date\"));\n\t\t\tdhtml.getElementById(\"text_birthday\").value = '';\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9c83d9514816eb0f0292454c48e64c1e", "score": "0.63963395", "text": "function ValidateDate(obj)\n{\n\tStoreDateRoutines();\t\n\tvar dteParams = dateIsValid(obj.value);\n\tvar dte = dteParams[0];\n\tvar errMsg = dteParams[1];\n\t\n\tif (!NonSpace(dte) || (dte == false))\n\t{\t\t\n\t\tif (!errMsg)\n\t\t\terrMsg = getSeaPhrase(\"CAL_1\",\"ESS\");\n\t\tvar focusFnc = function(){try{obj.focus();obj.select()}catch(e){}};\n\t\tsetRequiredField(obj, errMsg, focusFnc);\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tobj.value = dte;\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "777a2310821af093789598de01154347", "score": "0.6392108", "text": "function datepicker_call(){\n\t/************ datepicker ************/\n\tvar date_input=$('.date-picker'); //our date input has the name \"date\"\n\tvar container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : \"body\";\n\tdate_input.datepicker({\n\t\tformat: 'mm/dd/yyyy',\n\t\tcontainer: container,\n\t\ttodayHighlight: true,\n\t\tautoclose: true,\n\t\torientation: \"auto\",\n\t});\n}", "title": "" }, { "docid": "97b34441989ed85f9fd5f40dc0732b99", "score": "0.6377669", "text": "function check_birthdate()\r\n\t{\r\n\t\tbirth_date = $(\"#birth_date\").val();\r\n\t\tif (birth_date === '')\r\n\t\t{\r\n\t\t\t$(\"#birth_date_Error\").html(\"Enter valid date of birth.\");\r\n\t\t\t$(\"#birth_date_Error\").show();\r\n\t\t\terror_count = 0;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$(\"#birth_date_Error\").hide();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3bfef48d12330f171e9cf86a4add8354", "score": "0.63753426", "text": "function chkDate(obj) {\n\tvar input = obj.value.replace(/-/g,\"\");\n\tvar inputYear = input.substr(0,4);\n\tvar inputMonth = input.substr(4,2) - 1;\n\tvar inputDate = input.substr(6,2);\n\tvar resultDate = new Date(inputYear, inputMonth, inputDate);\n\tif ( resultDate.getFullYear() != inputYear ||\n\t resultDate.getMonth() != inputMonth ||\n\t resultDate.getDate() != inputDate) {\n\tobj.value = \"\";\n\t} else {\n\tobj.value = inputYear + \"-\" + input.substr(4,2) + \"-\" + inputDate;\n\t}\n}", "title": "" }, { "docid": "eb7f63b1d72ad46cbb2104b25f476966", "score": "0.6366634", "text": "function validDate() {\n}", "title": "" }, { "docid": "71823ac369e21f29a103b5007722a41a", "score": "0.6356751", "text": "function validationAndConvertionDateInput(tempObj, fieldID, dateArrayObj , sRequired, bShow, bReplaced)\n{\n\tvar bRequired = false;\n\t//sRquired is initially a string value??? make it as boolean\n\tif(sRequired == \"true\")\n\t\tbRequired = true;\n\telse\n\t\tbRequired = false;\n\t//user's date input value\n\tvar value = tempObj.value;\n\t//trim() is defined in common.js\n\tvalue = trim(value);\n\tvar temp_curDate = new Date();\n\tvar year\t=\t\"\";\n\tvar month\t=\t\"\";\n\tvar day\t\t=\t\"\";\n\tvar tempArrDate = new Array();\n\t\n //dateArrayObj is defined for handling form's loading since XML\n //will use neutral formats for edit-forms??\n if(dateArrayObj != null){\n //there is already known date's year, month, and day\n //year\n year = dateArrayObj[0];\n //month\n month = dateArrayObj[1];\n //day\n day = dateArrayObj[2];\n }else if (value != null && value!= \"\"){\n if(isBeingISODateFormat(value)){\n tempArrDate[\"year\"] = value.split(\"-\")[0];\n tempArrDate[\"month\"]= value.split(\"-\")[1];;\n tempArrDate[\"day\"] = value.split(\"-\")[2];;\n }else\n tempArrDate = gettingYearMonthDayFromDate(value);\n //if(tempArrDate != null)\n {\n year = tempArrDate[\"year\"];\n month = tempArrDate[\"month\"];\n day = tempArrDate[\"day\"];\n }\n }\n \n //replacing input's date by new date in its localized short format\n //type new date or existing date from record or required \n if((bReplaced && value != null && value != \"\" || bReplaced && dateArrayObj!=null && dateArrayObj.length > 1) || bRequired ){\n\t\t\n\t\tif(year==\"\")\n\t\t\tyear = temp_curDate.getFullYear();\n\t\tif(month==\"\")\n\t\t\tmonth = temp_curDate.getMonth()+ 1;\n\t\tif(day==\"\")\n\t\t\tday\t = temp_curDate.getDate();\n\t\t//alert(day+\"//\"+month+\"//\"+year);\n\t\t//alert(strDateShortPattern);\n\t\ttempObj.value = FormattingDate(day, month, year, strDateShortPattern);\n\t\t\n\t\t// SK: need to set the value so that it's displayed in the date hint below\n\t\tvalue = tempObj.value;\n\t\t\n\t\t//readOnly Date fields???? fixed ID format\n\t\tvar showDateShortFormatID = \"Show\" + fieldID + \"_short\";\n\t\tvar temp_obj_date_short = document.getElementById(showDateShortFormatID);\n\t\tif(temp_obj_date_short!=null){\n\t\t\ttemp_obj_date_short.innerHTML = FormattingDate(day, month, year, strDateShortPattern);\n\t\t}\n\t\tvar showDateLongFormatID = \"Show\" + fieldID + \"_long\";\n\t\tvar temp_obj_date_long = document.getElementById(showDateLongFormatID);\n\t\tif(temp_obj_date_long!=null){\n\t\t\ttemp_obj_date_long.innerHTML = FormattingDate(day, month, year, strDateLongPattern);\n\t\t}\n\t}\n\t\n\t//showing the date hint in its long date format if bowser is IE5- and netscape6-\n\tif(bShow){\n\t\tvar strShowingDate;\n\t\t//strShowingDate will be used to show user's validated date input in\n\t\t//date long format (whithout dddd in this application like \"March\n\t\t//22, 2002\")\n\t\t//strDateLongPattern,strDateShortPattern are defined in\n\t\t//locale.js \n\t\tif(bRequired || (value != null && value!= \"\") ){\n\t\t\tif(year==\"\")\n\t\t\t\tyear = temp_curDate.getFullYear();\n\t\t\tif(month==\"\")\n\t\t\t\tmonth = temp_curDate.getMonth()+ 1;\n\t\t\tif(day==\"\")\n\t\t\t\tday\t = temp_curDate.getDate();\n\t\t\tstrShowingDate = FormattingDate(day, month, year, strDateLongPattern);\n\t\t}else{\n\t\t\t// kb# 3016317\n\t\t\t// do not show date pattern for read only fields\n\t\t\tif(arrFieldsInformation[fieldID] != null && arrFieldsInformation[fieldID][\"readOnly\"] == \"true\"){\n\t\t\t\t//showing the short-date format, so users can type date in\n\t\t\t\tstrShowingDate = \"\";\n\t\t\t} else {\n\t\t\t\tstrShowingDate = strDateShortPattern;\n\t\t\t}\n\t\t}\n\t\t//\"Show\" is fixed prefix for hint field ID which is defined in\n\t\t//edit-form-data.xsl\n\t\n\t\tvar showLongFieldID = \"Show\" + fieldID + \"_long\";\n\t\tvar showLongDateFieldObj = null;\n\t\tif(document.all){\n\t\t\tshowLongDateFieldObj = document.all[showLongFieldID];\n\t\t}else if(!document.all && document.getElementById){\n\t\t\tshowLongDateFieldObj = document.getElementById(showLongFieldID);\n\t\t}\n\t\tif(showLongDateFieldObj != null)\n\t\t\tshowLongDateFieldObj.innerHTML = strShowingDate;\n\n\t}\n}", "title": "" }, { "docid": "8a9e49f02878942ef482e1301891d28c", "score": "0.6356301", "text": "function e(){this._curInst=null,// The current instance in use\nthis._keyEvent=!1,// If the last event was a key event\nthis._disabledInputs=[],// List of date picker inputs that have been disabled\nthis._datepickerShowing=!1,// True if the popup picker is showing , false if not\nthis._inDialog=!1,// True if showing within a \"dialog\", false if not\nthis._mainDivId=\"ui-datepicker-div\",// The ID of the main datepicker division\nthis._inlineClass=\"ui-datepicker-inline\",// The name of the inline marker class\nthis._appendClass=\"ui-datepicker-append\",// The name of the append marker class\nthis._triggerClass=\"ui-datepicker-trigger\",// The name of the trigger marker class\nthis._dialogClass=\"ui-datepicker-dialog\",// The name of the dialog marker class\nthis._disableClass=\"ui-datepicker-disabled\",// The name of the disabled covering marker class\nthis._unselectableClass=\"ui-datepicker-unselectable\",// The name of the unselectable cell marker class\nthis._currentClass=\"ui-datepicker-current-day\",// The name of the current day marker class\nthis._dayOverClass=\"ui-datepicker-days-cell-over\",// The name of the day hover marker class\nthis.regional=[],// Available regional settings, indexed by language code\nthis.regional[\"\"]={// Default regional settings\ncloseText:\"Done\",// Display text for close link\nprevText:\"Prev\",// Display text for previous month link\nnextText:\"Next\",// Display text for next month link\ncurrentText:\"Today\",// Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],// Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],// For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],// For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],// For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],// Column headings for days starting at Sunday\nweekHeader:\"Wk\",// Column header for week of the year\ndateFormat:\"mm/dd/yy\",// See format options on parseDate\nfirstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:!1,// True if right-to-left language, false if left-to-right\nshowMonthAfterYear:!1,// True if the year select precedes month, false for month then year\nyearSuffix:\"\"},this._defaults={// Global defaults for all the date picker instances\nshowOn:\"focus\",// \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\",// Name of jQuery animation for popup\nshowOptions:{},// Options for enhanced animations\ndefaultDate:null,// Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\",// Display text following the input box, e.g. showing the format\nbuttonText:\"...\",// Text for trigger button\nbuttonImage:\"\",// URL for trigger button image\nbuttonImageOnly:!1,// True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:!1,// True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:!1,// True if date formatting applied to prev/today/next links\ngotoCurrent:!1,// True if today link goes back to current selection instead\nchangeMonth:!1,// True if month can be selected directly, false if only prev/next\nchangeYear:!1,// True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\",// Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:!1,// True to show dates in other months, false to leave blank\nselectOtherMonths:!1,// True to allow selection of dates in other months, false for unselectable\nshowWeek:!1,// True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week,// How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\",// Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null,// The earliest selectable date, or null for no limit\nmaxDate:null,// The latest selectable date, or null for no limit\nduration:\"fast\",// Duration of display/closure\nbeforeShowDay:null,// Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null,// Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null,// Define a callback function when a date is selected\nonChangeMonthYear:null,// Define a callback function when the month or year is changed\nonClose:null,// Define a callback function when the datepicker is closed\nnumberOfMonths:1,// Number of months to show at a time\nshowCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1,// Number of months to step back/forward\nstepBigMonths:12,// Number of months to step back/forward for the big links\naltField:\"\",// Selector for an alternate field to store selected dates into\naltFormat:\"\",// The date format to use for the alternate field\nconstrainInput:!0,// The input is constrained by the current date format\nshowButtonPanel:!1,// True to show button panel, false to not show it\nautoSize:!1,// True to size the input for the date format, false to leave as is\ndisabled:!1},a.extend(this._defaults,this.regional[\"\"]),this.regional.en=a.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=a.extend(!0,{},this.regional.en),this.dpDiv=f(a(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "2bd134362ad1cb85e92748992f35ea38", "score": "0.6355516", "text": "function validateDate(form) {\r\n var bValid = true;\r\n var focusField = null;\r\n var i = 0;\r\n var fields = new Array();\r\n \r\n var oDate = eval('new ' + jcv_retrieveFormName(form) + '_DateValidations()');\r\n\r\n for (var x in oDate) {\r\n if (!jcv_verifyArrayElement(x, oDate[x])) {\r\n continue;\r\n }\r\n var field = form[oDate[x][0]];\r\n if (!jcv_isFieldPresent(field)) {\r\n continue;\r\n }\r\n var value = field.value;\r\n var isStrict = true;\r\n var datePattern = oDate[x][2](\"datePatternStrict\");\r\n // try loose pattern\r\n if (datePattern == null) {\r\n datePattern = oDate[x][2](\"datePattern\");\r\n isStrict = false;\r\n } \r\n if ((field.type == 'hidden' ||\r\n field.type == 'text' ||\r\n field.type == 'textarea') &&\r\n (value.length > 0) && (datePattern.length > 0)) {\r\n var MONTH = \"MM\";\r\n var DAY = \"dd\";\r\n var YEAR = \"yyyy\";\r\n var orderMonth = datePattern.indexOf(MONTH);\r\n var orderDay = datePattern.indexOf(DAY);\r\n var orderYear = datePattern.indexOf(YEAR);\r\n if ((orderDay < orderYear && orderDay > orderMonth)) {\r\n var iDelim1 = orderMonth + MONTH.length;\r\n var iDelim2 = orderDay + DAY.length;\r\n var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);\r\n var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);\r\n if (iDelim1 == orderDay && iDelim2 == orderYear) {\r\n dateRegexp = isStrict \r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})(\\\\d{4})$\") \r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})(\\\\d{4})$\");\r\n } else if (iDelim1 == orderDay) {\r\n dateRegexp = isStrict \r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n } else if (iDelim2 == orderYear) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})(\\\\d{4})$\");\r\n } else {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n }\r\n var matched = dateRegexp.exec(value);\r\n if(matched != null) {\r\n if (!jcv_isValidDate(matched[2], matched[1], matched[3])) {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n } else {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n } else if ((orderMonth < orderYear && orderMonth > orderDay)) {\r\n var iDelim1 = orderDay + DAY.length;\r\n var iDelim2 = orderMonth + MONTH.length;\r\n var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);\r\n var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);\r\n if (iDelim1 == orderMonth && iDelim2 == orderYear) {\r\n dateRegexp = isStrict \r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})(\\\\d{4})$\");\r\n } else if (iDelim1 == orderMonth) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n } else if (iDelim2 == orderYear) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})(\\\\d{4})$\");\r\n } else {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n }\r\n var matched = dateRegexp.exec(value);\r\n if(matched != null) {\r\n if (!jcv_isValidDate(matched[1], matched[2], matched[3])) {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n } else {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n } else if ((orderMonth > orderYear && orderMonth < orderDay)) {\r\n var iDelim1 = orderYear + YEAR.length;\r\n var iDelim2 = orderMonth + MONTH.length;\r\n var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);\r\n var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);\r\n if (iDelim1 == orderMonth && iDelim2 == orderDay) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})(\\\\d{2})(\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})(\\\\d{1,2})(\\\\d{1,2})$\");\r\n } else if (iDelim1 == orderMonth) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})(\\\\d{2})[\" + delim2 + \"](\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})(\\\\d{1,2})[\" + delim2 + \"](\\\\d{1,2})$\");\r\n } else if (iDelim2 == orderDay) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{2})(\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{1,2})(\\\\d{1,2})$\");\r\n } else {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{2})[\" + delim2 + \"](\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{1,2})[\" + delim2 + \"](\\\\d{1,2})$\");\r\n }\r\n var matched = dateRegexp.exec(value);\r\n if(matched != null) {\r\n if (!jcv_isValidDate(matched[3], matched[2], matched[1])) {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n } else {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n } else {\r\n if (i == 0) {\r\n focusField = field;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n }\r\n }\r\n if (fields.length > 0) {\r\n jcv_handleErrors(fields, focusField);\r\n }\r\n return bValid;\r\n }", "title": "" }, { "docid": "7e7f8c2c42918f1075fbc2f8329fc735", "score": "0.63538843", "text": "function dateValid(objName) {\r\n var strDate;\r\n var strDateArray;\r\n var strDay;\r\n var strMonth;\r\n var strYear;\r\n var intday;\r\n var intMonth;\r\n var intYear;\r\n var booFound = false;\r\n var datefield = objName;\r\n var strSeparatorArray = new Array(\"-\",\" \",\"/\",\".\");\r\n var intElementNr;\r\n // var err = 0;\r\n var strMonthArray = new Array(12);\r\n strMonthArray[0] = \"Jan\";\r\n strMonthArray[1] = \"Feb\";\r\n strMonthArray[2] = \"Mar\";\r\n strMonthArray[3] = \"Apr\";\r\n strMonthArray[4] = \"May\";\r\n strMonthArray[5] = \"Jun\";\r\n strMonthArray[6] = \"Jul\";\r\n strMonthArray[7] = \"Aug\";\r\n strMonthArray[8] = \"Sep\";\r\n strMonthArray[9] = \"Oct\";\r\n strMonthArray[10] = \"Nov\";\r\n strMonthArray[11] = \"Dec\";\r\n \r\n //strDate = datefield.value;\r\n strDate = objName;\r\n \r\n if (strDate.length < 1) {\r\n return true;\r\n }\r\n for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {\r\n if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) \r\n {\r\n strDateArray = strDate.split(strSeparatorArray[intElementNr]);\r\n if (strDateArray.length != 3) \r\n {\r\n err = 1;\r\n return false;\r\n }\r\n else \r\n {\r\n strDay = strDateArray[0];\r\n strMonth = strDateArray[1];\r\n strYear = strDateArray[2];\r\n }\r\n booFound = true;\r\n }\r\n }\r\n if (booFound == false) {\r\n if (strDate.length>5) {\r\n strDay = strDate.substr(0, 2);\r\n strMonth = strDate.substr(2, 2);\r\n strYear = strDate.substr(4);\r\n }\r\n }\r\n //Adjustment for short years entered\r\n if (strYear.length == 2) {\r\n strYear = '20' + strYear;\r\n }\r\n strTemp = strDay;\r\n strDay = strMonth;\r\n strMonth = strTemp;\r\n intday = parseInt(strDay, 10);\r\n if (isNaN(intday)) {\r\n err = 2;\r\n return false;\r\n }\r\n \r\n intMonth = parseInt(strMonth, 10);\r\n if (isNaN(intMonth)) {\r\n for (i = 0;i<12;i++) {\r\n if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {\r\n intMonth = i+1;\r\n strMonth = strMonthArray[i];\r\n i = 12;\r\n }\r\n }\r\n if (isNaN(intMonth)) {\r\n err = 3;\r\n return false;\r\n }\r\n }\r\n intYear = parseInt(strYear, 10);\r\n if (isNaN(intYear)) {\r\n err = 4;\r\n return false;\r\n }\r\n if (intMonth>12 || intMonth<1) {\r\n err = 5;\r\n return false;\r\n }\r\n if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {\r\n err = 6;\r\n return false;\r\n }\r\n if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {\r\n err = 7;\r\n return false;\r\n }\r\n if (intMonth == 2) {\r\n if (intday < 1) {\r\n err = 8;\r\n return false;\r\n }\r\n if (LeapYear(intYear) == true) {\r\n if (intday > 29) {\r\n err = 9;\r\n return false;\r\n }\r\n }\r\n else {\r\n if (intday > 28) {\r\n err = 10;\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "ed2e1f6e4ef784d5f8b01fb88a47a000", "score": "0.63441056", "text": "function ctrl_datepicker(){$(\".datepicker\").datepicker(),$(\".datetimepicker\").datetimepicker({separator:\" - \"})}", "title": "" }, { "docid": "3afdca6122aaf1180e0f07ded7918280", "score": "0.63438374", "text": "function checkDate (yearField, monthField, dayField, labelString, OKtoOmitDay)\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\n // in equality comparison below.\n if (checkDate.arguments.length == 4) OKtoOmitDay = false;\n if (!isYear(yearField.value)) return warnInvalid (yearField, iYear);\n if (!isMonth(monthField.value)) return warnInvalid (monthField, iMonth);\n if ( (OKtoOmitDay == true) && isEmpty(dayField.value) ) return true;\n else if (!isDay(dayField.value)) \n return warnInvalid (dayField, iDay);\n if (isDate (yearField.value, monthField.value, dayField.value))\n return true;\n alert (iDatePrefix + labelString + iDateSuffix)\n return false\n}", "title": "" }, { "docid": "d642742f6fffe225f8374139b29c36cb", "score": "0.6342052", "text": "function validDate() {\n\t// Get values from form\n\tvar when_year = document.getElementById('when_year').value;\n\tvar when_month = document.getElementById('when_month').value;\n\tvar when_day = document.getElementById('when_day').value;\n\t// Create a date object using the input values - JS indices for months start at 0!\n\tvar check = new Date();\n\tcheck.setFullYear(when_year, (when_month-1), when_day);\n\t// Check if the month that was entered (1..12) and the generated one (0..11) are the same\n\t// If not, date was not valid (like Feb 31)\n\treturn ( ((check.getMonth()+1) == when_month) && (check.getDate() == when_day) );\n}", "title": "" }, { "docid": "3b988d74f7a438d13d48f91f25291a75", "score": "0.6326358", "text": "function testDate() {\n\tvar d = document.getElementById('birth').value;\n\tconsole.log (\"Dat of Birth:\" + d);\n\tif (d != \"\") {\n\t\tdocument.getElementById('bir-validate').innerHTML = \"\";\n\t\treturn true;\n\t}\n\tdocument.getElementById('bir-validate').innerHTML = \"Invalid Day of Birth\";\n\treturn false;\n}", "title": "" }, { "docid": "26512407cf87477b146565277998d919", "score": "0.6310884", "text": "function initDateFields() {\n $.datepicker.setDefaults({\n dateFormat: 'dd-mm-yy',\n dayNamesMin: ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'],\n firstDay: 1,\n showAnim: 'fadeIn'\n });\n\n $('#startDate').datepicker();\n $('#endDate').datepicker();\n }", "title": "" }, { "docid": "5fd71a369a27a8d5d72e4de2fe859501", "score": "0.6310682", "text": "function RedDot_dateEdit(date1, dtval) {\n debugger\n if ($(dtval).val() != '') {\n var now = new Date($(dtval).val());\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n var today = (day) + \"/\" + (month) + \"/\" + now.getFullYear();\n $(date1).val(today);\n } else {\n $(date1).val('');\n }\n \n \n}", "title": "" }, { "docid": "54434112c3e1f1435d09575cb6437d2b", "score": "0.630967", "text": "function validateDate(date) {\r\n\r\n \tif((date.value==\"\")||(date.value == date.defaultValue)) return true;\r\n\r\n\tif(!isDate(date.value)){\r\n\t alert(\"Invalid Date\\nFormat : mm/dd/yyyy\");\r\n\t date.select();\r\n\t date.focus();\r\n\t return false;\r\n\t} else {\r\n\r\n\t var f1 = date.value.indexOf(\"/\");\r\n \t var f2 = date.value.indexOf(\"/\", f1+1);\r\n\r\n\t var mon = date.value.substring(0, f1);\r\n\t var day = date.value.substring(f1+1, f2);\r\n\t var year = date.value.substring(f2+1, date.value.length);\r\n\r\n\t if(parseFloat(year) < 1000 )\tyear = 2000 + parseFloat(year);\r\n\r\n\t \tif ((parseFloat(day) < 10 )&&(day.length == 1)) day = '0'+day;\r\n\t \tif ((parseFloat(mon) < 10 )&&(mon.length == 1)) mon = '0'+mon;\r\n\t \tdate.value = mon + \"/\" + day + \"/\" + year;\r\n\r\n\t \treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "d4e9385e9ce8413f43e5d27ccf463347", "score": "0.630623", "text": "function validDate(date){\n var today = new Date();\n var day = today.getDate();\n var mon = today.getMonth()+1;\n var year = today.getFullYear();\n if(day<10){\n day=\"0\"+day;\n } \n if(mon<10){\n mon=\"0\"+mon;\n } \n today = year+\"-\"+mon+\"-\"+day;\n if( $(date).val() > today){\n $(date).css(\"border\",\"1px solid #ff0000\");\n $(\"#dobError\").text(\"can't be future date!!\").addClass(\"errorMessage\");\n } \n else{\n $(date).css(\"border\",\"1px solid rgb(11, 243, 116)\");\n $(\"#dobError\").text(\"\").removeClass(\"errorMessage\");\n }\n \n}", "title": "" }, { "docid": "459daeab0620c33d9535476bdf8c6c3e", "score": "0.63045186", "text": "function formValidations()\n{\n\t\n\t//var selDEListSize = document.ChartGenerationForm.selectedDataElements.options.length;\n\tvar orgUnitListCB = document.getElementById(\"orgUnitListCB\");\n\tvar orgUnitLevelCB = document.getElementById(\"orgUnitLevelCB\");\n var ouSelCB = document.getElementById(\"ouSelCB\");\n //sDateIndex = document.ChartGenerationForm.sDateLB.selectedIndex;\n //eDateIndex = document.ChartGenerationForm.eDateLB.selectedIndex;\n \n \n\tvar startPeriodObj = document.getElementById('sDateLB');\n\tvar endPeriodObj = document.getElementById('eDateLB');\n\n\tsDateTxt = startPeriodObj.options[startPeriodObj.selectedIndex].text;\n sDate = formatDate(new Date(getDateFromFormat(sDateTxt,\"MMM-y\")),\"yyyy-MM-dd\");\n eDateTxt = endPeriodObj.options[endPeriodObj.selectedIndex].text;\n eDate = formatDate(new Date(getDateFromFormat(eDateTxt,\"MMM-y\")),\"yyyy-MM-dd\");\n \n //sDateTxt = document.ChartGenerationForm.sDateLB.options[sDateIndex].text;\n //sDate = formatDate(new Date(getDateFromFormat(sDateTxt,\"MMM - y\")),\"yyyy-MM-dd\");\n //eDateTxt = document.ChartGenerationForm.eDateLB.options[eDateIndex].text;\n //eDate = formatDate(new Date(getDateFromFormat(eDateTxt,\"MMM - y\")),\"yyyy-MM-dd\");\n\n if( ouSelCB.checked)\n {\n \tif(orgUnitListCB.options.length <=0 ) { alert( \"Please select OrgUnit(s)\" ); return false; }\n }\n else if( orgUnitLevelCB.selectedIndex < 0 ) { alert( \"Please select OrgUnitLevel\" ); return false; }\n\n orgUnitListCB.disabled = false;\n if(sDateIndex < 0) {alert(\"Please Select Starting Period\");return false;}\n else if(eDateIndex < 0) {alert(\"Please Select Ending Period\");return false;}\n else if(sDate > eDate) {alert(\"Starting Date is Greater\");return false;}\n \n //else if(selDEListSize <=0 ) {alert(\"Please Select Data elements\");return false;}\n\t/*\n\tfor(k=0;k<document.ChartGenerationForm.selectedDataElements.options.length;k++)\n \t{\n \t\tdocument.ChartGenerationForm.selectedDataElements.options[k].selected = true;\n } \n\t// for l\n\t*/\n \n /*\n for(k = 0; k < orgUnitListCB.options.length; k++)\n\t{\n\t\torgUnitListCB.options[k].selected = true;\n\t}\n\n var sWidth = 850;\n\tvar sHeight = 650;\n var LeftPosition=(screen.width)?(screen.width-sWidth)/2:100;\n var TopPosition=(screen.height)?(screen.height-sHeight)/2:100;\n\n window.open('','chartWindow1','width=' + sWidth + ', height=' + sHeight + ', ' + 'left=' + LeftPosition + ', top=' + TopPosition + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=yes, resizable=yes');\n \treturn true;\n \t*/\n \t\n \tgenerateNullReporterResult();\n}", "title": "" }, { "docid": "9422cf4b547ee2d02bbb184b8a6875ed", "score": "0.6299278", "text": "function dateValidation()\n{\n var udate = document.registration.datepic;\n var udate_len = udate.value.length;\n if (udate_len == 0 || udate.value == \"\")\n {\n alert(\"Please enter date.\");\n document.registration.datepic.focus();\n return false;\n }\n else\n {\n document.registration.from.focus();\n return true;\n }\n}", "title": "" }, { "docid": "df53ee4e56424cee271804af5ca5ef8c", "score": "0.6291354", "text": "function passport_date_err_show() {\n $('#date3').css('border','1px solid #FF0000')\n $('#date4').css('border','1px solid #FF0000')\n $('#date3').focus();\n $('#pass_date_err').show();\n $('#pass_date_err').css('color','#FF0000');\n $('#pass_date_err').html(\"Passport Expiry date should be after the Passport issue date !\");\n }", "title": "" }, { "docid": "be63b46184f7470d6d8dda217198bbd6", "score": "0.6285391", "text": "function visa_date_err_show() {\n $('#date5').css('border','1px solid #FF0000')\n $('#date6').css('border','1px solid #FF0000')\n $('#date5').focus();\n $('#visa_date_err').show();\n $('#visa_date_err').css('color','#FF0000');\n $('#visa_date_err').html(\"Visa Expiry date should be after the Visa issue date !\");\n }", "title": "" }, { "docid": "ed83163e2c09412acf4cdfae3a1876b8", "score": "0.62849295", "text": "function addDelToDateControls()\n {\n $('#display_end_date').on(\"keydown\",function(evt){\n var rawCode = evt.charCode ? evt.charCode : evt.which;\n if(rawCode===46 || rawCode===8)\n {\n $('#display_end_date').val(\"\");\n $('[name=\"end_date\"]').val(\"\");\n buildQuery();\n } else if(rawCode===9) {\n\t\t\treturn true;\n\t\t } else {\n\t\t\treturn false;\n\t\t }\n });\n $('#display_start_date').on(\"keydown\",function(evt){\n var rawCode = evt.charCode ? evt.charCode : evt.which;\n if(rawCode===46 || rawCode===8)\n {\n $('#display_start_date').val(\"\");\n $('[name=\"start_date\"]').val(\"\");\n buildQuery();\n } else if(rawCode===9) {\n\t\t\treturn true;\n } else {\n\t\t\treturn false;\n\t\t }\n });\n }", "title": "" }, { "docid": "c1271f2efa5ada5e4447d3f315440d2d", "score": "0.62848574", "text": "function validateDatesIni() {\n var fecha_ini = new Date($('#fecha_ini').val() + ' 23:59:59.00');\n var fecha_act = new Date();\n if (fecha_ini < fecha_act && fecha_ini != '') {\n $('#fecha_ini').val('');\n swal('Atencion!', 'Se debe seleccionar una fecha igual o mayor a la actual', 'warning');\n }\n}", "title": "" }, { "docid": "791ddac5864557756b876e476b8e8296", "score": "0.6280734", "text": "function initDOBDatepicker() {\n if ($('.dob-input-field').length) {\n $('.dob-input-field').datepicker({\n maxDate: 0,\n yearRange: '-100:+0',\n changeYear: true,\n beforeShow: function() {\n $('#blackout-div').show();\n $('#blackout-div').addClass('blacked-out');\n },\n onClose: function() {\n $('#blackout-div').removeClass('blacked-out');\n $('#blackout-div').hide();\n }\n });\n }\n}", "title": "" }, { "docid": "b6c3c375b1a7466542ef0c2a1806162c", "score": "0.62688726", "text": "function allowValidDate(evt, fieldValue) {\n var keyCode = \"\";\n if (window.event) {\n keyCode = window.event.keyCode;\n evt = window.event;\n }\n else if (evt) keyCode = evt.which;\n else return true;\n dateArray = fieldValue.split(\"\"); //take every character of field value in array\n\n if (fieldValue.length == 0) {\n if ((keyCode < 48 || keyCode > 51))// (0-3)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 1) {\n // If first digit of date is '3' then second digit should be (0-1) \n if (dateArray[0] == \"3\") {\n if (keyCode < 48 || keyCode > 49)// (0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n // If first digit of date is '0' then second digit should not be '0'\n if (dateArray[0] == \"0\") {\n if (keyCode == 48)// (0)\n {\n evt.returnValue = false;\n return false;\n }\n }\n else if ((keyCode < 48 || keyCode > 57))//(0-9)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 2) {\n if ((keyCode != 45))// (-)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 3) {\n if ((keyCode < 48 || keyCode > 49))//(0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 4) {\n // If first digit of month is '1' then second digit should be (0-2) \n if (dateArray[3] == \"1\") {\n if (keyCode < 48 || keyCode > 50)// (0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n // If first digit of month is '0' then second digit should not be '0' \n if (dateArray[3] == \"0\") {\n if (keyCode == 48)// (0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if ((keyCode < 48 || keyCode > 57))//(0-9)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 5) {\n if ((keyCode != 45))// (-)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if ((fieldValue.length > 5) && (fieldValue.length < 10)) {\n if ((keyCode < 48 || keyCode > 57))//(0-9)\n {\n evt.returnValue = false;\n return false;\n }\n }\n // check if year is not less then 0001\n if (fieldValue.length == 9) {\n if (dateArray[6] == \"0\" && dateArray[7] == \"0\" && dateArray[8] == \"0\") {\n if (keyCode == 48) {\n evt.returnValue = false;\n return false;\n }\n }\n }\n // check if field length is greater than 9\n if (fieldValue.length > 9) {\n evt.returnValue = false;\n return false;\n }\n\n else return true;\n}", "title": "" }, { "docid": "8631d33da2af737ecb4df28a250e0240", "score": "0.62660617", "text": "function allowValidDate(evt, fieldValue) {\n var keyCode = \"\";\n if (window.event) {\n keyCode = window.event.keyCode;\n evt = window.event;\n }\n else if (evt) keyCode = evt.which;\n else return true;\n dateArray = fieldValue.split(\"\"); //take every character of field value in array\n\n if (fieldValue.length == 0) {\n if ((keyCode < 48 || keyCode > 51))// (0-3)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 1) {\n // If first digit of date is '3' then second digit should be (0-1)\n if (dateArray[0] == \"3\") {\n if (keyCode < 48 || keyCode > 49)// (0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n // If first digit of date is '0' then second digit should not be '0'\n if (dateArray[0] == \"0\") {\n if (keyCode == 48)// (0)\n {\n evt.returnValue = false;\n return false;\n }\n }\n else if ((keyCode < 48 || keyCode > 57))//(0-9)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 2) {\n if ((keyCode != 45))// (-)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 3) {\n if ((keyCode < 48 || keyCode > 49))//(0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 4) {\n // If first digit of month is '1' then second digit should be (0-2)\n if (dateArray[3] == \"1\") {\n if (keyCode < 48 || keyCode > 50)// (0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n // If first digit of month is '0' then second digit should not be '0'\n if (dateArray[3] == \"0\") {\n if (keyCode == 48)// (0-1)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if ((keyCode < 48 || keyCode > 57))//(0-9)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if (fieldValue.length == 5) {\n if ((keyCode != 45))// (-)\n {\n evt.returnValue = false;\n return false;\n }\n }\n if ((fieldValue.length > 5) && (fieldValue.length < 10)) {\n if ((keyCode < 48 || keyCode > 57))//(0-9)\n {\n evt.returnValue = false;\n return false;\n }\n }\n // check if year is not less then 0001\n if (fieldValue.length == 9) {\n if (dateArray[6] == \"0\" && dateArray[7] == \"0\" && dateArray[8] == \"0\") {\n if (keyCode == 48) {\n evt.returnValue = false;\n return false;\n }\n }\n }\n // check if field length is greater than 9\n if (fieldValue.length > 9) {\n evt.returnValue = false;\n return false;\n }\n\n else return true;\n}", "title": "" }, { "docid": "99731bde067e70e5907b4f82a9a66b8f", "score": "0.62651163", "text": "function checkDateValidation()\n\t{\n\t\tvar isValid = true;\n\n\t\tvar dateInput = m_InputFields[7];\n\n\t\tvar now = new Date();\n\n\t\tif(dateInput.value === \"\" || Date.parse(dateInput.value) < now)\n\t\t{\n\t\t\tisValid = false;\n\t\t}\n\n\t\tdateInput.style.border = (isValid) ? '0.15em solid grey' : '0.15em solid red';\n\n\t\treturn isValid;\n\t}", "title": "" }, { "docid": "6d0807e64491c6b12db6aecb738aa224", "score": "0.6246174", "text": "function customBootstrapDatepicker(thisElement) {\n let inputGroup = thisElement.closest('.input-group');\n //let day = rawInputDay = ('.bdday').val();\n let day = rawInputDay = inputGroup.find('.bdday').val();\n let month = rawInputMonth = inputGroup.find('.bdmonth').val();\n let year = rawInputYear = inputGroup.find('.bdyear').val();\n\n // month setting\n if (!isNaN(month)) {\n month = monthNamesArr[month - 1];\n inputGroup.find('.bdmonth').val(month);\n }\n\n // year setting\n if ((year.toString()).length < 3) {\n let yearLastStr = '';\n if ((year.toString()).length == 1) {\n yearLastStr = '0' + year.toString();\n }\n if ((year.toString()).length == 2) {\n yearLastStr = year.toString();\n }\n\n let thisYear = new Date().getFullYear().toString();\n thisYear = thisYear.substring(0, thisYear.length - 2);\n thisYear = thisYear + yearLastStr;\n year = parseInt(thisYear);\n inputGroup.find('.bdyear').val(year);\n }\n if ((year.toString()).length == 3 || (year.toString()).length > 4) {\n inputGroup.find('.bdyear').val(new Date().getFullYear());\n year = new Date().getFullYear();\n }\n\n // check the full date is valid or not\n /*if(!isValidDate(day,monthNamesObj[month],year)) //month is str ie. Jan, Feb ...\n {\n $('.bdday').val('0');\n }*/\n\n // check day is valid or not if not set valid\n if (!isValidDay(day, monthNamesObj[month], year)) {\n // $('.bdday').val('0');\n day = maxDaysInMonth(monthNamesObj[month], year);\n inputGroup.find('.bdday').val(day);\n inputGroup.find('.bdday').select();\n return false;\n }\n\n // check month is valid or not\n if (!isValidMonth(monthNamesObj[month])) {\n //$('.bdmonth').val('0');\n month = monthNamesArr[new Date().getMonth()];\n inputGroup.find('.bdmonth').val(month);\n inputGroup.find('.bdmonth').select();\n return false;\n }\n\n // check year is valid or not\n if (!isValidYear(year)) {\n //$('.bdyear').val('0');\n year = new Date().getFullYear();\n inputGroup.find('.bdyear').val(year);\n inputGroup.find('.bdyear').select();\n return false;\n }\n\n // set the parsed full date to hidden input field\n let formatedDate = day + '-' + monthNamesObj[month] + '-' + year;\n inputGroup.find('.bdpicker_hidden_input').val(formatedDate);\n\n // set the parsed full date to the datepicker\n formatedDate = day + '-' + (monthNamesObj[month] + 1) + '-' + year;\n //$('.datepicker').datepicker('setDate', formatedDate);\n inputGroup.find('.datepicker').datepicker('setDate', formatedDate);\n }", "title": "" }, { "docid": "65a67b33294ed3b72fd982f8daa69fac", "score": "0.6244327", "text": "function required_holiday_date(){\n // console.log(\"coming inside\")\n var holi_from_date = document.getElementById(\"holi_from_date\").value;\n var holi_to_date = document.getElementById(\"holi_to_date\").value;\n var comp_from_date = document.getElementById(\"comp_from_date\").value;\n var comp_to_date = document.getElementById(\"comp_to_date\").value;\n//alert((holi_from_date!= \"\") && (holi_to_date== \"\") || ((holi_from_date== \"\") && (holi_to_date!= \"\")))\n//alert((comp_from_date!=\"\") && (comp_to_date==\"\") || ((comp_from_date==\"\") && (comp_to_date!=\"\")))\n\n if((holi_from_date!= \"\") && (holi_to_date== \"\") || ((holi_from_date== \"\") && (holi_to_date!= \"\"))){\n \n // console.log(\"holiday date pair missing\")\n swal(\"\",\"Please Enter Holiday Date\",\"error\");\n return false;\n }\n\n \n \n if((comp_from_date!= \"\") && (comp_to_date== \"\") || ((comp_from_date== \"\") && (comp_to_date!= \"\"))){\n swal(\"\",\"Please Enter Compensation Date\",\"error\");\n return false;\n }\n\n document.getElementById('holiday_search').submit(); \n\n}", "title": "" }, { "docid": "743e5c0ea67922a7d704ff74a21d6b85", "score": "0.62423545", "text": "function initDatePicker() {\r\n window.oToday = new Date();\r\n window.dateControl = new DatePick(window.document, false, \"Appt\", null, 160);\r\n window.ddMgr = getDropDownMgr( document );\r\n \r\n if (window.dateControl) {\r\n window.dateControl.setDatePickedCB( onDatePicked );\r\n window.dateControl.generateHTML();\r\n }\r\n}", "title": "" }, { "docid": "d46ad47f69ee2a727cc86110a1b4aba0", "score": "0.6237816", "text": "function displayCalendar(inputFieldID,buttonObj,displayTime,timeInput){ //alert(inputFieldID);\n\t$('#'+inputFieldID).datepicker();\n}", "title": "" }, { "docid": "0faa2937f9319ef9667e0bf3056ad2da", "score": "0.6236856", "text": "function prepareDatePicker() {\n\t$('.inputDate').each(function() {\n\t\tactivateDatePicker($(this));\n\t});\n}", "title": "" }, { "docid": "951e342a3d67ce8b0fa207c829b69018", "score": "0.62282354", "text": "function calendar() {\n\n var spnClickCalenderToolTip = $(\"#spnClickCalenderToolTip\").html();\n var options = {\n // yearRange: \"-11:+0\",\n showOn: \"button\",\n buttonImage: \"../../images/icon_calendar.gif\",\n changeYear: true,\n buttonImageOnly: true,\n buttonText: spnClickCalenderToolTip,\n hideIfNoPrevNext: true //,\n\n\n }\n\n var options1 = {\n yearRange: \"1991:2023\",\n showOn: \"button\",\n buttonImage: \"../../images/icon_calendar.gif\",\n changeYear: true,\n buttonImageOnly: true,\n buttonText: spnClickCalenderToolTip,\n hideIfNoPrevNext: true //,\n\n\n }\n\n\n // Current document language is at HTML root tag \n var lang = $('html').attr(\"lang\").toLowerCase();\n // Set datepicker language. \n $.datepicker.setDefaults($.datepicker.regional[lang === 'en-us' ? '' : lang]);\n $(\"#txtPlantingDate\").datepicker(options);\n $(\"#txtstartDate\").datepicker(options1);\n $(\"#txtEndDate\").datepicker(options1);\n\n}", "title": "" }, { "docid": "76acffb3aa90dd5d49968b0330a112c8", "score": "0.6224349", "text": "function validarFecha() {\n\n var fecha = document.getElementById('edad').value\n\n // Primero verifica el patron\n var isValid = fecha.match(/^([0-2][0-9]|(3)[0-1])(\\/)(((0)[0-9])|((1)[0-2]))(\\/)\\d{4}$/)\n if (!isValid) error = true\n\n // Mediante el delimitador \"/\" separa dia, mes y año\n var fecha = fecha.split('/')\n var day = parseInt(fecha[0])\n var month = parseInt(fecha[1])\n var year = parseInt(fecha[2])\n\n // Verifica que dia, mes, año, solo sean numeros\n error = isNaN(day) || isNaN(month) || isNaN(year)\n\n // Lista de dias en los meses, por defecto no es año bisiesto\n var ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n if (month === 1 || month > 2)\n if (\n day > ListofDays[month - 1] ||\n day < 0 ||\n ListofDays[month - 1] === undefined\n )\n error = true\n\n // Detecta si es año bisiesto y asigna a febrero 29 dias\n if (month === 2) {\n var lyear = (!(year % 4) && year % 100) || !(year % 400)\n if (lyear === false && day >= 29) error = true\n if (lyear === true && day > 29) error = true\n }\n\n if (error === true) {\n toastr.warning(\n \"Por favor, utiliza el formato DD/MM/YYYY Ej-12/05/1984\",\n \"Formato de fecha Incorrecto\");\n borrar()\n getFocus()\n\n return false\n\n } else calcularEdad()\n}", "title": "" }, { "docid": "c66eb26d7e11661ca1df5cbfdc21cf3e", "score": "0.6220408", "text": "function validDateCompare(txtFDate, txtTDate, jvType) {\r\n \r\n var fldFDate = txtFDate; //document.getElementById(txtFDate);\r\n var fldTDate = txtTDate;//document.getElementById(txtTDate);\r\n var fldFDateValue = fldFDate.val();\r\n var fldTDateValue = fldTDate.val();\r\n var jvIsValid = true;\r\n var re = /\\b\\d{1,2}[\\/-]\\d{1,2}[\\/-]\\d{4}\\b/;\r\n var delimChar = (fldFDateValue.indexOf(\"/\") != -1) ? \"/\" : \"-\";\r\n var objFDate;\r\n var objTDate;\r\n if (isEmpty(fldTDateValue) == false && isEmpty(fldTDateValue) == false) {\r\n // Validate From Date\r\n if (re.test(fldFDateValue)) {\r\n // Split the input into day,month and Year\r\n\r\n var delim1 = fldFDateValue.indexOf(delimChar);\r\n var delim2 = fldFDateValue.lastIndexOf(delimChar);\r\n day = parseInt(fldFDateValue.substring(0, delim1), 10);\r\n mo = parseInt(fldFDateValue.substring(delim1 + 1, delim2), 10);\r\n yr = parseInt(fldFDateValue.substring(delim2 + 1), 10);\r\n objFDate = new Date(yr, mo - 1, day);\r\n\r\n if (objFDate.getDate() != day) { jvIsValid = false; }\r\n if (objFDate.getMonth() + 1 != mo) { jvIsValid = false; }\r\n if (objFDate.getFullYear() != yr) { jvIsValid = false; }\r\n }\r\n else { jvIsValid = false; }\r\n\r\n if (jvIsValid == false) {\r\n var jvMsg = \"Invalid Date!!!\";\r\n showCustomMessage(\"Validation Failed\", jvMsg, \"Error\");\r\n fldFDate.value = \"\";\r\n fldFDate.focus();\r\n return false;\r\n }\r\n else {\r\n if (day < 10) { day = \"0\" + day; }\r\n if (mo < 10) { mo = \"0\" + mo; }\r\n fldFDate.value = day + \"/\" + mo + \"/\" + yr;\r\n }\r\n\r\n if (jvType == \"EXPC\") { fldTDateValue = \"01/\" + fldTDateValue; }\r\n\r\n // validate To Date\r\n if (re.test(fldTDateValue)) {\r\n // Split the input into day,month and Year\r\n var delim3 = fldTDateValue.indexOf(delimChar);\r\n var delim4 = fldTDateValue.lastIndexOf(delimChar);\r\n\r\n day = parseInt(fldTDateValue.substring(0, delim3), 10);\r\n mo = parseInt(fldTDateValue.substring(delim3 + 1, delim2), 10);\r\n yr = parseInt(fldTDateValue.substring(delim4 + 1), 10);\r\n objTDate = new Date(yr, mo - 1, day);\r\n\r\n if (objTDate.getDate() != day) { jvIsValid = false; }\r\n if (objTDate.getMonth() + 1 != mo) { jvIsValid = false; }\r\n if (objTDate.getFullYear() != yr) { jvIsValid = false; }\r\n }\r\n else { jvIsValid = false; }\r\n\r\n if (jvIsValid == false) {\r\n var jvMsg = \"Invalid ToDate!!!\";\r\n showCustomMessage(\"Validation Failed\", jvMsg, \"Error\");\r\n fldTDate.value = \"\";\r\n fldTDate.focus();\r\n return false;\r\n }\r\n else {\r\n if (day < 10) { day = \"0\" + day; }\r\n if (mo < 10) { mo = \"0\" + mo; }\r\n fldTDate.value = day + \"/\" + mo + \"/\" + yr;\r\n if (jvType == \"EXPC\") { fldTDate.value = mo + \"/\" + yr; }\r\n }\r\n\r\n // Comparison\r\n if (objFDate > objTDate) {\r\n var jvMsg = \"Invalid Date!!!\"\r\n var jvFocusCtrl;\r\n if (jvType == \"COM\") {\r\n jvMsg = \"From Date Cannot be Greater Than To Date!!!\";\r\n jvFocusCtrl = fldFDate;\r\n }\r\n else if (jvType == \"CO\") {\r\n jvMsg = \"To Date Cannot be Less Than From Date!!!\";\r\n jvFocusCtrl = fldTDate;\r\n }\r\n else if (jvType == \"NOFD\") {\r\n jvMsg = \"Cannot be Future Date!!!\";\r\n jvFocusCtrl = fldFDate;\r\n }\r\n else if (jvType == \"EXPC\") {\r\n jvMsg = \"Expiry Date Cannot be Lesser Than Current Date!!!\";\r\n jvFocusCtrl = fldTDate;\r\n }\r\n else {\r\n jvMsg = \"From Date Cannot be Greater Than To Date!!!\";\r\n jvFocusCtrl = fldFDate;\r\n }\r\n\r\n showCustomMessage(\"Validation Failed\", jvMsg, \"Error\");\r\n //alert(jvMsg)\r\n jvFocusCtrl.value = \"\";\r\n jvFocusCtrl.focus();\r\n return false;\r\n }\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "c1b05949d8a9df4d291cc19146255692", "score": "0.6212695", "text": "function getDateErrorMessage(dateObj) \n{\n\tvar strMonths,strMonth,strDay,strYear;\n\tvar strs;\n\tvar errorMsg = 'none';\n\n\tif ( dateObj.value.length < 10){\n\t\terrorMsg = 'PLEASE ENTER A VALID DATE.';\n\t\treturn errorMsg; \n\t}\n\n\tstrs = dateObj.value.substring(2,3); \n\tif (!(strs ==\"/\")){\n\t\terrorMsg = 'PLEASE ENTER A VALID DATE.';\n\t\treturn errorMsg; \n\t}\n\n\tstrs = dateObj.value.substring(5,6);\n\tif (!(strs ==\"/\")){\n\t\terrorMsg = 'PLEASE ENTER A VALID DATE.';\n\t\treturn errorMsg; \n\t}\n\n\tstrDay = dateObj.value.substring(0,2); \n\tstrMonth = dateObj.value.substring(3,5); \n\tstrYear = dateObj.value.substring(6,10);\n\n\tif(!(checkNonNumericCharacters(strYear))){\n\t\terrorMsg = 'YEAR SHOULD BE NUMERIC VALUE.';\n\t\treturn errorMsg; \n\t}\n\n\tif(!( (strYear >= \"1900\") && (strYear <= \"3000\") )){ \n\t\terrorMsg = 'PLEASE ENTER A VALID YEAR.';\n\t\treturn errorMsg;\n\t}\n\n\tif(!(checkNonNumericCharacters(strMonth))){\n\t\terrorMsg = 'MONTH SHOULD BE NUMERIC VALUE.';\n\t\treturn errorMsg;\n\t}\n\n\tif(!((strMonth <= \"12\") && (strMonth >= \"01\"))){\n\t\terrorMsg = 'PLEASE ENTER A VALID MONTH.';\n\t\treturn errorMsg;\n\t}\n\n\tif(!(checkNonNumericCharacters(strDay))){\n\t\terrorMsg = 'DAY SHOULD BE NUMERIC VALUE.';\n\t\treturn errorMsg;\n\t}\n\n\tstrMonths=\"312831303130313130313031\";\n\tif((( strYear%4 == 0 ) && (strYear%100 != 0)) || (strYear%400==\"0\") ){\n\t\tstrMonths=\"312931303130313130313031\";\n\t\treturn errorMsg;\n\t}\n\n\tif(!((strDay <= strMonths.substring((strMonth-1)*2,(strMonth-1)*2+2)) && (strDay>0))){\n\t\terrorMsg = 'PLEASE ENTER A VALID DAY';\n\t\treturn errorMsg;\n\t}\n\treturn errorMsg;\n}", "title": "" }, { "docid": "f0c19339789ea5ee5591bf8831641694", "score": "0.621072", "text": "function validateForm() {\n\t\tif($(\"#frm\").valid()) {\n\t\t\tvar school = $(\"#schoolId :selected\").val();\n\t\t\tvar sd = $(\"#startDate\").datepicker({ dateFormat: 'dd,MM,yyyy' }).val();\n\t\t\tvar ed = $(\"#endDate\").datepicker({ dateFormat: 'dd,MM,yyyy' }).val();\n\t\t\tdisplayChart();\n\t\t};\n\t}", "title": "" }, { "docid": "ba956294c2de6ccc2fed8e8590ac2f6f", "score": "0.6209004", "text": "emptyvalid(date){\n //if it full send signal\n if(date.value !== ''){\n return true;\n }\n //if its empty alert to user\n else if(date.value === ''){\n alert('please choose a Date');\n }\n }", "title": "" }, { "docid": "e23b7b8adb1e07d441b0ae5275ced278", "score": "0.6205145", "text": "function runDobValidator() {\n var dobEntryItem = $('#dob-input');\n var dobRegExp = /^\\d{0,4}$|^\\d{4}-\\d{0,2}$|^\\d{4}-\\d{2}-\\d{0,2}$/;\n runValidator(dobEntryItem, dobRegExp);\n}", "title": "" }, { "docid": "73fe9ea986bb03260ca5c9753b047511", "score": "0.6199748", "text": "function validatePeriod(x,y){\n var sd=x.value;\n sd=document.calform .Start.value;\n var dd=sd.substr(0,2);\n var mm=sd.substr(5,2);\n \n var yy=sd.substr(8,4);\n var sdobj = new Date(dd,mm,yy);\n\n var ed=y.value;\ned=document.calform .Start.value;\n var dd=ed.substr(0,2);\n var mm=ed.substr(5,2);\n var yy=ed.substr(8,4);\n \n var edobj = new Date(dd,mm,yy);\n \n if(sdobj<edobj) \n return true;\n else{\n\t/*alert(\"please select valid dates\");*/\n return true;\n\t}\n }", "title": "" }, { "docid": "c91ee893e0baa2b9c410600f19be76f6", "score": "0.61993974", "text": "function runDatePicker(url) {\n // var expired_date = 0;\n // var _url = \"getExpiredDate\";\n // var params = {};\n // var loaidangtin = $('#Property_loaidangtin').val();\n // params['loaidangtin'] = loaidangtin;\n // var today = new Date();\n // var FSDate = new Date(today);\n\n // jQuery.ajax({\n // url: _url,\n // data: params,\n // type: 'POST',\n // dataType: 'JSON',\n // success: function (data) {\n // expired_date = parseInt(data);\n // FSDate.setDate(today.getDate()+expired_date);\n // var id = jQuery(this).attr('id');\n // jQuery('#'+id).datepicker(\n // jQuery.extend(\n // {showMonthAfterYear:false}, \n // jQuery.datepicker.regional['vi-VN'], \n // {\n // 'dateFormat':'dd/mm/yy',\n // 'regional':'vi_VN',\n // 'changeMonth':'true',\n // 'changeYear':'true',\n // 'yearRange' : '1960',\n // 'showOn':'button',\n // 'buttonImage': url + '/admin/images/icon_calendar_r.gif',\n // 'buttonImageOnly':true,\n // 'minDate': FSDate\n // }\n // )\n // );\n // },\n // error: function () {\n \n // }\n // });\n \n var today = new Date();\n var FSDate = new Date(today);\n FSDate.setDate(today.getDate()+7);\n jQuery('.ver_datepicker_dangtin').each(function(){\n var id = jQuery(this).attr('id');\n \n jQuery('#'+id).datepicker(\n jQuery.extend(\n {showMonthAfterYear:false}, \n jQuery.datepicker.regional['vi-VN'], \n {\n 'dateFormat':'dd/mm/yy',\n 'regional':'vi_VN',\n 'changeMonth':'true',\n 'changeYear':'true',\n 'yearRange' : '1960',\n 'showOn':'button',\n 'buttonImage': url + '/admin/images/icon_calendar_r.gif',\n 'buttonImageOnly':true,\n 'minDate': FSDate,\n // 'disableInput' : true\n 'pickTime': false,\n // 'minDate' : 'jsDate'\n }\n )\n );\n });\n\n jQuery('.ver_datepicker_dob').each(function(){\n var id = jQuery(this).attr('id');\n jQuery('#'+id).datepicker(\n jQuery.extend(\n {showMonthAfterYear:false}, \n jQuery.datepicker.regional['en-GB'], \n {\n 'dateFormat':'dd/mm/yy',\n 'regional':'en_us',\n 'changeMonth':'true',\n 'changeYear':'true',\n 'yearRange' : '1960',\n 'showOn':'button',\n 'buttonImage': url + '/admin/images/icon_calendar_r.gif',\n 'buttonImageOnly':true,\n }\n )\n );\n });\n jQuery('.ver_datepicker').each(function(){\n var id = jQuery(this).attr('id');\n jQuery('#'+id).datepicker(\n jQuery.extend(\n {showMonthAfterYear:false}, \n jQuery.datepicker.regional['en-GB'], \n {\n 'dateFormat':'dd/mm/yy',\n 'regional':'en_us',\n 'changeMonth':'true',\n 'changeYear':'true',\n 'showOn':'button',\n 'buttonImage': url + '/admin/images/icon_calendar_r.gif',\n 'buttonImageOnly':true\n }\n )\n );\n });\n\n jQuery('.ver_datepicker_dmy').each(function(){\n var id = jQuery(this).attr('id');\n jQuery('#'+id).datepicker(\n jQuery.extend(\n {showMonthAfterYear:false}, \n jQuery.datepicker.regional['en-GB'], \n {\n 'dateFormat':'dd-mm-yy',\n 'regional':'en_us',\n 'changeMonth':'true',\n 'changeYear':'true',\n 'showOn':'button',\n 'buttonImage': url + '/admin/images/icon_calendar_r.gif',\n 'buttonImageOnly':true\n }\n )\n );\n }); \n}", "title": "" }, { "docid": "acb446baee1c5c5753a4e90b2d243def", "score": "0.61960304", "text": "function validate(ob, min, max, returntype, texttype, regexVal, returnFocus) {\n\tvar origVal;\n\n\t// Reset flag on page\n\t$('#field_validation_error_state').val('0');\n\n\t// If blank, or a valid missing data code, do nothing\n\tif (ob.value == '' || $.inArray(ob.value, missing_data_codes) !== -1) {\n\t\tob.style.fontWeight = 'normal';\n\t\tob.style.backgroundColor='#FFFFFF';\n\t\t//console.log('is blank or missing data code');\n\t\treturn true;\n\t}\n\torigVal = ob.value;\n\t\n\t// If datetime-picker was just clicked, do nothing because onblur will check this later unless the datetime-picker clicked is not sibling\n\ttry {\t\t\n\t\tvar isSibling = object_clicked.prev().attr('id') === $(ob).attr('id');\n\n\t\t// If the datepicker was just clicked then set isValidClick to true to allow for siblings to be clicked without triggering validation before onblur\n\t\tif (isSibling && typeof object_clicked == 'object' && object_clicked.hasClass('ui-datepicker-trigger')) {\n\t\t\tob.style.fontWeight = 'normal';\n\t\t\tob.style.backgroundColor='#FFFFFF';\n\t\t\tisValidClick = true;\n\t\t\treturn true;\n\t\t}\n\n\t\t// If any sibling of the datepicker is clicked, defer validation to onblur\n\t\tif (isValidClick && object_clicked.parents('.ui-datepicker:visible').length > 0 || object_clicked.siblings('input').attr('id') === $(ob).attr('id')) {\n\t\t\tob.style.fontWeight = 'normal';\n\t\t\tob.style.backgroundColor='#FFFFFF';\n\t\t\tisValidClick = false;\n\t\t\treturn true;\n\t\t}\n\t} catch(e) { }\n\t\n\t// Get ID of field: If field does not have an id, then given it a random one so later we can reference it directly.\n\tvar obId = $(ob).attr('id');\n\tif (obId == null) {\n\t\tobId = \"val-\"+Math.floor(Math.random()*10000000000000000);\n\t\t$(ob).attr('id', obId);\n\t}\n\t\n\t// Set the Javascript for returning focus back on element (if specified)\n\tif (returnFocus == null) returnFocus = 1;\n\tvar returnFocusJS = (returnFocus == 1) ? \"$('#\"+obId+\"').focus();\" : \"\";\n\t\n\tif (regexVal != null)\n\t{\n\t\t// Before evaluating with regex, first do some cleaning\n\t\tob.value = trim(ob.value);\n\n\t\t// Set id for regex validation dialog div\n\t\tvar regexValPopupId = 'redcapValidationErrorPopup';\n\n\t\t// For date[time][_seconds] fields, replace any periods or slashes with a dash. Add any leading zeros.\n\t\tif (texttype==\"date_ymd\" || texttype==\"date_mdy\" || texttype==\"date_dmy\") {\n\t\t\tob.value = redcap_clean_date(ob.value,texttype);\n\t\t\tif (ob.value.split('-').length == 2) {\n\t\t\t\t// If somehow contains just one dash, then remove the dash and re-validate it to force reformatting\n\t\t\t\treturn $(ob).val(ob.value.replace(/-/g,'')).trigger('blur');\n\t\t\t}\n\t\t\tvar thisdate = ob.value;\n\t\t\tvar thistime = '';\n\t\t} else if (texttype==\"datetime_ymd\" || texttype==\"datetime_mdy\" || texttype==\"datetime_dmy\"\n\t\t\t\t|| texttype==\"datetime_seconds_ymd\" || texttype==\"datetime_seconds_mdy\" || texttype==\"datetime_seconds_dmy\") {\n\t\t\tvar dt_array = ob.value.split(' ');\n\t\t\tif (dt_array[1] == null) dt_array[1] = '';\n\t\t\tvar thisdate = redcap_clean_date(dt_array[0],texttype);\n\t\t\tvar thistime = redcap_pad_time(dt_array[1]);\n\t\t\tob.value = trim(thisdate+' '+thistime);\n\t\t\tif (ob.value.split('-').length == 2) {\n\t\t\t\t// If somehow contains just one dash, then remove the dash and re-validate it to force reformatting\n\t\t\t\treturn $(ob).val(ob.value.replace(/-/g,'')).trigger('blur');\n\t\t\t}\n\t\t}\n\n\t\t// Obtain regex from hidden divs on page (where they are stored)\n\t\tvar regexDataType = '';\n\t\tif (regexVal === 1) {\n\t\t\tregexVal = $('#valregex_divs #valregex-'+texttype).html();\n\t\t\tregexDataType = $('#valregex_divs #valregex-'+texttype).attr('datatype');\n\t\t}\n\t\t\n\t\t// Evaluate value with regex\n\t\t// Remove leading and trailing '/'\n\t\tvar regexVal2 = new RegExp(regexVal.slice(1,-1)); \n\t\tif (regexVal2.test(ob.value))\n\t\t{\n\t\t\t// Passed the regex test!\n\n\t\t\t// // Reformat phone format, if needed\n\t\t\t// if (texttype==\"phone\") {\n\t\t\t// \tob.value = ob.value.replace(/-/g,\"\").replace(/ /g,\"\").replace(/\\(/g,\"\").replace(/\\)/g,\"\").replace(/\\./g,\"\");\n\t\t\t// \tif (ob.value.length > 10) {\n\t\t\t// \t\tob.value = trim(reformatUSPhone(ob.value.substr(0,10))+\" \"+trim(ob.value.substr(10)));\n\t\t\t// \t} else {\n\t\t\t// \t\tob.value = reformatUSPhone(ob.value);\n\t\t\t// \t}\n\t\t\t// }\n\t\t\t// // Make sure time has a leading zero if hour is single digit\n\t\t\t// else if (texttype==\"time\" && ob.value.length == 4) {\n\t\t\t// \tob.value = \"0\"+ob.value;\n\t\t\t// }\n\t\t\t// // If a date[time] field and the returnDelimiter is specified, then do a delimiter replace\n\t\t\t// else if (dateDelimiterReturned != null && dateDelimiterReturned != '-' && (texttype.substring(0,5) == 'date_' || texttype.substring(0,9) == 'datetime_')) {\n\t\t\t// \tob.value = ob.value.replace(/-/g, dateDelimiterReturned);\n\t\t\t// }\n\n\t\t\t// If the value has been reformatted above, then we run calculate() and doBranching() for this field based on its NEW value.\n\t\t\tif (origVal != ob.value) {\n\t\t\t\ttry{ calculate($(ob).attr('name')); doBranching($(ob).attr('name')); }catch(e){ }\n\t\t\t}\n\t\t\t\n\t\t\t// If a date/time field, check if its datepicker widget is opened\n\t\t\tvar hasDatePicker = $(ob).parentsUntil('tr').find('.ui-datepicker-trigger').length;\n\t\t\tvar hasDataPickerOpened = hasDatePicker ? $('#ui-datepicker-div:visible').length : false;\n\n\t\t\t// Now do range check (if needed) for various validation types\n\t\t\tif ((min != '' || max != '')) // && !hasDataPickerOpened)\n\t\t\t{\n\t\t\t\tholder1 = ob.value;\n\t\t\t\tholder2 = min;\n\t\t\t\tholder3 = max;\n\n\t\t\t\t\n\t\t\t\t// Range check - date[time][_seconds]\n\t\t\t\tif (texttype==\"date_ymd\" || texttype==\"date_mdy\" || texttype==\"date_dmy\"\n\t\t\t\t\t|| texttype==\"datetime_ymd\" || texttype==\"datetime_mdy\" || texttype==\"datetime_dmy\"\n\t\t\t\t\t|| texttype==\"datetime_seconds_ymd\" || texttype==\"datetime_seconds_mdy\" || texttype==\"datetime_seconds_dmy\")\n\t\t\t\t{\n\t\t\t\t\t// Convert date format of value to YMD to compare with min/max, which are already in YMD format\n\t\t\t\t\tif (/_mdy/.test(texttype)) {\n\t\t\t\t\t\tholder1 = trim(date_mdy2ymd(thisdate)+' '+thistime);\n\t\t\t\t\t\tvar min_array = min.split(' ');\n\t\t\t\t\t\tif (min_array[1] == null) min_array[1] = '';\n\t\t\t\t\t\tmin = trim(date_ymd2mdy(min_array[0],texttype)+' '+min_array[1]);\n\t\t\t\t\t\tvar max_array = max.split(' ');\n\t\t\t\t\t\tif (max_array[1] == null) max_array[1] = '';\n\t\t\t\t\t\tmax = trim(date_ymd2mdy(max_array[0],texttype)+' '+max_array[1]);\n\t\t\t\t\t} else if (/_dmy/.test(texttype)) {\n\t\t\t\t\t\tholder1 = trim(date_dmy2ymd(thisdate)+' '+thistime);\n\t\t\t\t\t\tvar min_array = min.split(' ');\n\t\t\t\t\t\tif (min_array[1] == null) min_array[1] = '';\n\t\t\t\t\t\tmin = trim(date_ymd2dmy(min_array[0],texttype)+' '+min_array[1]);\n\t\t\t\t\t\tvar max_array = max.split(' ');\n\t\t\t\t\t\tif (max_array[1] == null) max_array[1] = '';\n\t\t\t\t\t\tmax = trim(date_ymd2dmy(max_array[0],texttype)+' '+max_array[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tholder1 = trim(thisdate+' '+thistime);\n\t\t\t\t\t}\n\t\t\t\t\t// Ensure that min/max are in YMD format (legacy values could've been in M/D/Y format)\n\t\t\t\t\tif (texttype.substr(0,5) == \"date_\") {\n\t\t\t\t\t\tholder2 = redcap_clean_date(holder2,\"date_ymd\");\n\t\t\t\t\t\tholder3 = redcap_clean_date(holder3,\"date_ymd\");\n\t\t\t\t\t}\n\t\t\t\t\t// Remove all non-numerals so we can compare them numerically\n\t\t\t\t\tholder1 = (holder1.replace(/:/g,\"\").replace(/ /g,\"\").replace(/-/g,\"\"))*1;\n\t\t\t\t\tholder2 = (holder2==='') ? '' : (holder2.replace(/:/g,\"\").replace(/ /g,\"\").replace(/-/g,\"\"))*1;\n\t\t\t\t\tholder3 = (holder3==='') ? '' : (holder3.replace(/:/g,\"\").replace(/ /g,\"\").replace(/-/g,\"\"))*1;\n\t\t\t\t}\n\t\t\t\t// Check range\n\t\t\t\tif ((holder2 !== '' && holder1 < holder2) || (holder3 !== '' && holder1 > holder3)) {\n\t\t\t\t\tvar msg1 = ($('#valtext_divs #valtext_rangesoft1').length) ? $('#valtext_divs #valtext_rangesoft1').text() : 'The value you provided is outside the suggested range.';\n\t\t\t\t\t// var msg2 = ($('#valtext_divs #valtext_rangesoft2').length) ? $('#valtext_divs #valtext_rangesoft2').text() : 'This value is admissible, but you may wish to verify.';\n\t\t\t\t\tob.style.backgroundColor='#FFB7BE';\n\t\t\t\t\tvar msg = msg1 + ' (' + (min==''?'no limit':min) + ' - ' + (max==''?'no limit':max) +'). ';// + msg2;\n\t\t\t\t\t$('#'+regexValPopupId).remove();\n\t\t\t\t\tinitDialog(regexValPopupId);\n\t\t\t\t\t$('#'+regexValPopupId).html(msg);\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tsimpleDialog(msg, null, regexValPopupId, null, returnFocusJS);\n\t\t\t\t\t},10);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not out of range, so leave the field as normal\n\t\t\tob.style.fontWeight = 'normal';\n\t\t\tob.style.backgroundColor='#FFFFFF';\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tvar msg = ($('#valtext_divs #valtext_regex').length) ? $('#valtext_divs #valtext_regex').text() : 'The value you provided could not be validated because it does not follow the expected format. Please try again.';\n\n\tif ($('#valtext_divs #valtext_requiredformat').length && $('#valregex_divs #valregex-'+texttype).length) {\n\t\t// Set default generic message for failure\n\t\tmsg += '<div class=\"fvallab\">'+$('#valtext_divs #valtext_requiredformat').text()+' '\n\t\t\t+ $('#valregex_divs #valregex-'+texttype).attr('label')+'</div>';\n\t}\n\n\t// Because of strange syncronicity issues of back-to-back fields with validation, set pop-up content first here\n\t$('#'+regexValPopupId).remove();\n\tinitDialog(regexValPopupId);\n\t$('#'+regexValPopupId).html(msg);\n\t// Give alert message of failure\n\tsetTimeout(function(){\n\t\tsimpleDialog(msg, null, regexValPopupId, null, returnFocusJS);\n\t\t$('#'+regexValPopupId).parent().find('button:first').focus();\n\t},10);\n\tob.style.fontWeight = 'bold';\n\tob.style.backgroundColor = '#FFB7BE';\n\t// Set flag on page\n\t$('#field_validation_error_state').val('1');\n\treturn false;\n}", "title": "" }, { "docid": "dd1887a7d8ca879723220b2eb25ff72d", "score": "0.61883634", "text": "function DTB_DateKeys(ctl, nKeyCode)\n{\n var strDate, dtDate, nDay, nMonth, nYear;\n\n\t// Enter key? If so, format and exit. This is done because Enter\n // usually submits the page and that fires before the OnChange event\n // and we get a bogus validation error.\n\tif(nKeyCode == 13)\n\t{\n DTB_FormatDate(ctl);\n\t\treturn true;\n\t}\n\n // Popup calendar?\n if(nKeyCode == 80)\n {\n DTB_PopupCal(ctl.id);\n return false;\n }\n\n // Only used for PgUp/Down, Arrow Up/Down, and T\n if(nKeyCode != 33 && nKeyCode != 34 && nKeyCode != 38 &&\n nKeyCode != 40 && nKeyCode != 84)\n return true;\n\n if(nKeyCode != 84 && ctl.value != \"\")\n {\n DTB_FormatDate(ctl);\n dtDate = new Date(ctl.value);\n\n if(isNaN(dtDate))\n return;\n }\n else\n dtDate = new Date();\n\n switch(nKeyCode)\n {\n case 33: // Page up - Add a month\n dtDate.setMonth(dtDate.getMonth() + 1);\n break;\n\n case 34: // Page down - Subtract a month\n dtDate.setMonth(dtDate.getMonth() - 1);\n break;\n\n case 38: // Up arrow - Add a day\n dtDate.setDate(dtDate.getDate() + 1);\n break;\n\n case 40: // Down arrow - Subtract a day\n dtDate.setDate(dtDate.getDate() - 1);\n break;\n\n default: // Must have been \"T\" for Today\n break;\n }\n\n nDay = dtDate.getDate();\n nMonth = dtDate.getMonth() + 1;\n nYear = dtDate.getFullYear();\n\n if(nMonth < 10)\n strDate = \"0\" + nMonth.toString() + \"/\";\n else\n strDate = nMonth.toString() + \"/\";\n\n if(nDay < 10)\n strDate = strDate + \"0\" + nDay.toString() + \"/\" + nYear.toString();\n else\n strDate = strDate + nDay.toString() + \"/\" + nYear.toString();\n\n ctl.value = strDate;\n ctl.select();\n\n if(ctl.onchange != null)\n ctl.onchange();\n\n return false;\n}", "title": "" }, { "docid": "c7134dbfa309650027222a1d0deba4b4", "score": "0.6180317", "text": "day(member) {\n var day = $('#day').val();\n if ( day == \"\") {\n $('#error11').show();\n return false;\n }\n \n else {\n $('#error11').hide();\n return true;\n }\n }", "title": "" }, { "docid": "2dad26c5cdc41e242c1b20771449c89d", "score": "0.6179717", "text": "function checkDates(element)\r\n{ \r\n var birthDate = element.value;\r\n \r\n if(birthDate.length > 10){\r\n alert(\"Invalid Date Format\");\r\n element.value = \"\";\r\n element.focus();\r\n return;\r\n }\r\n var split = birthDate.split(/[^\\d]+/);\r\n var year = parseFloat(split[2]);\r\n var month = parseFloat(split[0]);\r\n var day = parseFloat(split[1]);\r\n if(birthDate != null){\r\n if (!/\\d{2}\\/\\d{2}\\/\\d{4}/.test(birthDate)) {\r\n alert(\"Invalid Date Format\");\r\n element.value = \"\";\r\n element.focus();\r\n return;\r\n }\r\n if(month > 13 || day > 32){\r\n alert(\"Invalid Date Format\");\r\n element.value = \"\";\r\n element.focus(); \r\n return;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "4f7f1e5b865d8cc2411e0d936578b27f", "score": "0.6177113", "text": "function initDatePicker()\n\t{\n\t\tvar dp = $('#datepicker');\n\t\tdp.datepicker();\n\t}", "title": "" }, { "docid": "567b94da794c37c31eb4ce566ebc4345", "score": "0.6167698", "text": "function validateDates(theStartDate,theEndDate,checkDates,returnFlag){\n\n\t\t\t\t\tvar now = new Date();\n\t\t\t\t\tvar theMonth = now.getMonth() + 1;\n\t\t\t\t\tvar theTodayStr = theMonth + \"/\" + now.getDate() + \"/\" + now.getFullYear();\n\t\t\t\t\tvar isReturnVal = false;\n\t\t\t\t//check if start date or end date is empty ; in order to prevent Javascript error to pop for fAfterSelected func of //calendar widget put today's date if field are empty\n\t\t\t\tif(isEmpty(theStartDate.value)){\n\t\t\t\t\talert(\"Start on: invalid blank value.\");\n\t\t\t\t\ttheStartDate.value=theTodayStr;\n\t\t\t\t\tisReturnVal = true;\n\t\t\t\t}\n\t\t\t\tif(isEmpty(theEndDate.value)){\n\t\t\t\t\talert(\"End on: invalid blank value.\");\n\t\t\t\t\ttheEndDate.value=theTodayStr;\n\t\t\t\t\tisReturnVal = true;\n\t\t\t\t}\n\t\t\t\tif(isReturnVal){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(checkDates){\n\t\t\t\t\t\tvar dt1=(theStartDate.value); \n\t\t\t\t\t\tvar dt2=(theEndDate.value); \n\t\t\t\t\t\t\n\t\t\t\t\t\tif (dt1==null) { \n\t\t\t\t\t\t\t//alert(\"dt1\");\n\n\t\t\t\t\t\t\talert(\"Invalid date format for Start date, valid format : MM/DD/YYYY\"); \n\t\t\t\t\t\t\ttheStartDate.value=theTodayStr;\n\t\t\t\t\t\t\tif(returnFlag){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar flag = false;\n\t\t\t\t\t\t\t\tflag = isValidDate(dt1,'Locale.US','/','Start Date', 'MM/DD/YYYY')\n\t\t\t\t\t\t\t\tif (!flag)\n\t\t\t\t\t\t\t\t\treturn flag\n\t\t\t\t\t\t\t\tflag = isValidDate(dt2,'Locale.US','/','End Date', 'MM/DD/YYYY')\n\t\t\t\t\t\t\t\tif (!flag)\n\t\t\t\t\t\t\t\t\treturn flag\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tvar dt_start1 =gfPop.theBeginDate;\n\t\t\t\t\t\t\t\tvar dt_start2=gfPop.theEndDate;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//alert(\"dt_start1 is : \"+ dt_start1);\n\t\t\t\t\t\t\t\tdate1=new Date(dt1[0],dt1[1]-1,dt1[2]);\n\t\t\t\t\t\t\t\tif(date1<dt_start1 || date1> dt_start2){\n\t\t\t\t\t\t\t\t\talert(\"Start date should not be earlier than \"+ dt_start1 + \" and later than \"+ dt_start2);\n\t\t\t\t\t\t\t\t\t//getElem(\"endDate\").value = theTodayStr;\n\t\t\t\t\t\t\t\t\ttheStartDate.value = theTodayStr;\n\t\t\t\t\t\t\t\t\tif(returnFlag){\n\t\t\t\t\t\t\t\t\t\treturn 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\t*/\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch(err) {\n\t\t\t\t\t\t\t\t//alert(\"caugth error\");\n\t\t\t\t\t\t\t\treturn true\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\tif (dt2==null) { \n\t\t\t\t\t\t\talert(\"dt2\");\n\t\t\t\t\t\t\talert(\"Invalid date format for End date, valid format : MM/DD/YYYY\");\n\t\t\t\t\t\t\ttheEndDate.value=theTodayStr;\n\t\t\t\t\t\t\tif(returnFlag){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar date2=new Date(dt2[0],dt2[1]-1,dt2[2]); //user entered value\n\t\t\t\t\t\t\t\tvar dt_updated ;\n\t\t\t\t\t\t\t\treturn isValidDate(dt2,'Locale.US','/','End Date', 'MM/DD/YYYY')\n\t\t\t\t\t\t\t\tdt_updated=gfPop.fParseInput(theStartDate.value);\n\t\t\t\t\t\t\t\tvar date_end1=new Date(dt_updated[0],dt_updated[1]-1,dt_updated[2]); // trying to get value considering start date field user entered\n\t\t\t\t\t\t\t\tvar date_end2=new Date(dt_updated[0]+2,dt_updated[1]-1,dt_updated[2]);// considering start date field userentry as above\n\t\t\t\t\t\t\t\tif( date2<date_end1 || date2> date_end2){\n\t\t\t\t\t\t\t\t\talert(\"End date should not be earlier than \"+ date_end1 + \" and no later than \"+ date_end2);\n\t\t\t\t\t\t\t\t\t\ttheEndDate.value = theStartDate.value;\n\t\t\t\t\t\t\t\t\tif(returnFlag){\n\t\t\t\t\t\t\t\t\treturn false;\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\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (err){\n\t\t\t\t\t\t\t\treturn true;\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}", "title": "" }, { "docid": "5d9f474d92171d1679e1503dc593b74a", "score": "0.6166492", "text": "function validateDate(fld, index)\n{\n\tvar oMultiDate = document.forms[0].item(fld);\t// the date input control\n\tvar nIndex = index;\n\n\tif(oMultiDate == null)\t//field not exist\n\t{\n\t\treturn true;\n\t}\n\n\tif(oMultiDate.length > 1) // multi\n\t{\n\t\toDate = oMultiDate[nIndex-1];\n\t}\n\telse\n\t{\n\t\toDate = oMultiDate;\n\t}\n\n\tif(oDate == null )\n\t{\n\t\treturn true;\n\t}\n\n\tvar sDate = oDate.value;\t\t\t\t// date in String\n\tif(sDate == \"\")\n\t{\n\t\treturn true;\n\t}\n\n\tif(!isDateString(sDate, \"-\"))\t//not validate date\n\t{\n\t\talert('无效日期格式,请按“年年年年-月月-日日”或“年年年年月月日日”格式输入。');\n\t\toDate.focus();\n\t\toDate.value = \"\";\n\t\treturn false;\n\t}\n\tif (sDate.length == 8)\n\t{\n\t\tsDate = sDate.substring(0, 4) + \"-\" + sDate.substring(4, 6) + \"-\" + sDate.substring(6, 8);\n\t}\n\toDate.value = sDate;\n\treturn true;\n}", "title": "" }, { "docid": "608ca0e441f99e0bf149701e09e99abd", "score": "0.6162717", "text": "initDatePicker() {\n\t\tconst field = this.input;\n\t\t// make sure it is a text input\n\t\tfield.type = 'text';\n\n\t\t// if touch device use default date picker\n\t\tif ( 'ontouchstart' in document.documentElement && __WEBPACK_IMPORTED_MODULE_0__utils_utils__[\"e\" /* mq */]( '(max-width:1024px)' ) ) {\n\t\t\tfield.type = 'date';\n\t\t\treturn;\n\t\t}\n\n\t\tconst setPicker = _ => {\n\t\t\tif ( field.isUpgraded ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst picker = new Pikaday( {\n\t\t\t\tfield: field,\n\t\t\t\tformat: 'MM/DD/YYYY',\n\t\t\t\tonSelect: function() {\n\t\t\t\t\tfield.value = this.getMoment().format( 'MM/DD/YYYY' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tfield.isUpgraded = true;\n\t\t};\n\n\t\tif ( typeof self.Pikaday === 'undefined' || !self.Pikaday ) {\n\t\t\t__WEBPACK_IMPORTED_MODULE_0__utils_utils__[\"d\" /* loadScript */]( SCRIPT_MOMENT )\n\t\t\t\t.then( _ => __WEBPACK_IMPORTED_MODULE_0__utils_utils__[\"d\" /* loadScript */]( SCRIPT_PIKADAY ) )\n\t\t\t\t.then( _ => setPicker() );\n\t\t}\n\t\telse {\n\t\t\tsetPicker();\n\t\t}\n\t}", "title": "" }, { "docid": "09ce158d02cc7661e6ada51abdfd713e", "score": "0.61593455", "text": "function Datepicker(){this._curInst=null;// The current instance in use\nthis._keyEvent=false;// If the last event was a key event\nthis._disabledInputs=[];// List of date picker inputs that have been disabled\nthis._datepickerShowing=false;// True if the popup picker is showing , false if not\nthis._inDialog=false;// True if showing within a \"dialog\", false if not\nthis._mainDivId=\"ui-datepicker-div\";// The ID of the main datepicker division\nthis._inlineClass=\"ui-datepicker-inline\";// The name of the inline marker class\nthis._appendClass=\"ui-datepicker-append\";// The name of the append marker class\nthis._triggerClass=\"ui-datepicker-trigger\";// The name of the trigger marker class\nthis._dialogClass=\"ui-datepicker-dialog\";// The name of the dialog marker class\nthis._disableClass=\"ui-datepicker-disabled\";// The name of the disabled covering marker class\nthis._unselectableClass=\"ui-datepicker-unselectable\";// The name of the unselectable cell marker class\nthis._currentClass=\"ui-datepicker-current-day\";// The name of the current day marker class\nthis._dayOverClass=\"ui-datepicker-days-cell-over\";// The name of the day hover marker class\nthis.regional=[];// Available regional settings, indexed by language code\nthis.regional[\"\"]={// Default regional settings\ncloseText:\"Done\",// Display text for close link\nprevText:\"Prev\",// Display text for previous month link\nnextText:\"Next\",// Display text for next month link\ncurrentText:\"Today\",// Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],// Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],// For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],// For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],// For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],// Column headings for days starting at Sunday\nweekHeader:\"Wk\",// Column header for week of the year\ndateFormat:\"mm/dd/yy\",// See format options on parseDate\nfirstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:false,// True if right-to-left language, false if left-to-right\nshowMonthAfterYear:false,// True if the year select precedes month, false for month then year\nyearSuffix:\"\"// Additional text to append to the year in the month headers\n};this._defaults={// Global defaults for all the date picker instances\nshowOn:\"focus\",// \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\",// Name of jQuery animation for popup\nshowOptions:{},// Options for enhanced animations\ndefaultDate:null,// Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\",// Display text following the input box, e.g. showing the format\nbuttonText:\"...\",// Text for trigger button\nbuttonImage:\"\",// URL for trigger button image\nbuttonImageOnly:false,// True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:false,// True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:false,// True if date formatting applied to prev/today/next links\ngotoCurrent:false,// True if today link goes back to current selection instead\nchangeMonth:false,// True if month can be selected directly, false if only prev/next\nchangeYear:false,// True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\",// Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:false,// True to show dates in other months, false to leave blank\nselectOtherMonths:false,// True to allow selection of dates in other months, false for unselectable\nshowWeek:false,// True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week,// How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\",// Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null,// The earliest selectable date, or null for no limit\nmaxDate:null,// The latest selectable date, or null for no limit\nduration:\"fast\",// Duration of display/closure\nbeforeShowDay:null,// Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null,// Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null,// Define a callback function when a date is selected\nonChangeMonthYear:null,// Define a callback function when the month or year is changed\nonClose:null,// Define a callback function when the datepicker is closed\nnumberOfMonths:1,// Number of months to show at a time\nshowCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1,// Number of months to step back/forward\nstepBigMonths:12,// Number of months to step back/forward for the big links\naltField:\"\",// Selector for an alternate field to store selected dates into\naltFormat:\"\",// The date format to use for the alternate field\nconstrainInput:true,// The input is constrained by the current date format\nshowButtonPanel:false,// True to show button panel, false to not show it\nautoSize:false,// True to size the input for the date format, false to leave as is\ndisabled:false// The initial disabled state\n};$.extend(this._defaults,this.regional[\"\"]);this.regional.en=$.extend(true,{},this.regional[\"\"]);this.regional[\"en-US\"]=$.extend(true,{},this.regional.en);this.dpDiv=datepicker_bindHover($(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));}", "title": "" }, { "docid": "0ffbcb7909eb7495caf480c81a94959a", "score": "0.615581", "text": "function dateSetup() {\n\t$('#add-date-input').click(addDatePicker);\n}", "title": "" }, { "docid": "ce73fcec4981475dfe13f3aae3c79390", "score": "0.61555964", "text": "function addDatePicker(){\n\t\t\n\t\tif (datefield.type != \"date\"){ \n\n\t\t\t$(\"#from\").datepicker();\n\t \t$(\"#to\").datepicker();\n\t\n\t\t}\n\t}", "title": "" }, { "docid": "07a7fe5bb5ed3110d6f9ec70178c7a0f", "score": "0.6154557", "text": "function birthdateValidation(){\n\n var birthValue = new Date(inputs.birthdate.value); // Cherche valeur dans input 'birthdate'\n \n var today = new Date(); // Date actuelle\n \n var currentTime = today.getTime(); // conversion en min\n \n var birthdayTime = birthValue.getTime();\n \n var age = (currentTime - birthdayTime)/31536000000; // calcul de l'âge \n\n if(inputs.birthdate.value === \"\"){\n alerts.birthdate.innerText = \"Merci d'entrer votre date de naissance\";\n event.preventDefault();\n return false;\n }\n else if(age >= 0 && age < 18){\n alerts.birthdate.innerText = \"Vous devez être majeur(e) pour pouvoir vous inscrire\";\n event.preventDefault();\n return false;\n }\n else if (age > 120) {\n alerts.birthdate.innerText = \"Vous êtes fossilisé(e) ? Rentrez une date valide ! \";\n event.preventDefault();\n return false;\n }\n else if(birthValue > today){\n alerts.birthdate.innerText = \"Vous ne pouvez pas être né(e) dans le futur ! \";\n event.preventDefault();\n return false;\n }\n else{\n alerts.birthdate.innerText = \"\";\n return true;\n }\n}", "title": "" }, { "docid": "e217c9a69f17435e80dab04b4c79d9df", "score": "0.61530715", "text": "function check_date_str(input_id,err_str_id,ret_val) {\n //\n // getting the input string from the element\n var input_str = trim(document.getElementById(input_id).value);\n var error = false;\n //\n if (input_str.match(/^\\d\\d\\d\\d-\\d\\d-\\d\\d\\s+\\d\\d\\:\\d\\d\\:\\d\\d$/)) {\n input_str = input_str.split(' ')[0];\n }\n //\n if (input_str.match(/^\\d\\d\\d\\d-\\d\\d-\\d\\d$/)) {\n var input_arr = input_str.split('-');\n var mon = parseInt(input_arr[1]);\n var day = parseInt(input_arr[2])\n if (mon == 0) {input_arr[1] = '01'}\n if (mon > 12) {input_arr[1] = '12'}\n if (day == 0) {input_arr[2] = '01'}\n if (day > 31) {input_arr[2] = '31'}\n //\n remove_class('invalid-field',input_id);\n document.getElementById(input_id).value = input_arr.join('-');\n // if an unhide element was provided making it invisible\n if (!!(err_str_id)) {\n add_class('hidden-elm',err_str_id)\n }\n }\n else {\n error = true\n add_class('invalid-field',input_id)\n // if an unhide element was provided making it visible\n if (!!(err_str_id)) {\n remove_class('hidden-elm',err_str_id)\n }\n }\n // if ret_val is true returning the error\n if (ret_val == true) { return error;}\n}", "title": "" }, { "docid": "a55c66c83b6e77b0a4534c7543199c4d", "score": "0.6151937", "text": "function attachDatePickers() {\n\t$(\"input[type=text][rel$='date']\").each(function() {\n\t\t$(this).datepicker({\n\t\t\tchangeMonth : true,\n\t\t\tchangeYear : true,\n\t\t\t/*numberOfMonths: 3,*/\n\t\t\tshowButtonPanel: true,\n\t\t\tdateFormat : 'dd/mm/yy',\n\t\t\tyearRange : 'c-80:c+20',\n\t\t\taltField\t: '#' + $(this).attr('name') + 'Example',\n\t\t\taltFormat : 'DD, d MM, yy'\n\t\t});\n\t});\n}", "title": "" }, { "docid": "4c32f28b3ffeaa797db002b5a13da65d", "score": "0.61447656", "text": "function fncTaoSuKienEdit() {\n var ngayBD = $('#txtNgayDangKy');\n var gio_start = $('#txtTuGio');\n var ngayKT = $('#txtDenNgay');\n var gio_end = $('#txtDenGio');\n var timeSelect = jQuery.parseJSON('['+ Encoder.htmlDecode(jsTime) + ']');\n //tuy chinh cho gio\n var chosenDrop = $(\".chosen-drop-grid\").css({\n \"width\": 70,\n 'display': 'none'\n });\n var lstChoice = $(\"<ul class='chosen-results'></ul>\");\n $.each(timeSelect, function () {\n lstChoice.append('<li class=\"active-result\" data-option-array-index=\"' + this.id + '\">' + this.value + '</li>');\n });\n chosenDrop.append(lstChoice);\n\n ngayBD.datepicker({\n dateFormat: \"dd/mm/yy\",\n defaultDate: new Date(),\n dayNamesShort: $.datepicker.regional.vi.dayNamesShort,\n dayNames: $.datepicker.regional.vi.dayNames,\n monthNamesShort: $.datepicker.regional.vi.monthNamesShort,\n monthNames: $.datepicker.regional.vi.monthNames,\n showAnim: \"slideDown\",\n firstDay: 1 // Start with Monday\n });\n if (CheckNullOrEmpty(ngayBD.val())) {\n ngayBD.datepicker(\"setDate\", new Date());\n }\n ngayBD.change(function () {\n if (!check_date(this))\n ngayBD.datepicker(\"setDate\", new Date());\n if (check_over_date($(this).val(), ngayKT.val())) {\n ngayKT.datepicker(\"setDate\", $(this).val());\n }\n });\n\n ngayKT.datepicker({\n dateFormat: \"dd/mm/yy\",\n defaultDate: new Date(),\n dayNamesShort: $.datepicker.regional.vi.dayNamesShort,\n dayNames: $.datepicker.regional.vi.dayNames,\n monthNamesShort: $.datepicker.regional.vi.monthNamesShort,\n monthNames: $.datepicker.regional.vi.monthNames,\n showAnim: \"slideDown\",\n firstDay: 1 // Start with Monday\n });\n if (CheckNullOrEmpty(ngayKT.val())) {\n ngayKT.datepicker(\"setDate\", new Date());\n }\n ngayKT.change(function () {\n if (!check_date(this))\n ngayKT.datepicker(\"setDate\", new Date());\n if (check_over_date(ngayBD.val(), $(this).val())) {\n ngayBD.datepicker(\"setDate\", $(this).val());\n }\n });\n\n// //thoi gian bat dau\n gio_start.click(function (e) {\n $(this).focus();\n fncPostionDropDown(chosenDrop, gio_start);\n fncShowDropDown();\n fncEventListChoice(lstChoice, chosenDrop, gio_start);\n\n });\n gio_start.change(function () {\n fncResetNgayGioKetThuc(false);\n if (CheckNullOrEmpty($(\"#txtNgay_start\").val()))\n fncResetNgayGioKetThuc(true);\n });\n gio_start.keydown(function (evt) {\n fncPostionDropDown(chosenDrop, gio_start);\n fncShowDropDown();\n var stroke;\n stroke = evt.keyCode;\n switch (stroke) {\n case 8:\n //keyboard backspace \n break;\n case 13:\n ////keyboard enter\n //$(e).attr('selectedid', lstChoice.find('.highlighted').attr('data-option-array-index'));\n //fncUpdateValueSelectedToGrid();\n break;\n case 38:\n //keyboard arrow up\n fncSetHighlightedSelection(lstChoice, null, \"up\");\n evt.preventDefault();\n break;\n case 40:\n //keyboard arrow down \n fncSetHighlightedSelection(lstChoice, null, \"down\");\n evt.preventDefault();\n break;\n }\n });\n gio_start.keyup(function (e) {\n //kiem tra phim muoi ten\n var stroke, checkKeyArrow;\n checkKeyArrow = false;\n stroke = e.keyCode;\n switch (stroke) {\n case 38://keyboard arrow up\n case 40://keyboard arrow down \n checkKeyArrow = true;\n break;\n }\n if (!checkKeyArrow) {\n if (!CheckNullOrEmpty($(this).val())) {\n var searchText = locdau($(this).val(), false).replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\n var escapedSearchText = locdau($(this).val(), false);\n var matcher = new RegExp(searchText, \"i\");\n //tim chuoi va tra ve danh sach\n var a = $.grep(timeSelect, function (item, index) {\n return matcher.test(locdau(Encoder.htmlDecode(item.value)));\n });\n if (a.length > 0) {\n lstChoice.html('');\n var firstHighlighted = true;\n $.each(a, function (stt) {\n var valueItem = Encoder.htmlDecode(this.value);\n var startpos = locdau(valueItem, false).search(matcher);\n if (this.id !== \"-1\") {\n var text = valueItem.substr(0, startpos + escapedSearchText.length) + '</em>' + valueItem.substr(startpos + escapedSearchText.length);\n var search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);\n if (firstHighlighted) {\n firstHighlighted = false;\n lstChoice.append('<li class=\"active-result highlighted\" data-option-array-index=\"' + this.id + '\">' + search_text + '</li>');\n }\n else\n lstChoice.append('<li class=\"active-result\" data-option-array-index=\"' + this.id + '\">' + search_text + '</li>');\n }\n });\n }\n else {\n lstChoice.html('');\n lstChoice.append('<li class=\"active-result\" data-option-array-index=\"\">' + $(this).val() + '</li>');\n }\n fncEventListChoice(lstChoice, chosenDrop, gio_start);\n }\n }\n });\n// //thoi gian ket thuc\n gio_end.click(function () {\n $(this).focus();\n fncPostionDropDown(chosenDrop, gio_end);\n fncShowDropDown();\n fncEventListChoice(lstChoice, chosenDrop, gio_end);\n });\n gio_end.keydown(function (evt) {\n fncPostionDropDown(chosenDrop, gio_end);\n fncShowDropDown(evt);\n var stroke;\n stroke = evt.keyCode;\n switch (stroke) {\n case 8:\n //keyboard backspace \n break;\n case 13:\n ////keyboard enter\n //$(e).attr('selectedid', lstChoice.find('.highlighted').attr('data-option-array-index'));\n //fncUpdateValueSelectedToGrid();\n break;\n case 38:\n //keyboard arrow up\n fncSetHighlightedSelection(lstChoice, null, \"up\");\n evt.preventDefault();\n break;\n case 40:\n //keyboard arrow down \n fncSetHighlightedSelection(lstChoice, null, \"down\");\n evt.preventDefault();\n break;\n }\n });\n gio_end.keyup(function (e) {\n if (!CheckNullOrEmpty($(this).val())) {\n var searchText = locdau($(this).val(), false).replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\n var escapedSearchText = locdau($(this).val(), false);\n var matcher = new RegExp(searchText, \"i\");\n //tim chuoi va tra ve danh sach\n var a = $.grep(timeSelect, function (item, index) {\n return matcher.test(locdau(Encoder.htmlDecode(item.value)));\n });\n if (a.length > 0) {\n lstChoice.html('');\n var firstHighlighted = true;\n $.each(a, function (stt) {\n var valueItem = Encoder.htmlDecode(this.value);\n var startpos = locdau(valueItem, false).search(matcher);\n if (this.id !== \"-1\") {\n var text = valueItem.substr(0, startpos + escapedSearchText.length) + '</em>' + valueItem.substr(startpos + escapedSearchText.length);\n var search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);\n if (firstHighlighted) {\n firstHighlighted = false;\n lstChoice.append('<li class=\"active-result highlighted\" data-option-array-index=\"' + this.id + '\">' + search_text + '</li>');\n }\n else\n lstChoice.append('<li class=\"active-result\" data-option-array-index=\"' + this.id + '\">' + search_text + '</li>');\n }\n });\n }\n else {\n lstChoice.html('');\n lstChoice.append('<li class=\"active-result\" data-option-array-index=\"\">' + $(this).val() + '</li>');\n }\n fncEventListChoice(lstChoice, chosenDrop, gio_end);\n }\n });\n\n funcMfUpload($('#upload'), \"ajax/giaoviec/upload.ashx\");\n\n $('#btnSave').click(function (e) {\n var DataJson = \"\";\n var fileNames = \"\";\n var isHoanThanh = $('#chkHoanThanh').is(':checked') == true ? \"1\" : \"0\";\n if ($('.fileUploadQueueItem').length > 0)\n fileNames = $('.fileUploadQueueItem .fileName').map(function () { return $(this).html().trim(); }).get().join(',');\n\n var strTypeInsert = \"insert\";\n if (!CheckNullOrEmpty($('#hdMa').val()))\n strTypeInsert = \"update\";\n\n DataJson += \"{\";\n DataJson += \"'type':'\" + strTypeInsert + \"',\";\n DataJson += \"'macongviec':'\" + Encoder.htmlEncode($('#hdMa').val()) + \"',\";\n DataJson += \"'tieude':'\" + Encoder.htmlEncode($('#tieude').val()) + \"',\";\n DataJson += \"'ngaybatdau':'\" + Encoder.htmlEncode($('#ngaybatdau').val()) + \"',\";\n DataJson += \"'giobatdau':'\" + Encoder.htmlEncode($('#giobatdau').val()) + \"',\";\n DataJson += \"'ngayketthuc':'\" + Encoder.htmlEncode($('#ngayketthuc').val()) + \"',\";\n DataJson += \"'gioketthuc':'\" + Encoder.htmlEncode($('#gioketthuc').val()) + \"',\";\n DataJson += \"'xulychinh':'\" + $('#xulychinh').val() + \"',\";\n DataJson += \"'phoihopxuly':'\" + $('#phoihopxuly').val() + \"',\";\n DataJson += \"'theodoi':'\" + $('#theodoi').val() + \"',\";\n DataJson += \"'hoanthanh':'\" + isHoanThanh + \"',\";\n DataJson += \"'taptin':'\" + fileNames + \"',\";\n DataJson += \"'ghichu':'\" + Encoder.htmlEncode($('#ghichu').val()) + \"'\";\n DataJson += \"}\";\n $('#hdMa').val('');\n fncRequestToServer(DataJson);\n });\n $('#btnCancel').click(function (e) {\n $('.divFormEdit').html('');\n fncLoadFormEdit();\n });\n\n}", "title": "" }, { "docid": "40dce04d4b21cc90c64123e040ffa0ed", "score": "0.61445796", "text": "function fn_checkDatePicker(dtpFrom, dtpTo, type) {\r\n\t\tvar today = CB.today();\r\n\t switch (type) {\r\n\t case \"W\" :\r\n\t dtpFrom.cbVal(CBDate.dateAdd(\"d\", -7, today, CB.dateformat(\"today\")));//\"yyyymmdd\"));\r\n\t dtpTo.cbVal(CBDate.dateAdd(\"d\", -1, today, CB.dateformat(\"today\")));//\"yyyymmdd\"));\r\n\t break;\r\n\t case \"M\" :\r\n\t dtpFrom.cbVal(CBDate.dateAdd(\"m\", -1, today, CB.dateformat(\"today\")));//\"yyyymmdd\"));\r\n\t dtpTo.cbVal(CBDate.dateAdd(\"d\", -1, today, CB.dateformat(\"today\")));//\"yyyymmdd\"));\r\n\t break;\r\n\t default :\r\n\t CBMsg.error(cb.locMessage(\"msg.295\", \"You entered a wrong information.\"));\r\n\t } \r\n\t}", "title": "" }, { "docid": "7074133705826e6e66fae9e76a491cc1", "score": "0.61430776", "text": "function validateDate(dateObj)\n{\n\tvar errorMsg = 'none';\n\terrorMsg = getDateErrorMessage(dateObj);\n\tif(errorMsg != 'none')\n\t{\n\t\talert(errorMsg);\n\t\tdateObj.value = \"\";\n\t\tdateObj.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "ae8440825ddfe5c4fc914f5052e86403", "score": "0.61407965", "text": "function report3Check(){\n if(isNull(document.getElementById('datepicker4').value)) \n\t{\n\t\talert(\"Please select the From date.\");\n\t\tdocument.getElementById('datepicker4').focus();\n\t\treturn false;\n\t}\t\n if(isNull(document.getElementById('datepicker5').value)) \n\t{\n\t\talert(\"Please select the To date.\");\n\t\tdocument.getElementById('datepicker5').focus();\n\t\treturn false;\n\t}\n if(document.getElementById('datepicker4').value > document.getElementById('datepicker5').value) \n\t{\n\t\talert(\"From date should be greater then to date.\");\n\t\tdocument.getElementById('datepicker4').focus();\n\t\treturn false;\n\t}\n\treturn true;\t\n}", "title": "" }, { "docid": "aa5d008bf2f7e0d8296cfd9aca9c7289", "score": "0.61337024", "text": "function setDatepickerDate() {\n calcTimespan()\n blurDatePicker()\n}", "title": "" }, { "docid": "aa5d008bf2f7e0d8296cfd9aca9c7289", "score": "0.61337024", "text": "function setDatepickerDate() {\n calcTimespan()\n blurDatePicker()\n}", "title": "" }, { "docid": "3c3a70bc8377cd86241991ea858361fe", "score": "0.61281323", "text": "function validateDateSelf(stringHolder) {\r\n\r\n // get the value\r\n var stringValue = new String(stringHolder);\r\n\t\t\r\n // test it\r\n if ( stringValue != \"\" ) { \r\n\r\n var stringTrue = new String(isDateString(stringValue));\r\n if ( stringTrue == \"false\" ) {\r\n alert(\"You have entered an invalid date of birth, Please re-enter using the correct date format (ex. 02/02/1933). Be sure to use 2 digits for month, 2 digits for date, and 4 digits for year. Please use the '/ ' key to separate month, date, and year.\");\r\n document.questions.elements[2].focus();\r\n } \r\n }\r\n}", "title": "" }, { "docid": "8d6358dee33dc9a19cc525876db504a5", "score": "0.6126699", "text": "function report1Check(){\n if(isNull(document.getElementById('datepicker').value)) \n\t{\n\t\talert(\"Please select the From date.\");\n\t\tdocument.getElementById('datepicker').focus();\n\t\treturn false;\n\t}\t\n if(isNull(document.getElementById('datepicker1').value)) \n\t{\n\t\talert(\"Please select the To date.\");\n\t\tdocument.getElementById('datepicker1').focus();\n\t\treturn false;\n\t}\n if(document.getElementById('datepicker').value > document.getElementById('datepicker1').value) \n\t{\n\t\talert(\"From date should be greater then to date.\");\n\t\tdocument.getElementById('datepicker').focus();\n\t\treturn false;\n\t}\n\treturn true;\t\n}", "title": "" }, { "docid": "9523315fd466aadfc5138cf1818d77ed", "score": "0.61243474", "text": "function validateDate(fld)\n{\n\tvar oDate = document.forms[0].item(fld);\t// the date input control\n\tif(oDate == null)\n\t{\n\t\treturn true;\n\t}\n\tvar sDate = oDate.value;\t\t\t\t// date in String\n\tif(sDate == \"\")\n\t{\n\t\treturn true;\n\t}\n\n\tif(!isDateString(sDate, \"-\"))\t//not validate date\n\t{\n\t\talert('无效日期格式,请按“年年年年-月月-日日”或“年年年年月月日日”格式输入。');\n\t\toDate.value = \"\";\n\t\toDate.focus();\n\t\treturn false;\n\t}\n\tif (sDate.length == 8)\n\t{\n\t\tsDate = sDate.substring(0, 4) + \"-\" + sDate.substring(4, 6) + \"-\" + sDate.substring(6, 8);\n\t}\n\toDate.value = sDate;\n\treturn true;\n}", "title": "" }, { "docid": "03fe1dcf7c7664d3e5b0d776f31a80e4", "score": "0.61238724", "text": "function checkValidDates(objNameFrom,objNameTo)\r\n{\r\n\tvar datefieldFrom = objNameFrom;\r\n\tvar datefieldTo = objNameTo;\r\n\t\r\n\tif (chkValidDates(objNameFrom,objNameTo) == false)\r\n\t {\r\n\t datefieldTo.select();\r\n\t alert(\"That date is invalid!!!. Please try again.\");\r\n\t datefieldTo.focus();\r\n\t return false;\r\n\t }\r\n\telse {\r\n\t\treturn true;\r\n }\r\n\r\n}", "title": "" }, { "docid": "a2d2903c8ab46a88ce0c7935827815ec", "score": "0.6120356", "text": "function invcSordDateTempCont() {\r\n\tvDynm.ob.invc.sordTempNo = document.querySelector('input[name=\"sordTempSelected\"]:checked').value;\t\r\n\tvDynm.ob.invc.sordDelDate = document.getElementById(\"i_sordDateSelected\").value;\r\n\t\r\n\tvar xAry = vDynm.ob.invc.sordDelDate.split('-');\r\n\tvDynm.ob.invc.misc2 = (xAry[1]+xAry[2]+xAry[0].substring(2))*1;\r\n\r\n\r\n\tvar dd = new Date(vDynm.ob.invc.sordDelDate);\r\n\tvar cd = new Date();\r\n\tcd.setHours(cd.getHours() - 24);\r\n\r\n\tif (dd > cd) {\r\n\t\tboxChange(5202);\r\n\t} else {\r\n\t\tdocument.getElementById(\"i_SectSubHdr\").innerHTML = \"Enter Valid Future Date\";\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "9bcff63b179f0e5e0c407266c673c527", "score": "0.61148", "text": "function runFinalDobChecker() {\n var dobEntryItem = $('#dob-input');\n var dobRegExp = /^\\d{4}-\\d{2}-\\d{2}$/;\n return runValidator(dobEntryItem, dobRegExp);\n}", "title": "" }, { "docid": "1ea6387f664c93850c50a467935af409", "score": "0.611313", "text": "function setDate(){\n var d = element(\"date\");\n var m = element(\"month\");\n var y = element(\"year\");\n \n d.options[29].disabled = false ;\n d.options[30].disabled = false ;\n d.options[31].disabled = false ;\n\n if(m.value.match(/(3|5|8|10)/)){\n d.options[31].disabled = true ;\n if(d.value === \"31\"){\n d.selectedIndex = 0;\n }\n }\n else if(m.value === \"1\"){\n if(y.value === \"\"){\n d.options[29].disabled = true ;\n d.options[30].disabled = true ;\n d.options[31].disabled = true ;\n if(d.value === \"29\"){\n d.selectedIndex = 0;\n }\n }\n else if(parseInt(y.value)%4===0){\n d.options[30].disabled = true ;\n d.options[31].disabled = true ;\n }\n else {\n d.options[29].disabled = true ;\n d.options[30].disabled = true ;\n d.options[31].disabled = true ;\n if(d.value === \"29\"){\n d.selectedIndex = 0;\n }\n }\n \n if(d.value===\"31\" || d.value===\"30\"){\n d.selectedIndex = 0;\n }\n }\n}", "title": "" }, { "docid": "c5960180a6c9195c7353bd1527db446c", "score": "0.61006737", "text": "function validateDate(x,y,z){\n \tvar yyyy=x.value;\n\tvar mm=y.value;\n\tvar dd=z.value;\n\tvar ed=yyyy+\"-\"+mm+\"-\"+dd;\n\n var pattern = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;\n if(!pattern.test(ed)) \n alert(\"Invalid Format\");\n }", "title": "" }, { "docid": "833880c9186da87dc5335c0fa4e4a97b", "score": "0.6094914", "text": "function initScheduleDatepicker() {\n if ($('.schedule-date-input-field').length) {\n $('.schedule-date-input-field').datepicker({\n minDate: 0,\n yearRange: '+0:+1',\n changeYear: true,\n beforeShow: function() {\n $('#blackout-div').show();\n $('#blackout-div').addClass('blacked-out');\n },\n onClose: function() {\n $('#blackout-div').removeClass('blacked-out');\n $('#blackout-div').hide();\n }\n });\n }\n}", "title": "" }, { "docid": "10c5c8b35f9d536e19854eedbb752e69", "score": "0.6094443", "text": "function initDatePicker(){\n\tvar nowTemp = new Date();\n var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);\n\n\tvar eventDate = $('#date-event').datepicker({\n\t\tformat:\"yyyy-mm-dd\",\n\t\tonRender: function(date) {\n\t\t\treturn date.valueOf() < now.valueOf() ? 'disabled' : '';\n\t\t}\n\t}).on('changeDate', function(ev) {\n\t\teventDate.hide();\n\t\t$('#dpd2')[0].focus();\n\t}).data('datepicker');\n\t\n\t\n}", "title": "" }, { "docid": "39da29801116ac434c7594e2849317e0", "score": "0.60853064", "text": "function validateWeekdayForm(weekday, id = \"\") {\n //Ensures only correct values can be entered.\n $(`#${weekday}-hr-${id}`).keydown(function (event) {\n const keyPress = event.which - 48;\n const val = parseInt($(`#${weekday}-hr-${id}`).val());\n const newVal = (Number.isNaN(val) ? 0 : val) * 10 + keyPress;\n //Allows for tab, backspace and left and right arrows.\n if (keyPress == -40 || keyPress == -39 || keyPress == -11 || keyPress == -9)\n return true;\n //Gets rid of repeated zero presses.\n if (\n keyPress == 0 &&\n $(`#${weekday}-hr-${id}`).val().length > 0 &&\n val == 0\n ) {\n return false;\n }\n if (keyPress < 0 || keyPress > 9 || newVal < 0 || newVal > 23) {\n return false;\n }\n });\n $(`#${weekday}-min-${id}`).keydown(function (event) {\n const keyPress = event.which - 48;\n const val = parseInt($(`#${weekday}-min-${id}`).val());\n const newVal = (Number.isNaN(val) ? 0 : val) * 10 + keyPress;\n //-40 is backspace.\n if (keyPress == -40 || keyPress == -39 || keyPress == -11 || keyPress == -9)\n return true;\n //Gets rid of repeated zero presses.\n if (\n keyPress == 0 &&\n $(`#${weekday}-min-${id}`).val().length > 0 &&\n val == 0\n ) {\n return false;\n }\n if (keyPress < 0 || keyPress > 9 || newVal < 0 || newVal > 59) {\n return false;\n }\n });\n\n //Blocked checkbox details.\n $(`#${weekday}-blocked-${id}`).click(function () {\n const block = $(`#${weekday}-blocked-${id}`).attr('aria-pressed') == 'true';\n $(`#${weekday}-hr-${id}`).prop(\"disabled\", !block);\n $(`#${weekday}-min-${id}`).prop(\"disabled\", !block);\n });\n}", "title": "" }, { "docid": "95dee4f80ae32250d8da2b17031854d2", "score": "0.6079475", "text": "function validateDate() {\n\tvar ysel = document.getElementsByName(\"year\")[0],\n msel = document.getElementsByName(\"month\")[0],\n dsel = document.getElementsByName(\"day\")[0];\n\tfor (var i = 2016; i <= 2030; i++) {\n\t var opt = new Option();\n\t opt.value = opt.text = i;\n\t ysel.add(opt);\n\t}\n\tysel.addEventListener(\"change\", validate_date);\n\tmsel.addEventListener(\"change\", validate_date);\n}", "title": "" }, { "docid": "626f03e912ba02cc7c6a9c10bb1f4776", "score": "0.6077275", "text": "function datepickerValidate(formId) {\n let form;\n if (formId == null) {\n form = $(\"form\");\n } else {\n form = $(\"#\" + formId);\n }\n\n let datepickerList = form.find(\".datepicker\"); // get all datepicker from the form\n\n form.submit(function() {\n let isValid = true;\n datepickerList.each(function( index ) {\n if (checkDate($(this)) == false) {\n isValid = false;\n }\n });\n return isValid;\n });\n\n datepickerList.each(function( index ) {\n $(this).change(function() {\n checkDate($(this));\n });\n });\n}", "title": "" }, { "docid": "f67b3c4e41f7b2cfa57e80c3ed6c3a56", "score": "0.6076752", "text": "function CheckSubmitToCustomer() {\n\t\n\tvar birthday = new Date(document.getElementById('datepicker').value.split(\"/\")[2]-543+\"-\"+document.getElementById('datepicker').value.split(\"/\")[1]+\"-\"+document.getElementById('datepicker').value.split(\"/\")[0]);\n\tvar birthday2 = new Date();\n\tbirthday2.setFullYear(new Date().getFullYear()-15);\n\t\n\t\n\tif (document.getElementById(\"username\").value ==\"\") {\n\t\tdocument.getElementById(\"username\").style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'ชื่อผู้ใช้งาน' !!\" );\n\t\tdocument.getElementById(\"username\").focus();\n\t\t return false;\n\t}else if(document.getElementById('password').value == \"\"){\n\t\tdocument.getElementById('password').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'รหัสผ่าน' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"password\").focus();\n\t\t return false;\n\t}else if(document.getElementById('passwordconfirm').value == \"\"){\n\t\tdocument.getElementById('passwordconfirm').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'ยืนยันรหัสผ่าน' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"passwordconfirm\").focus();\n\t\t return false;\n\t}else if(document.getElementById('fname').value == \"\"){\n\t\tdocument.getElementById('fname').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'ชื่อจริง ' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"fname\").focus();\n\t\t return false;\n\t}else if(document.getElementById('lname').value == \"\"){\n\t\tdocument.getElementById('lname').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'นามสกุล' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"lname\").focus();\n\t\t return false;\n\t}else if(document.getElementById('datepicker').value ==\"\"){\n\t\tdocument.getElementById('datepicker').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณาเลือก 'วัน/เดือน/ปีที่เกิด' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"datepicker\").focus();\n\t\t return false;\n\t}else if(birthday.getTime() > birthday2.getTime()){\n\t\tdocument.getElementById('datepicker').style.border = \"thick solid #ed3a14\";\n\t\talert( \"อายุผู้สมัครคือ 15 ปีขึ้นไป !!\" );\n\t\tdocument.getElementById(\"datepicker\").focus();\n\t\t return false;\n\t}else if(document.getElementById('tel').value == \"\"){\n\t\tdocument.getElementById('tel').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'เบอร์โทรศัพท์' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"tel\").focus();\n\t\t return false;\n\t}else if(document.getElementById('email').value == \"\"){\n\t\tdocument.getElementById('email').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'อีเมล์' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"email\").focus();\n\t\t return false;\n\t}else if(document.getElementById('address').value == \"\"){\n\t\tdocument.getElementById('address').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'ที่อยู่' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"address\").focus();\n\t\t return false;\n\t}else if(document.getElementById('subDistrict').value == \"\"){\n\t\tdocument.getElementById('subDistrict').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'ตำบล/แขวง ' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"subDistrict\").focus();\n\t\t return false;\n\t}else if(document.getElementById('district').value == \"\"){\n\t\tdocument.getElementById('district').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'อำเภอ/เขต ' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"district\").focus();\n\t\t return false;\n\t}else if(document.getElementById('province').value == \"\"){\n\t\tdocument.getElementById('province').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'จังหวัด ' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"province\").focus();\n\t\t return false;\n\t}else if(document.getElementById('postcode').value == \"\"){\n\t\tdocument.getElementById('postcode').style.border = \"thick solid #ed3a14\";\n\t\talert( \"กรุณากรอก 'รหัสไปษณีย์ ' ของผู้ใช้งาน !!\" );\n\t\tdocument.getElementById(\"postcode\").focus();\n\t\t return false;\n\t}else{\n\t\talert( \"ท่านได้ตรวจสอบขอมูลละเอียดดีแล้ว ยืนยันการลงทะเบียนหรือไม่ ?\" );\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "9dc0ab6343a175347642847abff8503e", "score": "0.6072539", "text": "function validateDate(x,y,z){\n \tvar yyyy=z.value;\n\tvar mm=y.value;\n\tvar dd=x.value;\n\tvar ed=dd+\"/\"+mm+\"/\"+yyy;\n\n var pattern = /^[0-9]{2}-[0-9]{2}-[0-9]{4}$/;\n if(!pattern.test(ed)) \n alert(\"Invalid Format\");\n }", "title": "" }, { "docid": "84009d5aad412488204721c1bf7e7309", "score": "0.60697454", "text": "function setValid(date) {\n\t\t\tthat.$target.removeClass(\"error\").removeAttr(\"aria-invalid\");\n\t\t\t$(\"#date-error\").addClass(\"hidden\").html(\"\");\n\t\t\t\n\t\t}", "title": "" }, { "docid": "2158e3883f52c571d4ec6e9beb26163f", "score": "0.6066933", "text": "function checkdate(input) {\n var validformat = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n var returnval = true;\n if (!validformat.test(input)) {\n returnval = false;\n alert(\"Invalid Date Format. Please correct and submit again.\");\n return false;\n }\n else {\n var monthfield = input.split(\"/\")[0];\n var dayfield = input.split(\"/\")[1];\n var yearfield = input.split(\"/\")[2];\n var dayobj = new Date(yearfield, monthfield - 1, dayfield);\n if ((dayobj.getMonth() + 1 != monthfield) || (dayobj.getDate() != dayfield) || (dayobj.getFullYear() != yearfield)) {\n returnval = false;\n alert(\"Invalid Day, Month, or Year range detected. Please correct and submit again.\");\n return false;\n }\n }\n return returnval;\n}", "title": "" }, { "docid": "b42276f1a4e62809974ebd28aa062a97", "score": "0.6050138", "text": "function dateValidation(inpDate)\n{\tvar mm,dd,yy;\n\tvar dateVal = inpDate;\n\tvar valid=\"ABCDEFGHIJLMNOPRSTUVY0123456789-\";\n\t\n\tif\t(dateVal.length == 0 ) return \"\";\n\tif\t(dateVal.length > 11)\n\t\t{\talert (\"FORMAT should be DDMMYYYY or DDMMYY\");\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\tfor (var i=0; i<dateVal.length; i++)\n\t\t{\tif\t(valid.indexOf(dateVal.charAt(i)) == -1)\n\t\t\t\t{\talert(\"INVALID FORMAT. Allowed characters are 'ABCDEFGHIJLMNOPRSTUVY, 0-9 , - '\");\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t}\n\t\t\n//Check for length of date field = 11 -------------------------------------------------------\n\tif\t(dateVal.length == 11)\n\t\t{\tif\t((isNaN(dateVal)) && (dateVal.charAt(2) == dateVal.charAt(6)))\n\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\tmm = dateVal.substring(3,6);\n\t\t\t\t\tswitch (mm.toUpperCase())\n\t\t\t\t\t\t{\tcase \"JAN\" : mm = \"01\"; break;\n\t\t\t\t\t\t\tcase \"FEB\" : mm = \"02\"; break;\n\t\t\t\t\t\t\tcase \"MAR\" : mm = \"03\"; break;\n\t\t\t\t\t\t\tcase \"APR\" : mm = \"04\"; break;\n\t\t\t\t\t\t\tcase \"MAY\" : mm = \"05\"; break;\n\t\t\t\t\t\t\tcase \"JUN\" : mm = \"06\"; break;\n\t\t\t\t\t\t\tcase \"JUL\" : mm = \"07\"; break;\n\t\t\t\t\t\t\tcase \"AUG\" : mm = \"08\"; break;\n\t\t\t\t\t\t\tcase \"SEP\" : mm = \"09\"; break;\n\t\t\t\t\t\t\tcase \"OCT\" : mm = \"10\"; break;\n\t\t\t\t\t\t\tcase \"NOV\" : mm = \"11\"; break;\n\t\t\t\t\t\t\tcase \"DEC\" : mm = \"12\"; break;\n\t\t\t\t\t\t\tdefault : mm = \"00\"; break;\n\t\t\t\t\t\t}\n\t\t\t\t\tyy = dateVal.substring(7,11);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\talert(\"INVALID FORMAT. 11 character entry has to be ' dd-mmm-yyyy '\");\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t}\n\n//Check for length of date field = 10 -------------------------------------------------------\n\telse if\t(dateVal.length == 10)\n\t\t{\tif\t(isNaN(dateVal))\n\t\t\t\t{\tif ((dateVal.charAt(2) == \"-\") && (dateVal.charAt(5) == \"-\"))\n\t\t\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\t\t\tmm = dateVal.substring(3,5);\n\t\t\t\t\t\t\tyy = dateVal.substring(6,10);\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t{\talert(\"INVALID FORMAT. Allowed separator is ' - '. Month/Date can't be single character\");\n\t\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\talert(\"INVALID FORMAT. 10 character entry has to be ' dd-mm-yyyy '\");\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t}\n\n\t\t\n//Check for length of date field = 8 --------------------------------------------------------\n\telse if\t(dateVal.length == 8)\n\t\t{\tif\t(isNaN(dateVal))\n\t\t\t\t{\tif ((dateVal.charAt(2) == \"-\") && (dateVal.charAt(5) == \"-\"))\n\t\t\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\t\t\tmm = dateVal.substring(3,5);\n\t\t\t\t\t\t\tyy = dateVal.substring(6,8);\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t{\talert(\"INVALID FORMAT. Allowed separator is ' - '. Month/Date can't be single character\");\n\t\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\tmm = dateVal.substring(2,4);\n\t\t\t\t\tyy = dateVal.substring(4,8);\n\t\t\t\t}\n\t\t}\n\n//Check for length of date field = 6 --------------------------------------------------------\n\telse if\t(dateVal.length == 6)\n\t\t{\tif\t(isNaN(dateVal))\n\t\t\t\t{\talert(\"INVALID FORMAT. 6 character entry has to be ' ddmmyy '\");\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\tmm = dateVal.substring(2,4);\n\t\t\t\t\tyy = dateVal.substring(4,6);\n\t\t\t\t}\n\t\t}\n\n//Format ddmmyyyy and length of date field = 5 ----------------------------------------------\n\telse if\t(dateVal.length == 5)\n\t\t{\tif\t((isNaN(dateVal)) && (dateVal.charAt(2) == '-'))\n\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\tmm = dateVal.substring(3,5);\n\t\t\t\t\tyy = 0;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\talert(\"INVALID FORMAT. 5 character entry has to be ' dd-mm '\");\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t}\n\n//Format ddmmyyyy and length of date field = 4 ----------------------------------------------\n\telse if\t(dateVal.length == 4)\n\t\t{\tif\t(isNaN(dateVal))\n\t\t\t\t{\talert(\"INVALID FORMAT. 4 character entry has to be 'ddmm'\");\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\tdd = dateVal.substring(0,2);\n\t\t\t\t\tmm = dateVal.substring(2,4);\n\t\t\t\t\tyy = 0;\n\t\t\t\t}\n\t\t}\n\n//If all the above formats with chars -11,10,6,5,4 not true then pop an error message-----------\n\telse \n\t\t{\talert (\"INVALID FORMAT. Allowed no. of characters are 11,10,8,6,5,4\");\n\t\t\treturn \"\";\n\t\t}\n\n//Individual validation for date,month and year ---------------------------------------------\n\tif\t((isNaN(dd)) || (Math.abs(dd) != dd))\n\t\t{\talert(\" ' \"+ dd + \" ' IS AN INVALID DATE\");\n\t\t\treturn \"\";\n\t\t}\n\tif\t((isNaN(mm)) || (Math.abs(mm) != mm))\n\t\t{\talert(\" ' \"+ mm + \" ' IS AN INVALID MONTH\");\n\t\t\treturn \"\";\n\t\t}\t\n\tif\t((isNaN(yy)) || (Math.abs(yy) != yy))\n\t\t{\talert(\" ' \"+ yy + \" ' IS AN INVALID YEAR\");\n\t\t\treturn \"\";\n\t\t}\n\t//alert(dd + \", \" + mm + \", \" + yy);\n\tvar retVal1 = validateDMY(dd,mm,yy);\n\treturn retVal1;\n}", "title": "" } ]
5ed628d561c55d59f8bdd4c6a2e3af9a
Generates food every 'timeout' seconds. If the timeout is not specified, the default is 2 seconds.
[ { "docid": "efa60bcf4c71f2731635cd33d7ae90e5", "score": "0.8513938", "text": "generateFoodEvery(timeout) {\n if (timeout === undefined)\n timeout = 2000;\n this.foodGenerationInterval = setInterval(this.generateFood, timeout);\n }", "title": "" } ]
[ { "docid": "a35102106c872c2604a9c80602ec1a9e", "score": "0.64078265", "text": "function prepareFood(callback)\n{\n setTimeout(callback,5000)\n}", "title": "" }, { "docid": "5eb54c91e7ae6cbbc0d4b3b06f5f381e", "score": "0.6336606", "text": "function cookAndDeliverFood (callback){\r\n setTimeout(callback,5000);\r\n}", "title": "" }, { "docid": "d42aa8508fc306cfa96046de63aab237", "score": "0.63217443", "text": "function cookAndDeliverFood(callback)\n{\n setTimeout(callback, 5000); // setting schedule to fire off in 5 seconds\n}", "title": "" }, { "docid": "6241675ebb7c704b86f2cf97b0c2b783", "score": "0.6302257", "text": "function cookAndDeliverFood(callback){\n setTimeout(callback,5000)\n}", "title": "" }, { "docid": "cb779ca1ee1cd77d871f9aa3c1667b59", "score": "0.6271838", "text": "function cookAndDeliverFood(callback){\n setTimeout(callback,5000);\n}", "title": "" }, { "docid": "148bcbc86becf36c863836c47a3dc3ee", "score": "0.62692523", "text": "function cookAndDeliveredFood(callback)\r\n{\r\n setTimeout(callback,5000)\r\n}", "title": "" }, { "docid": "433302a479a15e26b31e5d0719737a95", "score": "0.6227959", "text": "function cookAndDeliverFood(callback) {\n\tsetTimeout(callback, 5000);\n}", "title": "" }, { "docid": "52bc5a4067164b7f03c4d3b07b3a7d49", "score": "0.62276506", "text": "function cookAndDeliverFood(cb) {\n setTimeout(cb, 5000);\n}", "title": "" }, { "docid": "1485820b3715207d6ebe96fbc54cf251", "score": "0.6227246", "text": "function cookAndDeliverFood(callback){\n setTimeout(callback,5000); //means 5 seconds, after 5 seconds call back\n //settimeout, schedule to callback\n}", "title": "" }, { "docid": "adf32e855a59401d2e7eb6f2472a1eee", "score": "0.62253934", "text": "function cookAndDeliverFood(callback) {\n setTimeout(callback, 5000);\n}", "title": "" }, { "docid": "81e921e90531803be8cd4f34c07edf39", "score": "0.6033409", "text": "function CookAndDeliverFood(callback){\n setTimeout(callback, 5000);\n\n}", "title": "" }, { "docid": "cff48804980a84122650fe1723b137a0", "score": "0.5964078", "text": "function createFood() { \n for (let food of foods){\n noStroke();\n fill(\"yellow\");\n circle(food.x, food.y, food.radius * 2);\n }\n if (millis()-lastAddedFood > 4000+timeLastAddeddFood ){\n foods.push({x: random(0, width), y: random(0, width), radius: 10,});\n lastAddedFood = millis();\n timeLastAddeddFood +=2000;\n \n }\n}", "title": "" }, { "docid": "76c39f49a2b8be81ad6d42684bad1c0d", "score": "0.5953815", "text": "function getRandomTimeout () {\n return self._intervalMs + Math.floor(Math.random() * self._intervalMs / 5)\n }", "title": "" }, { "docid": "80595a4412b9538d3c27e0871df4f2ad", "score": "0.5900439", "text": "function randomTime() {\n let rand = Math.random()\n console.log('Wait for ' + rand + ' seconds')\n holeTimeLoop = setTimeout(randomTime, rand * 2000);\n randomPersonSpot(randomHole())\n }", "title": "" }, { "docid": "d88b58d622c032caee037d80ce7fd485", "score": "0.5784072", "text": "function nuovoTimer() {\n\ttimer = Math.floor(Math.random()*15)*500+2000;\n}", "title": "" }, { "docid": "8549a08f4c799f75686a0a9cbfb8d1d7", "score": "0.5784044", "text": "function generateRandomDelay() {\n return Math.floor(Math.random() * 2000);\n }", "title": "" }, { "docid": "2044fb3ba02d3aa339034a58f457e6d9", "score": "0.57738006", "text": "function generateRandomDelay() {\n return Math.floor(Math.random() * 2000);\n}", "title": "" }, { "docid": "ade5f7dafd00e1375f53254874e397c2", "score": "0.5707222", "text": "generateHunt(){\n\t\tsetTimeout(()=>{\n\t\t\tif (Math.random() < .4){\n\t\t\t\tFluxHelper.callAction(Actions.HUNT_FAIL);\n\t\t\t}else{\n\t\t\t\tlet creature = {\n\t\t\t\t\ttype: this.types[this.getRandomFromInterval(4,0)],\n\t\t\t\t\tname: null,\n\t\t\t\t\tage: this.getRandomFromInterval(this.age[1],this.age[0]),\n\t\t\t\t\tmana: this.getRandomFromInterval(this.mana[1],this.mana[0]),\n\t\t\t\t\tcapturedAt: +new Date\n\t\t\t\t}\n\t\t\t\tFluxHelper.callAction(Actions.HUNT_SUCCESS, creature);\n\t\t\t}\n\t\t}, Math.floor(this.getRandomFromInterval(4000,2500)));\n\t}", "title": "" }, { "docid": "565d6caa7fcd0162497946236d9413a4", "score": "0.56733364", "text": "function bananaRandomizer()\n{\n var randomSpawnTime = Math.random() * 2500;\n var gameTimeout = setTimeout( function() { spawnBanana(); bananaRandomizer(); }, randomSpawnTime );\n}", "title": "" }, { "docid": "50a4bece0425c7993cccd17258ce807c", "score": "0.563579", "text": "function getRandomTime() {\n // return Math.floor(Math.random() * 1000) + 3000;\n return 0;\n}", "title": "" }, { "docid": "e6222c320081bb2f2a0b6d55216cc29f", "score": "0.562522", "text": "function cookAndDeliverFood(callBack){\r\n setTimeout(callBack, 5000);\r\n}", "title": "" }, { "docid": "263f48c8cbaf925a66e058b4c2da4e4a", "score": "0.54743314", "text": "function randomThunder() {\r\n console.log('rayo');\r\n var rand = Math.floor(Math.random() * 120000) + 20000;\r\n thunder();\r\n setTimeout(function () {\r\n randomThunder();\r\n }, rand);\r\n }", "title": "" }, { "docid": "d5e7c04b528081e398aa924fed623c1a", "score": "0.54145867", "text": "function rand() {\n return Math.random() * 2000;\n }", "title": "" }, { "docid": "8bef16206cc7a5d912263ed1102f13f3", "score": "0.5409215", "text": "function generate_food()\r\n {\r\n food[0] = Math.round((Math.random()* 20));\r\n food[1] = Math.round((Math.random()* 30));\r\n return food\r\n }", "title": "" }, { "docid": "b420a344aa604a526007ffaf655bd2cb", "score": "0.54009986", "text": "function scheduleNextTrade(){\n setTimeout(makeRandomTrade, 1000);\n}", "title": "" }, { "docid": "ef0abf68a16c985e48e2d106c7bc30ef", "score": "0.53622276", "text": "static scan(timeout) {\n\t\treturn new Discovery().scan(timeout);\n\t}", "title": "" }, { "docid": "23487814f52d69a2e824caf460962320", "score": "0.53415436", "text": "function generateFood()\n{\n do {\n foodIndex=Math.floor(Math.random() * squares.length);\n } while(squares[foodIndex].classList.contains(\"snake\") || squares[foodIndex].classList.contains(\"bonus-food-1\") || squares[foodIndex].classList.contains(\"bonus-food-2\"));\n\n squares[foodIndex].classList.add(\"food\");\n\n if(foodIndex % 4 == 0 && bonusFoodIndex1 == -1)\n {\n do {\n bonusFoodIndex1=Math.floor(Math.random() * squares.length);\n } while(squares[bonusFoodIndex1].classList.contains(\"snake\") || squares[bonusFoodIndex1].classList.contains(\"food\") || squares[bonusFoodIndex1].classList.contains(\"bonus-food-1\") || squares[bonusFoodIndex1].classList.contains(\"bonus-food-2\"));\n\n squares[bonusFoodIndex1].classList.add(\"bonus-food-1\");\n\n bonusFoodIndex1TimerID=setTimeout(() => {\n if(squares[bonusFoodIndex1].classList.contains(\"bonus-food-1\"))\n {\n squares[bonusFoodIndex1].classList.remove(\"bonus-food-1\");\n bonusFoodIndex1=-1;\n }\n }, 7000);\n }\n\n if(foodIndex % 5 == 0 && bonusFoodIndex2 == -1)\n {\n do {\n bonusFoodIndex2=Math.floor(Math.random() * squares.length);\n } while(squares[bonusFoodIndex2].classList.contains(\"snake\") || squares[bonusFoodIndex2].classList.contains(\"food\") || squares[bonusFoodIndex2].classList.contains(\"bonus-food-1\") || squares[bonusFoodIndex2].classList.contains(\"bonus-food-2\"));\n\n squares[bonusFoodIndex2].classList.add(\"bonus-food-2\");\n\n bonusFoodIndex2TimerID=setTimeout(() => {\n if(squares[bonusFoodIndex2].classList.contains(\"bonus-food-2\"))\n {\n squares[bonusFoodIndex2].classList.remove(\"bonus-food-2\");\n bonusFoodIndex2=-1\n }\n }, 7000);\n }\n}", "title": "" }, { "docid": "c64e895a27303b39923c2422b90f6979", "score": "0.5340967", "text": "function repeat() {\n timeoutId = null;\n if (deadline && now.getTime() >= deadline) {\n const error = new googleError_1.GoogleError('Retry total timeout exceeded before any response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n if (retries && retries >= maxRetries) {\n const error = new googleError_1.GoogleError('Exceeded maximum number of retries before any ' +\n 'response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n retries++;\n const toCall = timeout_1.addTimeoutArg(func, timeout, otherArgs);\n canceller = toCall(argument, (err, response, next, rawResponse) => {\n if (!err) {\n callback(null, response, next, rawResponse);\n return;\n }\n canceller = null;\n if (retry.retryCodes.indexOf(err.code) < 0) {\n err.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n callback(err);\n }\n else {\n const toSleep = Math.random() * delay;\n timeoutId = setTimeout(() => {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n timeout = Math.min(timeout * timeoutMult, maxTimeout, deadline - now.getTime());\n repeat();\n }, toSleep);\n }\n });\n }", "title": "" }, { "docid": "f113db3eb5fcede151ce9f8ff7a6fb51", "score": "0.53407836", "text": "function generateLossDueToTimeOut() {\n unansweredQuestions++;\n $(\".main-content\").html(\"<p class='text-center '>Time Remaining: <span class='timer'>\" + counter + \"</span></p>\" + \"<p class='text-center'>You ran out of time! The correct answer was: \" + triviaQuestions[questionCounter].answerIndex + \"</p>\");\n setTimeout(next, 4000); // change to 4000 or other amount\n }", "title": "" }, { "docid": "f0358deb5d06e5b35b5543037eb77c87", "score": "0.5337985", "text": "function repeat() {\n timeoutId = null;\n if (deadline && now.getTime() >= deadline) {\n callback(\n new Error(\n 'Retry total timeout exceeded before any' + 'response was received'\n )\n );\n return;\n }\n\n if (retries && retries >= maxRetries) {\n callback(\n new Error(\n 'Exceeded maximum number of retries before any ' +\n 'response was received'\n )\n );\n return;\n }\n\n retries++;\n var toCall = addTimeoutArg(aFunc, timeout, otherArgs);\n canceller = toCall(argument, function(err) {\n if (!err) {\n var args = Array.prototype.slice.call(arguments, 1);\n args.unshift(null);\n callback.apply(null, args);\n return;\n }\n canceller = null;\n if (retry.retryCodes.indexOf(err.code) < 0) {\n err.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n callback(err);\n } else {\n var toSleep = Math.random() * delay;\n timeoutId = setTimeout(function() {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n timeout = Math.min(\n timeout * timeoutMult,\n maxTimeout,\n deadline - now.getTime()\n );\n repeat();\n }, toSleep);\n }\n });\n }", "title": "" }, { "docid": "9975e581432f47ef2b1321da2b79706f", "score": "0.53272617", "text": "function getRandomDelay() {\n const max = 1500;\n const min = 300;\n\n return Math.random() * (max - min) + min;\n}", "title": "" }, { "docid": "062a3a08d7b8aa316d157d504a132d6b", "score": "0.5320136", "text": "function cookAndDeliver(callback)\n{\n setTimeout(callback,5000);\n}", "title": "" }, { "docid": "f5b77be9314a3d3c8e9ff29a0c3f56dd", "score": "0.53008556", "text": "function settle (timeout, done) {\n setTimeout(done, timeout);\n }", "title": "" }, { "docid": "2f18e7229609554e96596d5c1ed46f0c", "score": "0.53006285", "text": "function newRandomQuote() {\n timeoutInterval = window.setTimeout(printQuote, 20000);\n}", "title": "" }, { "docid": "abcd2c28288d1acb1cc8ad8fe6925164", "score": "0.5284194", "text": "function FakeTimeout() {}", "title": "" }, { "docid": "db26086502054d9613806dbbc46054af", "score": "0.5273219", "text": "bonus() {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve(Math.round(Math.random() * 1000)), 1000)\n });\n }", "title": "" }, { "docid": "9fad45a0314ff9238a342d108224ba1a", "score": "0.52319175", "text": "function randomNotification(){\n var randomItem = Math.floor(Math.random()*courses.length);\n var notifTitle = courses[randomItem].topic;\n var notifBody='Created by '+courses[randomItem].provider+'.';\n var notifImg='data/images/'+courses[randomItem].slug+'.jpg';\n var options = {body:notifBody,\n icon:notifImg\n }\n var notif = new Notification(notifTitle,options);\n setTimeout(randomNotification,300000000);\n}", "title": "" }, { "docid": "77a586324560345478498f254581e236", "score": "0.5229673", "text": "function cookAndDeliverFood(callback)\n{\n\t// 'call me back', DB calls back the server when the request is done\n\tsetTimeout(callback, 5000); // setting a schedule\n}", "title": "" }, { "docid": "38f04b1916ddbc6c4090db7c7b5d7f31", "score": "0.5210989", "text": "function generateLossDueToTimeOut() {\n\tunansweredTally++;\n\tgameHTML = \"<p class='text-center timer-p'>Time Remaining: <span class='timer'>\" + counter + \"</span></p>\" +\n\t \"<p class='text-center'>You ran out of time! The correct answer was: \" + correctAnswers[questionNumber] + \n\t \"</p>\" + \"<img class='center-block img-wrong' src='assets/images/chicken.jpg'>\";\n\t$(\".mainArea\").html(gameHTML);\n\tsetTimeout(next, 4000); \n}", "title": "" }, { "docid": "5962ccc1d0e4a9dc5986291bbffb8456", "score": "0.5204977", "text": "function peep() {\n const time = Math.floor(Math.random() * 1500 ) + 500;\n const hole = randomHole(holes)\n hole.classList.add('up')\n setTimeout(() => {\n hole.classList.remove('up')\n // if(!timeUp) peep()\n }, time)\n}", "title": "" }, { "docid": "ffc6b16464b4f83790c5a61cef464228", "score": "0.5195865", "text": "function randomNotification() {\n\tvar randomItem = Math.floor(Math.random()*games.length);\n\tvar notifTitle = games[randomItem].name;\n\tvar notifBody = 'Created by '+games[randomItem].author+'.';\n\tvar notifImg = 'data/img/'+games[randomItem].slug+'.jpg';\n\tvar options = {\n\t\tbody: notifBody,\n\t\ticon: notifImg\n\t}\n\tvar notif = new Notification(notifTitle, options);\n\tsetTimeout(randomNotification, 30000);\n}", "title": "" }, { "docid": "ca19eb92cd41da6a3db19cffb6f521ea", "score": "0.5173548", "text": "function generateFood() {\n do {\n foodPositions[0] = Math.floor(Math.random() * 20);\n foodPositions[1] = Math.floor(Math.random() * 30);\n } while (isOnSnake(foodPositions, 0));\n $('#' + foodPositions[0] + '-' + foodPositions[1]).addClass('bg-danger');\n $('#textInformation').text('Score: ' + score);\n}", "title": "" }, { "docid": "d4cf9f122ec550808b5924b76102ade2", "score": "0.5168661", "text": "function generate(func, times){\n for (let i = 0; i < Number(times); i++) {\n func();\n }\n }", "title": "" }, { "docid": "9ca9a980bd836c4faae20d7d9b8ccfef", "score": "0.5167806", "text": "function createRandomFoods(numFoods){\n for (var i = 0; i < numFoods; i++){\n var randX = getRandomIntInclusive(0, xLimit);\n var randY = getRandomIntInclusive((0 + yLimit/5), yLimit);\n foodList.push(new CreateFood(randX, randY));\n }\n}", "title": "" }, { "docid": "5a62fea5d5e542a6e731411f0dcd2e0e", "score": "0.51633805", "text": "function metodo1(){\n return new Promise((resolve, reject)=>{\n setTimeout(()=>{\n resolve(Math.floor(Math.random()*1000));\n }, 3000);\n })\n}", "title": "" }, { "docid": "8dc347d819b329e818f77d4cf4852b5a", "score": "0.5160048", "text": "function generateLossDueToTimeOut() {\n\t\tunansweredTally++;\n\t\tgameHTML = \"<p class='text-center timer-p'>Time Remaining: <span class='timer>\" + counter + \"</span></p>\" + \"<p class='text-center'>You ran out of time! The correct answer was: \" + correctAnswers[questionCounter] + \"</p>\" + \"<img class='center-block img-wrong' src='assets/images/wrong.gif'>\";\n\t\t$(\".mainArea\").html(gameHTML);\n\t\tsetTimeout(wait, 5000); //change to 4000 or other amount \n\n\n\n}", "title": "" }, { "docid": "abf851630781f71f115b2547b9f6137d", "score": "0.5157888", "text": "generateTicket() {\n const MIN = 1_000_000_000;\n const MAX = 9_000_000_000;\n return Math.floor(Math.random() * (MAX - MIN) + MIN);\n }", "title": "" }, { "docid": "93a222ef1fe5a0f79e31d15562554309", "score": "0.51565146", "text": "function getFoods() {\n foods = [];\n while (foods.length < 10) {\n foods.push(new Ticket(\n Math.floor(Math.random() * 100) + 1,\n 'Ve 2D thuong',\n Math.floor(Math.random() * 1) + 1,\n (Math.floor(Math.random() * 5) + 4) * 10000,\n Math.floor(Math.random() * 2) + 1\n ));\n }\n}", "title": "" }, { "docid": "753afbb81908087e0bf5727d2709340a", "score": "0.5151889", "text": "function randomSleep() {\n return sleep(Math.floor(400 + 400 * Math.random()));\n }", "title": "" }, { "docid": "ad70d114999993b6bbd6072b122c2074", "score": "0.5142875", "text": "refillFood() {\n while (this.food.length < this.numFood) {\n this.food.push(Pellet.newRandom());\n }\n }", "title": "" }, { "docid": "c174218c925a8744ddb2aa0cbc955260", "score": "0.5142598", "text": "function giveFood2(name){\n var timesFed = 0; //<-- this will change over time!\n return function(foodToGive){\n console.log(\"Yo, \" + name + \"; here's some \" + foodToGive + \" [fed \" + ++timesFed + \" times]\");\n };\n}", "title": "" }, { "docid": "b817e49e34f127862430bd93226449a0", "score": "0.5114616", "text": "timeToComplete (eta) {\n const accelerated = (Math.floor(Math.random() * 2))\n const multiplier = (accelerated) ? 1 : -1\n return eta - (Math.floor(Math.random() * eta / 10) + 1) * multiplier\n }", "title": "" }, { "docid": "a0ff92f32c811aae64affef7a8e02ea0", "score": "0.5106795", "text": "function random_time(max = 30, min = 1) { //In seconds\n return (Math.floor(Math.random()*max)+min);\n}", "title": "" }, { "docid": "101b1b9334916b96d2b374aa9968a0a0", "score": "0.51032835", "text": "function gen(){\n var a = Math.floor(Math.random() * 20000);\n return a;\n }", "title": "" }, { "docid": "bbc4787442a191ce67e29f4b04683fa1", "score": "0.51029", "text": "fillRestaurantStock(restaurant) {\n console.log(chalk.blue('The restaurant ' + restaurant.name +\n ' is going to Rungis to refill its stock.'));\n setTimeout(restaurant.fillStock(1, 1, 1, 1, 1, 1, 1, 1),\n Math.floor(Math.random() * (maxRefillingTime -\n minRefillingTime)) + minRefillingTime);\n }", "title": "" }, { "docid": "9091710969ec41f0071e2f69f656b134", "score": "0.5101918", "text": "static tick() {\n if (Time.deltaTime > lastFoodSpawn + GlobalGameState.current.foodSpawnIntervalMs) {\n lastFoodSpawn = Time.deltaTime;\n\n const spawnX = GlobalConfig.FOOD_SPAWN_POSITIONS[Math.floor(Math.random() * GlobalConfig.FOOD_SPAWN_POSITIONS.length)];\n\n FoodFactory.createFood(new Vector2(spawnX, 20));\n }\n }", "title": "" }, { "docid": "831fcda7919ff95ec8270c423c2f04de", "score": "0.5100039", "text": "function repeat (test, times) {\n for (let i = 0; i < times; i++) {\n test()\n }\n }", "title": "" }, { "docid": "99e040bc6efd749f59c110ecbbaaa433", "score": "0.50898343", "text": "function delay() {\n return new Promise(resolve => {\n setTimeout(() => resolve(), 20000)\n })\n}", "title": "" }, { "docid": "3bcc35eb50a7a26b3cf4f161d65000f2", "score": "0.5078221", "text": "function myLoop () { // create a loop function\n setTimeout(function () {\n var day = i; // call a 3s setTimeout when the loop is called\n console.log(\"Day: \" + i \"!\");\n var rollNumber = Math.random()*(100 - 1) + 1;\n if (rollNumber < 15) {\n alert(\"DISEASE\");\n }\n // your code here\n i++; // increment the counter\n if (i < 10) { // if the counter < 10, call the loop function\n myLoop(); // .. again which will trigger another\n } // .. setTimeout()\n }, 1500)\n}", "title": "" }, { "docid": "995557d13ac9109e4b8107fc4feaf67e", "score": "0.5073869", "text": "async iterateAuto (mintime, multime) {\n let nextExist\n while ((nextExist = this.nextPuzzle()) && this.puzzleExists()) { } // eslint-disable-line no-empty\n if (nextExist) {\n await this.getPuzzle()\n setTimeout(_ => this.iterateAuto(mintime, multime), mintime + Math.random() * multime)\n }\n }", "title": "" }, { "docid": "3abe4bfe5e0e213618c6c7e3d71fe79f", "score": "0.507384", "text": "function delayResult(toReturn){\n return $timeout(\n function(){\n return toReturn\n },\n 200 + Math.random()*300 //simulate call to external resource\n )\n }", "title": "" }, { "docid": "5e986e4405581216f611bc23ed8f48c5", "score": "0.5071061", "text": "function vocab_get_next_phrase_a(marker='AA'){\n \n // randmon ms between 1 and 2000 \n timeout = Math.floor( (Math.random() * 2000) + 1 );\n \n console.log(timeout); // added for debug - \n \n setTimeout( () => {\n \n if (phrase_cnt_async++ > hp_data.length) { phrase_cnt_async = 0; } \n \n console.log(`${marker}: ${stamp()} - ${[ vocab[phrase_cnt_async], timeout ]} - ${stamp()}`); \n \n return [ vocab[phrase_cnt_async], timeout ];\n \n } , timeout);\n \n}", "title": "" }, { "docid": "66f40b34cafd5cf8449fe64350a22794", "score": "0.5066802", "text": "function processRandFood() {\n var foodURL =\n \"https://www.themealdb.com/api/json/v1/1/random.php\";\n foodAjax(foodURL);\n }", "title": "" }, { "docid": "756a57d5ff1d80fa64b9267ebfdf0161", "score": "0.50628585", "text": "function createMonsters(number) {\n for (let i = 0; i < number; i++) {\n monsterArray.push(new Obstacles(Math.random()*3 + 1))\n }\n //player must die\n setTimeout(() => {\n monsterArray.push(new Obstacles(Math.random()*3 + 1))\n }, 50000);\n}", "title": "" }, { "docid": "11891e29fe88df598fe80b4b9f880ccc", "score": "0.5053199", "text": "function CreateRandomStar() {\n var size = 5 + Math.floor(Math.random() * 30);\n var type = Math.floor(Math.random() * 10);\n var star = new Star(size, (type > 4) ? \"red\" : \"orange\");\n Create(star);\n endCreateRandomStar = setTimeout(CreateRandomStar, 5000);\n}", "title": "" }, { "docid": "f7e2a45fa7719928fba788cddd3d662c", "score": "0.50293565", "text": "function e(max=3){\n console.log(\"Max events at a time: \" + max);\n //Let sample event list be the random events a ply gets in a game.(simluation)\n var eventEntrances = eventList;\n \n //Constant time\n \n for(i = 0; i< eventList;i++){\n //Select random delay time\n randomGenerator = eventDelay();\n \n }\n //Determine a random delay. To represent plyr playing game.\n \n \n \n }", "title": "" }, { "docid": "b844717024e4faeab89c39b536860250", "score": "0.5021811", "text": "createFruit() {\n this.removeTimer({ detail: { timer: this.fruitTimer } });\n this.fruit.showFruit(this.fruitPoints[this.level] || 5000);\n this.fruitTimer = new Timer(() => {\n this.fruit.hideFruit();\n }, 10000);\n }", "title": "" }, { "docid": "a3a8ae15d2d563193493462fd103e3be", "score": "0.5011118", "text": "function delay(duration, getNextLyric) {\n if(!gameOver){\n timeout = setTimeout(getNextLyric, duration * 1000);\n }\n }", "title": "" }, { "docid": "8eaa336ffc2761b25585a8c376fb1f42", "score": "0.5004408", "text": "generateCalBurnt()\r\n {\r\n var calories = Math.floor((Math.random() * 20) + 1)\r\n console.log(calories)\r\n }", "title": "" }, { "docid": "f5069219aaa9a5bf1e2d9d36700c0808", "score": "0.4997711", "text": "function newApple(){\n var x = Random(width-appleWidth);\n var y = Random(height/2);\n var apple = new Apple(x, y);\n apple.ySpeed = hero.IsSlowed ? appleLowSpeed : 5+Random(7);\n var appleType = Math.random();\n\n if(appleType < 0.85)\n {\n apple.Type = ApplesType.NORMAL;\n apple.disappearanceTimeout = normalDisTimeout;\n }\n else if (appleType < 0.95)\n {\n apple.Type = ApplesType.WORMY;\n apple.disappearanceTimeout = wormyDisTimeout;\n }\n else\n {\n apple.Type = ApplesType.BONUS;\n apple.disappearanceTimeout = bonusDisTimeout;\n }\n\n apple.setGravity(gravity);\n return apple;\n}", "title": "" }, { "docid": "b3cb2b029c6fba9ae4affa3566d0da46", "score": "0.49839067", "text": "function starttime() {\n var d = new Date()\n console.log(\"Market maker automation: \" + d.toISOString() + \" timer...\")\n var t = setTimeout(function () { starttime() }, Math.floor((Math.random() * 5000) + 1000))\n}", "title": "" }, { "docid": "b3cb2b029c6fba9ae4affa3566d0da46", "score": "0.49839067", "text": "function starttime() {\n var d = new Date()\n console.log(\"Market maker automation: \" + d.toISOString() + \" timer...\")\n var t = setTimeout(function () { starttime() }, Math.floor((Math.random() * 5000) + 1000))\n}", "title": "" }, { "docid": "9f07b2e6877187bd66ce6073a4f325bd", "score": "0.49710414", "text": "function cook(sec) {\n setTimeout(function() {\n console.log(this.kind + \" cooked for \" + sec + \" seconds.\");\n }, sec * 1000);\n }", "title": "" }, { "docid": "38d38830af26ab4c0a421cd0ce50f9f5", "score": "0.49692857", "text": "function randomizeFood(){\n food.speed = map(noise(food.noiseValue), 0, 1, food.minSpeed, food.maxSpeed);\n food.angle += map(noise(food.noiseValue), 0, 1, -PI/8, PI/8);\n food.noiseValue += 0.1;\n}", "title": "" }, { "docid": "0d8af9599b34ba6653f489da41d75219", "score": "0.4965514", "text": "function setTimeoutTimer() {\r\n let t = timeoutTimer = setTimeout(() => {\r\n if (t === timeoutTimer) {\r\n if (retries-- > 0)\r\n retry();\r\n else\r\n reject(done = new Error(\"Timeout\"));\r\n }\r\n }, timeout);\r\n }", "title": "" }, { "docid": "da1d0ed26339f0013b0348e1046f41d6", "score": "0.49616173", "text": "function getRandomFood(callback){\n const randomFood = Math.floor(Math.random() * (fl.length))\n const foodKey = fl[randomFood];\n const finalName = foodKey.name;\n const finalType = foodKey.type;\n const finalCuisine = foodKey.cuisine;\n return callback(finalName, finalType, finalCuisine);\n}", "title": "" }, { "docid": "33eedd0bc80a4b4d9a3582cf81f1f72f", "score": "0.49603564", "text": "function repeat(action, times, argument) {\n let count = 0;\n\n const repeater = (arg) => {\n if (count >= times) {\n return arg;\n }\n\n count++;\n\n return action(arg).then(repeater);\n };\n\n return repeater(argument);\n}", "title": "" }, { "docid": "027c4a1823f68143c29a4a85181c802c", "score": "0.49559823", "text": "function getRandomNumber(){\n return new Promise (resolve => {setTimeout(function(){\n //Multiply Math.random() by 10\n resolve (Math.random()*10);\n }, 500);\n \n });\n }", "title": "" }, { "docid": "b5a989b3cbfc8d3c5ede3c0c04d17305", "score": "0.4955236", "text": "function printFruit(name, seconds) {\n setTimeout(function () {\n console.log(name);\n }, seconds * 1000)\n}", "title": "" }, { "docid": "a4ce3bec6626601b9cdc5e0eab0e25e0", "score": "0.4937422", "text": "function generateTarget() {\n return Math.floor(Math.random()*10);\n}", "title": "" }, { "docid": "2ecf6d0140da483f8e0954db41da1837", "score": "0.49348906", "text": "constructor() {\n this.timeout = 15000;\n }", "title": "" }, { "docid": "4264cf9e52ceb910f74a5546acd1d06b", "score": "0.4933274", "text": "function startTimeout () {\n\tISTIMEOUT = true;\n\tstopClock();\n\tCURRENT_SHOT_CLOCK_TIME = initialConfig.timeout_length;\n\tstartShotClock();\n}", "title": "" }, { "docid": "21ebb763e4269d00aec2d8258f8a1aaa", "score": "0.49280268", "text": "function repeat (n, action){\n for(i=0; i<n; i++){\n action(i);\n }\n}", "title": "" }, { "docid": "ddad1602fe199d92f3a6f4846ea62277", "score": "0.49210152", "text": "function cook(sec) {\n setTimeout(() => {\n console.log(this.kind + \" cooked for \" + sec + \" seconds.\");\n }, sec * 1000);\n }", "title": "" }, { "docid": "b5741c96a786a770c44a941a9f3d2597", "score": "0.49176297", "text": "static programDailyTimeout() {\n\t\tlet millisTill = getNextDay2AM() - new Date();\n\t\tif (millisTill === 0) {\n\t\t\t//Case at 2:00:00\n\t\t\tsetTimeout(DraftBot.programDailyTimeout, 10000);\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout(DraftBot.dailyTimeout, millisTill);\n\t}", "title": "" }, { "docid": "7874fa6a1a0ff3beeafebcc3b00cd264", "score": "0.4914178", "text": "function generateTarget()\r\n{\r\n return Math.floor(Math.random()*10);\r\n}", "title": "" }, { "docid": "6dfd0043e94bf2b9e399896a97d0a312", "score": "0.49140534", "text": "generateFood() {\n\t\tconst {r, c} = this.getRandomEmptyBoardPiece();\n\t\tthis.board[r][c] = 2;\n\t}", "title": "" }, { "docid": "a9366c759c3f1a1e618bb4f26f13d37b", "score": "0.4912361", "text": "function createDelayMethod(number) {\n return function() {\n // do something...\n };\n}", "title": "" }, { "docid": "1d276e0f6305c7d7f4dfaa5d78499a96", "score": "0.49076596", "text": "function randomMillis() {\n if (isTestingMode()) {\n return 1;\n }\n return Math.round(Math.random() * timeOptions.WAIT_RANGE);\n}", "title": "" }, { "docid": "e72ce2906f12ccdbe8a60e37de1ce87c", "score": "0.4906773", "text": "static timeout(Function, delay, ...funcArgs) {\n return new TimerTimeout(Function, delay, ...funcArgs)\n }", "title": "" }, { "docid": "dc97070dd00f847a87b716bef17f0a29", "score": "0.49002984", "text": "function times_(occurrences, timeLength, seed) {\n return _(occurrences)\n .thru(_.range)\n .map(randomDecimal(seed))\n .orderBy()\n .map(decimalToMinutes(timeLength))\n .map(minutesToTime())\n .value();\n}", "title": "" }, { "docid": "cbe30b368dbbf58f09b42fd1ac817e18", "score": "0.4898091", "text": "function randomizer() {\n var callbacks = Array.from(arguments);\n var time = 0;\n\n var intervalId = setInterval(function() {\n time += 1;\n console.log(time);\n\n if (time >= 2 * callbacks.length) {\n clearInterval(intervalId);\n }\n }, 1000);\n\n\n callbacks.forEach((callback, index) => {\n var timeInSeconds = Math.floor(Math.random() * 2 * callbacks.length) + 1;\n console.log(`time for callback${index + 1}: ${timeInSeconds}`);\n setTimeout(callback, timeInSeconds * 1000);\n });\n}", "title": "" }, { "docid": "0b3cecc28f175d3ec8f3e52dfa963007", "score": "0.48963937", "text": "function generateTarget() {\n return Math.floor(Math.random()*10);\n\n}", "title": "" }, { "docid": "f6d5f889bbb9f9350e754b390ea4269e", "score": "0.4886836", "text": "function generateTarget() {\n return Math.floor(Math.random()*10);\n }", "title": "" }, { "docid": "18d1801aa5ec8bdffd8899588df512f4", "score": "0.48861277", "text": "function fakeSearch(kind) {\n return function*(query) {\n yield timeout(Math.random() * 200);\n return kind + \" result for query \" + query;\n };\n}", "title": "" }, { "docid": "5fc7c7d5bcade1d6b1c21975881902d3", "score": "0.48859054", "text": "function myLoop() { // create a loop function\n identity = setTimeout(function() { // call a 3s setTimeout when the loop is called\n p.style.width = parseInt((i / time) * 100) + \"%\"\n p.textContent = parseInt((i / time) * 100) + \"%\"\n i++; // increment the counter\n if (i < time) { // if the counter < 10, call the loop function\n myLoop(); // .. again which will trigger another \n } // .. setTimeout()\n }, 1000)\n }", "title": "" }, { "docid": "9d74731d05fc8bf51f6252b182cc66e2", "score": "0.4885455", "text": "function generateConfetti() {\n const container = document.createElement('div');\n container.setAttribute('id', 'pinataConfettiContainer');\n container.style.position = 'absolute';\n container.style.top = \"0\";\n container.style.left = \"0\";\n for (let i = 0; i < 400; i++) {\n let t = 1 + .01*rand(0, 100);\n // Creating the confetti as the specified element type\n const element = document.createElement('div');\n\n element.setAttribute(\"class\", 'particle');\n element.style.transform = \"translate(\" + rand(0, 100) + \"vw, \" + rand(0, 100) + \"vh)\";\n element.style.background = \"hsl(\" + rand(0, 360) + \", 100%, 65%)\";\n element.style.animationDuration = t + \"s\";\n element.style.animationDelay = -0.1*rand(0, 100)*t + \"s\";\n // Inserts the confetti into the container\n container.appendChild(element);\n }\n\n document.getElementById(pinataModalBoxId).appendChild(container);\n}", "title": "" }, { "docid": "6f8ad7b29e6ae1e0ad8fc0227f58f1ec", "score": "0.48808327", "text": "async mock({timeout = 600} = {}) {\n this.refresh()\n clearTimeout(this.templates.placeholder.timeout)\n this.templates.placeholder.timeout = setTimeout(async () => {\n this.templates.placeholder.image = await placeholder(this)\n this.generated.content = \"\"\n this.generated.error = null\n }, timeout)\n }", "title": "" }, { "docid": "1e49efff936de3504d49734c7ec85475", "score": "0.48806512", "text": "function repeat(n, action) {\n for (let i = 0; i < n; i++) {\n action(i);\n }\n}", "title": "" }, { "docid": "2a0bf4779a424fd4bcf9a52c8727f865", "score": "0.4875881", "text": "function createFood(){\n\t\t\tfood = {\n\t\t\t\t\tx: Math.round(Math.random() * (w - cellW) / cellW),\n\t\t\t\t\ty: Math.round(Math.random() * (h - cellW) / cellW),\n\t\t\t\t\tticks: 0, // food timer\n\t\t\t\t};\n\t\t\t\t// add food to foodArray\n\t\t\t\tfoodArray.push(food);\n\t\t}", "title": "" } ]
bf2e1a828d26c04dd6390fee6739f796
LocationQuery: based on the shapes drawn it starts to query the data
[ { "docid": "e0d9eb0d4d8e60b261f120d9a85aef15", "score": "0.63197184", "text": "function locationQuery (){\n return new Promise(function (resolve, reject) {\n queryKeys = [];\n for (var key in sdata) {\n for (var i=0; i<shape_list.length; i++){\n if (google.maps.geometry.poly.containsLocation(new google.maps.LatLng(sdata[key]['loc']), shape_list[i])){\n queryKeys.push(key);\n break;\n } \n } \n }\n return queryKeys;\n });\n }", "title": "" } ]
[ { "docid": "991fa23809617a5ba06ad383d852c3a3", "score": "0.6051095", "text": "function setLocationQuery()\n\t{\n\t\tif(locationMarker !== null)\n\t\t{\n\t\t\tlocationMarker.setMap(null);\n\t\t}\n\t\tif(Circle !== null)\n\t\t{\n\t\t\tCircle.setMap(null);\n\t\t}\n\t\t$('#grp-day').hide(750);\n\t\t$('.day').removeClass('marked active');\n\t\tvar geocoder = new google.maps.Geocoder();\n\t\tgeocoder.geocode(\n\t\t\t{address:$('#location').val()+', Chicago, IL'},\n\t\t\tfunction(results, status)\n\t\t\t{\n\t\t\t\tif (status == google.maps.GeocoderStatus.OK)\n\t\t\t\t{\n\t\t\t\t\tif (results[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tMap.Map.panTo(results[0].geometry.location);\n\t\t\t\t\t\tplaceMarker(results[0].geometry.location);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\taddressError();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\taddressError();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "a73f9ab17b599707e5d585335073397c", "score": "0.595212", "text": "function handle_geolocation_query(position) {\n\n $scope.currentMetric = {\n coords: currPosLatLng,\n time: $scope.clock,\n lat: position.coords.lat,\n lng: position.coords.lng,\n altitude: position.coords.altitude,\n accuracy: position.coords.accuracy,\n altitudeAccuracy: position.coords.altitudeAccuracy,\n heading: position.coords.heading,\n speed: position.coords.speed,\n timestamp: position.timestamp\n };\n currentActivity.dataLog.push($scope.currentMetric);\n\n current_position=position;\n currPosLatLng = new google.maps.LatLng({lat: position.coords.latitude, lng: position.coords.longitude});\n\n // if (tracking==true){\n // \ttracking_data.push(current_position);\n // \tdata.push(currPosLatLng);\n // }\n\n if(!started && !finished) {\n posMarker = new google.maps.Marker({\n position: currPosLatLng,\n map: map,\n size: new google.maps.Size(10,10),\n icon: posIcon\n });\n started = true;\n }\n else if(started) {\n posMarker.setPosition(currPosLatLng);\n }\n\n measure_Distance();\n // var cent = new google.maps.LatLng({lat: current_position.coords.latitude, lng: current_position.coords.longitude});\n // map.panTo(cent);\n }", "title": "" }, { "docid": "fdcf2a7fc2d6689fce853fae5cf544ac", "score": "0.59369683", "text": "function findLocations() {\n if (vm.query !== \"\") {\n businessLogic.trackPage({ url: \"/address/\" + encodeURIComponent(vm.query) });\n businessLogic.getPosition(vm.query)\n // use of .then instead of success because returning a defer.promise\n // instead of an $http object (which has the success function)\n .then(function(position) {\n businessLogic.findLocations(position)\n .then(function(data) {\n vm.results.locations = data;\n vm.results.show = true;\n var i, loc, len = vm.results.locations.length;\n for (i = 0; i < len; i++) {\n loc = vm.results.locations[i];\n loc.cssmod = cssmod_baseline;\n loc.expanded = false;\n loc.HoursConsolidated = businessLogic.consolidateHours(loc);\n loc.distance = getDistanceFromLatLonInMi(position.coords.latitude, position.coords.longitude, loc.Latitude, loc.Longitude);\n (function(location) {\n businessLogic.getLocationMap(location)\n .then(function(mapUrl) {\n location.map = mapUrl;\n });\n })(loc);\n }\n if (data.length > 0) {\n selectLocation(vm.results.locations[0]);\n }\n });\n })\n .catch(function(err) {\n businessLogic.error(err);\n });\n }\n }", "title": "" }, { "docid": "6a2069a563a52c1955eaec3f11ae0940", "score": "0.58104926", "text": "function query(call) {\n call.on('data', function(point) {\n console.log(point)\n for (var index in place_list) {\n if (place_list[index].location.latitude === point.latitude && place_list[index].location.longitude === point.longitude) {\n call.write(place_list[index])\n return\n }\n }\n })\n call.on('end', function() {\n call.end()\n })\n}", "title": "" }, { "docid": "1176caf7e78a90f6db43179a02005674", "score": "0.57124555", "text": "function fPintaYQuery() {\n var tbDraw = new Draw(map);\n tbDraw.on(\"draw-complete\", addToMap);\n tbDraw.activate(Draw.POLYGON);\n }", "title": "" }, { "docid": "eeb169e1d89728c6e20fdae01a88d277", "score": "0.5708384", "text": "async function query(url){\n // initialize queryTask\n const queryTask = new QueryTask({\n // intersection url passed into makeSelection()\n url: url\n });\n // initialize query\n const query = new Query();\n query.returnGeometry = true;\n query.outFields = [\"*\"];\n // set geometry being passed in from draw graphic\n query.geometry = geometry;\n return await queryTask.execute(query);\n }", "title": "" }, { "docid": "0622b3490452f38ac6d66c03ed9b37dc", "score": "0.5705782", "text": "function sparql_query_start_path_activity(){\n \n var query = \"SELECT ?path_id ?x1 ?y1 ?z1 ?hasNextPath ?next_path_id\"+\n \" WHERE{\"+\n \"?path <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#Zone>;\"+\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasGuid> \\\"\"+path_id+\"\\\".\"+\n \"?path <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#isStartPath> \\\"true\\\".\"+\n \"?path <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasNextPath> ?hasNextPath.\"+\n \"?hasNextPath <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasGuid> ?next_path_id.\"+\n// \"?path <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasPlacement> ?placement.\"+\n// \"?placement <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasXCoord> ?x1.\"+\n// \"?placement <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasYCoord> ?y1.\"+\n// \"?placement <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasZCoord> ?z1.\"+\n \"}\";\n var result_object = sparql_query (query);\n console.log(query);\n var next_path_id = result_object.results.bin\n \n}", "title": "" }, { "docid": "0a5967c8ed6bdfd7af1422ebb0e99acc", "score": "0.5667659", "text": "function updateOne(){\n const carparks = d3.selectAll('.carpark').remove();\n const searchTerm = \"363\";\n const selectedPoints = geoPointsArray.filter(item => item.areamanagerid == searchTerm);\n drawCarParks(selectedPoints);\n console.log(selectedPoints);\n }", "title": "" }, { "docid": "682584cd003d0ef435a5c7b42dd3736b", "score": "0.5649637", "text": "function analyzeGeospatialData() {\n\t/**\n\t * Add initial markers (TODO specify initial loc and orient)\n\t */\n\tfor (let i = 0; i < globalSetIndex.length; i++) {\n\t\tlet s = globalSetIndex[i];\n\t\tlet is_active = false;\n\t\tif (s.coordSet.length > 3) { //we consider a recording to be mobile if it has more than 2 updates\n\t\t\ts.descriptor.is_mobile = true;\n\t\t} else {\n\t\t\ts.descriptor.is_mobile = false;\n\t\t}\n\t\ts.marker = new Marker();\n\t\ts.marker.init(s.coordSet[0].Latitude, s.coordSet[0].Longitude,\n\t\t\ts.index, s.id, s.orientSet[0].X, s.descriptor.is_mobile);\n\t\t//addLiveMarker(s.coordSet[0].Latitude, s.coordSet[0].Longitude,\n\t\t//\ts.index, s.id, s.orientSet[0].X, s.descriptor.is_mobile);\n\n\n\t\tif (s.id === reference_recordingID) {\n\t\t\thighlightMarker(s.marker, true); //we start by the current marker selected\n\t\t}\n\t}\n\n\n\t/**\n\t * Add marker updates\n\t */\n\tfor (let i = 0; i < globalSetIndex.length; i++) {\n\t\tlet s = globalSetIndex[i];\n\t\taddMarkerUpdates(s, i);\n\t\tglobalSetIndex[i].main_view_tracks_no = i;\n\t\tmain_view_tracks[i].oncuechange = function () {\n\t\t\tfor (let i = 0; i < this.activeCues.length; i++) {\n\t\t\t\tif (this.activeCues[i].id === \"OrientationUpdate\") {\n\t\t\t\t\tupdateMarkerOrientation(this.activeCues[i].track.label, JSON.parse(this.activeCues[i].text).X); //we only use X for display\n\t\t\t\t} else if (this.activeCues[i].id === \"LocationUpdate\") {\n\t\t\t\t\tupdateMarkerLocation(this.activeCues[i].track.label, JSON.parse(this.activeCues[i].text));\n\t\t\t\t} else if (this.activeCues[i].id === \"Event\") {\n\t\t\t\t\thandleEvent(this.activeCues[i].track.label, JSON.parse(this.activeCues[i].text));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\n\t//TODO after we move set p.t_videoStart out of addMarkerUpdates, move this out of here\n\tsetMainViewEndTime();\n\n}", "title": "" }, { "docid": "740914115f5623bfd44b86e24efc2887", "score": "0.5639063", "text": "function queryByLocation() {\n\t\t// show \"finding location\" message button to user while \n\t\t// location is being found\n\t\tjQuery(\"#submitButton\").addClass(\"loading\");\n\t\tjQuery(\".q\").attr(\"placeholder\", \"Finding your location...\");\n\n\t\tnavigator.geolocation.getCurrentPosition(function(location) {\n\t\t\t\n\t\t\tjQuery(\".q\").attr(\"placeholder\", \"Searching...\");\n\n\t\t\t// update search field\n\t\t\tif(locationField !== null) {\n\t\t\t\tlocationField.val(location.coords.latitude + \",\" + location.coords.longitude);\n\t\t\t}\n\t\t\t\n\t\t\tvar searchPanelForm = jQuery(\"#searchPanel form\");\n\t\t\t\n\t\t\tsearchPanelForm.find(\".q\").val(\"\");\n\t\t\tsearchPanelForm.submit();\n\t\t\t\n\t\t}, function() {\n\t\t\talert(\"Unable to determine your location.\");\n\t\t\tjQuery(\".nearby-button\").removeClass(\"down\");\n\t\t\tjQuery(\"#submitButton\").removeClass(\"loading\");\n\t\t\tjQuery(\".q\").removeAttr(\"placeholder\");\n\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "1ec2782e084f0c3644848de1e9297401", "score": "0.56150764", "text": "query(_range, _found){\n if (!this.boundary.intersects(_range)) {\n return;\n }\n else {\n for (let p of this.points){\n if (_range.contains(p)){\n _found.push(p);\n }\n }\n \n if (this.divided){\n this.qNE.query(_range, _found);\n this.qNW.query(_range, _found);\n this.qSE.query(_range, _found);\n this.qSW.query(_range, _found);\n } \n } \n }", "title": "" }, { "docid": "e4e5603776f7051dcc4be1d10ce1caa4", "score": "0.5595747", "text": "getQueryPoints(){\n //shoud only fire if these props exist\n let line = JSON.parse(window.sessionStorage.getItem('line'));\n let origin = JSON.parse(window.sessionStorage.getItem('origin'));\n let destination = JSON.parse(window.sessionStorage.getItem('destination'));\n // let originName = JSON.parse(window.sessionStorage.getItem('originName'));\n // let destinationName = JSON.parse(window.sessionStorage.getItem('destinationName'));\n\n console.log(line, origin, destination);\n var polyline = turf.lineString(line);\n let dist = distance.default([origin.lng, origin.lat], [destination.lng, destination.lat]);\n this.setState({\n distance: dist\n });\n let points = line.map((coords, i) => {\n if (dist > (i * 150) + 1){\n return along.default(polyline, i * 150)\n }\n })\n let coords = points.filter(coord =>{\n return coord !== undefined;\n })\n // add final destination to end of coords\n let obj = {geometry : { coordinates : [destination.lng, destination.lat]}};\n coords.push(obj);\n this.getCities(coords);\n }", "title": "" }, { "docid": "7f3208a323bd80373b4d34c5f3ab1557", "score": "0.55003816", "text": "function drawPoint(){\n clear();\n selectAll(\".locations\").forEach(location => location.hide());\n select(\".heading__year\").html(select(\"#yearSlider\").value());\n filteredBattles = filterData(document.getElementById(\"yearSlider\").value);\n for(var j =0; j<filteredBattles.length;j++) {\n if(filteredBattles[j].coord[0]) {\n var temp = myMap.latLngToPixel(filteredBattles[j].coord[0], filteredBattles[j].coord[1]);\n mapLocations[filteredBattles[j].id].updateLocation(temp.x,temp.y);\n mapLocations[filteredBattles[j].id].drawLocation();\n }\n }\n}", "title": "" }, { "docid": "925e072ff95ce39a33d11f98d072423b", "score": "0.54131764", "text": "function runAmenitiesQuery(infieldValue) {\r\n\r\n mapView.graphics.removeAll();\r\n\r\n var fieldNmae = 'COURT_TYPE';\r\n var fieldValue = infieldValue;\r\n var whereClause = fieldNmae + \"='\" + infieldValue + \"'\";\r\n\r\n //var parkList = [];\r\n\r\n var query4courtFields = courtfields.createQuery();\r\n query4courtFields.where = whereClause;\r\n query4courtFields.outFields = ['*'];\r\n query4courtFields.returnGeometry = true;\r\n query4courtFields.outSpatialReference = mapView.spatialReference;\r\n var courtFieldPoly = [];\r\n let union;\r\n\r\n courtfields.queryFeatures(query4courtFields)\r\n .then(function (response) {\r\n\r\n let features = response.features;\r\n\r\n for (var i = 0; i < features.length; i++) {\r\n var feature = features[i];\r\n //console.log(feature.geometry);\r\n courtFieldPoly.push(feature.geometry);\r\n\r\n }\r\n union = geometryEngine.union(courtFieldPoly);\r\n\r\n //console.log(parkList.length);\r\n // console.log(parkList);\r\n\r\n //console.log(courtFieldPoly);\r\n // courtFieldPoly = response.features[0].geometry;\r\n // console.log(response.features.length)\r\n\r\n let query4ParkPoly = parkPoly.createQuery();\r\n query4ParkPoly.geometry = union;\r\n query4ParkPoly.outFields = [\"*\"];\r\n query4ParkPoly.spatialRelationship = \"intersects\"; // this is the default\r\n query4ParkPoly.returnGeometry = true;\r\n query4ParkPoly.outSpatialReference = mapView.spatialReference;\r\n\r\n parkPoly.queryFeatures(query4ParkPoly)\r\n .then(function (response) {\r\n\r\n mapView.graphics.removeAll();\r\n\r\n for (feature in response.features) {\r\n var bufferGraphic = new Graphic({\r\n geometry: response.features[feature].geometry,\r\n symbol: {\r\n type: \"simple-fill\", // autocasts as new SimpleFillSymbol()\r\n outline: {\r\n width: 3,\r\n color: [244, 163, 0, 3]\r\n },\r\n style: \"none\"\r\n }\r\n });\r\n //console.log(bufferGraphic.geometry);\r\n mapView.graphics.add(bufferGraphic);\r\n\r\n\r\n\r\n }\r\n\r\n // print the number of results returned to the user\r\n dom.byId(\"printResults\").innerHTML = courtFieldPoly.length + \" \"+\r\n fieldValue + \"'s found in Parks!\";\r\n\r\n }).catch(function (error) {\r\n console.log(error);\r\n });\r\n\r\n\r\n\r\n }).catch(function (error) {\r\n console.log(error);\r\n\r\n });\r\n\r\n }", "title": "" }, { "docid": "df689537f66801a76dbf4b6a2ebde687", "score": "0.540621", "text": "function collectLocations() {\n fetchData(\"http://api-beta.breezometer.com/baqi/?location=new+york&key=9de9e08086af4c6ea6d2ac60b3d38acb\", \"New York\");\n fetchData(\"http://api-beta.breezometer.com/baqi/?location=new+york&key=9de9e08086af4c6ea6d2ac60b3d38acb\", \"San Francisco\");\n fetchData(\"http://api-beta.breezometer.com/baqi/?location=menlo+park,+ca,+united+states&key=9de9e08086af4c6ea6d2ac60b3d38acb\", \"Palo Alto\");\n}", "title": "" }, { "docid": "58cd6cd6ce595b1b06ae688248d255ca", "score": "0.5380111", "text": "function queryMoments(url) {\r\n\r\n //console.log('query');\r\n var qTask = new QueryTask({url:url});\r\n var params = new esriQuery({\r\n returnGeometry: true,\r\n outFields:['*'],\r\n orderByFields:['OBJECTID']\r\n });\r\n params.where = 'pathID = ' + app.pathID;\r\n //console.log(params);\r\n qTask.execute(params).then(buildTimeline).otherwise(promiseRejected);\r\n\r\n }", "title": "" }, { "docid": "6eb74e538451d446efc0579f49b89f0d", "score": "0.5370863", "text": "function LooksPlace(location) { \n app.progressbar.show('multi');\n var request = {\n location: location,\n radius: '200',\n query: filtro\n };\n \n service.textSearch(request, ShowResult);\n \n }", "title": "" }, { "docid": "4ea59a40d11d878601d6cf75352b6fff", "score": "0.5359947", "text": "function searchLocations() {\n //make sure all the listings are not showing\n hideListings();\n\n //go through each marker\n for (var i = 0; i < markers.length; i++) {\n\n //check if the marker is within the the circles\n for (var a = 0; a < yumPoly.length; a++) {\n if (yumPoly[a] != null) {\n //get bounds of all polygons and check whether markers are inside\n var circle = yumPoly[a].getBounds();\n var withinBool = circle.contains(locations[i].marker.position);\n if (withinBool === true) {\n markers[i].setMap(map);\n break;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "8dfb7ff0540ef8e0dda7b7992279a6c6", "score": "0.534739", "text": "function gotCoords(userName,lat,lng) {\n \t\n \t//filter out 0,0\n\t\t\tif (lat == 0 && lng == 0) {\n\t\t\t\tconsole.log('Filtering out 0,0 for ' + userName);\n\t\t\t\tdidNotGetCoords(userName);\n\t\t\t}\n \t\n\t $.each(results,function () {\n\t \t\n\t if (!this.waiting) {return;}\n\t if (this.from_user == userName) {\n\t \t\n\t \tthis.geo_info.valid = true;\n\t this.geo_info.lat = lat;\n\t this.geo_info.lng = lng;\n\t addToMap(map,this);\n\t \n\t }\n\t \n\t });\n\t\t\n }", "title": "" }, { "docid": "c665977149c612c8ff937594dd104dad", "score": "0.5338052", "text": "function searchPOI( idx ) {\n var request = {\n location: current_coord[idx],\n radius: g_searchRadius, \n types: ['food']\n } \n\n var num = 0.0;\n\n // Use the places services to search for point of interest\n g_places.nearbySearch(request, function(result, stat) {\n console.log( \"Status: \" + stat + \" | \" + result.length);\n for (var i=0; i < result.length; i++) {\n placePOI( result[i] );\n fillInfo( result[i] );\n }\n num = result.length;\n\n // Experimental: Set a colour based on the number of things found by the service\n if (num > 25) num = 25.0;\n num /= 25.0;\n console.log(num);\n var circle = new google.maps.Circle({\n center: current_coord[idx],\n radius: 250,\n strokeColor: \"#FF0000\",\n strokeOpacity: 0.5,\n strokeWeight: 1.5,\n fillColor: \"#FF1111\",\n //fillOpacity: 0.35,\n fillOpacity: num,\n map: g_map\n });\n\n });\n\n\n\n if (idx < current_coord.length - 1) {\n setTimeout( function() { searchPOI(++idx); }, 500);\n } else {\n console.log(\"blah\");\n storePoiAndPath();\n }\n}", "title": "" }, { "docid": "512b156a0eac5f5132006785629e5cbc", "score": "0.5325667", "text": "function queryWaterTimeSeries(location, map) {\n var template = $('#query-chart-template')[0].innerHTML;\n var chartElement = $($.parseXML(template)).contents();\n var chartElementId = 'query-chart-' + maxChartIndex;\n chartElement.attr('id', chartElementId);\n\n maxChartIndex++;\n\n var infoWindow = new google.maps.InfoWindow({content: chartElement[0]});\n\n // Add the marker at the clicked location, and add the next-available label\n // from the array of alphabetical characters.\n var marker = new google.maps.Marker({\n position: location,\n label: '',\n draggable: true,\n map: map\n });\n\n marker.addListener(\"dblclick\", function () {\n marker.setMap(null);\n });\n\n marker.addListener('click', function () {\n infoWindow.open(map, marker);\n });\n\n infoWindow.open(map, marker);\n\n google.maps.event.addListener(infoWindow, 'domready', function () {\n $.ajax({\n url: \"/get_ndwi_time_series\",\n data: {location: JSON.stringify(marker.position), begin: beginDate, end: endDate},\n dataType: \"json\",\n success: function (data) {\n // convert dates\n var data = data.map(function (d) {\n return {\n date: new Date(d.date).format('%Y-%m-%d'),\n value: d.value\n };\n });\n\n\n createQueryChart('#' + chartElementId, data);\n },\n error: function (data) {\n console.log(data.responseText);\n }\n });\n });\n\n queryMap = false;\n map.setOptions({draggableCursor: null});\n}", "title": "" }, { "docid": "e02725420c9e53c969800c9fa9f91aaf", "score": "0.52932227", "text": "function GeoQuery()\n{\t\n\t//don't allow this code to be executed if we're still waiting for a response from the db.\n\tif(geoquery == true && geoqueries.length > 0)\n\t{\n\t\tgeoquery = false;\n\t\tvar id = geoqueries[0].id; //client's socket id number\n\t\tvar data = {}; //clients geo data\n\n\t\t//Check db for existing geocodes //could give multiple results\n\t\tGEO.find({searchterm: geoqueries[0].place}).toArray(function(err, docs) \n\t\t{\t\n\t\t\tif(!err)\n\t\t\t{\n\t\t\t\tif(docs.length > 0) //if docs are found\n\t\t\t\t{\t\n\t\t\t\t\tdata.addresses = geoqueries[0].addresses; //client's collection / edition addresses\n\t\t\t\t\tdata.city = docs[0].city;\n\t\t\t\t\tdata.territory = docs[0].territory;\n\t\t\t\t\tdata.country = docs[0].country;\n\t\t\t\t\tdata.lt = docs[0].lt;\n\t\t\t\t\tdata.lg = docs[0].lg;\n\n\t\t\t \tGeoToClient(id, data); //send results to client\n\t\t\t\t}\n\t\t\t\telse //if searchterm is not in db\n\t\t\t\t{\n\t\t\t\t\t//geoquery = true; //this really speeds things up but I'm not sure how well it works with multiple clients \n\n\t\t\t\t\tif(geoqueries.length > 0 && geoqueries[0].place && geoqueries[0].place != \"\" && geoqueries[0].place != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar gq = geoqueries[0];\n\n\t\t\t\t\t\t//query OpenCage and add results to db //sometimes returns undefined for city\n\t\t\t\t\t\tgeocoder.geocode(gq.place, function(err, res)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t//console.log(\"response from geocoder\");\n\n\t\t\t\t\t\t\tif(!err) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//if there are matches found\n\t\t\t\t\t\t\t\tif(res.length > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar nocity = true;\n\n\t\t\t\t\t\t\t\t\t//run through until you can...\n\t\t\t\t\t\t\t\t\tfor(var i in res)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//...make sure that you're giving a city and not just a region //***Continue to work with how this is defined.\n\t\t\t\t\t\t\t\t\t\t//e.g.: Cape Town SA vs. Cape Town USA\n\t\t\t\t\t\t\t\t\t\t//if(res[i].city || res[i].state)\n\t\t\t\t\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t\t\t\t\tdata.searchterm = gq.place;\n\t\t\t\t\t\t\t\t\t\t\tdata.city = res[0].city;\n\t\t\t\t\t\t\t\t\t\t\tdata.territory = res[0].state;\n\t\t\t\t\t\t\t\t\t\t\tdata.country = res[0].country;\n\t\t\t\t\t\t\t\t\t\t\tdata.lt = res[0].latitude;\n\t\t\t\t\t\t\t\t\t\t\tdata.lg = res[0].longitude;\n\n\t\t\t\t\t\t\t\t\t\t\t//inserts data if there is no existing item that matches query, otherwise just updates it\n\t\t\t\t\t\t\t\t\t\t\tvar dbquery = {searchterm: gq.place, city: data.city, territory: data.territory, country: data.country};\n\t\t\t\t\t\t\t\t\t\t\tGEO.update \n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\tdbquery,\n\t\t\t\t\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t\t\t\t\t\t{upsert: true}, \n\t\t\t\t\t\t\t\t\t\t\t\tfunction(err, result) \n\t\t\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\tif (!err) console.log(\"updated / inserted \" + data.city + \" to DB\");\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\n\t\t\t\t\t\t\t\t\t\t\tdata.addresses = gq.addresses; //client's collection / edition addresses\n\n\t\t\t\t\t\t\t\t\t\t\tGeoToClient(id, data); //send results to client\n\n\t\t\t\t\t\t\t\t\t\t\tnocity = false;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif(nocity == true) GeoReset(); //***Develop a client response for no cities in OpenCage associated with search term\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse //if there are no geocodes associated with search term\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar err = \"OpenCage has no geocodes for\" + gq.place + \". Sorry. :(\";\n\t\t\t\t\t\t\t\t\tdata.addresses = gq.addresses;\n\t\t\t\t\t\t\t\t\tdata.err = err;\n\t\t\t\t\t\t\t\t\tGeoToClient(id, data); //send results to client\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse //if OpenCage has an error\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(\"open cage error: \" + err + \" place: \" + gq.place);\n\t\t\t\t\t\t\t\tdata.err = err; //read errors on client side\n\t\t\t\t\t\t\t\tGeoToClient(id, data); //send results to client\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{ \n\t\t\t\t\t\tconsole.log(\"something is wrong with place\");\n\t\t\t\t\t\tGeoReset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t \t}\n\t \telse //if MongoDB has an error\n\t \t{\t\n\t \t\tconsole.log(\"mongo error: \" + err);\n\t \t\tdata.err = err; //read errors on client side\n\t \t\tGeoToClient(id, data); //send results to client\n\t \t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "70d6a3fac7d2cf12715b338fda68e41f", "score": "0.5266014", "text": "function query_imagery(){\n \n // Enable delete button\n delete_training_button.setDisabled(false);\n \n // Enable first rename textbox\n land_class_1_name.setDisabled(false)\n \n // Enable the first land class button to allow for training \n land_class_1_button.setDisabled(false)\n \n // Remove all previous layers \n remove_all_layers()\n \n // Grab current layer \n var aoi = drawing_tools.layers().get(0).getEeObject(); // Grab current layer \n \n // Image collection call to grab best image\n var image = ee.ImageCollection(\"COPERNICUS/S2_SR\")\n .filterBounds(aoi)\n .filterDate(first_date_select.getValue(), second_date_select.getValue())\n .sort(\"CLOUDY_PIXEL_PERCENTAGE\")\n .first()\n \n // Clip image to the user drawn aoi\n clipped_image = image.clip(aoi)\n \n // Grab cooridnates for user drawn aoi and generate a linear ring geometry\n // Coordinates have to be flattened for the linearring method to work\n var coords_for_bounds = aoi.coordinates();\n var polygon_for_bounds = ee.Geometry.LinearRing(coords_for_bounds.flatten());\n \n // Add NDVI index to image\n var ndvi_band = clipped_image.normalizedDifference(['B8', 'B4']).rename('NDVI');\n clipped_image = clipped_image.addBands(ndvi_band);\n \n // Remove previous user drawn polygon\n clear_geometry();\n \n // Add new linearing 'polygon'\n Map.addLayer(polygon_for_bounds, null, \"Area of Interest Boundary\");\n \n // Add clipped image\n Map.addLayer(clipped_image, {bands: [\"B4\", \"B3\", \"B2\"], min: -76.652, max:1100.600}, \"Area of Interest\" )\n}", "title": "" }, { "docid": "2be0de7147379adeb73aab132c4281b8", "score": "0.52533436", "text": "function showData() {\n \n // graph -----------------------------------\n // lat and long ----------------------------\n beginShape();\n noStroke();\n fill(100);\n textSize(10);\n text(\"latitude\", 50, windowHeight - 30);\n text(\"longitude\", windowWidth - 60, 50);\n noFill();\n stroke(100);\n strokeWeight(4);\n vertex(windowWidth - 70, 50);\n vertex(windowWidth - 70, windowHeight - 50);\n vertex(50, windowHeight - 50);\n endShape();\n \n // equator ---------------------------------\n beginShape();\n noStroke();\n fill(100);\n textSize(10);\n text(\"equator\", 50, (windowHeight-70)/2);\n strokeWeight(1);\n stroke(150);\n vertex(50, (windowHeight-60)/2);\n vertex(windowWidth-70, (windowHeight-60)/2);\n endShape(); \n \n \n \n\n \n // data key ----------------------------\n fill(230);\n rect(50, 50, 250, 150);\n textSize(20);\n fill(100);\n text(\"Weekly Earthquake Feed\", 65, 75);\n textSize(10);\n strokeWeight(1);\n stroke(255, 180, 0, 80);\n fill(255, 180, 0, 80);\n text(\"6am - 12pm\", 85, 105);\n stroke(255, 110, 0, 80);\n fill(255, 110, 0, 80);\n text(\"1pm - 6pm\", 85, 125);\n stroke(200, 0, 200, 80);\n fill(200, 0, 200, 80);\n text(\"6pm - 10pm\", 85, 145);\n stroke(0, 0, 120, 80);\n fill(0, 0, 120, 80);\n text(\"10pm - 5am\", 85, 165);\n noStroke();\n fill(200);\n ellipse(220, 130, 60, 60);\n text(\"gap\", 240, 160);\n fill(255);\n text(\"magnitude\", 197, 130);\n\n\n // count the rows in our table\n var count = table.getRowCount();\n\n // parse the data returned by loadStrings()\n var rowHeight = 30;\n\n //get min and max\n for (var row = 1; row < count; row++) {\n for (var col = 1; col < 2; col++) {\n var val = table.getString(row, col);\n val = float(val);\n\n if (minVal > val) {\n minVal = val;\n } else if (maxVal < val) {\n maxVal = val;\n }\n }\n }\n \n // //get min and max\n // for (var row = 1; row < count; row++) {\n // for (var col = 1; col < 2; col++) {\n // var val = table.getString(row, col);\n // val = float(val);\n\n // if (minVal > val) {\n // minVal = val;\n // } else if (maxVal < val) {\n // maxVal = val;\n // }\n // }\n // }\n console.log(\"minimum: \" + minVal + \" | maximum: \" + maxVal);\n\n //loop through all the rows\n for (row = 0; row < count; row++) {\n // loop through all the columns\n for (col = 1; col < 6; col++) {\n noStroke();\n fill(200, 0, 200, col*7);\n //make a number out of the string val\n var date = new Date(table.getString(row, 0));\n var hr = date.getHours();\n \n // Date.prototype.getHours(today);\n var latitude = table.getString(row, 1);\n var longitude = table.getString(row, 2);\n var magnitude = table.getString(row, 4);\n var gap = table.getString(row, 7);\n \n // console.log(today);\n \n \n if (gap){\n \n if (hr >= 6 && hr <= 12){\n fill(255, 180, 0, 20);\n }else if(hr >=13 && hr <= 18){\n fill(255, 110, 0, 20);\n }else if(hr >= 18 && hr <=21 ){\n fill(200, 0, 200, 20);\n }else{\n fill(0, 0, 120, 20);\n }\n \n \n // ellipseMode(CENTER);\n \n // stroke(gap, 0, gap);\n // noFill();\n // ellipse(map(latitude, minVal, maxVal, 50, windowWidth-60), map(longitude, minVal, maxVal, 70-windowHeight, 50), gap/2, gap/2);\n noStroke();\n // fill(random(100,255), random(0,50), random(0,150), 25);\n ellipse(map(latitude, minVal, maxVal, 50, windowWidth-60), map(longitude, minVal, maxVal, 70-windowHeight, 50), gap/2, gap/2);\n \n textSize(10);\n fill(230);\n text(magnitude, map(latitude, minVal, maxVal, 50, windowWidth-60), map(longitude, minVal, maxVal, 70-windowHeight, 50)); \n \n // ellipse(map(latitude, minVal, maxVal, 50, windowWidth-60), map(longitude, minVal, maxVal, 70-windowHeight, 50), map(magnitude, -0.03,8, 5, 50 ), map(magnitude, -0.03,8, 5, 50 ));\n }\n \n }\n }\n}", "title": "" }, { "docid": "b914d77c48dfcb21ec52455dac447810", "score": "0.5250479", "text": "setQuery(newQuery, newLocation) {\n helpers.runQuery(newQuery, newLocation, data => {\n this.setState({ results: data });\n \n })\n console.log('from setQuery: '+this.state.results);\n }", "title": "" }, { "docid": "e068752895743e0b77800617442f1d5a", "score": "0.5241756", "text": "function queryLocation() {\n var term = $('#search').val(),\n source = (\n 'https://maps.googleapis.com/maps/api/geocode/json' +\n '?address=' +\n term +\n '&key=' +\n locationKey\n );\n \n $.ajax({\n dataType : 'json',\n url : source,\n success :\n function (data) {\n setLocation(data);\n queryWeather();\n },\n error :\n function (data) {\n alert('ERROR:\\n', data);\n }\n });\n }//======================================================================//", "title": "" }, { "docid": "f2cd79125747aa35c0e39861354296d1", "score": "0.5214864", "text": "function onFindLocation( event)\n{\n\t//get the table data from control panel\n\tcontrolPanel = Ab.view.View.getControl('', 'object_list');\n\tvar rows = controlPanel.rows;\n\n\tvar mapPanel = Ab.view.View.getControl('', 'object_map');\n\tvar lat = event.lat;\n\tvar lon = event.lon;\n\t\n\tlatArray[locationSeq] = lat;\n\tlonArray[locationSeq] = lon;\n\tlocationSeq++;\n\n\t//get the map panel and save the array of lan/lon to the panel\n\tmapPanel.myLatArray = latArray;\n\tmapPanel.myLonArray = lonArray;\n\t\n\tmyExplorer.recenterOrPanToLatLon(new AWLatLon(lat, lon));\n\t\n\t//if all geocodings are done, we save data to database\n\tif(rows.length == locationSeq)\n\t{\n\t\t// loop through all buildings shown in the report and save lat/lon to the database\n\t for (var i = 0; i < rows.length; i++) \n\t {\n\t // get current building data row\n\t var dataRow = rows[i];\n\t \n\t // create record to be saved and copy PK value from the data row\n\t var record = {};\n\t record['bl.bl_id'] = dataRow['bl.bl_id'];\n\t \n\t \tif (latArray[i] != null && lonArray[i] != null )\n\t {\n\t \trecord['bl.lat'] = latArray[i];\n\t \trecord['bl.lon'] = lonArray[i];\n\t\n\t \t// call WFR to save updated building record\n\t \t \tvar parameters = {\n\t \ttableName: 'bl',\n\t \tfields: toJSON(record)\n\t \t};\n\t\n\t \tvar result = Ab.workflow.Workflow.runRuleAndReturnResult('AbCommonResources-saveRecord', parameters);\n\t \tif (result.code != 'executed') {\n\t \tAb.workflow.Workflow.handleError(result);\n\t \tbreak;\n\t \t}\n\t }\n\t }\n\t\n\t}//end if \t\n}", "title": "" }, { "docid": "5d6f279f32bb3236ce5d7e6b0ddb3406", "score": "0.5201449", "text": "searchQuery(event){\n\t\tthis.props.closeWindow();\n\t\t//console.log(this.props.currentMarker[0])\n\t\tlet query=event.target.value;\n\t\tthis.setState({query:query.trim()})\n\t\tlet markers=this.props.currentMarker;\n\t\tlet newMark=[];\n\t\tif(query)\n\t\t{\n\t\tconst match = new RegExp(escapeRegExp(query), 'i');\n\t\tmarkers.map((marker)=>{\n\t\t\tif(match.test(marker.title)){\n\t\t\t\tmarker.setVisible(true);\n\t\t\t\tnewMark.push(marker)\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmarker.setVisible(false);\n\t\t\t}\n\t\t\treturn marker;\n\t\t})\n\t\t\n\t\tthis.setState({markers:newMark})\n\t\t//console.log(this.state.markers[0].marker.getPosition().lat())\n\t}\n\telse {\n\t\t//console.log(\"NO query\");\n\t\tfor(var j=0;j<markers.length;j++)\n\t\t{\n\t\t\tmarkers[j].setVisible(true);\n\t\t}\n\t\tthis.setState({markers:markers});\n\t\t//console.log(this.props.currentMarker)\n\t}\n}", "title": "" }, { "docid": "d10030ba775ff4bbcea2471d0188574f", "score": "0.5198259", "text": "function showLocation(data) {\n var i = 0;\n data[\"episodes\"].forEach(function (epi) {\n var state = epi[\"inferred-state\"].toLocaleUpperCase();\n var start = new Date(epi[\"start\"]);\n var end = new Date(epi[\"end\"]);\n var cluster = epi[\"cluster\"];\n if (state == \"STILL\" && cluster) {\n getLocationMap(cluster[\"latitude\"], cluster[\"longitude\"], start, end, i++);\n }\n });\n\n}", "title": "" }, { "docid": "801b086eeb4252fe44f89b65532fb3a0", "score": "0.51781976", "text": "function useTheData2(doc){\n // Geodata handling goes here, using JSON properties of the doc object\n for (var i = 0; i < doc[0].placemarks.length; i++)\n {\n if(doc[0].placemarks[i].Polygon != undefined && doc[0].placemarks[i].Polygon != null)\n {\n //console.log(doc[0].placemarks[i].name);\n var coordenadas = doc[0].placemarks[i].Polygon[0].outerBoundaryIs[0].coordinates;\n var coordenadapoligono = [];\n for(var x=0; x < coordenadas.length; x++)\n {\n var coordenada = new Object();\n coordenada.lat = coordenadas[x].lat;\n coordenada.lng = coordenadas[x].lng;\n \n coordenadapoligono.push(coordenada);\n }\n \n var poligono = new google.maps.Polygon({path: coordenadapoligono});\n arrPoligonos.push(poligono);\n //var status = google.maps.geometry.poly.containsLocation(new google.maps.LatLng(19.424280, -99.213535) , poligono);\n }\n }\n }", "title": "" }, { "docid": "116dfc559a061908915e9fd1bed2be79", "score": "0.5173793", "text": "function queryYelpWithPositions(queries){\n\n for (var i=0;i<queries.length;i++){\n $.get(\n serverIP+':8080',\n queries[i],\n function(results){\n var json_result = JSON.parse(results);\n console.log(json_result);\n markResults(json_result);\n }\n );\n }\n}", "title": "" }, { "docid": "ae0547a9587d04559b3e0cb26ac413e9", "score": "0.5172737", "text": "renderQueryLayer() {\n if (this.props.mapSources.results) {\n const src = this.olLayers.results.getSource();\n src.clear(true);\n src.addFeatures(\n GEOJSON_FORMAT.readFeatures({\n type: \"FeatureCollection\",\n features: this.props.highlightResults,\n })\n );\n } else if (\n this.props.highlightResults &&\n this.props.highlightResults.length > 0\n ) {\n console.error(\n 'No \"results\" layer has been defined, cannot do smart query rendering.'\n );\n }\n }", "title": "" }, { "docid": "bf9b88b9ccf4ca82e113f5ba98293b21", "score": "0.5165927", "text": "function queryLayer(){\n\n\t$('#query_error').html(\"\");\n\n\tvar query = new esri.tasks.Query();\n\tvar queryUrl = restEndpoint + \"EnterpriseFeatures/MapServer/\" + $('#select_a_layer option:selected').val();\n\tvar layerQueried = $('#select_a_layer option:selected').attr(\"turnOnLayer\");\n\tquery.where = queryWhereClause;\n\tquery.outFields = queryOutFields;\n\t//query.orderByFields = queryOrderByFields;\n\tquery.returnGeometry = true;\n\tvar queryTask = new esri.tasks.QueryTask(queryUrl);\n\tqueryTask.execute(query,function(featureSet) {\n\n\t\t\n\t\t// Showing the Query Results window only on Tablets and Desktop browsers AND number of features returned is > 0\n\t\tif ($(window).width() >= 768 && featureSet.features.length > 0) { \n\n\t\t\t//If the layer queried has a \"turnOnLayer\" attribute, turn on that layer in the TOC when queried\n\t\t\tif (layerQueried) {\n\t\t\t\tconsole.log(\"turning on queried layer: \" + layerQueried);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$(\"#tocTree\").jqxTree('checkItem', $(\".\" + layerQueried)[0], true);\n\t\t\t\t}, 800);\n\t\t\t}\n\n\t\t\tvar queryResultsWidth = $(window).width() - $('#search-panel').width();\n\t\t\t$('#query-results').css('width', queryResultsWidth + \"px\");\n\t\t\t$('#query-results').css('display','block');\n\n\t\t\t// First, clear all the contents in the graphic layers (Search results, if any)\n\t\t\tmap.getLayer(\"searchOutputGL_Point\").clear();\n\t\t\tmap.getLayer(\"searchOutputGL_Polyline\").clear();\n\t\t\tmap.getLayer(\"searchOutputGL_Polygon\").clear();\t\n\n\t\t\t\t\t\t\t\n\t\t\t// Create table header with the fields\n\t\t\t$('#tableHeaderRow-Query').empty();\n\t\t\t$.each(featureSet.fieldAliases, function(header,value) {\n\t\t\t $('#tableHeaderRow-Query').append(\"<td>\"+header+\"</td>\");\n\t\t\t});\n\n\t\t\t//sort featureSet\n\t\t\tconsole.log(\"sorting results\");\n\t\t\tfeatureSet.features.sort(function(a, b){\n\t\t\t\tvar x, y;\n\t\t\t\tx = a.attributes[queryOrderByFields[0]];\n\t\t\t\ty = b.attributes[queryOrderByFields[0]];\n\t\t\t\tif (x < y)\n\t\t\t\t\treturn -1;\n\t\t\t\tif (x > y)\n\t\t\t\t\treturn 1;\n\t\t\t\treturn 0;\n\t\t\t});\n\t\t\tconsole.log(\"done sorting results\");\n\n\n\t\t\t// Create table body dynamically with the values from Query\n\t\t\t$('#tableBody-Query').empty();\n\t\t\t$.each(featureSet.features,function(index,feature){\n\n\t\t\t\t// TO DISPLAY GRAPHICS ON THE MAP\n\t\t\t\tvar graphic = feature;\n\t\t \n\t\t SimpleMarkerSymbol=new esri.symbol.PictureMarkerSymbol('images/esriRedPin_64x64.png', 48, 48);\n\t\t SimpleLineSymbol=new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH,new dojo.Color([255,0,0]), 3);\n\t\t SimpleFillSymbol=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([79,160,134]), 2),new dojo.Color([71,255,159,0.5]));\n\n\t\t switch (graphic.geometry.type)\n\t\t {\n\t\t case \"point\":\n\t\t graphic.setSymbol(SimpleMarkerSymbol);\n\t\t searchOutputGL_Point.add(graphic);\n\t\t break;\n\t\t case \"polyline\":\n\t\t graphic.setSymbol(SimpleLineSymbol);\n\t\t searchOutputGL_Polyline.add(graphic);\n\t\t break;\n\t\t case \"polygon\":\n\t\t graphic.setSymbol(SimpleFillSymbol);\n\t\t searchOutputGL_Polygon.add(graphic);\n\t\t break;\n\t\t }\n\n\n\t\t\t\t// TO DISPLAY RESULTS IN THE TABLE\n\t\t\t\t// Just to differentiate class name for each row, so that different syling can be applied in CSS\n\t\t\t\tindex%2 == 0 ? $('#tableBody-Query').append(\"<tr id='tableBodyRow-Query_\"+index+\"' class='tableBodyOddRow-Query'>\") : $('#tableBody-Query').append(\"<tr id='tableBodyRow-Query_\"+index+\"' class='tableBodyEvenRow-Query'>\") ;\n\n\t\t\t\t$.each(feature.attributes,function(field,value){\n\t\t\t\t\tif (field in fieldDomains){ // By default, the query results contain the Code, if the field is coded value domain. This code is written to display the values associated with them.\n\t\t\t\t\t\tdojo.forEach(fieldDomains[field], function(arrayValues){\n\t\t\t\t\t\t\tif (arrayValues.code == value){\n\t\t\t\t\t\t\t\t$('#tableBodyRow-Query_'+index).append(\"<td>\"+arrayValues.name+\"</td>\")\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\t$('#tableBodyRow-Query_'+index).append(\"<td>\"+value+\"</td>\")\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t$('#tableBody-Query').append(\"</tr>\");\n\n\t\t\t\t// On row click, zoom to the feature\n\t\t\t\t$('#tableBodyRow-Query_'+index).bind('click',function(){\n\t\t\t\t $('#tableBody-Query tr').removeClass(\"tableBodyRow-Selected\");\n\t\t zoomToRow(feature);\n\t\t $(this).addClass(\"tableBodyRow-Selected\");\n\t\t });\n\n\t\t \n\t\t\t});\n\n\t\t\t// If campus Tiled map service extent contains the Search output (polygon) extent, Set the map extent to the Search output (polygon)\n\t\t\tif (campusExtent.contains(esri.graphicsExtent(featureSet.features))){ \n\t\t map.setExtent(esri.graphicsExtent(featureSet.features));\n\t\t } else { // Else set the extent to campusExtent\n\t\t map.setExtent(campusExtent); \n\t\t }\t\n\t\t\t\t\t\t\n\t\t\t\n\t\t} else if (featureSet.features.length == 0){ // If 0 features returned\n\t\t\t$('#query_error').html(\"0 features returned.\");\n\n\t\t\t// Clear all the contents in the graphic layers (To clear off the previous query results) and hide the Query results window\n\t\t\tmap.getLayer(\"searchOutputGL_Point\").clear();\n\t\t\tmap.getLayer(\"searchOutputGL_Polyline\").clear();\n\t\t\tmap.getLayer(\"searchOutputGL_Polygon\").clear();\t\n\n\t\t\t$('#query-results').css('display','none');\n\n\t\t} else if ($(window).width() < 768) { // If the tool is run on mobile or any device whose screen width is < 768\n\t\t\t$('#query_error').html(\"Your device isn't compatible to display the results.\");\n\n\t\t\t// Clear all the contents in the graphic layers (To clear off the previous query results) and hide the Query results window\n\t\t\tmap.getLayer(\"searchOutputGL_Point\").clear();\n\t\t\tmap.getLayer(\"searchOutputGL_Polyline\").clear();\n\t\t\tmap.getLayer(\"searchOutputGL_Polygon\").clear();\t\n\n\t\t\t$('#query-results').css('display','none');\n\t\t}\n\t\t\n\t}, function(error){ // If there is any error with Query task\n\t\t$('#query_error').html(\"Unable to Query selected layer.\");\n\n\t\t// Clear all the contents in the graphic layers (To clear off the previous query results) and hide the Query results window\n\t\tmap.getLayer(\"searchOutputGL_Point\").clear();\n\t\tmap.getLayer(\"searchOutputGL_Polyline\").clear();\n\t\tmap.getLayer(\"searchOutputGL_Polygon\").clear();\t\n\n\t\t$('#query-results').css('display','none');\n\t});\n\n}", "title": "" }, { "docid": "b82209fbdfb88a46cf5e622cb63f25fa", "score": "0.5157946", "text": "function _createGeoQuery(queryOperator, shapeOperator, type, coordinates, maxDistance, minDistance) {\n\t\tvar obj ={_geolocation:{}}\n\t\tobj._geolocation[queryOperator] = {};\n\t\tobj._geolocation[queryOperator][shapeOperator] = {type:type, coordinates:coordinates}\n\t\tif(maxDistance){\n\t\t\tobj._geolocation[queryOperator].$maxDistance = maxDistance\n\t\t}\n\t\tif(minDistance){\n\t\t\tobj._geolocation[queryOperator].$minDistance = minDistance\t\n\t\t}\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "87480652ddc17c60dbd3e13e64cf736c", "score": "0.51403314", "text": "function loadData() {\n let query = new google.visualization.Query(POSITION_DB_URL);\n query.send(handleDataResponse);\n}", "title": "" }, { "docid": "5abf4745a1913d9c6ddb172a2ac4e7ab", "score": "0.5128334", "text": "function executeQuery()\n {\n\n // declares the query statment variable and grabs the string by calling advancedSearchSQLSetup()\n var queryStatement = advancedSearchSQLSetup();\n\n // mySQL will execute the query, using the login info given at the start of the JS\n // will contact the server and (if successful) will pull GPS values through to the map\n MySql.Execute(db_server, db_username, db_password, db_table, queryStatement, function process (data)\n {\n // if the query is not successful will display the error\n if(!data.Success)\n {\n alert(data.Error);\n }\n // if the query is successful and the values are not null\n // will call sendToGPS and send the coordinates to the map\n else if (data.Result[0] != null)\n {\n console.log(data);\n\n // declaring variables to store both latitude and longitude\n var latitude = data.Result[0].latitude;\n var longitude = data.Result[0].longitude;\n\n sendGPSToMap(latitude, longitude);\n hideDiv(\"roomDetailsAdvancedSearchDiv\");\n showDiv(\"studySpotMapDiv\");\n }\n // if the query displays results that are NULL, will notify user that the\n // query did not return any results that matched the criteria\n else\n {\n console.log(\"Your search did not return any results\");\n alert(\"Your search did not return any results\");\n\n sendGPSToMap(null,null); \n }\n\n }\n );\n\n \n }", "title": "" }, { "docid": "e30c7db314510662ec85b84c7882a3a8", "score": "0.5119903", "text": "function load_places_near(area_near, locations ,map2, img) {\n for (var i = 0; i < locations.length; i++) {\n var lat=locations[i].location.coordinates[1];\n var lng=locations[i].location.coordinates[0];\n var latLng= new google.maps.LatLng(lat , lng);\n var near= google.maps.geometry.poly.containsLocation(latLng, area_near);\n \n if (near===true){\n var market= new google.maps.Marker({\n position: latLng,\n map: map2,\n icon: img\n });\n var content= locations[i].name + ', Address: '+locations[i].address;\n var info = new google.maps.InfoWindow();\n \n var events= new events_marker(market, content, map2, info); \n }\n }\n}", "title": "" }, { "docid": "2a166d40b2cd568c9a9024a64f74ca8a", "score": "0.5107836", "text": "function work(map, startX, startY, endX, endY) {\n var graph = new Graph(map),\n start = graph.grid[startY][startX],\n end = graph.grid[endY][endX];\n postMessage(astar.search(graph, start, end));\n }", "title": "" }, { "docid": "d27af6596704e207404cae0179b77fee", "score": "0.51026934", "text": "function request_gemeinden_jq(polygon_category, epsilon_val, specific_location, specific_location_hierarchy){\n jQuery.ajax({\n url: ajaxurl, \n data:{\n action: \"send_location_info\",\n polygon_category : polygon_category,\n specific_location : specific_location,\n specific_location_hierarchy: specific_location_hierarchy\n },\n success: function(result){\n locations_info = JSON.parse(result);\n console.log(\"Array POlygon ids:\");\n console.log(locations_info);\n request_data_qj(locations_info[0],epsilon_val); \n }});\n}", "title": "" }, { "docid": "90a256e1bd643f7b54a1f019ecf24e20", "score": "0.5102279", "text": "function getPOI(rank,lng,lat){\n //Google Request\n var requestLocation = new google.maps.LatLng(lat,lng);\n var request = {\n location: requestLocation,\n radius: '100',\n type: ['point_of_interest']\n };\n service = new google.maps.places.PlacesService(map);\n service.nearbySearch(request, function(results, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n POI = results; // all the points of interest\n recommendName = POI[recommendResult].name;\n if(recommendName in recommend_name || !(POI[recommendResult].photos)){\n while(recommendName in recommend_name || !(POI[recommendResult].photos)){\n recommendResult++;\n recommendName = POI[recommendResult].name;\n }\n recommend_name[recommendName] = 1;\n }\n else{\n recommend_name[recommendName] = 1;\n }\n var address = POI[recommendResult].vicinity;\n document.getElementById(\"R-name\"+rank).innerHTML = recommendName;\n document.getElementById(\"R-address\"+rank).innerHTML = address;\n var photo_reference = POI[recommendResult].photos[0].getUrl();\n var picUrl = 'https://maps.googleapis.com/maps/api/place/photo?maxwidth=100&photoreference='+photo_reference+'&key=AIzaSyD_xrySG3MlQuGCwglYYeXztFQehgNGDbw';\n var picUrl = photo_reference;\n document.getElementById(\"R-pic\"+rank).style.backgroundImage = \"url('\"+picUrl+\"')\";\n directionLa[rank] = POI[recommendResult].geometry.location.lat();\n directionLn[rank] = POI[recommendResult].geometry.location.lng();\n createRoute(rank,directionLa[rank],directionLn[rank]);\n var current_destination_lat = directionLa[rank];\n var current_destination_lng = directionLn[rank];\n recommendResult = 0;\n var PointStart ={\n lat: current_user_lat,\n lng: current_user_lng\n }\n var PointDestination ={\n lat: current_destination_lat,\n lng: current_destination_lng\n }\n var distance = google.maps.geometry.spherical.computeDistanceBetween(\n new google.maps.LatLng(PointStart),\n new google.maps.LatLng(PointDestination)\n )\n distance = Math.round(distance);\n document.getElementById(\"R-dis\"+rank).innerHTML = '距離' + distance + '公尺';\n\n POI_point = {\n name: recommendName,\n address: address,\n photo: picUrl,\n lat: directionLa[rank],\n lng: directionLn[rank],\n distance: distance\n }\n POIs2.push({\n name: recommendName,\n address: address,\n photo: picUrl,\n lat: directionLa[rank],\n lng: directionLn[rank],\n distance: distance,\n rank: rank\n });\n POIs3.push({\n name: recommendName,\n address: address,\n photo: picUrl,\n lat: directionLa[rank],\n lng: directionLn[rank],\n distance: distance\n });\n }\n });\n}", "title": "" }, { "docid": "ff043dfd0e6f7166a4845f7ad92d9139", "score": "0.5101664", "text": "function getCoords() {\n userLocation.name = document.getElementById(\"locSelect\").value;\n //filter out the neighborhood that match the users location name and get from the latitude & longitude of it)\n let matchLat = neighborhoods.filter(matchHood => matchHood.name === userLocation.name).map(matchHood => matchHood.lat);\n userLocation.lat = matchLat[0];\n let matchLon = neighborhoods.filter(matchHood => matchHood.name === userLocation.name).map(matchHood => matchHood.lon);\n userLocation.lon = matchLon[0];\n}", "title": "" }, { "docid": "6d6da1c41b6e910468c28604fbdc3fcc", "score": "0.5097815", "text": "function Query(pattern, positions){\r\n\t\tthis.dataset = null;\r\n\t\tthis.pattern = pattern;\r\n\t\tthis.positions = positions;\r\n\t}", "title": "" }, { "docid": "968dd0192815c1afc26b653869cb734e", "score": "0.5091888", "text": "function findObjectsOnPath( d, x0, y0 ) {\n\n\t//console.log(\"findObjectsOnPath: inx0=\"+inx0+\", iny0=\"+iny0);\n\n\tvar objsOnPath = [];\n\n\t// xy0 = snapToShapeGrid({x:inx0,y:iny0});\n\t// var x0 = xy0.x;\n\t// var y0 = xy0.y;\n\n\tif ( debug == 1 ) {\n\t\tconsole.log(\"findObjectsOnPath: IN \"+stringForDir(d)+\", x0=\"+x0+\", y0=\"+y0);\n\t}\n\n\tfor (var i=0; i < reflectorGroup1.length; i++) {\n\t\tvar shape = reflectorGroup1.getAt(i);\n\t\tif ( shape.alive ) {\n\t\t\tif ( !isShapeOnPath2( shape, d, x0, y0 ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//console.log(\"findObjectsOnPath: shape.x=\"+shape.x+\", shape.y=\"+shape.y);\n\t\t\tobjsOnPath.push( shape );\n\t\t}\n\t}\n\n\t// sort objsOnPath so that the top of the array is the closest to x0/y0\n\tobjsOnPath.sort(function (a,b) {\n\t\tif ( d.isDown ) {\n\t\t\treturn a.y - b.y;\n\t\t} else if ( d.isUp ) {\n\t\t\treturn b.y - a.y;\n\t\t} else if ( d.isRight ) {\n\t\t\treturn a.x - b.x;\n\t\t}\n\t\treturn b.x - a.x;\n\t});\n\n\t// for debugging...\n\t// if ( objsOnPath.length > 0 ) {\n\t// \tconsole.log(\"findObjectsOnPath: showing objsOnPath\");\n\t// \tfor (var ii=0; ii < objsOnPath.length; ii++) {\n\t// \t\tconsole.log(\"findObjectsOnPath: objsOnPath[\"+ii+\"].x=\"+objsOnPath[ii].x+\", .y=\"+objsOnPath[ii].y);\n\t// \t}\n\t// }\n\n\treturn objsOnPath;\n}", "title": "" }, { "docid": "474347567c1a64f87403588fc69cec19", "score": "0.50911444", "text": "function findCoords(searchValue) {\n $.ajax({ \n url: \"http://open.mapquestapi.com/geocoding/v1/address?key=0GxkVNACX7ZbVYmlAotnqVBEvhPvDi1j&location=\" + searchValue,\n\n method: 'GET',\n }).then(function(data){\n\n // Gets the state name from data \n var state = data.results[0].locations[0].adminArea3\n\n // Gets coordinates from data \n var coords = data.results[0].locations[0].latLng\n\n // Function calls \n showMap(coords)\n fis(state)\n });\n }", "title": "" }, { "docid": "e58c08df87646b7c5a708557941ad2de", "score": "0.5088346", "text": "function visualize() {\n let found = a_star.getPath(grid.startNode, grid.targetNode);\n grid.fillNodes();\n grid.drawPath();\n isVisualized = true;\n}", "title": "" }, { "docid": "a07db51a085d4494255d08e8c7a65c40", "score": "0.50866026", "text": "async filterLocByType(itemValue){\n this.setState({\n isLoading: true,\n filter: itemValue,\n });\n // If the user picks 'all', display all recommended locations\n if(itemValue === 'all') {\n this.setState({\n distVals: []\n });\n for(var i = 0; i < this.state.photoDists.length; i++){\n calculated_dist = await getDistance(\n {latitude: this.state.latitude, longitude: this.state.longitude },\n {latitude: this.state.photoDists[i][1], longitude: this.state.photoDists[i][2]}\n );\n calculated_dist = await convertDistance(calculated_dist, 'mi');\n let distValsHistory = [...this.state.distVals];\n distValsHistory.push([this.state.photoDists[i][0], calculated_dist, this.state.photoDists[i][3], this.state.photoDists[i][4], this.state.photoDists[i][5]])\n this.setState({\n distVals: distValsHistory\n });\n }\n await this.sortLocations();\n await this.toArrayOfObjects();\n }\n // If the user picks any other value, only display the locations that match that type\n if(itemValue === 'beach' || itemValue === 'vista' || itemValue === 'hidden') {\n this.setState({\n distVals: []\n });\n for(var i = 0; i < this.state.photoDists.length; i++){\n if(this.state.photoDists[i][5] === itemValue) {\n calculated_dist = await getDistance(\n {latitude: this.state.latitude, longitude: this.state.longitude },\n {latitude: this.state.photoDists[i][1], longitude: this.state.photoDists[i][2]}\n );\n calculated_dist = await convertDistance(calculated_dist, 'mi');\n let distValsHistory = [...this.state.distVals];\n distValsHistory.push([this.state.photoDists[i][0], calculated_dist, this.state.photoDists[i][3], this.state.photoDists[i][4], this.state.photoDists[i][5]])\n this.setState({\n distVals: distValsHistory\n });\n }\n }\n await this.sortLocations();\n await this.toArrayOfObjects();\n }\n this.setState({\n isLoading: false\n });\n }", "title": "" }, { "docid": "e61c6c67fc5afa1d4f35a0b63bbaff66", "score": "0.5081913", "text": "function onResults(results) {\n // if (!results.poseLandmarks) {\n // grid.updateLandmarks([]);\n // return;\n // }\n\n canvasCtx.save();\n canvasCtx.clearRect(0, 0, canvasElement.width, canvasElement.height);\n canvasCtx.drawImage(\n results.image, 0, 0, canvasElement.width, canvasElement.height);\n drawConnectors(canvasCtx, results.poseLandmarks, POSE_CONNECTIONS,\n {color: '#00FF00', lineWidth: 4});\n drawLandmarks(canvasCtx, results.poseLandmarks,\n {color: '#FF0000', lineWidth: 2});\n canvasCtx.restore();\n // console.log(results.poseLandmarks)\n // grid.updateLandmarks(results.poseWorldLandmarks);\n}", "title": "" }, { "docid": "528b8c3ca2b6f18de1761cba785671a7", "score": "0.5080895", "text": "function record(devNum, query)\n\t{\n\t\tvar outputWindow = document.getElementById('dataPlane');\n\t\t\n\t\t// Reset background to gray in case the map was viewed\n\t\toutputWindow.innerHTML = \"\";\n\t\t\n\t\t// Initialize datapoints to 0\n\t\tvar CO2DataPoints = [{x: 1, y: 0}, {x: 2, y: 0}, {x: 3, y: 0}, {x: 4, y: 0}, {x: 5, y: 0}];\n\t\tvar tempFDataPoints = [{x: 1, y: 0}, {x: 2, y: 0}, {x: 3, y: 0}, {x: 4, y: 0}, {x: 5, y: 0}];\n\t\tvar tempCDataPoints = [{x: 1, y: 0}, {x: 2, y: 0}, {x: 3, y: 0}, {x: 4, y: 0}, {x: 5, y: 0}];\n\t\tvar humidityDataPoints = [{x: 1, y: 0}, {x: 2, y: 0}, {x: 3, y: 0}, {x: 4, y: 0}, {x: 5, y: 0}];\n\t\tvar lightDataPoints = [{x: 1, y: 0}, {x: 2, y: 0}, {x: 3, y: 0}, {x: 4, y: 0}, {x: 5, y: 0}];\n\t\tvar dpsMain = [CO2DataPoints, tempCDataPoints, tempFDataPoints, humidityDataPoints, lightDataPoints];\n\t\t\n\t\t// Set up containers for the graphs\n\t\tvar CO2Chart \t\t= createGraphContainer(\"CO2ChartContainer\", \"left\");\n\t\tvar tempCChart \t\t= createGraphContainer(\"tempCChartContainer\", null);\n\t\tvar tempFChart \t\t= createGraphContainer(\"tempFChartContainer\", \"left\");\n\t\tvar humidityChart \t= createGraphContainer(\"humidityChartContainer\", null);\n\t\tvar lightChart \t\t= createGraphContainer(\"lightChartContainer\", \"left\");\n\t\t\n\t\t// Add the graph containers to the web page\n\t\tdocument.getElementById('dataPlane').appendChild(CO2Chart);\n\t\tdocument.getElementById('dataPlane').appendChild(tempCChart);\n\t\tdocument.getElementById('dataPlane').appendChild(tempFChart);\n\t\tdocument.getElementById('dataPlane').appendChild(humidityChart);\n\t\tdocument.getElementById('dataPlane').appendChild(lightChart);\n\t\t\n\t\t// Create the graphs\n\t\tvar CO2Graph \t\t= createGraphs(\"CO2ChartContainer\", \"CO2 Level\", dpsMain[0], \"CO2 (ppm)\");\n\t\tvar tempFGraph \t\t= createGraphs(\"tempFChartContainer\", \"Temperature\", dpsMain[1], \"Temperature (F)\");\n\t\tvar tempCGraph \t\t= createGraphs(\"tempCChartContainer\", \"Temperature\", dpsMain[2], \"Temperature (C)\");\n\t\tvar humidityGraph \t= createGraphs(\"humidityChartContainer\", \"Humidity\", dpsMain[3], \"Humidity (%)\");\n\t\tvar lightGraph \t\t= createGraphs(\"lightChartContainer\", \"Light Intensity\", dpsMain[4], \"Light Intensity (Lumens)\");\n\t\t\n\t\tvar xVal = dpsMain[0].length + 1;\n\t\tvar yVal;\t\n\t\t\t\t\n\t\tfunction loop()\n\t\t{\n\t\t\trecordingEvent = setTimeout(function()\n\t\t\t{\n\t\t\t\tparseObject.fetch();\n\t\t\t\tvar sensorValues = parseObject.get(\"data\");\n\t\t\t\t\n\t\t\t\t// Add new data points\n\t\t\t\tdpsMain[0].push({x: xVal,y: + sensorValues[0]});\n\t\t\t\tdpsMain[1].push({x: xVal,y: + sensorValues[1]});\n\t\t\t\tdpsMain[2].push({x: xVal,y: + sensorValues[2]});\n\t\t\t\tdpsMain[3].push({x: xVal,y: + sensorValues[3]});\n\t\t\t\tdpsMain[4].push({x: xVal,y: + sensorValues[4]});\n\t\t\t\t\n\t\t\t\t// Inrease x-axis value by 1\n\t\t\t\txVal+= 1;\n\t\t\t\t\n\t\t\t\t// Make sure we only show 10 minutes of data\n\t\t\t\tif (dpsMain[1].length > 600 || xVal < 12 )\n\t\t\t\t{\n\t\t\t\t\tdpsMain[0].shift();\n\t\t\t\t\tdpsMain[1].shift();\n\t\t\t\t\tdpsMain[2].shift();\n\t\t\t\t\tdpsMain[3].shift();\n\t\t\t\t\tdpsMain[4].shift();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCO2Graph.render();\n\t\t\t\ttempCGraph.render();\n\t\t\t\ttempFGraph.render();\n\t\t\t\thumidityGraph.render();\n\t\t\t\tlightGraph.render();\n\t\t\t\t\n\t\t\t\tloop();\n\t\t\t\t\n\t\t\t}, 1000)}\n\t\t\t\n\t\tloop();\n\t}", "title": "" }, { "docid": "58908b80eeef20568c4efad57467f1b8", "score": "0.5077209", "text": "function whereAmIAsQuery(){\n\tvar w=whereAmI();\n\treturn \"panx=\"+w[0].toFixed(1)+\"&pany=\"+w[1].toFixed(1)+\"&zoom=\"+w[2].toFixed(1);\n}", "title": "" }, { "docid": "cb592950573ea64ba5ef4e62ab5d0148", "score": "0.5069418", "text": "function retrieveLocations(){\n\t//Retrieve location data from the sent data\n\tfor(var i=0;i<data.length;i++){\n\t\tlocations[i]=[];\n\t\tlocations[i].x=data[i].location.x;\n\t\tlocations[i].y=data[i].location.y;\n\t\tlocations[i].id=data[i].idPar;\n\t\tif(data[i].sensor!=null){\n\t\t\tlocations[i].free=data[i].sensor.Free;\n\t\t\tlocations[i].zone=data[i].sensor.Zone;\n\t\t\tlocations[i].disabled=data[i].sensor.Disabled;\n\t\t\tlocations[i].type=\"sensor\";\n\t\t}\n\t\telse if(data[i].garage){\n\t\t\t\n\t\t\tlocations[i].free=data[i].garage.Free;\n\t\t\tlocations[i].type=\"garage\";\n\t\t}\n\t}\n\tconsole.log(locations);\n\n}", "title": "" }, { "docid": "b46ce561672ac10f83859a2bee01e1b6", "score": "0.5066236", "text": "function singleLayerDrawQuery() {\n map.unByKey(clickListener);//画的时候将点击监听取消\n map.removeInteraction(draw);\n draw=null;\n vectorSource.clear();//清除\n //var iter = layer.getFeatures().values();\n //while (!(entry = iter.next()).done) {\n // layer.removeFeature(entry.value);\n //}\n //var value = typeSelect.value;\n var value=\"Polygon\";\n draw = new ol.interaction.Draw({\n source: vectorSource,\n type: /** @type {ol.geom.GeometryType} */ value\n //maxPoints: maxPoints\n });\n map.addInteraction(draw);\n\n draw.on('drawend',function(e){\n clickListener=map.on(\"click\",clickQuery);\n var out= e.feature.getGeometry().o;\n var points=[],len=out.length;\n for(var i=0;i<len/2;i++){\n var p=[out[i*2],out[i*2+1]];\n points.push(p);\n }\n var esriGeometry='{\"rings\":[[';\n for(var i=0;i<points.length;i++){\n esriGeometry+=\"[\"+points[i][0]+\",\"+points[i][1]+\"]\";\n if(i!=points.length-1){\n esriGeometry+=\",\";\n }\n }\n esriGeometry+=']],\"spatialReference\":{\"wkid\":4326}}';\n map.removeInteraction(draw);\n //{\"rings\":[[[120.41051441925049,30.10748317779541],[120.43815190093994,30.123619347229003],[120.45531803863526,30.107654839172362],[120.45154148834229,30.08619716705322],[120.44845158355713,30.062164574279784],[120.40399128692627,30.06250789703369],[120.41051441925049,30.10748317779541]]],\"spatialReference\":{\"wkid\":4326}}\n $.ajax('http://172.18.13.146/proxy/proxy.ashx?http://172.18.13.146:8399/arcgis/rest/services/trip_taxi/MapServer/0/query?text=', {\n type: 'GET',\n dataType: \"json\",\n data: {\n \"geometry\":esriGeometry,\n \"geometryType\":\"esriGeometryPolygon\",\n \"inSR\":4326,\n \"spatialRel\":\"esriSpatialRelIntersects\",\n \"where\":\"1=1\",\n \"returnGeometry\":\"true\",\n \"outSR\":4326,\n \"outFields\":\"*\",\n \"f\":\"pjson\"\n }\n }).done(function(resp){\n alert(\"查询到\"+resp.features.length+\"个出租车\");\n }).fail(function () {\n alert(\"fail loading layer!!!\")\n });// ajax end\n });// draw on end\n}// function singleLayerDrawQuery end", "title": "" }, { "docid": "ed22ee12659c956735233118b5861f64", "score": "0.50637674", "text": "function getLocation() {\n\t //The no-results class is removed when handleNoResults is called which is after every query\n\t $main.addClass('no-results');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n //Use session storage to store the location of a user so that we don't always have to be in this\n //Callback to get the location coordinates. This can be stored in statically because we can assume \n //He or she will be in one location, and session storage will be updated once you clear the browser\n sessionStorage.setItem('location.latitude', position.coords.latitude);\n sessionStorage.setItem('location.longitude', position.coords.longitude);\n algoliaHelper.setQueryParameter('aroundLatLng', pos.lat + ' , ' + pos.lng).search();\n }, function(){\n \t//There is an error getting the location for whatever reason\n \tlocationError();\n });\n } else {\n \tlocationError();\n }\n\t}", "title": "" }, { "docid": "405c2e297c6c2f0e295daa3650183bff", "score": "0.5042919", "text": "function showLocations(result){\n\tswitch (result){\n\t\tcase \"all\": //show all markers\n\t\t\tsetAllMap(null);\n\t\t\tsetAllMap(map);\n\t\tbreak;\n\t\tcase \"clear\": // clear all markers\n\t\t\tsetAllMap(null);\n\t\t\tmarkers = [];\n\t\tbreak;\n\t\tdefault:\n\t\t\tsetAllMap(null);\n\t\t\t//markers[result].setMap(map);\n\t\t\tcalcRoute(pyrmont, markers[result].position,result); //calculate distance and find route from current location to a certain place\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "82fbbedb850a02b1216a97c18d5e42b6", "score": "0.5040861", "text": "function MapUsers(field, label, sortOrder, element, shouldsearch) { //Removing for now due to Google Map 10 geocode / sec limit\n\nvar qElemList=[];\nvar qDataList=[];\nvar map;\nvar marker;\n\n\t//console.log(\"MapUsers fired\");\n var list;\n var listId;\n var $el = element;\n var existsInDOM = false;\n var selectedState = false;\n var openState = false;\n var searchable = shouldsearch || false;\n var labeltrim = label.replace(/\\s+/g, '').replace(/\\./g, '');\n\n\n var sort = field == 'DateRange' ? {\n \"qSortByNumeric\": 1\n } : {\n \"qSortByState\": 1,\n \"qSortByAscii\": 0,\n\t\"qSortByExpression\": -1,\n\t\"qExpression\": sortOrder\n };\n\n /**\n * Create the Qlik Sense Object\n * https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/EngineAPI/Content/GenericObject/PropertyLevel/ListObjectDef.htm\n * \n * Returns a promise which will call render once it's fulfilled.\n */\n app.createSessionObject({\n \"qInfo\": {\n \"qId\": \"\",\n \"qType\": \"ListObject\"\n },\n \"qListObjectDef\": {\n \"qLibraryId\": \"\",\n \"qShowAlternatives\": true,\n \"qDef\": {\n \"qFieldDefs\": [field],\n \"qSortCriterias\": [sort]\n },\n \"qInitialDataFetch\": [{\n \"qTop\": 0,\n \"qHeight\": 1000,\n \"qLeft\": 0,\n \"qWidth\": 1\n }]\n }\n }).then(function(reply) {\n list = reply;\n\t//console.log(list);\n render();\n });\n\n function render() {\n /**\n * Get the layout/data of the List Object\n */\n list.getLayout().then(function(layout) {\n //console.log(layout);\n listId = layout.qInfo.qId; \n \n//google.maps.event.addDomListener(window, 'load', initialize); \t\n \n var items = layout.qListObject.qDataPages[0].qMatrix;\n //var selected = layout.qListObject.qDimensionInfo.qStateCounts.qSelected;\n\t\t//console.log(items);\n\t\tvar map;\n\t\tvar marker;\n\n\t\t//console.log($el);\n\t\t// = layout.qListObject.qDataPages[0].qMatrix;\n\t\t//console.log(itemsData);\n\n\t\tinitialize();\n\t\tgrabData(items);\n\t \n });\n };\n \n // function sleep(miliseconds) {\n\t // console.log(\"Sleeping\");\n // var currentTime = new Date().getTime();\n\n // while (currentTime + miliseconds >= new Date().getTime()) {\n // }\n // //return;\n// }\n \n function initialize() {\n\t console.log(\"Initialize\");\n\t\tvar mapOptions = {\n\t\t\tcenter: new google.maps.LatLng(40.680898,-8.684059),\n\t\t\tzoom: 2,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t\t};\n\t\t\n\t\tmap = new google.maps.Map($el, mapOptions);\n }\n\n function grabData(items) {\n\t //console.log(\"GrabData\");\n\t //console.log(items);\n\t\tvar locationCounter = 0;\n\t\tvar lookupArray = [];\n\t\tvar arrayHolder = [];\n\t\titems.forEach(function(d, index) {\n\t\t\t//itemsData.push()\n\t\t\t//console.log(d);\n\t\t\tqElemList.push(d[0].qElemNumber);\n\t\t\tqDataList.push(d[0].qText);\n\t\t\t//console.log(d);\n\t\t\tif(d[0].qState==\"O\" || d[0].qState==\"S\") {\n\t\t\t\tlocationCounter +=1;\n\t\t\t\t//console.log(d[0].qText, d[0].qState);\n\t\t\t\tlookupArray.push(d[0].qText);\n\t\t\t\tif(locationCounter % 50 == 0) {\n\t\t\t\t\tarrayHolder.push(lookupArray);\n\t\t\t\t\tlookupArray = [];\n\t\t\t\t}\n\t\t\t\t//console.log(index, items.length);\n\n\t\t\t}\t\t\n\t\t\tif(index==items.length-1) {\n\t\t\t\tarrayHolder.push(lookupArray);\n\t\t\t\tsearchAddress(arrayHolder);\n\t\t\t}\t\t\t\n\n\t\t});\t \n }\n \n\tfunction searchAddress(addressGeoCode) {\n\t\t//console.log(\"SEARCHADDRESS CALLLED\");\n\t\t//var addressInput = addressGeoCode;//= document.getElementById('address-input').value;\n\t\tvar searchQuery;\n\t\t\n\t\t//console.log(addressGeoCode);\n\t\t\n\t\tvar connectionList = [];\n\t\t\n\t\taddressGeoCode.forEach(function(d, index) {\n\t\t\t//console.log(d, index);\n\t\t\tsearchQuery = \"\";\n\t\t\t//console.log(addressGeoCode[index]);\n\t\t\taddressGeoCode[index].forEach(function(data) {\n\t\t\t\t//console.log(data);\n\t\t\t\tsearchQuery += \"location=\" + data + \"&\";\n\t\t\t});\t\t\n\t\t\t\n\t\t\tconnectionList.push(searchQuery);\n\t\t\n\t\t});\n\t\t\n\t\t//console.log(connectionList);\n\t\t\n\t\tconnectionList.forEach(function(d) {\n\t\t\t$.get('http://www.mapquestapi.com/geocoding/v1/batch?key='+ mapQuestKey +'&'+ d + 'maxResults=1', function(data) {\n\t\t\t\t//console.log(data);\n\t\t\t\tfor (i = 0; i <=49; i++) { \n\t\t\t\t//console.log(data.results[i].locations[0]);\n\t\t\t\t\tif(data.results[i].locations[0].latLng.lat != undefined && data.results[i].locations[0].latLng.lng != undefined) {\n\t\t\t\t\t\tcreateMarker(data.results[i].locations[0].latLng.lat, data.results[i].locations[0].latLng.lng, data.results[i].providedLocation.location);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\t\n\t\t});\n\n\t\t\n\n\t}\n\n\tfunction createMarker(latitude,longitude, addressGeoCode) {\n\t//console.log(\"TRIGGERED CERATEMARKER\");\n\n\n\t\t//console.log(latitude, longitude, addressGeoCode);\n\t\tvar arrayPos = jQuery.inArray( addressGeoCode, qDataList );\n\n\n\n var pinImage = new google.maps.MarkerImage(\"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|\" + pinColor,\n new google.maps.Size(21, 34),\n new google.maps.Point(0,0),\n new google.maps.Point(10, 34));\t\t\n\t\t\n\t\t\n\t marker = new google.maps.Marker({\n\t\tmap: map,\n\t\tposition: {lat: latitude, lng: longitude},\n\t\ticon: pinImage,\n\t\ttitle: addressGeoCode,\n\t\tqElem: qElemList[jQuery.inArray( addressGeoCode, qDataList )]\n\t });\n\t \n\t google.maps.event.addListener(marker, 'click', function(value) {\n\t\t //console.log(this);\n\t\t select(this.qElem);\n\t\t //select() \n\t\t//console.log(marker.title);\n\t\t //console.log(jQuery.inArray( marker.title, qDataList ));\n\t\t// console.log(qDataList);\n\t\t //console.log(\"clicked\");\n\t });\n\t}\t \n\n /**\n * Select a value in the Qlik Sense Data Model.\n * Will trigger a update message to notify other objects to update accordingly.\n */\n function select(qElem) {\n list.selectListObjectValues(\"/qListObjectDef\", [+qElem], true).then(function(success) {\n //$('#clearfilter').addClass('active');\n pubsub.publish('update');\n }, function(error) {\n console.log(error);\n });\n }\n\n /**\n * Listen for messages and delegate actions.\n */\n var update = pubsub.subscribe('update', render);\n pubsub.subscribe('kill', function() {\n app.destroySessionObject(listId);\n pubsub.unsubscribe(update);\n });\n \n}", "title": "" }, { "docid": "4c8c3affaae7f7a0701c7d85023a966b", "score": "0.50321305", "text": "function calculatorAllLocation(){\n \t\tvar origin = [];\n \t\tfor(var i = 0; i < markers.length; i++){\n \t\t\torigin.push(new google.maps.LatLng(markers[i].getPosition().lat(), markers[i].getPosition().lng()));\n \t\t}\n\n\t\t \tservice.getDistanceMatrix({\n\t\t \t\torigins: origin,\n\t\t\t destinations: origin,\n\t\t\t travelMode: 'DRIVING',\n\t\t\t unitSystem: google.maps.UnitSystem.METRIC\n\t\t \t}, callback);\n \t}", "title": "" }, { "docid": "e3cf55b783340e43b142bcb6e65703fe", "score": "0.5028895", "text": "function sendQuery(sPoint, ePoint){\r\n\tvar sendData = {'client_id': client_id, 'startPoint': sPoint, 'endPoint': ePoint};\r\n\t$.ajax({\r\n\t\tasync: false,\r\n\t\tglobal: false,\r\n\t\turl: '/send_query',\r\n\t\tdata: sendData,\r\n\t\ttype: 'POST',\r\n\t\tdataType: \"text\",\r\n\t success: function(data) {\r\n\t\t$(\"#dataCanvas\").remove();\r\n\t\t$(\"#canvas\").append(\"<canvas id='dataCanvas' width='300' height='300'></canvas>\");\r\n\t\t$(\"#messageDiv\").empty();\r\n\t\tvar json = JSON.parse(data);\r\n\t\tvar lst = json.rect;\r\n\t\tvar glst = json.grect;\r\n\t\tif (json.type == \"error\"){\r\n\t\t\tconsole.log(\"There was a problem with your query input: \"+json.message);\r\n\t\t\t$(\"#messageDiv\").append(\"There was a problem with your query input: \"+json.message);\r\n\t\t\t$(\"#status\").dialog( \"close\" );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (json.type == \"results\"){\r\n\t\t\tvar sp = sPoint.split(\",\")\r\n\t\t\tvar scaleFactor = 500;\r\n\t\t\t//sp[0] = scaleFactor*parseFloat(sp[0]) + parseFloat(json.minVals[\"mx\"]);\t\r\n\t\t\tsp[0] = scaleFactor*parseFloat(json.sp.x) + parseFloat(json.minVals[\"mx\"]);\t\r\n\t\t\t//sp[1] = (scaleFactor*-1.0*parseFloat(sp[1])) + parseFloat(json.minVals[\"my\"]);\t\r\n\t\t\tsp[1] = (scaleFactor*-1.0*parseFloat(json.sp.y)) + parseFloat(json.minVals[\"my\"]);\t\r\n\t\t\tvar ep = ePoint.split(\",\");\r\n\t\t\tep[0] = scaleFactor*parseFloat(json.ep.x) + parseFloat(json.minVals[\"mx\"]);\r\n\t\t\tep[1] = (scaleFactor*-1.0 * parseFloat(json.ep.y)) + parseFloat(json.minVals[\"my\"]);\r\n\t\t\t\t\t\t\r\n\t\t\tvar canvas = document.getElementById('dataCanvas')\r\n\t\t\tvar ctx = null;\r\n\t\t\tif (canvas.getContext){\r\n\t\t\t\tctx = canvas.getContext('2d');\r\n\t\t\t} else {\r\n\t\t\t\t$(\"#messageDiv\").append(\"Your browser does not support the canvas object. Cannot draw results.\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tctx.beginPath();\r\n\t\t\tfor (var i = 0; i < glst.length ; i++){\r\n\t\t\t\tr = glst[i].res\r\n\t\t\t\tctx.rect(r[0],r[1],r[2],r[3]);\t\t\r\n\t\t\t}\r\n\t\t\tctx.stroke();\r\n\t\t\t\r\n\t\t\tif (lst.length > 1) {\r\n\t\t\t\t$(\"#messageDiv\").append(\"Your query was submitted successfully. Your number of results: \"+json.rect.length);\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.strokeStyle=\"#00FF00\";\r\n\t\t\t\tfor (var i = 0; i < lst.length ; i++){\r\n\t\t\t\t\tr = lst[i].res\r\n\t\t\t\t\tctx.rect(r[0],r[1],r[2],r[3]);\t\t\r\n\t\t\t\t}\r\n\t\t\t\tctx.stroke();\r\n\t\t\t} else {\r\n\t\t\t\t$(\"#messageDiv\").append(\"Your query was submitted successfully. No route can be found between your start and destination points.\");\r\n\t\t\t}\r\n\t\t\t// mark start and end in red\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.fillStyle=\"#FF0000\";\r\n\t\t\tctx.moveTo(sp[0], sp[1]);\r\n\t\t\tctx.arc(sp[0], sp[1],2,0,Math.PI*2,true);\r\n\t\t\tctx.moveTo(ep[0], ep[1]);\r\n\t\t\tctx.arc(ep[0], ep[1],2,0,Math.PI*2,true);\r\n\t\t\tctx.fill();\r\n\t\t\t//ctx.fillRect(sp[0], sp[1], 2,2);\t\t\r\n\t\t\t//ctx.fillRect(ep[0], ep[1], 2,2);\r\n\t\t} else {\r\n\t\t\tconsole.log('Missing message.type');\r\n\t\t}\r\n\t\t$(\"#status\").dialog( \"close\" );\r\n\t\treturn false;\r\n\t}\r\n\t,\r\n\terror: function(data) {\r\n\t\t$( \"#confirm\" ).html(\"Query could not be processed successfully. Likely too much data was requested and a timeout occurred.\");\r\n\t\t$( \"#confirm\" ).dialog({\r\n\t\t width:450,\r\n\t\t modal: true,\r\n\t\t buttons: {\t \r\n\t\t Close: function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#status\").dialog( \"close\" );\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$(this).dialog( \"close\" );\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\treturn false;\r\n\t\t }\r\n\t\t\t\t\t\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t} \r\n\t});\r\n\treturn true;\r\n}", "title": "" }, { "docid": "02f14e20e009f32697788c054d35de62", "score": "0.5018853", "text": "function loadAllPoints() {\n Points.query(function(result) {\n vm.points = result;\n vm.searchQuery = null;\n });\n }", "title": "" }, { "docid": "02f14e20e009f32697788c054d35de62", "score": "0.5018853", "text": "function loadAllPoints() {\n Points.query(function(result) {\n vm.points = result;\n vm.searchQuery = null;\n });\n }", "title": "" }, { "docid": "ff10e607bf60b0976f07b321c2d69b51", "score": "0.5013351", "text": "function buildMusicEventsQuery() {\n\t if( navigator.geolocation ) {\n\t\t navigator.geolocation.getCurrentPosition( function( position ) {\n\t\t\t\tvar myGeoLat = position.coords.latitude;\n\t\t\t\tvar myGeoLong = position.coords.longitude;\n\t\t\t\tvar lastFMQueryURI = \"http://ws.audioscrobbler.com/2.0/?method=geo.getevents&lat=\" + \n\t\t\t\t\t\t myGeoLat + \"&long=\" + myGeoLong + \"&limit=20\" + \"&api_key=\" + lastFMAPIKey;\n\t\t\t\t// The URI must be encoded for so the proxy will understand it\n\t\t\t\tvar encodedLastFMQueryURI = encodeURIComponent( lastFMQueryURI );\n\t\t\t\tvar completedMusicURI = proxyURI + encodedLastFMQueryURI;\n\t\t\t\t\n\t\t\t\t// The line below is only used for proxy testing\n\t\t\t\t// document.getElementById('uriHolder').appendChild( document.createTextNode( completedMusicURI ) );\n\t\t\t\t\n\t\t\t\tloadSomething( completedMusicURI, \"lastFM\" );\n\t\t }, function() {\n\t\t\t\talert( \"Geolocation music search failed.\" );\n\t\t } );\n\t } else {\n\t\t // Geolocation not supported\n\t\t alert( \"Geolocation is not supported by your browswer.\" );\n\t }\n}", "title": "" }, { "docid": "2d53836956fcba0acbf65ed24ebbec23", "score": "0.50080484", "text": "function drawGeofence() {\n //clearLists();\n indexPoint = -1;\n action = \"add\";\n $(\"#pcursor\").text(action);\n\n gpsLatLon = new GLatLng(47.643742,6.8565076);\n map.setCenter(gpsLatLon, 17);\n map.setUIToDefault();\n //map.clearOverlays();\n GEvent.clearListeners(map);\n GEvent.addListener(map, \"click\", getPoint);\n\n }", "title": "" }, { "docid": "26532402a4f6d6a89c4a76078b99047d", "score": "0.5000337", "text": "async getLocations()\r\n { \r\n // Find the subjects of all locations (from statements having type = 'location')\r\n let locations = this.store.match(null, NS_RDF('type'), NS_SCHEMA('Place'));\r\n\r\n // Build a list of all locations by fetching the location data from the locations URL (subject)\r\n let result = await Promise.all(locations.map(l => this.readLocationFromUrl(l.subject).catch(err => console.warn(err))));\r\n\r\n // Make sure we always get a consistent sort order\r\n result.sort((a,b) => (a.name ? a.name.localeCompare(b.name) : 0));\r\n\r\n return result; \r\n }", "title": "" }, { "docid": "a59913c6409dcd615351452fb112fb83", "score": "0.50002956", "text": "execute(delta, time) {\n // Iterate through all the entities on the query\n this.queries.moving.results.forEach(entity => {\n var velocity = entity.getComponent(Velocity);\n var position = entity.getMutableComponent(Position);\n position.x += velocity.x * delta;\n position.y += velocity.y * delta;\n \n if (position.x > canvasWidth + SHAPE_HALF_SIZE) position.x = - SHAPE_HALF_SIZE;\n if (position.x < - SHAPE_HALF_SIZE) position.x = canvasWidth + SHAPE_HALF_SIZE;\n if (position.y > canvasHeight + SHAPE_HALF_SIZE) position.y = - SHAPE_HALF_SIZE;\n if (position.y < - SHAPE_HALF_SIZE) position.y = canvasHeight + SHAPE_HALF_SIZE;\n });\n }", "title": "" }, { "docid": "d31de8820520b6a4dd4ccaf070dd70d9", "score": "0.4995823", "text": "function assembleQueryURL() {\n\n // Store the location of the truck in a variable called coordinates\n var coordinates = [startPoint];\n var distributions = [];\n keepTrack = [startPoint];\n\n // Create an array of GeoJSON feature collections for each point\n var restJobs = objectToArray(pointHopper);\n\n // If there are actually orders from this restaurant\n if (restJobs.length > 0) {\n\n // Check to see if the request was made after visiting the restaurant\n var needToPickUp = restJobs.filter(function(d, i) {\n return d.properties.orderTime > lastAtRestaurant;\n }).length > 0;\n\n // If the request was made after picking up from the restaurant,\n // Add the restaurant as an additional stop\n if (needToPickUp) {\n var restaurantIndex = coordinates.length;\n // Add the restaurant as a coordinate\n coordinates.push(alsoStartPoint);\n // push the restaurant itself into the array\n keepTrack.push(pointHopper.warehouse);\n }\n\n restJobs.forEach(function(d, i) {\n // Add dropoff to list\n keepTrack.push(d);\n coordinates.push(d.geometry.coordinates);\n // if order not yet picked up, add a reroute\n if (needToPickUp && d.properties.orderTime > lastAtRestaurant) {\n distributions.push(restaurantIndex + ',' + (coordinates.length - 1));\n }\n });\n }\n\n // Set the profile to `driving`\n // Coordinates will include the current location of the truck,\n console.log('mapbox being sent to api')\n console.log(coordinates)\n return 'https://api.mapbox.com/optimized-trips/v1/mapbox/driving/' + coordinates.join(';') + '?distributions=' + distributions.join(';') + '&overview=full&steps=true&geometries=geojson&source=first&access_token=' + mapboxgl.accessToken;\n}", "title": "" }, { "docid": "8a8cc422205f45bf50bf20fac74ab091", "score": "0.49939474", "text": "function assembleQueryURL() {\n // Store the location of the truck in a variable called coordinates\n var coordinates = [truckLocation];\n var distributions = [];\n keepTrack = [truckLocation];\n // Create an array of GeoJSON feature collections for each point\n var restJobs = objectToArray(pointHopper);\n // If there are actually orders from this restaurant\n if (restJobs.length > 0) {\n // Check to see if the request was made after visiting the restaurant\n var needToPickUp = restJobs.filter(function(d, i) {\n return d.properties.orderTime > lastAtRestaurant;\n }).length > 0;\n // If the request was made after picking up from the restaurant,\n // Add the restaurant as an additional stop\n if (needToPickUp) {\n var restaurantIndex = coordinates.length;\n // Add the restaurant as a coordinate\n coordinates.push(depoLocation);\n // push the restaurant itself into the array\n keepTrack.push(pointHopper.depo);\n }\n restJobs.forEach(function(d, i) {\n // Add dropoff to list\n keepTrack.push(d);\n coordinates.push(d.geometry.coordinates);\n // if order not yet picked up, add a reroute\n if (needToPickUp && d.properties.orderTime > lastAtRestaurant) {\n distributions.push(restaurantIndex + ',' + (coordinates.length - 1));\n }\n });\n }\n // Set the profile to `driving`\n // Coordinates will include the current location of the truck,\n return 'https://api.mapbox.com/optimized-trips/v1/mapbox/driving/' + coordinates.join(';') + '?distributions=' + distributions.join(';') + '&overview=full&steps=true&geometries=geojson&source=first&access_token=' + mapboxgl.accessToken;\n }", "title": "" }, { "docid": "a8bff76609549ce5082c8131e103ff02", "score": "0.49936444", "text": "function makeQuery(listData) {\n $.ajax({\n url: assembleQueryURL(listData),\n type: \"GET\"\n }).done(function(data) {\n //create a geojson feature collection\n var routeGeoJSON = turf.featureCollection([turf.feature(data.trips[0].geometry)]);\n\n //update the route source by getting the route source and setting the data equal to routeGeoJSON\n map.getSource(\"route\").setData(routeGeoJSON);\n });\n }", "title": "" }, { "docid": "03cfd0e864c620c7985d1a4c3aa3d2e8", "score": "0.4986224", "text": "searchThisArea() {\n const numConcurrentSearchThisAreaCalls =\n this.core.storage.get(StorageKeys.LOCATOR_NUM_CONCURRENT_SEARCH_THIS_AREA_CALLS);\n const updatedNumSearchThisAreaCalls = numConcurrentSearchThisAreaCalls + 1 || 1;\n this.core.storage.set(\n StorageKeys.LOCATOR_NUM_CONCURRENT_SEARCH_THIS_AREA_CALLS,\n updatedNumSearchThisAreaCalls\n );\n\n this.deselectAllResults();\n\n this._container.classList.remove('VerticalFullPageMap--showSearchThisArea');\n\n const mapProperties = this.core.storage.get(StorageKeys.LOCATOR_MAP_PROPERTIES);\n const center = mapProperties.visibleCenter;\n const radius = mapProperties.visibleRadius;\n const lat = center.latitude;\n const lng = center.longitude;\n\n const filterNode = ANSWERS.FilterNodeFactory.from({\n filter: {\n 'builtin.location': {\n '$near': { lat, lng, radius }\n }\n },\n remove: () => this.core.clearStaticFilterNode('SearchThisArea')\n });\n this.core.setStaticFilterNodes('SearchThisArea', filterNode);\n this.core.verticalSearch(this.verticalKey, {\n setQueryParams: true,\n resetPagination: true,\n useFacets: true\n });\n this.updateMostRecentSearchState();\n this.core.clearStaticFilterNode('SearchThisArea');\n }", "title": "" }, { "docid": "94f77f87d2af4617820dc66f66fa77e3", "score": "0.4985731", "text": "function createQuery(trace, from, to, showing){\n const line = trace.split(\" \");\n var query = '';\n var services = false;\n var global_total = false;\n var group = line[0];\n /* If trace is for global group total*/\n if (group == 'groups_total'){\n global_total = true\n var groups = [];\n var l = document.getElementsByName(group);\n var len = l.length\n for (var k = 0; k < len; k++){\n groups.push(l[k].value);\n }\n var measurement = line[1];\n query += `SELECT time,SUM(\"value\") FROM \"${measurement}\" WHERE `;\n for (var g = 0; g < groups.length; g++){\n query += `\"group\"='${groups[g]}'`;\n if(g != groups.length-1){\n query += ` OR `;\n }\n }\n }\n else{\n query += `SELECT time,value FROM `;\n }\n /* If trace is for service status*/\n if(line.length == 1){\n services = true;\n var measurement = line[0];\n query += `\"${measurement}\"`;\n }\n /* If trace is regular*/\n else if(line.length == 3 && !global_total){\n var cloud = line[1];\n var measurement = line[2];\n query += `\"${measurement}\" WHERE \"cloud\"='${cloud}' AND \"group\"='${group}'`;\n }else if(!services && !global_total){\n var measurement = line[1];\n query += `\"${measurement}\" WHERE \"group\"='${group}'`;\n }\n /* If requesting newest 30s of data*/\n if (to == 0){\n if(!services) query += ` AND time >= ${from}ms`;\n else query += ` WHERE time >= ${from}ms`;\n /* Default request is last 1 hour*/\n }else if (showing == false || (date-from) <= 3600000){\n if(!services) query += ` AND time >= ${date-3600000}ms`;\n else query += ` WHERE time >= ${date-3600000}ms`;\n /* If plot is showing*/\n }else{\n /* Check if trace is already plotted*/\n var index = -1;\n for(var x = 0; x < TSPlot.traces.length; x++){\n if (TSPlot.traces[x].name == trace){\n index = x;\n break;\n }\n }\n /* If trace is already plotted*/\n if(index == -1) to = date;\n if(!services){\n if(from > TSPlot.layout.xaxis.range[0])\tquery += ` AND time >= ${TSPlot.layout.xaxis.range[0]}ms AND time < ${to}ms`;\n else query += ` AND time >= ${from}ms AND time < ${to}ms`;\n }else{\n if(from > TSPlot.layout.xaxis.range[0])\tquery += ` WHERE time >= ${TSPlot.layout.xaxis.range[0]}ms AND time < ${to}ms`;\n else query += ` WHERE time >= ${from}ms AND time < ${to}ms`;\n }\n }\n /* Get db to sum over 30s periods*/\n if(global_total) query += ` GROUP BY time(30s)`;\n return query;\n}", "title": "" }, { "docid": "75888ca0e622c5812b28f2a6ed1a1561", "score": "0.49848664", "text": "function successGPSRequest(data){\n if (abortFeed == false && visibleBuses.length > 0 && data.data[371] !== undefined) {\n // Fire this request every 1 sec to get the real-time CatTran GPS feed\n setTimeout('getLiveGPSFeed([' + visibleBuses + '])',1000);\n catTranLocations.clear();\n\n // 371 is the agency code for University of Arizona, set by Transloc\n for (var i=0;i<data.data[371].length;i++){\n\n lat=data.data[371][i].location.lat;\n lng=data.data[371][i].location.lng;\n\n switch (data.data[371][i].route_id) {\n case \"8002924\": //USA/Downtown\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriBluePin_64x64.png', 48, 48);\n break;\n case \"8002000\": //Outer Campus Loop\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriGreenPin_64x64.png', 48, 48);\n break;\n case \"8002004\": //North/South\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriPurplePin_64x64.png', 48, 48);\n break;\n case \"8002916\": //Mountain Avenue\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriOrangePin_64x64.png', 48, 48);\n break;\n case \"8002012\": //Inner Campus Loop\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriTealPin_64x64.png', 48, 48);\n break;\n case \"8002920\": //Nightcat -- Need dark green symbol\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriBlackPin_64x64.png', 48, 48);\n break;\n case \"8002024\": //SE Off Campus/UA Mall -- Need pink symbol\n SimpleMarkerSymbolB=new esri.symbol.PictureMarkerSymbol('images/esriRedPin_64x64.png', 48, 48);\n break;\n }\n\n SimpleMarkerSymbolB.setOffset(0,23);\n //add current location to the map\n mapPoint=new esri.geometry.Point(lng,lat);\n catTranLocations.add(new esri.Graphic(mapPoint,SimpleMarkerSymbolB));\n\n }\n } else {\n stopLiveGPSFeed();\n }\n}", "title": "" }, { "docid": "85f34e941536a0e91b7fbf9669da5d0e", "score": "0.4982405", "text": "function loadLocationByFloor(svg, floor){\n for (var l in locations) {\n if (locations[l].floor == floor) {\n renderPolygons(svg, locations[l]);\n }\n }\n tooltipBtn();\n}", "title": "" }, { "docid": "2e6e1d99414bccd72dfed5074d9b8d35", "score": "0.49734905", "text": "function getData(location) {\n if (location.length === 5 && $.isNumeric(location)) {\n createWeatherGeoQuery(location);\n }\n else {\n createGeoWeatherQuery(location);\n }\n \n}", "title": "" }, { "docid": "2d3631916e591173fe6ee60a836cf80f", "score": "0.49729154", "text": "constructor(typ, callback, query, queryOr) {\n\n this.queries = [typ + this.AsQuery(query)]\n if (queryOr !== undefined) {\n this.queries.push(typ + this.AsQuery(queryOr));\n }\n this.callback = callback;\n this.lastRun = undefined;\n this.oldMinLat = 0;\n this.oldMaxLat = 0;\n this.oldMinLon = 0;\n this.oldMaxLon = 0;\n this.queryRunning = false;\n }", "title": "" }, { "docid": "97d227ffe846f05087e972d6eff9cf69", "score": "0.4970784", "text": "function QueryTool()\n {\n this.SERVER_ROOT = '/EWMDataServicesWeb/service/wtims';\n this.getWellInfoById = function (chosenwell, func)\n {\n $.ajax({\n url: this.SERVER_ROOT + \"/contour/getWellById\",\n data: {\n wellid: chosenwell\n },\n success: function (res) {\n func(res);\n }\n });\n };\n this.getWellsByName = function (wellids, func)\n {\n $.ajax({\n url: this.SERVER_ROOT + \"/contour/getWellsByNames\"\n , data: {wellnumbers: JSON.stringify(wellids)}\n , success: func\n });\n };\n\n this.initSearchAutoComplete = function (textid, func)\n {\n var self = this;\n $(textid).autocomplete({\n source: function (request, response) {\n var value = $(textid).val().trim();\n // value = value.replace(/\\s/g, '');\n $.ajax({\n url: self.SERVER_ROOT + \"/contour/autoComplete\",\n data: {\n param: value\n },\n success: function (data) {\n response(data);\n }\n });\n },\n minLength: 3,\n select: function (event, ui) {\n $(textid).val(ui.item.value);\n func();\n }\n });\n };\n\n this.doBufferSearch = function (newpoint, func)\n {\n var lat = newpoint.getLatitude();\n var lng = newpoint.getLongitude();\n\n var radius = $(\"#bufferTextbox\").val();\n var distance = 3;\n if (!isNaN(radius) && radius != \"\")\n distance = Number(radius);\n\n $.ajax({\n url: this.SERVER_ROOT + \"/contour/getBufferedPoints\",\n data: {\n lat: lat,\n lng: lng,\n distance: distance * 5280\n },\n success: function (results) {\n func(results, newpoint, distance);\n }\n });\n };\n\n this.getWellMeasurements = function (wellid, wellnames, func)\n {\n for (var i = 0; i < wellnames.length; i++)\n {\n if (wellnames[i] == null || wellnames[i] == undefined)\n wellnames[i] = \"\";\n }\n $.ajax({\n url: this.SERVER_ROOT + \"/contour/getTimeSeries\",\n data: {\n \"wellNumbers\": JSON.stringify(wellid),\n \"wellNames\": JSON.stringify(wellnames)\n },\n success: function (response) {\n func(response, wellid);\n }\n });\n };\n\n this.downloadWellData = function (wellids, func)\n {\n var data = '?wellids=' + encodeURIComponent(JSON.stringify(wellids));\n window.open(this.SERVER_ROOT + '/contour/downloadWellCSV' + data, '_blank');\n// $.ajax({\n// url: this.SERVER_ROOT + \"/contour/downloadWellCSV\",\n// data: {\n// \"wellids\": JSON.stringify(wellids)\n// },\n// success: function (response) {\n// func(response);\n// }\n// });\n };\n\n this.downloadTimeSeriesCSV = function (wellids, func)\n {\n var data = '?wellids=' + encodeURIComponent(JSON.stringify(wellids));\n window.open(this.SERVER_ROOT + '/contour/downloadTimeSeriesCSV' + data, '_blank');\n// $.ajax({\n// url: this.SERVER_ROOT + \"/contour/downloadTimeSeriesCSV\",\n// data: {\n// \"wellids\": JSON.stringify(wellids)\n// },\n// success: function (response) {\n// func(response);\n// }\n// });\n };\n }", "title": "" }, { "docid": "6eb5d3a4fbe9781a2a7c90a6c6b7cdde", "score": "0.4967989", "text": "function ShapeFilter(){\n // pull data for UFO sightings \n var filterUFOshape = UFOsighting\n d3.event.preventDefault();\n\n // Set up a variable to hold the UFO shape entered by user\n var userShape=d3.select(\"#shape\").property(\"value\");\n\n // Use input from field to filter the data for shape\n // if user enters a shape, filter data to include sightings that match the criteria\n if(userShape) {\n filterUFOshape=filterUFOshape.filter(item => item.shape===userShape);\n };\n\n // run the createTable function with the filtered data\n createTable(filterUFOshape);\n}", "title": "" }, { "docid": "dc5ebdf7f824991c41eae51e4fefb55a", "score": "0.4967635", "text": "function init() {\n dojo.connect(grid, \"onRowClick\", onRowClickHandler);\n //Create Find Task using the URL of the map service to search\n dojo.connect(map, \"onLoad\");\n findTask = new esri.tasks.FindTask(\"http://localhost:6080/arcgis/rest/services/DLRC_Malawi/DLRC_Operational_Layers/MapServer\");\n //Define the find parameters\n findParams = new esri.tasks.FindParameters();\n findParams.returnGeometry = true;\n /*\n * The below parameters has been greyed out\n * \n * //findParams.layerIds =[2];\n * \n * It is defined in the function processServiceInfo(sel) found in querysel function\n */\n\n //Define search fields on the so defined layer\n findParams.searchFields = [\"scheme\", \"OBJECTID\"];\n //define srid to be that of the \n findParams.outSpatialReference = map.spatialReference;\n //Write to the console\n //console.log(\"find sr: \", findParams.outSpatialReference);\n //for details on setting up a proxy page.\n esri.config.defaults.io.proxyUrl = \"/proxy\";\n esri.config.defaults.io.alwaysUseProxy = false;\n\n //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications\n esri.config.defaults.geometryService = new esri.tasks.GeometryService(\"http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer\");\n //Initialize measure functionality\n measure(map);\n\n}", "title": "" }, { "docid": "ebc3c0db061d5013a45a5a95eb56322d", "score": "0.49674857", "text": "function drawPoints() {\n var offset = new MM.Point(0, 0);\n for (var i = 0; i < locations.length; i++) {\n var point = map.locationPoint(locations[i]);\n if (!locations[i].pointDiv) {\n locations[i].pointDiv = document.createElement('div');\n locations[i].pointDiv.className = 'wax-point-div';\n locations[i].pointDiv.style.position = 'absolute';\n locations[i].pointDiv.style.display = 'block';\n // TODO: avoid circular reference\n locations[i].pointDiv.location = locations[i];\n // Create this closure once per point\n bean.add(locations[i].pointDiv, 'mouseup',\n (function selectPointWrap(e) {\n var l = locations[i];\n return function(e) {\n MM.removeEvent(map.parent, 'mouseup', mouseUp);\n pointselector.deleteLocation(l, e);\n };\n })());\n map.parent.appendChild(locations[i].pointDiv);\n }\n locations[i].pointDiv.style.left = point.x + 'px';\n locations[i].pointDiv.style.top = point.y + 'px';\n }\n }", "title": "" }, { "docid": "f552ad63029d8a18880768cae31d9ac1", "score": "0.49669695", "text": "function buildSocialEventsQuery() {\n\t if( navigator.geolocation ) {\n\t\t navigator.geolocation.getCurrentPosition( function( position ) {\n\t\t\t\tvar myGeoLat = position.coords.latitude;\n\t\t\t\tvar myGeoLong = position.coords.longitude;\n\t\t\t\tvar eventfulQueryURI = \"http://api.eventful.com/rest/events/search?app_key=\" +\n\t\t\t\t\t eventfulAPIKey + \"&where=\" + myGeoLat + \",\" + myGeoLong + \"&within=25\";\n\t\t\t\t// The URI must be encoded for so the proxy will understand it\n\t\t\t\tvar encodedEventfulQueryURI = encodeURIComponent( eventfulQueryURI );\n\t\t\t\tvar completedEventfulURI = proxyURI + encodedEventfulQueryURI;\n\t\t\t\t\n\t\t\t\t// The line below is only used for proxy testing\n\t\t\t\t// document.getElementById('uriHolder').appendChild( document.createTextNode( completedEventfulURI ) );\n\t\t\t\t\n\t\t\t\tloadSomething( completedEventfulURI, \"eventful\" );\n\t\t }, function() {\n\t\t\t\talert( \"Geolocation event search failed.\" );\n\t\t } );\n\t } else {\n\t\t // Geolocation not supported\n\t\t alert( \"Geolocation is not supported by your browswer.\" );\n\t }\n}", "title": "" }, { "docid": "d28857dd78182e5cd3fff2d48a8ebf6c", "score": "0.49649897", "text": "function queryData() {\n if(typeOfHomicide === \"DWRH\") {\n var maptitle = maptitle_dwrh;\n\tvar homstr = \"drh\";\n\tvar homstr_as = \"drh\";\n\tvar ratestr = \"rate\";\n } else { \n\tvar maptitle = homicides_text + \" \";\n\tif (!adjustHom) {\n\t var homstr = \"hom\";\n\t var homstr_as = \"hom\";\n\t var ratestr = \"homrate\";\n\t}\n\telse {\n\t var homstr = \"hom_imputed\";\n\t var homstr_as = \"hom\";\n\t var ratestr = \"homrate\";\n\t}\n }\nvar queryCartodb = \"SELECT sum(\" + homstr + \") AS \" + homstr_as + \", MAX(ST_X(the_geom)) AS long, MAX(ST_Y(the_geom)) as lat, name, ROUND(AVG(pop)) as pop FROM homicides_web WHERE date BETWEEN DATE '\" +startDate+\"' AND DATE '\"+ endDate +\"' AND \" + homstr + \" > 0 GROUP BY name ORDER BY \" + homstr_as + \" DESC\";\n\n $.getJSON(baseURLCartodb + encodeURIComponent(queryCartodb) + \"&callback=?\",function(result){\n\t\t coordData = result;\n\t\t //overlay.crimes.splice(0, overlay.crimes.length);\n\t\t overlay.crimes.length = 0;\n\t\t //var startTime = new Date();\n\t\t for(var i =0; i<result.rows.length;i++) {\n\t\t \n\t\t \n\t\t overlay.crimes[i] = ({lat : result.rows[i][\"lat\"], lon: result.rows[i][\"long\"], latlon: new google.maps.LatLng(result.rows[i][\"lat\"], result.rows[i][\"long\"]), code: result.rows[i][homstr_as], name:result.rows[i][\"name\"], rate:result.rows[i][homstr_as]/result.rows[i][\"pop\"] * 100000 * 12/numMonths, pop:result.rows[i][\"pop\"]\n});\n\t\t \n\t\t }\n\t\t \n\t\t //var endTime = new Date();\n\t\t \n\t\t //alert(endTime-startTime);\n\t\t overlay.draw();\n\t\t $(\"#map-dates\").\n\t\t text(maptitle + monthName[new Date(startDate).getMonth()] + \" \"+ new Date(startDate).getFullYear() + \" – \" + monthName[new Date(endDate).getMonth()] + \" \"+ new Date(endDate).getFullYear());\n\t });\n}", "title": "" }, { "docid": "29d6180b4a09c221ba32b0f7d9b6e3e9", "score": "0.4964073", "text": "function MapLocations() {\t\n\tfor (var i = 0; i < data.length; i++) {\n\t\tvar dist = mathMod.Distance(currLocation, data[i]);\n\t\tvar horizAngle = mathMod.Bearing(currLocation, data[i]);\n\t\t\n\t\tvar ro = 28 * dist / maxDist;\n\t\tvar centerX = 28 + ro * Math.sin(horizAngle);\n\t\tvar centerY = 28 - ro * Math.cos(horizAngle);\n\n\t\tvar circView = Ti.UI.createView({\n\t\t\theight: 4,\n\t\t\twidth: 4,\n\t\t\tbackgroundColor: \"#fff\",\n\t\t\tborderRadius: 2,\n\t\t\ttop: centerY - 2,\n\t\t\tleft: centerX - 2\n\t\t});\n\t\tcircleView.add(circView);\n\t}\n}", "title": "" }, { "docid": "65ff8a3152b30b693c8b9c0732e8d998", "score": "0.4953856", "text": "function generateCube() {\n\n\n //Set style for placemark icon, placemark label, and line string\n //Placemark icon can be anything\n var icon = ge.createIcon('');\n icon.setHref('http://maps.google.com/mapfiles/kml/paddle/red-circle.png');\n var style = ge.createStyle('');\n style.getIconStyle().setIcon(icon);\n style.getIconStyle().setScale(2);\n style.getLabelStyle().setScale(5);\n style.getLineStyle().getColor().set('9900ffff');\n style.getLineStyle().setWidth(0.5);\n\n var gpsList = [];\n\n //Generate 10 random latitude, longtitude, and altitude triplets\n //Latitude and longitude in degrees, altitude in meters\n //Needs to be replaced with real data\n for (i = 0; i < 10; i++) {\n var a = Math.floor(Math.random() * 180) - 90;\n var b = Math.floor(Math.random() * 360) - 180;\n var c = Math.floor(Math.random() * 700000) + 500000;\n gpsList[i] =\n {\n lat : a,\n lon : b,\n alt : c\n };\n }\n\n //Attempt at using real data\n //Note: altitude from positionGD is in km\n var numTLE = (Search.TLE).length;\n var tleLine1;\n var tleLine2;\n var satRec;\n var posVelocity;\n var timeNow = new Date();\n var yearUTC = timeNow.getUTCFullYear();\n var monthUTC = timeNow.getUTCMonth() + 1;\n var dayUTC = timeNow.getUTCDate();\n var hourUTC = timeNow.getUTCHours();\n var minuteUTC = timeNow.getUTCMinutes();\n var secondUTC = timeNow.getUTCSeconds();\n var positionECI;\n var positionGD;\n var gmst = satellite.gstime_from_date(yearUTC,monthUTC,dayUTC,hourUTC,minuteUTC,secondUTC); \n for (i = 0; i < numTLE; i++)\n {\n tleLine1 = (Search.TLE).TLE_LINE1;\n tleLine2 = (Search.TLE).TLE_LINE2;\n //satRec = satellite.twoline2satrec(tleLine1,tleLine2);\n //posVelocity = satellite.propagate(satRec,yearUTC,monthUTC,dayUTC,hourUTC,minuteUTC,secondUTC);\n //positionECI = posVelocity.position;\n //positionGD = satellite.eci_to_geodetic(positionECI, gmst);\n gpsList[i+10] =\n {\n //lat : satellite.degrees_lat(positionGD.latitude),\n //lon : satellite.degrees_long(positionGD.longitude),\n //alt : (positionGD.height / 1.609) * 5280\n };\n } \n\n //Initialize arrays and other variables\n var coords = gpsList;\n var coordsCount = coords.length;\n var latsum = 0.0;\n var lonsum = 0.0;\n var placemark;\n var point;\n var balloon = [];\n var cubePlacemark;\n var multiGeometry;\n var radius = 1.5;\n var height = 150000;\n var minLat;\n var maxLat;\n var minLong;\n var maxLong;\n var minAlt;\n var maxAlt;\n var temp;\n //var lineString;\n //var lineStringPlacemark;\n\n //Goes through all latitude, longitude, altitude triplets\n for (j = 0; j < coordsCount; j++) {\n //Create and set point for placemark\n point = ge.createPoint('');\n point.setLatitude(coords[j].lat);\n point.setLongitude(coords[j].lon);\n point.setAltitude(coords[j].alt);\n point.setAltitudeMode(ge.ALTITUDE_ABSOLUTE);\n //Create and set placemark\n placemark = ge.createPlacemark('');\n placemark.setStyleSelector(style);\n placemark.setName(\"sat\" + j);\n placemark.setDescription(\"lat: \" + coords[j].lat + \"\\nlongitude: \" + coords[j].lon);\n placemark.setGeometry(point);\n\n latsum += coords[j].lat;\n lonsum += coords[j].lon;\n\n //Add placemark to map\n //ge.getFeatures().appendChild(placemark); \n\n //create placemark for cube\n cubePlacemark = ge.createPlacemark('');\n cubePlacemark.setName(\"sat\" + j);\n cubePlacemark.setDescription(\"latitude: \" + coords[j].lat + \" degrees\" + \"\\nlongitude: \" +\n coords[j].lon + \" degrees\" + \"\\naltitude: \" + coords[j].alt\n \t + \" feet\");\n\n //define dimensions for cube\n minAlt = coords[j].alt - height;\n maxAlt = coords[j].alt + height;\n minLat = latMin(coords[j].lat, radius);\n maxLat = latMax(coords[j].lat, radius);\n minLong = longMin(coords[j].lon, radius);\n maxLong = longMax(coords[j].lon, radius);\n\n if (minLat > maxLat)\n {\n\t temp = maxLat;\n\t maxLat = minLat;\n\t minLat = temp;\n }\n if (minLong > maxLong)\n {\n\t temp = maxLong;\n\t maxLong = minLong;\n\t minLong = temp;\n }\n\n //set coordinates for all six faces of cube\n multiGeometry = ge.createMultiGeometry('');\n multiGeometry.getGeometries().appendChild(cubeSide(minLat,maxLat,minLong,maxLong,minAlt,maxAlt,1));\n multiGeometry.getGeometries().appendChild(cubeSide(minLat,maxLat,minLong,maxLong,minAlt,maxAlt,2));\n multiGeometry.getGeometries().appendChild(cubeSide(minLat,maxLat,minLong,maxLong,minAlt,maxAlt,3));\n multiGeometry.getGeometries().appendChild(cubeSide(minLat,maxLat,minLong,maxLong,minAlt,maxAlt,4));\n multiGeometry.getGeometries().appendChild(cubeSide(minLat,maxLat,minLong,maxLong,minAlt,maxAlt,5));\n multiGeometry.getGeometries().appendChild(cubeSide(minLat,maxLat,minLong,maxLong,minAlt,maxAlt,6));\n\n\n cubePlacemark.setGeometry(multiGeometry);\n cubePlacemark.setStyleSelector(style);\n\n ge.getFeatures().appendChild(cubePlacemark);\n\n //Create and set a line string\n //lineStringPlacemark = ge.createPlacemark('');\n\n //lineString = ge.createLineString('');\n //lineStringPlacemark.setGeometry(lineString);\n //lineString.setAltitudeMode(ge.ALTITUDE_ABSOLUTE);\n\n //lineString.getCoordinates().pushLatLngAlt(coords[j].lat, coords[j].lon, 0);\n //lineString.getCoordinates().pushLatLngAlt(coords[j].lat, coords[j].lon, coords[j].alt);\n\n //lineStringPlacemark.setStyleSelector(style);\n\n //Add line string to map\n //ge.getFeatures().appendChild(lineStringPlacemark);\n\n\t\n //Failed attempt at editing balloon window size\n //Could use html and css to edit balloon text and background\n //balloon[j] = ge.createHtmlStringBalloon('');\n //balloon[j].setFeature(lineStringPlacemark[j]);\n //balloon[j].setMinWidth(200);\n //balloon[j].setMaxHeight(300);\n //balloon[j].setCloseButtonEnabled(false);\n }\n\n //new viewpoint\n var lookAt = ge.createLookAt('');\n lookAt.set(latsum / coordsCount, lonsum / coordsCount, 14000000,\n ge.ALTITUDE_RELATIVE_TO_GROUND,0,0,20000);\n ge.getView().setAbstractView(lookAt);\n}", "title": "" }, { "docid": "006adaa192308e7f0b59e7dcb7726078", "score": "0.49537385", "text": "function searchPoiBasedArea(){\r\r\n\t\r\r\n\tif(validateSearchArea())\r\r\n\t{\r\r\n\t showSlider = false;\r\r\n\t infoWindowClose();\r\r\n\t \r\r\n\t uncheckAllCategoryCheckbox();\r\r\n\t cleanSearchInformation();\r\r\n\t cleanListDestination();\r\r\n\t \r\r\n\t // parameter area\r\r\n\t area = dojo.byId('selectedArea').value;\r\r\n\t\r\r\n\t // animate after search di dalam method getPoiBasedArea\r\r\n\t animateBeforeSearch(\"loading-place\"); \r\r\n\t \r\r\n\t getAreaCoordinate(area);\r\r\n\t getPoiBasedArea(area);\r\r\n\t}\r\r\n \r\r\n}", "title": "" }, { "docid": "448b66b6c28415fae95b78236c16d011", "score": "0.49530247", "text": "async function searchByCategory() {\n\t\t\tconst withinParam = `${latitude},${longitude}`;\n\t\t\tconst searchResults = await phqEvents.search({\n\t\t\t\t'location_around.origin': withinParam,\n\t\t\t\tcategory\n\t\t\t});\n\n\t\t\treturn searchResults.result.results;\n\t\t}", "title": "" }, { "docid": "bcfff25bd34b0e22f0b0cc2e3119cb97", "score": "0.4949841", "text": "function doQuery(point) {\n if (!point || !point.xid) return $q.reject('no point');\n \n var url;\n if ($scope.firstLast === 'true') {\n \turl = '/rest/v1/point-values/' + encodeURIComponent(point.xid) +\n '/first-last';\n } else {\n \turl = '/rest/v1/point-values/' + encodeURIComponent(point.xid) +\n '/statistics';\n }\n var params = [];\n \n var now = new Date();\n var from = Util.toMoment($scope.from, now, $scope.dateFormat);\n var to = Util.toMoment($scope.to, now, $scope.dateFormat);\n \n var result = {\n \tpoint: point\n };\n \n if (from.valueOf() === to.valueOf()) {\n \treturn {\n \t\tpromise: $q.when(result),\n \t\tcancel: angular.noop\n \t};\n }\n \n params.push('from=' + encodeURIComponent(from.toISOString()));\n params.push('to=' + encodeURIComponent(to.toISOString()));\n params.push('useRendered=true');\n \n for (var i = 0; i < params.length; i++) {\n url += (i === 0 ? '?' : '&') + params[i];\n }\n\n var cancelDefer = $q.defer();\n \t\t\tvar cancelFn = cancelDefer.resolve;\n \t\t\tsetTimeout(cancelFn, $scope.timeout || mangoTimeout);\n \n var promise = $http.get(url, {\n \ttimeout: cancelDefer.promise,\n headers: {\n 'Accept': 'application/json'\n }\n }).then(function(response) {\n \tvar data = response.data;\n \t\n \tif (data.startsAndRuntimes) {\n \t\tfor (i = 0; i < data.startsAndRuntimes.length; i++) {\n \t\t\tvar statsObj = data.startsAndRuntimes[i];\n \t\t\tvar valueRenderer = point.valueRenderer(statsObj.value);\n \t\t\tif (!valueRenderer) continue;\n \t\t\tstatsObj.renderedValue = valueRenderer.text;\n \t\t\tstatsObj.renderedColor = valueRenderer.colour;\n \t\t}\n \t}\n \t\n \tresult.stats = data;\n \treturn result;\n });\n \n return {\n \tpromise: promise,\n \tcancel: cancelFn\n };\n }", "title": "" }, { "docid": "237ae2752a6433f5c47d9678e1b24934", "score": "0.49494022", "text": "function findLocations() {\n allPushpins = [];\n map.entities.clear();\n\n //Don't start getting all the provider locations until we know our current location.\n //This is so we can calculate the distance to the providers.\n getLocation();\n }", "title": "" }, { "docid": "8cb47ec606f5da498f71f17db8e3193f", "score": "0.49484688", "text": "function findPlaces(category, pt) {\n fetch(\"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?\", {\n method: 'POST',\n headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},\n body:serialize({ \n \"f\":\"json\",\n \"category\":category, \n \"location\": pt.longitude+\",\"+pt.latitude,\n \"outFields\": \"Place_addr, PlaceName\",\n \"maxLocations\": \"30\" \n })\n }).then(function(response){return response.json()})\n //locator.addressToLocations({\n //location: pt,\n //categories: [category],\n //maxLocations: 30,\n //outFields: [\"Place_addr\", \"PlaceName\"]\n //})\n .then(function(results) {\n // console.log(results);\n view.popup.close();\n view.graphics.removeAll();\n results[\"candidates\"].filter(function(element, index){\n if(index !==0 && index !==29){\n return true;\n }\n else{\n console.log(element);\n return false;\n }\n }).map(function(result, index){\n //results.forEach(function(result){\n\t\t\t\t\tresult.location.type = \"point\";\n view.graphics.add(\n new Graphic({\n attributes: result.attributes,\n geometry: result.location,\n symbol: {\n type: \"simple-marker\",\n color: \"#660000\",\n size: \"18px\",\n outline: {\n color: \"#6f42c1\",\n width: \"4px\"\n }\n },\n popupTemplate: {\n //title: result.attributes.PlaceName,\n //content: result.attributes.Place_addr\n \n title: \"{PlaceName}\"+\" - \"+ index,\n content: \"{Place_addr}\"\n }\n }));\n });\n\n });\n }", "title": "" }, { "docid": "95afadf59946ca542d0da3adddfee2f5", "score": "0.49426985", "text": "function queryMaps() {\n var url = \"http://maps.google.com/maps/geo?q=\";\n url += encodeURIComponent(options.getValue(OPT_CITY)).replace(\" \",\"+\");\n url += \"&output=xml&key=\" + MAPS_KEY;\n\n try {\n var http = new XMLHttpRequest();\n http.onreadystatechange = HTTPData;\n http.open(\"GET\", url, true);\n http.send(null);\n } catch(err) {\n debug.error(\"cannot connect\");\n options.putValue(OPT_ADDRESS, \"\");\n options.putValue(OPT_CITY, \"\");\n options.putValue(OPT_COORD, kDefaultCoord);\n shiftMap(kDefaultCoord);\n eMapTime.align = \"center\";\n eCity.innerText = \"\";\n return;\n }\n\n function HTTPData() {\n var feed;\n\n if (http.readyState == 4) {\n parseCoords(http.responseXML);\n } else {\n return;\n }\n }\n}", "title": "" }, { "docid": "34038ddafc6cba817f235e85faa65c51", "score": "0.49373066", "text": "initPainter(expressions, expressionClasses, queryParam) {\n const state = this.state;\n const query = {\n q: queryParam,\n type: 'Pathway'\n };\n\n\n // const uri = 'http://identifiers.org/reactome/R-HSA-5389840';\n\n // if (uri != null) {\n // const expressionTable = createExpressionTable(expressions, expressionClasses);\n // const header = expressionTable.header;\n\n // apiCaller.getGraphAndLayout(uri, 'latest').then(response => {\n // state.cy.remove('*');\n // state.cy.add({\n // nodes: _.get(response, 'graph.nodes', []),\n // edges: _.get(response, 'graph.edges', [])\n // });\n\n\n // if (!_.isEmpty(response.layout)) {\n // state.cy.layout({\n // name: 'preset',\n // positions: node => response.layout[node.id()],\n // animate: true,\n // animationDuration: 500\n\n // }).run();\n // } else {\n // state.cy.layout({\n // name: 'cose-bilkent',\n // randomize: false,\n // nodeDimensionsIncludeLabels: true,\n // nodeRepulsion: 5000 * state.cy.nodes().size()\n // }).run();\n // }\n\n // this.setState({\n // selectedClass: _.get(header, '0', null),\n // expressionTable: expressionTable,\n // name: _.get(response, 'graph.pathwayMetadata.title', 'N/A'),\n // datasource: _.get(response, 'graph.pathwayMetadata.dataSource.0', 'N/A'),\n // // searchResults: searchResults\n // }, () => this.applyExpressionData());\n // });\n // }\n\n apiCaller.querySearch(query).then(searchResults => {\n const uri = _.get(searchResults, '0.uri', null);\n\n if (uri != null) {\n const expressionTable = createExpressionTable(expressions, expressionClasses);\n const header = expressionTable.header;\n\n apiCaller.getGraphAndLayout(uri, 'latest').then(response => {\n state.cy.remove('*');\n state.cy.add({\n nodes: _.get(response, 'graph.nodes', []),\n edges: _.get(response, 'graph.edges', [])\n });\n\n\n if (!_.isEmpty(response.layout)) {\n state.cy.layout({\n name: 'preset',\n positions: node => response.layout[node.id()],\n animate: true,\n animationDuration: 500\n\n }).run();\n } else {\n state.cy.layout({\n name: 'cose-bilkent',\n randomize: false,\n nodeDimensionsIncludeLabels: true,\n nodeRepulsion: 5000 * state.cy.nodes().size()\n }).run();\n }\n\n this.setState({\n selectedClass: _.get(header, '0', null),\n expressionTable: expressionTable,\n name: _.get(response, 'graph.pathwayMetadata.title', 'N/A'),\n datasource: _.get(response, 'graph.pathwayMetadata.dataSource.0', 'N/A'),\n searchResults: searchResults\n }, () => this.applyExpressionData());\n });\n }\n });\n }", "title": "" }, { "docid": "d878e1924ec84be29317e455414b5ca6", "score": "0.4934946", "text": "function NearestAnimal(latitude,longitude){\n var mindif=99999;\n var closest;\n for (index=0;index<locations.length;index++){\n var dif = PythagorasEquirectangular(latitude,longitude,locations[index].lat,locations[index].lng);\n if (dif < mindif){\n closest=index;\n closelat = locations[index].lat;\n closelon = locations[index].lng;\n closeAnimal = locations[index].animal;\n mindif=dif;\n } \n }\n\n // Draw line, reframe map, generate text \n mapFunctions(closelat,closelon, closeAnimal);\n textResult(mindif,closeAnimal,latitude,longitude);\n}", "title": "" }, { "docid": "25339ed64314a92310b011bc7e158c1d", "score": "0.49335966", "text": "function queryFeatures(queryGeometry) {\n queryResults = [];\n pageResults = null;\n currentPage = 1;\n promiseUtils.eachAlways(queryLayers.map(function (layerView) {\n // if (layerView.layer.type && layerView.layer.type === \"map-image\") {\n var flQuery = layerView.layer.createQuery();\n flQuery.geometry = queryGeometry;\n flQuery.returnGeometry = true;\n flQuery.outFields = [\"*\"];\n flQuery.spatialRelationship = \"intersects\";\n return layerView.queryFeatures(flQuery).then(function (queryResults) {\n return queryResults;\n });\n })).then(function (results) {\n queryResults = [];\n results.forEach(function (result) {\n if (result && result.value && result.value.features) {\n result.value.features.forEach(function (val) {\n queryResults.push(val);\n });\n }\n });\n numberOfPages = Math.ceil(queryResults.length / numberPerPage);\n liveDetailsNode.innerHTML = \"\";\n if (queryResults.length && queryResults.length > 21) {\n liveDetailsNode.innerHTML = queryResults.length + \" results found in search area. Press the plus key to zoom in and reduce number of results.\";\n }\n else {\n generateList();\n }\n });\n }", "title": "" }, { "docid": "aff339947f0d6d2d361f6713f3f80f48", "score": "0.4931343", "text": "function runSearch(city) {\n getCoordinates(city);\n}", "title": "" }, { "docid": "b59fa7d57c4d69afd11c99d1a8a35838", "score": "0.49313006", "text": "function initMap(map) {\n\n // finding the user location function\n navigator.geolocation.getCurrentPosition(function(position) {\n // setting location of the user to the center\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n // making map center\n map.setCenter(pos);\n\n appendPins(locations);\n\n // drawing circle\n search_area = {\n // circle color\n strokeColor: '#FF0000',\n // opacity of circle\n strokeOpacity: 0.8,\n // how big the stroke is\n strokeWeight: 2,\n // center is the pos\n center : new google.maps.LatLng(position.coords.latitude, position.coords.longitude),\n radius : 2200\n };\n\n // search area is now the size of the circle\n search_area = new google.maps.Circle(search_area);\n // setting area in map\n search_area.setMap(map);\n\n // finding markers inside circle\n var bounds = search_area.getBounds();\n\n // searching to each if any of the markers are in the area\n var markersWithinBounds = markers.filter(function(marker){\n return bounds.contains(marker.getPosition());\n });\n\n console.log(markersWithinBounds);\n // calling a function with the pins in the area\n closestStores(markersWithinBounds);\n\n\n });\n\n}", "title": "" }, { "docid": "f2a23a720d8320ff3f640ab3c00ec8bd", "score": "0.49252898", "text": "function brushmove() {\n filterByTime()\n drawDataToMap();\n }", "title": "" }, { "docid": "4faa93525ad69d89957923812de653d8", "score": "0.49233854", "text": "function doQuery(point) {\n if (!point || !point.xid) return $q.reject('no point');\n\n var url;\n if ($scope.firstLast === 'true') {\n \turl = '/rest/v1/point-values/' + encodeURIComponent(point.xid) +\n '/first-last';\n } else {\n \turl = '/rest/v1/point-values/' + encodeURIComponent(point.xid) +\n '/statistics';\n }\n var params = [];\n\n var now = new Date();\n var from = Util.toMoment($scope.from, now, $scope.dateFormat);\n var to = Util.toMoment($scope.to, now, $scope.dateFormat);\n\n var result = {\n \tpoint: point\n };\n\n if (from.valueOf() === to.valueOf()) {\n \treturn {\n \t\tpromise: $q.when(result),\n \t\tcancel: angular.noop\n \t};\n }\n\n params.push('from=' + encodeURIComponent(from.toISOString()));\n params.push('to=' + encodeURIComponent(to.toISOString()));\n params.push('useRendered=true');\n\n for (var i = 0; i < params.length; i++) {\n url += (i === 0 ? '?' : '&') + params[i];\n }\n\n var cancelDefer = $q.defer();\n \t\t\tvar cancelFn = cancelDefer.resolve;\n \t\t\tsetTimeout(cancelFn, $scope.timeout || mangoTimeout);\n\n var promise = $http.get(url, {\n \ttimeout: cancelDefer.promise,\n headers: {\n 'Accept': 'application/json'\n }\n }).then(function(response) {\n \tvar data = response.data;\n\n \tif (data.startsAndRuntimes) {\n \t\tfor (i = 0; i < data.startsAndRuntimes.length; i++) {\n \t\t\tvar statsObj = data.startsAndRuntimes[i];\n \t\t\tvar valueRenderer = point.valueRenderer(statsObj.value);\n \t\t\tif (!valueRenderer) continue;\n \t\t\tstatsObj.renderedValue = valueRenderer.text;\n \t\t\tstatsObj.renderedColor = valueRenderer.colour;\n \t\t}\n \t}\n\n \tresult.stats = data;\n \treturn result;\n });\n\n return {\n \tpromise: promise,\n \tcancel: cancelFn\n };\n }", "title": "" }, { "docid": "c40ac7d5a6a0e6102eef536206827489", "score": "0.49151713", "text": "function getLocation(request, response) {\n const query = request.query.data;\n client.query(`SELECT * FROM locations WHERE search_query=$1`, [query]).then(sqlResult => {\n if(sqlResult.rowCount > 0){\n response.send(sqlResult.rows[0]);\n } else {\n updateLocation(query, request, response);\n }\n });\n}", "title": "" }, { "docid": "a1e11cd3e1abc658a6d267c28830a1eb", "score": "0.4913918", "text": "function query() {\r\n\r\n // URL for querying\r\n var url= 'https://api.darksky.net/forecast/b7da10e47185eed24eb8968618f1baa6/42.361936, -71.097309';\r\n\r\n // Query the URL, set a callback\r\n // 'jsonp' is needed for security\r\n loadJSON(url, gotData, 'jsonp');\r\n}", "title": "" }, { "docid": "c269f24f8d86ff695e81f9acdcf77685", "score": "0.4912699", "text": "sendQuery(e, term) {\n e.preventDefault();\n let searchTerm = term;\n if (!searchTerm.length) {\n return;\n }\n const { lat, lng } = this.props.initialPosition;\n let location = new google.maps.LatLng(lat, lng);\n let map = new google.maps.Map(this.refs.map, {\n center: location,\n zoom: 15\n });\n\n let request = {\n location: location,\n rankBy: 'DISTANCE',\n query: searchTerm\n };\n\n let service = new google.maps.places.PlacesService(map);\n let bounds = map.getBounds();\n let nearbyResults = [];\n\n service.textSearch(request, (results, status) => {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n for (let i = 0; i < results.length; i++) {\n let place = results[i];\n\n nearbyResults.push(place);\n let lat = place.geometry.location.lat();\n let lng = place.geometry.location.lng();\n\n let marker = new google.maps.Marker({\n position: { lat, lng },\n map: map\n });\n\n this.addInfoWindow(place, map, marker, 'click');\n\n if (place.geometry.viewport) {\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n }\n }\n map.fitBounds(bounds);\n this.setState({ searchResults: nearbyResults.slice() });\n });\n }", "title": "" }, { "docid": "9698d25dd8757318110c386115e3794a", "score": "0.49114504", "text": "function getDateTimeBBox() {\n\t// Storing the value of the date-from and date-to element in a string\n\tstartDate = $('#date-from').val();\n\tendDate = $('#date-to').val();\n\t\n\t// check if the user wants to perform a temporal-spatial filtering\n\tif (startDate != '' && endDate != '' && rectangleActive == true) {\n\t\t// calling getDT() in order to get the URL String for the temporal filter\t\n\t\tvar dateTimeUrl = getDT();\n\t\t// calling getBB() in order to get the bounding box coordinates\n\t\tvar BBoxString = getBB();\n\t\t\n\t\t// creating the URL for the query\n\t\tvar dateTimeBBoxUrl = dateTimeUrl + BBoxPrefix + BBoxString;\n\t\t\n\t\t// creating a new query object\n\t\tquery = new Query();\n\t\t\n\t\tvar inputUrl = dateTimeBBoxUrl;\n\t\tconsole.log(inputUrl);\n\t\t// the request url is passed to the query object and a measurement object will be built\n\t\tquery.getMeasurements(inputUrl);\n\t\t\t\t\n\t// check if the user wants to perform a temporal filtering\t\n\t} else if (startDate != '' && endDate != '' && rectangleActive == false) {\n\t\t// calling getDT() in order to get the URL string for the temporal filter\n\t\tvar dateTimeUrl = getDT();\n\t\t\n\t\t// creating a new query object\n\t\tquery = new Query();\n\t\t\n\t\tvar inputUrl = dateTimeUrl;\n\t\tconsole.log(inputUrl);\t\t\n\t\t// the request url is passed to the query object and a measurement object will be built\n\t\tquery.getMeasurements(inputUrl);\n\t\t\n\t\t\n\t// check if the user wants to perform a spatial filtering\n\t} else if (startDate == '' && endDate == '' && rectangleActive == true) {\n\t\t// Display an alert to the user to inform him about a possible long time to perform the request\n\t\tif (l == 'en') {\n\t\t\talert('If you want to get data without any temporal criteria, it may need a long time to collect all data depending on the used bounding box!');\n\t\t} else {\n\t\t\talert('Wenn du die Daten ohne zeitliche Einschränkung abrufst, kann es abhängig von der Boundingbox sehr lange dauern, die Daten abzurufen!');\n\t\t}\n\t\t\n\t\t// calling getBB() in order to get the bounding box coordiantes\n\t\tvar BBoxString = getBB();\n\t\t\n\t\t// building the request url\n\t\tvar BBUrl = baseUrlBBox + BBoxString;\n\t\t\n\t\t//creating a new query object\n\t\tquery = new Query();\n\t\t\n\t\tvar inputUrl = BBUrl;\n\t\tconsole.log(inputUrl);\t\t\n\t\t// the request url is passed to the query object and a measurement object will be built\n\t\tquery.getMeasurements(inputUrl);\n\t\t\n\t} else if (startDate == '' && endDate == '' && rectangleActive == false) {\n\t\thideProgressAnimation();\n\t\t// Ignore missing filter when app is started\n\t\tif (appStarted) {\n\t\t\tappStarted = false;\n\t\t} else {\n\t\t\tif (l == \"en\") {\n\t\t\t\t\talert('Please choose a period of time, spatial or temporal-spatial filter before you get the data!');\n\t\t\t\t} else {\n\t\t\t\t\talert('Bitte wähle einen Zeitraum, räumlichen oder raum-zeitlichen Filter aus, bevor du Daten abrufst!');\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ae4f6fa6f48de2b2240b1ad99baaaecd", "score": "0.4906856", "text": "function processLocation() {\n\t\tvar radius = parseInt(document.getElementById(\"radius\").value);\n\t\tvar jsonResponse = JSON.parse(this.responseText);\n\t\tvar latitude = jsonResponse.results[0].geometry.location.lat;\n\t\tvar longitude = jsonResponse.results[0].geometry.location.lng;\n\t\tvar position = { lat: latitude, lng: longitude };\n\t\taddLocationMarker(position, icons.USER_LOCATION);\n\t\toutputMap.setCenter(position);\n\t\toutputMap.setZoom(18);\n\t\tdrawCircle(radius, position);\n\t}", "title": "" }, { "docid": "5cba1bc0f2eabedafe5323605d980b64", "score": "0.49036345", "text": "function checkBusStation() {\n console.log(\"Va a comparar con la posicion \" + allData.lat + \" \" + allData.lon);\n location.find({\n geo: {\n $near: [allData.lon, allData.lat],\n $maxDistance: distance\n }\n }).limit(10).exec(function(err, locations) {\n if (err) {\n //console.log(\"Error es \" + err + \"\");\n }\n\n //console.log(\"El resultado es \" + JSON.stringify(locations))\n });\n\n}", "title": "" }, { "docid": "0cc850ff78aa22ea8e7fd85277da5e29", "score": "0.49018803", "text": "function getPoints() {\n return loc;\n}", "title": "" }, { "docid": "70a153b5a2e2b9370c723ee4dbf9298f", "score": "0.49013248", "text": "_refresh() {\n this._oBefore = new Set();\n this._oAfter = new Set();\n this._oPassive = new Set();\n this._oLocal = new Set();\n this._oPaths = {};\n this._oDynamic = {};\n this.CURSORS = {};\n\n Object.keys(this._oQueries).map(sKey => {\n let mQuery = this._oQueries[sKey];\n let bIsPath = Array.isArray(mQuery);\n let aPath;\n\n if (bIsPath) {\n aPath = mQuery;\n\n if (!this._checkPath(aPath)) {\n console.warn('baobabComponent: Incomplete Path for Cursor', aPath);\n return;\n }\n } else {\n if (mQuery.cursor !== undefined) {\n if (mQuery.cursor === baobabComponent.LOCAL_STATE) {\n aPath = [this.sLocalPrefix, sKey];\n this._oLocal.add(sKey);\n } else {\n aPath = mQuery.cursor\n }\n }\n\n if (!aPath) {\n aPath = [this.sLocalPrefix, sKey]; // Default to treating as LOCAL_STATE\n this._oLocal.add(sKey);\n }\n\n if (!this._checkPath(aPath)) {\n console.warn('baobabComponent: Incomplete Path for Cursor', aPath);\n return;\n }\n\n if (mQuery.default !== undefined) {\n if (!baobabComponent.TREE.exists(aPath) || !baobabComponent.TREE.get(aPath)) {\n baobabComponent.TREE.set(aPath, mQuery.default);\n }\n }\n\n if (typeof mQuery.setState === 'function') {\n this._oBefore.add(sKey);\n }\n\n if (typeof mQuery.onUpdate === 'function') {\n this._oAfter.add(sKey);\n }\n\n if (mQuery.invokeRender !== undefined && mQuery.invokeRender === false) {\n this._oPassive.add(sKey);\n }\n }\n\n if (aPath) {\n this._oPaths[ sKey ] = aPath;\n try {\n this.CURSORS[sKey] = baobabComponent.TREE.select(aPath);\n } catch (e) {\n console.warn('baobabComponent: Key Unavailable for Cursor', sKey, aPath /* , e */);\n }\n }\n });\n\n this._bBefore = this._oBefore.size > 0;\n this._bAfter = this._oAfter.size > 0;\n this._bPassive = this._oPassive.size > 0;\n this._aPaths = Object.values(this._oPaths);\n this._getData = () => {\n let oData = {};\n\n Object.keys(this._oPaths).forEach(sStateParameter => {\n let aPath = this._oPaths[sStateParameter];\n\n if (baobabComponent.DEBUG_LEVEL >= 3) {\n console.log('_refresh.getData', aPath);\n }\n\n if (!this._checkPath(aPath)) {\n if (baobabComponent.DEBUG_LEVEL >= 2) {\n console.warn('baobabComponent: Incomplete Path for Data', sStateParameter, aPath);\n }\n return;\n }\n\n try {\n oData[sStateParameter] = baobabComponent.TREE.get(aPath);\n } catch (e) {\n if (baobabComponent.DEBUG_LEVEL >= 2) {\n console.warn('baobabComponent: Key Unavailable for Data', sStateParameter, aPath /* , e */);\n }\n }\n });\n\n return oData;\n };\n }", "title": "" } ]
9747da53344f7da41f6c0580edd8ea13
gets the word from the data function and creates the word game kicks of the game
[ { "docid": "73a924f50ef2bed4abd4cbf8434ac3b7", "score": "0.6473169", "text": "function getWords() {\n var data = new Data(),\n min = Math.ceil(0),\n max = Math.floor(data.array.six_wrong.length),\n random = Math.floor(Math.random() * (max - min));\n\n /**\n * check if word has been used through the loop \n */\n if (usedWords.includes(random)) {\n console.log('cant proceed with this', random, usedWords);\n flaged_number++;\n random = Math.floor(Math.random() * (max - min));\n for (var i = 0; i < data.array.six_wrong[random].length; i++) {\n wordLoop(random, i);\n }\n\n } else {\n for (var i = 0; i < data.array.six_wrong[2].length; i++) {\n wordLoop(random, i);\n\n }\n usedWords.push(random);\n console.log('word has been used', random, usedWords);\n }\n\n}", "title": "" } ]
[ { "docid": "bbc7d2ebd7414cfd5e0e665bc285beeb", "score": "0.7436566", "text": "function getWord() {\n // Pick a random word in the dictionary library\n var randomWord = game.dictionary[Math.floor(Math.random() * game.dictionary.length)];\n // Array of letters of chosen word\n game.word = [];\n // Array of _ characters with the chosen word's length\n game.guessWord = [];\n // constructing a new array with each letter of the chosen word as elementsp]\n for (let i = 0; i < randomWord.length; i++) {\n game.word[i] = randomWord.charAt(i);\n game.guessWord[i] = \"_\";\n }\n // Update the <h1 id=\"word\"></h1> with _ _ _ _ _\n getID(\"word\").innerHTML = game.guessWord.join(\" \");\n }", "title": "" }, { "docid": "22bbe41d2ab82828554157532b593c8d", "score": "0.7373186", "text": "chooseWord() {\n //This method uses a random number to pick a word from the plato.word array for the player to guess.\n plato.word = plato.words[\n Math.floor(Math.random() * plato.words.length)\n ].toString();\n }", "title": "" }, { "docid": "98ff34d0a0d303670bc7182291085798", "score": "0.72257864", "text": "setupGame() {\n const wordKeys = Object.keys(this.wordsToPick);\n this.wordInPlay = wordKeys[Math.floor(Math.random() * wordKeys.length)];\n this.lettersOfTheWord = this.wordInPlay.split(\"\");\n this.rebuildWordView();\n this.processUpdateTotalGuesses();\n }", "title": "" }, { "docid": "b401ff4d548283612683abdd3f3ed13f", "score": "0.71713734", "text": "function computerWord() {\n targetWord = wordBank[Math.floor(Math.random()* wordBank.length)].toUpperCase();\n playerWordSetup();\n}", "title": "" }, { "docid": "922c06b39a0ef1a4fed7a4ffb1c5607e", "score": "0.70819074", "text": "function chooseWord () {\n\t\tword = wordArray[Math.floor(Math.random() * wordArray.length)];\n\t\tguessesLeft = (wordArray.length + 1) * 2;\n\t\tfor (var i = 0; i < word.length; i++) {\n\t\t\thiddenWord.push(blank);\n\t\t}\n\t\tloadParse();\n\t}", "title": "" }, { "docid": "2463899e063ad609480a4da055f17689", "score": "0.70328677", "text": "function loadWord(words) {\n //generate random index\n const randIndex = Math.floor(Math.random() * words.length)\n // output generated word\n currentWord.innerHTML = words[randIndex]\n}", "title": "" }, { "docid": "4bcaa2bd3fca59d6fe9062421c08ace8", "score": "0.7008513", "text": "function playGame() {\n var wordChoices = [\"elephant\", \"lion\", \"tiger\", \"giraffe\", \"crocodile\", \"gorilla\", \"hippopotamus\", \"kangaroo\"];\n computerGuess = wordChoices[Math.floor(Math.random() * wordChoices.length)];\n //console.log(computerGuess);\n console.log(\"Hint:Its an Animal!!\\n\");\n var computerGuessArray = computerGuess.split(\"\");\n var letterObjectsArray = [];\n numberOfGuesses = 10;\n //Creating letter object from the computer guessed word and storing it in an array\n for (var i = 0; i < computerGuessArray.length; i++) {\n letterObjectsArray.push(new letter(computerGuessArray[i]));\n }\n data = new word(letterObjectsArray);\n previousWord = data.getData();\n console.log(previousWord);\n checkUserInput();\n}", "title": "" }, { "docid": "68019b79841dbc6230caa336fb57922b", "score": "0.6993777", "text": "function wordPicker() {\n \"use strict\";\n curWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n while (curWord === prevWord) {\n curWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n }\n\n prevWord = curWord;\n}", "title": "" }, { "docid": "569c092d8e65265990e8b43ebca35317", "score": "0.6989466", "text": "function word() {\n return wordBank[Math.floor(Math.random() * wordBank.length)];\n}", "title": "" }, { "docid": "2baea14128557afed14a0effcb85a47b", "score": "0.69873506", "text": "function generateWord() {\n\tfs.readFile('wordList.txt', 'utf8', ( err, data ) => {\n\t\tif ( err ) throw err;\n\t\twordArr = data.split( os.EOL );\n\t\tlet random = ~~( Math.random() * wordArr.length );\n\t\tword = new Word( random, wordArr, lettersGuessed );\n\t\tword.blankify();\n\t\tdrawMan();\n\t\tguessLetter(); \n\t})\n}", "title": "" }, { "docid": "cc8ab7fbb07f2af98921de83450adc90", "score": "0.6980788", "text": "function compWord() {\n var x =Math.floor((Math.random()*dictWords.length));\n document.getElementById(\"gameWord\").innerHTML= dictWords[x];\n console.log (x);\n \n console.log (dictWords[x]);\n return dictWords[x];\n // document.getElementById(\"playHang\").innerHTML = dictWords[x];\n}", "title": "" }, { "docid": "f063982f326580b0c4c7aad93dcdd52a", "score": "0.6978527", "text": "function getRandomWord() {\r\n\r\n}", "title": "" }, { "docid": "8f1e2e00c3e3df029d927c439cb5dfe8", "score": "0.69514114", "text": "function targetWord()\n{\n i=0;\n while(guessedletters.length>0)\n {\n guessedletters.pop();\n }\n var randomNumber=Math.floor(Math.random()*targetwords.length);\n //pick random word from targetwords array\n targetword=targetwords[randomNumber];\n console.log(\"*******************************************************\".rainbow);\n console.log(\"\\nWelcome! Please start guessing the word\\n\");\n console.log(\"Hint: Words are web related! \\n\")\n console.log(\"*******************************************************\".rainbow);\n target = new word(targetword);\n game();\n}", "title": "" }, { "docid": "07b45af66135d4faae70ea01a9f31be9", "score": "0.6948417", "text": "function selectGameWord(){ \n return wordBank[Math.floor(Math.random() * wordBank.length)];\n}", "title": "" }, { "docid": "51abfc10f617cd381395d81562dd47bf", "score": "0.6941843", "text": "function getNewWord() {\n var randNum = Math.floor(Math.random() * 6)\n return gameWord = new Word(hangmanWords[randNum])\n}", "title": "" }, { "docid": "07fc91eb5dfadb73f392f1545935750a", "score": "0.6929534", "text": "function showWord() {\r\n\tvar wordList = words[wordTypes[wordType]];\r\n\tvar word = wordList[Math.floor(Math.random() * wordList.length)].word;\r\n\t// save word for later use\r\n\tcrystalWords += wordTypes[wordType] + '=' + word + ', ';\r\n\r\n\t$(\"#contentHolder\").text(word);\r\n\r\n\twordType = (wordType == wordTypes.length-1) ? 0 : wordType+1;\r\n\tsetColorDecay(-1);\r\n\tshakeReverse = true;\r\n\tvar infoStageKey = wordTypes[wordType];\r\n\tif (wordType !== 0) {\r\n\t\t$(crystalInfo).trigger('stage-change', infoStageKey);\r\n\t\tif(accelometer) {\r\n\t\t\tsetTimeout(enableMotionDetection, 4000);\r\n\t\t} else {\r\n\t\t\tstopDragging();\r\n\t\t}\r\n\t} else {\r\n\t\t// last stage\r\n\t\t$(crystalInfo).trigger('stage-change', 'finale');\r\n\t\tcrystalInfo.showFinalForm(crystalWords);\r\n\t}\r\n\tmoveToCenter(true);\r\n}", "title": "" }, { "docid": "e2211569d2d46e291cc2ce2c014a04d7", "score": "0.68989223", "text": "function pickRandomWord() {\n randomWord = wordsAvalible[Math.floor(Math.random() * wordsAvalible.length)];\n lettersOfWord = Array.from(randomWord.toLocaleLowerCase());\n word = new Word(lettersOfWord);\n // run wordStrin on word object to print out word blanks\n word.wordString();\n}", "title": "" }, { "docid": "c9d746ce477eb3086ffa387e4fab8b82", "score": "0.68932897", "text": "function wordGenerator() {\n solutionIndex = Math.floor(Math.random() * wordBank.length);\n while (previousSolutionIndex == solutionIndex) {\n solutionIndex = Math.floor(Math.random() * wordBank.length);\n };\n return wordBank[solutionIndex];\n }", "title": "" }, { "docid": "6871af00fbd47f0ac7a90488cf7679dc", "score": "0.6873925", "text": "function word(Word)\n{\nthis.Word=Word;\nthis.word_=[];\n// a method to initiat the word with _\nthis.init=function(){\nfor (var i = 0; i<this.Word.length; i++) {\n\tthis.word_.push(new letters(this.Word[i]));\n}\n}\n// to display the word as a string\nthis.displayword=function(){\n\tvar interword='';\n for (var i = 0; i < this.word_.length; i++) {\n \t\tinterword=interword+this.word_[i].display();\n \t}\t\n return interword; \t\n}\n// to check if a letter is in a word\nthis.check=function(lettertocheck){\n\tvar checkresult;\n for (var i = 0; i < this.word_.length; i++) {\n \t if(this.word_[i].letter===lettertocheck && this.word_[i].guessedletter==false)\n \t {\n this.word_[i].guessedletter=true;\n checkresult=chalk.green('correct');\n break;\n \t }else\n \t {\n \t \tcheckresult=chalk.red('incorrect');\n \t }\n }\n console.log(checkresult);\n}\n// to check if there still letters to check or the word was guessed\nthis.end=function(){\n var end = true;\n\tfor (var i = 0; i < this.word_.length; i++) {\n if(this.word_[i].guessedletter===false)\n {\n end=false;\n break;\n }\n\t}\n\treturn end;\n}\n}", "title": "" }, { "docid": "b7b7f213d6ec64166573e0dde7287eae", "score": "0.686372", "text": "function pickWord(){\n\n // Call to back-end to fetch word data\n $.ajax('/newWord', {\n type: \"GET\",\n success: function(data){\n console.log(data);\n\n\n var max = data.length - 1;\n var random = Math.floor(Math.random() * ((max - 0 + 1) + 0));\n if(wordsFinished.length === data.length){\n wordsFinished = [];\n };\n\n while(wordsFinished.includes(data[random].word) || data[random].word === currentWord){\n random = Math.floor(Math.random() * ((max - 0 + 1) + 0));\n }\n \n \n\n $(document).unbind('keyup');\n beginGame(data[random]);\n\n }\n });\n\n}", "title": "" }, { "docid": "0253e97cba9ad71bc721a84bcaf43f60", "score": "0.68465906", "text": "function game(word) {\n let winArray = [];\n let myWord = word;\n let leng = myWord.word.length;\n let allLetters = [];\n\n console.log(\"\");\n console.log(\"Definition: \" + myWord.definition);\n console.log(\"\");\n console.log(\"Hint: Your word might contain spaces. Use <space button>\");\n\n for (let i = 0; i < leng; i++) {\n myWord.blankWordArray.push(\"_\");\n }\n\n guessLetter(myWord, leng, winArray);\n\n}", "title": "" }, { "docid": "9c99fce82fd212736dc11cd92463190f", "score": "0.68438095", "text": "function show_Word(words) {\r\n\t//create a random index to pull word\r\n\t//generate random array using math to pick a random word\r\n\t//then making a pool of words by * wirds.length\r\n\tconst randIndex = Math.floor(Math.random() * words.length);\r\n\tcurrentWord.innerHTML = words[randIndex];\r\n\r\n}", "title": "" }, { "docid": "301446b24a9cd8dbefa66fb5212b1ae3", "score": "0.68372047", "text": "function play(word) {\n readyWord = [...word.toUpperCase()];\n render();\n}", "title": "" }, { "docid": "dce77196f0749e2000ffb19e3a64d8df", "score": "0.68331283", "text": "function initWord() {\n\tchosenWord = wordArray[Math.floor(Math.random() * wordArray.length)];\n}", "title": "" }, { "docid": "85af6499c627b21e0c6e27642d58e428", "score": "0.6826493", "text": "function get_word() {\n var play_word = words[Math.floor(Math.random() * 8181)].toUpperCase();\n //console.log(words + \"/\" + Math.random()*6);\n console.log(play_word);\n return play_word;\n}", "title": "" }, { "docid": "3bac7eba9ef7423899c8d29d1d7de303", "score": "0.6817388", "text": "function getWord() {\r\n var a = new Array('abate','aberrant','abscond','accolade','acerbic','acumen','adulation','adulterate','aesthetic','aggrandize','alacrity','alchemy','amalgamate','ameliorate','amenable','anachronism','anomaly','approbation','archaic','arduous','ascetic','assuage','astringent','audacious','austere','avarice','aver','axiom','bolster','bombast','bombastic','bucolic','burgeon','cacophony','canon','canonical','capricious','castigation','catalyst','caustic','censure','chary','chicanery','cogent','complaisance','connoisseur','contentious','contrite','convention','convoluted','credulous','culpable','cynicism','dearth','decorum','demur','derision','desiccate','diatribe','didactic','dilettante','disabuse','discordant','discretion','disinterested','disparage','disparate','dissemble','divulge','dogmatic','ebullience','eccentric','eclectic','effrontery','elegy','eloquent','emollient','empirical','endemic','enervate','enigmatic','ennui','ephemeral','equivocate','erudite','esoteric','eulogy','evanescent','exacerbate','exculpate','exigent','exonerate','extemporaneous','facetious','fallacy','fawn','fervent','filibuster','flout','fortuitous','fulminate','furtive','garrulous','germane','glib','grandiloquence','gregarious','hackneyed','halcyon','harangue','hedonism','hegemony','heretical','hubris','hyperbole','iconoclast','idolatrous','imminent','immutable','impassive','impecunious','imperturbable','impetuous','implacable','impunity','inchoate','incipient','indifferent','inert','infelicitous','ingenuous','inimical','innocuous','insipid','intractable','intransigent','intrepid','inured','inveigle','irascible','laconic','laud','loquacious','lucid','luminous','magnanimity','malevolent','malleable','martial','maverick','mendacity','mercurial','meticulous','misanthrope','mitigate','mollify','morose','mundane','nebulous','neologism','neophyte','noxious','obdurate','obfuscate','obsequious','obstinate','obtuse','obviate','occlude','odious','onerous','opaque','opprobrium','oscillation','ostentatious','paean','parody','pedagogy','pedantic','penurious','penury','perennial','perfidy','perfunctory','pernicious','perspicacious','peruse','pervade','pervasive','phlegmatic','pine','pious','pirate','pith','pithy','placate','platitude','plethora','plummet','polemical','pragmatic','prattle','precipitate','precursor','predilection','preen','prescience','presumptuous','prevaricate','pristine','probity','proclivity','prodigal','prodigious','profligate','profuse','proliferate','prolific','propensity','prosaic','pungent','putrefy','quaff','qualm','querulous','query','quiescence','quixotic','quotidian','rancorous','rarefy','recalcitrant','recant','recondite','redoubtable','refulgent','refute','relegate','renege','repudiate','rescind','reticent','reverent','rhetoric','salubrious','sanction','satire','sedulous','shard','solicitous','solvent','soporific','sordid','sparse','specious','spendthrift','sporadic','spurious','squalid','squander','static','stoic','stupefy','stymie','subpoena','subtle','succinct','superfluous','supplant','surfeit','synthesis','tacit','tenacity','terse','tirade','torpid','torque','tortuous','tout','transient','trenchant','truculent','ubiquitous','unfeigned','untenable','urbane','vacillate','variegated','veracity','vexation','vigilant','vilify','virulent','viscous','vituperate','volatile','voracious','waver','zealous');\r\n return a[parseInt(Math.random()* a.length)];\r\n}", "title": "" }, { "docid": "e0d6d9efbb5c2bcb0a8eef3637a4f200", "score": "0.68173057", "text": "function chooseWord() {\n let wordIndex = Math.floor(Math.random() * Math.floor(wordBank.length));\n word = wordBank[wordIndex];\n for(let i = 0; i < word.length; i++)\n wordShown += \"_\";\n document.getElementById(\"wordShown\").innerText = wordShown;\n console.log(word);\n }", "title": "" }, { "docid": "b8d25725ef6e7265943c25abc4459362", "score": "0.6813746", "text": "function loadScene() {\r\n\tempty(2);\r\n\tvar randomWordIndex = Math.floor(Math.random() * words.length);\r\n\trandomWord = words[randomWordIndex];\r\n\tconsole.log(randomWord);\r\n\tbeginText.innerHTML = 'First letter of the 5 letter word you need to guess:';\r\n\trandomWordId.innerHTML = randomWord.charAt(0).toUpperCase();\r\n\tyourGuess.innerHTML = 'Your guess:';\r\n\tbutton.value = 'Check';\r\n\tbutton.onclick = check;\r\n}", "title": "" }, { "docid": "71ec76d466f96cc63f503b195f82b438", "score": "0.68019646", "text": "function wordgame_load_new_word() {\n \n // Clear previous input.\n $('#edit-wordgame-word-form-translation').val('');\n \n // Grab a random word from the Drupal site translated view JSON page:\n // http://language.tylerfrankenstein.com/vi/random-word\n //\n // Note: the 'vi' is the language code for Vietnamese. Replace it\n // with the language code for the language you would like to\n // learn.\n drupalgap.views_datasource.call({\n path:'vi/random-word',\n success:function(data){\n if (data.nodes.length > 0) {\n // If there were any results, iterate over the collection.\n $.each(data.nodes, function(index, object){\n // Extract the node.\n var node = object.node;\n // Show the word to translate.\n $('div#wordgame_word').html(\n '<p>The word to translate is:</p>' + \n '<p>' + node.title_translated + '</p>'\n );\n // Save the answer.\n wordgame_answer = node.title;\n });\n }\n }\n });\n\n}", "title": "" }, { "docid": "449668d564b58e79356758fe64996c81", "score": "0.67988044", "text": "generateWord() {\n return WORDS_LIST[Math.floor(Math.random() * WORDS_LIST.length)];\n }", "title": "" }, { "docid": "5bf84e027d384b511bbec218fe405cff", "score": "0.67956364", "text": "function generate() {\n\n unirest.get(\"https://wordsapiv1.p.mashape.com/words/?random=true\")\n .header(\"X-Mashape-Key\", process.env.MASHAPE_KEY)\n .header(\"Accept\", \"application/json\")\n .end(result => {\n\n //console.log(result.status, result.headers, result.body)\n if (typeof result.body.results === 'undefined') {\n console.log(\"Loading...\")\n\n generate();\n\n } \n\n let newDefinition = result.body.results[0].definition;\n let newPartSpeech = result.body.results[0].partOfSpeech;\n let newWord = result.body.word;\n let arr = [];\n guessesLeft = 8;\n allLetters = [];\n end = false;\n let dailyQuote = result.caseless['dict']['x-ratelimit-requests-remaining'];\n console.log(\"\");\n console.log(\"You have \" + dailyQuote + \" games left for today\");\n let currWord = new Word.Word(newWord, newDefinition, newPartSpeech, arr, dailyQuote);\n game(currWord);\n\n });\n}", "title": "" }, { "docid": "c61d016664062713acdf5be4c69b39f4", "score": "0.6794938", "text": "initWord() {\n const pickedWord = ks1_1.default[Math.floor(Math.random() * ks1_1.default.length)];\n return { \"raw_word\": pickedWord, \"guess_word\": this.obfusicate(pickedWord) };\n }", "title": "" }, { "docid": "a3702b7f062fc635b722365256073e5a", "score": "0.67918915", "text": "function getWord(){\n\t\tvar categorySize = wordArray.length;\n\t\tword = wordArray[Math.floor((Math.random() * categorySize))];\n\t\t//alert(word);\n\t}", "title": "" }, { "docid": "f68168e58ab3e5575afd0b5aa263d9f8", "score": "0.678818", "text": "function getWord(){\n\t//TODO this function is supposed to load the words file and get a random one\n\twordlist=['la','va','ve','me','hoy','doy','soy','pie','rey','bus','sal','luz','sed','miel','piel','fiel','pies','tren','flor','cruz','niño','mesa','carro','malo','todo','lápiz','pared','metál','árbol','antes']\t\n\topt=wordlist.length;\n\tchoice=Math.floor(Math.random()*opt);\n\treturn wordlist[choice];\n}", "title": "" }, { "docid": "782d80669e04f6932678f31f2d3658a7", "score": "0.6769822", "text": "function startNewWord() {\n if (wordGuessGame.gameNum < wordGuessGame.words.length) {\n wait = false;\n wordGuessGame.resetLettersGuessed();\n htmlEl.guessedLetters.textContent = wordGuessGame.lettersGuessed;\n\n wordGuessGame.resetGuessesRemainNum();\n writeGuessRemainNum(wordGuessGame.guessesDefaultNum);\n\n // Reset displayedWordArray.\n displayedWordArray = [];\n // Update currentWordArray.\n getCurrentWordArray();\n // create dynamic display word array based on length of current word\n currentWordArray.forEach((item, i) => displayedWordArray[i] = hiddenLetter);\n\n showLetterBoxes(displayedWordArray);\n\n htmlEl.hint.textContent = wordGuessGame.words[wordGuessGame.gameNum].hint1;\n writeMessage(messages.play);\n } else {\n writeMessage(messages.completed);\n }\n}", "title": "" }, { "docid": "ab51266aa78838691ed61f6c225c6a81", "score": "0.6768349", "text": "function word(w, cat, played) {\n this.gameword = w;\n this.gcategory = cat;\n this.wordplayed = played;\n}", "title": "" }, { "docid": "610e83f02ea678d9a50572f4801003e7", "score": "0.6764326", "text": "function newGame() {\n chosenWord = randWord();\n guessesArray = [];\n guessesLeft = 10;\n chosenLetter ='';\n updatingSpace= makingSpace('_', chosenWord.length);\n chancesText.textContent = updatingSpace;\n console.log(chosenWord);\n }", "title": "" }, { "docid": "3dfd8f026890871bb9c9a18111db6891", "score": "0.67505383", "text": "function newGame() {\n //reset all game info\n gameRunning = true;\n guessesleft = 8;\n guessedLetterBank = [];\n incorrectLetterBank = [];\n pickedWordPlaceholderArr = [];\n\n //pick a new word\n pickedWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n //console.log(\"The picked word is now: \", pickedWord);//\n\n //create placehoders out of new pickedWord\n for (var i = 0; i < pickedWord.length; i++) {\n if (pickedWord[i] === '') {\n pickedWordPlaceholderArr.push(' ');\n } else {\n pickedWordPlaceholderArr.push('_');\n }\n }\n\n //write all new game info to DOM\n $guessesLeft.textContent = guessesleft;\n $placeholders.textContent = pickedWordPlaceholderArr.join('');\n $guessedLetters.textContent = incorrectLetterBank;\n}", "title": "" }, { "docid": "6a0bedda8ffd165e77ddf2a991c5144d", "score": "0.67470795", "text": "function randomWord() {\n document.getElementById(\"messages\").innerHTML = \"\";\n for (var i = 0; i < words.length; i++) {\n if (guessedWordsArray.indexOf(words[i]) == -1 ) {\n word = words[i]\n }\n }\n\n //If player played all words, game over\n if(words.length == guessedWordsArray.length) {\n\n document.getElementById(\"guessLetter\").disabled = true;\n document.getElementById(\"newWordInput\").disabled = true;\n document.getElementById(\"chooseWordInput\").disabled = true;\n document.getElementById(\"messages\").innerHTML = messages.lose;\n document.getElementById(\"info\").style.display = \"none\";\n stop();\n wordTime.wordEnded = new Date ();\n gameTime.gameEnded = new Date ();\n word = \"\";\n storeGameplay();\n }\n }", "title": "" }, { "docid": "c7e4eb65aa95f493244f43fcd34f8a14", "score": "0.6746534", "text": "function drawWord() {\n //random number. maximum num is the size of array\n let index = Math.round(Math.random() * arrayOfWords.length);\n theWord = arrayOfWords[index].spellWord();\n //display hint\n hintToGuessPlaceholder.innerHTML = \"HINT: \" + arrayOfWords[index].describeHint();\n}", "title": "" }, { "docid": "09b123917c6323a39f5744bca0e2183a", "score": "0.6743563", "text": "function selectGameWord () {\n\n //check to make sure there are still letters left in the word array\n if(wordArray.length === 0) {\n\n //define word array\n wordArray = [\"Lake Lure\", \"Grandfather Mountain\", \"Blue Ridge Parkway\", \"Nags Head\", \n \"Cape Hatteras\", \"Chimney Rock\", \"Kitty Hawk\", \"Emerald Isle\", \"Smoky Mountains\"];\n\n }\n\n //Select game word\n var gameWordIndex = Math.floor(Math.random() * wordArray.length);\n var newGameWord = wordArray[gameWordIndex];\n\n //remove word from wordArray so that it cannot be selected again for new games played\n //during the same session\n wordArray.splice(gameWordIndex, 1);\n\n //return new game word\n return newGameWord;\n}", "title": "" }, { "docid": "af50c5f8c1df3efd4071b396e701e41b", "score": "0.67403257", "text": "function generateWord() {\n let dictionaryArray = Object.keys(dictionary);\n let randomNum = Math.floor((Math.random() * 10));\n answer = dictionaryArray[randomNum];\n document.getElementById(\"definitionDisplay\").innerHTML = dictionary[dictionaryArray[randomNum]];\n guessed = '_'.repeat(answer.length);\n updateDisplay();\n}", "title": "" }, { "docid": "03eab61ae206d33e8dcedf778b315c91", "score": "0.6725127", "text": "function loadWord() {\n var randomIndex = getRandomInt(wordList.length);\n return wordList[randomIndex];\n}", "title": "" }, { "docid": "fcf325111bd18ca409879475f6e2aa09", "score": "0.6719742", "text": "function startGame() {\n pickWord(); \n initBoard();\n createLetters();\n updateMan();\n updateBoard();\n\n}", "title": "" }, { "docid": "e7b2ebbc38e7bdea34e0341addef5454", "score": "0.6711438", "text": "function testGame() {\n let secret_word = 'guess';\n //OR\n let secret_word = choose_word(load_words(wordList));\n hangman_with_hints(secret_word)\n}", "title": "" }, { "docid": "6d522482230c9f46b24a729cb4450009", "score": "0.6708457", "text": "function random() {\n $(\".words\").html(\"\");\n var index = Math.floor(Math.random() * gameWrds.length - 1 );\n var word = gameWrds[index];\n for (var i = 0; i < word.length; i++) {\n return word;\n }\n }", "title": "" }, { "docid": "df05ce51ea64c1ae85df25d54858a980", "score": "0.6705013", "text": "function pickWord() {\n var idx = parseInt(Math.random() * words.length);\n selectedWord = words[idx];\n console.log(selectedWord);\n var newWord = hideLetters(selectedWord);\n console.log(newWord);\n for (var i in newWord ){\n var letter = newWord.charAt(i);\n loadLetterBox(letter);\n }\n \n}", "title": "" }, { "docid": "f946c100ee61fc167ca2eee5a07fd39e", "score": "0.6701181", "text": "function generateWord() {\n let i = Math.floor(Math.random() * wordBank.length)\n return wordBank[i];\n}", "title": "" }, { "docid": "88e435512f07f7768521eeb246f7165b", "score": "0.66964144", "text": "function startGame() {\n if (wordList.length<2) {\n wordList = [\"THE OFFICE\", \"GAME OF THRONES\", \"PARKS AND RECREATION\", \"THE GOOD PLACE\", \"BOJACK HORSEMAN\", \"BREAKING BAD\", \"WESTWORLD\", \"NARCOS\", \"STRANGER THINGS\", \"BLACK MIRROR\"];\n }\n select = Math.floor(Math.random()*wordList.length);\n chosenWord = wordList[select];\n gameWord = new Word(chosenWord);\n gameWord.makeWord();\n if (select > -1) {\n wordList.splice(select, 1);\n }\n console.log(\"\\nYou get 8 letter guesses for TV shows!.\\n\")\n promptUser();\n}", "title": "" }, { "docid": "9b5841c055582c70803215a27901c6b9", "score": "0.6695619", "text": "startGame(){\n\t\t\t// console.log('startGame!')\n\t\t\tthis.phrase = this.phrases[Math.floor(Math.random() * this.phrases.length)].word;\n\t\t\tthis.splitPhrase = this.phrase.split('');//splits words into letters\n\t\t\tthis.offset = Math.floor((this.boardWidth - this.phrase.length) / 2);\n\t\t\tthis.guessedLetters = this.splitPhrase;\n\n\n\t\t\tfor (var i = 0; i < this.boardWidth; i++) {\n\t\t\t\t$('#t_' + i).css({\"background\": \"lightgreen\"}).attr('data-letter', '').text('');\n\t\t\t\t$('#hint').html('');\n\t\t\t};\n\n\t\t\t//this need to display white boxes for the amount of letters in word\n\t\t\tfor (var i = this.offset; i < (this.offset + this.splitPhrase.length); i++) {\n\t\t\t\t// console.log('#t_' + i)\n\t\t\t\t$('#t_' + i).css({\"background\": \"white\"}).attr('data-letter', this.splitPhrase[i - 1]);\n\t\t\t\t// .text(this.splitPhrase[i - 1]);\n\t\t\t};\n\t\t\tfor (var i = 0; i < this.phrases.length; i++) {\n\t\t\t\tif (this.phrases[i].word === this.phrase) {\n\t\t\t\t\t$('#hint').html('HINT: ' + this.phrases[i].hint);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1671a00e97fe35379bfaf5055c7e835e", "score": "0.6691645", "text": "function newWord(){\n\n // Pick a random word for the player to guess\n var mysteryWord = cafeGame.words[Math.floor(Math.random() * cafeGame.words.length)];\n \n // log mystery word\n console.log(mysteryWord);\n \n // empty array to store guesses\n var answerArray = [];\n var falseArray = [];\n \n // create blank spaces equal to the length of the mystery word\n for (var i = 0; i < mysteryWord.length; i++) {\n \n answerArray[i]= \"_\";\n \n }\n \n // populate html w/ answerArray - currently blank\n document.getElementById(\"current\").innerHTML = answerArray.join(\" \");\n \n // populate html w/ false Array, blank array for guessed answers\n document.getElementById(\"already-guessed\").innerHTML = falseArray;\n \n guessesLeft = 10;\n }", "title": "" }, { "docid": "040c723634a6e6ddd6d572955440fed2", "score": "0.6690714", "text": "function addWordToGame(){\n\n\tvar word;\n\tvar enoughSpace = false;\n\tvar x_pos = 0;\n\n \tdo{\n\t\tword = words[Math.floor(Math.random() * words.length)];\n \t}while(wordsVisible.indexOf(word) !== -1);\n\n \twordsVisible.push(word);\n\n \tvar end = 0;\n\n \tdo{\n \t\tx_pos = Math.floor(Math.random() * 20 + 2) - word.length;\n\n \t\tfor(var i = x_pos; i <= 20; i++){\n \t\t\tif($('#' + i).html() !== \"\"){\n \t\t\t\tenoughSpace = false;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\telse{\n \t\t\t\tenoughSpace = true;\n \t\t\t}\n \t\t}\n \t\tend++;\n \t}while((x_pos <= 0 || (enoughSpace === false)) && end < 15);\n\n\tif(enoughSpace === true){\n\t \tfor(var i = 0; i < word.length; i++){\n\t\t\tvar $letter = $('#' + (x_pos + i));\n\n\t \t\t$letter.html(word[i]);\n\t \t\t$letter.addClass(word);\n\t\t}\n \t}else{\n \t\treturn false;\n \t}\n }", "title": "" }, { "docid": "083025fadc6f8f8a5d6689b035efad34", "score": "0.66845244", "text": "function generateWord() {\n\t\tvar beer = ['lager', 'stout', 'pilsner', 'porter', 'amber', 'wheat'];\n\t\tvar selection = beer[Math.floor(Math.random() * beer.length)];\n\t\treturn selection;\n\t}", "title": "" }, { "docid": "62099c0975e3ea010ef17471cc166513", "score": "0.66833985", "text": "makeText(numWords = 100) {\n let story = \"\"\n let word = this.words[Math.floor(Math.random() * this.words.length)]\n story += word\n for(let i=0; i<numWords; i++){\n story += ' '\n let arr = this.chains.get(word)\n let newWord = arr[Math.floor(Math.random() * arr.length)]\n story += newWord\n word = newWord\n }\n return story\n }", "title": "" }, { "docid": "99e3ab6059e2637b2878aceb62f21e3e", "score": "0.66814137", "text": "function getRandomWord(word_arr, def_arr){\n let position = Math.floor(Math.random() * 10);\n let definition = def_arr[position];\n document.getElementById(\"definition_box\").innerHTML = definition;\n return word_arr[position];\n}", "title": "" }, { "docid": "61094fd0afe8f2c84508b4598d4e4542", "score": "0.6678805", "text": "function dataWord () {\n\n $(\"[data-words]\").attr(\"data-words\", function(i, d){\n var $self = $(this),\n $words = d.split(\"|\"),\n tot = $words.length,\n c = 0; \n\n for(var loadtext=0; loadtext<tot; loadtext++) { $self.append($('<span/>',{text:$words[loadtext]}));}\n\n $words = $self.find(\"span\").hide();\n\n (function loop(){\n $self.animate({ width: $words.eq( c ).width() });\n $words.stop().fadeOut().eq(c).fadeIn().delay(750).show(0, loop);\n c = ++c % tot;\n }());\n \n });\n\n }", "title": "" }, { "docid": "d104608eb009e187beb9027be573e778", "score": "0.66699475", "text": "function pickWord(myWords, randNum){\n //object with words\n this.myWords = myWords;\n this.word = myWords[randNum];\n} // pickWord ends here", "title": "" }, { "docid": "a0a297e73fbc3c68d430e61763da797b", "score": "0.6666947", "text": "function getRandomWord() {\n var num = Math.floor(Math.random() * 7 + 1);\n return wordBank[num];\n\n}", "title": "" }, { "docid": "7393481069abd8440dae02085dc5c151", "score": "0.66662097", "text": "function wordgame_play() {\n var content = {\n /* Load word button */\n new_word:{\n theme:\"button\",\n text:\"Load New Word\",\n attributes:{\n onclick:\"wordgame_load_new_word();\"\n }\n },\n /* Word display container */\n word:{\n markup:'<div id=\"wordgame_word\"></div>',\n },\n /* Player input form */\n player_input:{\n markup:drupalgap_get_form('wordgame_word_form')\n },\n /* Answer button */\n answer:{\n theme:'button',\n text:'View Answer',\n attributes:{\n onclick:\"wordgame_view_answer();\"\n }\n },\n };\n return content;\n}", "title": "" }, { "docid": "551025fd5b5ed3bf6d250b3841170e32", "score": "0.66624516", "text": "function playGame() {\n let secret_word = choose_word(load_words(wordList));\n hangman_with_hints(secret_word);\n}", "title": "" }, { "docid": "d11c2bb584b216e53496c41e3dd0637d", "score": "0.6657807", "text": "function getword()\n \n{ \n\n var myindex=get_random();\n\n theWord=myWords[myindex]; //this is computer's word\n toOutput=\"\";\n for (var i = 0; i < theWord.length; i++) {\n toOutput = toOutput + \"_ \";\n }\n\n document.getElementById(\"wordToGuess\").innerHTML = toOutput;\n }", "title": "" }, { "docid": "141f095e10c7cb723e329e96ec32dc74", "score": "0.66570956", "text": "function randomWord() {\n\tcomputerWord = computerChoices[Math.floor(Math.random() * computerChoices.length)];\n}", "title": "" }, { "docid": "a22d52aa0bd60b390214338de143c7c1", "score": "0.6657061", "text": "function selectWord() {\n \n // Game words array\n var gameWords = [\n \"GEORGE WASHINGTON\", \"JOHN ADAMS\", \"THOMAS JEFFERSON\", \"JAMES MADISON\", \"JAMES MONROE\", \n \"JOHN QUNICY ADAMS\", \"ANDREW JACKSON\", \"MARTIN VAN BUREN\", \"WILLIAM HENRY HARRISON\", \"JOHN TYLER\", \n \"JAMES K POLK\", \"ZACHARY TAYLOR\", \"MILLARD FILLMORE\", \"FRANKLIN PIERCE\", \"JAMES BUCHANAN\", \n \"ABRAHAM LINCOLN\", \"ANDREW JOHNSON\", \"ULYSSES S GRANT\", \"RUTHERFORD B HAYES\", \"JAMES GARFIELD\", \n \"CHESTER A ARTHUR\", \"GROVER CLEVELAND\", \"BENJAMIN HARRISON\", \"WILLIAM MCKINLEY\", \"THEODORE ROOSEVELT\", \n \"WILLIAM HOWARD TAFT\", \"WOODROW WILSON\", \"WARREN G HARDING\", \"CALVIN COOLIDGE\", \"HERBERT HOOVER\", \n \"FRANKLIN D ROOSEVELT\", \"HARRY S TRUMAN\", \"DWIGHT D EISENHOWER\", \"JOHN F KENNEDY\", \"LYNDON B JOHNSON\", \n \"RICHARD M NIXON\", \"GERALD R FORD\", \"JAMES CARTER\", \"RONALD REAGAN\", \"GEORGE H W BUSH\", \n \"WILLIAM J CLINTON\", \"GEORGE W BUSH\", \"BARACK OBAMA\", \"DONALD J TRUMP\"\n ];\n\n // Determine the size of the gameWords array\n var arraySize = gameWords.length;\n \n // Select a random number from the arraySize\n var randomIndex = Math.floor((Math.random() * arraySize));\n \n // Select the word from the gameWords array that corresponds to the randomIndex. This is the word to guess.\n wordToGuess = gameWords[randomIndex];\n wLength = wordToGuess.length;\n\n wordToGuessByLetter = wordToGuess.split(\"\");\n \n //console.log(\"wordToGuess: \" + wordToGuess);\n}", "title": "" }, { "docid": "ca740331de47deb62179483385931e1b", "score": "0.6654825", "text": "function game(fetchword){\n const wordarray = fetchword.split(\"\");\n const wordlength = wordarray.length;\n console.log(wordlength)\n\n //creating empty space for fetched word\n for(let i=0; i<wordlength; i++){\nlet wordnode = document.createElement(\"span\");\nwordnode.setAttribute(\"class\", \"wordletter\")\nwordnode.setAttribute(\"id\", i)\nlet text = document.createTextNode(\"\");\nwordnode.appendChild(text);\nwordsection.appendChild(wordnode)\n}\n\ndocument.querySelectorAll(\".alphabet\").forEach(each=> {each.addEventListener('click', selectLetter)});\n\n//function on selecting letter event\nfunction selectLetter(event){\nlet selectedLetter = event.target.innerText;\n\n//checks if slected letter is in the fetched word\n\n let letterStatus = wordarray.includes(selectedLetter);\ndocument.getElementById(selectedLetter).classList.add(\"bg\");\n\n if(letterStatus){\n//fills the word selected in the corresponding empty space if true\n\n var indexes = [];\n for(let i = 0; i < wordarray.length; i++){\n if (wordarray[i] === selectedLetter)\n indexes.push(i);}\n\n for(let j=0; j<indexes.length; j++){\n document.getElementById(indexes[j]).innerText = wordarray[indexes[j]];\n }\n//checks if the word is guessed already\n filledCount = filledCount + indexes.length;\n\n if(filledCount===wordarray.length){\n document.querySelectorAll(\".alphabet\").forEach(each=> {each.removeEventListener('click', selectLetter)});\n document.querySelector(\".win\").classList.add(\"viewwin\")\n }\n\n }\n\n\nelse {\n //if false, raises false count by 1\nfalseCount++;\nconsole.log(falseCount)\nif(falseCount===5){\n //game over when falsecount === 5\n document.querySelectorAll(\".alphabet\").forEach(each=> {each.removeEventListener('click', selectLetter)});\n document.querySelector(\".gameover\").classList.add(\"viewgameover\");\n document.getElementById(\"correctword\").innerText = `The correct word was: ${fetchword}`;\n}\n}\ndocument.getElementById(\"chancesleft\").innerText = 5-falseCount;\n \n }\n\n\n}", "title": "" }, { "docid": "2feeffb25442e3dc074a8a2a6012bcff", "score": "0.6651257", "text": "makeText(numWords = 100) {\n // pick random word from words list\n const keysArr = Object.keys(this.chain)\n let randomWord = keysArr[Math.floor(Math.random() * keysArr.length)];\n\n // assign that word to a string called newStory. Capitalize 1st letter of first word.\n let newStory = randomWord[0].toUpperCase() + randomWord.slice(1);\n\n let counter = 1;\n\n let currWord = randomWord;\n\n while(counter<numWords) {\n let nextWordsArr = this.chain[currWord.toLowerCase()];\n // console.log(`current word: ${currWord}, next word array: ${nextWordsArr}`)\n let nextWord = nextWordsArr[Math.floor(Math.random() * nextWordsArr.length)];\n if (!nextWord) {\n break;\n }\n newStory += ` ${nextWord}`;\n if (!this.chain[nextWord]) {\n break;\n }\n currWord = nextWord;\n counter++;\n }\n\n newStory += '.';\n\n return newStory\n\n // while loop through the chains to generate a story. Stop at null OR when max num words has been reached.\n // Make sure to add period before returning story\n }", "title": "" }, { "docid": "a145d46b9d8b968e641b3692f85685f7", "score": "0.66411823", "text": "function gameStart() {\n // Establishes that the word has not been completed by guesses, will check against in later functions\n wordFinished = false;\n // currentWord to play gets assigned a random index from wordLibrary\n currentWord = wordLibrary[Math.floor(Math.random() * wordLibrary.length)];\n // enters guess guessesRemaining value to <div id = #guesses-remaining>\n document.getElementById(\"guesses-remaining\").innerHTML = guessesRemaining;\n // draws the blanks...\n document.getElementById(\"current-word\").innerHTML = \"_\".repeat(currentWord.length);\n document.getElementById(\"emoji\").src=\"assets/images/thinking.png\";\n \n \n console.log(currentWord);\n console.log(currentWord.length);\n}", "title": "" }, { "docid": "8f3137f1b07d29ffa2a70885947affc1", "score": "0.6639882", "text": "function pickWord(div, letter){\n let url = url1 + letter + url2;\n loadJSON(url, gotData);\n function gotData(data){\n let options = data.searchResults;\n let selection = random(options); \n div.html(selection.word); \n console.log(selection.word);\n }\n }", "title": "" }, { "docid": "ce00cb0446c99c853fc15d062c66f8d1", "score": "0.6636634", "text": "function newGame() {\n word = generateNum();\n console.log(word);\n displayDashes(word.length);\n }", "title": "" }, { "docid": "ab7d00b9fc9148b72e6dcd9ef8aaec93", "score": "0.663565", "text": "function newGame() {\n guess = 15;\n computerChoice = '';\n word = '';\n hiddenWord = '';\n userGuess = '';\n hiddenWordArr = [];\n guessesTillNow = [];\n\n document.getElementById(\"demo\").innerHTML = \" \";\n printBlank();\n vid = document.getElementById(\"mySong\");\n vid.pause();\n\n //function to select random word from an array \n}", "title": "" }, { "docid": "d32ca686d864b1dfe5f1132cde5ce9cf", "score": "0.6621407", "text": "function generateWord(difficulty, index) {\n let newWord;\n let shuffledWord;\n if (difficulty === \"L1\") {\n newWord = words_1[index]\n shuffledWord = shuffleWord(newWord)\n return shuffledWord }\n else if (difficulty === \"L2\") {\n newWord = words_2[index]\n shuffledWord = shuffleWord(newWord)\n return shuffledWord}\n else if (difficulty === \"L3\"){\n newWord = words_3[index]\n shuffledWord = shuffleWord(newWord)\n return shuffledWord\n }\n}", "title": "" }, { "docid": "899b8f30b669f1aad81e50ed9be9fbc4", "score": "0.6614051", "text": "function wordChoice(){\n\t\tx = Math.floor(Math.random() * wordList.length);\n\t\tchosenWord = wordList[x];\n\t}", "title": "" }, { "docid": "6a2e74fce2c2b762563f3d37a012ed60", "score": "0.66081357", "text": "function pickWord (wordArr) {\n var randomNumber = generateRandomNumber(wordArr);\n gameWord = wordArr[randomNumber];\n var currentWords = currentPlayer.previousWords;\n if (currentWords.length === 0) {\n currentWords.push(gameWord);\n } else if (currentWords.length === easyWords.length){\n currentWords = [];\n currentWords.push(gameWord);\n } else {\n while (currentWords.indexOf(gameWord) !== -1) {\n randomNumber = generateRandomNumber(wordArr);\n gameWord = wordArr[randomNumber];\n }\n currentWords.push(gameWord);\n }\n storeLocal();\n return gameWord;\n}", "title": "" }, { "docid": "7979c0b0b4d36a21cec3524069fffde7", "score": "0.660644", "text": "function WordToUse() {\n // randomises the word of the array, counting the length of it\n // outputs a decimal number, but with math.floor rounds it up\n let randomIndex = Math.floor(Math.random() * gameWords.length);\n // random index value of the array will be stored here\n let tempWord = gameWords[randomIndex];\n // let rand = randomWordArray(tempWord.split(\"\"));\n // console.log(rand);\n return tempWord;\n}", "title": "" }, { "docid": "148b120a720a577e74b670a2b5b0366f", "score": "0.6602398", "text": "function Word(currentWord){\n this.selection = currentWord;\n this.letters = []; //An array of new Letter objects representing the letters of the underlying word\n this.populateLetters = function(){\n var array = this.selection.split(\"\");\n var letters = this.letters\n array.forEach(function (v) {\n letters.push(new Letter(v))\n });\n }\n this.runString = function(){\n //A function that returns a string representing the word. This should call the function on each letter object (the first function defined in Letter.js) that displays the character or an underscore and concatenate those together.\n var progress = \"\";\n var letters = this.letters;\n var word = this.selection;\n for (var i = 0; i < letters.length; i++){\n progress += letters[i].returnChar();\n }\n return progress;\n };\n this.checkWord = function (character){\n //A function that takes a character as an argument and calls the guess function on each letter object(the second function defined in Letter.js)\n this.letters.forEach(v => v.check(character));\n };\n}", "title": "" }, { "docid": "e767fdab4871200eaf95d48bae00cf2e", "score": "0.6586105", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random kata\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "6bad59ec80f1e49217454cc573b12810", "score": "0.6580256", "text": "function wordSelection () {\n\tcurrentWord = words[Math.floor(Math.random() * words.length)];\n\tcurrentWordLettersRemaining = currentWord.length;\n\n\t// Resets the wordSelection\n\tgWord.innerHTML = \"\";\n\tfor(var i = 0; i < currentWord.length; i++) {\n\t\t// Writes each letter in a div with numbered id (letter#) and an underscore placeholder\n\t\tvar letter = '<div id=\"letter' + i + '\">' + \"_\" + '</div>';\n\t\t// Writes each iteration of the variable letter before the end of the div id gameWord\n\t\tgWord.insertAdjacentHTML('beforeend', letter)\n\t}\n}", "title": "" }, { "docid": "9cc080600d1e217b5f790750da1150b9", "score": "0.6567871", "text": "function chooseWord(){\n\twordList = [\"doubtful\", \"chalk\", \"thaw\", \"grain\", \"distance\", \"jam\", \"shop\", \"gray\", \"entertain\", \"ring\", \"stormy\", \"stocking\"];\n\tword = wordList[Math.floor(Math.random()*wordList.length)];\n\t// Split word into individual letters\n\twordSplit = word.split(\"\");\n}", "title": "" }, { "docid": "773aa445eaa96f9178ccbc89be32a189", "score": "0.65653867", "text": "function getWord() {\n\n\t\tcurrentWord = this.listofWords[Math.floor(Math.random()*this.listofWords.length)];\n\t\tcurrentWordCount = (currentWord.replace(/\\s+/g, \"\").length);\n\t\tthis.printBlanks();\n\t\tconsole.log(currentWord + \"current word count \" + currentWordCount);\n\n\t}", "title": "" }, { "docid": "65d4a6d2c9fdbe976fcfd6b529f4d991", "score": "0.6563667", "text": "getWord() {\n\t\tlet url = \"randomword?word=newWord\";\n\t\tif (this.state.userAnswered) {\n\t\t\t// user answered before - reset states\n\t\t\tif (document.querySelector(\".card-body\").classList.contains(\"flip\")) {\n\t\t\t\tdocument.querySelector(\".card-body\").classList.toggle(\"flip\");\n\t\t\t}\n\t\t\tthis.state.userAnswered = false;\n\t\t\tif (document.querySelector(\".card-side-container\").classList.contains(\"correct\")) {\n\t\t\t\t// remove\n\t\t\t\tdocument.querySelector(\".card-side-container\").classList.remove(\"correct\");\n\t\t\t}\t\n\t\t}\n\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(\n\t\t\t\t(result) => {\n\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\tkor: result.korWd,\n\t\t\t\t\t\teng: result.engWd\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\terror\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t)\t\t\t\t\n\t}", "title": "" }, { "docid": "47340e011513bdf35b56a7b7624c9ae4", "score": "0.6563545", "text": "function initializeGame() {\n\tinitWord(); \t\t\t\t\t\t//This gets my random word from the wordArray\n\tinitChosenPlaceholders(); \t\t\t//This call the function to set the placeholders\n\trefreshTrysRemainingLabel();\t\t// Initialize the trys remaining\n\t//alert(chosenWord); \t\t\t\t\n}", "title": "" }, { "docid": "6925295ccfc09387ebdba92b5c57bbde", "score": "0.6561912", "text": "chooseRandomWord() {\n const randomIndex = Math.floor(Math.random() * this.words.length);\n this.currentWord = this.words[randomIndex];\n this.wordObj = new word_1.Word(this.currentWord);\n }", "title": "" }, { "docid": "4aa63fb70e8d1e5282461aef1bbe1f09", "score": "0.65490913", "text": "function newWord(){\n guessWord =words[Math.floor(Math.random() * words.length)];\n newAnswer(guessWord);\n }", "title": "" }, { "docid": "b73255757aea1197d290ac2574dded48", "score": "0.65450716", "text": "function GameWord(word) {\n\tthis.letters = this.makeLetters(word);\n\tthis.isSolved = false;\n}", "title": "" }, { "docid": "f87e881759eed1a440883482a99b280d", "score": "0.65449816", "text": "pickWord() {\n return String(this.words[Math.floor(Math.random() * this.words.length)]);\n }", "title": "" }, { "docid": "82228d944c962301297a5dbd6dcf05cc", "score": "0.6539103", "text": "function addWord(data){\n randomWord = data;\n let word = data;\n letterArray = word.split('');\n for(let i=0; i < letterArray.length; i++){\n $(\".word\").append('<div class=\"letter\" id=\"'+ letterArray[i] +'\"></div>')\n }\n}", "title": "" }, { "docid": "6832363d59041a92abe636ab6922c213", "score": "0.6538525", "text": "function randomWord(){\n return word[randomNum(4)]\n }", "title": "" }, { "docid": "23765fa98e694d2449ba07e05dd0fcdb", "score": "0.6532482", "text": "function newGame() {\n gameRunning = true;\n guessesLeft = 12;\n guessedLetterBank = [];\n incorrectLetterBank = [];\n pickedWordPlaceHolderArr = [];\n\n // picks random word from array\n pickedWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n\n //create placeholder out of new word\n for (let i = 0; i < pickedWord.length; i++) {\n pickedWordPlaceHolderArr.push(\"_\");\n }\n\n //Pushing everything to the DOM\n guessesLeftHTML.textContent = guessesLeft;\n placeHoldersHTML.textContent = pickedWordPlaceHolderArr.join(\" \");\n // wordTestHTML.textContent = pickedWord;\n guessedLettersHTML.textContent = incorrectLetterBank;\n\n}", "title": "" }, { "docid": "b588524bc559a2495d4019d236aa8195", "score": "0.6523659", "text": "function wordComplete() {\n let gameBoardString = turnToString(gameBoard)\n if (gameBoardString === word) {\n document.getElementById(\"game-board\").textContent = word\n celebrate();\n winBox += 1;\n } else {\n }\n}", "title": "" }, { "docid": "05217b4a6688627ba868eba1e231ed4a", "score": "0.65189695", "text": "function playGame(){\n var category = document.getElementById(\"categorySelection\").value;\n document.getElementById(\"WinOrLoose\").innerHTML = \"\";\n\n //checks if the category selected exists\n var t = false;\n for(var i = 0; i < 5;i++){\n if(titles[i] == category){\n t = true;\n }\n }\n\n if(t){\n words = lists[titles.indexOf(category)];\n } else {\n alert(\"Please choose a category\")\n }\n //choosing word and starting game\n if(words.length > 1 ){\n var x = words.length;\n var y =Math.floor(Math.random() * x);\n word = words[y];\n console.log(word);\n\n //sets up the game\n updateGame(true);\n } else{\n //error\n console.log(\"fail with the words list referencing\");\n }\n}", "title": "" }, { "docid": "bf855d51679e802bfeda5905c3cf2782", "score": "0.65180534", "text": "function showWord(Word){\n var randomWord = Math.floor(Math.random()*word.length)\n wordNow.innerHTML = word[randomWord].toLowerCase()\n}", "title": "" }, { "docid": "b56d548a178e8425e8c41d478c72bab8", "score": "0.65140396", "text": "function word(w) {\n // track current and new post offset to prevent repeating posts on click\n // nothing we can do about reloads, obviously.\n if (w) {\n getPost(place_word, 1, w);\n } else {\n var get_post = current_post;\n while (get_post == current_post) {\n get_post = randomInt(post_count);\n }\n current_post = get_post;\n getPost(place_word, get_post); \n }\n}", "title": "" }, { "docid": "e5577ba9a4f9cc97a3f304d6cb0e3c86", "score": "0.65015054", "text": "function pickWord(){\n words = [\n 'PERSONALITY',\n 'EMPLOYMENT',\n 'KICKOFF',\n 'ALARM',\n 'FOOTPRINT',\n 'GUARANTEE',\n 'BAD',\n 'PACKING',\n 'ESCAPOLOGY',\n 'JAVASCRIPT',\n 'MONKEY',\n 'AMAZING',\n 'PANCAKE',\n 'BANANA',\n 'CHOCOLATE',\n 'COFFEE',\n 'TRAIN',\n 'MODEL',\n 'CODE',\n 'MOUNTAIN',\n 'REACTION',\n 'MEETING'\n ];\n return words[Math.floor(Math.random() * words.length)];\n}", "title": "" }, { "docid": "dd5653c2c9ecae1ca1668c4fa9d946ae", "score": "0.65002054", "text": "function pickWord(){\n currentWord = wordChoice[Math.floor(Math.random() * wordChoice.length)];\n for (var i = 0; i < currentWord.length; i++) {\n guessWord.push(\"__\\xa0\");\n };\n}", "title": "" }, { "docid": "e205bea24e35c1d4c6956077b9740e49", "score": "0.64970917", "text": "function regenerateStartingWord(secondWord) {\n REQUEST = \"https://api.datamuse.com/words?topics=\" + theme + \"&rc=\" + secondWord;\n console.log(\"REQUEST: \" + REQUEST);\n $.getJSON(REQUEST, function (data) {\n var rouletteWordIndexes = [];\n for (var i = 0; i < data.length; i++) {\n if (rouletteWordIndexes.length < wordsPerRoulette) {\n var word = data[i].word;\n var syllables = syllableCount(word);\n\n if (syllables != -1 && syllables == syllableCount(startingWord) && legalWord(word)) {\n rouletteWordIndexes[rouletteWordIndexes.length] = i;\n }\n }\n }\n\n if (rouletteWordIndexes.length != 0) {\n var index = rouletteWordIndexes[Math.floor(Math.random() * rouletteWordIndexes.length)];\n\n var newStartingWord = data[index].word;\n newStartingWord = newStartingWord.charAt(0).toUpperCase() + newStartingWord.slice(1);\n\n var words = poem[0].split(\" \");\n poem[0] = poem[0].substring(words[0].length, poem[0].length);\n poem[0] = newStartingWord + poem[0];\n startingWord = newStartingWord;\n }\n\n $(\"#poem\").html(poem);\n });\n}", "title": "" }, { "docid": "032f324ecf27b936af58dc3aafeda859", "score": "0.6496374", "text": "function PopulateBoard() {\r\n PrepareBoard();\r\n\r\n var isOk = true; // consider all words are matching already\r\n\r\n for (var i = 0, len = wordBank.length; i < len; i++) {\r\n\r\n // even if one word has 0 total matches\r\n if (wordBank[i].totalMatches == 0) {\r\n isOk = false; // make false if even one word does not match\r\n console.log(\"Word not matching for\" + wordBank[i].string);\r\n //window.onload = Error(wordBank[i].string);\r\n\r\n \r\n // Written by me ( only if word cannot be inserted do this)\r\n // Error function works partially\r\n document.getElementById(\"crossword\").innerHTML = isOk\r\n ? BoardToHtml(\" \")\r\n : Error(wordBank[i].string); //console.log(\"error found\");\r\n }\r\n }\r\n\r\n // If all words have matches, crossword can be created possibly**** because cases like MAT BAT CAT still are not tracked until this step\r\n\r\n //for (var i = 0, isOk = true, len = wordBank.length; i < len && isOk; i++) {\r\n\r\n /* here cases like MAT BAT CAT can be tracked\r\n try to add all the words to the board \r\n \r\n //come back here after you try to add word, and it is ok or not\r\n //if(isOK==false)\r\n //not a word that can be added */\r\n\r\n console.log(\"BEFORE adding word to Board\",wordBank);\r\n for (var i = 0, len = wordBank.length; i < len && isOk; i++) {\r\n\r\n isOk = AddWordToBoard();\r\n //console.log(wordBank[0]);\r\n // console.log(\"i is\", i,wordBank);\r\n // returned_val = AddWordToBoard();\r\n // isOk = returned_val[0];\r\n //console.log(\"Word is here\",wordBank[i].string);\r\n \r\n\r\n // console.log(returned_val);\r\n // console.log(typeof(returned_val));\r\n // console.log(Object.keys(returned_val).length);\r\n\r\n // if (Object.keys(returned_val).length == 3) {\r\n \r\n // console.log(\"inside\", isOk);\r\n // console.log(returned_val);\r\n // wordBank[i].endxIndex = returned_val[1];\r\n // wordBank[i].endyIndex = returned_val[2];\r\n // console.log(\"Here\",wordBank[i]);\r\n // }\r\n \r\n }\r\n console.log(\"AFTER adding word to Board\",wordBank);\r\n console.log(\"inside populate board newWordBank\", newWordBank);\r\n console.log(\"inside populate board wordActive\", wordsActive);\r\n\r\n \r\n\r\n // when I return isOk = true , it means all words can be added\r\n return isOk; // returns isOk to Create func \r\n}", "title": "" }, { "docid": "f56668386a56d3dff938edb059670516", "score": "0.64922076", "text": "function randomWord() {\n var words = [\n \"ahoy\",\n \"plank\",\n \"booty\",\n \"seadog\",\n \"captain\",\n \"buccaneer\",\n \"privateer\",\n \"arrrr\",\n \"marooned\",\n \"parley\",\n \"cutlass\",\n \"doubloon\",\n \"grog\",\n \"keelhaul\",\n \"scurvy\",\n \"barnacles\",\n \"ship\",\n \"lad\",\n \"matey\",\n \"anchor\",\n \"pillage\",\n \"scuttle\"\n ];\n //picks a random word\n var word = words[Math.floor(Math.random() * words.length)];\n return word;\n}", "title": "" }, { "docid": "2fffbe803a1d32c023113ddae629fb5c", "score": "0.6481506", "text": "function _getWord() {\n var index = Math.floor(Math.random() * _words.length);\n return _words[index];\n}", "title": "" }, { "docid": "273ea6899bb464d328e778c178c2df31", "score": "0.6472386", "text": "function randomWord() {\r\n //Use Math.random() function to get the random number between(0-1, 1 exclusive).\r\n //Multiply it by the array length to get the numbers between(0-arrayLength).\r\n //Use Math.floor() to get the index ranging from(0 to arrayLength-1).\r\n answer = programming_languages[Math.floor(Math.random() * programming_languages.length)];\r\n}", "title": "" }, { "docid": "5c0c0af52fa8c275acdf43de29834d7d", "score": "0.64681697", "text": "function newWord() {\n\t\n\t// Picks a random value from wordArray to be used as the word for the current round \n\trandomWord = wordArray[Math.floor(Math.random() * wordArray.length)];\n\t// Sets guesses back at 6 (for starting new round) and displays the value on the page\n\tguessesRemaining = 6;\n\tdocument.getElementById(\"guesses-remaining\").innerHTML = \"Guesses Remaining: \" + guessesRemaining;\n\t// Clears the letters guessed display on the page\n\tlettersGuessed = [];\n\tdocument.getElementById(\"letters-guessed\").innerHTML = \"Letters Guessed: \";\n\t// Clears the chosenWord array\n\tchosenWord = [];\n\t// Loops through the current word and stores each letter as an underscore in the chosenWord array\n\tfor (var i = 0; i < randomWord.length; i++) {\n\t\tchosenWord[i] = \"_\";\n\t}\n\t// Converts the chosenWord array to a string without commas and displays it in the word-space heading\n\tdocument.getElementById(\"word-space\").innerHTML = chosenWord.join(\" \");\n\n}", "title": "" }, { "docid": "722d3102175debc572bdff6583ea0e16", "score": "0.6465365", "text": "function generateWords() {\n if (line < rhymeScheme.length) {\n if (syllableScheme[line] - syllablesOnLine > 3) {\n REQUEST = \"https://api.datamuse.com/words?topics=\" + theme + \"&lc=\" + previousWord;\n console.log(\"REQUEST: \" + REQUEST);\n $.getJSON(REQUEST, function (data) {\n syllablesLeft = syllableScheme[line] - syllablesOnLine;\n\n // Indexes of words to be included in random selection\n var rouletteWordIndexes = [];\n for (var i = 0; i < data.length; i++) {\n if (rouletteWordIndexes.length < wordsPerRoulette) {\n var word = data[i].word;\n var syllables = syllableCount(word);\n\n if (syllables != -1 && syllables < syllablesLeft && legalWord(word)) {\n rouletteWordIndexes[rouletteWordIndexes.length] = i;\n }\n }\n }\n\n\n if (rouletteWordIndexes.length != 0) {\n var index = rouletteWordIndexes[Math.floor(Math.random() * rouletteWordIndexes.length)];\n\n previousWord = data[index].word;\n\n var syllables = syllableCount(previousWord);\n\n syllablesOnLine += syllables;\n currentLine += \" \" + previousWord;\n console.log(\"word: '\" + previousWord + \"' index: \" + index + \" syllables: \" + syllables);\n } else {\n console.log(\"rouletteWordIndexes is empty: \");\n currentLine = \"\";\n syllablesOnLine = 0;\n attempts++;\n if (attempts >= attemptsBeforeRestart) {\n restartPoem();\n return;\n }\n }\n\n syllablesLeft = syllableScheme[line] - syllablesOnLine;\n\n generateWords();\n });\n } else {\n if (rhymes.length > rhymeScheme[line]) {\n REQUEST = \"https://api.datamuse.com/words?topics=\" + theme + \"&lc=\" + previousWord + \"&rel_rhy=\" + rhymes[rhymeScheme[line]];\n console.log(\"REQUEST: \" + REQUEST);\n $.getJSON(REQUEST, function (data) {\n // Indexes of words to be included in random selection\n var rouletteWordIndexes = endWordRouletteSelection(data);\n\n console.log(\"roull: \" + rouletteWordIndexes + \" rhymes: \" + rhymes[rhymeScheme[line]]);\n\n if (rouletteWordIndexes.length != 0) {\n addLastWord(data, rouletteWordIndexes);\n } else {\n console.log(\"2rouletteWordIndexes = 0\");\n console.log(\"line: \" + line);\n currentLine = \"\";\n line--;\n attempts++;\n if (attempts >= attemptsBeforeRestart) {\n restartPoem();\n return;\n }\n }\n\n handleLastWordResults();\n });\n } else {\n REQUEST = \"https://api.datamuse.com/words?topics=\" + theme + \"&lc=\" + previousWord;\n console.log(\"REQUEST: \" + REQUEST);\n $.getJSON(REQUEST, function (data) {\n // Indexes of words to be included in random selection\n var rouletteWordIndexes = endWordRouletteSelection(data);\n\n console.log(\"roull: \" + rouletteWordIndexes + \" rhymes: \" + rhymes[rhymeScheme[line]]);\n\n if (rouletteWordIndexes.length != 0) {\n addLastWord(data, rouletteWordIndexes);\n rhymes[rhymeScheme[line]] = previousWord;\n } else {\n console.log(\"3rouletteWordIndexes = 0\");\n currentLine = \"\";\n line--;\n attempts++;\n if (attempts >= attemptsBeforeRestart) {\n restartPoem();\n\n }\n }\n\n handleLastWordResults();\n });\n }\n }\n }\n}", "title": "" } ]
7d211f3fff4d618e8fd66aea78f326f4
Formats the JSON response from the Marvel API into character profiles used by the store
[ { "docid": "215c4576ed7897461180689ccf5dcf6d", "score": "0.65668195", "text": "function formatJSONResponse(json) {\n return json.data.results.map((character) => {\n return {\n id: character.id,\n strenght: character.comics.available,\n description: character.description,\n name: character.name,\n thumbnail: character.thumbnail.path + '/portrait_xlarge.' + character.thumbnail.extension\n }\n });\n}", "title": "" } ]
[ { "docid": "9c3c392b09e9facdbbc2ce91ff41591c", "score": "0.64417964", "text": "function formatJSONResponse(json) {\n let character = json.data.results[0];\n return {\n id: character.id,\n strenght: character.comics.available,\n description: character.description,\n name: character.name,\n thumbnail: character.thumbnail.path + '/portrait_xlarge.' + character.thumbnail.extension,\n isFighting: true\n }\n}", "title": "" }, { "docid": "06d8777db382c8eb29236c5f61a7977e", "score": "0.6122587", "text": "function getPageCharacterDetails(data){\n let details = \"\"\n let name = data['name'];\n let height = data['height'];\n let mass = data['mass'];\n let hair_color = data['hair_color'];\n let skin_color = data['skin_color'];\n let eye_color = data['eye_color'];\n let birth_year = data['birth_year'];\n let gender = data['gender'];\n details = details + \"Name: \" + name + \"</br>\";\n details = details + \"Height: \" + height + \" cm</br>\";\n details = details + \"Mass: \" + mass + \" kg</br>\";\n details = details + \"Hair Color: \" + hair_color + \"</br>\";\n details = details + \"Skin Color: \" + skin_color + \"</br>\";\n details = details + \"Eye Color: \" + eye_color + \"</br>\";\n details = details + \"Birth Year: \" + birth_year + \" (measured in years Before or After the Battle of Yavin)</br>\";\n details = details + \"Gender: \" + gender + \"</br>\";\n return details;\n}", "title": "" }, { "docid": "4cc5df316cc0cd1af4a05e6aac2f30ae", "score": "0.583881", "text": "format_initial_accounts() {\n this.json.initial_accounts = this.json.initial_accounts.map(account => {\n return {\n \"name\": account.eth.replace(/\"/g, ''),\n \"owner_key\": account.aac.replace(/\"/g, ''),\n \"active_key\": account.aac.replace(/\"/g, ''),\n \"liquid_balance\": `${account.balance.replace(/\"/g, '')} AAC`\n };\n });\n }", "title": "" }, { "docid": "fe31b56094ed87143d70c3cefe7ef1b7", "score": "0.57248235", "text": "function getCharacters() {\n fetch('https://rickandmortyapi.com/api/character')\n .then((response) => {\n return response.json();\n })\n .then((charData) => { \n displayChars(charData);\n })\n .catch((error) => {\n console.log(error);\n })\n}", "title": "" }, { "docid": "2a3ab750851e847927397a07e8cc0916", "score": "0.55395883", "text": "async function fetchCharacters() {\n const response = await fetch(\"https://swapi.dev/api/people/\");\n const data = await response.json();\n setCharacters(data.results);\n }", "title": "" }, { "docid": "792ddd0cf12b89442479b4bd6d2d0b83", "score": "0.5501177", "text": "toProfile(profile) {\n return { \"name\": profile.name, \"id\": profile.uuid, \"_msmc\": profile._msmc };\n }", "title": "" }, { "docid": "28300191826f6b5183c7799f96783e49", "score": "0.5490851", "text": "function response(poeData) {\n console.log(poeData);\n for (var i = 0; i < 50; i++) {\n console.log(`Character name: ${poeData.entries[i].character.name}`);\n }\n}", "title": "" }, { "docid": "b8539db7a217d1e7c6d9d363191b50aa", "score": "0.548153", "text": "fetchInfo() {\n fetch(\"http://beta-api-kuroganehammer.azurewebsites.net/api/characters/name/\" + this.state.usrInput)\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n charInfo: result\n });\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n\n fetch(\"http://beta-api-kuroganehammer.azurewebsites.net/api/characters/name/\" + this.state.usrInput + \"/characterattributes\")\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n items: result\n });\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n }", "title": "" }, { "docid": "094a6c757fd0052f750d50233a6603db", "score": "0.5459375", "text": "function success_userDetails(json) {\n var response = JSON.parse(json);\n return {\n userDetails: {\n img: response[0].owner.avatar_url,\n repos: response.length,\n languages: getLanguages(response),\n stars: countStars(response)\n },\n firstRepo: {\n name: response[0].name,\n url: response[0].html_url,\n created: response[0].created_at.substr(0, 10),\n issues: response[0].open_issues,\n watchers: response[0].watchers,\n contributors_url: response[0].contributors_url,\n contributors: []\n }\n };\n}", "title": "" }, { "docid": "2c3b195d1c6eec85e36c0acf32fbecb9", "score": "0.5448584", "text": "getCharacterDetailsWith (characterUrl) {\n newApi = create ({\n baseURL: `${characterUrl}`,\n headers: {\n Accept: 'application/vnd.anapioficeandfire+json',\n version: 1,\n },\n });\n return newApi.get ();\n }", "title": "" }, { "docid": "42b17ece56d9aa398492b5a9bf25ab23", "score": "0.53979844", "text": "function getCharacter(id)\n{\n fetch('https://rickandmortyapi.com/api/character/'+id)\n .then(response => response.json())\n .then(data => {\n if (data) {\n let details = document.getElementsByClassName('site_character_details');\n\n for (let j = 0; j < details.length; j++) {\n if (j === 0) {\n let image = document.getElementsByClassName('site_character_image')[0];\n image.src = data['image'];\n\n } else {\n switch (j) {\n case 1:\n details[j].innerHTML = details[j].innerHTML.split(':')[0] + ': ' + data['name'];\n break;\n case 2:\n details[j].innerHTML = details[j].innerHTML.split(':')[0] + ': ' + data['location']['name'];\n break;\n case 3:\n details[j].innerHTML = details[j].innerHTML.split(':')[0] + ': ' + data['species'];\n break;\n case 4:\n details[j].innerHTML = details[j].innerHTML.split(':')[0] + ': ' + data['gender'];\n break;\n default:\n break;\n }\n }\n }\n }\n })\n .catch(function(err) {\n console.error(err);\n });\n}", "title": "" }, { "docid": "51ab81cd121b0218071c51c7566115ab", "score": "0.53852904", "text": "function loadCharactersFromAPI() {\n\n apiHandler.getAllCharacters()\n .then(res => {\n const charactersUL = document.querySelector(\"#charactersList\")\n console.log(res)\n\n let charactersInfo = \"\"\n res.data.reverse().forEach(character => {\n charactersInfo += `<li>Nombre: ${character.name} </br> Ocupación: ${character.occupation} </br> Arma: ${character.weapon}</li>`\n });\n\n charactersUL.innerHTML = charactersInfo\n })\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "1fe781cecb66b4fe8ae0a1d6e3cc6c23", "score": "0.53644884", "text": "function newProfileResponse(data){\n console.log(data);\n}", "title": "" }, { "docid": "ad56ea9c931333de396cd13951af897a", "score": "0.53340596", "text": "async function renderProfiles() {\n let profilesData = await fsw.readFile(home + '/profile/profile.json', 'utf8');\n let profilesJson = JSON.parse(profilesData);\n let profiles = [];\n if (Object.keys(profilesJson).length > 0) { \n for await (let profile of Object.keys(profilesJson)) {\n profiles.push(profilesJson[profile].username)\n }\n }\n socket.emit('renderprofiles', profiles);\n }", "title": "" }, { "docid": "35ed0f4e0513af917c6c3ff126d88b04", "score": "0.53084445", "text": "function fetchCharacters() {\n let returned = fetchedData.characterInfo.map((data) => {\n return (\n <tr key={data.name}>\n <td> {data.name} </td>\n <td>{data.gender}</td>\n <td> {data.birth_year}</td>\n <td> {data.mass} </td>\n <td>{data.height}</td>\n </tr>\n );\n });\n return returned;\n }", "title": "" }, { "docid": "ff7326ed4f46829fdc0f4df1c5b02a0f", "score": "0.5267888", "text": "getProfile() {\n return decode(this.getToken());\n }", "title": "" }, { "docid": "4b4bf0333317d6f45aba286aaa9e1393", "score": "0.5265211", "text": "function getAllProfiles (callback) {\n request.get({ uri: bufferApiRootUrl + '/profiles.json?access_token=' + config.bufferAccessToken }, function (err, res, body) {\n var profiles;\n\n // Bufferapp is supposed to send valid JSON, but you never know\n try{\n profiles = JSON.parse(body);\n } catch (e) {\n profiles = [];\n }\n\n return callback(null, profiles);\n });\n}", "title": "" }, { "docid": "2c738c21ecc07824ad5b9b7a6d232aa7", "score": "0.52582204", "text": "function players (resp) {\n return base(resp).map(function (player) {\n var names = player.displayLastCommaFirst.split(\", \").reverse();\n return {\n firstName: names[0].trim(),\n lastName: (names[1] ? names[1] : \"\").trim(),\n playerId: player.personId,\n teamId: player.teamId,\n };\n });\n}", "title": "" }, { "docid": "e4266b51631f25f892122be3472e3227", "score": "0.5255526", "text": "showProfile(user) {\n // console.log('The character object', user);\n\n // Loop over the character abilities, and output in a li tag\n const abilities = user.abilities.map((ab) => ab);\n let specials = '';\n abilities.forEach((element) => {\n specials += `\n <li>${element}</li>\n `;\n });\n\n this.profile.innerHTML = `\n <div class=\"character-profile\">\n <h1>${user.name}</h1>\n \n <img src=${user.img} />\n <p class=\"character-gender\"><b>Gender:</b> ${user.gender}</p>\n <p class=\"character-race\"><b>Race:</b> ${user.race}</p>\n </div>\n \n <div class=\"character-stats\">\n <div class=\"character-bio\">\n <p>${user.bio}</p>\n </div>\n <div class=\"character-stats-abilities\">\n <div class=\"character-stats\">\n <h2>Stats</h2>\n <ul>\n <li>Health: ${user.health}</li>\n <li>Attack: ${user.attack}</li>\n <li>Defense: ${user.defense}</li>\n <li>KI Restore Speed: ${user.kiRestoreSpeed}</li>\n </ul>\n </div>\n <div class=\"character-abilities\">\n <h2>Special Abilites</h2>\n <ul>\n ${specials}\n </ul>\n </div>\n</div>\n `;\n }", "title": "" }, { "docid": "f93ac3f070011855e052abe41cd577b0", "score": "0.5254602", "text": "getProfile() {\n return decode(this.getToken());\n }", "title": "" }, { "docid": "3e35da132b090a4248a55bf54452f954", "score": "0.5249946", "text": "function loadCharactersFromAPI() {\n\n charactersAPI\n //lo pasamos como parametro de la funcion desplegar uno y añadimos sus datos\n .displayOne(singleID)\n .then(elm => {\n console.log(elm);\n\n\n //IMPORTANTE PONER ELM.DATA porque data es una key del objeto elm que asu vez es otro objeto y accedemos a su valor .name\n\n\n let character = `<div class=\"character-info\">\n\n \n <div class=\"name\">Character Name: ${elm.data.name}</div>\n <div class=\"occupation\">Character Occupation: ${elm.data.occupation}</div>\n <div class=\"cartoon\">Is a Cartoon? ${elm.data.cartoon}</div>\n <div class=\"weapon\">Character Weapon: ${elm.data.weapon}</div>\n\n </div> `\n\n document.querySelector('.characters-container').innerHTML = character\n\n\n })\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "c52c7fd02bdc7acff69265db4745943f", "score": "0.5232278", "text": "function profileParser(body) {\n var temp = JSON.parse(body), profile = {};\n if (temp.error) {\n profile.error = temp.error;\n //TODO: there might be other properties to consider\n }\n if (temp.email) {\n profile.email = temp.email;\n } else if (temp.emails) {\n if (temp.emails.preferred) {\n profile.email = temp.emails.preferred;\n } else if (temp.emails.account) {\n profile.email = temp.emails.account;\n } else if (temp.emails.business) {\n profile.email = temp.emails.business;\n } else if (temp.emails.personal) {\n profile.email = temp.emails.personal;\n }\n }\n if (temp.first_name) {\n profile.first_name = temp.first_name;\n } else if (temp.given_name) {\n profile.first_name = temp.given_name;\n }\n if (temp.last_name) {\n profile.last_name = temp.last_name;\n } else if (temp.family_name) {\n profile.last_name = temp.family_name;\n }\n if (temp.gender) {\n profile.gender = temp.gender;\n }\n if (temp.id) {\n profile.id = temp.id;\n }\n if(temp.link) {\n profile.link = temp.link;\n }\n if (temp.locale) {\n profile.locale = temp.locale;\n }\n //if (temp.name) {\n // profile.name = temp.name;\n //}\n if (temp.picture) {\n profile.picture = temp.picture;\n }\n if (temp.timezone) { //only Facebook\n profile.timezone = temp.timezone;\n }\n if (temp.updated_time) {\n profile.updated = temp.updated_time;\n }\n if (temp.verified) {\n profile.verified = temp.verified;\n } else if (temp.verified_email) {\n profile.verified = temp.verified_email;\n }\n return profile;\n }", "title": "" }, { "docid": "091975769154ac8c21282f2e74af9455", "score": "0.52221656", "text": "function app(response) {\n var characters = response.data.results;\n console.log(characters);\n displayCharacterNames(characters);\n }", "title": "" }, { "docid": "c31f3220801ca12057c9c8a48d2ce328", "score": "0.52116174", "text": "getCharacters() {\n return apiClient.get('/characters')\n }", "title": "" }, { "docid": "f48484a8fa155dabe3e774ee5eb35849", "score": "0.5182035", "text": "function getCustomAPI(string) {\n client.invokeApi('getuserinfo', {\n method: 'get'\n })\n .done(function (results) {\n var obj = JSON.parse(results.responseText);\n $(\".userimage\").attr(\"src\", obj.profile_image_url_https);\n $(\".screenname\").text(obj.screen_name);\n console.log(obj.screen_name);\n });\n}", "title": "" }, { "docid": "3acdb3805bdfb144b8a4c5d5dc60eec7", "score": "0.51696485", "text": "function generateResponseBody(data) {\n return {\n username: data.username,\n name: data.name,\n location: data.location,\n email: data.email,\n bio: data.bio,\n avatar_url: data.avatar_url,\n titles: generateTitles(data),\n favorite_language: getMostUsedLanguage(data.languages),\n public_repos: data.public_repos,\n total_stars: data.starCount,\n highest_starred: data.highestStarred,\n perfect_repos: data.perfectRepos,\n followers: data.followers,\n following: data.following\n };\n}", "title": "" }, { "docid": "2760c03936e29e444de43ee0061e8b7a", "score": "0.51691955", "text": "function profileInfo(object) {\n return object.name.slice(0, 1).toUpperCase() + object.name.slice(1) + \" is a \" + object.species.slice(0, 1).toUpperCase() + object.species.slice(1);\n //return a string with value at key name catitlized added string is a plus value at the key species capitlized \n}", "title": "" }, { "docid": "0d37a0ca445441352ad9b37e9e2bf241", "score": "0.51682913", "text": "dataForRender(profile) {\n let cardUrl = '';\n if (profile.url) {\n cardUrl = profile.url;\n } else if (profile.landingPageUrl) {\n cardUrl = profile.landingPageUrl;\n }\n\n let imageUrl = '';\n let alternateText = '';\n if (profile.photoGallery && profile.photoGallery[0]) {\n imageUrl = Formatter.image(profile.photoGallery[0]).url;\n alternateText = Formatter.image(profile.photoGallery[0]).alternateText;\n }\n\n return {\n title: profile.name, // The header text of the card\n url: cardUrl, // If the card is a clickable link, set URL here\n target: '_top', // If the card URL should open in a new tab, etc.\n titleEventOptions: this.addDefaultEventOptions(),\n subtitle: Formatter.price(profile.price), // The sub-header text of the card\n image: imageUrl, // The URL of the image to display on the card\n altText: alternateText, // The alternate text for the image\n details: profile.richTextDescription ? ANSWERS.formatRichText(profile.richTextDescription, 'richTextDescription', '_top') : null, // The text in the body of the card, Warning: cannot contain links\n // tag: profile.stockStatus ? profile.stockStatus : '', // The tag text for the card\n };\n }", "title": "" }, { "docid": "7a55ea06ec44daab5ae3c1cc654e7596", "score": "0.5163576", "text": "function displayProfile(responseJson) {\n\n const name = responseJson.name; // e.g. Amazon, Inc\n const ticker = responseJson.ticker; // e.g. AMZN\n const marketCap = formatter.format(responseJson.marketCapitalization);// Change to integer and format with fewer zeros\n const exchange = responseJson.exchange;\n const industry = responseJson.finnhubIndustry;\n const url = responseJson.weburl;\n\n if (name === undefined) {\n $(\"div#greeting\").html(`<h2> Stock symbol is not found. Please try again. </h2>`)\n $(\"div#greeting\").removeClass('hidden');\n $('#results').addClass('hidden');\n } else {\n $(\"div#greeting\").html(`<h2> Your results are below</h2>`);\n $(\"#overview-ul\").empty();\n $(\"#overview-ul\").append(`<li> Company Name: ${name} </li>`);\n $(\"#overview-ul\").append(`<li> Ticker Symbol: ${ticker} </li>`);\n $(\"#overview-ul\").append(`<li> Market Cap: ${marketCap} (MM) </li>`);\n $(\"#overview-ul\").append(`<li> Exchange: ${exchange} </li>`);\n $(\"#overview-ul\").append(`<li> Industry: ${industry} </li>`);\n $(\"#overview-ul\").append(`<li> Website: ${url} </li>`);\n $('#results').removeClass('hidden');\n }\n}", "title": "" }, { "docid": "684a2a00bbdb0333d2b6ae0676aca4ae", "score": "0.51494473", "text": "function fetchCharacters () {\r\n // request data & handle response data\r\n sendGetRequest(fullURL, function (responseData) {\r\n let characterData = responseData.data.results;\r\n renderCharacters(characterData);\r\n })\r\n}", "title": "" }, { "docid": "fd768499c6bab90c56e72e07b5b6e100", "score": "0.5143062", "text": "function returnUsefulJSON(data) {\n // Example URL: https://images.dog.ceo/breeds/hound-ibizan/n02091244_743.jpg\n // 30th character is where the breed name starts.\n let breedName = \"\";\n let i = 30;\n while(data.message[i] != '/') {\n breedName += data.message[i];\n i++;\n }\n breedName = breedName.charAt(0).toUpperCase() + breedName.substr(1);\n\n processJSON({\n name: breedName,\n description: \"Hopefully this \" + breedName + \" cheers you up!\",\n picture: data.message\n });\n }", "title": "" }, { "docid": "1de289dc2fd424569410c7657e272ed1", "score": "0.5133221", "text": "onGetTopCharactersSuccess (data) {\n this.characters = data.slice(0, 5);\n }", "title": "" }, { "docid": "173029299407eb9cd0278741d2dd4bee", "score": "0.511855", "text": "function profileInfo(object) {\nreturn `${object.name.charAt(0).toUpperCase()}${object.name.slice(1)} is a ${object.species.charAt(0).toUpperCase()}${object.species.slice(1)}`;\n}", "title": "" }, { "docid": "e48aafeb9921abe53dceb5c2254f2c0b", "score": "0.50875664", "text": "parse (response) {\n if (!response.parsed) {\n response.avatar = response.avatar_urls['96']\n\n // Clean up unnecessary attributes\n delete response._links\n delete response.avatar_urls\n delete response.link\n\n // Mark as parsed so it doesn't get parsed again\n response.parsed = true\n }\n\n return response\n }", "title": "" }, { "docid": "97505fcdbff0e428f21572a2ac09b3e9", "score": "0.5084623", "text": "function formatMaritalStatusCountyData(json) {\n\n maritalStatusCountyData = [];\n\n for (var i = 1; i < json.length; i++) {\n var totalPopulation15AndOver = json[i][0]\n var totalMaleMaritalStatusPopulation = json[i][1];\n var totalFemaleMaritalStatusPopulation = json[i][2];\n var countyNameAndState = json[i][3];\n var stateID = json[i][4];\n var countyID = json[i][5];\n maritalStatusCountyData.push({\n TotalPopulation15AndOver: totalPopulation15AndOver,\n TotalMaritalStatusPopulation: parseFloat(totalMaleMaritalStatusPopulation) + parseFloat(totalFemaleMaritalStatusPopulation),\n CountyNameAndState: countyNameAndState,\n CountyID: +stateID + countyID\n });\n }\n return maritalStatusCountyData\n }", "title": "" }, { "docid": "af6ea5f9396f78d92f0d34000f19d134", "score": "0.50697124", "text": "formatWikiData(response) {\n let len = response[1].length;\n let data = [];\n for (let m = 0; m < len; m++) {\n data.push({});\n }\n for(let index = 0; index < response.length; index++) {\n let section = response[index];\n switch (index) {\n case 1:\n for (let i = 0; i < len; i++) {\n data[i].title = section[i];\n }\n // console.log(section);\n break;\n case 2:\n for (let j = 0; j < len; j++) {\n data[j].snippet = section[j];\n }\n // console.log(section);\n break;\n case 3:\n for (let k = 0; k < len; k++) {\n data[k].url = section[k];\n }\n // console.log(section);\n break;\n default:\n //skip any thing else\n }\n }\n // console.log(data);\n return data;\n }", "title": "" }, { "docid": "74b2a6d7ffee1dac8135dc5c83bd654e", "score": "0.506216", "text": "function displayProfile(user) {\n\tvar target = new XMLHttpRequest();\n\ttarget.onreadystatechange = function() {\n \tif (this.readyState == 4 && this.status == 200) {\n\t\t\tProfile = JSON.parse(this.response);\n\t\t\tfor (var key in Profile) {\n\t\t\t\tif (key == user) {\n \t\t\tvar picture = '<img src = \"'+ Profile[key].picture+ '\" class=\"dp\">';\n\t\t\t\t\tvar name = '<p id=\"name\" class=\"name\">' + Profile[key].fullname+ '</p>';\n\t\t\t\t\tvar position = '<p id=\"position\" class =\"position\">Position:' + Profile[key].position + '</br>Location:' +Profile[key].location +'</br>Description:' + Profile[key].description + '</p>';\n\t\t\t\t\tvar allData = picture + name + position;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdocument.getElementById(\"text\").innerHTML = allData\n\t\t\tdocument.getElementById(\"overlaysidebar\").style.display = \"block\";\n\n \t}\n }\ntarget.open(\"GET\", \"/returnProfile\", true);\ntarget.send();\n}", "title": "" }, { "docid": "2de8c5c47a449150276578854402feb8", "score": "0.5053704", "text": "function formatMaleAndFemalePopulationRatioCountyData(json) {\n\n maleAndFemaleRatioCountyData = [];\n\n for (var i = 1; i < json.length; i++) {\n var totalPopulationAllAges = json[i][0]\n var totalMaleOrFemalePopulation = json[i][1];\n var countyNameAndState = json[i][2];\n var stateID = json[i][3];\n var countyID = json[i][4];\n maleAndFemaleRatioCountyData.push({\n TotalPopulationAllAges: totalPopulationAllAges,\n TotalMaleOrFemalePopulation: totalMaleOrFemalePopulation,\n CountyNameAndState: countyNameAndState,\n CountyID: +stateID + countyID\n });\n }\n return maleAndFemaleRatioCountyData\n }", "title": "" }, { "docid": "d3884f5f90904a7304803c2d1037fd65", "score": "0.5042874", "text": "function fetchProfileData(){\n \n fetch('https://api.fitbit.com/1/user/-/profile.json',\n {\n headers: {\n \"Authorization\": `Bearer ${localStorage.getItem(\"ourtoken\")}`\n \n }\n }\n )\n .then(j => {\n if (!j.ok) {\n throw new Error('network response not ok');\n }\n return j.json()\n })\n .catch(returnStubData)\n .then(getUserInfo)\n .then(writeUserInfo)\n}", "title": "" }, { "docid": "49d36ec934df21cd8d5bbbf132ab8e10", "score": "0.50415844", "text": "function profileInfo(object) {\nvar name = object.name.charAt(0).toUpperCase() + object.name.slice(1);\nreturn name + ' is a ' + object.species.charAt(0).toUpperCase() + object.species.slice(1);\n}", "title": "" }, { "docid": "038f117d43dcd4ed2cb457ad50fd1043", "score": "0.50366247", "text": "function getJSON() {\n return {\"coursename\" : name, \"coursenumber\" : number };\n }", "title": "" }, { "docid": "996c7d93be7e36320350dd2a7b946efd", "score": "0.5027138", "text": "async componentDidMount() {\n this.setState({ loading: true });\n const response = await fetch('https://swapi.dev/api/people/1/?format=json');\n const data = await response.json();\n this.setState({\n loading: false,\n character: data\n });\n }", "title": "" }, { "docid": "267cc91e4bd8afe36a4f523aae13378f", "score": "0.50223964", "text": "getPerspectives(){\n return fetch(dafneApi.API_URL+'/perspectives',{\n method:\"GET\",\n credentials:\"include\"\n })\n .then((response) => response.json())\n .then((response) => {\n return response;\n })\n .catch((error) =>{\n return error;\n });\n }", "title": "" }, { "docid": "8aa7639a5a14160e0073bdfd918f7c51", "score": "0.5018204", "text": "function getProfiles(json) {\n const profileArr = [];\n json.results.forEach(person => {\n profileArr.push(getSingleProfile(person));\n });\n return profileArr;\n}", "title": "" }, { "docid": "2c25181a952af7ba26cc1872dd02e77f", "score": "0.50178677", "text": "static async getAllInfo(){\n const info = await fetchData();\n return info.results.map((charInfo) => {\n return {\n id: charInfo.id,\n name: charInfo.name,\n status: charInfo.status,\n species: charInfo.species\n };\n });\n }", "title": "" }, { "docid": "07bfc55c166c76a96155434f947640f9", "score": "0.5001174", "text": "function getCharacterInfo() {\n\tvar not_applicable = [\n\t\t0,1,2,3,\t// TODO: Fix, these should never be variable names (is an array being treated as a regular variable somewhere?)\n\t\t'getSkillData','getBuffData','getSkillDamage','skill_layout','weapon_frames','wereform_frames','fcr_bp','fcr_bp_alt','fcr_bp_werebear','fcr_bp_werewolf','fhr_bp','fhr_bp_alt','fhr_bp_werebear','fhr_bp_werewolf','fbr_bp','fbr_bp_alt','fbr_bp_werebear','fbr_bp_werewolf',\n\t\t'name','type','rarity','not','only','ctc','cskill','set_bonuses','group','size','upgrade','downgrade','aura','tier','weapon','armor','shield','max_sockets','duration','nonmetal','debug'\t// TODO: Prevent item qualities from being added as character qualities\n\t];\n\tvar charInfo = \"{character:{\";\n\tfor (stat in character) {\n\t\tvar halt = 0;\n\t\tfor (let i = 0; i < not_applicable.length; i++) { if (stat == not_applicable[i]) { halt = 1 } }\n\t\tif (isNaN(Number(stat)) == false && character[stat] == \"undefined\") { halt = 1 }\t// TODO: determine why numbers are being added to character (especially 0,1,2,3 which are being defined as NaN instead of just undefined)\n\t\tif ((typeof(unequipped[stat]) != 'undefined' && character[stat] == unequipped[stat]) || unequipped[stat] == \"\") { halt = 1 }\n\t\tif (halt == 0 || stat == \"statpoints\" || stat == \"strength_added\" || stat == \"dexterity_added\" || stat == \"vitality_added\" || stat == \"energy_added\" || stat == \"strength\" || stat == \"dexterity\" || stat == \"vitality\" || stat == \"energy\" || stat == \"life\" || stat == \"mana\" || stat == \"stamina\" || stat == \"mana_regen\") { charInfo += (stat+\":\"+character[stat]+\",\") }\n\t}\n\tcharInfo += \"},skills:[\"\n\tfor (let s = 0; s < skills.length; s++) { charInfo += \"[\"+skills[s].level+\",\"+skills[s].extra_levels+\",\"+skills[s].force_levels+\"],\" }\n\tcharInfo += \"],equipped:{\"\n\tfor (group in corruptsEquipped) { charInfo += (group+\":{name:\"+equipped[group].name+\",tier:\"+equipped[group].tier+\"},\") }\n\tcharInfo += \"charms:[\"\n\tfor (charm in equipped.charms) { if (typeof(equipped.charms[charm].name) != 'undefined' && equipped.charms[charm].name != 'none') { charInfo += \"'\"+equipped.charms[charm].name+\"',\" } }\n\tcharInfo += \"]},corruptsEquipped:{\"\n\tfor (group in corruptsEquipped) { charInfo += (group+\":{name:'\"+corruptsEquipped[group].name+\"'},\") }\n\tcharInfo += \"},mercEquipped:{\"\n\tfor (group in mercEquipped) { charInfo += (group+\":{name:'\"+mercEquipped[group].name+\"'},\") }\n\tcharInfo += \"},socketed:{\"\n\tfor (group in socketed) {\n\t\tcharInfo += group+\":[\"\n\t\tfor (let i = 0; i < socketed[group].items.length; i++) { charInfo += (\"name:{'\"+socketed[group].items[i].name+\"'},\") }\n\t\tcharInfo += \"],\"\n\t}\n\tcharInfo += \"},effects:{\"\n\tfor (id in effects) { if (typeof(effects[id].info.enabled) != 'undefined') {\n\t\tcharInfo += (id+\":{enabled:\"+effects[id].info.enabled+\",snapshot:\"+effects[id].info.snapshot)\n\t\tif (effects[id].info.snapshot == 1) {\n\t\t\tcharInfo += (\",origin:\"+effects[id].info.origin+\",index:\"+effects[id].info.index)\n\t\t\tfor (affix in effects[id]) { if (affix != \"info\") {\n\t\t\t\tcharInfo += (\",\"+affix+\":\"+effects[id][affix])\n\t\t\t} }\n\t\t}\n\t\tcharInfo += \"},\"\n\t} }\n\tcharInfo += \"},selectedSkill:[\"+selectedSkill[0]+\",\"+selectedSkill[1]\n\tcharInfo += \"],mercenary:'\"+mercenary.name+\"'\"\n\tcharInfo += \",settings:{coupling:\"+settings.coupling+\",autocast:\"+settings.autocast\n\tcharInfo += \"},ironGolem:\"+golemItem.name\n\tcharInfo += \"}\"\n\treturn charInfo\n}", "title": "" }, { "docid": "1fa003de451591ce225b3a42ed8cd09d", "score": "0.49985495", "text": "function callback(error, response, body){\n\n\tif(!error && response.statusCode == 200){\n var data = JSON.parse(body);\n\n\t// a) username image\n\n console.log(\"Profile Image: \" + data.avatar_url);\n\n // b) username\n console.log(\"Username: \" + data.login);\n\n // c) public repo count\n console.log(\"Number of Public Repos: \" + data.public_repos);\n\n // d) followers count\n console.log(\"Followers: \" + data.followers);\n }\n else{\n\n // 4) Output the Error if user is not found\n console.log(\"Invalid Profile Name\");\n }\n\n\n}", "title": "" }, { "docid": "2f1074aaeee7570c9fe5ecc3b06df672", "score": "0.4995866", "text": "function processData(res){\n rooms_data = res;\n uses = [... new Set(Object.values(res.features.map(k => k.properties.use)))];\n blocks = [...new Set(Object.values(res.features.map(k=>k.properties.block)))];\n\n return {'use':uses,\n 'utilities':[... new Set(Object.keys(res.features[0].properties))],\n 'blocks':blocks\n }\n\n}", "title": "" }, { "docid": "6447a970ed5059559bd31916a6c6077c", "score": "0.499422", "text": "getAllCharacters() {\n return this.http.get(this.URL_API)\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"map\"])((data) => data.data.results));\n }", "title": "" }, { "docid": "b7f19e5b8e0faa541a38b9e75f902381", "score": "0.49909228", "text": "function prepData(res){\n for( var a in res.rows ){\n //Format the access to make it more visually appearing\n access = \"\";\n var row = res.rows[a];\n\n //Assemble access\n for( var b=0; b<Math.min(row.countries.length, row.roles.length); b++ ){\n access += caps(row.countries[b]) + \"-\" + caps(row.roles[b]) + \" | \";\n }\n row.access = access.slice(0, -3);\n\n //Format the user data to make it searchable (but not visible)\n data = \"\";\n if( typeof(row.data) != \"object\" ){\n console.error(\"Bad user data - not an object.\");\n row.data = {};\n }\n var keys = Object.keys( row.data );\n for(var c in keys){\n var element = row.data[keys[c]];\n var val = element.val || element.value || \"\";\n data += caps(keys[c]) + \": \" + caps( val ) + \" | \";\n }\n row.data = data.slice(0,-3);\n\n //TODO: Format the creation time stamp to make it more readable.\n }\n return res.rows;\n }", "title": "" }, { "docid": "9ecd94f3296b896af209a3a0c3b269d6", "score": "0.4988801", "text": "function profileInfo(object) {\n for(let key in object) {\n //use bracket notation to access name: values and substring \n let name = object['name'][0].toUpperCase() + object['name'].substring(1) ; \n //Use dot notation and slice method\n let species = object.species[0].toUpperCase() + object.species.slice(1);\n return `${name} is a ${species}`;\n }\n}", "title": "" }, { "docid": "8a3d610290a2b0ff77797017a1edacaf", "score": "0.4976408", "text": "function profileInfo(object) {\n\nreturn object.name[0].toUpperCase() + object.name.slice(1) + ' is a ' + \nobject.species[0].toUpperCase() + object.species.slice(1);\n\n}", "title": "" }, { "docid": "8ceca73d2dbac82618e2f5ba463f959f", "score": "0.496544", "text": "function getParsedProfiles(req, cb) {\n getProtectedResource('/profiles', req.session, function (err, profilesBody) {\n _.each(profilesBody, function (value, key) {\n if (!Array.isArray(value)) {\n return;\n }\n\n profilesBody[key] = _.map(value, function (profile) {\n return parseInt(profile, 10);\n });\n });\n\n cb(profilesBody);\n });\n}", "title": "" }, { "docid": "7fe3083819d7dcd4641e6c4275147a62", "score": "0.495953", "text": "function profileInfo(object) {\n // return name capitalized + is a + species capitalized - message\n return object.name[0].toUpperCase() + object.name.slice(1) +\" is a \" + object.species[0].toUpperCase() + object.species.slice(1);\n\n}", "title": "" }, { "docid": "9404153440b751e2dafb0d3faeaeebfc", "score": "0.49444017", "text": "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"id\", \"first-name\", \"last-name\", \"headline\", \"location\", \"picture-url\", \"public-profile-url\", \"email-address\").result(displayProfileData).error(onError);\n }", "title": "" }, { "docid": "5f911667599e8c7ac653e2b49c02a47a", "score": "0.49394858", "text": "function format_cards(json) {\n var w, cards = json;\n cards.levels = {};\n for (w in cards.words) if (cards.words.hasOwnProperty(w)) {\n var obj = cards.words[w];\n //obj.word = w;\n if (!cards.levels.hasOwnProperty(obj.level)) cards.levels[obj.level] = [w];\n else cards.levels[obj.level].push(w);\n }\n return cards;\n}", "title": "" }, { "docid": "4d46cd79fe91f699fc5a1312c28fad8d", "score": "0.4937837", "text": "function getUsers(){\n fetch('https://jsonplaceholder.typicode.com/users')\n .then((response) => response.json())\n .then((data) =>{\n\n let output = '<h2 class=\"mb-4\">Movie Goers</h2>';\n console.log(data);\n\n data.forEach(function(user){\n\n output += `\n <ul class=\"list-group mb-3\">\n <li class=\"list-group-item\"> Name: ${user.name}</li>\n <li class=\"list-group-item\"> Contact Info: ${user.email}</li>\n <li class=\"list-group-item\"> City: ${user.address.city}</li>\n</ul>`;\n\n });\n\n document.getElementById('output').innerHTML = output;\n })\n\n\n\n}", "title": "" }, { "docid": "16c0b1912d307071242402aef3199f4e", "score": "0.4926937", "text": "function getJson() {\n fetch('https://jsonplaceholder.typicode.com/todos')\n .then((res) => res.json())\n .then((data) => {\n let output = \"<h1>CARDS</h1>\";\n data.forEach(function(card) {\n output += `\n <div class =\"info\">\n <div><h3> userID: ${card.userId}</h3></div>\n <div><h3> ID: ${card.id}</h3></div>\n <div><h3> Title: ${card.title}</h3></div>\n <div><h3> Completed: ${card.completed}<h3></div>\n </div>\n `;\n });\n document.getElementById('output').innerHTML = output;\n })\n}", "title": "" }, { "docid": "d9f2f6f7101d61c151d5b7a715641cc4", "score": "0.4924935", "text": "function character (json) {\n // console.log(json.results[0]);\n let name = document.createElement('h2')\n let para = document.createElement('p')\n let img = document.createElement('img')\n let article = document.createElement('article')\n let clearfix = document.createElement('div')\n\n //This sets a variable from a random character from the JSON using [] and a little math\n let chars = json.results[Math.floor(Math.random()*20)]\n\n name.innerHTML = chars.name\n para.innerHTML = chars.status + '!'\n img.src = chars.image\n\n\n\n console.log('Character:', chars)\n\n clearfix.appendChild(article)\n article.appendChild(name)\n article.appendChild(img)\n article.appendChild(para)\n section.appendChild(clearfix)\n}", "title": "" }, { "docid": "d2eaab074f72604877618196b21b1baa", "score": "0.49153173", "text": "function getCharacters() {\n // start building our initial table of 100 names\n $('#dynamictable').append('<table></table>');\n var table = $('#dynamictable').children();\n table.append(\"<tr><th>Image</th><th>Character Name</th><th>Description</th></tr>\");\n // NOTE: Limit is set to 100 in our API call\n $.get( \"http://gateway.marvel.com/v1/public/characters?limit=100&ts=1&apikey=8e772030b79a222c38c4d89b084bcfa2&hash=0ccab67d6d383dd5d750b361a4cbca17\", function( data ) {\n var result = data.data.results;\n $.each(result, function(index, value) {\n let image = '<img src=\"' + value.thumbnail.path + \".\" + value.thumbnail.extension + '\">';\n table.append(\"<tr><td>\" + image + \"+</td><td id='nameclick'><a href='#'>\" + value.name + \"</a></td>\" + \"<td>\" + value.description + \"</td></tr>\");\n }) // end each\n }); // end get\n } // end getCharacters", "title": "" }, { "docid": "af9b960997dbda0540310f29706bf290", "score": "0.4913162", "text": "function getPersonalization(url) {\n\t//load json skin (profile) and run it\n\tmakeCorsRequest(url);\n}", "title": "" }, { "docid": "efa0e2fb02b50870428ad54ee6f30087", "score": "0.49107066", "text": "function parse_umpires(response) {\n\tconst btp_t = response.Result[0].Tournament[0];\n\tif (!btp_t.Officials || !btp_t.Officials[0] || !btp_t.Officials[0].Official) return [];\n\treturn btp_t.Officials[0].Official.map(o => {\n\t\tconst res = {\n\t\t\tfirstname: o.FirstName[0],\n\t\t\tlastname: o.Name[0],\n\t\t\tbtp_id: o.ID[0],\n\t\t};\n\t\tif (o.Country && o.Country[0]) {\n\t\t\tres.nationality = o.Country[0];\n\t\t}\n\t\tres.name = res.firstname + ' ' + res.lastname;\n\t\treturn res;\n\t});\n}", "title": "" }, { "docid": "09de5786a48e918f15f279f19075702f", "score": "0.49009788", "text": "function formatData(data) {\n return {\n tweet: data.text,\n user: data.user.screen_name,\n follow: data.user.followers_count,\n location: data.user.location\n };\n}", "title": "" }, { "docid": "55ba15d5d6458fe307dd4fe86c7d528f", "score": "0.48954445", "text": "function generateUIForJSON(data){\n return `\n <div class=\"quarter\">\n <div class=\"image\">\n <img src=\"${data.picture}\"/>\n </div>\n <div class=\"info\">\n <h3>${data.name}</h3>\n <h4>${data.gender}</h3>\n <h5>${data.email}</h5>\n </div>\n </div>\n `\n}", "title": "" }, { "docid": "402fa62acdbd48562a24e84ee0bf8d0d", "score": "0.48932418", "text": "function parsingData(response){\n return response.json();\n}", "title": "" }, { "docid": "6d3e5d3fa78b5e9194e043edf8ce23e8", "score": "0.48848706", "text": "function generateResponseBodyFast(data) {\n return {\n username: data.username,\n name: data.name,\n location: data.location,\n email: data.email,\n bio: data.bio,\n avatar_url: data.avatar_url,\n titles: generateTitlesFast(data),\n favorite_language: getFavoriteLanguage(data.languages),\n public_repos: data.public_repos,\n total_stars: data.starCount,\n highest_starred: data.highestStarred,\n perfect_repos: data.perfectRepos,\n followers: data.followers,\n following: data.following\n };\n}", "title": "" }, { "docid": "16d50764b04fe94cefc50f224ea8894d", "score": "0.48820224", "text": "function getCardsJSON() {\n\n console.log(\"-------------------------------\")\n console.log(\"CARDS\")\n\n var cards = GameDataManager.getInstance().cardsCollection.models\n var data = {\"cards\": {}}\n\n for (i = 0; i < cards.length; i++) {\n var attributes = cards[i].attributes\n\n // Skip Unavailable, Hidden, Token, Training Teacher\n if (attributes.isAvailable === false) { continue }\n if (attributes.isHiddenInCollection) { continue }\n if (attributes.rarityName === \"Token\") { continue }\n if (attributes.factionId === 200) { continue }\n\n // Card\n card = {}\n card.animations = {}\n card.keywords = []\n\n // Basic\n card.id = attributes.id\n card.name = attributes.name\n card.mana = attributes.manaCost\n\n // Category\n if (attributes.isArtifact) { card.category = \"artifact\" }\n if (attributes.isSpell) { card.category = \"spell\" }\n if (attributes.isTile) { card.category = \"tile\" }\n if (attributes.isUnit) { card.category = \"unit\" }\n\n // Description\n // Note: Spells have a description, Units do not\n card.description = attributes.description\n\n // Faction\n card.faction = attributes.factionName\n card.factionId = attributes.factionId\n card.factionSlug = card.faction.split(\" \")[0].toLowerCase()\n\n // Keywords\n var keywords = attributes.keywordDescriptions\n if (keywords.length) {\n for (var ii = 0; ii < keywords.length; ii++) {\n card.keywords[ii] = keywords[ii].name\n }\n }\n\n // Race\n card.race = attributes.raceName\n\n // Rarity\n card.rarity = attributes.rarityName\n card.rarityId = attributes.rarityId\n\n // Search\n card.searchableContent = attributes.searchableContent\n\n // Type\n if (attributes.raceName) {\n card.type = attributes.raceName\n } else if (attributes.isGeneral) {\n card.type = \"General\"\n } else if (attributes.isArtifact) {\n card.type = \"Artifact\"\n } else if (attributes.isSpell) {\n card.type = \"Spell\"\n } else {\n card.type = \"Minion\"\n }\n\n // Unit\n card.attack = attributes.atk\n card.hp = attributes.hp\n card.isGeneral = attributes.isGeneral\n\n // Visibility\n card.isHidden = attributes.isHiddenInCollection\n\n // Save\n data.cards[card[\"id\"]] = card\n\n console.log(\"-------------------------------\")\n console.log(card.name + \" - \" + card.category + \" - \" + card.id)\n console.log(cards[i])\n console.log(card)\n\n }\n\n console.log(\"-------------------------------\")\n console.log(\"TOTAL: \" + Object.keys(data.cards).length);\n\n return JSON.stringify(data);\n}", "title": "" }, { "docid": "b1a72f5fc57fb908fce543fd416d0bf6", "score": "0.48807937", "text": "function profileInfo(obj) {\n return capitalizeWord(obj.name) + \" is a \" + capitalizeWord(obj.species);\n}", "title": "" }, { "docid": "c7f9542576fd8ce86875c5469624483a", "score": "0.4874569", "text": "fetchInfoNew(newInput) {\n fetch(\"http://beta-api-kuroganehammer.azurewebsites.net/api/characters/name/\" + newInput)\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n charInfo: result\n });\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n\n fetch(\"http://beta-api-kuroganehammer.azurewebsites.net/api/characters/name/\" + newInput + \"/characterattributes\")\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n items: result\n });\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n }", "title": "" }, { "docid": "71c354589b5e48c80beb2881244519b8", "score": "0.4871523", "text": "function getCharacterInfo(memID, memType, charID) {\n let path =\n \"https://www.bungie.net/platform/Destiny2/\" +\n memType +\n \"/Profile/\" +\n memID +\n \"/Character/\" +\n charID +\n \"/?components=200\";\n\n return axios({\n method: \"get\",\n url: path,\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"X-API-Key\": apiKey,\n },\n });\n}", "title": "" }, { "docid": "1060d134645a935989254a66c00398ab", "score": "0.4869364", "text": "getFullList () {\n axios.get(`${this.BASE_URL}/characters/`).then(data => {\n let html = ''\n data.data.forEach(char => {\n html += `\n <div class=\"character-info\" id=${char.id}>\n <div class=\"name\">Name: <span>${char.name}</span></div>\n <div class=\"id\">ID: <span>${char.id}</span></div>\n <div class=\"occupation\">Occupation: <span>${char.occupation}</span></div>\n <div class=\"cartoon\">Is this a cartoon?: <span>${char.cartoon}</span></div>\n <div class=\"weapon\">Weapon: <span>${char.weapon}</span></div>\n </div>\n `;\n })\n document.querySelector(\".characters-container\").innerHTML = html\n }).catch(err => console.log(err));\n }", "title": "" }, { "docid": "a19357dad0c6b0c01a995eaa54d7a03e", "score": "0.48607987", "text": "function getMembers(){\n const getAllMembersApiUrl = \"https://title-town-cards-api.herokuapp.com/API/Members\";\n fetch(getAllMembersApiUrl).then(function(response){\n console.log(response);\n return response.json();\n }).then(function(json){ \n let html = '';\n json.forEach((member)=>{\n html += \"<tr>\"+\n \"<th scope =\\\"row\\\">\" + member.memberID + \"</th>\" +\n \"<td>\" + member.memberName + \"</td>\" +\n \"<td>\" + member.memberAddress + \"</td>\" +\n \"<td>\" + member.memberEmail + \"</td>\" +\n \"<td>\" + member.memberDOB + \"</td>\" +\n \"<td>\" + member.memberPhone + \"</td>\" +\n \"</tr>\"\n });\n document.getElementById(\"allMembers\").innerHTML = html;\n }).catch(function(error){\n console.log(error);\n });\n}", "title": "" }, { "docid": "8b41ae4f90bf2574534f7a0c2242a37d", "score": "0.485919", "text": "async function fetchCharacters() {\n let output = document.querySelector(\".output\");\n output.innerHTML = \"\"; // Clears the contents of output class\n let outputTitle = document.querySelector(\"#outputtitle\");\n outputTitle.innerText = \"Characters\";\n\n let res = await fetch(`https://www.breakingbadapi.com/api/characters`);\n let results = await res.json();\n results.map((character) => createCharacters(character));\n}", "title": "" }, { "docid": "84d0e1d552f11d211fa25d7f993beb97", "score": "0.48531815", "text": "render() {\n let character = this.props.character;\n return (\n <div className='profile-container'>\n <h2 id='characterName'>{character.name}</h2>\n <div className='card-container'>\n <div className='information-card'>\n <li><span>Year Born:</span> {character.birth_year}</li>\n <li><span>Gender:</span> {character.gender}</li>\n <li><span>Height:</span> {character.height}</li>\n <li><span>Hair Color:</span> {character.hair_color}</li>\n <li><span>Eye Color:</span> {character.eye_color}</li>\n </div>\n <div className='information-card'>\n <li><span>Home World:</span> {character.homeWorld}</li>\n <li><span>Weight:</span> {character.mass}</li>\n <li><span>Skin Color:</span> {character.skin_color}</li>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "ad61a950b0e6d0c0ca7b9bec3d1d7226", "score": "0.48515645", "text": "function formatRaceCountyData(json) {\n\n desiredRaceCountyData = [];\n\n for (var i = 1; i < json.length; i++) {\n var totalPopulationAllAges = json[i][0]\n var totalDesiredRace = json[i][1];\n var countyNameAndState = json[i][2];\n var stateID = json[i][3];\n var countyID = json[i][4];\n desiredRaceCountyData.push({\n TotalPopulationAllAges: totalPopulationAllAges,\n TotalDesiredRace: totalDesiredRace,\n CountyNameAndState: countyNameAndState,\n CountyID: +stateID + countyID\n });\n }\n return desiredRaceCountyData\n }", "title": "" }, { "docid": "3a123815716ed7e72024b82a6b3085aa", "score": "0.48456866", "text": "static _formatResults(res) {\n let ret = {};\n\n const lines = res.split(CRLF);\n for (const line of lines) {\n const keyEnd = line.indexOf(\":\");\n const key = line.substring(0, keyEnd);\n const value = line.substring(keyEnd + 1);\n ret[key.trim()] = value.trim();\n }\n\n // want it to be last thing\n ret[\"_raw\"] = res;\n\n return ret;\n }", "title": "" }, { "docid": "440b1511c75b39e9a4e042a4469c0370", "score": "0.48422956", "text": "function getCustomerProfileExample() {\n oneapi.getCustomerProfile('me',function(isOk,oResponse) {\n if(!isOk) { // oResponse is DmApiError\n log(\"Error: Unable to get Customer profile:\" + oResponse.getErrorText()); \n } else { // oResponse is DmCustomerProfile\n log(\"Customer profile for <b>\" + oResponse.getAttr(\"username\",\"\") + '</b> :'); \n oResponse.forEachAttr(function(name,value) { // display all attributes of customer profile\n log(name + \" = \" + value);\n return true;\n }); \n log(\"Done.\");\n }\n });\n}", "title": "" }, { "docid": "171c23afd439b6788937a0ab297e8ffe", "score": "0.48383746", "text": "function formatJson(jsonResponse) {\r\n description.innerHTML = `<p>Description: ${jsonResponse.weather[0].description.toUpperCase()}</p>`;\r\n temp.innerHTML = `<p>Temperature: ${jsonResponse.main.temp} F</p>`;\r\n pressure.innerHTML = `<p>Pressure: ${jsonResponse.main.pressure} hPa</p>`;\r\n humidity.innerHTML = `<p>Humidity: ${jsonResponse.main.humidity}%</p>`;\r\n}", "title": "" }, { "docid": "9318708e3f9653601c779658a2b9375d", "score": "0.48367116", "text": "serializeProfile(profile) {\n return {\n user_id: profile.user_id,\n display_name: xss(profile.display_name),\n bio: xss(profile.bio),\n lfm_in: xss(profile.lfm_in),\n genres: profile.genres,\n avatar: profile.avatar,\n platforms: profile.platforms,\n xbox: xss(profile.xbox),\n psn: xss(profile.psn),\n nintendo: xss(profile.nintendo),\n steam: xss(profile.steam),\n discord: xss(profile.discord),\n other: xss(profile.other)\n };\n }", "title": "" }, { "docid": "c81602ef951de4dce95dddfaaac3de8c", "score": "0.4835614", "text": "function ProfileMapper() {\n this.toRaw = function(profile) {\n var raw = {\n email: profile.email,\n full_name: profile.full_name,\n avatar_url: profile.avatar_url,\n role: profile.role,\n location: profile.location,\n description: profile.description\n }\n if (profile.password) {\n raw.password = profile.password;\n raw.password_confirmation = profile.password_confirmation;\n }\n return raw;\n }\n}", "title": "" }, { "docid": "96773f1b306e730828ee51c9c52e5a84", "score": "0.48321602", "text": "function success() {\n var data = JSON.parse(this.responseText); //parse the string to JSON\n // console.log(data)\n // // console.log(JSON.stringify(data));\n // document.getElementById(\"jok\").innerHTML = JSON.stringify(data)\n // var jokeObj= JSON.stringify(data)\n document.getElementById(\"jok\").innerHTML= \"<br>\" + data['setup'] +\"<br><br>\"+ data['punchline'];//\n \n}", "title": "" }, { "docid": "52f090b2e1361290fc11163f84536428", "score": "0.48278525", "text": "function showCountriesList(resp) {\n countriesList.innerHTML = '';\n resp.forEach(function(item){\n let liEl = document.createElement('div');\n liEl.innerHTML = \n `<div class=\"country-heading\">\n <img src=${item.flag} alt=\"\">\n <h3>${item.name}</h3>\n </div>\n <ul class=\"properties\">\n <li>Native name:</li>\n <li>Language:</li>\n <li>Area:</li>\n <li>Capital:</li>\n <li>Currency:</li>\n </ul>\n <ul class=\"values\">\n <li>${item.nativeName}</li>\n <li>${item.languages[0].name}</li>\n <li>${item.area}</li>\n <li>${item.capital}</li>\n <li>${item.currencies[0].name}</li>\n </ul>`\n //item.name+item.area;\n countriesList.appendChild(liEl);\n });\n}", "title": "" }, { "docid": "6fb62d04c5cde62f3e869b2e85081171", "score": "0.48246711", "text": "async function fetchCharacter() { //async permet un comport. asynchrone basé sur des promesses, évitant ainsi les chaînes de promesses.\n try {\n const api = await fetch('https://character-database.becode.xyz/characters');\n const data = await api.json();\n console.log(data);\n return data;\n\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "c8a70263f7ad9bcd3adb7b9cb4c50f10", "score": "0.48240507", "text": "function print_profiledata(profile_info) {\n profile_info = JSON.parse(profile_info)\n $(\"#main\").remove() //Remove the login page after getting the user profile\n $(\"#show_info\").text(\"\")\n var tab = document.createElement('table')\n for (key in profile_info) {\n var row = document.createElement('tr')\n var col_1 = document.createElement('td')\n col_1.textContent = key\n var col_2 = document.createElement('td')\n col_2.textContent = profile_info[key]\n row.append(col_1, col_2)\n tab.append(row)\n }\n $(\"#show_info\").append(tab)\n $(\"#show_info\").addClass('my-5')\n tab.setAttribute('class', 'table table-bordered h2 bg-primary col-10 col-md-8 col-lg-3 offset-lg-2 text-center')\n $('body').addClass('container')\n}", "title": "" }, { "docid": "1d50f239f416dd182bfb80910ef85e0a", "score": "0.48238367", "text": "function covidDataJson(data){\r\n // Insert this to 'try-catch' to catch the errer if there is any property missing\r\n // To see this work type: at worldwide 'saba'\r\n \r\n let ret = \r\n {\r\n name: data.name,\r\n population: numberWithCommas(data.population),\r\n update_at: new Date(data.updated_at).toLocaleDateString(),\r\n total_confirmed: numberWithCommas(data.timeline[0].confirmed),\r\n new_confirmed: numberWithCommas(data.timeline[0].new_confirmed),\r\n active: numberWithCommas(data.timeline[0].active),\r\n deaths: numberWithCommas(data.timeline[0].deaths),\r\n new_deaths: numberWithCommas(data.timeline[0].new_deaths)\r\n }\r\n // console.log(ret)\r\n return ret;\r\n}", "title": "" }, { "docid": "2e7f337e429573da7521465021c3b699", "score": "0.48232225", "text": "parseUserJson(response) {\n const user = new User(response.login, response.avatar_url, response.html_url, response.type, response.name, response.public_repos, response.company, response.public_gists, response.followers, response.following, response.blog, response.location, response.created_at);\n return user;\n }", "title": "" }, { "docid": "94186ad7d866da9a8e3d49ba6c808cdf", "score": "0.48156705", "text": "function getStartingIntro(userObj) {\n userObj.profile.first_name=userObj.profile.first_name?userObj.profile.first_name:\"\";\n let response = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [{\n \"title\": \"Hello \" + userObj.profile.first_name + \"! \" + CONFIG.keyMapped['welcome'],\n \"subtitle\": \"Tap on Find Hotels to book a reservation.\",\n \"image_url\": \"https://cdn.glitch.com/c6c2dc22-89f9-4d15-a9bb-9d07a31dec01%2Fihg.png?1516965115124\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": CONFIG.keyMapped['findHotels'],\n \"payload\": \"find_hotels\"\n },\n {\n \"type\": \"web_url\",\n \"url\": \"http://customerservice.ihg.com/ihg/bot.html?isJSEnabled=1&brandcode=6c&businessArea=Root.IHG&reservation=%5Bobject%20Object%5D&akamaiCountryCode=AU&akamaiRegion=AMEA&akamaiSubRegion=Oceania&ihgSession=&subSection=null&pageidbrand=6c_reservationhome&hotelCode=null&categoryID=6c_new%2F925%2Fen&siteCountry=gb&timeOfDayAttribute=2&pcrNumber=null&membershipStatus=null&type=home&glat=&beFreeCookieCreationDate=&urlType=https&loginType=anonymous&country=925&iata=&controllerName=reservationhome&propertyCode=null&envName=prod&siteLanguage=en&brand=6c_new&language=en&city=null&eID=null&pcrTravelType=null&contentPage=null&hotelCityStateCountryCode=&hotelBrand4Digit=null&hotelBrand=null&initiatedActualUnitPrice=null&rateType=null&initiatedCurrencyCode=null&initiatedUnitPrice=null&initialBookingTotal=null&viewport=large&orientation=landscape&edwSellSource=WEBWB\",\n \"title\": CONFIG.keyMapped['liveChat']\n }\n ],\n }\n ]\n }\n }\n };\n userObj.tempQuestion = 'getStarted';\n service.callSendAPI(userObj.userId, response);\n}", "title": "" }, { "docid": "03850aadc923dc0b34008adb670229f4", "score": "0.48153073", "text": "static getAbilities(json) {\n // const match = [...text.matchAll(/\\*\\*\\*(.*?)\\.\\*\\*\\* (.*)/g)];\n // const extraMatch = [...text.matchAll(/(&nbsp;)+\\*\\*(.*?)\\.\\*\\* (.*)/g)];\n const abilitiesObject = {};\n let actions = []\n if (Array.isArray(json['action'])){\n actions = actions.concat(json['action'])\n }\n else if (json['action']){\n actions.push(json['action'])\n }\n\n if (Array.isArray(json['trait'])){\n actions = actions.concat(json['trait'])\n }\n else if (json['trait']){\n actions.push(json['trait'])\n }\n // if (!Array.isArray(json['traits'])){\n // actions.push(json['action'])\n // }\n actions.forEach((ability) => {\n //sometimes there are empty abilities\n if (Object.keys(ability['name']).length == 0 && Object.keys(ability['text']).length == 0){\n return;\n }\n\n let text = Parser.htmlDescription(ability.text)\n\n let cleanName = ability.name;\n\n var abilityObject = {\n description: Parser._clearText(text),\n data: {}\n };\n if (cleanName === 'Spellcasting'){\n abilityObject.data = Parser.getSpellcastingStats(text);\n }\n // else if (ability['name'].startsWith('Innate Spellcasting')){\n // console.log(ability['name'])\n // abilitiesObject.innate = {\n // data: Parser.getSpellcastingStats(text),\n // spells: Parser.getInnateSpells(ability['text'])\n // }\n // }\n else{\n abilityObject.data = Parser.getAttack(text);\n }\n\n let recharge_match = ability.name.match(/ \\(Recharges after a (?<short>Short or )?Long Rest\\)/);\n\n if (recharge_match){\n if (recharge_match.groups.short){\n abilityObject.data.uses = {\n value: 1,\n max: 1,\n per: \"sr\"\n }\n }\n else{\n abilityObject.data.uses = {\n value: 1,\n max: 1,\n per: \"lr\"\n }\n }\n\n cleanName = cleanName.replace(/ \\(Recharges after a (?<short>Short or )?Long Rest\\)/, \"\");\n }\n\n let day_match = ability.name.match(/ \\((?<count>\\d)\\/day\\)/i);\n\n if (day_match){\n abilityObject.data.uses = {\n value: Number(day_match.groups.count),\n max: Number(day_match.groups.count),\n per: \"day\"\n }\n\n cleanName = cleanName.replace(/ \\((?<count>\\d)\\/day\\)/i, \"\");\n }\n\n let recharge_on = ability.name.match(/ \\(Recharge (?<recharge>\\d)([-—]6)?\\)/);\n\n if (recharge_on){\n if (recharge_on.groups.recharge){\n abilityObject.data.recharge = {\n value: Number(recharge_on.groups.recharge)\n };\n }\n\n cleanName = cleanName.replace(/ \\(Recharge (?<recharge>\\d)([-—]6)?\\)/, \"\");\n }\n\n abilitiesObject[cleanName] = abilityObject;\n\n });\n // extraMatch.forEach((extraAbility) => {\n // abilitiesObject[extraAbility[2]] = {\n // description: Parser._clearText(extraAbility[3]),\n // data: {}\n // };\n // abilitiesObject[extraAbility[2]].data = Parser.getAttack(extraAbility[3]);\n // });\n return abilitiesObject;\n }", "title": "" }, { "docid": "0975fbc1d7f3469c09057db8cecc79ce", "score": "0.48145685", "text": "function fetchMembers() {\n return {\n [CALL_API]: {\n types: [ MEMBERS_REQUEST, MEMBERS_SUCCESS, MEMBERS_FAILURE ],\n api: 'cape',\n endpoint: 'acf/profiles',\n schema: Schemas.MEMBER_ARRAY,\n },\n }\n}", "title": "" }, { "docid": "1c33bfe2b9f84b20fa15df78014272af", "score": "0.48140463", "text": "function getProfileData() {\n\n\tvar request = new XMLHttpRequest();\n\trequest.open('GET', profile_url, true);\n\n\t//This function will be called when data returns from the web api\n\trequest.onload = function () {\n\n\t\t//get all the profile records into our profile array\n\t\tprofile_array = JSON.parse(request.responseText);\n\n\t\t//call the function so as to display all profile\n\t\tgetProfile();\n\t};\n\n\t//This command starts the calling of the profile web api\n\trequest.send();\n}", "title": "" }, { "docid": "1d2b67ae632d983169e027e36bf2fbcb", "score": "0.4812254", "text": "function dynamicSkinningSuccess(resp){\n kony.print(resp);\n}", "title": "" }, { "docid": "8bfcdb8477cbc5d916b0bfd7a01ac3e4", "score": "0.4809865", "text": "function formatStatsData(data) {\n let formattedData = [];\n\n // Data can be a nested array if it has paging links.\n // This is why there are two loops through the data.\n data.forEach(function (elements, index) {\n elements.forEach(function (element, index2) {\n let item = [];\n\n // Loop through object.\n for (part in element) {\n\n if (part === 'users') {\n item['username'] = [].concat(element['users']['username']['content_editor'], element['users']['username']['site_contact']);\n item['email_address'] = [].concat(element['users']['email_address']['content_editor'], element['users']['email_address']['site_contact']);\n continue;\n }\n\n item[part] = element[part];\n }\n\n // Get bundles out\n formattedData.push(item);\n });\n });\n\n return formattedData;\n}", "title": "" }, { "docid": "6ba009fa19eac70bc606a25c751ae212", "score": "0.4807155", "text": "function profileInfo(object) {\n return `${object.name[0].toUpperCase()}${object.name.slice(1)} is a ${object.species[0].toUpperCase()}${object.species.slice(1)}`;\n // using template literals return the object names first element capitalized and then joined with the rest of the word followed by \"is a\" and capitalized the rest of the word\n \n}", "title": "" }, { "docid": "eefd30dfb8bef344d6753b1fb17108c3", "score": "0.48065725", "text": "encode_initial_producers() {\n this.json.initial_producers = this.json.initial_producers.map(producer => {\n console.log(producer);\n producer.owner_name = generate_account_name(producer.owner_name.replace(/\"/g, ''), producer.index);\n delete producer.index;\n return producer;\n });\n }", "title": "" }, { "docid": "c3911f3acf6d8d578ca886e6c311640a", "score": "0.4806314", "text": "function fetchMemesJson(){\n\treturn fetch('https://api.imgflip.com/get_memes')\n\t\t\t.then(response => response.json())\n}", "title": "" }, { "docid": "af2333f128106ba74f22ba44a15dc22a", "score": "0.4804122", "text": "function getPersonalization(url) {\n\tif(!isDefined(url)){\n\t\treturn;\n\t}\n\tconsoleLog(\"ps1_e called: \");\n\t//load json skin (profile) and run it\n\tmakeCorsRequest(url);\n}", "title": "" }, { "docid": "560ce8c44733cf8fd360cb14f119e149", "score": "0.4803262", "text": "function profileInfo(object) {\n return `${object.name.charAt(0).toUpperCase() + object.name.slice(1)} is a ${object.species.charAt(0).toUpperCase() + object.species.slice(1)}`\n}", "title": "" }, { "docid": "2cd9b3f0610c6d3a41519d4599502e21", "score": "0.4802623", "text": "function profileInfo(object) {\n if (object.hasOwnProperty('name') && object.hasOwnProperty('species')) {\n object.name = capitalizeWord(object.name);\n object.species = capitalizeWord(object.species);\n return object.name + \" is a \" + object.species;\n }\n}", "title": "" }, { "docid": "e266dc288359472767ea60cb8b51acf5", "score": "0.47998476", "text": "componentDidMount() {\n fetch(`http://hp-api.herokuapp.com/api/characters`)\n .then(response => response.json())\n .then(characters => this.setState(\n {\n characters: characters\n }\n ))\n }", "title": "" }, { "docid": "51c1b620e30c6761dfce82ac4cd04530", "score": "0.47995988", "text": "function getPartyCharacters() {\n const partyData = [{\n name: \"Meatshield\",\n type: \"PC\",\n stats: {\n level: 5,\n //\n hp: 40,\n //\n str: 18,\n dex: 10,\n con: 14,\n wis: 10,\n int: 13,\n cha: 13,\n //\n equipped_armour_value: 6,\n //\n fort_prof: 2,\n will_prof: 1,\n ref_prof: 2,\n //\n skill_perception_prof: 1,\n skill_athletics_prof: 1,\n //\n attack_martial_prof: 1,\n //\n armour_unarmoured_prof: 0,\n armour_light_prof: 1,\n armour_medium_prof: 1,\n armour_heavy_prof: 1,\n },\n config: {\n equipped_armour_type: \"heavy\",\n },\n flags: [\n \"male\",\n \"goblin\",\n \"small\",\n \"fighter\",\n \"PC\",\n ],\n }, {\n name: \"Raspberry\",\n type: \"PC\",\n stats: {\n level: 5,\n //\n hp: 20,\n //\n str: 11,\n dex: 14,\n con: 13,\n wis: 8,\n int: 18,\n cha: 12,\n //\n equipped_armour_value: 0,\n //\n fort_prof: 1,\n will_prof: 2,\n ref_prof: 1,\n //\n skill_perception_prof: 1,\n skill_occultism_prof: 1,\n //\n attack_martial_prof: 0,\n //\n armour_unarmoured_prof: 1,\n armour_light_prof: 0,\n armour_medium_prof: 0,\n armour_heavy_prof: 0,\n },\n config: {\n equipped_armour_type: \"unarmoured\",\n },\n flags: [\n \"female\",\n \"small\",\n \"gnome\",\n \"witch\",\n \"PC\",\n ],\n }, {\n name: \"Rael\",\n type: \"PC\",\n stats: {\n level: 5,\n //\n hp: 31,\n //\n str: 11,\n dex: 13,\n con: 13,\n wis: 18,\n int: 12,\n cha: 13,\n //\n equipped_armour_value: 3,\n //\n fort_prof: 2,\n will_prof: 2,\n ref_prof: 1,\n //\n skill_perception_prof: 1,\n skill_occultism_prof: 1,\n //\n attack_martial_prof: 0,\n //\n armour_unarmoured_prof: 1,\n armour_light_prof: 1,\n armour_medium_prof: 1,\n armour_heavy_prof: 0,\n },\n config: {\n equipped_armour_type: \"medium\",\n },\n flags: [\n \"androgynous\",\n \"medium\",\n \"elf\",\n \"cleric\",\n \"war priest\",\n \"PC\",\n ],\n }, {\n name: \"Benedict\",\n type: \"PC\",\n stats: {\n level: 5,\n //\n hp: 38,\n //\n str: 18,\n dex: 10,\n con: 14,\n wis: 14,\n int: 8,\n cha: 16,\n //\n equipped_armour_value: 5,\n //\n fort_prof: 2,\n will_prof: 2,\n ref_prof: 1,\n //\n skill_perception_prof: 1,\n skill_occultism_prof: 1,\n //\n attack_martial_prof: 0,\n //\n armour_unarmoured_prof: 1,\n armour_light_prof: 1,\n armour_medium_prof: 1,\n armour_heavy_prof: 1,\n },\n config: {\n equipped_armour_type: \"heavy\",\n },\n flags: [\n \"male\",\n \"human\",\n \"medium\",\n \"paladin\",\n \"PC\",\n ],\n }, {\n name: \"Aurora\",\n type: \"PC\",\n stats: {\n level: 5,\n //\n hp: 21,\n //\n str: 11,\n dex: 14,\n con: 13,\n wis: 13,\n int: 18,\n cha: 10,\n //\n equipped_armour_value: 0,\n //\n fort_prof: 1,\n will_prof: 2,\n ref_prof: 1,\n //\n skill_perception_prof: 1,\n skill_arcana_prof: 1,\n //\n attack_martial_prof: 0,\n //\n armour_unarmoured_prof: 1,\n armour_light_prof: 0,\n armour_medium_prof: 0,\n armour_heavy_prof: 0,\n },\n config: {\n equipped_armour_type: \"unarmoured\",\n },\n flags: [\n \"female\",\n \"medium\",\n \"elf\",\n \"wizard\",\n \"PC\",\n ],\n }];\n return Promise.resolve(partyData);\n}", "title": "" } ]
42d4a4463126d0a2e2be7c56b6259f47
required functions for pigLatin to run
[ { "docid": "5f3283dedc6e6ea09cd65a717e7535bf", "score": "0.0", "text": "function smallestNonNegative(num1, num2){\n if (num1<0) {\n return num2\n } \n \n if (num2<0) {\n return num1\n }\n \n if (num1<num2) {\n return num1\n } else {\n return num2\n }\n \n}", "title": "" } ]
[ { "docid": "ba319d1f34c59a68f093439912a6ca84", "score": "0.7452489", "text": "function convertWordToPigLatin(word) {\n\n }", "title": "" }, { "docid": "0f1c44c7377dc96a14d3dd8594d25098", "score": "0.7244215", "text": "function translatePigLatin(str) {\n\t return str;\n\t}", "title": "" }, { "docid": "baa247c9df7663a284fc02405057246c", "score": "0.72330034", "text": "function translatePigLatin(str) {\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]; \n var myArray = str.split(\"\"); \n var myArrayLength = myArray.length;\n var len = str.length;\n var newString = \"\";\n \n //determine the first positon of a vowel\n for(pos = 0; pos < myArrayLength; pos++){\n if(vowels.indexOf(myArray[pos].toLowerCase()) !== -1){ \n break;\n }\n }\n //determine the word in piglatin\n if(pos == 0){\n str = newString.concat(str, \"way\").toLowerCase(); \n }else{\n len = len - pos;\n str = newString.concat(str.substr(pos, len).toLowerCase(), str.substr(0, pos).toLowerCase(), \"ay\");\n } \n \n return str;\n}", "title": "" }, { "docid": "fec74fd7ae5640be907003c5ec54c15b", "score": "0.708842", "text": "function pigLatin(sentence) {\n\n let sentenceArray = sentence.split(\" \")\n let translation = \"\"\n sentenceArray.forEach(function(word) {\n let chopOff = word.search(/[aeiou]/i)\n let head = \"\"\n let tail = \"\"\n if (word[chopOff] === word.charAt(0)) { chopOff = word.search(/[^aeiou]/i) }\n tail = word.slice(0, chopOff) + \"ay\";\n head = word.slice(chopOff);\n word = head + tail;\n translation += word + \" \"\n })\n return translation\n}", "title": "" }, { "docid": "f6860b7e1e3335dffb801220260cf6d4", "score": "0.7045984", "text": "function pigLatin(str) {\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n str = str.split(' ');\n var toReturn = str.map((word, i) => {\n if(word[word.length - 1] === '.' && vowels.indexOf(word[0].toLowerCase()) >= 0){\n return word.substring(0, word.length - 1) + 'way' + '.';\n }else if(word[word.length - 1] === '.' && vowels.indexOf(word[0].toLowerCase()) < 0){\n return word.substring(1, word.length - 1) + word [0] + 'ay' + '.';\n }else if(vowels.indexOf(word[0].toLowerCase()) >= 0){\n return word + 'way';\n }else{\n if(i === 0){\n if((word[word.length - 1] !== '!' && word[word.length - 1] !== '.')){\n return word.substring(1, 2).toUpperCase() + word.substring(2, word.length) + word[0].toLowerCase() + 'ay';\n }else{\n return word.substring(1, 2).toUpperCase() + word.substring(2, word.length - 1) + word[0].toLowerCase() + 'ay' + word[word.length - 1];\n }\n }else{\n return word.substring(1, 2) + word.substring(2, word.length) + word[0].toLowerCase() + 'ay';\n }\n\n }\n });\n return toReturn.join(' ');\n}", "title": "" }, { "docid": "4e1947d33621d5502827f2112f7627ef", "score": "0.69281435", "text": "function translatePigLatin(str) {\n let vowels = [\"a\", \"e\", \"i\", \"o\", 'u']\n let i = 0\n let pig = \"\"\n if (vowels.indexOf(str[0]) === -1) {\n while (vowels.indexOf(str[i]) == -1){\n pig += str[i]\n i++\n }\n } else {\n return str + \"way\" \n }\n return str.substring(i) + pig + \"ay\";\n }", "title": "" }, { "docid": "e5fc9b756d7b8bdd5b22781f9c2c5f47", "score": "0.6868572", "text": "function translatePigLatin(str) {\n let reVowal = /[aeiou]/;\n let vowal = \"way\";\n let consonant = \"ay\"\n\n if (str.substring(0, 1).match(reVowal)) {\n return str.concat(vowal);\n } else if (str.substring(0, str.length).match(reVowal) === null) {\n return str.concat(consonant);\n } else if (str.substring(1, 2).match(reVowal)) {\n return str.substring(1, str.length).concat(str.slice(0, 1).concat(consonant));\n } else if (str.substring(str.length / 2, str.length).match(reVowal)) {\n return str.substring(str.length / 2, str.length).concat(str.slice(0, str.length / 2).concat(consonant));\n }\n}", "title": "" }, { "docid": "2a0ba19ce86d518265602cc83bdfda76", "score": "0.68667424", "text": "function translatePigLatin(str) {\n\n var strArr = str.split(\"\");\n var index;\n for(var i = 0; i < strArr.length; i++){\n if(strArr[i] == \"a\" || strArr[i] == \"e\" || strArr[i] == \"i\" || strArr[i] == \"o\" || strArr[i] == \"u\"){\n index = i;\n break;\n }\n }\n\n if(index === 0){\n str = str + \"way\";\n }\n else {\n var substring = strArr.splice(0,index);\n str = str.slice(index) + substring.join(\"\") + \"ay\";\n }\n\n return str;\n}", "title": "" }, { "docid": "6a876dd7a4c50f8da38d1a686d38e4f6", "score": "0.68657434", "text": "function pigLatin(s) {\n s = s.toLowerCase();\n if (s.search(/[^a-z]/) != -1) return null;\n if (s.search(/[aeiou]/) == 0) return `${s}way`;\n return s.replace(/^([^aeiou]+)(.*)$/, '$2$1ay');\n}", "title": "" }, { "docid": "64e3d9df5fca37195dbdb3bd2b38c991", "score": "0.6859748", "text": "function translatePigLatin(str) {\n for (let i = 0; i < str.length; i++) {\n if (str[i].match(/[aeiou]/) && i == 0) {\n return str.concat('way');\n }\n if (str[i].match(/[aeiou]/) && i != 0) {\n return str.slice(i) + str.slice(0, i) + 'ay';\n }\n if (i == str.length - 1) {\n return str.concat('ay');\n }\n }\n}", "title": "" }, { "docid": "f4d67099fcab0d633e0e56fdb07b4bea", "score": "0.68451273", "text": "function translatePigLatin(str) {\n // create a regex to look for vowels\n var vowelIndex = str.search(/[aeiou]/);\n // there's a vowel on the first character, just add way and return\n if (vowelIndex == 0) {\n str += \"way\";\n return str;\n // else start string at end of constenant cluster, add the constenant cluster to end and add ay\n } else {\n str = str.substr(vowelIndex) + str.substr(0, vowelIndex) + \"ay\";\n return str;\n }\n}", "title": "" }, { "docid": "daa60c646dd9d12e1d4a00c30cdc6513", "score": "0.68343383", "text": "function pigLatin(word) {\n const vowels = ['a', 'e', 'i', 'o', 'u'];\n if (vowels.includes(word[0])) {\n return word + \"way\"\n } else if (!vowels.includes(word[0])) {\n for (let index = 0; index < word.length; index +=1) {\n if (vowels.includes(word[index])) {\n return word.slice(index, word.length-1) + word.slice(0,index) + \"ay\";\n }\n }\n } else {\n return word\n }\n}", "title": "" }, { "docid": "424216e75b1872ca82b70bb429bb1523", "score": "0.6821322", "text": "function translatePigLatin(str) {\n var vowelsBeginning = /^[aeoiuy]/;\n var vowels = /[aeoiuy]/;\n var firstVowel;\n if (vowelsBeginning.test(str)) {\n return str + \"way\";\n }\n else {\n firstVowel = str.search(vowels); \n return str.slice(firstVowel) + str.slice(0, firstVowel) + \"ay\";\n }\n}", "title": "" }, { "docid": "c493512633e611663a66dd7c84a897c8", "score": "0.6804881", "text": "function parsePigLatin(phrase) {\n //initialize regexes for all letters, and for all nonletters\n const letterRegex = /[a-zA-Z]/;\n const nonletterRegex = /[^a-zA-Z]/;\n //make a copy of phrase and use it to initialize pigLatinPhrase, which will later be returned\n let pigLatinPhrase = phrase;\n\n // will only execute of there are ANY letters present in phrase, if there are not, \n // phrase is returned without any changes\n if (letterRegex.test(phrase)) {\n //initialize startPos to the first occurence of a letter in phrase\n let startPos = phrase.search(letterRegex);\n //initialize endPos to phrase.length\n let endPos = phrase.length;\n\n //keeps iterating while there are still nonletters present after startPos\n while (regexIndexOf(phrase, nonletterRegex, startPos) >= 0) {\n endPos = regexIndexOf(phrase, nonletterRegex, startPos);\n //creating a letter sequence with startPos (next occurence of letter) and endPos (next occurence of nonletter)\n let english = phrase.substring(startPos, endPos);\n let pigLatin = toPigLatin(english);\n //original english substring is then replaced with the translated substring in pigLatinPhrase,\n //which was initialized to be identical to phrase previously. Phrase remains unchanged\n pigLatinPhrase = pigLatinPhrase.replace(english, pigLatin);\n //update startPos to be at the first occurence of a letter after the previous endPos, \n //otherwise if it does not exist, break out of the loop. No more letter sequences need to be found\n if (regexIndexOf(phrase, letterRegex, endPos) >= 0) {\n startPos = regexIndexOf(phrase, letterRegex, endPos);\n }\n else {\n break;\n }\n }\n //deals with the case of startPos being updated, but not endPos. The loop exited because\n //the conditional evaluated to false. This means that phrase must end with a letter, \n //and one last letter sequence must be sent to toPigLatin()\n if (letterRegex.test(phrase.substring(phrase.length - 1))) {\n let english = phrase.substring(startPos, phrase.length);\n let pigLatin = toPigLatin(english);\n pigLatinPhrase = pigLatinPhrase.replace(english, pigLatin);\n }\n }\n return pigLatinPhrase;\n\n}", "title": "" }, { "docid": "8829167851675a4f4e26de08fefdc350", "score": "0.6761519", "text": "function pigLatin(str) {\n // Convert string to lowercase\n str = str.toLowerCase()\n str = str.split(\" \")\n // Initialize array of vowels\n const vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n // Initialize vowel index to 0\n let vowelIndex = 0;\n\n \n if (vowels.includes(str[0])) {\n // If first letter is a vowel\n return str + \"way\";\n } else {\n // If the first letter isn't a vowel i.e is a consonant\n for (let char of str) {\n // Loop through until the first vowel is found\n if (vowels.includes(char)) {\n // Store the index at which the first vowel exists\n vowelIndex = str.indexOf(char);\n break;\n }\n }\n // Compose final string\n return str.slice(vowelIndex) + str.slice(0, vowelIndex) + \"ay\";\n }\n }", "title": "" }, { "docid": "7acd9b1409915875666ce653973af34f", "score": "0.675639", "text": "function convertWordToPigLatin(word) {\n if(wordStartsWithVowel(word) === true){\n return appendYayToWord(word);\n } else {\n return convertWordWithConsonant(word);\n }\n }", "title": "" }, { "docid": "835686c311179031d023b61488c944c7", "score": "0.671454", "text": "function translatePigLatin(str) {\n return (/^[aeiou]/.test(str)) ? str + \"way\" : consonants(str);\n}", "title": "" }, { "docid": "f4a9c66e9dc9f77d72c3785c578afec1", "score": "0.6704397", "text": "function pigLatinTranslate (string) {\n\tvar string = \"\";\n\tvar vowel = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n\n\tfor(i=0; i<string.length; i++);\n\tfor(j=0; j<vowel.length; i++){\n\t\tif(string.length = vowel.length){\n\t\t\t.join(\"yay\");\n\n\t} return ;\n\t\t}\n}", "title": "" }, { "docid": "f8da289ab60ccbc6508383430d487385", "score": "0.66854084", "text": "function translatePigLatin(str) {\n if (isVowel(str[0])) {\n return str += \"way\";\n }\n else {\n for (var i = 1; i <= str.length; i++) {\n if (isVowel(str[i])) {\n var first = str.substring(0,i);\n var second = str.substring(i);\n return second + first + \"ay\";\n \n }\n }\n }\n}", "title": "" }, { "docid": "09c2c3ca5610a777df3e3d7aa9d76e77", "score": "0.6685343", "text": "function translatePigLatin(str) {\n //regex checks for vowel in front\n if(str.match(/^[aeiou]/))str = `${str}way`\n //regex to match for non vowel first letters\n if(str.match(/^[^aeiou]+/g)){\n let consCluster = str.match(/^[^aeiou]+/g)\n str = `${str.substring(consCluster[0].length,str length)}${consCluster}ay`\n }\n return str;\n}", "title": "" }, { "docid": "2efe637cd114c72e61057c8ae7830d6c", "score": "0.66838026", "text": "function pigLatin(sentence) {\r\n const word = sentence.split(\" \")\r\n const reverseWord = word.map((val) => val.slice(1) + val.charAt(0).toLowerCase() + \"ay\")\r\n const joinWord = reverseWord.join(\" \")\r\n\r\n return joinWord.charAt(0).toUpperCase() + joinWord.slice(1)\r\n}", "title": "" }, { "docid": "b899c47f5878f3e66e976a82e5e1c759", "score": "0.6683147", "text": "function translatePigLatin(str) {\r\n console.log(str[0]);\r\n if (\r\n str[0] === \"e\" ||\r\n str[0] === \"a\" ||\r\n str[0] === \"i\" ||\r\n str[0] === \"y\" ||\r\n str[0] === \"o\" ||\r\n str[0] === \"u\"\r\n ) {\r\n str = str + \"way\";\r\n } else {\r\n str = str.replace(/([^aeiou]*)([aeiou]\\w*)/, \"$2$1ay\");\r\n console.log(str);\r\n return str;\r\n }\r\n}", "title": "" }, { "docid": "38ed561ffbae9d7f51b59d12eb484391", "score": "0.6666158", "text": "function translatePigLatin(str) {\n\n let newStr = str;\n if(str.charAt(0) == \"a\" || str.charAt(0) == \"e\" || str.charAt(0) == \"i\" || str.charAt(0) == \"o\" || str.charAt(0) == \"u\"){\n return newStr + 'way';\n }\n else {\n let arr = newStr.split(/(?=a|e|i|o|u)/)\n let firstpart = arr.shift();\n newStr = arr.join(\"\");\n console.log(arr);\n return newStr + firstpart + \"ay\";\n }\n}", "title": "" }, { "docid": "0189cab40bddaede8b241d7745099c46", "score": "0.665871", "text": "function translatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n let myConsonants = str.match(consonantRegex);\n return myConsonants !== null\n ? str.replace(consonantRegex, \"\").concat(myConsonants).concat(\"ay\") : str.concat(\"way\");\n}", "title": "" }, { "docid": "49ba17aebf1ecb8dd950b0d76fc92416", "score": "0.6651909", "text": "function translatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n let myConsonants = str.match(consonantRegex);\n return myConsonants !== null\n ? str\n .replace(consonantRegex, \"\")\n .concat(myConsonants)\n .concat(\"ay\")\n : str.concat(\"way\");\n }", "title": "" }, { "docid": "49ba17aebf1ecb8dd950b0d76fc92416", "score": "0.6651909", "text": "function translatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n let myConsonants = str.match(consonantRegex);\n return myConsonants !== null\n ? str\n .replace(consonantRegex, \"\")\n .concat(myConsonants)\n .concat(\"ay\")\n : str.concat(\"way\");\n }", "title": "" }, { "docid": "70cbe1dafba86a56b041a92315808a73", "score": "0.6637744", "text": "function translatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n let myConsonants = str.match(consonantRegex);\n return myConsonants !== null\n ? str.replace(consonantRegex, \"\").concat(myConsonants).concat(\"ay\")\n : str.concat(\"way\");\n}", "title": "" }, { "docid": "43a80d9c11703df0c58b1b214b4c20b1", "score": "0.6619528", "text": "function translatePigLatin(str) {\n str = str.toLowerCase();\n if (str[0].match(/[aiueo]/g)) {\n str += \"way\";\n } else if (!str.match(/[aiueo]/g)) {\n str += \"ay\";\n } else {\n str = str.replace(/([^aiueo]*)([aiueo])(\\w+)/, \"$2$3$1ay\");\n }\n return str;\n}", "title": "" }, { "docid": "bb76f09d72b565413c5e047f523e5162", "score": "0.65737873", "text": "function translatePigLatin(str) {\n \n var consonantCluster = '';\n var regex = /[aeiou]/i;\n var index = str.search(regex);\n \n // if the word starts with a vowel\n if (index === 0){\n return str.slice(index) + 'way';\n }\n \n // if the word doesn't have a vowel\n else if (index === -1) {\n return str + 'ay';\n }\n \n // if the word starts with consonant(s)\n else {\n consonantCluster = str.slice(0, index);\n return str.slice(index) + consonantCluster + 'ay';\n }\n }", "title": "" }, { "docid": "180f5ee37c584578082766c9563b2dd3", "score": "0.6571762", "text": "function convertSentenceToPigLatin(word) {\n var array = word.split(\" \");\n \n for(var i = 0; i < array.length; i = i + 1) {\n $(\"#result_text\").append(\" \" + convertWordToPigLatin(array[i]));\n console.log(convertWordToPigLatin(array[i]));\n }\n }", "title": "" }, { "docid": "d1716a776bf16724c523f12160ef80f6", "score": "0.6564711", "text": "function translatePigLatin(str) {\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n var newStr;\n \n var arr = str.split(\"\");\n \n // if arr[0] is a vowel, add way to the end\n if(vowels.indexOf(arr[0]) !== -1) {\n arr.push(\"way\");\n newStr = arr.join(\"\");\n return newStr;\n }\n \n // check if arr[0] is a consonent(cluster)\n for(i=0; i<arr.length; i++) {\n var index = vowels.indexOf(arr[0]);\n if (index === -1 ) {\n // it's a consonent! move it to the end\n arr.push(arr[0]);\n arr.shift();\n }\n } \n // add ay\n arr.push(\"ay\");\n newStr = arr.join(\"\");\n return newStr;\n}", "title": "" }, { "docid": "38ac42b18135077c93e89c9dc76afa53", "score": "0.65541494", "text": "function translatePigLatin(str) {\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let newStr = \"\";\n\n if (vowels.indexOf(str[0]) > -1) {\n newStr = str + \"way\";\n return newStr;\n } else {\n let firstMatch = str.match(/[aeiou]/g) || 0;\n let vowel = str.indexOf(firstMatch[0]);\n newStr = str.substring(vowel) + str.substring(0, vowel) + \"ay\";\n return newStr;\n }\n}", "title": "" }, { "docid": "b19616f8ca597219487ad89907438b35", "score": "0.65428287", "text": "function wordToPigLatin(word) {\n if (word[0] === \"a\" || word[0] === \"e\" || word[0] === \"i\" || word[0] === \"o\" ||\n word[0] === \"u\") {\n //it is a vowel\n return word + \"ay\";\n }\n else {\n //it is a consonant\n var length = word.length;\n var firstLetter = word.slice(0, 1);\n var rest = word.slice(1, length);\n var newTransformation = rest + firstLetter + \"ay\";\n return newTransformation;\n // word = word.substring(0, 1);\n // word = word + firstLetter + \"ay\";\n }\n\n}", "title": "" }, { "docid": "0541c35ce46538da915b1ad7f623110c", "score": "0.65240794", "text": "function translatePigLatin(str) {\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let strArr = str.split('');\n let suffix = '';\n\n if (vowels.includes(str.charAt(0))) {\n return str + 'way';\n } else if (str.match(/[aeiou]/gi) === null) {\n return str + 'ay';\n }\n\n while (!vowels.includes(strArr[0])) {\n suffix += strArr.shift();\n }\n\n return strArr.join('') + suffix + 'ay';\n}", "title": "" }, { "docid": "d542e623c344b0481022393e2132d86e", "score": "0.6515489", "text": "function translatePigLatin(str) {\n let vowelGrout = /[aeiou]/ig;\n let cutChars = [];\n let res = '';\n if(str[0].match(vowelGrout)) {\n res = str + 'way';\n } else {\n str = str.split('');\n while(!str[0].match(vowelGrout)) {\n cutChars = cutChars.concat(str.shift());\n }\n res = str.concat(cutChars, 'ay').join('');\n }\n return res;\n}", "title": "" }, { "docid": "352419ad8fef1165d3cee2ab4c52e534", "score": "0.6502995", "text": "function pigLatin(word) {\n\tconst vowels = ['a', 'e', 'i', 'o', 'u'];\n\n\tlet transformed = '';\n\tif (vowels.includes(word[0])) {\n\t\ttransformed = word + 'way';\n\t} else {\n\t\tlet partToMove = '';\n\t\tlet index = 0;\n\t\tfor (let i = 0; i < word.length; i++) {\n\t\t\tif (vowels.includes(word[i])) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpartToMove += word[i];\n\t\t}\n\t\ttransformed = word.substr(index) + partToMove + 'ay';\n\t}\n\treturn transformed;\n}", "title": "" }, { "docid": "0197d7da42751a73bd1c300fa77a080c", "score": "0.65015525", "text": "function translatePigLatin(str) {\n if(/[aeiou]/.test(str[0])){\n return str + \"way\";\n }\n var ending = \"\";\n let i = 0;\n while(/\\w/.test(str[i]) && ! /[0-9aeiou]/.test(str[i])){\n ending += str[i];\n i++;\n }\n return str.slice(i) + ending + \"ay\";\n}", "title": "" }, { "docid": "2f1fd296fef4e9261d61e68344306aef", "score": "0.64965135", "text": "function translatePigLatin(str) {\n const vowels = /[aeiuo]/g;\n if (str[0].match(vowels)) { // if the first letter is a vowel\n return str + \"way\"\n } else if (str.match(vowels) === null) { // if str doesn't have any vowels\n return str + \"ay\"\n } else {\n const firstVowel = str.match(vowels)[0]; // first vowel\n // Or you can use this instead\n //const [firstVowel] = str.match(vowels);\n const indexOftheFirstVowel = str.indexOf(firstVowel) // index of first vowel\n const removeCosonants = str.substr(indexOftheFirstVowel) //remove consonats in the word\n const restStr = str.substr(0, indexOftheFirstVowel);// the rest of the word with removed consonants\n\n return removeCosonants + restStr + \"ay\" // all together\n }\n}", "title": "" }, { "docid": "1eead6ac90cce2b3bcc3f265f78f283a", "score": "0.64766884", "text": "function myTranslatePigLatin(str) {\n let arr = str.split(\"\");\n\n let newArr = [];\n\n let vogal = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n\n if (vogal.some((letter) => letter === arr[0]) === true) {\n newArr.push(arr.slice(0).join(\"\") + \"way\");\n } else {\n for (let i = 0; i < arr.length; i++) {\n if (vogal.some((letter) => letter === arr[i]) === true) {\n newArr = arr.splice(i);\n newArr.push(arr.slice(0, i).join(\"\") + \"ay\");\n }\n }\n for (let i = 0; i < arr.length; i++) {\n if (vogal.some((letter) => letter === arr[i]) != true) {\n newArr.push(arr[i]);\n }\n if (i === arr.length - 1) {\n newArr.push(\"way\");\n }\n }\n }\n\n let newStr = newArr.join(\"\");\n\n console.log(newStr);\n return newStr;\n}", "title": "" }, { "docid": "5cc320b99c8ed97df9a464086363d485", "score": "0.64430165", "text": "function translatePigLatin(str) {\n // Create variables to be used\n var pigLatin = \"\";\n var regex = /[aeiou]/gi;\n\n // Check if the first character is a vowel\n if (str[0].match(regex)) {\n pigLatin = str + \"way\";\n } else if (str.match(regex) === null) {\n // Check if the string contains only consonants\n pigLatin = str + \"ay\";\n } else {\n // Find how many consonants before the first vowel.\n var vowelIndice = str.indexOf(str.match(regex)[0]);\n\n // Take the string from the first vowel to the last char\n // then add the consonants that were previously omitted and add the ending.\n pigLatin = str.substr(vowelIndice) + str.substr(0, vowelIndice) + \"ay\";\n }\n\n return pigLatin;\n}", "title": "" }, { "docid": "47f0a4e7d116cc7ca70c6eea6e00b267", "score": "0.6437342", "text": "function translatePigLati(str) {\n if(\"aeiou\".indexOf(str[0]) > -1) {\n return str + \"way\";\n } else {\n for(let i = 0; i < str.length; i++) {\n if(\"aeiou\".indexOf(str[i]) > -1) {\n return str.substr(i) + str.substr(0, i) + \"ay\";\n }\n }\n }\n}", "title": "" }, { "docid": "16cc839d5fd03186d4154080ed45bd35", "score": "0.64316595", "text": "function translateToPigLatin() {\n //get input from index.HTML and trim it to get rid of unnecessary whitespace\n // initialize an empty string for output\n let input = document.getElementById('textInput').value.trim();\n let output = '';\n \n while (input.indexOf(' ', 0) >= 0) {\n //substring will always represent a sequence of characters without spaces\n let substring = input.substring(0, input.indexOf(' ', 0));\n //input is updated so that the value of substring is sliced off from the beginning\n input = input.substring(input.indexOf(' ', 0)).trim();\n //updating output with the return value from calling parsePigLatin()\n output += parsePigLatin(substring) + ' ';\n }\n //at this point, no more whitespaces can be found. input is reduced to a single \n //character sequence without any spaces. This final character sequence is parsed\n //and added to output\n output += parsePigLatin(input);\n //updating the inner HTML of the webpage\n document.getElementById('pigLatinOutput').innerHTML = output;\n}", "title": "" }, { "docid": "04540ccf8c9fa6b817c98c77bb14cc58", "score": "0.6403711", "text": "function mainProgramme(){\nlet array = createWordArray()\nlet arrayOfObjects = createWordObject(array)\nlet arrayOfPigLatinObjects = mapString(arrayOfObjects)\nrestoreToString(arrayOfPigLatinObjects)\n}", "title": "" }, { "docid": "fc3b61befeeca3f01e594bd0294692f0", "score": "0.63979965", "text": "function expTranslatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n let myConsonants = str.match(consonantRegex);\n console.log(myConsonants);\n\n if (myConsonants !== null) {\n let a = str.replace(consonantRegex, \"\");\n console.log(a);\n\n let b = a.concat(myConsonants);\n console.log(b);\n\n let c = b.concat(\"ay\");\n console.log(c);\n\n return c;\n } else {\n let d = str.concat(\"way\");\n console.log(d);\n\n return d;\n }\n}", "title": "" }, { "docid": "b37aba684525a528523af03430cebca0", "score": "0.63794935", "text": "function translatePigLatin(str) {\n \n var reg = /[aeiou]/gi;\n if(str[0].match(reg)!=null){\n return str+\"way\";\n }else if(str.match(reg)===null){\n return str.slice(1)+\"ay\";\n }else {\n // console.log(str.indexof(reg))\n let startfrom=str.search(reg);\n return str.slice(startfrom)+str.slice(0,startfrom)+\"ay\";\n }\n }", "title": "" }, { "docid": "c0cc5fe79ee864e4eed2707e2dd7f38a", "score": "0.6367216", "text": "function convertToPigLatin() {\n let allLines = document.getElementById(\"txt1\").value.trim().split(\"\\n\");\n let newText = \"\";\n let newLine;\n let vowels = \"aeiouAEIOU\";\n for (let line of allLines) {\n let words = line.trim().split(\" \");\n for (let i in words) {\n if (!words[i].localeCompare(\" \") && vowels.indexOf(words[i].charAt(0))>-1) {\n words[i] = (words[i].substring(1) + words[i].charAt(0) + \"ay\");\n }\n else {\n words[i] += \"ay\";\n }\n }\n newLine = words.join(\" \") + \"\\n\";\n newText += newLine;\n }\n document.getElementById(\"txt1\").value = newText;\n}", "title": "" }, { "docid": "193134cff4ae1e1e4d28259e963ccf2f", "score": "0.62353975", "text": "function translatePigLatin(str) {\n let arr = [];\n if(str.match(/^[aeiou]/g)){\n str = str.concat('way');\n console.log(str);\n return str;\n }\n arr = str.split(\"\");\n console.log(arr);\n if(arr[0].match(/^[^aeiou]/g)){\n for(let i = 0; i < arr.length; i++){\n if(arr[0].match(/[^aeiou]/)){ \n arr.push(arr[0]);\n arr.shift();\n console.log(arr);\n }\n }\n } \n str = arr.join(\"\").concat(\"ay\");\n console.log(str);\n return str;\n}", "title": "" }, { "docid": "b9ff200cc0f6ab3b7c5850b791ab5277", "score": "0.61187387", "text": "function pigIt(str){\n // a place to store the pig latin\n let pigLatin = ''\n let firstLetter = str[0];\n // iterate over the string\n for (let i = 1; i < str.length; i++) {\n const currentLetter = str[i];\n if (!firstLetter) {\n firstLetter = currentLetter;\n } else {\n if (currentLetter != ' ') {\n // append each next letter until we see a space\n pigLatin += currentLetter;\n } else {\n // append the current first letter and ay\n pigLatin += firstLetter + 'ay ';\n firstLetter = '';\n }\n }\n }\n pigLatin += firstLetter + 'ay';\n\n return pigLatin;\n}", "title": "" }, { "docid": "4e1acfdadbcf034d3e56cb9b37fc17bc", "score": "0.60814", "text": "function pigIt(str){\n let words = str.split(' ');\n let latin = words.map( (word) => {\n var letter = word.charAt(0);\n var word = word.substr(1);\n var finishedWord = word + letter + 'ay';\n return finishedWord;\n })\n if (str[str.length - 1] === '!' || str[str.length-1] === '?'){\n var displace = latin.pop();\n latin.push(displace[0]);\n return latin.join(' ')\n } else {\n return latin.join(' ');\n }\n }", "title": "" }, { "docid": "e464936f5ef36c34ef619f930d7e4cd6", "score": "0.6050885", "text": "function applyLatinLigatures() {\n var this$1 = this;\n var script = 'latn';\n\n if (!this.featuresTags.hasOwnProperty(script)) {\n return;\n }\n\n var tags = this.featuresTags[script];\n\n if (tags.indexOf('liga') === -1) {\n return;\n }\n\n checkGlyphIndexStatus.call(this);\n var ranges = this.tokenizer.getContextRanges('latinWord');\n ranges.forEach(function (range) {\n latinLigature.call(this$1, range);\n });\n}", "title": "" }, { "docid": "d2d75084502b84c2dce341b8dd79c968", "score": "0.59299415", "text": "function generalLatin(s) {\n\t\t\tlet transformed;\n\n\t\t\tif (!s) { return s; } // sometimes s is empty string\n\n\t\t\t// Handle some special characters at the beginning\n\t\t\t// these are characters often found at subtitle beginning, we keep them unchanged and transform rest of the string\n\t\t\tlet startingCharacters = [...specialChars.startingChars];\n\n\t\t\tif (startingCharacters.includes(s.charAt(0))) {\n\t\t\t\ttransformed = s.charAt(0) + generalLatin(s.substring(1));\n\t\t\t}\n\n\t\t\t// Handle subtitle markup\n\t\t\t// Sometimes subtitles contains html markup, usualy <b>, <i>, <u> and </b>, </i>, </u>.\n\t\t\t// Keep text inside <> without change and transform the rest\n\t\t\t// Note: there can be more tags in one text, and might not necesary be in pairs\n\t\t\telse if (s.match(/<[^>]+>/)) { // looking for < anything in angle brackets >\n\t\t\t\n\t\t\t\t// we need to find all <tags>, for which we use global string.replace with callback function\n\t\t\t\ttransformed = s.replace(/([^<>]*)(<[^<>]+>)([^<>]*)/g,\n\t\t\t\t\tfunction(m,p1,p2,p3,o,s,g) { // m contains one whole match, p1 text before <angle bracket>, p2 text inside <angle bracket> including brackets, p3 text after <angle bracket>\n\t\t\t\t\t\t//console.log({m:m,p1:p1,p2:p2,p3:p3,o:o,s:s,g:g});\n\t\t\t\t\t\treturn generalLatin(p1) + p2 + generalLatin(p3);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Handle [text in brackets]\n\t\t\t// It this usually comment, that is not part of speach\n\t\t\t// Keep all text inside brackets without change and transform the rest\n\n\t\t\telse if (s.match(/\\[[^\\]]+\\]/)) { // looking for [ anything in square brackets ]\n\t\t\t\tlet results = s.match(/(.*)(\\[[^\\]]+\\])(.*)/); // results[1] contains text before [backets], results[2] containts text inside [backets] including brackets, results[3] text after [backets]\n\t\t\t\ttransformed = generalLatin(results[1]) + results[2] + generalLatin(results[3]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Finally here, decide which words to hide\n\t\t\t\t// Split text into fragments between spaces (usually words, but also numbers, punctuations etc.) and check every fragment\n\t\t\t\t// \\s is can be any type of space character including tabulator. But most usually it is space. At least in subtitles.\n\t\t\t\tlet fragments = s.split(/\\s/);\n\t\t\t\t//console.log(fragments.length);\n\n\t\t\t\t// Coeficient, who large part of the text to hide\n\t\t\t\tlet coef = filterDifficulty; // 3 = hard, 2 = normal, 1.5 = easy\n\t\t\t\tlet nFragmentsToKeep;\n\t\t\t\tlet cycleStartWithFragmentNo; // index, with which fragment start for cycle 1st iteration\n\n\t\t\t\tif (coef == 0) { // HARDCORE difficulty: filterDifficulty == 0, coef == 0, nFragmentsToKeep == 0\n\t\t\t\t\tnFragmentsToKeep = 0;\n\t\t\t\t\ttransformed = \"\";\n\t\t\t\t\tcycleStartWithFragmentNo = 0; // In HARDCORE we start hiding with the 1st word\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnFragmentsToKeep = Math.round(fragments.length / coef);\n\t\t\t\t\ttransformed = fragments[0]; // start 1st fragment\n\t\t\t\t\tcycleStartWithFragmentNo = 1; // In filters other then hardcore we starting hiding from the 2nd word, just make sure at least 1st word stay\n\t\t\t\t}\n\n\t\t\t\tfor (let i = cycleStartWithFragmentNo; i < fragments.length; i++) {\n\t\t\t\t\t//console.log( fragments[i] );\n\n\t\t\t\t\t// Keep words/fragments in the 1st subtitle part\n\t\t\t\t\tif (i < nFragmentsToKeep) {\n\t\t\t\t\t\ttransformed = transformed + \" \" + fragments[i];\n\t\t\t\t\t}\n\t\t\t\t\t// Delete words/fragments in the 2nd part\n\t\t\t\t\telse {\n\t\t\t\t\t\t// But check for common non-letter characters, like punctuation, we do not want to hide them\n\t\t\t\t\t\tlet specialCharacters = [...specialChars.generalChars, ...specialChars.arabicChars];\n\n\t\t\t\t\t\tlet re = new RegExp(\"[\" + specialCharacters.join(\"\") + \"]\"); // create matching regexp for detecting special chars like: /[-♪()]/\n\t\t\t\t\t\tlet re2 = new RegExp(\"([^\" + specialCharacters.join(\"\") + \"]+)\", \"g\"); // create negative global regexp for replacing non-special chars like: /([^-♪()]+)/g\n\n\t\t\t\t\t\t//console.log({re, re2});\n\n\t\t\t\t\t\tif (fragments[i].match(re)) { // found special character\n\t\t\t\t\t\t\tlet replaced = fragments[i].replace(re2, \"<del>$1</del>\"); // keep special characters, others must be put inside <del> tags\n\t\t\t\t\t\t\t// Replace abc,def => <del>abc</del>,<del>def</del>\n\t\t\t\t\t\t\tif (transformed) {\n\t\t\t\t\t\t\t\ttransformed = transformed + \" \" + replaced;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\ttransformed = replaced;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// no special characters, just wrap fragment inside <del> tags\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (fragments[i] === \"\") { // Without this check will string terminating on space like \"I read \" genereate an additional \" _ \" at the end during filtering, issue #12, #13\n\t\t\t\t\t\t\t\tif (transformed) {\n\t\t\t\t\t\t\t\t\ttransformed = transformed + \" \";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\ttransformed = \"\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (transformed) {\n\t\t\t\t\t\t\t\t\ttransformed = transformed + \" \" + \"<del>\"+ fragments[i] + \"</del>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\ttransformed = \"<del>\"+ fragments[i] + \"</del>\";\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}\t\t\t\n\n\t\t\treturn transformed;\n\t\t}", "title": "" }, { "docid": "ab4a7dacc0f965db3849f6373f474f2a", "score": "0.5915531", "text": "function latinToDeva(text, map, revmap) {\n\tvar output=q0(text, \"\", map);\n\treturn output;\n}", "title": "" }, { "docid": "372869e767ee33eb2bc9e664ff1266cb", "score": "0.59067875", "text": "function devaToLatin(text, map, revmap) {\n\tvar output=revParseText(text, revmap);\n\treturn output;\n}", "title": "" }, { "docid": "81f1217a97c31b1c3b70ecad044f4627", "score": "0.5756608", "text": "function t(e,t,n,i){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?a[n][0]:a[n][1]}", "title": "" }, { "docid": "81f1217a97c31b1c3b70ecad044f4627", "score": "0.5756608", "text": "function t(e,t,n,i){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?a[n][0]:a[n][1]}", "title": "" }, { "docid": "81f1217a97c31b1c3b70ecad044f4627", "score": "0.5756608", "text": "function t(e,t,n,i){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?a[n][0]:a[n][1]}", "title": "" }, { "docid": "bf9750ff7c5e2267869e4ac2665c4b14", "score": "0.5748559", "text": "function pigIt(str) {\n console.log('z'.charCodeAt(0));\n return str\n .split(' ')\n .map(function(x) {\n if (x.split(' ').every(y => isLetter(y))) {\n return x.slice(1) + x.slice(0, 1) + 'ay';\n }\n return x;\n })\n .join(' ');\n}", "title": "" }, { "docid": "f5c221bbea9584fddd9f0473a046f021", "score": "0.574273", "text": "function e(t,e,n,i){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?a[n][0]:a[n][1]}", "title": "" }, { "docid": "df80fa4ddd56af82c2accef1d7a0b7b0", "score": "0.5740185", "text": "function fconve_latin(numx)\r\n\t {\r\n\t var aux1=0;\r\n var numero=0;\r\n var separa=new Array();\r\n var resultado=0;\r\n numero=numx;\r\n separa= numero.split(',');\r\n cant_array=separa.length;\r\n aux1=separa[0];\r\n for(i=0;i<cant_array;i++)\r\n {\r\n //alert(\"El valor 1 cifra entrada : \"+separa+\"cantida arreglos: \"+cant_array);\r\n separa1=aux1;\r\n //alert(\"El valor 2 sin decimales: \"+separa1);\r\n separa2=separa1.replace('.','');\r\n //alert(\"El valor Extraido: \"+separa2+\"valor de I\"+i);/*esta aqui 9,999*/\r\n aux1=separa2;\r\n }\r\n /*------------------------------------------------------------------*/\r\n caract1= numero.indexOf(','); \r\n extrae=numero.substring(caract1);\r\n separapto2=extrae.replace(',','.');\r\n //alert(\"E: \"+separapto2);\r\n puntos=[separa2, separapto2];\r\n arreglo=puntos.join(\"\");resultado=arreglo;\r\n //alert(\"El salida final para calcular: \"+resultado);\r\n return resultado; \r\n }", "title": "" }, { "docid": "88efe3c71d62c8e7c905977bafbaf2a5", "score": "0.5727666", "text": "function arrayTranslatePigLatin() {\n [\"california\", \"paragraphs\", \"glove\", \"algorithm\", \"eight\"].every(translatePigLatin);\n\n}", "title": "" }, { "docid": "d71da7575d19ab8a369d94fc69028a0c", "score": "0.57262635", "text": "function transliterate(input) {\n // replace zero width non joiners\n input = input.replace(/[\\u200B-\\u200D\\uFEFF]/g, \"\");\n\n // replace modified compounds first\n input = _replaceModifiedGlyphs(_compounds, input);\n\n // replace modified non-compounds\n input = _replaceModifiedGlyphs(_vowels, input);\n input = _replaceModifiedGlyphs(_consonants, input);\n\n var v = \"\";\n // replace unmodified compounds\n for (var k in _compounds) {\n if (!_compounds.hasOwnProperty(k)) continue;\n\n v = _compounds[k];\n\n input = input.replace(new RegExp(k + \"്([\\\\w])\", \"g\"), v + \"$1\"); // compounds ending in chandrakkala but not at the end of the word\n input = input.replace(new RegExp(k + \"്\", \"g\"), v + \"u\"); // compounds ending in chandrakkala have +'u' pronunciation\n input = input.replace(new RegExp(k, \"g\"), v + \"a\"); // compounds not ending in chandrakkala have +'a' pronunciation\n }\n\n // glyphs not ending in chandrakkala have +'a' pronunciation\n for (var k in _consonants) {\n if (!_consonants.hasOwnProperty(k)) continue;\n\n v = _consonants[k];\n input = input.replace(new RegExp(k + \"(?!്)\", \"g\"), v + \"a\");\n }\n\n // glyphs ending in chandrakkala not at the end of a word\n for (var k in _consonants) {\n if (!_consonants.hasOwnProperty(k)) continue;\n\n v = _consonants[k];\n input = input.replace(new RegExp(k + \"്(?![\\\\s).;,\\\"'/\\\\%!])\", \"ig\"), v);\n }\n\n // remaining glyphs ending in chandrakkala will be at end of words and have a +'u' pronunciation\n for (var k in _consonants) {\n if (!_consonants.hasOwnProperty(k)) continue;\n\n v = _consonants[k];\n input = input.replace(new RegExp(k + \"്\", \"g\"), v + \"u\");\n }\n\n // remaining consonants\n for (var k in _consonants) {\n if (!_consonants.hasOwnProperty(k)) continue;\n\n v = _consonants[k];\n input = input.replace(new RegExp(k, \"g\"), v);\n }\n\n // vowels\n for (var k in _vowels) {\n if (!_vowels.hasOwnProperty(k)) continue;\n\n v = _vowels[k];\n input = input.replace(new RegExp(k, \"g\"), v);\n }\n\n // chillu glyphs\n for (var k in _chil) {\n if (!_chil.hasOwnProperty(k)) continue;\n\n v = _chil[k];\n input = input.replace(new RegExp(k, \"g\"), v);\n }\n\n // anusvaram 'am' at the end\n input = input.replace(/ം/g, \"m\");\n\n // replace any stray modifiers that may have been left out\n for (var k in _modifiers) {\n if (!_modifiers.hasOwnProperty(k)) continue;\n\n v = _modifiers[k];\n input = input.replace(new RegExp(k, \"g\"), v);\n }\n\n // capitalize first letter of sentences for better aeshetics\n input = input.replace(/(^\\s*\\w|[\\.\\!\\?]\\s*\\w)/g, function(c) {\n return c.toUpperCase();\n });\n\n return input;\n }", "title": "" }, { "docid": "6efc9f3f915594fbc33edabd3ace8d27", "score": "0.57224613", "text": "function simplePigLatin(string) {\n if (typeof string === 'string' && string.length === 0) {\n return ''; \n } else if (!/[A-Za-z]/g.test(string)) {\n return string;\n }\n \n const SUFFIX = 'ay';\n \n return string.replace(/\\w+/g, (word) => {\n return word.slice(1) + word[0] + SUFFIX;\n });\n}", "title": "" }, { "docid": "4f6bc50e98384d79f6a5a750ede2a8e4", "score": "0.5719148", "text": "function t(e,t,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "title": "" }, { "docid": "4f6bc50e98384d79f6a5a750ede2a8e4", "score": "0.5719148", "text": "function t(e,t,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "title": "" }, { "docid": "94d12ef2f0c92e33278f79c250c3760e", "score": "0.5709351", "text": "function asciilitize(text, verbose = false){\n\tlet words = text.trim().replace(punctuation,\"\").split(\" \");\n\tlet outwords = [];\n\tfor (let ww of words){\n\n\t\tlet w = ww.trim();\n\n\t\tif (w==\"\")\n\t\t\tcontinue;\n\n\t\tlet T = null;\n\t\tfor (let Tt of tonesLetters){\n\t\t\t\n\t\t\tif(deAccentRegexpes[Tt].test(w)){\n\t\t\t\tT = Tt;\n\n\t\t\t\tif(verbose)\n\t\t\t\t\tconsole.log(\"matched \"+Tt+\" with \"+deAccentRegexpes[Tt]+\" on \"+w);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!T){\n\t\t\tfor (let Tt of tonesLetters){\n\t\t\t\tif(w.includes(diacritic[Tt])){\n\t\t\t\t\tT = Tt;\n\t\t\t\t\tw.replace(diacritic[Tt],\"\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!T)\n\t\t\tT = \"D\";\n\n\t\t//w = w.replace(vowelNormalise,\"a\");\n\n\t\tfor(let v of unaccented_all)\n\t\t{\n\t\t\tw = w.replace(vowelNormalisers[v],v);\n\t\t}\n\n\t\t//remove residual accents\n\t\tfor( let d of Object.values(diacritic))\n\t\t\tw = w.replace(d,\"\");\n\n\t\t//Syllabics\n\t\tw = w.replace(/(p|b|t|d|k|g|s|z|ṣh|ẓh|m|n|ṇ|ċh|ch)(r)(p|b|t|d|k|g|s|z|ṣh|ẓh|n|ṇ|ċh|ch)/g,\"$1$2§$3\");\n\t\tw = w.replace(/(p|b|t|d|k|g|s|z|ṣh|ẓh|r|ċh|ch)(ṇ)(p|b|t|d|k|g|s|z|ṣh|ẓh|r|ċh|ch)/g,\"$1$2§$3\");\n\t\tw = w.replace(/(p|b|t|d|k|g|s|z|ṣh|ẓh|r|ċh|ch)(m|n)(p|b|k|g|s|z|ṣh|ẓh|r|ċh|ch)/g,\"$1$2§$3\");\n\n\t\tw = w.replace(/aa/g,\"a\");\n\t\t\n\t\toutwords.push(T+w);\n\t}\n\n\t\n\n\treturn outwords.join(\" \");\n}", "title": "" }, { "docid": "84e5068e6b39129a1579b3d6b6f4c9e3", "score": "0.5693598", "text": "function toDevar(l) { l = l.toLowerCase() + \" \"; var m = { a: \" अ\", i: \" इ\", u: \" उ\", \"ā\": \" आ\", \"ī\": \" ई\", \"ū\": \" ऊ\", e: \" ए\", o: \" ओ\" }; var n = { \"ā\": \"ा\", i: \"ि\", \"ī\": \"ी\", u: \"ु\", \"ū\": \"ू\", e: \"े\", o: \"ो\", \"ṃ\": \"ं\", k: \"क\", kh: \"ख\", g: \"ग\", gh: \"घ\", \"ṅ\": \"ङ\", c: \"च\", ch: \"छ\", j: \"ज\", jh: \"झ\", \"ñ\": \"ञ\", \"ṭ\": \"ट\", \"ṭh\": \"ठ\", \"ḍ\": \"ड\", \"ḍh\": \"ढ\", \"ṇ\": \"ण\", t: \"त\", th: \"थ\", d: \"द\", dh: \"ध\", n: \"न\", p: \"प\", ph: \"फ\", b: \"ब\", bh: \"भ\", m: \"म\", y: \"य\", r: \"र\", l: \"ल\", \"ḷ\": \"ळ\", v: \"व\", s: \"स\", h: \"ह\" }; var k, h, g, f, e, d, b; var c = \"\"; var a = 0; var j = 0; l = l.replace(/\\&quot;/g, \"`\"); while (j < l.length) { k = l.charAt(j - 2); h = l.charAt(j - 1); g = l.charAt(j); f = l.charAt(j + 1); e = l.charAt(j + 2); d = l.charAt(j + 3); b = l.charAt(j + 4); if (j == 0 && m[g]) { c += m[g]; j += 1 } else { if (f == \"h\" && n[g + f]) { c += n[g + f]; if (e && !m[e] && f != \"ṃ\") { c += \"्\" } j += 2 } else { if (n[g]) { c += n[g]; if (f && !m[f] && !m[g] && g != \"ṃ\") { c += \"्\" } j++ } else { if (g != \"a\") { if (a[h] || (h == \"h\" && a[k])) { c += \"्\" } c += g; j++; if (m[f]) { c += m[f]; j++ } } else { j++ } } } } } if (a[g]) { c += \"्\" } c = c.replace(/\\`+/g, '\"'); pdevar = c.slice(0, -1); return c.slice(0, -1) }", "title": "" }, { "docid": "84e5068e6b39129a1579b3d6b6f4c9e3", "score": "0.5693598", "text": "function toDevar(l) { l = l.toLowerCase() + \" \"; var m = { a: \" अ\", i: \" इ\", u: \" उ\", \"ā\": \" आ\", \"ī\": \" ई\", \"ū\": \" ऊ\", e: \" ए\", o: \" ओ\" }; var n = { \"ā\": \"ा\", i: \"ि\", \"ī\": \"ी\", u: \"ु\", \"ū\": \"ू\", e: \"े\", o: \"ो\", \"ṃ\": \"ं\", k: \"क\", kh: \"ख\", g: \"ग\", gh: \"घ\", \"ṅ\": \"ङ\", c: \"च\", ch: \"छ\", j: \"ज\", jh: \"झ\", \"ñ\": \"ञ\", \"ṭ\": \"ट\", \"ṭh\": \"ठ\", \"ḍ\": \"ड\", \"ḍh\": \"ढ\", \"ṇ\": \"ण\", t: \"त\", th: \"थ\", d: \"द\", dh: \"ध\", n: \"न\", p: \"प\", ph: \"फ\", b: \"ब\", bh: \"भ\", m: \"म\", y: \"य\", r: \"र\", l: \"ल\", \"ḷ\": \"ळ\", v: \"व\", s: \"स\", h: \"ह\" }; var k, h, g, f, e, d, b; var c = \"\"; var a = 0; var j = 0; l = l.replace(/\\&quot;/g, \"`\"); while (j < l.length) { k = l.charAt(j - 2); h = l.charAt(j - 1); g = l.charAt(j); f = l.charAt(j + 1); e = l.charAt(j + 2); d = l.charAt(j + 3); b = l.charAt(j + 4); if (j == 0 && m[g]) { c += m[g]; j += 1 } else { if (f == \"h\" && n[g + f]) { c += n[g + f]; if (e && !m[e] && f != \"ṃ\") { c += \"्\" } j += 2 } else { if (n[g]) { c += n[g]; if (f && !m[f] && !m[g] && g != \"ṃ\") { c += \"्\" } j++ } else { if (g != \"a\") { if (a[h] || (h == \"h\" && a[k])) { c += \"्\" } c += g; j++; if (m[f]) { c += m[f]; j++ } } else { j++ } } } } } if (a[g]) { c += \"्\" } c = c.replace(/\\`+/g, '\"'); pdevar = c.slice(0, -1); return c.slice(0, -1) }", "title": "" }, { "docid": "5e21e3273128cc393e4fdef7e7d850d6", "score": "0.5691554", "text": "function e(t,e,a,i){var n={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?n[a][0]:n[a][1]}", "title": "" }, { "docid": "a2dfa4b2e1998b39c82a16747afa787c", "score": "0.568535", "text": "function toThai(m) { m = m.toLowerCase() + \" \"; var n = { a: \"1\", \"ā\": \"1\", i: \"1\", \"ī\": \"1\", \"iṃ\": \"1\", u: \"1\", \"ū\": \"1\", e: \"2\", o: \"2\" }; var j = { a: \"อ\", \"ā\": \"า\", i: \"ิ\", \"ī\": \"ี\", \"iṃ\": \"ึ\", u: \"ุ\", \"ū\": \"ู\", e: \"เ\", o: \"โ\", \"ṃ\": \"ํ\", k: \"ก\", kh: \"ข\", g: \"ค\", gh: \"ฆ\", \"ṅ\": \"ง\", c: \"จ\", ch: \"ฉ\", j: \"ช\", jh: \"ฌ\", \"ñ\": \"ญ\", \"ṭ\": \"ฏ\", \"ṭh\": \"ฐ\", \"ḍ\": \"ฑ\", \"ḍh\": \"ฒ\", \"ṇ\": \"ณ\", t: \"ต\", th: \"ถ\", d: \"ท\", dh: \"ธ\", n: \"น\", p: \"ป\", ph: \"ผ\", b: \"พ\", bh: \"ภ\", m: \"ม\", y: \"ย\", r: \"ร\", l: \"ล\", \"ḷ\": \"ฬ\", v: \"ว\", s: \"ส\", h: \"ห\" }; var a = { k: \"1\", g: \"1\", \"ṅ\": \"1\", c: \"1\", j: \"1\", \"ñ\": \"1\", \"ṭ\": \"1\", \"ḍ\": \"1\", \"ṇ\": \"1\", t: \"1\", d: \"1\", n: \"1\", p: \"1\", b: \"1\", m: \"1\", y: \"1\", r: \"1\", l: \"1\", \"ḷ\": \"1\", v: \"1\", s: \"1\", h: \"1\" }; var l, h, g, f, e, d, b; var c = \"\"; var k = 0; m = m.replace(/\\&quot;/g, \"`\"); while (k < m.length) { l = m.charAt(k - 2); h = m.charAt(k - 1); g = m.charAt(k); f = m.charAt(k + 1); e = m.charAt(k + 2); d = m.charAt(k + 3); b = m.charAt(k + 4); if (n[g]) { if (g == \"o\" || g == \"e\") { c += j[g] + j.a; k++ } else { if (k == 0) { c += j.a } if (g == \"i\" && f == \"ṃ\") { c += j[g + f]; k++ } else { if (g != \"a\") { c += j[g] } } k++ } } else { if (j[g + f] && f == \"h\") { if (e == \"o\" || e == \"e\") { c += j[e]; k++ } c += j[g + f]; if (a[e]) { c += \"ฺ\" } k = k + 2 } else { if (j[g] && g != \"a\") { if (f == \"o\" || f == \"e\") { c += j[f]; k++ } c += j[g]; if (a[f] && g != \"ṃ\") { c += \"ฺ\" } k++ } else { if (!j[g]) { c += g; if (a[h] || (h == \"h\" && a[l])) { c += \"ฺ\" } k++; if (f == \"o\" || f == \"e\") { c += j[f]; k++ } if (n[f]) { c += j.a } } else { k++ } } } } } if (a[g]) { c += \"ฺ\" } c = c.replace(/\\`+/g, '\"'); pthai = c.slice(0, -1); return c.slice(0, -1); }", "title": "" }, { "docid": "a2dfa4b2e1998b39c82a16747afa787c", "score": "0.568535", "text": "function toThai(m) { m = m.toLowerCase() + \" \"; var n = { a: \"1\", \"ā\": \"1\", i: \"1\", \"ī\": \"1\", \"iṃ\": \"1\", u: \"1\", \"ū\": \"1\", e: \"2\", o: \"2\" }; var j = { a: \"อ\", \"ā\": \"า\", i: \"ิ\", \"ī\": \"ี\", \"iṃ\": \"ึ\", u: \"ุ\", \"ū\": \"ู\", e: \"เ\", o: \"โ\", \"ṃ\": \"ํ\", k: \"ก\", kh: \"ข\", g: \"ค\", gh: \"ฆ\", \"ṅ\": \"ง\", c: \"จ\", ch: \"ฉ\", j: \"ช\", jh: \"ฌ\", \"ñ\": \"ญ\", \"ṭ\": \"ฏ\", \"ṭh\": \"ฐ\", \"ḍ\": \"ฑ\", \"ḍh\": \"ฒ\", \"ṇ\": \"ณ\", t: \"ต\", th: \"ถ\", d: \"ท\", dh: \"ธ\", n: \"น\", p: \"ป\", ph: \"ผ\", b: \"พ\", bh: \"ภ\", m: \"ม\", y: \"ย\", r: \"ร\", l: \"ล\", \"ḷ\": \"ฬ\", v: \"ว\", s: \"ส\", h: \"ห\" }; var a = { k: \"1\", g: \"1\", \"ṅ\": \"1\", c: \"1\", j: \"1\", \"ñ\": \"1\", \"ṭ\": \"1\", \"ḍ\": \"1\", \"ṇ\": \"1\", t: \"1\", d: \"1\", n: \"1\", p: \"1\", b: \"1\", m: \"1\", y: \"1\", r: \"1\", l: \"1\", \"ḷ\": \"1\", v: \"1\", s: \"1\", h: \"1\" }; var l, h, g, f, e, d, b; var c = \"\"; var k = 0; m = m.replace(/\\&quot;/g, \"`\"); while (k < m.length) { l = m.charAt(k - 2); h = m.charAt(k - 1); g = m.charAt(k); f = m.charAt(k + 1); e = m.charAt(k + 2); d = m.charAt(k + 3); b = m.charAt(k + 4); if (n[g]) { if (g == \"o\" || g == \"e\") { c += j[g] + j.a; k++ } else { if (k == 0) { c += j.a } if (g == \"i\" && f == \"ṃ\") { c += j[g + f]; k++ } else { if (g != \"a\") { c += j[g] } } k++ } } else { if (j[g + f] && f == \"h\") { if (e == \"o\" || e == \"e\") { c += j[e]; k++ } c += j[g + f]; if (a[e]) { c += \"ฺ\" } k = k + 2 } else { if (j[g] && g != \"a\") { if (f == \"o\" || f == \"e\") { c += j[f]; k++ } c += j[g]; if (a[f] && g != \"ṃ\") { c += \"ฺ\" } k++ } else { if (!j[g]) { c += g; if (a[h] || (h == \"h\" && a[l])) { c += \"ฺ\" } k++; if (f == \"o\" || f == \"e\") { c += j[f]; k++ } if (n[f]) { c += j.a } } else { k++ } } } } } if (a[g]) { c += \"ฺ\" } c = c.replace(/\\`+/g, '\"'); pthai = c.slice(0, -1); return c.slice(0, -1); }", "title": "" }, { "docid": "1da20872680e077dc795f22432da1fce", "score": "0.5675175", "text": "function e(t,e,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "title": "" }, { "docid": "caf0a5171f6270fa61376a1d09f2cc11", "score": "0.5667902", "text": "function generalLatinEasy(s) {\n\n\t\t\tsetFilterDifficulty(1.5);\n\t\t\treturn generalLatin(s);\n\t\t}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "1422af43aa95c9bd262d16524e2842a8", "score": "0.564142", "text": "function e(t,e,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[t+\" सॅकंडांनी\",t+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[t+\" मिणटांनी\",t+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[t+\" वरांनी\",t+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[t+\" दिसांनी\",t+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[t+\" म्हयन्यानी\",t+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[t+\" वर्सांनी\",t+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3f061004265b238a5a74419bff714e5a", "score": "0.5640187", "text": "function t(e,t,n,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[n][0]:r[n][1]}", "title": "" } ]
1aa2919389e92379505f0fca5a93137d
update volume bar and audio volume
[ { "docid": "366b85762d75e117b22b8828f95ffb8f", "score": "0.7121069", "text": "function volumeControl(clikedPoint) {\n const width = volumeContainer.clientWidth;\n const clickX = clikedPoint;\n volumeMemory = clickX / width;\n\n audio.volume = volumeMemory;\n volumeBar.style.width = `${volumeMemory * 100}%`;\n}", "title": "" } ]
[ { "docid": "9130b1f88ffe66291eb5b4f1866d7019", "score": "0.82249063", "text": "function setVolume() {\n current_song.volume = volume_slider.value / 100;\n}", "title": "" }, { "docid": "4dc0099405b17571d3d45514ba42aa46", "score": "0.8196972", "text": "function updateVolumeProgressBar(audio) {\n\tvar volume = audio.volume * 100;\n\t$(\".volumeBar .progress\").css(\"width\", volume + \"%\");\n}", "title": "" }, { "docid": "5e06322ce1b7763a3e8bcc2faaa0be25", "score": "0.814959", "text": "function updateVolume() {\n let vol_value = this.dataset.range;\n video.volume = vol_value;\n // Update the slider volume range\n sliders[1].value = vol_value;\n}", "title": "" }, { "docid": "7f6d794d4a8302464a4e70b9d895c9fa", "score": "0.8098508", "text": "function volumer() {\n audio.volume = bVolume.value;\n document.querySelector('label').innerHTML=bVolume.value*100+'%';\n }", "title": "" }, { "docid": "9b014af852617cc7ee1af8c755e60a2c", "score": "0.8094427", "text": "function updateVolume() {\n if (video.muted) {\n video.muted = false;\n }\n\n video.volume = volume.value;\n }", "title": "" }, { "docid": "2310b191fce33d0bb44e6e0a6ab9ee6e", "score": "0.8025875", "text": "function updateVolume(volume) {\n\t\tdefaults.volume = volume <= 100 ? volume : 100;\n\t\tdefaults.volume = volume >= 0 ? volume : 0;\n\t\tfn.text(volumeVal, `${defaults.volume}%`);\n\t\tfn.val(volumeRange, defaults.volume);\n\t\tfn.html(btnVolume, defaults.mute ? svg.volume_slash : svg.volume);\n\t\tif (!fn.isNull(defaults.current)) {\n\t\t\tdefaults.current.volume = defaults.mute ? 0 : defaults.volume / 100;\n\t\t}\n\t}", "title": "" }, { "docid": "07c396f1e0f59d9794b216df09c4a983", "score": "0.79482365", "text": "function updateVolumeProgressBar(audio) {\n var volume = audio.volume * 100;\n $(\".volumeBar .progress\").css(\"width\", volume + \"%\");\n}", "title": "" }, { "docid": "cf8bb6362d65d0ea3ea40b1b75fe769e", "score": "0.7914712", "text": "function updateVolumeProgressBar(audio) {\n // Volume val is a decimal value from 0-1. We multiply it by 100 to get the volume percentage \n var volume = audio.volume * 100;\n $(\".volumeBar .progress\").css(\"width\", volume + \"%\");\n}", "title": "" }, { "docid": "efd0607525a5011ba8df4cdf4a709f2a", "score": "0.7900471", "text": "function setvolume() {\n\tvid.volume = volumeslider.value / 100;\n}", "title": "" }, { "docid": "8a6309f03961051bd9f1521f48ec7bd4", "score": "0.7899797", "text": "function changeVolume() {\n\tvar volume_image;\n\tvar volume = $(\"#volume\").val() / 10;\n\t//Set volume\n\ttrack.volume = volume;\n\t//Set volume image\n\tif(track.volume == 0)\n\t\tvolume_image = \"fa fa-volume-off\";\n\telse if(track.volume > 0 && track.volume < 0.8)\n\t\tvolume_image = \"fa fa-volume-down\";\n\telse\n\t\tvolume_image = \"fa fa-volume-up\";\n\t$(\"#vol_img\").attr(\"class\", volume_image);\n\t//Set sound effects volume\n\tsuccess.volume = volume;\n\tfail.volume = volume;\n\tincorrect.volume = volume;\n\tcorrectSounds[0].volume = volume;\n\tcorrectSounds[1].volume = volume;\n}", "title": "" }, { "docid": "8329f365c3708a586fe82f02865543ac", "score": "0.7889116", "text": "function _updateVolume() {\n // Get the current volume\n var volume = plyr.media.muted ? 0 : plyr.media.volume * config.volumeMax;\n\n // Update the <input type=\"range\"> if present\n if (plyr.supported.full) {\n if (plyr.volume.input) {\n plyr.volume.input.value = volume;\n }\n if (plyr.volume.display) {\n plyr.volume.display.value = volume;\n }\n }\n\n // Update the volume in storage\n _updateStorage({ volume: volume });\n\n // Toggle class if muted\n _toggleClass(plyr.container, config.classes.muted, volume === 0);\n\n // Update checkbox for mute state\n if (plyr.supported.full && plyr.buttons.mute) {\n _toggleState(plyr.buttons.mute, volume === 0);\n }\n }", "title": "" }, { "docid": "50e3eddeda0706bfe729a4ab6d5759ae", "score": "0.7882142", "text": "handleVolumeLevel() {\n const Audios = document.getElementsByTagName(\"AUDIO\");\n for (let i = 0; i < Audios.length; i++) {\n Audios[i].volume = this.state.volume;\n }\n this.handleDisplay(\"Volume : \" + Math.floor(this.state.volume * 100));\n }", "title": "" }, { "docid": "3e27dfb65f8fbd580d6ddb1c4abd2b49", "score": "0.78760743", "text": "function _updateVolume() {\n // Get the current volume\n var volume = plyr.media.muted ? 0 : (plyr.media.volume * config.volumeMax);\n\n // Update the <input type=\"range\"> if present\n if (plyr.supported.full) {\n if (plyr.volume.input) {\n plyr.volume.input.value = volume;\n }\n if (plyr.volume.display) {\n plyr.volume.display.value = volume;\n }\n }\n\n // Update the volume in storage\n _updateStorage({volume: volume});\n\n // Toggle class if muted\n _toggleClass(plyr.container, config.classes.muted, (volume === 0));\n\n // Update checkbox for mute state\n if (plyr.supported.full && plyr.buttons.mute) {\n _toggleState(plyr.buttons.mute, (volume === 0));\n }\n }", "title": "" }, { "docid": "5642de8240c109732fb80214fd23cd97", "score": "0.7863689", "text": "function _updateVolume() {\n // Get the current volume\n var volume = player.media.muted ? 0 : (player.media.volume * 10);\n\n // Update the <input type=\"range\"> if present\n if (player.supported.full && player.volume) {\n player.volume.value = volume;\n }\n\n // Store the volume in storage\n if (config.storage.enabled && _storage().supported) {\n window.localStorage.setItem(config.storage.key, volume);\n }\n\n // Toggle class if muted\n _toggleClass(player.container, config.classes.muted, (volume === 0));\n\n // Update checkbox for mute state\n if (player.supported.full && player.buttons.mute) {\n _toggleState(player.buttons.mute, (volume === 0));\n }\n }", "title": "" }, { "docid": "7bb2fcfb6805d91bc44c933e6c4fcbdc", "score": "0.78338516", "text": "function updateVolume() {\n if (video.volume === 1){\n video.volume = 0;\n } else {\n video.volume += 0.25;\n }\n volume.src = `assets/icons/vol-${video.volume}.svg`;\n}", "title": "" }, { "docid": "f5f5f7a36e45ddbd4b1f2cddec20c412", "score": "0.77935874", "text": "function refresh_audio_volume(e){\n var bounding_rect = volumeBar.getBoundingClientRect(),\n x = e.clientX - bounding_rect.left,\n volume = Math.abs(x / bounding_rect.width);\n\n if(volume >= 0 && volume <= 1){\n refresh_volume_bar(volume); \n return volume;\n }\n}", "title": "" }, { "docid": "3dc3685b7b5403acf5bed0c1d04065d1", "score": "0.77216786", "text": "function volChange(n){\n\tvol=(n==1&&vol<1?vol+=0.1:vol);\n\tvol=(n!=1&&vol>0?vol-=0.1:vol);\n\tdocument.getElementById('volumeBar').style.width = vol*100;\n\t//\tdocument.getElementById('volPlus').disabled=(vol>=0.91?true:false);\n\t//\tdocument.getElementById('volMinus').disabled=(vol<=0.01?true:false)\n\tif(currentSong)\n\t\tcurrentSong.volume=vol;\n}", "title": "" }, { "docid": "691a040219925c94aef6a489ea7290cc", "score": "0.770696", "text": "function setvolume() {\n\n var song = document.querySelector('audio');\n song.volume = volumeslider.value / 100;\n}", "title": "" }, { "docid": "34f32598f926980eff235cca65c8b81e", "score": "0.7680515", "text": "function adjustVolume(){\n volumeController.volume = \"0.5\";\n volumeController.adjustVolume();\n}", "title": "" }, { "docid": "f282557435164b4c392b0d243ec213aa", "score": "0.7677699", "text": "function volumeBarClickedUp() {\n clearInterval(volumeBarInterval);\n console.log(currentMusic.volume);\n}", "title": "" }, { "docid": "560c6d3e5d1f175f1d5d46e6eb0a5efe", "score": "0.7666976", "text": "function setMasterVolume(val) {\n if(currentSong !== undefined) {\n // If we are here, then we need to reset the mute all button\n document.querySelector(\"#bsound\").innerHTML = '<span class=\"glyphicon glyphicon-volume-up\"></span>';\n var fraction;\n \n // set its volume to the current value of the master volume knob\n if(val == undefined) {\n console.log(\"calling setMasterVolume without parameters, let's take the value from GUI\");\n fraction = $(\"#masterVolume\").val() / 100;\n } else {\n fraction = val / 100;\n }\n \n // Let's use an x*x curve (x-squared) since simple linear (x) does not\n // sound as good.\n currentSong.setVolume(fraction*fraction);\n \n console.log(\"volume : \" + currentSong.volume);\n }\n}", "title": "" }, { "docid": "c43c0d5a4f9bc32c7f2a30b5a8821d71", "score": "0.76629806", "text": "setVolume(value) {\n this.volume = value;\n SongManager.player.volume = value / 100;\n let volumeRange = document.querySelector(\"#audioadjusterbar\");\n if (volumeRange.object.value != value)\n volumeRange.object.value = Math.ceil(value);\n }", "title": "" }, { "docid": "0df09b9f1d30d329a67b55aa2f095b4b", "score": "0.7656247", "text": "function adjustVolume(deltaVolume){\r\n setVol(globalVolume + deltaVolume);\r\n}", "title": "" }, { "docid": "7de4cb9796d49ce06a2f565b5fdbcdaa", "score": "0.75763273", "text": "updateVolume() {\n /**\n * In order to fix floating math issues,\n * we set the toFixed in order to avoid 0.999999999999 increments.\n */\n let currentVolume = parseFloat(this._player.volume.toFixed(2));\n /**\n * If the volume is correctly set to the target, no need to change it\n *\n * Note: On iOS devices, volume level is totally under user's control and cannot be programmatically set.\n * We pause the music immediately in this case.\n * (https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html)\n */\n if (currentVolume === this.state.audioConfig.targetVolume || isIOS) {\n // If the audio is set to 0 and it’s been met, pause the audio\n if (this.state.audioConfig.targetVolume === 0 && this.state.pausing)\n this.pause();\n\n // Unmet audio volume settings require it to be changed\n } else {\n /**\n * We capture the value of the next increment by either the configuration\n * or the difference between the current and target\n * if it's smaller than the increment.\n */\n let volumeNextIncrement = Math.min(\n this.state.audioConfig.fadeSteps,\n Math.abs(this.state.audioConfig.targetVolume - this._player.volume)\n );\n\n /**\n * Adjust the audio based on if the target is\n * higher or lower than the current.\n */\n let volumeAdjust =\n this.state.audioConfig.targetVolume > this._player.volume\n ? volumeNextIncrement\n : -volumeNextIncrement;\n\n this._player.volume += volumeAdjust;\n\n let audioConfig = this.state.audioConfig;\n audioConfig.currentVolume += volumeAdjust;\n\n this.setState({\n audioConfig\n });\n // The speed at which the audio lowers is also controlled.\n setTimeout(\n this.updateVolume,\n this.state.audioConfig.volumeTransitionSpeed\n );\n }\n }", "title": "" }, { "docid": "150739ae045832fa3921f71ad06ce49e", "score": "0.7551354", "text": "function setVolume(percentage){\n \n activeSong.volume = percentage;\n \n var percentageOfVolume = activeSong.volume / 1;\n var percentageOfVolumeSlider = document.getElementById('volumeMeter').offsetWidth * percentageOfVolume;\n \n document.getElementById('volumeStatus').style.width = Math.round(percentageOfVolumeSlider) + \"px\";\n}", "title": "" }, { "docid": "0751fdf6c8b22272d120805cbda0d814", "score": "0.7549989", "text": "function changeVolumeOnMain() {\n globalVolume = document.getElementById(\"mainVolumeRange\").value / 100;\n currentMusic.volume = globalVolume * musicVolume;\n}", "title": "" }, { "docid": "3e74d220fd3c4188c517e00c19f326f4", "score": "0.7538403", "text": "set volume(value) {\r\n this.setVolume(value);\r\n }", "title": "" }, { "docid": "9f552884d195cd4206c6ff8070dad573", "score": "0.75354666", "text": "setVolume(newVolume) {\r\n this.sound.volume(newVolume);\r\n }", "title": "" }, { "docid": "5187bf83e5fdc3753c04a73b91509a6f", "score": "0.75332797", "text": "function changeVolume() \n{\n\tvid.volume = volumeSlider.value;\n\tif (volumeSlider.value==0) \n\t{\n\t\tspeaker.innerHTML = \"<i class='fa fa-volume-mute'></i>\";\n\t}\n\telse\n\t{\n\t\tspeaker.innerHTML = \"<i class='fas fa-volume-up'></i>\";\n\t}\n}", "title": "" }, { "docid": "ea256e8801194ee82c7d5c6b23ff6a4e", "score": "0.7519483", "text": "function changeVolumeOnMusic() {\n musicVolume = document.getElementById(\"musicVolumeRange\").value / 100;\n currentMusic.volume = globalVolume * musicVolume;\n}", "title": "" }, { "docid": "621fb49ac6097f69456ef8154e6e1539", "score": "0.75027776", "text": "function update_volume(x)\n{\n\t/*change volume*/\n\tvar volume = $(\".chalk_player .media_controls .volumeBar\");\n var position = x - volume.offset().left;\n var percentage = 100 * position / volume.width();\n /*taking care of extremes*/\n if(percentage>100)\n \tpercentage = 100;\n if(percentage<0)\n \tpercentage = 0;\n localStorage.setItem(\"chst_video_vol\",(percentage != 0)?percentage:\"0.5\");\n ui_volume(percentage);\n cp_mediaPlayer.volume = percentage / 100;\n /*mute conditions*/\n mute_condition();\n /*change volume icon*/\n change_volume_icon();\n}", "title": "" }, { "docid": "3ee415556fa3b61b3b7c8fda511cea8b", "score": "0.7495618", "text": "function updateVolume(amt) {\n masterChannel.gain.value = amt;\n}", "title": "" }, { "docid": "048f2745bcd3b264a9c1e9a272c9f465", "score": "0.7485899", "text": "setVolume() {\n this.props.volumeChanged(this.slider.current.value);\n }", "title": "" }, { "docid": "923319c27a5c5c99af6e1609dd60af22", "score": "0.7458463", "text": "function add_volume_functions(){\n var e = document.querySelector('.volume-slider-con');\n var eInner = document.querySelector('.volume-slider');\n var audio = document.getElementById('true_audio_player');\n var drag = false;\n e.addEventListener('mousedown',function(ev){\n drag = true;\n updateBar(ev.clientX);\n });\n document.addEventListener('mousemove',function(ev){\n if(drag){\n updateBar(ev.clientX);\n }\n });\n document.addEventListener('mouseup',function(ev){\n drag = false;\n });\n var updateBar = function (x) {\n var volume = e;\n var percentage;\n var position = parseFloat(e.getBoundingClientRect().left);\n var position = x - position;\n \n percentage = 100 * position / volume.clientWidth;\n \n if (percentage > 100) {\n percentage = 100;\n }\n if (percentage < 0) {\n percentage = 0;\n }\n\n //update volume bar and video volume\n eInner.style.width = percentage +'%';\n audio.volume = percentage / 100;\n };\n}", "title": "" }, { "docid": "13bff5c34f7046277f1f30e844527156", "score": "0.74520147", "text": "function ChangeVolume() {\n var myVol = volumeRange.value;\n audio.volume = myVol;\n if (myVol == 0) {\n audio.muted = true;\n } else {\n audio.muted = false;\n }\n }", "title": "" }, { "docid": "9a51fb8699a9b833bee18e57a5178e1d", "score": "0.74230605", "text": "function setVolume(e) {\t \n\t var vol = e.offsetX;\t\n\tif(ytplayer){\n ytplayer.setVolume(vol);\n $(\".jp-volume-bar-value\").css( \"width\",vol + \"%\");\n }\n }", "title": "" }, { "docid": "c9b22b70288f42773661ff9d785f8693", "score": "0.74123496", "text": "function setVolume(e) {\n const width = this.clientWidth;\n const clickX = e.offsetX;\n\n audio.volume = clickX / width;\n const volumePercent = audio.volume * 100;\n volume.style.width = `${volumePercent}%`;\n volumePercentage.innerText = Math.round(audio.volume * 100) + \" %\";\n}", "title": "" }, { "docid": "2b46041c06608ce3a4cbee3add2700b3", "score": "0.74062747", "text": "function volumeChangeBar() {\n let voloffsets = volumefg.getBoundingClientRect();\n let volwidth = voloffsets.right-voloffsets.left;\n volumefg.style.clip = 'rect(0, '+((video.volume*volwidth)/16)+'rem, '+(volwidth/16)+'rem, 0)';\n }", "title": "" }, { "docid": "18a6245ac7f7671f3748153c4fbe5d11", "score": "0.73985845", "text": "function updateUI(volume) {\n console.log(`updating UI to new Ultrasound configuration: ${volume}`);\n\n // Update text\n xapi.command('UserInterface Extensions Widget SetValue', {\n WidgetId: 'volume_text',\n Value: volume\n });\n \n //Update ON/OFF toggle\n if (volume > 0) {\n xapi.command('UserInterface Extensions Widget SetValue', {\n WidgetID: 'us_on_off',\n Value:\"on\"});\n }\n else {\n xapi.command('UserInterface Extensions Widget SetValue', {\n WidgetID: 'us_on_off',\n Value:\"off\"})\n \n }\n\n // Update slider\n const level = Math.round(parseInt(volume) * 255 / MAX);\n xapi.command('UserInterface Extensions Widget SetValue', {\n WidgetId: 'volume_slider',\n Value: level\n });\n \n }", "title": "" }, { "docid": "ecce3b7d9125eb6c1f3d143e545ce6bf", "score": "0.73961973", "text": "function updateVolume(){\r\n\t\r\n\t\tMopidyService.getVolume().then(function( volume ){\r\n\t\t\t$scope.volume = volume;\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "508ba050b358207f45a9ed177aeb8fae", "score": "0.73956966", "text": "changeVolume({ commit }, changeVolume) {\n commit(\"setVolume\", changeVolume / 10);\n state.audioElement.volume = state.volume;\n }", "title": "" }, { "docid": "7bc058e3158cc1c520ece23dcc5f20fc", "score": "0.73615915", "text": "function update_volume_button( audio, vol_btn ) {\n\n\t// updates the volume button's icon\n\tif ( 0 === audio.volume || audio.muted ) {\n\n\t\t// uses the off glyphicon\n\t\tif ( vol_btn.classList.contains( 'glyphicon-volume-up' ) ||\n\t\t\tvol_btn.classList.contains( 'glyphicon-volume-down' ) ) {\n\n\t\t\tvol_btn.classList.remove( 'glyphicon-volume-up', 'glyphicon-volume-down' );\n\t\t\tvol_btn.classList.add( 'glyphicon-volume-off' );\n\t\t}\n\t} else if ( audio.volume < 0.5 ) {\n\n\t\t// uses the volume-down glyphicon\n\t\tif ( vol_btn.classList.contains( 'glyphicon-volume-off' ) ||\n\t\t\tvol_btn.classList.contains( 'glyphicon-volume-up' ) ) {\n\n\t\t\tvol_btn.classList.remove( 'glyphicon-volume-off', 'glyphicon-volume-up' );\n\t\t\tvol_btn.classList.add( 'glyphicon-volume-down' );\n\t\t}\n\t} else {\n\n\t\t// uses the volume-up glyphicon\n\t\tif ( vol_btn.classList.contains( 'glyphicon-volume-off' ) ||\n\t\t\tvol_btn.classList.contains( 'glyphicon-volume-down' ) ) {\n\n\t\t\tvol_btn.classList.remove( 'glyphicon-volume-off', 'glyphicon-volume-down' );\n\t\t\tvol_btn.classList.add( 'glyphicon-volume-up' );\n\t\t}\n\t}\n\n\t// makes the button the default/toggled color\n\tif ( vol_btn.classList.contains( 'glyphicon-volume-off' ) ) {\n\t\tvol_btn.classList.remove( 'ctrl-button-toggled' );\n\t} else {\n\t\tvol_btn.classList.add( 'ctrl-button-toggled' );\n\t}\n}", "title": "" }, { "docid": "432610c8c7c24147c80d9799ce60436e", "score": "0.73538804", "text": "function changeVolume() {\n setVisible(volumeSliderBox, true);\n setVisible(volumeOccluder, true);\n volumeSlider.focus();\n }", "title": "" }, { "docid": "ded0a47eeb2a3dcd3f6349b407a72223", "score": "0.7352235", "text": "function onVolume(data) {\n\tif (\"Error\" in data) {\n\t\tonError(data.Error);\n\t} else {\n\t\t$(\"#volume-slider\").slider(\"value\", data.Value);\n\t}\n}", "title": "" }, { "docid": "f781e34c8a029cf2124d6aa3c54fbc8f", "score": "0.73476875", "text": "onAudioVolumeChange(currentVolume) {\n console.log(\"audio volume change\", currentVolume);\n }", "title": "" }, { "docid": "cfbd7fc973a21cae0def401508aa32aa", "score": "0.734203", "text": "function changeVolumeUp() {\n setVolume(fmRadio.getVolume() + 0.1);\n }", "title": "" }, { "docid": "301dd4924cbda18532d8cc019900dbee", "score": "0.7326905", "text": "function volumeBarClickedDown(changeVolume) {\n volumeBarInterval = setInterval(changeVolume, 100);\n}", "title": "" }, { "docid": "177488e8ce6cae20885011f9000f5c73", "score": "0.73092276", "text": "function volumeChanged(val)\n{\n document.querySelector(\"#volume_out\").value = val;\n\n if (gChannel)\n {\n var result = gChannel.setVolume(parseFloat(val));\n CHECK_RESULT(result);\n }\n}", "title": "" }, { "docid": "05a7177ce4c09288244774e8b2182d99", "score": "0.7308603", "text": "function changeVolume(audios, vol){\n boop.play();\n for(audio of audios) {\n audio[0].volume = audio[1] * vol;\n }\n}", "title": "" }, { "docid": "09a1e043cd9c5ec257bc63b79e501dd2", "score": "0.7295756", "text": "function changeVolume(number, direction){\n //Checks to see if the volume is at zero, if so it doesn't go any further.\n if(activeSong.volume >= 0 && direction == \"down\"){\n activeSong.volume = activeSong.volume - (number / 100);\n }\n //Checks to see if the volume is at one, if so it doesn't go any higher.\n if(activeSong.volume <= 1 && direction == \"up\"){\n activeSong.volume = activeSong.volume + (number / 100);\n }\n \n //Finds the percentage of the volume and sets the volume meter accordingly.\n var percentageOfVolume = activeSong.volume / 1;\n var percentageOfVolumeSlider = document.getElementById('volumeMeter').offsetWidth * percentageOfVolume;\n \n document.getElementById('volumeStatus').style.width = Math.round(percentageOfVolumeSlider) + \"px\";\n}", "title": "" }, { "docid": "5f10ceee7a86ba720005a8fe881a64a2", "score": "0.729391", "text": "function changeAudioVolume(data) {\n console.log(\"changeAudioVolume \" + data.filename + \", \" + data.value);\n var aud = document.getElementById(data.filename);\n if (aud!=undefined && !isIOS())\n aud.volume = data.value;\n}", "title": "" }, { "docid": "04800aa431433176bbd3d4a9c921314d", "score": "0.7293813", "text": "function handleVolume(e) {\n if (isVolume) {\n const { offsetWidth: width } = this;\n const { offsetX: x } = e;\n const progress = round(x / width);\n\n // volume for the video ought to be in the [0-1] range\n // in the custom property changing the color of the volume bar in the [0-100] range\n video.volume = progress;\n volumeBar.style.setProperty('--volume', `${progress * 100}%`);\n }\n}", "title": "" }, { "docid": "0c57ed3c7b2979ec4110392a15ce441d", "score": "0.7284115", "text": "function OnConfigurationUpdated()\n{\n\taudio.volume = ConfigurationDirector.GetCycleHumVolume();\n}", "title": "" }, { "docid": "e609fca72fa8c02d4ee648bdeb4c8b47", "score": "0.7277492", "text": "changeVolume (delta) {\n // change volume with delta value\n this.setVolume(this.state.playing.volume + delta)\n }", "title": "" }, { "docid": "fb7a9fe8d8a19ccf33142e24641fb482", "score": "0.7272381", "text": "function handleVolumeChange(e) {\n setVolume(parseInt(e.target.value, 10));\n }", "title": "" }, { "docid": "52b1b15d049a32c97960de2b8373eabc", "score": "0.7265435", "text": "function controlVolume() {\n audio.volume = audio.volume === 1 ? 0 : audio.volume === 0 ? 0.5 : 1;\n const icon = audio.volume === 1 ? 'volume-up' : audio.volume === 0 ? 'volume-off' : 'volume-down';\n volumeButton.querySelector('i.fas').className = `fas fa-${icon}`;\n}", "title": "" }, { "docid": "d4dd5ceee2f9f8d3d71d8342dbfaaccb", "score": "0.7252706", "text": "changeVolume(value) {\n if (this.stream.volume + value > 1) {\n this.stream.volume = 1;\n log.debug(\"Hit upper bound for volume ctrl\");\n }\n else if (this.stream.volume + value < 0) {\n this.stream.volume = 0;\n log.debug(\"Hit lower bound for volume ctrl\");\n }\n else {\n this.stream.volume = Math.round((this.stream.volume + value) * 10) / 10;\n log.debug(`Modified volume by ${value} to ${this.stream.volume}`);\n }\n }", "title": "" }, { "docid": "47bc7485482b99cce79aac1a37c1a347", "score": "0.7251485", "text": "function ui_volume(percentage)\n{\n /*changing bar sizes*/\n $('.chalk_player .media_controls .volume').css('width', percentage+'%');\n $(\".chalk_player .media_controls .volumeThumb\").css(\"margin-left\",percentage+'%');\n}", "title": "" }, { "docid": "7ee4244a1b8fd85fb9758c8136b79898", "score": "0.72371376", "text": "function setvall() {\r\n audio1.volume=Math.round(Number(rng.value))/100;\r\n audio2.volume=Math.round(Number(rng.value))/100;\r\n}", "title": "" }, { "docid": "8189a8722334a1e9ebcab162479f3017", "score": "0.7234815", "text": "function volumeChange(evt) {\n let pos = evt.pageX;\n let voloffsets = volumefg.getBoundingClientRect();\n let volwidth = voloffsets.right-voloffsets.left;\n let perc = (pos-voloffsets.left)/volwidth;\n let value = (volwidth*perc)/16;\n volumefg.style.clip = 'rect(0, '+value+'rem, '+(volwidth/16)+'rem, 0)';\n video.volume = perc.toFixed(1);\n volumeChangeBtn();\n }", "title": "" }, { "docid": "b72265bf072907877405fbfcaf1e36ae", "score": "0.72232497", "text": "setVolume (volume) {\n // check if its in [0.0 - 1.0] range\n volume = Math.max(0, Math.min(1, volume))\n\n const state = this.state\n if (isCasting(state)) {\n Cast.setVolume(volume)\n } else {\n state.playing.setVolume = volume\n }\n }", "title": "" }, { "docid": "95f1a9c67225a2c9914f990bad1798be", "score": "0.7209144", "text": "onAudioVolumeChange(currentVolume) {\n console.log('audio volume change', currentVolume)\n }", "title": "" }, { "docid": "49712917942ffa256b83135cd1ab04ef", "score": "0.7203641", "text": "function setVol(volume){ \r\n // clamp input value\r\n volume = Math.max(0,volume);\r\n volume = Math.min(100,volume);\r\n globalVolume = volume;\r\n if(oldProvider === 'youtube'){\r\n $('#media').tubeplayer('volume',Math.round(volume));\r\n }else if(oldProvider === 'vimeo'){\r\n $f($('#vimeo')[0]).api('setVolume',volume/100.0);\r\n }\r\n}", "title": "" }, { "docid": "7a54ad6fcea781fd429b2c162016ec8a", "score": "0.7195142", "text": "function volumeValue(newValue) {\n player.video.volume = (newValue) / 100;\n if (player.video.volume == 0) {\n player.video.muted == true;\n playerQuery('.mute').innerHTML = 'V'\n\n } else {\n playerQuery('.mute').innerHTML = 'W';\n }\n\n}", "title": "" }, { "docid": "52080498b4238dbc80e596afab10a475", "score": "0.7184846", "text": "function changeVolumeOnSound() {\n soundVolume = document.getElementById(\"soundVolumeRange\").value / 100;\n}", "title": "" }, { "docid": "e644e359ced2298b1670ab5c5b04ee1f", "score": "0.71777517", "text": "volume(difference) {\n const level = parseFloat((this.audio.volume).toFixed(2)) + difference\n const validLevel = level <= 1 && level >= 0\n\n if (validLevel) {\n this.audio.volume = level\n this.audioOver.volume = level\n }\n }", "title": "" }, { "docid": "0ef0c670dbaf623bab81b6e2111b16dd", "score": "0.7166869", "text": "function set_video_volume(new_volume) {\n var unmute_message = document.getElementById('unmute-message');\n if (unmute_message) {\n unmute_message.style.display = 'none';\n }\n new_volume = Math.min(Math.max(0, new_volume.toFixed(2)), 1);\n\n video.muted = false; // allow unmuting and use video.volume to control\n video.volume = new_volume;\n\n /* change volume bar and mute button */\n volume_bar.value = new_volume;\n if (new_volume > 0) {\n mute_button.muted = false;\n mute_button.style.backgroundImage = volume_on_img;\n } else {\n mute_button.muted = true;\n mute_button.style.backgroundImage = volume_off_img;\n }\n }", "title": "" }, { "docid": "904becd2be81323af12d1bf7b9cb4906", "score": "0.71569026", "text": "setVolume(volume) {\n // check if its in [0.0 - 1.0] range\n volume = Math.max(0, Math.min(1, volume))\n\n const state = this.state\n state.playing.setVolume = volume\n if (isCasting(state)) {\n Cast.setVolume(volume)\n } else {\n state.playing.setVolume = volume\n }\n }", "title": "" }, { "docid": "efc772e9485dedfba37d4f90b21f3819", "score": "0.71452135", "text": "setVolume(volume) {\r\n assertRange(volume, 0, 1, 'volume');\r\n this._volume = volume;\r\n this.audio.volume = volume;\r\n this.emit(exports.PlayerEvent.VolumeChange, this.audio.volume);\r\n }", "title": "" }, { "docid": "d9467382f04ae3a5b237e9b8f9e5fd03", "score": "0.71295875", "text": "changeVolume(delta) {\n // change volume with delta value\n this.setVolume(this.state.playing.volume + delta)\n }", "title": "" }, { "docid": "f4c80f8b5969de1456496eca6299725c", "score": "0.7109444", "text": "setVolume(event){\n\t\t\tvar leftOffset = event.clientX - this.refs.volumeElement.getBoundingClientRect().left;\n\t\t\tvar leftPercentage = leftOffset / this.refs.volumeElement.clientWidth;\n\t\t\tthis.props.updateVolume(leftPercentage);\n\t}", "title": "" }, { "docid": "716228890398b6ba7476189287820656", "score": "0.70799094", "text": "function setVolume(value) {\n\t\t\tconst button =\n\t\t\t\tdocument.querySelector(\"[ln-player-action=mute]\") ||\n\t\t\t\tdocument.querySelector(\"[ln-player-action=unmute]\");\n\t\t\t// When scroller value goes below 0 debugger starts because it's out of bounds and stops program execution\n\t\t\tif (value <= 0) {\n\t\t\t\tthis.audio.volume = 0;\n\t\t\t\tthis.volumeSlider.value = 0;\n\t\t\t\tdispatchEvent.call(button, \"volumeMuted\");\n\t\n\t\t\t\t// When scroller value goes above 100 debugger starts because it's out of bounds and stops program execution\n\t\t\t} else if (value >= 1) {\n\t\t\t\tthis.audio.volume = 1;\n\t\t\t\tthis.volumeSlider.value = 100;\n\t\t\t\t// Normal execution\n\t\t\t} else {\n\t\t\t\tthis.audio.volume = value;\n\t\t\t\tthis.volumeSlider.value = value * 100;\n\t\n\t\t\t\tif (this.volumeSlider.value < 50) {\n\t\t\t\t\tdispatchEvent.call(button, \"volumeBelowHalf\");\n\t\t\t\t}\n\t\t\t\tif (this.volumeSlider.value > 50) {\n\t\t\t\t\tdispatchEvent.call(button, \"volumeAboveHalf\");\n\t\t\t\t}\n\t\t\t\tlocalStorage.setItem(this.ls.volume, value);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "05406bf9972ec9abc00139390e9d360e", "score": "0.7041525", "text": "function updatevolum(){\n if(video.muted)\n {\n video.muted=false;\n volume.innerHTML='<i class=\"fas fa-volume-up\">'\n }\n else{\n video.muted=true;\n volume.innerHTML='<i class=\"fas fa-volume-mute\"></i>'\n }\n}", "title": "" }, { "docid": "80f86ef97fcdef331bec543f876bd5ad", "score": "0.69964856", "text": "function setVolume() {\n var volume = volumePort.get() * masterVolume;\n if(volume >= VOLUME_MIN && volume <= VOLUME_MAX) {\n // gainNode.gain.value = volume;\n gainNode.gain.setValueAtTime(volume, audioCtx.currentTime);\n } else {\n // gainNode.gain.value = VOLUME_DEFAULT * masterVolume;\n gainNode.gain.setValueAtTime(VOLUME_DEFAULT * masterVolume, audioCtx.currentTime);\n }\n}", "title": "" }, { "docid": "533ac7420428985be65f239a1e786830", "score": "0.6982782", "text": "updateVolume(e) {\n\n StateManager.UpdateValue(\n \"UI.FeedRecorder.SelectedVolume\",\n e.target.value\n );\n\n if (StateManager.State().UI.SelectedModalData.Content) { // only update if the content exists\n StateManager.UpdateValue(\"UI.SelectedModalData.Content\", this.getVolumeWidgetContent(e.target.value));\n }\n\n }", "title": "" }, { "docid": "bcc68a07ad4c0dac230fa8888e6108cb", "score": "0.69332916", "text": "function volumeUp(){ //volumeup\n var volume = $(\"audio\").prop(\"volume\")+0.2;\n if(volume >1){\n volume = 1;\n }\n $(\"audio\").prop(\"volume\",volume);\n}", "title": "" }, { "docid": "e1f30753a113fb38b864fe43136ac226", "score": "0.69325525", "text": "function outputUpdate2(vol) {\n\tdocument.querySelector('#volume2').value = vol;\n}", "title": "" }, { "docid": "4b8dc2f79118547be7190b84bd86ecf7", "score": "0.692535", "text": "function volume() {\n var volumebutton = document.querySelector('.player__slider[name=\"volume\"]');\n video.volume = volumebutton.value;\n}", "title": "" }, { "docid": "734fef1181a0d8172acfc0af9558adc0", "score": "0.69137573", "text": "function musicVolumeUp() {\n if (music.volume == 1) return;\n let audioVolume = parseFloat(music.volume) + 0.05;\n music.volume = audioVolume.toFixed(4);\n return audioVolume.toFixed(4);\n}", "title": "" }, { "docid": "ed5b9314626f3f833f62476e4c053aa3", "score": "0.68837416", "text": "function draw() {\n hiHat.setVolume(hiHatSlider.value());\n openHat.setVolume(openHatSlider.value());\n ride.setVolume(rideSlider.value());\n clap.setVolume(clapSlider.value()); \n perc.setVolume(percSlider.value());\n snare.setVolume(snareSlider.value());\n synthOne.setVolume(synthOneSlider.value());\n synthThree.setVolume(synthThreeSlider.value());\n kick.setVolume(kickSlider.value());\n \n}", "title": "" }, { "docid": "fd2916cf7c2433ead6612119cbd66fda", "score": "0.6873398", "text": "function toggleMuteVolume() {\n if (video.volume > 0) {\n prevvol = video.volume;\n video.volume = 0;\n }\n else {\n video.volume = prevvol;\n prevvol = 0;\n }\n volumeChangeBar();\n volumeChangeBtn();\n }", "title": "" }, { "docid": "8df06d0128bfbfd84966cbebb8b1af88", "score": "0.6845701", "text": "function setSoundProgress() {\n if (video.muted) {\n video.muted = false;\n }\n\n let theVolume = sliderVolume.value / 10;\n video.volume = theVolume;\n\n if (theVolume === 0) {\n sound.firstElementChild.className = \"fas fa-volume-off fa-2x\";\n } else if (theVolume === 1) {\n sound.firstElementChild.className = \"fas fa-volume-up fa-2x\";\n } else {\n sound.firstElementChild.className = \"fas fa-volume-down fa-2x\";\n }\n}", "title": "" }, { "docid": "9b78fd851d06de0ea3ee95cefe87dc5a", "score": "0.6844024", "text": "function sliderMovesVolume () {\n // audio_collection = document.querySelectorAll('audio')\n // slider_collection = document.querySelectorAll('.volumeSlider')\n audio_containers = document.querySelectorAll('.audio-container')\n\n audio_containers.forEach(container => {\n // for each slider audio.volume = slider.value\n\n let audioTag = container.children[0].children[1]\n let volumeInput = container.children[0].children[2]\n\n audioTag.volume = volumeInput.value\n\n });\n}", "title": "" }, { "docid": "2eca656a29a3db103f32f26c26857917", "score": "0.6841998", "text": "function calcVolume(l, w, h){ //function for volume is length time width time height\n var volume = l * w * h;\n return volume; //return command volume to above sinkVolume var\n}", "title": "" }, { "docid": "b477f547352050fdefb1dd21d6cb2b59", "score": "0.6839497", "text": "setVolume(volume) {\n this._player.setVolume(volume);\n this._volume = volume;\n }", "title": "" }, { "docid": "6a8251027e36edd1c6952d6210f5c3ab", "score": "0.68294287", "text": "niveauVolume(){\n\tlet video= document.getElementById('video'+this.name);\n\tlet barreSon= document.getElementById('barreSon'+this.name);\n\tlet niveauSon = barreSon.value;\n\tvideo.volume = niveauSon/100;\n}", "title": "" }, { "docid": "56d4ee19cbb970eb0d9b9f7c9d258413", "score": "0.68129766", "text": "function changeVolumeDown() {\n setVolume(fmRadio.getVolume() - 0.1);\n }", "title": "" }, { "docid": "60393fe8ff826952b3dd9a677412b698", "score": "0.6798487", "text": "function volumeOut(evt) {\n let pos = evt.pageX;\n let voloffsets = volumefg.getBoundingClientRect();\n if (pos < voloffsets.left && pos > voloffsets.left-8) {\n video.volume = 0;\n }\n else if (pos > voloffsets.right && pos < voloffsets.right+8) {\n video.volume = 1;\n }\n volumeChangeBar();\n volumeChangeBtn();\n }", "title": "" }, { "docid": "f28320f5f92d34285b8d16e382b5e087", "score": "0.6796969", "text": "set ConeVolume(value) {}", "title": "" }, { "docid": "a4892a4b79aa94e630dfb544a3008047", "score": "0.67846733", "text": "function setvol(val) {\n $('#volume').val(val, false).trigger('update');\n GUI.volume = val;\n $('#volumemute').removeClass('btn-primary');\n sendCmd('setvol ' + val);\n}", "title": "" }, { "docid": "91b8016feafdf6a998b75de13a6f88f1", "score": "0.6768999", "text": "onVolumeButtonClick(e){\n console.log('volume',this.loaded,this.muted);\n if( ! this.loaded ) return;\n this.toggleMute();\n }", "title": "" }, { "docid": "0b5e3fef801e9c6d1fd1c728f902acd7", "score": "0.6756433", "text": "function updateVolumeIcon() {\n volumeIcons.forEach(icon => {\n icon.classList.add('hidden');\n });\n\n volumeButton.setAttribute('data-title', 'Mute (m)')\n\n if (video.muted || video.volume === 0) {\n volumeMute.classList.remove('hidden');\n volumeButton.setAttribute('data-title', 'Unmute (m)')\n } else if (video.volume > 0 && video.volume <= 0.5) {\n volumeLow.classList.remove('hidden');\n } else {\n volumeHigh.classList.remove('hidden');\n }\n }", "title": "" }, { "docid": "10c1cfe10074d1a5e7af0af3dc0c3622", "score": "0.67532724", "text": "setVolume(type, volume) {\r\n const prevVolume = this.storage.data.settings.sound.volume[type];\r\n\r\n if (prevVolume !== undefined) {\r\n this.storage.setVolume(type, volume);\r\n Sound.setVolume(type, volume);\r\n }\r\n }", "title": "" }, { "docid": "b3e89f7301d9ebc76c2b3eb154498d58", "score": "0.6750316", "text": "setVolume(value) {\r\n this._volume = value;\r\n if (this.gainNode) {\r\n // human perception of loudness is logarithmic, rather than linear\r\n // https://www.dr-lex.be/info-stuff/volumecontrols.html\r\n this.gainNode.gain.value = Math.pow(value, 2);\r\n }\r\n }", "title": "" }, { "docid": "3bab3087209f765e22d0c06dcffaa6ca", "score": "0.6737315", "text": "function privateSetVolume( volume_level ){\n\t\tconfig.active_song.volume = volume_level / 100;\n\t}", "title": "" }, { "docid": "2d408c9ef5ed06835ff9daad8502180c", "score": "0.6730573", "text": "function volumeDown(){ //volmedown\n var volume = $(\"audio\").prop(\"volume\")-0.2;\n if(volume <0){\n volume = 0;\n }\n $(\"audio\").prop(\"volume\",volume);\n}", "title": "" }, { "docid": "3f7a655615ae5c69695799ce259b7a0b", "score": "0.6730131", "text": "function OnVolUpdate(x)\n{\ntry {\n\n val = ConvertToDB(x);\n \n\tDVD.Volume = val;\n\n // update the other slider\n if(true == g_bFullScreen){\n\n VolSlider.Value = x;\n }\n else {\n\n VolSliderFull.Value = x;\n }/* end of if statement */\n \n // we adjusted the volume so lets unmute\n MFBar.EnableObject(\"Mute\", true);\n\tMFBar.EnableObject(\"MuteFull\", true);\n\tMFBar.EnableObject(\"Sound\", false);\n\tMFBar.EnableObject(\"SoundFull\", false);\n\n}\n\ncatch(e) {\n\n\tVolSlider.Disable = true;\n\tVolSliderFull.Disable = true;\n Mute.Disable = true;\n MuteFull.Disable = true;\n Sound.Disable = true;\n SoundFull.Disable = true;\n\n\treturn;\n}\n}", "title": "" }, { "docid": "2e67f8a2adb354fd6eef79ed23654e8e", "score": "0.67248994", "text": "function setVolume(gain) {\n if (volume){\n volume.gain.value = gain;\n console.log(context.currentTime +\" -- Volume set to \" + gain);\n }\n}", "title": "" }, { "docid": "145d9eb42cfc9970a952ff4c52e669ac", "score": "0.66865", "text": "function setNewVolume(obj,e){\n var volumeSliderWidth = obj.offsetWidth;\n var evtobj = window.event? event: e;\n clickLocation = evtobj.layerX - obj.offsetLeft;\n \n var percentage = (clickLocation/volumeSliderWidth);\n setVolume(percentage);\n}", "title": "" }, { "docid": "dbeb26ddc63509faeee5ba8d19c0dd12", "score": "0.6681594", "text": "function setVolume() {\n\tclient.sendCommand('setvol '+currentVolume)\n}", "title": "" } ]
3f300d1b7c68fed60245dc9f5e379591
Actually enlarging the dot using the outputed eased "p"
[ { "docid": "2737367d973a23b7144b6518e0547e4c", "score": "0.73860294", "text": "function enlargeDot(p) {\n\t \tdot.style.webkitClipPath = 'circle('+(parseInt(dot_clip[0])*(p*4.5+1))+'px at ' + -dot_x + 'px ' + -dot_y + 'px)';\n\t\t}", "title": "" } ]
[ { "docid": "3428322dcf50225629fd682bb5b22d3a", "score": "0.6078223", "text": "display() {\r\n fill(128, 0, 0);\r\n ellipse(this.x + SCALE/2, this.y + SCALE/2, SCALE, SCALE);\r\n }", "title": "" }, { "docid": "b06cf21174340c8e0d5fb22d79c0265c", "score": "0.6072701", "text": "function drawDot() {\n push();\n noStroke();\n //rectMode(CENTER);\n translate(cellSize/2,cellSize/2);\n //fill(255,0,0);\n //rect(0,0, cellSize,cellSize);\n fill(255);\n ellipse(0,0,cellSize/4,cellSize/4);\n pop();\n}", "title": "" }, { "docid": "afc4720908e03d78bbf87f0c4f47ab51", "score": "0.60702735", "text": "function markPnt(p){\r\n var r1 = 1.0;\r\n activeDocument.activeLayer.pathItems.ellipse(\r\n p[1] + r1,\r\n p[0] - r1,\r\n r1*2, r1*2);\r\n}", "title": "" }, { "docid": "4c7bb24158b61e3d14408eb1b02eb421", "score": "0.59849405", "text": "display(){\n translate(this.size/2,this.size/2);\n fill(255,0,0);\n ellipse(this.x,this.y,this.size,this.size);\n // if(this.x < width && this.y < height){\n // this.x += 1;\n // this.y += 1;\n // }\n translate(0,0);\n }", "title": "" }, { "docid": "49cbc0e5691edfe792aaebbfc9203484", "score": "0.59146816", "text": "function positionDot() {\n turnRight(45);\n move(14, 0);\n}", "title": "" }, { "docid": "c117fa5d54a011ed4a3580ec1f24b148", "score": "0.5893132", "text": "function updatePointDisplay() {\n let pointsCanvas = document.getElementById(\"pointsCanvas\");\n let gc = pointsCanvas.getContext(\"2d\");\n // wipe canvas:\n gc.clearRect(0,0,pointsCanvas.width,pointsCanvas.height);\n // calculate font size s.t. the values will fit regardless of digits (within reason)\n // xCushion: provides xCushion/2 px per side\n let xCushion = 10;\n // find number of digits:\n let numDigits = 1;\n let x = points;\n while (x>=10) {\n numDigits++;\n x = x/10;\n }\n // font size = (canvaswidth-xCushion)/numDigits\n let fontSize = (3/2)*((pointsCanvas.width-xCushion)/numDigits);\n // add new value:\n gc.beginPath();\n gc.strokeStyle=\"black\";\n gc.fillStyle=\"red\";\n gc.font = fontSize+'px serif';\n gc.fillText(points.toString(),xCushion/2,pointsCanvas.height-xCushion/2);\n gc.strokeText(points.toString(),xCushion/2,pointsCanvas.height-xCushion/2);\n }", "title": "" }, { "docid": "afa4a664981d4de9f8a2e3fb7f8f11ee", "score": "0.5892398", "text": "_scaleDot(size) {\n let radius = 7, margin = 7;\n if (size >= 18) {\n let ratio = 18 / size;\n radius = (7 * ratio) << 0;\n margin = (7 * ratio) << 0;\n }\n\n return {\n width: radius,\n height: radius,\n borderRadius: radius / 2,\n marginRight: margin,\n };\n }", "title": "" }, { "docid": "c4ac439fad37cd6eaa043b337061feee", "score": "0.5829269", "text": "function drawTip() {\n penWidth(45);\n penRGB(236, 240, 241);\n turnTo(154);\n moveForward(55);\n moveBackward(55);\n turnTo(206);\n moveForward(30);\n penUp();\n}", "title": "" }, { "docid": "e27b96854c4d2c1be9a8cb89b6939eeb", "score": "0.5807329", "text": "function display() {\n fill(0,127);\n noStroke();\n strokeWeight(2);\n ellipse((x),(y),(w*2),(w*2));\n }", "title": "" }, { "docid": "7521498eadaf25e5f9e94fb807e70db6", "score": "0.58062917", "text": "function drawMoveDot(currentX, currentY, lastX, lastY, toolColor, toolSize) {\n\n \t\t// Draw end point\n \t\tctx.beginPath();\n \t\tctx.arc(currentX, currentY, toolSize, 0, 2*Math.PI, true);\n \t\tctx.fill();\n\n \t\t// Interpolate\n \t\ttwoPointLine(ctx, lastX, lastY, currentX, currentY, toolColor, toolSize);\n\n \t}", "title": "" }, { "docid": "f307cb08b49d4c04bf7e796485cec6b8", "score": "0.5805716", "text": "display() {\n fill(100, 20, 54);\n textAlign(CENTER);\n textSize(this.scale * 5);\n textStyle(ITALIC);\n text(this.text, this.xPos, this.yPos);\n }", "title": "" }, { "docid": "05b5d0876e974a35b5708d0c56b52c6c", "score": "0.57394916", "text": "function putDot(n, x, y, size) {\n\t\tvar id = 'dot-' + n,\n\t\t\tel = document.getElementById(id);\n\t\tif (!el) {\n\t\t\tel = document.createElement('div');\n\t\t\tvar ael = angular.element(el);\n\t\t\tael.addClass('dot');\n\t\t\thide(ael, x, y, size);\n\t\t\tel.id = id;\n\t\t\tif (options.showNumbers)\n\t\t\t\tael.text(n + options.indexFrom);\n\t\t\tpanel.append(ael);\n\t\t}\n\t\t// todo - replace with css animation?\n\t\tpromises[n] = timeout(function() {\n\t\t\t(ael || angular.element(el)).removeClass('hiding')\n\t\t\t\t.css({\n\t\t\t\t\tbackground: service.getBg(n),\n\t\t\t\t\ttop: (y - size * 0.5) + 'px',\n\t\t\t\t\tleft: (x - size * 0.5) + 'px',\n\t\t\t\t\t'line-height': size - borderWidth + 'px',\n\t\t\t\t\t'font-size': (size * options.fontSize) + 'px',\n\t\t\t\t\twidth: size + 'px',\n\t\t\t\t\theight: size + 'px'\n\t\t\t\t});\n\t\t}, options.preTransitionDelay);\n\t}", "title": "" }, { "docid": "2aa730d67853e3065ddc545af532529a", "score": "0.5681069", "text": "function draw() {\n    ctx.clearRect(0, 0, cw, ch);\n\n // Update the dots\n for (let i = 0; i < dots.length; i++) {\n        dots[i].update();\n    }\n \n // Add helper text\n // ctx.fillStyle = 'black';\n // ctx.textAlign='center'; \n // ctx.font = '12px Arial';\n // ctx.fillText('Move you mouse around and watch the dots change.', (cw / 2), 15);\n\n requestAnimFrame(draw);\n}", "title": "" }, { "docid": "19cb2e336b55bd937db583478fac293d", "score": "0.56808275", "text": "large()\r\n {\r\n this.s=this.s + 1;\r\n fill(252,231,190,200);\r\n ellipse(this.x,this.y,this.s,this.s); \r\n }", "title": "" }, { "docid": "7aaa4e51ae232186d58bac21562c1a29", "score": "0.5671495", "text": "createOffscreenDot() {\n\t\tlet left = Math.floor(Math.random() * 2) === 1 ? true : false;\n\t\tlet canvasHalfWidth = this.element.width / 2;\n\t\tthis.dots.push({\n\t\t\tx: left ? Math.random() * canvasHalfWidth - 5 : Math.random() * canvasHalfWidth + canvasHalfWidth + 5,\n\t\t\ty: -5,\n\t\t\txSpeed: left ? Math.random() : Math.random() - 1,\n\t\t\tySpeed: Math.random() + 1,\n\t\t\tsize: this.dotSize\n\t\t});\n\n\t\treturn this;\n\t}", "title": "" }, { "docid": "3b03b510550df1192b9a8a80d75686f7", "score": "0.56268203", "text": "function drawAlien(){\n moveTo(160,270);\n penColor(\"Green\");\n dot(20);\n moveTo(160,235);\n penColor(\"#00b33c\");\n dot(20);\n moveTo(176.5,235);\n turnRight(120);\n penWidth(10);\n penDown();\n moveForward(30);\n turnRight(110);\n moveForward(20);\n penUp();\n \n}", "title": "" }, { "docid": "70741c71036b61e8a26438d48472a0f7", "score": "0.5619491", "text": "function drawScale(c) {\n var ctx = c.getContext(\"2d\");\n var points = 10;\n var total = zoomRight - zoomLeft;\n ctx.font = \"15px Georgia\";\n\n for (var x=1; x < points; x++) {\n ctx.beginPath();\n var xPos = x / points * c.width;\n ctx.moveTo(xPos, c.height);\n ctx.lineTo(xPos, c.height - 20);\n ctx.stroke();\n\n var text = \"\"+ Math.round(zoomLeft + x / points * total);\n ctx.fillStyle = 'black';\n ctx.fillText(\"\"+ text, xPos - text.length * 4, c.height - 27);\n }\n\n}", "title": "" }, { "docid": "d2e8350e1d68ab0d049fb334df5e1f1e", "score": "0.56090903", "text": "function markpt(p){\n var r = 2;\n app.activeDocument.pathItems.ellipse(\n p.y + r, p.x - r, r*2, r*2\n );\n}", "title": "" }, { "docid": "abb574ff5b22ecfe770903b1352fafed", "score": "0.559547", "text": "function drawPavement() {\n penUp();\n penWidth(37);\n//turtle is positioned in order to draw a pavement that extends from one end to another\n moveTo(0, 200);\n penDown();\n turnRight(90);\n moveForward(500);\n}", "title": "" }, { "docid": "1b08fc0f714713b9b94e89420d4ce51c", "score": "0.559119", "text": "grow (dotSize)\n {\n this.size.current += this.size.grow_rate * dotSize\n\n this.velocity.current = 1 - (this.size.current / 300)\n\n this.velocity.current = Mathf.clamp(this.velocity.current,this.velocity.min,this.velocity.max)\n \n }", "title": "" }, { "docid": "327914897353ce6df08014f02ba86d90", "score": "0.5570431", "text": "function drawOneDots(posXS, posYS, colored) {\n ellipse(posXS+(caseWidth/2), posYS+(caseHeight/2), 5, 5);\n}", "title": "" }, { "docid": "1bfd66125bca1687e9b6001428b24afa", "score": "0.5569093", "text": "function drawStep(p) {\n let [h, pH, v, pV] = gethpHvpV();\n let x = h * width + pH * p;\n let y = v * height + pV * p;\n ellipse(x, y, p);\n}", "title": "" }, { "docid": "1bcc74846a1b9256d9f9f55e119bc364", "score": "0.5557643", "text": "show(){\n\t\tstrokeWeight(4);//perim of circle\n\t\tfill(this.color1,this.color2,this.color3);//fill of the circle\n\t\tellipse(this.x, this.y, this.d, this.d);\n\t\tfill(0);//font color\n\t\ttextSize(this.size);//text size\n\t\ttext(this.label, this.x-this.minusX, this.y+this.plusY); //location\t\n\t}", "title": "" }, { "docid": "d92705d5e55c272f2d353c4a5a18ca1a", "score": "0.555574", "text": "function pt(){\n\tthis.x = random(400);\n\tthis.y = random(400);\n\n\tif(this.y < this.x){\n\t\tthis.label = -1;\n\t}else{\n\t\tthis.label = 1;\n\t}\n\n\tthis.pixelX = function(){\n\t\treturn this.x;\n\t};\n\tthis.pixelY = function(){\n\t\treturn map(this.y,0,400,400,0);\n\t};\n\tthis.show = function(){\n\t\tif(this.label > 0){\n\t\t\tstroke(0);\n\t\t\tfill(0);\n\t\t}else{\n\t\t\tstroke(0);\n\t\t\tnoFill();\n\t\t}\n\t\tellipse(this.pixelX(), this.pixelY(), 8, 8);\n\t};\n}", "title": "" }, { "docid": "ce01ccfeb731a08d42e02545a1962613", "score": "0.5542194", "text": "dot() {\n this.context.beginPath();\n this.context.strokeStyle = \"red\";\n this.context.rect(this.startX, this.startY, 1, 1);\n this.context.stroke();\n }", "title": "" }, { "docid": "0cdb079274d09916767ddf8de1face45", "score": "0.5540866", "text": "_sotter(dot, props) {\r\n dot = canvas.getDotByXY(dot.x, dot.y);\r\n canvas.setDotProperties(dot, props);\r\n }", "title": "" }, { "docid": "5d4066074af6fcc8eaef4a0a855a4d4b", "score": "0.5530436", "text": "function penSize(size) {\n penWidth = size;\n document.getElementById(\"pensize\").innerHTML = penWidth;\n}", "title": "" }, { "docid": "ea0b66dacc2b84458f0e24a01078f8f7", "score": "0.55282664", "text": "function displayDot(xCoor, yCoor, key) {\r\n ctx.rect(xCoor, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n ctx.rect(xCoor, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n ctx.fillStyle = `hsl(${hue},100%,50%)`;\r\n ctx.fill();\r\n switch (key) {\r\n case 'ArrowUp':\r\n ctx.clearRect(xCoor, yCoor + MOVE_AMOUNT, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n case 'ArrowDown':\r\n ctx.clearRect(xCoor, yCoor - MOVE_AMOUNT, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n case 'ArrowLeft':\r\n ctx.clearRect(xCoor + MOVE_AMOUNT, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n case 'ArrowRight':\r\n ctx.clearRect(xCoor - MOVE_AMOUNT, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n default:\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "001aa8993000ec6edb08c137dbb400ce", "score": "0.55245596", "text": "messageHeight(maxWidth) {\n //text wird überall dort, wo ein Leerzeichen ist, gespalten und als neues Element in einem Array aufgerufen\n let text = this.message.split(\" \");\n //hier wird nur this.line erzeigt, ohne ihm einen Wert zuzuweisen\n this.line = \"\";\n //wenn textHeight und textLeaning nicht verschieden definiert werden, funktioniert textHeight += this.textLeading; nicht mehr\n let textHeight = this.textLeading;\n for (let i = 0; i < text.length; i++) {\n //hier wird jetzt jedes Wort einzeln durchgegangen und mit einem Leerzeichen ergänzt, damit der Text lesbar ist.\n let textLine = this.line + text[i] + \" \";\n //The p5.js API provides a lot of functionality for creating graphics, but there is some native HTML5 Canvas functionality that is not exposed by p5. You can still call it directly using the variable drawingContext, as in the example shown.(https://p5js.org/reference/#/p5/drawingContext)\n let textWidth = drawingContext.measureText(textLine).width;\n //hier wird, wenn die Textlänge einer Zeile den maximalen Wert, den diese Annehmen soll,überschreitet, eine Zeile hinzugeefügt\n if (textWidth > maxWidth && i > 0) {\n this.line = text[i] + \" \";\n // a+=b === a=a+b\n textHeight += this.textLeading;\n } else {\n this.line = textLine;\n }\n }\n return textHeight;\n }", "title": "" }, { "docid": "7fc5a0b1554f16f19834d44b7752cc7f", "score": "0.55199695", "text": "show() {\n noStroke()\n fill(this.color) // random color\n ellipse(this.pos.x, this.pos.y, this.w) // \n }", "title": "" }, { "docid": "b5d57b6404de0be9efa9f80fff1b6c15", "score": "0.551117", "text": "function Dot(x = 100, y = 100) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.size = 5;\n\n\tthis.display = function() {\n\t\tthis.size = calculateDistance(this.x, this.y, cursorX, cursorY) / 400;\n\n\t\tctx.beginPath();\n\t\tctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, true);\n\t\tctx.closePath();\n\t\tctx.fillStyle = \"rgba(\" + lR + \", \" + lG + \", \" + lB + \", \" + lA + \")\";\n\t\tctx.fill();\n\t}\n}", "title": "" }, { "docid": "29374335016ed3e856f427c66b6679e8", "score": "0.5493105", "text": "resizeDots() {\n\t\tfor (let dot of this.dots) {\n\t\t\t// use pythagorean theorem to calculate the distance between the 2 points\n\t\t\tlet distance = Math.sqrt(Math.pow(Math.abs(this.mouseX - dot.x), 2) + Math.pow(Math.abs(this.mouseY - dot.y), 2));\n\t\t\tdot.size = Math.max(Math.min(20 - distance / 20, 30 /*largest size*/), this.dotSize);\n\t\t}\n \treturn this;\n }", "title": "" }, { "docid": "cb9c9400d3f4440ea7f5ef17423e8f4c", "score": "0.5492934", "text": "function DotAnimationForOverlay() {\n var overlay = $('#overlay');\n var text = overlay.text();\n if (text.indexOf('...', text.length - 3) > 0) {\n overlay.text(text.substring(0, text.length - 3));\n } else {\n overlay.text(text + '.');\n }\n}", "title": "" }, { "docid": "af2f822bf7fe788e0d34187f33aa0673", "score": "0.5490724", "text": "addDot(index) {\n const dot = new _dot__WEBPACK_IMPORTED_MODULE_7__[\"Dot\"]();\n dot.setDotShiftY(this.glyph.dot_shiftY);\n this.dots++;\n return this.addModifier(index, dot);\n }", "title": "" }, { "docid": "ff37c300b91a09ee7f469e32eb47008b", "score": "0.5489739", "text": "display() {\n\n push();\n noStroke();\n fill(random(100,255));\n this.radius = 2*this.effect; // make the effectivity related to its size\n ellipse(this.x, this.y, this.radius * 2);\n fill(random(70,170),random(50,200), 255); // text color\n textSize(this.radius);// text size related to vote size\n text(\"vote\",this.x-this.radius,this.y-this.radius);\n pop();\n }", "title": "" }, { "docid": "bfc05c2239ad606cd13f7b83bc601999", "score": "0.5475012", "text": "function drawPiece(svg, margin, w, ix, iy, p, emp) {\n var pieceText = Piece[p.toLowerCase()];\n\n if (pieceText) {\n var x = margin[3] + w * (ix + 0.5);\n var y = margin[0] + w * (iy + 0.5);\n var piece = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n\n if (p.charAt(0) == '+') {\n piece.setAttribute('class', 'nari-goma');\n }\n else {\n piece.setAttribute('class', 'koma');\n }\n\n piece.setAttribute('x', x);\n piece.setAttribute('y', y);\n\n if (isGote(p)) {\n // Rotate Gote's piece\n var transformation = 'translate(' + String(x) + ' ' + String(y) + ') ';\n if (pieceText.length == 2) {\n // Shrink the height of Gote's 成香、成桂、成銀\n transformation += ' scale(1.0 0.5)';\n }\n transformation += 'rotate(180)';\n transformation += 'translate(' + String(-x) + ' ' + String(-y) + ') ';\n\n piece.setAttribute('transform', transformation);\n }\n else if (pieceText.length == 2) {\n // Shrink the height of Sente's 成香、成桂、成銀\n var transformation = 'translate(' + String(x) + ' ' + String(y) + ') ';\n transformation += ' scale(1.0 0.5)';\n transformation += 'translate(' + String(-x) + ' ' + String(-y) + ') ';\n piece.setAttribute('transform', transformation);\n }\n\n piece.setAttribute('text-anchor', 'middle');\n piece.setAttribute('dominant-baseline', 'central');\n var text;\n\n if (emp) {\n text = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n text.setAttribute('class', 'made');\n text.appendChild(document.createTextNode(pieceText));\n }\n else\n text = document.createTextNode(pieceText);\n\n piece.appendChild(text);\n svg.appendChild(piece);\n }\n else {\n console.log('Error: unknown piece, ' + p);\n }\n}", "title": "" }, { "docid": "281d8bbb5a28779e9ae945b394b65f6e", "score": "0.5474767", "text": "addDot() {\n const dot = new _dot__WEBPACK_IMPORTED_MODULE_5__[\"Dot\"]();\n this.dots += 1;\n return this.addModifier(dot, 0);\n }", "title": "" }, { "docid": "7cb4bab398534be148f09058a9a1bd35", "score": "0.54647183", "text": "function makeDots (num) {\n let ret = ''\n while (num > 0) {\n ret += ' ○ '\n num--\n }\n return ret\n}", "title": "" }, { "docid": "8e7360861f909e32f8638c77e5488e2a", "score": "0.5447734", "text": "dotEaten() {\n this.remainingDots -= 1;\n\n this.soundManager.playDotSound();\n\n if (this.remainingDots === 174 || this.remainingDots === 74) {\n this.createFruit();\n }\n\n if (this.remainingDots === 40 || this.remainingDots === 20) {\n this.speedUpBlinky();\n }\n\n if (this.remainingDots === 0) {\n this.advanceLevel();\n }\n }", "title": "" }, { "docid": "e9a4542807a7e56ce55b14501b8bfd6a", "score": "0.54454607", "text": "function drawUpDot(currentX, currentY, lastX, lastY, toolColor, toolSize) {\n \t\tdrawDownDot(currentX, currentY, toolColor, toolSize);\n \t}", "title": "" }, { "docid": "310a0a924440457eff1a8be68990956a", "score": "0.54439443", "text": "updateComponents() {\n this.text.x = this.position.x + this.getWidth() + this.spacing.text\n this.text.y = this.position.y + PlaceholderDimension.height + GLOBAL_SETTINGS.fontSize / 2\n this.edge.sx = this.position.x\n this.edge.sy = this.position.y + PlaceholderDimension.height + this.spacing.y\n this.edge.ex = this.position.x + this.getWidth()\n this.edge.ey = this.position.y + PlaceholderDimension.height + this.spacing.y\n }", "title": "" }, { "docid": "1c997fc168a4561be7ccd94d1b58c6ca", "score": "0.5441388", "text": "display() {\n push();\n noStroke();\n fill(255, 255, 255, this.transparency);\n noStroke();\n ellipse(this.x, this.y, this.size, this.size);\n fill(255, 255, 255, this.transparency2);\n ellipse(this.x2, this.y2, this.size2, this.size2);\n pop();\n }", "title": "" }, { "docid": "04ff56f2c8a5110b10b3a4381d254d0f", "score": "0.5434334", "text": "function pimpText(){\n var text = document.getElementById(\"text\");\n //text.style.fontSize = \"2em\"; //1em = 12pt, 2em = 24pt\n defaultFont += 2;\n text.style.fontSize = defaultFont + \"pt\";\n}", "title": "" }, { "docid": "359f6728a4f2a98684599db0788f243b", "score": "0.54284376", "text": "show() {\n noStroke();\n push();\n translate(this.p1.x, this.p1.y);\n rotate(-this.angle);\n fill(100);\n rect(0, 0, this.w, this.h);\n pop();\n }", "title": "" }, { "docid": "6dc853907bb3a2528c2cd28e609600b4", "score": "0.54112667", "text": "function repositionPoint(point, magnifier) {\n point.css('top', (point.data('top') * magnifier) + 'px');\n point.css('left', (point.data('left') * magnifier)+ 'px');\n point.css('width', (point.data('size') * magnifier)+ 'px');\n point.css('height', (point.data('size') * magnifier)+ 'px');\n //$(this).css('border-radius', (25 * magnifier)+ 'px');\n\n var fontSize = 24;\n if (point.data('size') === 10) {\n fontSize = 5;\n } else if (point.data('size') === 25) {\n fontSize = 12;\n } else if (point.data('size') === 100) {\n fontSize = 56;\n } else if (point.data('size') === 200) {\n fontSize = 108;\n }\n point.css('font-size', (fontSize * magnifier) + 'px');\n}", "title": "" }, { "docid": "9fc33c4ffcebea83b591dc60ca03a3f0", "score": "0.5410103", "text": "function drawDot(ctx,x,y,size) {\n // Let's use black by setting RGB values to 0, and 255 alpha (completely opaque)\n r=255; g=0; b=0; a=100;\n\n // Select a fill style\n ctx.fillStyle = \"rgba(\"+r+\",\"+g+\",\"+b+\",\"+(a/255)+\")\";\n\n // Draw a filled circle\n ctx.beginPath();\n ctx.arc(x, y, size, 0, Math.PI*2, true);\n ctx.closePath();\n ctx.fill();\n}", "title": "" }, { "docid": "ee872e4b2d9bb8d026169f007004ca98", "score": "0.54043317", "text": "function draw(){\n\tbackground(200);\n\t// Get the overall volume (between 0 and 1.0)\n\tlet vol = mic.getLevel();\n\tfill(127);\n\tstroke(0);\n\n\t// Draw an ellipse with height based on volume\n\tlet h = map(vol, 0, 1, height, 0);\n\tellipse(width / 2, h - 25, 50, 50);\n}", "title": "" }, { "docid": "295e5f538785580a39e8aaa4f5f01dc7", "score": "0.5395921", "text": "drawNumber(x, y, teethNumber) {\n if((teethNumber >= 11 && teethNumber <=18) || (teethNumber >=51 && teethNumber <=55) || (teethNumber >=42 && teethNumber <=48)|| (teethNumber >=81 && teethNumber <=85))\n {\n x = x - 23;\n\n }\n else\n {\n x = x + 20 ;\n\n }\n var simpleText = new Konva.Text({\n x: x ,\n y: y + 18,\n text: teethNumber,\n fontSize: 10,\n fill: 'blue',\n\n fontFamily: 'Calibri',\n fill: 'black'\n });\n return simpleText;\n }", "title": "" }, { "docid": "b669a305b957c4664ab4cbb38d21c4c8", "score": "0.5379567", "text": "drawText() {\n const ctx = this.context;\n let is_pedal_depressed = false;\n const pedal = this;\n\n // Iterate through each note, placing glyphs or custom text accordingly\n this.notes.forEach(note => {\n is_pedal_depressed = !is_pedal_depressed;\n const stave = note.getStave();\n const x = note.getAbsoluteX();\n const y = stave.getYForBottomText(pedal.line + 3);\n\n const point = this.musicFont.lookupMetric(`pedalMarking.${is_pedal_depressed ? 'down' : 'up'}.point`);\n\n let text_width = 0;\n if (is_pedal_depressed) {\n if (pedal.custom_depress_text) {\n text_width = ctx.measureText(pedal.custom_depress_text).width;\n ctx.fillText(pedal.custom_depress_text, x - (text_width / 2), y);\n } else {\n drawPedalGlyph('pedal_depress', ctx, x, y, point);\n }\n } else {\n if (pedal.custom_release_text) {\n text_width = ctx.measureText(pedal.custom_release_text).width;\n ctx.fillText(pedal.custom_release_text, x - (text_width / 2), y);\n } else {\n drawPedalGlyph('pedal_release', ctx, x, y, point);\n }\n }\n });\n }", "title": "" }, { "docid": "dd98f47af97b4b1c8c3de57f3bcaf60c", "score": "0.5368397", "text": "function showPaused(){\r\n ctx.textAlign=\"center\";\r\n ctx.font=\"35px Arial\";\r\n ctx.fillStyle=\"white\";\r\n ctx.fillText(\"PAUSED\",width/2,height/2);\r\n}", "title": "" }, { "docid": "d36463e8ff456b86b7dc511d03d806a8", "score": "0.5342326", "text": "function textBottomInfo(){\n ctx.fillStyle = INFOTEXTCOLOR;\n ctx.font = FONT;\n ctx.textAlign = CENTER;\n ctx.fillText('Play this gamble?', c.width/2, c.height*1/5);\n }", "title": "" }, { "docid": "0e939808a0fe126b56bcce0d25d90fdc", "score": "0.53417027", "text": "show() {\n strokeWeight(20);\n stroke(255);\n this.edges();\n point(this.position.x, this.position.y);\n\n // Draw a tadpole-like shape\n for (let i = 0; i < 18; i += 2) {\n strokeWeight(i);\n point(this.position.x - this.velocity.x * (20-i) * 0.15, this.position.y - this.velocity.y * (20-i) * 0.15);\n }\n }", "title": "" }, { "docid": "64f08257feeea70951a4bf5b71f90b04", "score": "0.5333986", "text": "show() {\n if(this.alive == true&& this.end > 0){\n fill(0, 0, 0);\n noStroke();\n ellipse(this.x, this.y, this.r * 2, this.r * 2);\n\n \n }}", "title": "" }, { "docid": "b78856992363e4d7e0759e8d05a6d1c1", "score": "0.5327241", "text": "draw(p) {\n p.push();\n p.translate(this.pos);\n this.drawSelf(p);\n this.drawSignal(p);\n p.pop();\n }", "title": "" }, { "docid": "3be9a85d0cbae5ded84cad9ab22914ba", "score": "0.5325261", "text": "show(){\n fill(255)\n ellipse(this.x, this.y, 32, 32 )\n }", "title": "" }, { "docid": "2654a6ef7f65fa82a44dccfd501035f1", "score": "0.53184295", "text": "function Dot()\n{\n // set default properties\n this.xpos = random(0, width);\n this.ypos = height; \n this.speed = random(1, 4);\n this.letter = letters[Math.floor(Math.random() * letters.length)];\n this.boxFilled = Math.random() < 0.5 ? 0 : 1;\n}", "title": "" }, { "docid": "0e636f2717d2e8178a842c31212cfda3", "score": "0.53159076", "text": "function Echo(x, y, max_wid, last_echo) {\n var curr_wid = 0;\n var curr_hei = 0;\n \n this.echo = function() {\n if (curr_wid < max_wid) {\n stroke(255, max_wid - curr_wid);\n ellipse(x, y, curr_wid, curr_hei);\n curr_wid ++;\n curr_hei ++;\n }\n else if (last_echo == true) {\n return true;\n }\n return false;\n }\n}", "title": "" }, { "docid": "bf379f7dfc1acc86f18902a54ae68705", "score": "0.53123075", "text": "function drawPoint(p, point) {\n p.ellipse(point[0], point[1], 5, 5);\n}", "title": "" }, { "docid": "60ed11fb7d0ecc2f3a249db23eb38e4f", "score": "0.53108513", "text": "show() {\n fill(255);\n ellipse(this.x, this.y, 2 * this.r, 2 * this.r);\n }", "title": "" }, { "docid": "97538edd7b5ef5802cac7dcc269ab917", "score": "0.52999574", "text": "function drawPlusMinus() {\n textSize(16);\n textAlign(CENTER, CENTER);\n if (random(1) < 0.50) {\n text('+', x + controls.spacingChange/2, y + controls.spacingChange/2);\n } else {\n text('-', x + controls.spacingChange/2, y + controls.spacingChange/2);\n }\n}", "title": "" }, { "docid": "a71f434395a105138742ebc5f36732cd", "score": "0.52992266", "text": "function dots(dots=true, transparentBackground=false,force=false) {\n\n var scale = unit * globalScope.scale;\n var ox = globalScope.ox % scale; //offset\n var oy = globalScope.oy % scale; //offset\n\n document.getElementById(\"backgroundArea\").style.left=(ox-scale)/DPR;\n document.getElementById(\"backgroundArea\").style.top=(oy-scale)/DPR;\n\n if(globalScope.scale==simulationArea.prevScale && !force)return;\n\n if(!backgroundArea.context)return;\n simulationArea.prevScale=globalScope.scale;\n\n var canvasWidth = backgroundArea.canvas.width; //max X distance\n var canvasHeight = backgroundArea.canvas.height; //max Y distance\n\n var ctx = backgroundArea.context;\n ctx.beginPath();\n backgroundArea.clear();\n ctx.strokeStyle=\"#eee\";\n ctx.lineWidth=1;\n if (!transparentBackground) {\n ctx.fillStyle = \"white\";\n ctx.rect(0, 0, canvasWidth, canvasHeight);\n ctx.fill();\n }\n\n\n var correction=0.5*(ctx.lineWidth%2);\n for (var i = 0 ; i < canvasWidth; i += scale){\n ctx.moveTo(Math.round(i+correction)-correction,0);\n ctx.lineTo(Math.round(i+correction)-correction,canvasHeight);\n }\n for (var j = 0 ; j < canvasHeight; j += scale){\n ctx.moveTo(0,Math.round(j+correction)-correction);\n ctx.lineTo(canvasWidth,Math.round(j+correction)-correction);\n }\n ctx.stroke();\n\n\n return ;\n\n\t// Old Code\n // function drawPixel(x, y, r, g, b, a) {\n // var index = (x + y * canvasWidth) * 4;\n // canvasData.data[index + 0] = r;\n // canvasData.data[index + 1] = g;\n // canvasData.data[index + 2] = b;\n // canvasData.data[index + 3] = a;\n // }\n // if (dots) {\n // var canvasData = ctx.getImageData(0, 0, canvasWidth, canvasHeight);\n\t//\n\t//\n\t//\n // for (var i = 0 + ox; i < canvasWidth; i += scale)\n // for (var j = 0 + oy; j < canvasHeight; j += scale)\n // drawPixel(i, j, 0, 0, 0, 255);\n // ctx.putImageData(canvasData, 0, 0);\n // }\n}", "title": "" }, { "docid": "e6ea9b13d6f0f3561621424b1dcc687d", "score": "0.52987045", "text": "function drawPlanet2(){\n moveTo(240,200);\n penColor(\"#dd8888\");\n dot(33);\n}", "title": "" }, { "docid": "c41b11c55c8bd35190e47cc5533d3ba0", "score": "0.5297002", "text": "function dot(size) {\n if (size == undefined) {\n size = Math.max(turtle.width+4, turtle.width*2);\n }\n imageContext.save();\n centerCoords(imageContext);\n imageContext.beginPath();\n imageContext.fillStyle=turtle.color;\n imageContext.strokeStyle=turtle.color;\n imageContext.arc (turtle.pos.x, turtle.pos.y, size, 0, 2*Math.PI);\n // draw it regardless of pen up or down\n imageContext.stroke();\n imageContext.fill();\n imageContext.restore();\n svgClosePath()\n svgBlob = svgBlob + '<circle cx=\"' + round( turtle.pos.x, svgPrecision) + '\" cy=\"' + round( turtle.pos.y, svgPrecision)\n + '\" r=\"' + round( size, svgPrecision) + '\"'\n + ' style=\"stroke:' + turtle.color + '; stroke-width:' + turtle.width + '; fill:' + turtle.color + '\"/>\\n';\n drawIf();\n}", "title": "" }, { "docid": "39366fdc7fb17888b9bf82bf5629479e", "score": "0.5296583", "text": "function defineJogadorPequeno(){\n tamanhoJogador = 'pequeno';\n jogador.scale.setTo(0.8,0.8);\n}", "title": "" }, { "docid": "11d7d6c02707b5ca28d5c0b1d4103e32", "score": "0.5291483", "text": "toString (p = 4) {\n\t\t\treturn this.x.toPrecision (p) + \" \" + ((this.y > 0) ? \"+\" : \"\") + this.y.toPrecision (p) + \"i\";\n\t\t}", "title": "" }, { "docid": "931d2b6798959c9c9f3d4ef27c8eafbe", "score": "0.52913046", "text": "function addAntidot() {\n dots[1].addDot(p5.mouseX, p5.mouseY, boxes.getBoxID(p5.mouseX, p5.mouseY));\n }", "title": "" }, { "docid": "fd45f26f4ff7214ee7d0cc5fc3c7e489", "score": "0.52910596", "text": "function pausePoint() {\n ellipse(xP*coeffW, yP*coeffH, 8, 8);\n}", "title": "" }, { "docid": "956e2a387d8de830af5441343904ce1b", "score": "0.5284053", "text": "function Dot(Point, radius, fillColor, borderColor, borderWeight, objPaper) {\n this.startPoint = Point;\n this.radius = radius;\n this.border = borderWeight;\n this.borderColor = borderColor;\n this.fillColor = fillColor;\n this.paper = objPaper;\n}", "title": "" }, { "docid": "7479b6dba7bf300f99bb4464d5a12dfb", "score": "0.52839524", "text": "show(){\n noStroke();\n fill('white');\n ellipse(this.x, this.y, this.r * 1.5);\n }", "title": "" }, { "docid": "0525d35b6d8091584bfd4d628d7a6b25", "score": "0.5281775", "text": "function drawElement(element) {\n fill(element.color2)\n ellipse(element.x,element.y, (element.s + element.w),(element.s + element.w))\n fill(element.color1)\n ellipse(element.x, element.y, element.s, element.s)\n fill(255,255,255)\n text(element.id,element.x-5,element.y+5)\n\n}", "title": "" }, { "docid": "8ce544ffe1393447493f98a0c77f4bea", "score": "0.5277619", "text": "function draw() {\n //fill(0);\n \n \n stroke(255);\n strokeWeight(4);\n nofill();\n ellipse(300, 200, 100, 100);\n}", "title": "" }, { "docid": "f3e129305817d9d7248b6daaf1ff3548", "score": "0.52684295", "text": "show(){\n\t\tstrokeWeight(1);\n\t\tfill(50);\n\t\trect(this.x1, this.x2, this.x3, this.x4);\n\t\tstrokeWeight(100);\n\t\tfill(255);\n\t\ttextSize(150);\n\t\ttext(this.floorLevel, width/2-35, 540);\t\n\t }", "title": "" }, { "docid": "9d980e86d4fc421eec118500a1fc0cff", "score": "0.5262815", "text": "function drawDot(ctx,x,y,size) {\n // Select a fill style\n ctx.fillStyle = selectColour;\n\n // Draw a filled circle\n ctx.beginPath();\n ctx.arc(x, y, size, 0, Math.PI*2, true);\n ctx.closePath();\n ctx.fill();\n}", "title": "" }, { "docid": "1ad5ee2ddd691823b61f9c4daf000536", "score": "0.5260192", "text": "function drawPoint(p, color=\"#000000\", mc=undefined) {\r\n\tif(mc == undefined) {\r\n\t\tmc = document.getElementById(SvgContainer);\r\n\t}\r\n\tmc.innerHTML += '<circle fill=\"#ffffff\" stroke=\"'+ color +'\" cx=\"'+ p.x +'\" cy=\"'+ p.y +'\" r=\"1\" />';\r\n}", "title": "" }, { "docid": "620904b04037b632adf13869a7013b60", "score": "0.52497494", "text": "getWidth(d) {\n return 250 + PEM * 1.6;\n }", "title": "" }, { "docid": "88c432a6130ada189bbfa5f67e0bda84", "score": "0.5249614", "text": "function render() {\n\n\t\t// Draw Horizontal Lines\n\t\tp.push();\n\n\t\t\tp.strokeCap(p.ROUND);\n\t\t\tp.stroke(121, 192, 242);\t\t\t\t// Light Blue\n\t\t\tp.translate(p.width/2, p.height/2);\t\t// Translate to center\n\n\t\t\t// Set strokeweight to decrease proportionally to the stretch factor\n\t\t\tvar base_stroke_weight = 3;\n\t\t\tvar stroke_weight = base_stroke_weight - (a_l_de.value * base_stroke_weight);\n\t\t\t\tstroke_weight = p.max(stroke_weight, 0.25);\n\t\t\t\n\t\t\tp.strokeWeight(stroke_weight);\n\n\t\t\tvar spacing = 75;\t\t\t\t\t\t// Set space around Es\n\t\t\t// Mult by -1 for left line\n\t\t\tvar x_1 = a_l_ds.value * (p.width / 2) + spacing; \t// Displacement Start\n\t\t\tvar x_2 = a_l_de.value * (p.width / 2) + spacing;\t\t// Displacement End\n\n\t\t\tp.line(-x_1, 0, -x_2, 0);\t\t// Left Line\n\t\t\tp.line(x_1, 0, x_2, 0);\t\t// Right Line\n\n\t\tp.pop();\n\n\t\t// Assemble Logo!\n\n\t\t// Rotate E\n\t\tp.push();\n\n\t\t\tp.tint(255, 255); // Opacity (255)\n\t\t\t\n\t\t\tp.translate(p.width/2, p.height/2);\n\t\t\tp.rotate(p.radians(a_ed_r.value));\t\t// All rotations must occur here!!!\n\t\t\tp.scale(1,1);\n\n\t\t\t// For Dots\n\t\t\tp.push();\n\n\t\t\t\tp.translate(-41.25,-42.65); \t\t// Center offset\n\t\t\t\tp.scale(0.15,0.15);\n\n\t\t\t\t// Polar Coordinates\n\t\t\t\tvar r = a_d_d.value;\t\t\t\t// Origin Offset \t{start: 300, end: 265}\n\t\t\t\tangle = p.radians(a_d_r.value);\t\t// Angle Offset\t\t{start: 0, end: 77}\n\t\t\t\tx = p.cos(angle) * r;\t\t\t\t// Multiply r * -1 for other Dot\n\t\t\t\ty = p.sin(angle) * r;\n\n\t\t\t\t\t// Top Dot\n\t\t\t\t\tp.push();\n\t\t\t\t\t\tp.scale(1, 1);\n\t\t\t\t\t\t// p.translate(278, 75); \t// Dot final position\n\t\t\t\t\t\tp.translate(x,y);\n\t\t\t\t\t\tp.translate(276,283); \t\t// Center on Es\n\t\t\t\t\t\tp.scale(a_d_s.value, a_d_s.value); \t// Each scale <-- Parametric\n\t\t\t\t\t\tp.image(dot, -50, -50); \t// Center around origin\n\t\t\t\t\t\t// p.ellipse(-1,1,2,2);\t\t// Debugging Center pt\n\t\t\t\t\tp.pop();\n\n\t\t\t\t\t// Bottom Dot\n\t\t\t\t\tp.push();\n\t\t\t\t\t\tp.scale(1, 1);\n\t\t\t\t\t\t// p.translate(175, 593); \t// Dot final position\n\t\t\t\t\t\tp.translate(-x,-y);\n\t\t\t\t\t\tp.translate(276,283); \t\t// Center on Es\n\t\t\t\t\t\tp.scale(a_d_s.value, a_d_s.value); \t// Each scale <-- Parametric\n\t\t\t\t\t\tp.image(dot2, -50, -50); \t// Center around origin\n\t\t\t\t\t\t// p.ellipse(-1,1,2,2);\t\t// Debugging Center pt\n\t\t\t\t\tp.pop();\n\n\t\t\tp.pop();\n\n\t\t\t// For Es\n\t\t\tp.push();\n\n\t\t\t\tp.scale(a_e_s.value, a_e_s.value); \t\t\t\t\t\t// Global scale\n\t\t\t\tp.translate(-41.25,-42.65); \t\t// Center offset\n\t\t\t\tp.scale(0.15,0.15);\n\n\t\t\t\t\n\t\t\t\t// Bottom E\n\t\t\t\tp.image(E, 100, 100);\n\n\t\t\t\t// Top E\n\t\t\t\tp.push();\n\t\t\t\t\tp.translate(200, 0);\n\t\t\t\t\tp.image(E2, 0, 0);\n\t\t\t\tp.pop();\n\n\t\t\tp.pop();\n\n\t\tp.pop();\n\n\t\tp.push();\n\t\t\tp.fill(255);\n\t\t\tp.noStroke();\n\t\t\tp.translate(p.width/2, p.height/2);\n\t\tp.pop();\n\n\t}", "title": "" }, { "docid": "1565279ff5b85cc9a75d8d25b10b5011", "score": "0.52425224", "text": "function drawDot(x, y, r, a){\n ctx.fillStyle = DOTCOLOR;\n\n a1 = -(Math.ceil(a) * PI / 180);\n\n var x1 = (x) + Math.cos(a1) * (r);\n var y1 = (y) + Math.sin(a1) * (r);\n\n ctx.beginPath();\n ctx.globalAlpha = 1;\n ctx.arc(x1, y1, 5, 0, 2*PI);\n ctx.strokeStyle = DOTOUTLINE;\n ctx.lineWidth = CB[1];\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "1565279ff5b85cc9a75d8d25b10b5011", "score": "0.52425224", "text": "function drawDot(x, y, r, a){\n ctx.fillStyle = DOTCOLOR;\n\n a1 = -(Math.ceil(a) * PI / 180);\n\n var x1 = (x) + Math.cos(a1) * (r);\n var y1 = (y) + Math.sin(a1) * (r);\n\n ctx.beginPath();\n ctx.globalAlpha = 1;\n ctx.arc(x1, y1, 5, 0, 2*PI);\n ctx.strokeStyle = DOTOUTLINE;\n ctx.lineWidth = CB[1];\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "1565279ff5b85cc9a75d8d25b10b5011", "score": "0.52425224", "text": "function drawDot(x, y, r, a){\n ctx.fillStyle = DOTCOLOR;\n\n a1 = -(Math.ceil(a) * PI / 180);\n\n var x1 = (x) + Math.cos(a1) * (r);\n var y1 = (y) + Math.sin(a1) * (r);\n\n ctx.beginPath();\n ctx.globalAlpha = 1;\n ctx.arc(x1, y1, 5, 0, 2*PI);\n ctx.strokeStyle = DOTOUTLINE;\n ctx.lineWidth = CB[1];\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "975485dbe555081ddf362d3a571a0313", "score": "0.5241203", "text": "drawSmallBall(){\n if(p>5300 && p<8500){ //p>5300 && p<7000\n fill(\"red\");\n ellipse(this.x, this.y, 30, 30);\n }\n}", "title": "" }, { "docid": "3c5ca755a45460ce03596ce26fcab844", "score": "0.5239612", "text": "function dotOne() {\r\n if (quoteIsLoaded === false) {\r\n $(\".dots\").html(\".<span style='color: orange'>..</span>\");\r\n window.setTimeout(dotTwo, 1000);\r\n }\r\n }", "title": "" }, { "docid": "3cde0f05bbedd3c06d6d2fb2f7b0806a", "score": "0.5239008", "text": "show() {\n push();\n textAlign(CENTER);\n fill(this.fillR, this.fillG, this.fillB);\n textFont(this.font, this.size);\n text(this.line, this.x, this.y);\n pop();\n }", "title": "" }, { "docid": "f059c6dfa6dbe1e52358f172e7f1b119", "score": "0.5238808", "text": "function dot() {\n\n if (display.value.includes('.')) {\n return\n } else {\n display.type = 'text';\n display.value = display.value + '.';\n printThings(display.value);\n }\n}", "title": "" }, { "docid": "66bbe1e3cb2a86fc0d4e0e189fddf89c", "score": "0.5237496", "text": "function showLevel() {\n\n textSize(100);\n fill(255,0,0);\n var levelLife = level;\n text(levelLife,width/10,height/5);\n}", "title": "" }, { "docid": "3878e154e882ef78e5bd139045130f4d", "score": "0.5235667", "text": "function drawDotsLeft(x, y, w, h) {\n\n for (let i = 0; i < NUM_DOTS; i++) {\n let xOff = random() * w;\n let yOff = random() * h;\n rect(x + xOff, y + yOff + (x + xOff) / 2, dotSize, dotSize);\n }\n }", "title": "" }, { "docid": "c36641b882d06c4af4dd81227f455435", "score": "0.5235383", "text": "void display() {\n // Render the ellipse just like in a regular particle\n super.display();\n // Then add a rotating line\n pushMatrix();\n translate(location.x,location.y);\n rotate(theta);\n stroke(255,lifespan);\n line(0,0,25,0);\n popMatrix();\n }", "title": "" }, { "docid": "6385aa12a5cc96b18df0bb7eedac5247", "score": "0.523293", "text": "display2() {\n push();\n translate(this.x, this.y);\n textSize(100);\n textAlign(CENTER);\n textFont(diorFont);\n fill(this.color);\n textLeading((mouseX / width) * 100);\n text(this.dispText, 0,0);\n pop();\n }", "title": "" }, { "docid": "368643728d54054db28ef78d42d06c08", "score": "0.5230902", "text": "getScaleGlyph() {\r\n return `<figure class=\"table-glyph\"><img src=\"images/taxistop.png\" alt=\"Ride has one or more stops\"></figure>`;\r\n }", "title": "" }, { "docid": "76dbc4da1f7a81a14d90238460345e3c", "score": "0.52303094", "text": "function moveDot() {\n // clear canvas to redraw dots\n context.clearRect(0, 0, cWidth, cHeight);\n \n for (i = 0; i < dots.length; i++) {\n // move dot based on object's direction and speed values\n if (dots[i].xMove == '+') {\n dots[i].x += dots[i].speed;\n } else {\n dots[i].x -= dots[i].speed;\n }\n\n if (dots[i].yMove == '+') {\n dots[i].y += dots[i].speed;\n } else {\n dots[i].y -= dots[i].speed;\n }\n \n // redraw dot\n drawDot(dots[i])\n \n // if dot hits edge of screen, reverse it's direction\n if ((dots[i].x + dots[i].radius) >= cWidth) {\n dots[i].xMove = '-';\n }\n\n if ((dots[i].x - dots[i].radius) <= 0) {\n dots[i].xMove = '+';\n }\n\n if ((dots[i].y + dots[i].radius) >= cHeight) {\n dots[i].yMove = '-';\n }\n\n if ((dots[i].y - dots[i].radius) <= 0) {\n dots[i].yMove = '+';\n }\n }\n \n // Render it again\n window.requestAnimationFrame(moveDot);\n }", "title": "" }, { "docid": "293709da55c0e29474a74d9a63bec091", "score": "0.5212989", "text": "function position(dot) {\n dot .attr(\"x\", function(d) { return xScale(x(d)); })\n .attr(\"y\", function(d) { return yScale(y(d)); })\n .style(\"font-size\", function(d) { return fontScale(fontSize(d)) + \"pt\"; })\n .style(\"stroke-opacity\", function(d) { return contourOpacity(d); })\n .text(function (d) { return job_name(d);});\n }", "title": "" }, { "docid": "ff6e38f57290d4ced507665cc2715a2a", "score": "0.52090204", "text": "draw() {\n const ctx = this.checkContext();\n this.setRendered();\n\n ctx.save();\n ctx.setStrokeStyle(this.render_options.color);\n ctx.setFillStyle(this.render_options.color);\n ctx.setFont(this.font.family, this.font.size, this.font.weight);\n\n L('Rendering Pedal Marking');\n\n if (this.style === PedalMarking.Styles.BRACKET || this.style === PedalMarking.Styles.MIXED) {\n ctx.setLineWidth(this.render_options.bracket_line_width);\n this.drawBracketed();\n } else if (this.style === PedalMarking.Styles.TEXT) {\n this.drawText();\n }\n\n ctx.restore();\n }", "title": "" }, { "docid": "8c76226ea63ce1b23514a5208f7f749b", "score": "0.52065116", "text": "function pong() {\nOutput('<span>pong</span></br><span class=\"pong\"><b class=\"left\">|</b><b class=\"right\">|</b></span></br>');\n}", "title": "" }, { "docid": "f806c0c0c07082dd448dc9b899d16c58", "score": "0.5205123", "text": "function drawPedalGlyph(name, context, x, y, point) {\n\t var glyph_data = PedalMarking.GLYPHS[name];\n\t var glyph = new _glyph.Glyph(glyph_data.code, point);\n\t glyph.render(context, x + glyph_data.x_shift, y + glyph_data.y_shift);\n\t}", "title": "" }, { "docid": "6247b4d57cb01d2ce27d446b0f1d72d3", "score": "0.5202012", "text": "function draw(){\n\n// allows for the program to know how much the perlin noise should move\nxoff = xoff + 1;\nxoff2 = xoff2 + 0.5;\n\nlet n = noise(xoff);\nlet n2 = noise(xoff2);\n\n var t = frameCount;\n //where all the ellipses are called\n \t\ttranslate(width / 2, height / 2);\n stroke(255,61,127,30);\n \t\tellipse(sin(t / 100) * 100, cos(t / 100) * 100, 50 * n, 50 *n);\n stroke(255,158,157,30);\n \t\tellipse(sin(t / 100) * 200, cos(t / 100) * 200, 50, 50);\n stroke(127,199,175,30);\n \t\tellipse(sin(t / 100) * 300, cos(t / 100) * 300, 75 * n2, 75 * n2);\n stroke(63,184,175,30);\n \t\tellipse(sin(t / 100) * 400, cos(t / 100) * 400, 50, 50);\n}", "title": "" }, { "docid": "5bc1391cf216993b2b316f6a480308e3", "score": "0.52018297", "text": "function draw(){\n ellipse(20, 20, 30, 30 );\n}", "title": "" }, { "docid": "1f0b1c6d96cbffdd75105116fb9885fc", "score": "0.51861614", "text": "function drawPanda(p){\n\t// Get the x and y of this p\n let [h, pH, v, pV] = gethpHvpV();\n let x = h * width + pH * p;\n let y = v * height + pV * p;\n image(panda, x, y, p, p)\n}", "title": "" }, { "docid": "64600e5c3bcaf2e0d28309a2e2fc0015", "score": "0.51854867", "text": "function write (size, fore, x, y, halign, valign, output)\r\n{\r\n fill (fore);\r\n strokeWeight (0);\r\n textSize (size);\r\n textAlign (halign, valign);\r\n text (output, x, y);\r\n}", "title": "" }, { "docid": "9b00c128584a4186f0a60d9b17362c44", "score": "0.5179757", "text": "function showText(pos, string){\n ctx.fillSyle=\"blue\";\n ctx.textAlign=\"center\"; \n ctx.font=\"30px Georgia\";\n ctx.fillText(string,pos[0],pos[1]);\n}", "title": "" }, { "docid": "aa1dcf70ff3cab5db54c757fa8b6e2c4", "score": "0.51794964", "text": "function floatHPchange(game, x, y, height, text, color, hold, delay) {\n // Find place to spawn text\n color = color || \"#fff\";\n hold = hold || 0;\n delay = delay || 0;\n\n // Create at origin\n var style = { font: \"16px Optima\", fill: color, fontStyle: \"bold\" };\n var text = game.add.text(x, y, text, style).setOrigin(0.5, 0.5);\n text.setStroke(\"#000\", 3);\n text.depth = 50;\n text.alpha = 0;\n\n // Animation\n var timeline = game.tweens.createTimeline();\n timeline.callbacks = { onComplete: { func: () => {\n text.destroy();\n } } };\n\n timeline.add({\n targets: text,\n y: height,\n alpha: 1,\n ease: \"Power2\",\n duration: 1000,\n hold: hold,\n delay: delay,\n });\n\n timeline.add({\n targets: text,\n alpha: 0,\n ease: \"Linear\",\n duration: 300,\n });\n\n timeline.play();\n}", "title": "" }, { "docid": "b811d82a6c22929d127e92d6ba17f2b1", "score": "0.5175713", "text": "static get PAWN() { return 'p'; }", "title": "" } ]
dcb8173f6e2b0244657b4accb3e17720
Get a list of all the files and add it to "filesToPreLoad"
[ { "docid": "817ee138586cf44291bd112d3a35478b", "score": "0.6025689", "text": "function resyncExistingFiles() {\n var watchedFolders = Object.keys(config.roots);\n var roots = [];\n for (var i = 0; i < watchedFolders.length; i++) {\n // match all files in all directories (excludes .hidden dirs by default)\n roots.push(watchedFolders[i] + '/**/*');\n }\n var pattern = roots.join('');\n // can be multiple sets\n if (roots.length > 1) {\n pattern = '{' + roots.join(',') + '}';\n }\n\n glob(pattern, {\n nodir: true\n }, function (err, files) {\n if (err) logit.error('Exception:', err);\n\n if (files.length === 0) {\n logit.info('No files found to resync'.red);\n watchFolders();\n }\n\n // files is an array of filenames.\n for (var x in files) {\n //logit.info(('Adding file: '+files[x]).blueBG);\n addToPreLoadList(files[x], {\n filePath: files[x]\n });\n }\n });\n}", "title": "" } ]
[ { "docid": "cd1b4b77014b0f2af4375806ee600b2e", "score": "0.6663019", "text": "function loadFiles (filesSet) {\n for (var f in filesSet) {\n filesProviders['browser'].set(createNonClashingName(f), filesSet[f].content)\n }\n switchToNextFile()\n }", "title": "" }, { "docid": "27c9ee240f4b1ad727fc58e0a4753fd6", "score": "0.6513624", "text": "function loadFiles() {\n\n var files = fs.readdirSync(UPLOAD_DIRECTORY);\n\n files = _.filter(files, function(file) {\n var parts = file.split('.');\n var fileType = _.last(parts);\n return _.indexOf( SUPPORTED_FILE_TYPES, fileType ) >= 0;\n });\n\n var fileMetaInformation = fileMetaDataStorage.allSync();\n\n var images = _.map( files, function(filename) {\n\n var mimetype = mime.lookup(filename);\n var informationData = fileMetaInformation[filename] || {};\n var stats = fs.statSync(path.join(UPLOAD_DIRECTORY, filename));\n\n return _.extend( informationData, {\n filename: filename,\n thumbnail: getFileTypeThumbnail(mimetype, filename),\n mimetype: mimetype,\n created: stats.ctime,\n size: stats.size\n });\n });\n\n images.sort(function(a, b) {\n return timeService.compareDateTimes(a.created, b.created);\n });\n\n return images;\n}", "title": "" }, { "docid": "73175908ee6ab74ce1f6f713610f924f", "score": "0.647743", "text": "function fileList(){\n\t\tvar fileList = [];\n\t\tfor (var key in files)\n\t\t\tfileList.push(fileMeta(files[key]));\n\t\treturn fileList;\n\t}", "title": "" }, { "docid": "4f150084b9c42a0af459e38a3f23e93c", "score": "0.6409833", "text": "function loadFiles() {\n var fileItemsString = localStorage.getItem(filesKey);\n fileItems = JSON.parse(fileItemsString);\n}", "title": "" }, { "docid": "3a4cb9b23b942edcc3ab94d031196318", "score": "0.63825876", "text": "function onsuccess(files) {\n\ttotal = files.length;\n\tfor (var i = 0; i < total; i++) {\n\t\tif (files[i].isFile) {\n\t\t\tvar deze = files[i].toURI().replace('file://', '');\n\t\t\tvar last = files[i].name.lastIndexOf(\".\");\n\t\t\tvar naam = files[i].name.slice(0, last);\n\t\t\t//console.log(deze);\n\t\t\timgList.push({\n\t\t\t\tName: naam,\n\t\t\t\tURL: deze,\n\t\t\t\tsource: files[i].toURI()\n\t\t\t});\n\t\t}\n\t}\n\tdisplayAndSet();\n\tafterLoad();\n}", "title": "" }, { "docid": "9af47685d1ba97b3ae4d1298ea0adc79", "score": "0.63818955", "text": "function loadSourceFiles() {\n if (sourceFileNamesArr && sourceFileNamesArr.length > 0) {\n console.log('source file names array', sourceFileNamesArr);\n for (var fileName of sourceFileNamesArr) {\n console.log('fileName', fileName);\n $('#file-selector').append($('<option>', {\n value: fileName,\n text: fileName.replace('.json', '')\n }));\n }\n // readFile(); // read first file by default\n } else {\n console.error('no source files detected, please checkout sourceFileNamesArr');\n }\n}", "title": "" }, { "docid": "7f81114ad1c685a43ab71299c3a0079d", "score": "0.63781965", "text": "function list() {\n var end_index = this.f.name.length - 4;\n files[this.f.name.substring(0, end_index)] = deblobify(this.result);\n files_loaded[this.f.name.substring(0, end_index)] = true;\n}", "title": "" }, { "docid": "ad8bd40cbf249843e1ed615ecf0e2375", "score": "0.6283131", "text": "function getFiles() {\n\n var files = [];\n\n try {\n\n files = angular.fromJson(localStorage.PreprosFiles || '[]');\n\n } catch (e) {\n\n window.alert('Error Reading Files ! Reverting to defaults.');\n\n saveFiles([]);\n\n }\n\n return files;\n }", "title": "" }, { "docid": "6e319bbeda6b4dfc4662780317452a48", "score": "0.6222767", "text": "function loadFiles(dataDir) {\n\tvar dir = dataDir || './dataFiles';\n\t// return emptyCollection()\n\treturn listDataFiles(dir);\n}", "title": "" }, { "docid": "228db0a6151969c608942f4121c1d0c3", "score": "0.62131685", "text": "function loadqueue() {\n files.forEach(function(file) {\n q.push(file, function() {});\n });\n}", "title": "" }, { "docid": "3f2795186d470339360d9b2310248e72", "score": "0.6180937", "text": "function getFilesToWatch() {\n return [\n // The current HTML file\n window.location.pathname,\n // Any linked scripts\n ...getTags(\"script\").filter(s => s.src).map(s => s.src),\n // Any linked styles\n ...getTags(\"script\").filter(l => l.rel === \"stylesheet\").map(s => s.href)\n ];\n }", "title": "" }, { "docid": "b3880242debc6f3ddbf5927d5ad496dd", "score": "0.61256576", "text": "loadList (fileList) {\n\n if (fileList.images && fileList.images.length > 0) {\n this.loadImages(fileList.images, this.on_LOADED);\n }\n }", "title": "" }, { "docid": "a992e744b00306ecf26889c74bb78a6c", "score": "0.60580915", "text": "function init() {\n var tag = document.getElementById('bootstrapper'),\n urls = (tag ? tag.getAttribute('data-load').split('|') : []),\n head = document.getElementsByTagName('head')[0];\n\n totalFiles = urls.length;\n\n urls.forEach(function (url) {\n var script = document.createElement('script');\n\n script.type = 'text/javascript';\n script.src = url;\n script.async = false;\n script.onload = function() {\n filesLoaded++;\n\n if (filesLoaded === totalFiles)\n executeQueue();\n };\n\n head.appendChild(script);\n });\n }", "title": "" }, { "docid": "cdd6df2fb25df0c8ff4e1dd07cf73bb4", "score": "0.6054831", "text": "function loadFiles() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var urls = opts.urls,\n _opts$onProgress = opts.onProgress,\n onProgress = _opts$onProgress === undefined ? noop : _opts$onProgress;\n\n (0, _assert2.default)(urls.every(function (url) {\n return typeof url === 'string';\n }), 'loadImages: {urls} must be array of strings');\n var count = 0;\n return Promise.all(urls.map(function (url) {\n url = pathPrefix + url;\n var promise = (0, _browserLoad.loadFile)(Object.assign({ url: url }, opts));\n promise.then(function (file) {\n return onProgress({\n progress: ++count / urls.length,\n count: count,\n total: urls.length,\n url: url\n });\n });\n return promise;\n }));\n}", "title": "" }, { "docid": "c81e82f8ad89284a10ab0a1222f7cd38", "score": "0.60374707", "text": "function loadFiles() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var urls = opts.urls,\n _opts$onProgress = opts.onProgress,\n onProgress = _opts$onProgress === void 0 ? noop : _opts$onProgress;\n Object(_utils_assert__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(urls.every(function (url) {\n return typeof url === 'string';\n }), 'loadImages: {urls} must be array of strings');\n var count = 0;\n return Promise.all(urls.map(function (url) {\n var promise = Object(_browser_load__WEBPACK_IMPORTED_MODULE_2__[\"loadFile\"])(Object.assign({\n url: url\n }, opts));\n promise.then(function (file) {\n return onProgress({\n progress: ++count / urls.length,\n count: count,\n total: urls.length,\n url: url\n });\n });\n return promise;\n }));\n}", "title": "" }, { "docid": "e35803a73d200db768fc75bc8d02c409", "score": "0.5984407", "text": "function collectFiles(bundle, files = new Set()) {\n files.add(bundle.name);\n bundle.childBundles.forEach(child => collectFiles(child, files));\n return files;\n}", "title": "" }, { "docid": "4f0b94a81c1398235177b6d0af098901", "score": "0.59809166", "text": "function loadCSSFiles() {\n const path = 'app/assets/css';\n loadDir(path).forEach(css => {\n if (!css.includes('@')) document.head.insertAdjacentHTML('beforeend', `<link rel=\"stylesheet\" href=\"../assets/css/${css}\"/>`);\n });\n}", "title": "" }, { "docid": "354f7fbf30f5f8c07f275751ab77fa93", "score": "0.5962508", "text": "get fileList() {\r\n return Object.keys(this.files).sort();\r\n }", "title": "" }, { "docid": "6b2f1fa1dfc6a42bfbe7d561ca18aea8", "score": "0.59580547", "text": "function loadFiles() {\n try {\n envelope = fs.readFileSync(__dirname + '/' + soapEnvelopeTemplateFile, 'utf8');\n keyInfo = fs.readFileSync(__dirname + '/' + keyInfoTemplateFile, 'utf8');\n publicKey = fs.readFileSync(__dirname + '/' + config.publicKeyFile, 'utf8');\n publicKeyStripped = publicKey\n .replace('-----BEGIN CERTIFICATE-----','')\n .replace('-----END CERTIFICATE-----','')\n .replace(new RegExp('\\\\n', 'g'),'');\n privateKey = fs.readFileSync(__dirname + '/' + config.privateKeyFile, 'utf8');\n } catch (e) {\n console.error(e.message);\n }\n\n if (util.setReady(isReady, 'loadFiles')) {\n // Send module 'ready' event to parent (sync file reads seem to require the timeout)\n setTimeout(function () {\n module.exports.emit('ready')\n });\n }\n}", "title": "" }, { "docid": "94eda924895a0cef6ed87d4cdc71bb38", "score": "0.59531087", "text": "function preloader() {\r\n const imagesPaths = [\r\n \"./img/hydro.jpg\",\r\n \"./img/wind.jpg\",\r\n \"./img/solar.jpg\"\r\n ];\r\n const images = [];\r\n for (let i = 0; i < imagesPaths.length; i++) {\r\n images[i] = new Image();\r\n images[i].src = imagesPaths[i];\r\n }\r\n\r\n // Images ready to be used:\r\n console.log(`Preloaded images:\\n\\t${images[0].src}\\n\\t${images[1].src}\\n\\t${images[2].src}`);\r\n}", "title": "" }, { "docid": "839c4d7ebca6d64f875e6af139685441", "score": "0.5935508", "text": "function listRequiredFiles (mainPath, options) {\n var sources = {};\n var history = {\n requiredFiles: [],\n overrides: null\n };\n return doListRequiredFiles(mainPath, sources, options, history).then(function (files) {\n return {\n files: files,\n sources: sources\n };\n });\n}", "title": "" }, { "docid": "aeffd232e6dfe170b1e50bd53ffe2310", "score": "0.59296066", "text": "function loadFiles(data) {\n currentView = currentView || 'grid';\n directory_files_array = data;\n showFiles();\n }", "title": "" }, { "docid": "8fdb441dfe85c3fe3f17f39688ebd9e9", "score": "0.5920053", "text": "function processFiles() {\n\t\t// Make sure the DataStore is ready before we continue\n\t\tif (DataStore.isReady()) {\n\t\t\t// Resolve the glob to individual files\n\t\t\tglob(argv.files, function(er, files) {\n\t\t\t\tif (er != null) {\n\t\t\t\t\tlogMessage(er, 'processFiles');\n\t\t\t\t} else if (files.length === 0) {\n\t\t\t\t\tlogMessage('No files matching the critria were found', 'processFiles');\n\t\t\t\t} else {\n\t\t\t\t\t// Log the resolved files from the glob\n\t\t\t\t\tlogMessage(files, 'processFiles');\n\t\t\t\t\t// Set the call count, this will be decreased once each file\n\t\t\t\t\t// has been processed or was unable to load\n\t\t\t\t\tcallCount = files.length;\n\t\t\t\t\t// Loop over all the files and load each and every one\n\t\t\t\t\tfor (var index = 0, ubound = files.length; index < ubound; index++) {\n\t\t\t\t\t\tloadFile(files[index]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tlogMessage('DataStore not ready!', 'processFiles');\n\t\t}\n\t}", "title": "" }, { "docid": "c9883e680c0b30129f3b81efcc472c5b", "score": "0.59133613", "text": "function preload() {\n data[1] = loadStrings('data/data1.txt');\n data[2] = loadStrings('data/data2.txt');\n data[3] = loadStrings('data/data3.txt');\n data[4] = loadStrings('data/data4.txt');\n data[5] = loadStrings('data/data5.txt');\n}", "title": "" }, { "docid": "d055fe8c68e807f49fe55d2350b285aa", "score": "0.5909643", "text": "function GetFilesList()\n{\n\t//List files in this project.\n\tvar progPath = appPath+\"/\"+curProgram;\n\tvar pattern = \"(?!~.*)(.*\\.js|.*\\.html|.*\\.txt|.*\\.css|.*\\.json)\";\n\tvar list = app.ListFolder( progPath,pattern,0,\"alphasort,regex,files\");\n\n\t//Put main file to front of list.\n\tif( curProgTitle )\n\t{\n\t\tvar idx = list.indexOf( curProgTitle );\n\t\tlist.splice(idx, 1);\n\t\tlist.unshift( curProgTitle );\n\t}\n\treturn list;\n}", "title": "" }, { "docid": "3677f18311bf9c0d4896965925b8a425", "score": "0.5894353", "text": "function loadFiles(fileElementID = \"files\") {\n // Ask the worker thread to load these files... \n // I can already feel this not working...\n let files = document.getElementById(fileElementID).files;\n cascadeStudioWorker.postMessage({\n \"type\": \"loadFiles\",\n \"payload\": files\n });\n\n // Receive a list of the imported files\n messageHandlers[\"loadFiles\"] = (extFiles) => {\n console.log(\"Storing loaded files!\");\n //console.log(extFiles);\n consoleGolden.setState(extFiles);\n };\n}", "title": "" }, { "docid": "17b5eb6dfa83b81799382c9ad5ae0c41", "score": "0.58871126", "text": "function loadFilesInOrder(){\n var files = arguments;\n var loadPromise = null;\n\n return [].reduce.call(\n files,\n function(chainedPromise, fname){\n return chainedPromise.then(function(){\n return loadjscssfile(fname);\n });\n },\n // stub start promise\n Promise.resolve(true)\n );\n}", "title": "" }, { "docid": "4ee1497e959d2d070de2cd6830561e64", "score": "0.5879104", "text": "function loadFiles (urls, params) {\n urls = angular.isArray(urls) ? urls : [urls];\n var promises = [];\n angular.forEach(urls, function (url) {\n promises.push(loadFilePath(url, params));\n });\n return $q.all(promises);\n }", "title": "" }, { "docid": "72ff6dbdc4e426cca53f37b01d0d603b", "score": "0.5852629", "text": "function addEntryFiles(scriptsPath, paths, files) {\n if(!!files) {\n return paths.concat(files);\n }\n return paths;\n }", "title": "" }, { "docid": "d2836f91972c83b5706d7ae324e287a7", "score": "0.5844895", "text": "function refreshFileList() {\n getFiles()\n .then(drinks => {\n \n window.fileList = drinks;\n \n const html = renderFiles(drinks);\n $('#list-container').html(html);\n });\n}", "title": "" }, { "docid": "b0c47620b9099fe441bc16eecdae700d", "score": "0.5831031", "text": "function listFiles(autoCallback, data){\r\n fs.readdir(sourceDir, function(error, files){\r\n if(error){\r\n autoCallback(error);\r\n } \r\n else {\r\n var filtered = [];\r\n for(var i = 0; i < files.length; i++){\r\n if(files[i].indexOf('.geojson') !== -1) {\r\n filtered.push(files[i]);\r\n }\r\n }\r\n autoCallback(null, filtered);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "cbc33a77a4b76217791cd3dc871a7383", "score": "0.5830523", "text": "function getAssetFiles() {\n return dir.files('./public/asset-injections', { sync: true });\n}", "title": "" }, { "docid": "bb8ce1cc4fe8be61fee8b5417042306b", "score": "0.58273745", "text": "loadInternalModuleFiles(extraModulesList, basedir) {\n const extraModules = {};\n if (extraModulesList) {\n Object.keys(extraModulesList).forEach(moduleName => {\n try {\n this.logger.debug('loading File %s', extraModulesList[moduleName]);\n extraModules[moduleName] =\n require(path.join(basedir, extraModulesList[moduleName]));\n }\n catch (e) {\n this.logger.error('Could not load internal file %s of module %s. Error: %s', path.join(basedir, extraModulesList[moduleName]), this.moduleName, e.message);\n }\n });\n }\n return extraModules;\n }", "title": "" }, { "docid": "c61f3a1a4ab1f0a642224512c15c9431", "score": "0.5825094", "text": "function loadFiles(filePaths) {\n var result = [];\n R.forEach(function(i) {\n try {\n result = result.concat(fs.readFileSync(i).toString());\n } catch (e) {\n throw new Error(e.message + \":\" + i);\n };\n }, filePaths);\n return result;\n}", "title": "" }, { "docid": "d4d58edc6a9b1e5118ac35d81a232d29", "score": "0.5822427", "text": "getDataFiles() {\n var dataFiles, error, file, key, results;\n dataFiles = {\n 'yolo_config': 'configData',\n 'yolo_defaults': 'defaults'\n };\n results = [];\n for (file in dataFiles) {\n key = dataFiles[file];\n try {\n results.push(this[key] = require(this.getDataPath(file)));\n } catch (error1) {\n error = error1;\n this.initDatabase();\n results.push(this.overwriteJson(file, this[key]));\n }\n }\n return results;\n }", "title": "" }, { "docid": "632e2a15647be723b517da17d9b879ad", "score": "0.58065355", "text": "function GruntFilesArray ()\n{}", "title": "" }, { "docid": "82b80ee25d0daa5e621e585786e462f9", "score": "0.579305", "text": "function loadFiles() {\n\t\t// logger.trace('inside loadFiles()');\n\t\tvar allfiles = findFiles( rootpath, [ '**/*.js', '**/*.json' ] );\n\t\t// logger.debug(JSON.stringify(allfiles, null, 2));\n\n\t\t_.forEach( allfiles, function( filepath ) {\n\t\t\tregistry.files.push( filepath );\n\t\t} );\n\n\t\tvar packagepaths = _.filter( allfiles, function( filepath ) {\n\t\t\treturn( /.+(package\\.json)/.test( filepath ) );\n\t\t} );\n\t\t_.forEach( packagepaths, function( filepath ) {\n\t\t\tvar content = fs.readFileSync( path.posix.join( rootpath, filepath ), 'utf8' );\n\t\t\tvar json = JSON.parse( content );\n\t\t\tif( json.main ) {\n\t\t\t\tregistry.directories.push( {\n\t\t\t\t\tid: path.posix.dirname( filepath ),\n\t\t\t\t\tpath: path.posix.resolve( path.posix.join( path.posix.dirname( filepath ), json.main ) )\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tvar indexpaths = _.filter( allfiles, function( filepath ) {\n\t\t\treturn( /.+(index\\.js)/.test( filepath ) );\n\t\t} );\n\n\t\t_.forEach( indexpaths, function( filepath ) {\n\t\t\tvar existingdir = _.find( registry.directories, function( dir ) {\n\t\t\t\treturn dir.id === path.posix.dirname( filepath );\n\t\t\t} );\n\t\t\tif( !existingdir ) {\n\t\t\t\tregistry.directories.push( {\n\t\t\t\t\tid: path.posix.dirname( filepath ),\n\t\t\t\t\tpath: filepath\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn registry;\n\t}", "title": "" }, { "docid": "e542c4c2bc564e8228fe9b39d063d2ab", "score": "0.57912326", "text": "function loadFiles (files) {\n\n let { pdfNames, annoNames } = getContents(files)\n\n return new Promise((resolve, reject) => {\n\n let promises = []\n\n // Load pdfs.\n let p = pdfNames.map(file => {\n return new Promise((resolve, reject) => {\n\n let fileReader = new FileReader()\n fileReader.onload = event => {\n\n resolve({\n type : 'content',\n name : _excludeBaseDirName(file.webkitRelativePath),\n content : event.target.result\n })\n\n }\n fileReader.readAsArrayBuffer(file)\n })\n })\n promises = promises.concat(p)\n\n // Load annos.\n p = annoNames.map(file => {\n return new Promise((resolve, reject) => {\n let fileReader = new FileReader()\n fileReader.onload = event => {\n\n resolve({\n type : 'anno',\n name : _excludeBaseDirName(file.webkitRelativePath),\n content : event.target.result\n })\n }\n fileReader.readAsText(file)\n })\n })\n promises = promises.concat(p)\n\n // Wait for complete.\n Promise.all(promises).then(results => {\n\n const contents = results.filter(r => r.type === 'content')\n const annos = results.filter(r => r.type === 'anno')\n\n resolve({ contents, annos })\n })\n\n })\n}", "title": "" }, { "docid": "aee9382c29e22f78450ad83019d3db17", "score": "0.5780047", "text": "function modulesToLoad() {\n return list;\n}", "title": "" }, { "docid": "eee81f6196233b3802fe58239bd2f84a", "score": "0.5773513", "text": "async requirePreloads() {\n this.preloads\n .filter((node) => {\n if (!node.environment || this.environment === 'unknown') {\n return true;\n }\n return node.environment.indexOf(this.environment) > -1;\n })\n .forEach((node) => {\n this.profiler.profile('file:preload', node, () => {\n this.logger.trace(node, 'file:preload');\n this.resolveModule(node.file, (error) => {\n if (!node.optional) {\n throw error;\n }\n });\n });\n });\n }", "title": "" }, { "docid": "afd9e82d385a6826a0a8e27d1d513c09", "score": "0.57686865", "text": "function preCache() {\n var options = expiry.options\n , dir = Array.isArray(options.dir) ? options.dir : [options.dir]\n , callback = (typeof options.loadCache === 'object' && \n typeof options.loadCache.callback !== 'function') ? \n options.loadCache.callback : false;\n\n dir.forEach(function (dir) {\n findit.sync(dir, {}, function(file, stat) {\n if (stat.isFile() && (!callback || callback(file, stat))) {\n var urlCacheKey = file.substr(dir.length);\n if (!expiry.urlCache[urlCacheKey]) {\n expiry.urlCache[urlCacheKey] = fingerprintAssetUrl(urlCacheKey);\n }\n }\n });\n });\n}", "title": "" }, { "docid": "f3b4979b69794edd744ac63935ec606a", "score": "0.5768597", "text": "function packageFiles (callback) {\n var ret = {}\n var files = filesProviders['browser']\n var filtered = Object.keys(files.list()).filter(function (path) { if (!files.isReadOnly(path)) { return path } })\n async.eachSeries(filtered, function (path, cb) {\n ret[path.replace(files.type + '/', '')] = { content: files.get(path) }\n cb()\n }, () => {\n callback(null, ret)\n })\n }", "title": "" }, { "docid": "dfa3595e6c749257b7f0aecaa8e5bdcb", "score": "0.5767272", "text": "function getResourcesList() {\n try {\n let rootDir = './extensions/';\n var paths = fs.readdirSync(rootDir);\n let resources = [];\n paths.forEach((path)=>{\n if(!fs.lstatSync(rootDir+path).isDirectory()) return;\n if(fs.existsSync(rootDir+path+'/resource/__resource.lua')){\n resources.push(path)\n }\n });\n\n return resources;\n } catch (error) {\n throw new Error(`[getResourcesList] Error resetting [txAdmin-cache] folder: ${error.message}`);\n }\n}", "title": "" }, { "docid": "ce9a989da27db5471bdbaa6d2a75482c", "score": "0.5763008", "text": "function fillFileQueue(files) {\n queuedFiles = [];\n fileList = files; //storing the original browsers FileList object.\n for (var file in files) {\n if (files.hasOwnProperty(file) && typeof(files[file]) === 'object') {\n queuedFiles.push(files[file]);\n }\n }\n return queuedFiles;\n }", "title": "" }, { "docid": "dea6afc6e497d3155c8428212e1cce1b", "score": "0.5745518", "text": "function loadScripts(\n localDirectory = null,\n scriptList = null,\n label = null\n)\n{\n var queue = scriptList.map(\n function (script) {\n var url = '/assets/js/' + localDirectory + script;\n\n consoleInfoWithModeFlag(label + \" :: \" + url);\n\n return $.getScript(url)\n .done(\n function (data, textStatus, jqxhr) {\n consoleLogWithModeFlag(label + \" LOADED :: \" + this.url);\n }\n )\n .fail(\n function (jqxhr, settings, exception) {\n consoleErrorWithModeFlag(\"*** FAILED LOADING FEATURE :: \" + this.url + \" (\" + exception + \")\");\n }\n );\n }\n );\n\n return queue;\n}", "title": "" }, { "docid": "b4114724cf9ffaf759f987131a24cac7", "score": "0.5743255", "text": "function preloadResources(urls) {\n\tvar request = new XMLHttpRequest();\n\tfor (i=0; i<urls.length; i++) {\n\t\trequest.open(\"GET\", urls[i], true);\n\t\trequest.send(null);\t\n\t}\n}", "title": "" }, { "docid": "79d33998d24cc4e0b3f7ea1840eabf56", "score": "0.5741123", "text": "function loadFiles(files) {\n\n let { pdfNames, annoNames } = getContents(files);\n\n return new Promise((resolve, reject) => {\n\n let promises = [];\n\n // Load pdfs.\n let p = pdfNames.map(file => {\n return new Promise((resolve, reject) => {\n\n let fileReader = new FileReader();\n fileReader.onload = event => {\n\n resolve({\n type : 'content',\n name : _excludeBaseDirName(file.webkitRelativePath),\n content : event.target.result\n });\n\n }\n fileReader.readAsArrayBuffer(file);\n });\n });\n promises = promises.concat(p);\n\n // Load annos.\n p = annoNames.map(file => {\n return new Promise((resolve, reject) => {\n let fileReader = new FileReader();\n fileReader.onload = event => {\n\n resolve({\n type : 'anno',\n name : _excludeBaseDirName(file.webkitRelativePath),\n content : event.target.result\n });\n }\n fileReader.readAsText(file);\n });\n });\n promises = promises.concat(p);\n\n // Wait for complete.\n Promise.all(promises).then(results => {\n\n const contents = results.filter(r => r.type === 'content');\n const annos = results.filter(r => r.type === 'anno');\n\n resolve({ contents, annos });\n });\n\n });\n}", "title": "" }, { "docid": "a0b42bcac7598e939d2d820711ed9fa2", "score": "0.5734287", "text": "async function additionalFilesAddFiles() {\r\n let files = await eel.ask_files()();\r\n for (file of files) {\r\n additionalFilesAdd(file, '.');\r\n }\r\n}", "title": "" }, { "docid": "381ed8d09fc3f5be36327d400fcb430b", "score": "0.5731957", "text": "preload() {\n\n //Make sure that there is at least 1 file in the queue before loading\n if (this.queue.length > 0) {\n\n //Make the loader not usable\n this.canUse = false;\n\n\n\n //Next load state\n this.load();\n\n }\n\n }", "title": "" }, { "docid": "3e6acc3d6a4fb8b8d91067df3df852ff", "score": "0.5730858", "text": "function preloadImages() {\n for (i = 0; i < preloadImages.arguments.length; i++) {\n preloadedImages[i] = new Image()\n preloadedImages[i].src = preloadImages.arguments[i]\n }\n }", "title": "" }, { "docid": "07b2eb5627575f62a1fb83adbb735fdb", "score": "0.57261294", "text": "preload() {\n const imgPromises = this.images.map(img =>\n preloadImage(img.getAttribute('src')),\n );\n return Promise.all(imgPromises);\n }", "title": "" }, { "docid": "9c432dbe9eb53f54782413a2caaf85ce", "score": "0.5714494", "text": "getAll(){ \n readFiles();\n }", "title": "" }, { "docid": "5a07470df59d689db1b72bfa7fafae01", "score": "0.5698073", "text": "function loadAllFilesInAllProjectDirs() {\n return __awaiter(this, void 0, Promise, function* () {\n let projectDirs = atom.project.getDirectories();\n let projectDirsContents = [];\n for (let dir of projectDirs) {\n // separate file set for each project dir\n let pathsAndContents = yield loadAllFilesInProjectDir(dir);\n projectDirsContents.push(pathsAndContents);\n }\n return projectDirsContents;\n });\n}", "title": "" }, { "docid": "3968b6811ac698cc879e70e25f9d3808", "score": "0.5680844", "text": "get list() {\n\t\tlet list=[];\n\t\tfor(let k in this.loaded) {\n\t\t\tlist.push(this.loaded[k]);\n\t\t}\n\t\treturn list;\n\t}", "title": "" }, { "docid": "5d26fac271a1c2744a759d2c64561f18", "score": "0.56734574", "text": "function loadAll() {\n\treadLogFile(true);\n\tloadSuggestions();\n}", "title": "" }, { "docid": "ba0fe562058a7e74aa45b5024092b96c", "score": "0.56680375", "text": "async _getPayloads () {\n return (await readdir(this._path, { withFileTypes: true }))\n .filter(f => f.isFile() && filenameRe.test(f.name))\n .map(f => join(this._path, f.name))\n .sort()\n }", "title": "" }, { "docid": "c95d9f9f6c7a00530e6f72a917ab6a0a", "score": "0.5666962", "text": "function refreshFileList() {\n const template = $('#list-template').html();\n const compiledTemplate = Handlebars.compile(template);\n\n getFiles()\n .then(files => {\n\n window.fileList = files;\n\n const data = {files: files};\n const html = compiledTemplate(data);\n $('#list-container').html(html);\n })\n}", "title": "" }, { "docid": "316066f2f54aaa6ad111e53c3b811f25", "score": "0.5658039", "text": "function page_all_files() {\n var ret = '<h1>All files</h1>';\n ret += '<ul>';\n ret += $.map(all_files, function(file) {\n return \"<li><a href='\" + file + \"'>\" + file + '</a></li>';\n }).join('');\n ret += '</ul>';\n return ret;\n}", "title": "" }, { "docid": "4a200f6b571c426af67ab303867bedc2", "score": "0.5656311", "text": "function autoloadall(){\n\tvar files, types, callback;\n\n\tif(arguments.length === 2){\n\t\tfiles = arguments[0];\n\t\tcallback = arguments[1];\n\t\ttypes = files.map(function(file){ return null;});\n\t} else if(arguments.length === 3) {\n\t\tfiles = arguments[0];\n\t\ttypes = arguments[1];\n\t\tcallback = arguments[2];\n\t}\n\n\tif(files.length !== types.length) return callback(new Error(\"Arrays of files and types must be same length.\"));\n\n\tvar tuples = Array(files.length);\n\tfor(var i = 0; i < tuples.length; i++){\n\t\ttuples[i] = [files[i], types[i]];\n\t}\n\n\tasyncMap(tuples, loadhelper, callback);\n}", "title": "" }, { "docid": "bfedf0012108ac58534c1dc9888f33c4", "score": "0.56559104", "text": "async function getFileList(dir) {\n return new Promise(function (resolve, reject) {\n //for all files in the event folder\n fs.readdir(dir, (err, files) => {\n if (err) return console.error(err);\n\n //filter out any non-js files\n let jsFiles = files.filter(f => f.split(\".\").pop() === \"js\");\n if (jsFiles.length <= 0) {\n console.log(\"There are no events to load...\");\n return resolve([]);\n }\n\n //load all file names\n let list = [];\n jsFiles.forEach((fileName, i) => {\n list.push(fileName.replace(/\\.js$/, ''));\n });\n resolve(list);\n });\n })\n}", "title": "" }, { "docid": "6ebbe7e8326ec68c23d6dc36feefb392", "score": "0.5653042", "text": "function prepareLoad(event)\n {\n console.log(' event fired'+event.target.files[0].name);\n files=event.target.files;\n }", "title": "" }, { "docid": "8d0e1aafed2e94716b72f9e583f460c2", "score": "0.5652206", "text": "function files(){\n\n}", "title": "" }, { "docid": "9b62880e2d43ee6ff7df1e68e8784da1", "score": "0.56449866", "text": "static getFileSet (dist) {\n var fileset = [];\n file.walkSync(dist, (dirPath, dirs, files) => {\n let fset = files.map(f => dirPath + '/' + f);\n fileset = fileset.concat(fset);\n });\n return fileset;\n }", "title": "" }, { "docid": "dd36ed0d95a128b79fb566f293dcea3d", "score": "0.5642629", "text": "getFileList(){\n\t\tthis.showSpinner=true;\n\t\tif(this.documentIds.length==0){\n\t\t\tthis.files=[];\n\t\t\tthis.notifyDocumentChange();\n\t\t\treturn;\n\t\t}\n\t\tgetFilesByDocumentIds({documentIds:this.documentIds})\n\t\t.then(result=>{\n\t\t\tthis.files = result;\n\t\t\tthis.showSpinner=false;\n\t\t\tthis.notifyDocumentChange();\n\t\t})\n\t\t.catch(error=>{\n\t\t\tthis.showSpinner=false;\n\t\t\tconsole.error('Error in feteching files for the record '+this.recordId+ ': '+JSON.stringify(error));\n\t\t});\n\t}", "title": "" }, { "docid": "b4b775dc4d72835ed4fe75649aeec08c", "score": "0.5641671", "text": "load() {\n this.parent.loader.add('data', 'assets', {\n type: 'getAllAssets'\n });\n this.parent.loader.add('data', 'initAssetLayerTypes', {\n type: 'getAssetsType'\n });\n }", "title": "" }, { "docid": "7c3ddbfab2bcd61cc279b2581aada606", "score": "0.56176096", "text": "function preloadmedia() {\n\timgs = []\n\taudios = []\n\tresources = []\n\tfor (i = 0; i < exp.current_exp_list.length; i++) {\n\t\timgs.push('static/imgs/' + exp.current_exp_list[i].img_left);\n\t\timgs.push('static/imgs/' + exp.current_exp_list[i].img_right);\n\t\taudios.push('static/audio/' + exp.current_exp_list[i].audio);\n\t}\n\tpreload(imgs);\n\tpreload(audios);\n\n}", "title": "" }, { "docid": "5267c260c76251b9f89d83082c4bab8b", "score": "0.5613042", "text": "function SetFilesNeeded( needed ) {}", "title": "" }, { "docid": "e6c2d8d4b9e1c0da56bcacb35475c8a2", "score": "0.56101686", "text": "function getFileList() {\r\n var xhr = new XMLHttpRequest;\r\n xhr.open('GET', apiRoot + \"/logs\");\r\n xhr.onload = updateFileList;\r\n xhr.send();\r\n }", "title": "" }, { "docid": "ed7113483e4dcb34f7f2e4b078568993", "score": "0.56058353", "text": "function insertAllFiles() {\n fileKeys = [];\n var $popup = editor.popups.get('filesManager.insert');\n\n function insertMapElements(el, index, map) {\n if (el.children['target'].checked) {\n fileKeys.push(parseInt(el.id.split('-').pop()));\n\n if (isImage(file_list_values.get(parseInt(el.id.split('-').pop())).type) && imageEditIndex == -1) {\n imageEditIndex = index;\n }\n }\n }\n\n imageEditIndex = -1;\n editImageValue = null;\n $popup.find('.fr-insert-checkbox').toArray().forEach(insertMapElements);\n insertFiles(fileKeys);\n checkInsertAllState();\n }", "title": "" }, { "docid": "c30dc71dcd729c4afed94057e0559f5c", "score": "0.55959314", "text": "function loadImageList () {\n var data = fs.readFileSync('photoList.json');\n if (! data) {\n\t console.log(\"cannot read photoList.json\");\n } else {\n\t listObj = JSON.parse(data);\n\t imgList = listObj.photoURLs;\n }\n}", "title": "" }, { "docid": "9d12ba19424e149d125f3530dac1e4cc", "score": "0.55928624", "text": "function loadJSXFiles(pFolderPath) {\n var extensionRoot = csInterface.getSystemPath(SystemPath.EXTENSION) + pFolderPath;\n csInterface.evalScript('$._ext.evalFiles(\"' + extensionRoot + '\")');\n }", "title": "" }, { "docid": "8f13d278735f5b1bb397cd29e20f6a90", "score": "0.5586203", "text": "function loadScripts() {\n\tvar files = glob.sync(path.join(__dirname, 'main/*.js'));\n\tfiles.forEach(function(file) {\n console.log('loaded '+ file);\n\t\trequire(file);\n\t});\n}", "title": "" }, { "docid": "9e7776f2187f9ab95097d86e0d99c7c0", "score": "0.5586106", "text": "function loadFiles() {\n var selector = document.querySelector('#meshFile');\n var files = selector.files;\n var count = 0;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n if (file.name.indexOf('.stl') !== -1) {\n count++;\n loadStlFile(file);\n } else if (file.name.indexOf('.dcm') !== -1) {\n count++;\n loadDcmFile(file);\n } else {\n console.log('Unknown file', file);\n }\n }\n initMain(count);\n}", "title": "" }, { "docid": "6ee1877b52a0bbd15ad07de82750e7de", "score": "0.5578499", "text": "function loadContent(files) {\n let contents = [];\n if (files) {\n files.forEach(item => contents.push(JSON.parse(fs.readFileSync(item))));\n }\n return contents\n}", "title": "" }, { "docid": "ad2c824eed9513dc9f62accc43502bdb", "score": "0.5573411", "text": "static getStoredFiles( ext ){\n return fs.readdirSync( \".\" )\n .filter( (file) => fs.statSync( file ).isFile()\n && file.endsWith( ext ) ) || [ ];\n }", "title": "" }, { "docid": "35f9325e5d1603808ea62350a6247df9", "score": "0.5567567", "text": "function preload(gpath, type) {\n glob.sync(gpath).forEach(function(file) {\n walk(file, type, null, require);\n });\n}", "title": "" }, { "docid": "568d7966b14a90294116c864a015f4cd", "score": "0.55647844", "text": "getFiles() {\n const {\n files\n } = this.getState();\n return Object.values(files);\n }", "title": "" }, { "docid": "d487df1bb6e1b4b7fbd0875ac400fb57", "score": "0.5562462", "text": "function renderFileList(files) {\n\tfiles.forEach((file) => {\n\t\taddFile(file, \"PROCESSED.\");\n\t});\n}", "title": "" }, { "docid": "83a744469dcaf8011878d17dca461618", "score": "0.55511844", "text": "function getAllFiles(e) {\n\n // Checking total length of files selected for processing\n var totalFiles = e.target.files.length;\n if (totalFiles.length > MAX_UPLOAD_LIMIT) {\n alertPopup(\"Only \" + MAX_UPLOAD_LIMIT + \" files can be added at a time !\", \"alert\", \"\");\n if (location.href.indexOf(\"processor\") === -1)\n window.location.href = BASE_URL + \"add-subtitles.php\";\n return;\n }\n\n // Checking total length of already added files and newly selected files for processing\n if (localStorage.getItem(\"files\") !== null) {\n var alreadyStoredFiles = JSON.parse(localStorage.getItem(\"files\")).length;\n if ((alreadyStoredFiles + totalFiles) > MAX_UPLOAD_LIMIT) {\n alertPopup(\"Only \" + (MAX_UPLOAD_LIMIT - alreadyStoredFiles) + \" more file(s) can be added !<br />Delete some files from list to add more.\", \"alert\", \"\");\n if (location.href.indexOf(\"processor\") === -1)\n window.location.href = BASE_URL + \"add-subtitles.php\";\n return;\n }\n }\n\n // Getting already stored files reference\n if (localStorage.getItem(\"files\") !== null) {\n alreadyAvailableFiles = JSON.parse(localStorage.getItem(\"files\"));\n }\n\n // Iterating over all selected files for processing\n for (var i = 0; i < totalFiles; i++) {\n if (i === (totalFiles - 1))\n extractFileContents(e.target.files[i], true)\n else\n extractFileContents(e.target.files[i], false)\n }\n}", "title": "" }, { "docid": "46e24235ee9005da1d497cdb7db21daf", "score": "0.55455244", "text": "function fillPreloads() {\n\n\tif( !$( '#lf-preload' ).length ) {\n\t\treturn;\n\t}\n\n\t$( '#lf-preload' ).attr( 'style', 'display: block' );\n\n\t$.get( wgScript, { title: 'Template:Stdpreloads', action: 'raw', ctype: 'text/plain' } ).done( function( data ) {\n\t\tvar\t$preloadOptionsList,\n\t\t\tlines = data.split( '\\n' );\n\n\t\t$preloadOptionsList = $( '<select />' ).attr( 'id', 'stdSummaries' ).change( function() {\n\t\t\tvar templateName = $( this ).val();\n\t\t\tif ( templateName !== '' ) {\n\t\t\t\ttemplateName = 'Template:' + templateName + '/preload';\n\t\t\t\ttemplateName = templateName.replace( ' ', '_' );\n\t\t\t\t$.get( wgScript, { title: templateName, action: 'raw', ctype: 'text/plain' } ).done( function( data ) {\n\t\t\t\t\tif ($('.CodeMirror').length > 0) {\n\t\t\t\t\t\tWikiEditorCodeMirror.doc.replaceSelection(data);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tinsertAtCursor( document.getElementById( 'wpTextbox1' ), data );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tfor ( var i = 0; i < lines.length; i++ ) {\n\t\t\tvar templateText = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : '';\n\t\t\t$preloadOptionsList.append( $( '<option>' ).val( templateText ).text( lines[i] ) );\n\t\t}\n\n\t\t$( '#lf-preload-cbox' ).html( $preloadOptionsList );\n\t} );\n\n\t$( '#lf-preload-pagename' ).html( '<input type=\"text\" class=\"textbox\" />' );\n\t$( '#lf-preload-button' ).html( '<input type=\"button\" class=\"button\" value=\"Insert\" onclick=\"doCustomPreload()\" />' );\n\n}", "title": "" }, { "docid": "f85e6f9f307a0080c5dd7416b2f72e4e", "score": "0.55442786", "text": "function refreshFileEntry() {\n getFiles()\n .then(files => {\n window.fileList = files;\n })\n\n .done(function() { \n $('.entry-wrapper').load(' .art-entry');\n })\n}", "title": "" }, { "docid": "848c3ef7211136027877dfdbdc0a4fad", "score": "0.5544018", "text": "function preload(){\n table = loadTable('csv/weibo.csv', 'csv', 'header');\n tfm = loadImage('image/tfm.PNG');\n t = loadImage('image/t.png');\n c = loadImage('image/c.png');\n m = loadImage('image/m.png');\n line = loadImage('image/line.png');\n\n //load the new mood and content files\n contentList = loadStrings(\"content.txt\");\n moodList = loadStrings(\"mood.txt\");\n}", "title": "" }, { "docid": "6a5f43324dbedeaa0414d2b29918577f", "score": "0.5543183", "text": "get fileTypes() {\n return this._fileTypes.slice();\n }", "title": "" }, { "docid": "6a5f43324dbedeaa0414d2b29918577f", "score": "0.5543183", "text": "get fileTypes() {\n return this._fileTypes.slice();\n }", "title": "" }, { "docid": "47074515f93d5343e37d363648e2e170", "score": "0.55330664", "text": "function preload(){\n //lessonDirectory15 = loadJSON('json/directory15.json');\n lessonDirectory15 = loadJSON('json/directory15.json', ()=>{\n lessonDirectory16 = loadJSON('json/directory16.json', ()=>{\n lessonDirectory17 = loadJSON('json/directory17.json');\n });\n })\n}", "title": "" }, { "docid": "7dc9b5a490539939137dee573c50174c", "score": "0.5526537", "text": "function preload() {\n tarotData = loadJSON(TAROT_DATA_URL);\n objectData = loadJSON(OBJECT_DATA_URL);\n instrumentData = loadJSON(INSTRUMENT_DATA_URL);\n dogData = loadJSON(DOG_DATA_URL);\n countryData = loadJSON(COUNTRY_DATA_URL);\n}", "title": "" }, { "docid": "60e62420992f40a568a71397bbe60e3b", "score": "0.552624", "text": "function collectSrcJsFiles(srcPath) {\n \"use strict\";\n var js = [];\n // collect all files in srcPath\n var files = index_2.dir(srcPath);\n // add js files to array\n for (var i = 0; i < files.length; i++) {\n if (path.extname(files[i]) === \".js\") {\n js.push(files[i]);\n }\n }\n return js;\n}", "title": "" }, { "docid": "31f7f61421f073329ee522d453dde1d0", "score": "0.5525389", "text": "constructor(fileList) {\n this.fileList = fileList;\n }", "title": "" }, { "docid": "5dfde44966973debf9f4325801fae88a", "score": "0.55250263", "text": "function populateCache (files, cache) {\n return cache.addAll(files);\n}", "title": "" }, { "docid": "fa3bf27d437b988973bd9c0ac211a0bf", "score": "0.55218685", "text": "function populateSceneFiles (callback){\n\t//console.log(\"concat: populating scene files\");\n\t__Database.getAll('timeline',function(e, tEvents){\n\t\tasync.each(tEvents, function(evt, cb){\n\t\t\tif(evt.scenes.length>0){\n\t\t\t\tasync.each(evt.scenes, function(sce, _cb){\n\t\t\t\t\tvar thisFilename = sce.slug+\".mov\";\n\t\t\t\t\tallSceneFileNames.push(thisFilename);\n\t\t\t\t\t_cb(null);\n\t\t\t\t});\n\t\t\t}\n\t\t\tcb(null);\n\t\t});\n\t\t//quick, before we move on, clear out the concat_list.txt file if it exists and has stuff in it:\n\t\tvar clearFile = exec(\"> \"+concatListTxtDir, function(err,stdout,stderr){\n\t\t\tif(err) callback(err);\n\t\t\telse callback(null);\n\t\t})\n\t});\n}", "title": "" }, { "docid": "ef38c593b08b8e49040fa7429cfbe0bd", "score": "0.55211526", "text": "function LoadAll( filePaths : String[]) {\n\t\tfor(var filePath : String in filePaths) {\n\t\t\tvar load : WWW = new WWW(\"file:///\"+filePath);\n\t\t\t\n\t\t\t yield load;\n\t\t\tif (!String.IsNullOrEmpty(load.error)) {\n\t\t\t\tDebug.LogWarning(filePath + \" error\");\n\t\t\t} else {\n//\t\t\tprint(\"GEttingImages?\");\n\t\t\t\timages.Push(load.texture);\n\t\t\t\t//image[imagedex]= load.texture;\n\t\t\t\t//imagedex++;\n\t\t\t\tbuiltinArray = images.ToBuiltin(Texture2D) as Texture2D[];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "bfd555e429e9aa4f9514190273deba07", "score": "0.55167264", "text": "function fetchScripts() {\n //reads files in userscripts dir and asynchronously calls updateScripts\n fs.readdir(\"userscripts/\", updateScripts);\n}", "title": "" }, { "docid": "aa5caac3ec974b77c78a064b96b77e86", "score": "0.55164033", "text": "function preload() {\n\t\tqueue = new createjs.LoadQueue();\n\t\tqueue.on(\"complete\", begin, this);\n\t\tqueue.loadManifest(assetData);\n\t}", "title": "" }, { "docid": "0f3383040d01873a18ad217f0a6b3a2d", "score": "0.5509691", "text": "componentDidMount() {\n for (let path of fs.readdirSync(\"./src/extensions\").sort()) {\n this.LoadExtension(path);\n }\n }", "title": "" }, { "docid": "69534b71fd3de0653dd37e82b72266f2", "score": "0.5508043", "text": "function makeFileList(src) {\n const dirPath = path.join(__dirname, src);\n let fileList = fs\n .readdirSync(dirPath, \"utf8\")\n .filter((file) => path.extname(file).toLowerCase() === \".js\");\n return fileList;\n}", "title": "" }, { "docid": "0dff1384867cc9d270b6c9be7c560525", "score": "0.55066997", "text": "getAvailableScriptImports() {\n return this.cache.getOrAdd('allAvailableScriptImports', () => {\n let allDependencies = this.getAllDependencies()\n //skip typedef files\n .filter(x => extname(x) !== '.d.bs');\n let result = [];\n let filesInProgram = this.program.getFilesByPkgPaths(allDependencies);\n for (let file of filesInProgram) {\n result.push(file.pkgPath);\n }\n this.logDebug('computed allAvailableScriptImports', () => result);\n return result;\n });\n }", "title": "" }, { "docid": "ffd41f2189cf1fdc9b22e91d4dca0b15", "score": "0.5505046", "text": "getImageFiles() {\n return fs.readdirSync(this.getBundleItemsDirectory()).filter(filename => filename.includes('.png'));\n }", "title": "" }, { "docid": "8a1e2c5a377f32d1d424f8e18efa3d90", "score": "0.5503742", "text": "loadList(){\n fetch('files.json').then(function(res){\n return res.json()\n }).then(function(res){\n this.filesCurrent = res[0].contents\n this.addBreadcrumb('Inicio', res[0].contents)\n this.showFiles(res[0].contents, '')\n }.bind(this))\n }", "title": "" }, { "docid": "c095cac0bb815122ddcb4a72f63de918", "score": "0.5500816", "text": "static preloadTemplates()\n {\n let templates = [\n \"templates/partials/quest-log/tab.html\",\n \"templates/partials/quest-preview/gmnotes.html\",\n \"templates/partials/quest-preview/details.html\",\n \"templates/partials/quest-preview/management.html\"\n ];\n\n templates = templates.map((t) => `modules/forien-quest-log/${t}`);\n loadTemplates(templates);\n }", "title": "" }, { "docid": "f266db6ebdb9ea6703d6d759a898b9d4", "score": "0.54997706", "text": "getDependencies (alreadyFiles = new Set()) {\n // Add own fileName\n alreadyFiles.add(this)\n\n // Add all dependencyFiles\n for (const dependencyFile of this.dependencies) {\n dependencyFile.getDependencies(alreadyFiles)\n }\n\n return alreadyFiles\n }", "title": "" } ]
33a51dc27050290e9f82868efc548eee
Function to handle Save Button
[ { "docid": "bca0f484eed7766b5952e262ac0c0482", "score": "0.0", "text": "function handleSaveBtn(hour) {\n // Variable for time value declared\n var timeValue = $(\".\" + hour).val();\n // Console log timeValue\n console.log(timeValue);\n // Save to local storage\n localStorage.setItem(hour, timeValue);\n}", "title": "" } ]
[ { "docid": "018fb8ab732bd525873753358fbb1f88", "score": "0.7872864", "text": "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "title": "" }, { "docid": "018fb8ab732bd525873753358fbb1f88", "score": "0.7872864", "text": "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "title": "" }, { "docid": "e2b0a05103c50f6b0cd50535cd4dd9f0", "score": "0.7314917", "text": "function handleSaveItem(event){\n //Console readout\n //console.log(\"Saving item...\")\n \n //Convert the button that was clicked to a jQuery DOM item\n var target = $(event.target);\n\n //Check if the save icon is clicked instead of the button itself and adjust handle accordingly\n if (target.hasClass(\"fas\")){\n saveButton = $(event.target).parent();\n }else{\n saveButton = target;\n }\n \n //Get index for data save from data attribute \n var index = saveButton.parent().children('textarea').data('index');\n\n //Get entered text for timeblock\n var text = saveButton.parent().children('textarea').val();\n\n //Enter item into local storage\n localStorage.setItem(index,text);\n\n}", "title": "" }, { "docid": "feb4850b64a23c6d0c697d579483d1c2", "score": "0.7258807", "text": "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.commentObject.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "title": "" }, { "docid": "b03813069dc86c9d90a0c401523a051b", "score": "0.7229068", "text": "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.threadInformation.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "title": "" }, { "docid": "51c831c3251f7c76ae41efda6eca65bd", "score": "0.7187268", "text": "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n saveOutputOption();\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "85e6e54c3fb7b0286d6b88a241818d65", "score": "0.7169057", "text": "function save(e) {\n let saveBtn = e.target;\n let inputBox = event.target.parentNode.lastChild;\n event.target.parentNode.firstChild.textContent = inputBox.value;\n inputBox.style.display = \"none\";\n saveBtn.style.display=\"none\";\n let editBtn = event.target.nextSibling;\n editBtn.style.display = \"inline\";\n \n}", "title": "" }, { "docid": "d52b6c268950355e481bc48fc218c333", "score": "0.71675193", "text": "_handleButtonSave()\n {\n var element = this._getJQueryElement();\n if ($(element).is(':visible'))\n {\n this.model.set('job_settings', this._editor.getValue());\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOWJOB_SAVE, {workflowjob: this.model, workflow: this._workflow});\n }\n }", "title": "" }, { "docid": "d44efc983bf043310cc6154e887dcbdd", "score": "0.71564746", "text": "function clickSaveButton() {\n\tif(this.innerHTML === savedButtText) {\n\t\tthis.innerHTML = notSavedButtText;\n\t} else {\n\t\tthis.innerHTML = savedButtText;\n\t}\n\n\tupdateAllSavedPCs();\n}", "title": "" }, { "docid": "05ec6c12b1332ff6066e5794918d1d9b", "score": "0.71249336", "text": "onClickSave() {\n let saveAction = this.$element.find('.editor__footer__buttons select').val();\n let postSaveUrl;\n\n let setContent = () => {\n // Use publishing API\n if(this.model.getSettings('publishing').connectionId) {\n // Unpublish\n if(saveAction === 'unpublish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/unpublish', this.model);\n\n // Publish\n } else if(saveAction === 'publish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/publish', this.model);\n \n // Preview\n } else if(saveAction === 'preview') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/preview', this.model);\n\n }\n }\n\n // Just save normally\n return HashBrown.Helpers.RequestHelper.request('post', 'content/' + this.model.id, this.model);\n }\n\n this.$saveBtn.toggleClass('working', true);\n\n // Save content to database\n setContent()\n .then((url) => {\n postSaveUrl = url;\n \n return HashBrown.Helpers.RequestHelper.reloadResource('content');\n })\n .then(() => {\n this.$saveBtn.toggleClass('working', false);\n \n this.reload();\n \n HashBrown.Views.Navigation.NavbarMain.reload();\n\n this.dirty = false;\n\n if(saveAction === 'preview') {\n UI.iframeModal(\n 'Preview',\n postSaveUrl\n );\n }\n })\n .catch((e) => {\n this.$saveBtn.toggleClass('working', false);\n UI.errorModal(e);\n });\n }", "title": "" }, { "docid": "15d502f1cd559256cb4831bc55312cb5", "score": "0.7123495", "text": "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "title": "" }, { "docid": "00477fb8739360e9ae1140ae1c3fb8d5", "score": "0.71105987", "text": "function handleSaveChangesButton(event, file_name_stockImg) {\n let startDate = $('#startDate').val();\n let stockPublished;\n if (document.getElementById('published').checked) {\n stockPublished = \"true\";\n } else {\n stockPublished = \"false\";\n }\n startDate = moment(startDate).format(\"YYYY-MM-DD\")\n let endDate = \"\"\n if ($('#endDate').val() !== null || $('#endDate').val() !== \"\") {\n endDate = $('#endDate').val()\n endDate = moment(endDate).format(\"YYYY-MM-DD\")\n }\n if (endDate === \"Invalid date\") {\n endDate = \"\"\n }\n\n const stock = {\n id: $('#stockId').val(),\n stockImg: file_name_stockImg,\n stockTitle: $('#stockTitle').val(),\n stockText: $('#stockText').summernote('code'),\n startDate: startDate,\n endDate: endDate,\n published: stockPublished\n }\n let method = (stock.id !== '' ? 'PUT' : 'POST')\n fetchStock(stock, method)\n\n function fetchStock(stock, method) {\n fetch(stockApiUrl, {\n method: method,\n headers: myStockHeaders,\n body: JSON.stringify(stock)\n }).then(function (response) {\n if (response.status === 200) {\n successActionMainPage(\"#mainWindowAlert\", \"Акция успешно сохранена\", \"success\")\n } else {\n successActionMainPage(\"#mainWindowAlert\", \"Акция не сохранена\", \"error\")\n }\n })\n }\n\n $('#stockModal').modal('hide')\n}", "title": "" }, { "docid": "a01205e597f39eab2bfd10d03b095fb7", "score": "0.70841724", "text": "function handleSave(evt) {\n hideNavMenu();\n let filename = \"okit.json\";\n if (okitSettings.is_timestamp_files) {\n filename = 'okit-' + getTimestamp() + '.json'\n }\n console.info('>> Saving Single Region File');\n okitJsonModel.updated = getCurrentDateTime();\n saveJson(JSON.stringify(okitJsonModel, null, 2), filename);\n}", "title": "" }, { "docid": "43c0cefadb552141e8fe8cd4b1c50c99", "score": "0.7081801", "text": "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "title": "" }, { "docid": "d99c2bcccbc5aa9a420fba95e1ad3859", "score": "0.7054692", "text": "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "title": "" }, { "docid": "974fd02a927afd3bc0dfcfb921443fae", "score": "0.7029306", "text": "function onSaveClick() {\n logger.info('save_button click event handler');\n closeKeyboards();\n clearAllErrors();\n var isValid = true;\n\n if (!($.customer_profile_first_name.value)) {\n showError($.customer_profile_first_name, $.first_name_error, _L('Please provide a first name.'), true);\n isValid = false;\n }\n if (!($.customer_profile_last_name.value)) {\n showError($.customer_profile_last_name, $.last_name_error, _L('Please provide a last name.'), true);\n isValid = false;\n }\n\n if (isValid) {\n var params = {\n first_name : $.customer_profile_first_name.value,\n last_name : $.customer_profile_last_name.value\n };\n\n var promise = currentCustomer.setProfile(params);\n Alloy.Router.showActivityIndicator(promise);\n promise.done(function(model, params, options) {\n notify(_L('Customer profile data successfully saved.'));\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n });\n }\n\n if (!isValid) {\n notify(_L('Please fill in all the required fields.'));\n }\n}", "title": "" }, { "docid": "991792a1fb32a9419fb51d31c7c81447", "score": "0.70071787", "text": "onSavePress() {\n\t\t\tvar sUrl = this._buildPreviewURL(this._buildReturnedURL());\n\t\t\tif (isValidUrl(sUrl) && this._areAllTextFieldsValid() && this._areAllValueStateNones()) {\n\t\t\t\tthis._close(this._buildReturnedSettings());\n\t\t\t} else {\n\t\t\t\tthis._setFocusOnInvalidInput();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "807d0eefec0407a776c33a40f2283406", "score": "0.697449", "text": "function process_save(saveall) {\n obj = getObj('save_func');\n if (saveall)\n obj.value = 'save_all_page';\n else\n obj.value = 'save_marked';\n obj.form.submit();\n}", "title": "" }, { "docid": "4ca5a017082c4a8ecff20e59620b2497", "score": "0.6956569", "text": "save(){\n //\n }", "title": "" }, { "docid": "a096ab9cf77d14a3b29e7f8130d09889", "score": "0.6954424", "text": "function onSaveButtonPress() {\n\tif (!validateSettings()) return;\n\tdlgMain.close(saveButtonID);\n}", "title": "" }, { "docid": "3e64e1bce9e029630d5726222e39d123", "score": "0.6924035", "text": "function saveAction(saveURL)\r\n{\r\n var workArea = _getWorkAreaDefaultObj();\r\n var docData = workArea.getHTMLDataObj();\r\n if(docData != null && docData.hasUserModifiedData() == true)\r\n {\r\n \tdocData.setSaveURL(saveURL);\r\n docData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n \tvar objAjax = new htmlAjax();\r\n \tobjAjax.error().addError(\"warningInfo\", szMsg_No_change, false);\r\n \t_displayProcessMessage(objAjax);\r\n }\r\n}", "title": "" }, { "docid": "f063357f07a9674db02fef1ac5e70645", "score": "0.69180095", "text": "function save ()\n {\n $uibModalInstance.close(vm.item);\n }", "title": "" }, { "docid": "9b621d3c4038f228087fd71236b5c044", "score": "0.69176596", "text": "function openSaveAs() {\n var ediv = $(\"#edit-widget-content\").get(0);\n if ($.data(ediv, \"assetid\")) {\n saveAssetContent(null,null);\n } else {\n if (contentEditCriteria.producesResource) {\n $.perc_browser({on_save:onSave, initial_val:\"\"});\n } else {\n saveAssetContent(contentEditCriteria.contentName,null);\n }\n }\n }", "title": "" }, { "docid": "ba11891219173bd6b83318c98b024fc7", "score": "0.68733424", "text": "onClickSave() {\n HashBrown.Helpers.SettingsHelper.setSettings(this.model.id, null, 'info', this.model.settings.info)\n .then(() => {\n this.close();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "title": "" }, { "docid": "eb74a23703a572622daef91344141e0a", "score": "0.6873099", "text": "_handleClickButtonSave()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RESOURCELIST_SAVE, {resourcelist: this.model,\n fields: {resource_type: this.ui.selectResourceType.val(),\n name: this.ui.resourceListName.val(),\n description: this.ui.resourceListDescription.val()}});\n }", "title": "" }, { "docid": "6c4cabc7624afb81db86155d1863b4dd", "score": "0.6870943", "text": "function saveAndClose(){\n save_button.addEventListener('click', function(event){\n event.preventDefault();\n active_element.innerHTML = editable_content.value;\n let json = {\n project_id: iframe.attributes['data-project-id'].value,\n selector: getUniqueSelector(active_element),\n change_value: editable_content.value,\n comment: content_comment.value\n }\n let myJSON = JSON.stringify(json);\n // Send data to backend\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/savechanges\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n console.log(\"Saved!\");\n }\n };\n xhr.send(myJSON);\n\n pu.style.display = 'none';\n editable_content.innerHTML = \"\";\n });\n close_button.addEventListener('click', function(){\n pu.style.display = \"none\";\n editable_content.innerHTML = \"\";\n });\n }", "title": "" }, { "docid": "8f648361c1f45cf4275b8f8bc0bdbf55", "score": "0.6861387", "text": "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.createDefaultFields(this.data.creator);\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.showGridView();\n\t\t// LiveUpdater.refresh(); // decided to remove this for now\n\t}", "title": "" }, { "docid": "f6d1d4a63ec2730d0fe1c53b6523fe2a", "score": "0.6820545", "text": "function saveAndExit() {\n scope.showSaveAndExitModal = true;\n }", "title": "" }, { "docid": "06472e34352cc2257e99a488ee4b2b27", "score": "0.6819397", "text": "function save_and_export() {\r\n\r\n}", "title": "" }, { "docid": "bc42a57798397ce72ee748e79b0f112a", "score": "0.68139434", "text": "function save(id) {\n idx = id.replace('save-button','');\n article = {\n \"author\": data.articles[idx].author,\n \"content\": data.articles[idx].content,\n \"description\": data.articles[idx].description,\n \"publishedAt\": data.articles[idx].publishedAt,\n \"title\": data.articles[idx].title,\n \"url\": data.articles[idx].url,\n \"urlToImage\": data.articles[idx].urlToImage\n };\n if(document.getElementById(id).src.includes(\"empty.png\")) {\n document.getElementById(id).src = \"images/save_icon_fill.png\";\n $(\"#\"+id).after('<p id=\"success\">Added article to Saved!</p>');\n $(\"#success\").delay(2000).fadeOut();\n saveArticle(article);\n } else {\n document.getElementById(id).src = \"images/save_icon_empty.png\";\n $(\"#\"+id).after('<p id=\"success\">Removed article from Saved!</p>');\n $(\"#success\").delay(2000).fadeOut();\n }\n}", "title": "" }, { "docid": "6943fbc20624e1af0615e5bb94a28876", "score": "0.6807115", "text": "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "title": "" }, { "docid": "4470c36348383653e57e2b3d15699f9f", "score": "0.68048126", "text": "function saveCallback()\n {\n clearUndoBuffer();\n updateUndoButton();\n if (!($('#perc-region-tool-inspector').hasClass('buttonPressed')))\n {\n $(\"#perc-undo-tool\").hide();\n $(\"#perc-undo-tool-disabled\").hide();\n }\n }", "title": "" }, { "docid": "10968f9481145420c87a52a9c3cc49b9", "score": "0.67970157", "text": "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = PageData.SavedImageTitle;\n let storageKey = Date.now().toString();\n\n let overwrite = Common.customConfirm('Overwrite existing diagram?');\n if (overwrite) {\n storageKey = PageData.Filename;\n } else {\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n if (!diagramTitle) return;\n }\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "title": "" }, { "docid": "4ff2095d915c6e016965aaea25f723fe", "score": "0.6794399", "text": "function save() {\n $(\"#save-dialog\").dialog({\n resizable: false,\n draggable: false,\n height: 200,\n width: 400,\n modal: true,\n buttons: {\n \"Yes\": function () {\n saveBackend(true);\n $(this).siblings(\".ui-dialog-titlebar\").find(\"button\").remove();\n $(this).siblings(\".ui-dialog-buttonpane\").remove();\n $(this).children(\"p\").text(\"Saving and archiving...\");\n $(this).children(\"img\").show();\n },\n \"No\": function () {\n saveBackend(false);\n $(this).siblings(\".ui-dialog-titlebar\").find(\"button\").remove();\n $(this).siblings(\".ui-dialog-buttonpane\").remove();\n $(this).children(\"p\").text(\"Saving...\");\n $(this).children(\"img\").show();\n }\n }\n });\n}", "title": "" }, { "docid": "72d7f67c750f0f96740f1ceecb660e43", "score": "0.67896694", "text": "save() {\n }", "title": "" }, { "docid": "a307251a129e699a4dbb4368750f106a", "score": "0.6789454", "text": "onSaving() {\n var ptr = this;\n this.formView.applyValues();\n this.record.save(function () {\n ptr.onSaved();\n });\n this.saving.raise();\n }", "title": "" }, { "docid": "111e262131addde125106469bc5b11e4", "score": "0.6768423", "text": "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.fields = data.fields;\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.renderGridView();\n\t\tthis.showGridView();\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "title": "" }, { "docid": "4ec90c29ee2818c59b68222cc715a223", "score": "0.6756256", "text": "function userSavesHandler() {\n\tif (!filepath) {\n\t\tdialog.showSaveDialog(savePathChosenHandler);\n\t} else {\n\t\twriteToFile(filepath)\n\t}\n}", "title": "" }, { "docid": "8b7fbb0b962fc3f95b8bcdee80e2ad31", "score": "0.675614", "text": "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "title": "" }, { "docid": "94b78f6c5d3bc5e5fa734f78a54785b6", "score": "0.6749163", "text": "function Save(e) {\n\t// saveURL is a switch used to check whether this is a new feature request or an edit.\n\tif (saveURL === undefined) {\n\t saveURL = newURL;\n\t}\n\t\n\t$.ajax({\n type: \"POST\",\n url: saveURL,\n data: $('#feature-request-form').serialize(),\n success: function (data) {\n grid.reload();\n\t\t$('#feature-modal-form').modal('hide');\n\t\tclearForm('#feature-modal-form');\n },\n\t failure: function () {\n alert('Failed to save.');\n\t\t$('#feature-modal-form').modal('hide');\n\t }\n });\n\tsaveURL = newURL;\n e.preventDefault();\n }", "title": "" }, { "docid": "44b8f7aaaf4167f33899d5576d2824cf", "score": "0.6744268", "text": "save() {}", "title": "" }, { "docid": "335849a1295e97fc9fb4cd32f5be0d66", "score": "0.6730802", "text": "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.field = data.field;\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "title": "" }, { "docid": "4e4005a7ac7bb1a2cfe3310e0a9a3be4", "score": "0.6717113", "text": "function renderSaveButton() {\n\t\treturn (\n\t\t\t<IconButton variant=\"success\" onClick={() => run('update_settings', { settings })} icon=\"save\" title={lang.settingview_save} />\n\t\t);\n\t}", "title": "" }, { "docid": "463553d51ad84c2586a5d013e9fbbb5b", "score": "0.669176", "text": "onSaved() {\n this.saved.raise();\n }", "title": "" }, { "docid": "a0a84b7633f90299b6ca7e829724d16d", "score": "0.66850203", "text": "function save() {\n $scope.broadcastFromRoot(addPageCtrl.constants.CC_PAGE_ADDED, { page: addPageCtrl.page });\n closeDialog();\n }", "title": "" }, { "docid": "eef8f68d42acfd158410ec1b9ebb238e", "score": "0.6682131", "text": "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "title": "" }, { "docid": "edf94080d30a9d5883c5fde55290a4cc", "score": "0.6681428", "text": "function handleSaveButton() {\n $(\".main-area\").on(\"submit\", \"#js-edit-form\", function(e) {\n console.log(\"Save button clicked\");\n // stop from form submitting\n e.preventDefault();\n // create variable that holds title value\n let title = $(\"#journal-title\").val();\n // create variable that holds date value\n let travelDate = $(\"#travel-date\").val();\n // create variable that hold image value\n let coverPhoto = $(\"#main-image\").val();\n // if this (main-area) data method entry id equal undefined (meaning nothing inputted) is true\n if ($(this).data(\"entryid\") === undefined) {\n // call create entyr function with title, date and photo as parameter\n createEntry(title, travelDate, coverPhoto);\n } else {\n const id = $(this).data(\"entryid\");\n // create new entry object that has different keys\n const newEntry = {\n id,\n title,\n travelDate,\n coverPhoto\n };\n // call save entry with new entry object as a parameter\n saveEntry(newEntry);\n }\n });\n}", "title": "" }, { "docid": "09bfb14a14e76b133905bb7825d93cca", "score": "0.66794264", "text": "function handleSave() {\n console.log('in handleSave');\n const updatedList = {\n id: trip.id,\n location: title,\n start_date: date,\n days: days,\n }\n console.log('Updated trip info:', updatedList);\n //update list to reflect changes by triggering events stemmed from update list reducer\n dispatch({ type: 'UPDATE_LIST', payload: updatedList })\n //reset edit mode to false\n setEditMode(false)\n // history.push('/user')\n }", "title": "" }, { "docid": "6fcfb379b403a7a2316a8107e60a8868", "score": "0.6677606", "text": "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "title": "" }, { "docid": "d305331add3a2ce3664a3b7f7458e7e3", "score": "0.6671836", "text": "get saveButton() {\n return {\n command: \"save\",\n icon: \"save\",\n label: \"Save\",\n type: \"rich-text-editor-button\",\n };\n }", "title": "" }, { "docid": "c39a257c5bc161e1995400191d2d09a9", "score": "0.66622335", "text": "function successSave() {\n var saveSuccess = $('#save-success');\n showSaveResult(saveSuccess);\n}", "title": "" }, { "docid": "5830efd574d1c70498435a92337feaa3", "score": "0.6660476", "text": "function save() {\n\t\tdocument.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n\t\tmyDiagram.isModified = false;\n\t}", "title": "" }, { "docid": "d2c11ae0d93107982ed88b3e4365a69f", "score": "0.6658991", "text": "onClickSave() {\n SettingsHelper.setSettings(this.projectId, null, 'info', this.model)\n .then(() => {\n this.modal.hide();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "title": "" }, { "docid": "685c052ada6e4d5b5fd5b5c63aba4bf5", "score": "0.66494846", "text": "function saveSubmit() {\n\tvar sPath = '';\n\tsPath += document.getElementById('currentRoot').value;\n\tsPath += document.getElementById('currentFolder').value;\n\tif (selectedType == 'file') {\n\t\twindow.opener.filelibraryAction(sPath + selectedFile);\n\t\twindow.close();\n\t}\t\t\n}", "title": "" }, { "docid": "2036af874d7e491494c4305a40ed6a8d", "score": "0.66435546", "text": "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "title": "" }, { "docid": "2036af874d7e491494c4305a40ed6a8d", "score": "0.66435546", "text": "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "title": "" }, { "docid": "73e936fedf8ac5f4f8f3434c1a6df116", "score": "0.663272", "text": "function CheckForSave() {\n\n // Update Back&Save button\n if($.trim($(\"#StepList\").html()) != \"\" || $.trim($(\"#Name\").val()) != \"\" || SequenceID != -1) {\n $(\"#btnBackSave\").html(\"<i class='material-icons'>arrow_back</i> &nbsp; <i class='material-icons'>save</i>\");\n MustSave = true;\n } else {\n $(\"#btnBackSave\").html(\"<i class='material-icons'>arrow_back</i>\");\n MustSave = false;\n }\n\n}", "title": "" }, { "docid": "d555fe4969e9a1b4bb5f2c6a44ac6c4c", "score": "0.6631302", "text": "async saveButtonClicked() {\n try {\n const writingData = await this.getData();\n const endpoint = this.page ? '/api/page/' + this.page._id : '/api/page';\n\n try {\n let response = await fetch(endpoint, {\n method: this.page ? 'POST' : 'PUT',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n },\n body: JSON.stringify(writingData)\n });\n\n response = await response.json();\n\n if (response.success) {\n window.location.pathname = response.result.uri ? response.result.uri : '/page/' + response.result._id;\n } else {\n alert(response.error);\n console.log('Validation failed:', response.error);\n }\n } catch (sendingError) {\n console.log('Saving request failed:', sendingError);\n }\n } catch (savingError) {\n alert(savingError);\n console.log('Saving error: ', savingError);\n }\n }", "title": "" }, { "docid": "b9e88244fac68d23ef7a41a67928a05b", "score": "0.662557", "text": "function _saveAsPanelHandler(){\n\n $('#sm-editing-table--checkbox').on(\"click\", function() {\n // traverse the DOM up to the table and find all input checkboxes, mark as checked\n $(this).closest('table').find('td input:checkbox').prop('checked', this.checked);\n });\n\n $(\".showHistoryTable\").on(\"click\", function() {\n $('.sm-editing-table--history').toggle();\n });\n\n }", "title": "" }, { "docid": "44ca9d82e9d820e56e5ac1c4117c5844", "score": "0.6608734", "text": "_event_saving() {\n\t\tlet ev = new Event(\"saving\", { \"bubbles\": true, \"cancelable\": true });\n\t\tthis.dispatchEvent(ev);\n\t}", "title": "" }, { "docid": "aedaacd4279ba6acb701df62ea1f4149", "score": "0.6593859", "text": "function buttonSaveCallback(data)\n{\n alert(data);\n}", "title": "" }, { "docid": "5d373aea0590cca131b00b4eeedfa5f9", "score": "0.6589831", "text": "function save(model) {\n // who knows what this does\n }", "title": "" }, { "docid": "b82e2a0e1cd590ac7f5435d030288ada", "score": "0.65881336", "text": "function save() {\n\n // stops the loop so that it will not automatically get more updates\n stop_loop();\n loading();\n\n // display deployments again so that it disables Save button and site buttons at the same time\n saving = true;\n document.getElementById(\"save\").disabled = true;\n console.log(\"saving...\");\n obj.init = \"False\";\n display_deployments();\n\n dep = {};\n dep['new_deployments'] = new_deployments;\n DATA['deployments'] = dep;\n api.request(\"update\", \"deployments\");\n\n}", "title": "" }, { "docid": "eca61a79eff56a3ed4559f79e980dae7", "score": "0.6561406", "text": "function handleSave(){\n props.onAdd(qItems);\n props.toggle(); \n }", "title": "" }, { "docid": "331a8343d535ec07477d058cf5daff4f", "score": "0.65523666", "text": "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "44eaf20eecb6a0cf658f9aa2d22eea4c", "score": "0.65408194", "text": "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "title": "" }, { "docid": "1cf3e503ce6f5e190689d16596ed45d2", "score": "0.65346247", "text": "save() {\n this._toggleSaveThrobber();\n try {\n this._readFromForm();\n var resp = this.dao.save();\n if (!resp) {\n alert(\"Error while saving taxon.\")\n } else {\n var jsonObj = JSON.parse(resp);\n if (jsonObj[0].response == false ) {\n alert(jsonObj[1].response);\n } else {\n console.log(this.dao)\n // make sure the latin name input field is showing the correct name, reload data from server\n document.getElementById('latin_name').value = this.dao.unique_name;\n alert('Saved');\n }\n }\n } catch(e) {\n alert(e);\n console.log(e);\n }\n this._toggleSaveThrobber();\n }", "title": "" }, { "docid": "e5653faa09f5b101cbf029767425be2a", "score": "0.6533529", "text": "function onEditDialogSave(){\r\n\t\t\r\n\t\tif(!g_codeMirror)\r\n\t\t\tthrow new Error(\"Codemirror editor not found\");\r\n\t\t\r\n\t\tvar content = g_codeMirror.getValue();\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_edit_file\");\r\n\t\t\r\n\t\tvar item = objDialog.data(\"item\");\r\n\t\t\r\n\t\tvar data = {filename: item.file, path: g_activePath, pathkey: g_pathKey, content: content};\r\n\t\t\r\n\t\tg_ucAdmin.setAjaxLoaderID(\"uc_dialog_edit_file_loadersaving\");\r\n\t\tg_ucAdmin.setErrorMessageID(\"uc_dialog_edit_file_error\");\r\n\t\tg_ucAdmin.setSuccessMessageID(\"uc_dialog_edit_file_success\");\r\n\t\t\r\n\t\tassetsAjaxRequest(\"assets_save_file\", data);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "7d8b8a20166d2c3b35084d5ede09b098", "score": "0.65316105", "text": "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "title": "" }, { "docid": "261b37c14824e61083f931ff449ce03c", "score": "0.65288687", "text": "saveAndExit() {\n saveAndExit();\n }", "title": "" }, { "docid": "ac58bd7b4c3fa8dabb34a1d2ed87bb2f", "score": "0.65253174", "text": "function save() {\n $log.log('CollegeFundPaymentDialogController::save called');\n if (vm.collegeFundPayment.id) {\n //update the collegeFundPayment information\n CollegeFundPayment.save(vm.collegeFundPayment, onSaveFinished);\n } else {\n // Create New CollegeFundPayment\n if (vm.collegeFundPayment.id !== null) {\n CollegeFundPayment.create(vm.collegeFundPayment, onSaveFinished);\n }\n }\n }", "title": "" }, { "docid": "d7d1692bde6591fc68193a0c08373fe6", "score": "0.65190655", "text": "addSaveButton(callback) {\n this.addButton(CHECK_ICON, callback);\n }", "title": "" }, { "docid": "5ff4eff9fafa965fd83fe62fa7a68f85", "score": "0.6517109", "text": "function save() {\n if (!pro) {\n $ionicPopup.alert({\n title: 'Pro Feature',\n template: 'Workouts can only be saved in Ruckus Pro. You can however still share!'\n });\n return false;\n }\n\n if (vm.saved) {\n return false;\n }\n workoutService.editOrCreate(saveSnapShot.date, saveSnapShot).then(function(res) {\n vm.saved = true;\n }, function(err) {\n log.log('there was an error with saving to the datastore' + err);\n });\n }", "title": "" }, { "docid": "07e9628512aed1abaadb6d17ab5eb9f6", "score": "0.6514702", "text": "saveBook(event) {\n const bookInfo = event.target;\n API.saveBook({\n title: bookInfo.dataset.title,\n authors: bookInfo.dataset.authors,\n description: bookInfo.dataset.description,\n image: bookInfo.dataset.image,\n link: bookInfo.dataset.link\n })\n .then(res => console.log('Saved!'))\n //SEND OUT A MODAL WHEN YOU GET A CHANCE\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "0b433b886f98904bb331aa214f0d4099", "score": "0.65058124", "text": "function saveData() {\n\t\t\n\t\t// After Save, Alert User with a Dailog //\n\t\t$.mobile.changePage( \"#dialogAlert\", {\n\t\t transition: \"pop\",\n\t\t reverse: false,\n\t\t changeHash: false\n\t\t});\n\n\t\t// When #alertDialog Loads, Target ID, Clear the Div and Append the Following Save Alert //\n\t\t// In A listview with an Anchor Leading to #viewData //\n\t\t$('#alert').empty();\n\t\t$('#alert').append($('<li>').append($('<a href=\"#viewData\" id=\"saveAlertLink\" data-icon=\"rightarrow\"></a>')\n\t\t\t.append($('<img src=\"save.png\" class=\"iconImg\" />' +\n\t\t\t\t'<h4>Hooray!</h4>' +\n\t\t\t\t'<p>Your Loan Has Been Saved!</p>')\n\t\t)));\n\t\t// Refresh The Dialog listview to Ensure Proper View //\n\t\t$('#alert').listview(\"refresh\");\n\t}", "title": "" }, { "docid": "021badcbdcce96a00dd3f89c0fca7fa2", "score": "0.6504921", "text": "function save() {\n\t\t\t\t\t\t$rootScope.$broadcast(\"modal:blockAllOperations\");\n\t\t\t\t\t\tDataTypesPageService.save($scope.dataType);\n\t\t\t\t\t}", "title": "" }, { "docid": "2587992b3aea7d5836d7b85619934fd6", "score": "0.64947146", "text": "function save() {\r\n\t\tvar str = myDiagram.model.toJson();\r\n\t\tdocument.getElementById(\"mySavedModel\").value = str;\r\n\t }", "title": "" }, { "docid": "1f7e61c1f440c78fb70867f8f6ab5266", "score": "0.64925164", "text": "function saveEventDesc(event) {\n let clickedSave = event.target;\n let rowEventId = $(clickedSave).prev().attr('id');\n eventDescText = $(`#${rowEventId} textarea`).val()\n //check if the user enterd an event for the save button clicked\n if (eventDescText) {\n evntDescProp = rowEventId\n if (!dailyEvents) {\n dailyEvents = {}\n }\n dailyEvents[evntDescProp] = eventDescText\n localStorage.setItem(plannerDate.text(), JSON.stringify(dailyEvents));\n alert(\"Changes have been saved.\")\n }\n else {\n //if no data enterd for the event for the save button clicked, alert the user they clicked the wrong save\n alert(\"Please enter an event descrption before clicking SAVE.\")\n }\n}", "title": "" }, { "docid": "ed8439db41eea13a4dfe1fccdf089b71", "score": "0.6490185", "text": "save() {\n\t\t// Rendering in PHP\n\t\treturn null;\n\t}", "title": "" }, { "docid": "ed8439db41eea13a4dfe1fccdf089b71", "score": "0.6490185", "text": "save() {\n\t\t// Rendering in PHP\n\t\treturn null;\n\t}", "title": "" }, { "docid": "f9d18083fb31f5eaec40f758dff1a3b4", "score": "0.64719284", "text": "function createSaveButton(panel, translator) {\n const trans = (translator || nullTranslator).load('jupyterlab');\n function onClick() {\n if (panel.context.model.readOnly) {\n return showDialog({\n title: trans.__('Cannot Save'),\n body: trans.__('Document is read-only'),\n buttons: [Dialog.okButton({ label: trans.__('Ok') })]\n });\n }\n void panel.context.save().then(() => {\n if (!panel.isDisposed) {\n return panel.context.createCheckpoint();\n }\n });\n }\n return addToolbarButtonClass(ReactWidget.create(React.createElement(UseSignal, { signal: panel.context.fileChanged }, () => (React.createElement(ToolbarButtonComponent, { icon: saveIcon, onClick: onClick, tooltip: trans.__('Save the notebook contents and create checkpoint'), enabled: !!(panel &&\n panel.context &&\n panel.context.contentsModel &&\n panel.context.contentsModel.writable) })))));\n }", "title": "" }, { "docid": "5b03b225506d3184be7b3315749b1e46", "score": "0.6471481", "text": "handleSaveClick(event) {\n event.stopPropagation();\n event.preventDefault();\n\n this.doFormSave();\n }", "title": "" }, { "docid": "eb369649a453912f43acc372b0df6e11", "score": "0.6466748", "text": "function save(){\n if (!isSaveAllowed) {\n log('Save was temporarily disabled until you decide what to do with previously saved content.');\n return;\n }\n\n var data = getFormData();\n data['_autosaveTime'] = now();\n var key = getKey();\n\n if(typeof key === 'string' && key.length > keyPrefix.length && typeof data === 'object'){\n localStorage.setItem(key.trim(), JSON.stringify(data));\n\n log('Content saved.');\n }\n\n removeOldEntries();\n}", "title": "" }, { "docid": "c5a867864b49539de42a438590d526dd", "score": "0.6463239", "text": "function createSaveButton(dashboardAPI, viewIdentifier) {\n\t\tfunction onSaveButton() {\n\t\t\tvar filterSettings = conDecFiltering.getFilterSettings(viewIdentifier);\n\n\t\t\tif (filterSettings[\"projectKey\"]) {\n\t\t\t\tif (filterSettings[\"definitionOfDone\"]) {\n\t\t\t\t\t// necessary since savePreferences cannot store objects\n\t\t\t\t\tObject.assign(filterSettings, filterSettings.definitionOfDone);\n\t\t\t\t}\n\t\t\t\tdashboardAPI.savePreferences(filterSettings);\n\t\t\t}\n\n\t\t\tdashboardAPI.resize();\n\t\t}\n\n\t\tclearListener(\"save-button-\" + viewIdentifier);\n\n\t\tdocument.getElementById(\"save-button-\" + viewIdentifier).addEventListener(\"click\", onSaveButton);\n\t}", "title": "" }, { "docid": "bf8f73f3c54a6860304fc537a06acc25", "score": "0.6458458", "text": "function savingInLocalStorage() {\n\n\n //1.get all the calaculated data from the BudgetController:\n let sendDataToLocalStorage = budgetCtrl.getAllData();\n\n //2.send data to UIcontroller for storing it in local storage:\n document.querySelector(DOMClassNames.savingData).addEventListener('click', () => {\n\n //update the data to be sent:\n if (input && input.description !== '' && !isNaN(input.value) && input.value > 0) {\n\n sendDataToLocalStorage.total_income = budget.totalInc;\n sendDataToLocalStorage.total_expenditure = budget.totalExp\n sendDataToLocalStorage.final_budget = budget.budget;\n sendDataToLocalStorage.percentage = budget.percentage;\n\n UIctrl.saving(sendDataToLocalStorage);\n }\n })\n\n }", "title": "" }, { "docid": "3df63329096bda904dee8b1ba2e37b31", "score": "0.64561296", "text": "function closeSave() {\n const title = document.querySelector('#title-input').value;\n const body = document.querySelector('#input-textarea').value;\n if(title) {\n fetch('/documents/' + document_id, {\n method: 'PUT',\n body: JSON.stringify({\n title: title,\n body: body\n })\n });\n }\n else {\n fetch('/documents/' + document_id, {\n method: 'PUT',\n body: JSON.stringify({\n body: body\n })\n });\n }\n if(title != \"\") {\n document.querySelector('#doc-title').innerHTML = title;\n }\n document.querySelector('#overlay').style.display = 'none';\n document.querySelector('#save-popup').style.display = 'none';\n}", "title": "" }, { "docid": "8b2716f05b02d62a1c69951e6a9116c9", "score": "0.64493334", "text": "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.6441671", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.6441671", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.6441671", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.6441671", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "4f74b1cd3718ca6b004778b5dea2a6fa", "score": "0.6435183", "text": "static Save() {}", "title": "" }, { "docid": "85089390c091fd5e0d906ac559d4de37", "score": "0.6431118", "text": "function saveEditedTaskButtonHandler(obj)\n{\n // first: grab the task ID and data\n const row = getGrandparent($(obj));\n const taskType = getRowsTable(row);\n const taskID = getSavedTaskID(row);\n const taskData = getNewTaskData(row);\n const taskObject = buildTaskData(taskData[0], taskData[1], taskData[2], taskData[3], taskData[4]);\n // save data to the DOM\n saveTaskData(taskID, taskObject);\n // update the task table\n updateTask(row, taskObject);\n saveToEdit($(obj), $(obj).parent());\n}", "title": "" }, { "docid": "78423c2301c5a238a0cfb371feb61e73", "score": "0.64304096", "text": "function handleSave(event) {\n event.preventDefault();\n setSaving(true);\n if (addOrEditContactType === messages.Add) onAddContact(addOrEditContact);\n else onUpdateContact(addOrEditContact);\n history.push('/contact-list');\n const contact = { ...addOrEditContact };\n const name = `${contact.firstname} ${contact.lastname}`;\n toast.success(`${messages.toastcontact} ${name} ${messages.toastsaved}`);\n }", "title": "" }, { "docid": "73fbdf8ea56aabe39eae87789fd05fce", "score": "0.6427157", "text": "saveItem() {\n\n }", "title": "" }, { "docid": "952e346703180e4208c7936a77e8b128", "score": "0.6425457", "text": "function doSave(oExactBrowser, bSkip) {\n\t\toExactBrowser._saveDialog.close();\n\t\tif(!bSkip){\n\t\t\talert(\"Save: \"+oExactBrowser._saveTextField.getValue());\n\t\t}\n\t}", "title": "" }, { "docid": "3a9ff63c422d35ee604af3d0f8d2aed3", "score": "0.64248574", "text": "handleSave(event) {\n this.props.handleSave({\n paletteName: this.state.paletteName,\n emoji: this.state.emoji,\n });\n }", "title": "" }, { "docid": "70ac13258f4c201729170b423a5a8aa7", "score": "0.6424284", "text": "function save() {\n Bar.createWithConfig(dataForm.name, dataForm.frequency, PoP.getFinalStatements().getItem(dataForm.final_statement))\n .then(() => {\n goBack();\n return Promise.resolve()\n })\n .catch(error => {\n console.log(error);\n console.dir(error);\n console.trace();\n\n Dialog.alert({\n title: \"Error\",\n message: error,\n okButtonText: \"Ok\"\n });\n\n return Promise.reject(error);\n });\n\n\n\n\n}", "title": "" }, { "docid": "e2ed899a93e6214e501e2eee7abaca29", "score": "0.6422726", "text": "async postSave () {\n\t}", "title": "" }, { "docid": "9a8e09e9e97a40f05db568d7ea611513", "score": "0.6419811", "text": "onSaved() {\n if (this._saved) {\n this._saved.raise();\n }\n }", "title": "" }, { "docid": "5fc56dc5b55b23638f1091d0f4284ab9", "score": "0.6415587", "text": "function handleSave() {\n setLoading(true);\n //console.log(props.editData.data.id);\n let formData = {\n title,\n text\n };\n console.log(formData);\n axios\n .post(\n `https://salesforce-blogs.herokuapp.com/blogs/api/${\n isEdit ? props.editData.data.id : ''\n }`,\n formData\n )\n .then(response => {\n toast.success('Post saved successfully.');\n setLoading(false);\n })\n .catch(err => {\n toast.error('Cannot save post, some error occured' + err);\n console.log('Cannot save post, some error occured' + err);\n setLoading(false);\n });\n }", "title": "" } ]
82cb0d83f19dabadec37f36ffe766044
Getting form information for array constructor function for retrieving value for selected state
[ { "docid": "29c3cdbf86237664ac23a9ab53ca751f", "score": "0.0", "text": "function getStatePrice() {\r\n var incomeStatePrice = 0.23;\r\n /*var selectedState = the_calc_Form.elements[\"state\"];\r\n incomeStatePrice = state_prices[selectedState.value]; */\r\n return incomeStatePrice;\r\n}", "title": "" } ]
[ { "docid": "fd5072f0b44ea7faf524db1559eca755", "score": "0.58242065", "text": "function select(state) {\n\t\treturn {\n\t\t\tdata: state.data,\n\t\t\tinfo: state.info\n\t\t};\n\t}", "title": "" }, { "docid": "ab006348e6ebaed0a00cc66255161083", "score": "0.5709213", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "ab006348e6ebaed0a00cc66255161083", "score": "0.5709213", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "d5479532136b6307a2a9b8edf8971f72", "score": "0.5686724", "text": "function select(state) {\n\treturn {\n\t\tdata: state\n\t};\n}", "title": "" }, { "docid": "b70103d0e037300750d80e0e09212c90", "score": "0.56768304", "text": "function getStateData(pState){\n if($('#stateForm').valid()){\n var stateIndex = searchArray.indexOf(pState.toUpperCase())%myState.length\n document.forms[\"stateForm\"].elements[\"stateNameOut\"].value = myState[stateIndex][1]\n document.forms[\"stateForm\"].elements[\"stateCapitolOut\"].value = myState[stateIndex][2]\n document.forms[\"stateForm\"].elements[\"statePopOut\"].value = \n Number(myState[stateIndex][3]).toLocaleString() \n }\n}", "title": "" }, { "docid": "050b44e8a8c37ef86d50f0f67d55be81", "score": "0.5645625", "text": "getState() { return [this._s0, this._s1, this._s2, this._c]; }", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "984e75d565dc14ad709b20d4c62e52d8", "score": "0.5639176", "text": "function select(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "6ad092e3df3eb7dee7de0c7fd2795473", "score": "0.5629991", "text": "function select (state) {\n return {\n data: state\n }\n}", "title": "" }, { "docid": "9d0491c449061dac8b494305156eef26", "score": "0.56099945", "text": "function select (state) {\n return {\n data: state,\n }\n}", "title": "" }, { "docid": "9d0491c449061dac8b494305156eef26", "score": "0.56099945", "text": "function select (state) {\n return {\n data: state,\n }\n}", "title": "" }, { "docid": "9b17369e5227e3e15a95c2bb302e451b", "score": "0.5570569", "text": "function createInputArray()\n {\n /* we look for a previous created select */\n if ( document.querySelector('.customFields_Type_select') )\n {\n var options = document.querySelector('.customFields_Type_select').options;\n if ( options )\n {\n /* Convert to an array */\n var inputArrayValues = new Array;\n var j=0;\n inputArrayValues[j] = 'Choose a type';\n j++;\n for ( var i in options)\n {\n if ( ( options[i].value ) && ( options[i].value != '') )\n {\n //console.log (options[i]);\n inputArrayValues[j] = options[i].value;\n j++;\n }\n\n\n }\n\n return (inputArrayValues);\n }\n }\n }", "title": "" }, { "docid": "bbcdde878ea4227fa93242bcd407e17b", "score": "0.55586123", "text": "onChangeAssignmentArray(e) {\n var tacticArray = this.state.assignedTactics;\n if (e.target.placeholder == \"Tactic Name\") {\n tacticArray[e.target.name].name = e.target.value;\n this.setState({\n assignedTactics: tacticArray\n });\n } else {\n tacticArray[e.target.name].description = e.target.value;\n this.setState({\n assignedTactics: tacticArray\n });\n }\n }", "title": "" }, { "docid": "f484851c7f5e60d59fb74849296da5d6", "score": "0.55469936", "text": "getFormValues(name, description, intro, position, experience, conclusion) {\n\n var obj = {name_key: name,\n description_key: description,\n intro_key: intro,\n position_key: position,\n experience_key: experience,\n conclusion_key: conclusion };\n\n //create two more arrays for template name and desriptions\n\n var updatedNames = this.state.formNames,\n updatedDesc = this.state.formDescriptions;\n\n this.setState({formNames: updatedNames.concat(name)});\n this.setState({formDescriptions: updatedDesc.concat(description)});\n this.setState({formValue: obj});\n //this.props.addTemplate(this.state.formNames);\n \n\n }", "title": "" }, { "docid": "0982c3c67aec57270c54e68443694a2e", "score": "0.55329376", "text": "function updateArray(e) {\n //This function is adding info about new input to dummy state\n let parentId = e.target.parentElement.id;\n if (e.target.name === \"stateName\") {\n dummy_states[parentId] = {\n ...dummy_states[parentId],\n id: parentId,\n stateName: e.target.value,\n };\n } else if (e.target.name == \"symbol\") {\n dummy_states[parentId] = {\n ...dummy_states[parentId],\n id: parentId,\n symbol: e.target.value,\n };\n } else if (e.target.name === \"transitsTo\") {\n dummy_states[parentId] = {\n ...dummy_states[parentId],\n id: parentId,\n transitTo: e.target.value,\n };\n }\n console.log(parentId);\n // console.log(e.target.value);\n}", "title": "" }, { "docid": "2a79c43aee600f437162bb54bb0a861a", "score": "0.5438313", "text": "function __fieldValue__(element, successful) {\n var name = element.name,\n type = element.type,\n tag = element.tagName.toLowerCase(),\n index,\n array,\n options,\n option,\n one,\n i, imax,\n value;\n\n if (typeof successful == 'undefined') {\n successful = true;\n }\n //console.log('element %s disabled ? %s (successful:%s)', name, element.disabled, successful);\n\n if (successful && (!name || element.disabled || type == 'reset' || type == 'button' ||\n (type == 'checkbox' || type == 'radio') && !element.checked ||\n //thatcher - todo: determine why not type == 'submit'\n (/*type == 'submit||*/ type == 'image') &&\n element.form && element.form.clk != element || tag === 'select' &&\n element.selectedIndex === -1)) {\n //console.log('skipping element in form serialization %s', element);\n return null;\n }\n\n if (tag === 'select') {\n index = element.selectedIndex;\n if (index < 0) {\n return null;\n }\n array = [];\n options = element.options;\n one = (type == 'select-one');\n imax = (one ? index+1 : options.length);\n i = (one ? index : 0);\n for( i; i < imax; i++) {\n option = options[i];\n if (option.selected) {\n value = option.value;\n if (one) {\n return value;\n }\n array.push(value);\n }\n }\n return array;\n }\n return element.value;\n}", "title": "" }, { "docid": "97c3d41b0446d8a211b37c469e3a8cea", "score": "0.5429071", "text": "function select( state ) {\n return {};\n}", "title": "" }, { "docid": "fc2cd209c344db701b99ae50406e5c5a", "score": "0.53841746", "text": "handleSubmit(event) {\n //Querying provinces for state user specified \n this.state.provinces.map(element => {\n if (element.province.toLowerCase() === this.state.provinceInput.toLowerCase()) {\n this.setState({ provinceObj: element})\n //this.setState({selectedProvincesArray: this.state.selectedProvincesArray.push(this.state.provinceObj)})\n this.setState({ selectedProvincesArray: this.state.selectedProvincesArray.push('44')})\n\n \n //this.setState({selectedProvincesArray: [this.state.selectedProvincesArray,this.state.provinceObj]})\n \n\n }\n \n })\n console.log(this.state.selectedProvincesArray) \n console.log(this.state.selectedProvincesArray[0]) \n event.preventDefault(); //Stops page from refreshing once submit is clicked\n }", "title": "" }, { "docid": "36a0b8620fcccf648889d168b9e4b9e7", "score": "0.53299046", "text": "function select(state) {\n return {\n }\n}", "title": "" }, { "docid": "e83962f5f643b44ac7d8db164ed89f3f", "score": "0.5311457", "text": "function createFormArrayState(id, initialValue) {\n const controls = initialValue\n .map((value, i) => createChildState(`${id}.${i}`, value));\n return computeArrayState(id, controls, initialValue, {}, [], {}, { wasOrShouldBeEnabled: true });\n}", "title": "" }, { "docid": "b5461103b17d13ef2bffe24603fc139e", "score": "0.52986264", "text": "function createSelectionTypeArray()\n {\n for (let m = 0; m < FormItPlugins.GenerateStringLights.arrays.typeArray.length; m++)\n {\n if (FormItPlugins.GenerateStringLights.arrays.typeArray[m] === validType)\n {\n FormItPlugins.GenerateStringLights.arrays.bIsEdgeTypeArray.push(true);\n }\n else \n {\n FormItPlugins.GenerateStringLights.arrays.bIsEdgeTypeArray.push(false);\n }\n }\n //console.log(\"Is valid array: \" + deanstein.GenerateStringLights.arrays.bIsEdgeTypeArray);\n }", "title": "" }, { "docid": "5b8a8f82729bac3aafbb928cba83bff1", "score": "0.5285324", "text": "function getArrayData() {\n var formData = form.serializeArray();\n var data = {};\n $(formData).each(function (index, obj) {\n data[obj.name] = obj.value;\n });\n console.log(data);\n return data;\n }", "title": "" }, { "docid": "1529ce7878def953e701015217c58b1b", "score": "0.52739394", "text": "getValue() {\n //console.log(\"AsyncSelectInput.getValue(): this.props.value = \",\n // this.props.value[this.props.valueKey] + \" - \" + this.props.value[this.props.labelKey]);\n\n return {\n [this.props.valueKey]: this.props.value[this.props.valueKey],\n [this.props.labelKey]: this.props.value[this.props.labelKey]\n };\n }", "title": "" }, { "docid": "a20c61d32174bff6b9d0bd9ad3be7b5a", "score": "0.526353", "text": "function populateForm (array, index) {\n\t'use strict';\n\tvar\tfunctionTitle = document.getElementById('functionTitle'),\n\t\t\tdescription = document.getElementById('description'),\n\t\t\ttextField = document.getElementById('textField');\n\n\tfunctionTitle.innerHTML=arrayOfObjects[index].title;\n\tdescription.innerHTML=arrayOfObjects[index].description;\n\ttextField.placeholder=arrayOfObjects[index].placeholder;\n}", "title": "" }, { "docid": "9c0b2e0244423a36f7275644315fd4ea", "score": "0.5262725", "text": "function objectifyForm(formArray) {//serialize data function\r\n\r\n var returnArray = {};\r\n for (var i = 0; i < formArray.length; i++){\r\n returnArray[formArray[i]['name']] = formArray[i]['value'];\r\n }\r\n return returnArray;\r\n}", "title": "" }, { "docid": "8f987726cd13ad7aff2bdcad38a268f6", "score": "0.5229081", "text": "function initialize(){ \n\t_initializeButtonValue(ARRAYVALUE);//private function\n}", "title": "" }, { "docid": "7f9d6f6f339c7a43e3262064f2ebc65e", "score": "0.51842594", "text": "constructMulti(attribute, arr) {\n let query = this.state.query;\n if (arr.length) {\n query.filters[attribute] = arr.map(option => option.value);\n } else {\n delete query.filters[attribute];\n }\n\n if (Object.keys(this.state.query.filters).length) {\n this.postSearch();\n } else {\n this.setState({\n data: [{}]\n });\n }\n }", "title": "" }, { "docid": "b2cf8b0b56f900c198b2dd9dd1de4396", "score": "0.5179137", "text": "function form_values() {\n var selectedIDs = []\n $.each(all_selected, function(id, select){\n selector = select.split(\"|\")\n var engineer = selector[0];\n var mdate = selector[1];\n attr = {\n \"engineer\": engineer,\n \"date\": mdate,\n }\n selectedIDs.push(attr);\n })\n return {\n \"key\": selectedIDs,\n }\n}", "title": "" }, { "docid": "0459398f27e11a3f5538134d04d18440", "score": "0.51553667", "text": "function getState() {\r\n stateSelected = $(\"select\").val();\r\n console.log(stateSelected + \" --Selected State\");\r\n}", "title": "" }, { "docid": "500d1ba229fdf79cec9c663537d71aef", "score": "0.5124985", "text": "function GetSetJsonInspectionInputTypeData(type, caption, fieldCounter, currentSelectedVal, id, option = null) {\n if (currentSelectedVal == \"P\") {\n var InspectionInputTypeData = new GetInputType(type, caption, fieldCounter, id, option);\n PInspectionInputTypeArray.push(InspectionInputTypeData);\n }\n //else if (currentSelectedVal == \"U\") {\n // var InspectionInputTypeData = new GetInputType(type, caption, fieldCounter, option);\n // UInspectionInputTypeArray.push(InspectionInputTypeData);\n //}\n else if (currentSelectedVal == \"F\") {\n var InspectionInputTypeData = new GetInputType(type, caption, fieldCounter, id, option);\n FInspectionInputTypeArray.push(InspectionInputTypeData);\n }\n //else if (currentSelectedVal == \"RR\") {\n // var InspectionInputTypeData = new GetInputType(type, caption, fieldCounter, id, option);\n // RRInspectionInputTypeArray.push(InspectionInputTypeData);\n //}\n\n}", "title": "" }, { "docid": "29577e737f887edc725a248d37c9a5c5", "score": "0.5111734", "text": "createFormForOption() {\n var formHtml = [];\n var cols = this.props.data;\n\n // request the 'Option' header differently from the content\n formHtml.push(\n <span key='span_row0'>\n <span key='header_text' className='input-text form-header' >New Option Name:</span>\n <input type='text' key='header' className='form-header' placeholder='New option name' autoFocus \n value={this.state.header} \n onChange={this.handleChangeHeader}\n ref='optionName' />\n <input type='text' key='header_score' name='score' className='form-header score-display' \n autoComplete='off' readOnly='true' \n value={this.state.optScore} \n ref='optionNameScore'/>\n </span>\n );\n\n // TODO: pagination!\n // column headers are unique, so they can be the key\n // request all the corresponding information\n if (this.state.header.trim().length !== 0) {\n for (var i = 1, len = cols.length; i < len; i++) {\n formHtml.push(\n <span key={'span_row'+i}>\n <span key={'label' + cols[i]._id} className='input-text'>{cols[i].name}: </span>\n <input type='text' key={'value' + cols[i]._id}\n placeholder={'Input ' + cols[i].name + ' for ' + this.state.header} \n ref={'optionValue' + i} />\n <input type='number' key={'score' + cols[i]._id} name='score' className='input-text'\n min='1' max='10' defaultValue='5' autoComplete='off' \n ref={'optionValueScore' + i} />\n </span>\n );\n }\n }\n return formHtml;\n }", "title": "" }, { "docid": "279408f63bd6cd2f37be534fa8822f34", "score": "0.5105147", "text": "function getInitialFormState() {\n\t\tconst formFields = getFormFields();\n\n\t\tconst formFieldNames = formFields.reduce((obj, field) => {\n\t\t\tobj[field.name] = getFormFieldDefaultValue(field);\n\t\t\treturn obj;\n\t\t}, {});\n\n\t\treturn formFieldNames;\n\t}", "title": "" }, { "docid": "0b867fdbcaecbac5c6b179b0e8ab16d0", "score": "0.5096185", "text": "get formElementsArray() {\n return this.__formElementsArray;\n }", "title": "" }, { "docid": "3fe7c2f3ae9fba0a05909aee9782dde2", "score": "0.5087368", "text": "constructTipoArrayError(){\n return[{label:'Hubo un error',value:''}];\n }", "title": "" }, { "docid": "6dc2575317f939fe1623504b59ecfd5c", "score": "0.508434", "text": "function getFormData($form){\n\t var unindexed_array = $form.serializeArray();\n\t var indexed_array = {};\n\t\n\t $.map(unindexed_array, function(n, i){\n\t indexed_array[n['name']] = n['value'];\n\t });\n\t\n\t return indexed_array;\n\t}", "title": "" }, { "docid": "6d6b5c76eda06b0f1b151a7da47f433f", "score": "0.50786585", "text": "createTag() {\n const tags = [\n ...this.state.tags,\n {\n value: this.state.value,\n special: this.state.isSpecial,\n },\n ];\n this.props.onChange(tags);\n }", "title": "" }, { "docid": "f48dbc14031488d2b04e8949844d5aa5", "score": "0.507776", "text": "prepareData(formArray) {\n\t\tvar map = {};\n\t\tfor (var i = 0; i < formArray.length; i++){\n\t\t map[formArray[i]['name']] = formArray[i]['value'];\n\t\t}\n\n\t\treturn map\n }", "title": "" }, { "docid": "79444f4086a979c4f8182f924f7c4869", "score": "0.5077667", "text": "getValue() {\r\n let schema = [this.props.targetKey || 'contact'];\r\n let isFormValid = isValidForm(schema, this.refs);\r\n if (!isFormValid) {\r\n return false;\r\n }\r\n let obj = getForm(schema, this.refs);\r\n return { ...obj[this.props.targetKey || 'contact'] };\r\n }", "title": "" }, { "docid": "a05308fedf96f4f4a8c719ebfd22af1e", "score": "0.5077422", "text": "function select(state) {\n\n return {\n todoItemText: state.todoItemText,\n todoBeingEdited: state.todoBeingEdited,\n todoBeingEditedPriorState: state.todoBeingEditedPriorState,\n todos: state.todos,\n inProgress: state.inProgress,\n activeTodoId: state.activeTodoId,\n err: state.err\n };\n}", "title": "" }, { "docid": "fed3a05c5083ca97151f4f46b098711f", "score": "0.5074774", "text": "handleChange(index, type, event) {\n let temp = [...this.state[event.target.name]];\n let value = event.target.value;\n temp[index][type] = value;\n this.setState({ [event.target.name]: temp });\n }", "title": "" }, { "docid": "0f93831af91bdc59440c93b8bdad55b2", "score": "0.50727475", "text": "handleChange(event) {\n let obj = []\n obj[event.target.name] = event.target.value\n this.setState(obj)\n }", "title": "" }, { "docid": "0f93831af91bdc59440c93b8bdad55b2", "score": "0.50727475", "text": "handleChange(event) {\n let obj = []\n obj[event.target.name] = event.target.value\n this.setState(obj)\n }", "title": "" }, { "docid": "e32e32a09027a1c21a45baa0c3c67fcd", "score": "0.50699157", "text": "function initialFormValue(tipoPerstate) {\n if (tipoPerstate == 1) {\n return {\n primerNombre: llenarDelStorage(\"primerNombre\", \"\", tipoPerstate),\n segundoNombre: llenarDelStorage(\"segundoNombre\", \"\", tipoPerstate),\n primerApellido: llenarDelStorage(\"primerApellido\", \"\", tipoPerstate),\n segundoApellido: llenarDelStorage(\"segundoApellido\", \"\", tipoPerstate),\n apodo: llenarDelStorage(\"apodo\", \"\", tipoPerstate),\n fallecido: llenarDelStorage(\"fallecido\", \"NO\", tipoPerstate),\n fechaNacimiento: llenarDelStorage(\"fechaNacimiento\", \"\", tipoPerstate),\n fechaDefuncion: llenarDelStorage(\"fechaDefuncion\", \"\", tipoPerstate),\n cedula: llenarDelStorage(\"cedula\", \"\", tipoPerstate),\n credencialSerie: llenarDelStorage(\"credencialSerie\", \"\", tipoPerstate),\n credencialNumero: llenarDelStorage(\"credencialNumero\", \"\", tipoPerstate),\n sexo: llenarDelStorage(\"sexo\", \"\", tipoPerstate),\n identidadGenero: llenarDelStorage(\"identidadGenero\", \"\", tipoPerstate),\n raza: llenarDelStorage(\"raza\", \"\", tipoPerstate),\n domicilioActual: llenarDelStorage(\"domicilioActual\", \"\", tipoPerstate),\n domicilioAnterior: llenarDelStorage(\n \"domicilioAnterior\",\n \"\",\n tipoPerstate\n ),\n telefono_celular: llenarDelStorage(\"telefono_celular\", \"\", tipoPerstate),\n correoElectronico: llenarDelStorage(\n \"correoElectronico\",\n \"ejemplo@mail.com\",\n tipoPerstate\n ),\n seccionalPolicial: llenarDelStorage(\n \"seccionalPolicial\",\n \"\",\n tipoPerstate\n ),\n estadocivil_id: llenarDelStorage(\"estadocivil_id\", \"\", tipoPerstate),\n pais_id: llenarDelStorage(\"pais_id\", \"\", tipoPerstate),\n tipo_persona_id: tipoPerstate,\n inscripcion_id: \"1\",\n departamento_id: llenarDelStorage(\"departamento_id\", \"\", tipoPerstate),\n ciudadBarrio_id: llenarDelStorage(\"ciudadBarrio_id\", \"\", tipoPerstate),\n\n nombre_departamento_estado: llenarDelStorage(\n \"nombre_departamento_estado\",\n \"\",\n tipoPerstate\n ),\n nombre_ciudad: llenarDelStorage(\"nombre_ciudad\", \"\", tipoPerstate),\n };\n } else {\n return {\n primerNombre: llenarDelStorage(\"primerNombre\", \"\", tipoPerstate),\n segundoNombre: llenarDelStorage(\"segundoNombre\", \"\", tipoPerstate),\n primerApellido: llenarDelStorage(\"primerApellido\", \"\", tipoPerstate),\n segundoApellido: llenarDelStorage(\"segundoApellido\", \"\", tipoPerstate),\n apodo: llenarDelStorage(\"apodo\", \"\", tipoPerstate),\n fallecido: llenarDelStorage(\"fallecido\", \"\", tipoPerstate),\n fechaNacimiento: llenarDelStorage(\"fechaNacimiento\", \"\", tipoPerstate),\n fechaDefuncion: llenarDelStorage(\"fechaDefuncion\", \"\", tipoPerstate),\n cedula: llenarDelStorage(\"cedula\", \"0\", tipoPerstate),\n credencialSerie: llenarDelStorage(\"credencialSerie\", \"\", tipoPerstate),\n credencialNumero: llenarDelStorage(\"credencialNumero\", \"0\", tipoPerstate),\n sexo: llenarDelStorage(\"sexo\", \"\", tipoPerstate),\n identidadGenero: llenarDelStorage(\"identidadGenero\", \"\", tipoPerstate),\n raza: llenarDelStorage(\"raza\", \"\", tipoPerstate),\n domicilioActual: llenarDelStorage(\"domicilioActual\", \"\", tipoPerstate),\n domicilioAnterior: llenarDelStorage(\n \"domicilioAnterior\",\n \"\",\n tipoPerstate\n ),\n telefono_celular: llenarDelStorage(\"telefono_celular\", \"0\", tipoPerstate),\n correoElectronico: llenarDelStorage(\n \"correoElectronico\",\n \"ejemplo@mail.com\",\n tipoPerstate\n ),\n seccionalPolicial: llenarDelStorage(\n \"seccionalPolicial\",\n \"\",\n tipoPerstate\n ),\n estadocivil_id: llenarDelStorage(\"estadocivil_id\", \"0\", tipoPerstate),\n pais_id: llenarDelStorage(\"pais_id\", \"0\", tipoPerstate),\n tipo_persona_id: tipoPerstate,\n inscripcion_id: \"1\",\n departamento_id: llenarDelStorage(\"departamento_id\", \"0\", tipoPerstate),\n ciudadBarrio_id: llenarDelStorage(\"ciudadBarrio_id\", \"0\", tipoPerstate),\n nombre_departamento_estado: llenarDelStorage(\n \"nombre_departamento_estado\",\n \"\",\n tipoPerstate\n ),\n nombre_ciudad: llenarDelStorage(\"nombre_ciudad\", \"\", tipoPerstate),\n };\n }\n}", "title": "" }, { "docid": "5dfa0b70d925e388a98c40a4598dbccb", "score": "0.50641626", "text": "_getState(props) {\n\n const {\n onChangeWidgetProperty,\n children,\n factories,\n formats = {},\n onSubmit,\n requestUploadUrl,\n url,\n types = {},\n } = props\n\n // value is the value of the whole form in an object, and will be updated with every change on the form\n let { options = {}, type, value } = props\n\n // transform is a function that transform a valid json to a tcomb object attending the registered formats and types\n // Remove all the registered formats and types\n transform.resetFormats()\n transform.resetTypes()\n\n // Register formats and types as props from the json\n Object.entries(formats).forEach(entry => transform.registerFormat(...entry))\n Object.entries(types).forEach(entry => transform.registerType(...entry))\n\n // Pass custom variables and callbacks to the `Form` instance trhough the options field\n if (onSubmit) options.onSubmit = onSubmit\n if (requestUploadUrl) options.requestUploadUrl = requestUploadUrl\n if (url) options.url = url\n options.triggerValidation = this._triggerValidation\n\n // Get type definition\n type = type || children || {}\n\n // If a string is passed it is first transform to JSON object\n if (typeof type === 'string') type = JSON.parse(type)\n\n if (!(typeof type === 'function')) {\n [type, options, value] = jsonToTcombObjectAndUpdate(type, value, options, factories, transform, onChangeWidgetProperty)\n }\n // Update values ot the options like if there is a validation error, disable submit values\n options = this._updateOptions(options, type)\n\n return { options, type, value }\n }", "title": "" }, { "docid": "ee281826f904c39d3568e052d9e25691", "score": "0.50638086", "text": "onChangeProcedure(e, index) {\n const temp = [...this.state.procedures];\n temp[index] = e.target.value;\n this.setState({procedures:temp})\n }", "title": "" }, { "docid": "88699b0ebcbc03634fdcd8990350dcad", "score": "0.5058648", "text": "onChange(event){\n this.setState({\n [event.target.name] : [event.target.value]\n })\n }", "title": "" }, { "docid": "540d6cbd895376cb7ee4aa11f24b38b3", "score": "0.5048068", "text": "handleChangeFields(event){\n const name = event.target.name;\n const value = event.target.value;\n const obj = {};\n obj[name] = value; \n this.setState(obj);\n }", "title": "" }, { "docid": "fa1c24b7b2c30993ad262a90c7a5987f", "score": "0.5042475", "text": "createSelect(selectedOption, selectedType) {\n const arrayOfData = selectedOption;\n return arrayOfData.map((data) =>\n <option\n key={data[selectedType]}\n value={data[selectedType]}\n >\n {data[selectedType]}\n </option>\n );\n }", "title": "" }, { "docid": "6ed5de80074fa5e77a8820b5b40470f7", "score": "0.5033909", "text": "changeHandler(event) {\n console.log(\"name\", event.target.name);\n console.log(\"value\", event.target.value);\n const { name, value } = event.target;\n this.selected = { ...this.selected, [name]: value };\n }", "title": "" }, { "docid": "0d03510d45911f1843a7ca586b076b87", "score": "0.50317836", "text": "function formArrayReducer(state, action) {\n if (!state) {\n throw new Error('The array state must be defined!');\n }\n return formArrayReducerInternal(state, action);\n}", "title": "" }, { "docid": "3fdb56d0d7032f93286ca2c6938f1f68", "score": "0.5028073", "text": "getValues() {\n return {\n description: Form.description.value,\n amount: Form.amount.value,\n date: Form.date.value\n }\n }", "title": "" }, { "docid": "dc32aeb2f29867e55f35fe2dd1860bfd", "score": "0.5026032", "text": "function selectedCategoryArray(array) {\n let selectedArray = [];\n\n for (let i in array) {\n if (array[i].checked)\n {\n selectedArray.push(array[i].value);\n }\n }\n\n if (selectedArray === [])\n {\n return null;\n }\n\n return selectedArray;\n }", "title": "" }, { "docid": "251af6fb7667148d7ca421f69a14fb10", "score": "0.5013523", "text": "__getElementsParamsForm() {\n const currentParamsForm = {};\n [...this.__instanceForm.getElementsByTagName(\"input\")].forEach(\n (currentInputElement) => {\n currentParamsForm[currentInputElement.getAttribute(\"name\")] =\n currentInputElement.value;\n }\n );\n return currentParamsForm;\n }", "title": "" }, { "docid": "9763d87359e7150acb5dfbee502777a6", "score": "0.5007998", "text": "SET_SUBMITTED(state) {\n state.allForm = [\n { idSalon: state.idSalon },\n { idMaster: state.idMaster },\n { userDate: state.userDate },\n { userTime: state.userTime },\n { userName: state.userName },\n { userPhone: state.userPhone }\n ]\n }", "title": "" }, { "docid": "40f056608a34040dad9417c91a7c5da4", "score": "0.4990743", "text": "onTextChange(e) {\n // console.log(e.target);\n // keeping this here just in case I want to expand the form\n // const value = e.target.type === 'checkbox' ? e.target.checked : e.target.value;\n\n const name = e.target.name;\n const value = e.target.value; \n\n this.setState({\n [name]: value\n });\n }", "title": "" }, { "docid": "8c7a2dec6c3e5707c03fbee311864fe5", "score": "0.49854994", "text": "dadosForm(event){\n let form = this.state.form;\n form[event.target.name] = event.target.value;\n this.setState({form: form});\n }", "title": "" }, { "docid": "64e76f8ad6e58775903d31cd65927726", "score": "0.4985088", "text": "getValues(){\n let user = {};\n //Spreading an object to array \n [...this.formEl.elements].forEach(function(field, index){\n if(field.name == \"gender\") {\n if(field.checked){\n user[field.name] = field.value;\n }\n } else if(field.name == \"admin\") {\n user[field.name] = field.checked;\n } else {\n user[field.name] = field.value;\n }\n }); \n return new User(\n user.name,\n user.gender,\n user.birth,\n user.country, \n user.email,\n user.password, \n user.photo, \n user.admin\n );\n }", "title": "" }, { "docid": "ed0fd14cc41aafeba42e95db9472d422", "score": "0.49828705", "text": "onChange(e) {\r\n this.setState({ [e.target.name]: e.target.value });\r\n console.log(this.state);\r\n }", "title": "" }, { "docid": "2aac24017cff7be9f7f1544d22252bb4", "score": "0.4972826", "text": "function _egw_json_getFormValue(serialized, child)\n{\n\t//Return if the child doesn't have a name, is disabled, or is a radio-/checkbox and not checked\n\tif ((typeof child.name == \"undefined\") || (child.disabled && child.disabled == true) ||\n\t\t(child.type && (child.type == 'radio' || child.type == 'checkbox' || child.type == 'button' || child.type == 'submit') && (!child.checked)))\n\t{\n\t\treturn;\n\t}\n\n\tvar name = child.name;\n\tvar values = null;\n\n \tif ('select-multiple' == child.type)\n\t{\n\t\tvalues = new Array;\n \t\tfor (var j = 0; j < child.length; ++j)\n\t\t{\n \t\t\tvar option = child.options[j];\n \t\t\tif (option.selected == true)\n \t\t\t\tvalues.push(option.value);\n \t\t}\n \t}\n\telse\n\t{\n \t\tvalues = child.value;\n \t}\n\n\t//Special treatment if the name of the child contains a [] - then all theese\n\t//values are added to an array.\n\tvar keyBegin = name.indexOf('[');\n\tif (0 <= keyBegin) {\n\t\tvar n = name;\n\t\tvar k = n.substr(0, n.indexOf('['));\n\t\tvar a = n.substr(n.indexOf('['));\n\t\tif (typeof serialized[k] == 'undefined')\n\t\t\tserialized[k] = new Object;\n\n\t\tvar p = serialized; // pointer reset\n\t\twhile (a.length != 0) {\n\t\t\tvar sa = a.substr(0, a.indexOf(']')+1);\n\n\t\t\tvar lk = k; //save last key\n\t\t\tvar lp = p; //save last pointer\n\n\t\t\ta = a.substr(a.indexOf(']')+1);\n\t\t\tp = p[k];\n\t\t\tk = sa.substr(1, sa.length-2);\n\t\t\tif (k == '') {\n\t\t\t\tif ('select-multiple' == child.type) {\n\t\t\t\t\tk = lk; //restore last key\n\t\t\t\t\tp = lp;\n\t\t\t\t} else {\n\t\t\t\t\tk = _egw_json_getObjectLength(p);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof p[k] == 'undefined')\n\t\t\t{\n\t\t\t\tp[k] = new Object;\n\t\t\t}\n\t\t}\n\t\tp[k] = values;\n\t} else {\n\t\t//Add the value to the result object with the given name\n\t\tif (typeof values != \"undefined\")\n\t\t{\n\t\t\tserialized[name] = values;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "177976bccc057f37c9f0f5055d72850a", "score": "0.49718404", "text": "handleOnChange(event, index) {\n //extract values from form\n const { name, value } = event.target;\n //manipulate stare data indirectly\n const newState = this.state[name];\n newState[index] = value;\n\n //set state based on which form item is changed\n this.setState({ [name]: newState });\n }", "title": "" }, { "docid": "074e615eb2c3c4db7a0b276366e381d4", "score": "0.49680308", "text": "handleEvent (index, e) {\n var gratitudeCopy = this.state.gratitude.slice();\n gratitudeCopy[index] = e.target.value;\n\n this.setState({\n gratitude: gratitudeCopy\n });\n }", "title": "" }, { "docid": "d0e715a421abd908829a68b10bdb7b52", "score": "0.49679235", "text": "constructor(props) {\n super(props);\n\n this.state = {\n list: [\n {\n toDo: \"something\",\n done: false,\n id: 0\n },\n {\n toDo: \"something else\",\n done: false,\n id: 1\n }\n ],\n\n formValue: \"\"\n };\n }", "title": "" }, { "docid": "4960c6e1b0e365fe7247a54752b6d736", "score": "0.49654487", "text": "changeModelList(e) {\n this.setState({\n modelsArr: this.state.makersObj[e.target.value],\n });\n }", "title": "" }, { "docid": "3219943e5edffcc7afe424b58bfbd2d7", "score": "0.4962945", "text": "get state() {\r\n return this.i.a;\r\n }", "title": "" }, { "docid": "fef5d127f14c26a6cffc0e76574dcf9d", "score": "0.49611732", "text": "function select(state) {\n return {\n todos: state.todos,\n visibilityFilter: state.visibilityFilter,\n grid: state.grid\n }\n}", "title": "" }, { "docid": "2bdd970dd393ff5294865d5de10ba665", "score": "0.49559325", "text": "function createInput(name) {\n return {\n name,\n numVisited: 0,\n value: 1\n };\n}", "title": "" }, { "docid": "3c170d98f09e35ff345f094124851fb1", "score": "0.495338", "text": "function select(state) {\n return {\n testFilter1: state.testFilter1,\n testFilter2: state.testFilter2\n }\n}", "title": "" }, { "docid": "98d25542476549f03ae05d6b9f9e4585", "score": "0.4953098", "text": "handleChange(e,key) {\n // If Select Field changes...\n if (e.target.options) {\n // Grab custom attribute serviceid for the Service ID\n // Grab icon from the value\n // Grab type from the option text\n this.setState({\n formData: {\n ...this.state.formData,\n [key]: e.target.value,\n type: e.target.options[e.target.selectedIndex].text,\n serviceId: e.target.options[e.target.selectedIndex].getAttribute('serviceid')\n },\n });\n }\n // All other fields...\n else {\n this.setState({\n formData: {\n ...this.state.formData,\n [key]: e.target.value,\n },\n });\n }\n }", "title": "" }, { "docid": "cdc9263fc5aed2c88d0233eddbd9a059", "score": "0.4944573", "text": "handleSelectChange(selected, parentKey) {\n let tmpQuestions = this.state.questions;\n tmpQuestions[parentKey].attributes.answer = [];\n tmpQuestions[parentKey].attributes.errMessage = null;\n if (selected.value) {\n tmpQuestions[parentKey].attributes.answer.push(selected.value);\n }\n this.setState({ questions: tmpQuestions });\n }", "title": "" }, { "docid": "1730a4de1f8a3dbc1a83c2c942439d6b", "score": "0.4943916", "text": "createNestedAggregationOption(event) {\n let newAggregateForm = this.state.nestedAggregateFormStates;\n let conjunction = event.target.value;\n let i = newAggregateForm.length;\n let selectedColumns = this.state.selectedColumns.selected;\n\n if (i === 0) {\n newAggregateForm[i] = {\n selectedColumn: selectedColumns[0],\n aggregateCondition: \"avg\"\n };\n }\n\n this.setState({nestedAggregateFormStates: newAggregateForm});\n }", "title": "" }, { "docid": "acf0bf618d67733afd67d09365d825c3", "score": "0.49394637", "text": "getSelected() {}", "title": "" }, { "docid": "a1f2a13ea6cea59d0a1a6e6674b38dc9", "score": "0.49378988", "text": "constructor(){\n super();\n this.state = {\n currentValue: [],\n operation: '',\n num1:[],\n num2:[]\n }\n }", "title": "" }, { "docid": "b6f4134252e7918231bf8aec0320832f", "score": "0.49377683", "text": "createFormForCriterion() {\n var formHtml = [];\n var rows = this.props.data;\n\n // Input the column name separately\n formHtml.push(\n <span key='span_col'>\n <span key='header_text' className='input-text form-header'>New Criterion Name:</span>\n <input type='text' key='header' className='form-header' placeholder='New criterion name' autoFocus \n value={this.state.header} \n onChange={this.handleChangeHeader}\n ref='colName' />\n <input type='number' key='header_score' name='score' className='form-header' \n min='0' max='10' defaultValue='5' autoComplete='off' \n ref='colName_score' />\n </span>\n );\n\n // we have the ids for the input, so use that as a key \n // request all the corresponding information\n if (this.state.header.trim().length !== 0) {\n for (var i = 0, len = rows.length; i < len; i++) {\n var inputInfo = this.state.header + ' for ' + rows[i][this.props.optionIdx].value;\n formHtml.push(<span key={rows[i]._id + '_text'} className='input-text'>{inputInfo}:</span>);\n formHtml.push(<input key={rows[i]._id} type='text' ref={'textInput' + i}\n placeholder={'Type to add data for ' + inputInfo} />);\n formHtml.push(<input type='number' name='score' key={rows[i]._id + '_score'} ref={'textInput' + i + '_score'}\n className='input-text' min='1' max='10' defaultValue='5' autoComplete='off' />);\n }\n }\n return formHtml;\n }", "title": "" }, { "docid": "13727e53bb8c304eb50c57f52690bdf8", "score": "0.49315464", "text": "getValues() {\n return {\n description: Form.description.value,\n amount: Form.amount.value,\n date: Form.date.value\n }\n }", "title": "" }, { "docid": "ea65ba8fb2146e2522b72dedba365c13", "score": "0.49282658", "text": "function mkattr(e)\n {\n var a = soattr(e)\n //a[\"test1\"] = \"True\"\n //a[\"test2\"] = soinit\n //a[\"test3\"] = soelem(e)\n //a[\"test4\"] = getElementText(e)\n if ( soinit && soinit == soelem(e) )\n {\n a[\"selected\"] = \"True\"\n }\n return a\n }", "title": "" }, { "docid": "8f3c2d5d166887d62796e27142131e10", "score": "0.49274254", "text": "assetType(event){\n\n // Copy by value to work around immuntability\n let newPositions = this.state.assetPositions.slice();\n\n newPositions[3] = event.target.value;\n\n // Set State\n this.setState({assetPositions: newPositions});\n\n }", "title": "" }, { "docid": "da51d771119849176549312ed5d4cee4", "score": "0.491202", "text": "grindstate() {\n let state = {\n minimized: false,\n fields: {},\n filters: [],\n selected: this.selectedrow,\n sort: (this.currentsort) ? this.currentsort : this.defaultsort,\n search: null\n };\n\n for (let f of this.fields) {\n if (f.hidden === undefined) { f.hidden = false; }\n state.fields[f.name] = {\n name: f.name,\n hidden: f.hidden\n };\n }\n if (this.activefilters) {\n for (let f of this.activefilters) {\n state.filters.push({\n filterid: f.filterid,\n field: f.field,\n comparator: f.comparator,\n value: f.value\n });\n }\n }\n\n return state;\n }", "title": "" }, { "docid": "647a3282dd66fe5abd968ba8a2c95a92", "score": "0.49062768", "text": "handleSelectChange(value, e) {\n this.setState({\n [e.target.name]: value,\n }, () => this.getSubmitValidationState());\n }", "title": "" }, { "docid": "5669f0d74df01af6ae6029478fff3c72", "score": "0.49054164", "text": "onChange(e){\n this.setState({ [e.target.name] : e.target.value });\n }", "title": "" }, { "docid": "5669f0d74df01af6ae6029478fff3c72", "score": "0.49054164", "text": "onChange(e){\n this.setState({ [e.target.name] : e.target.value });\n }", "title": "" }, { "docid": "c7ba89f0f70334b08a184285fa54f432", "score": "0.48963925", "text": "function select(state) {\n return {\n signUpFormState: state.AuthReducer.signUpFormState,\n currentlySending: state.AuthReducer.currentlySending,\n errorMessage: state.AuthReducer.errorMessage,\n //cognitoUser: state.AuthReducer.cognitoUser,\n readyToConfirm: state.AuthReducer.readyToConfirm\n };\n}", "title": "" }, { "docid": "81a0af51d51cc80aae06a3a30bd82881", "score": "0.4894745", "text": "function genValidateObj(selectForm) {\n\n var allIn = $(selectForm+' :input').serializeArray();\n allIn.map(function(row,i){\n row.vel = {};\n row.ord = '';\n row.msg = {};\n row.errOnOff = {};\n //console.log(row.name);\n });\n console.log(JSON.stringify(allIn));\n return JSON.stringify(allIn);\n }", "title": "" }, { "docid": "7d2e66603fd999a8d0c739e9396c4ea7", "score": "0.48917496", "text": "function radioButtonType (fieldElement, arr) {\n //parent constructor call\n radioButtonType.prototype.parent.constructor.call(this, fieldElement, arr);\n this.listNo = arr.choiceNumber;\n this.maxNo = arr.maxNo;\n this.chosenValue = \"\";\n this.shown = 1;\n this.showInput = 1;\n this.subList = arr.subList;\n this.showSections = arr.showSections;\n this.noOfSections = arr.noOfSections;\n this.clickedSub = \"\";\n }", "title": "" }, { "docid": "bb5b0bb952e316b7c22a27dadd6bf50c", "score": "0.48912016", "text": "render () { // de cada option para obtener una array con los strings de cada una de \n return ( // las opciones seleccionadas, luego usamos setState con el nuevo array\n <div> {/* que creamos con las opciones seleccionadas. ACLARACION: Arrat.from() */}\n <h1> {/*puede recibir de segundo parametro un mapeo o cualquier transformacion */}\n Etiqueta Select <Unicorn /> {/*de datos. Luego con las techs seleccionadas hacemos un mapeado de los */}\n </h1> {/*items en el renderizado */}\n <form>\n <select\n value={this.state.techs} \n onChange={this.handleChange}\n multiple\n >\n <option value=\"Angular\">Angular</option>\n <option value=\"React\">React</option>\n <option value=\"Vue\">Vue</option>\n <option value=\"Vanilla\">Vanilla</option>\n </select>\n </form>\n <ul>\n {this.state.techs.map(tech => (\n <li key={tech}>\n { tech }\n </li>\n ))}\n </ul>\n </div>\n )\n }", "title": "" }, { "docid": "d39cb3d4aedb3c6e58eb28cf89c2db29", "score": "0.48874372", "text": "function State () {\n\treturn {\n\t\tchecked: false,\n\t\tbingo: 0,\n\t\ttext: \"\",\n\t};\n}", "title": "" }, { "docid": "8e36e6ba9dcde18e3f4cd3b76c06b60e", "score": "0.48823354", "text": "function formToParams(f, a) {\n var data = a || [],\n e, n, v, d, i, il, j, jl, o;\n \n f = f.getDOMNode();\n\n // Iterate over the form elements collection to construct the\n // label-value pairs.\n for (i = 0, il = f.elements.length; i < il; ++i) {\n e = f.elements[i];\n d = e.disabled;\n n = e.name;\n\n if (n && !d) {\n v = e.value;\n\n switch (e.type) {\n // Safari, Opera, FF all default options.value from .text if\n // value attribute not specified in markup\n case 'select-one':\n if (e.selectedIndex > -1) {\n o = e.options[e.selectedIndex];\n data.push([n, o.attributes.value && o.attributes.value.specified ? o.value : o.text]);\n }\n break;\n case 'select-multiple':\n if (e.selectedIndex > -1) {\n for (j = e.selectedIndex, jl = e.options.length; j < jl; ++j) {\n o = e.options[j];\n if (o.selected) {\n data.push([n, o.attributes.value && o.attributes.value.specified ? o.value : o.text]);\n }\n }\n }\n break;\n case 'radio':\n case 'checkbox':\n if (e.checked) {\n data.push([n, v]);\n }\n break;\n case 'file':\n // stub case as XMLHttpRequest will only send the file path as a string.\n case undefined:\n // stub case for fieldset element which returns undefined.\n case 'reset':\n // stub case for input type reset button.\n case 'button':\n // stub case for input type button elements.\n break;\n case 'submit':\n default:\n data.push([n, v]);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "bf798a9a279e187d089e3e99fc604fdc", "score": "0.4881093", "text": "handleChange(submission) {\n this.setState({[submission.target.name]: submission.target.value})\n}", "title": "" }, { "docid": "cb8b148b0d0a4db7944c6a240fe875c6", "score": "0.4878135", "text": "selectClass() {\n var inputArr = this.state.input.slice()\n this.state.error.map((item, index) => {\n if (this.state.error[index] == true) {\n inputArr[index] = 'empty_input'\n } else {\n inputArr[index] = ''\n }\n })\n this.setState({input: inputArr})\n }", "title": "" }, { "docid": "b0d135175a0c031d5bce626ff04ff9f0", "score": "0.48732364", "text": "makeFormInput (questionID, data) {\n const inputTypes = {\n \"TB\": \"text\",\n \"TA\": \"textarea\",\n \"SC\": \"radio\",\n \"MC\": \"checkbox\"\n };\n\n var question = data[\"Question\"];\n var questionType = data[\"Type\"];\n var options = data[\"Answer Choices\"];\n // console.log(questionID, question, questionType, options)\n switch (questionType) {\n case \"SC\": case \"MC\":\n var optionElements = Object.values(options).map((opt, i) => {\n let input = $('<input/>', {\n id: `${questionID}-${i}`, // question-[questionID]-[optionNumber]\n type: inputTypes[questionType],\n name: `${questionID}`,\n checked: (opt == data[\"Value\"])\n }).click(() => { this.setHasUnsavedChanges(true) });\n\n let label = $('<label/>', {\n class: `form-option`,\n for: `${questionID}-${i}`,\n html: `${opt}`\n });\n \n return input.add(label);\n });\n\n return $('<fieldset/>').append($('<legend>', {\n class: `question-label`,\n html: `${question}`\n }), optionElements);\n case \"TA\":\n let textarea = $('<textarea/>', {\n id: `${questionID}-${question}`\n }).change(() => { this.setHasUnsavedChanges(true); });\n textarea.html(data[\"Value\"]);\n\n let label = $('<label/>', {\n class: `question-label`,\n for: `${questionID}-${question}`,\n html: `${question}`\n });\n\n return label.add(textarea);\n default:\n console.log(\"Unknown question type: \", questionType);\n return null;\n }\n }", "title": "" }, { "docid": "46a22f83402af4651c23edbffebf9ee9", "score": "0.4869559", "text": "renderForm(item,labels) {\n return [\n <Select name=\"company\" value={item[\"company\"]} label={labels[\"company\"]} key=\"i1\" items={this.props.companies_list}/>,\n <Input name=\"number\" value={item[\"number\"]} label={labels[\"number\"]} keyboard=\"numeric\" key=\"i2\"/>,\n <DateTime name=\"date\" value={item[\"date\"]} label={labels[\"date\"]} key=\"i3\"/>,\n <Input name=\"amount\" value={item[\"amount\"]} label={labels[\"amount\"]} keyboard=\"decimal-pad\" key=\"i4\"/>,\n <Input name=\"description\" value={item[\"description\"]} label={labels[\"description\"]} multiline={true} key=\"i5\"/>\n ]\n }", "title": "" }, { "docid": "b7978e71548d374d2e55d75cf9e77878", "score": "0.4868468", "text": "function select(state) {\n return {\n contacts: state.contacts\n };\n}", "title": "" }, { "docid": "6c467ac79c113c2cc9650ac297ed01e1", "score": "0.48645037", "text": "onChange(e) {\r\n this.setState({[e.target.name]: e.target.value }, () => console.log(this.state));\r\n }", "title": "" }, { "docid": "6b6ffd28227436cbba3f8b7616e65dea", "score": "0.48616531", "text": "function prepareForSelect(array, valueKeyName, labelKeyName) {\n return array.map(function(arrayItem) {\n return {\n label: arrayItem[labelKeyName],\n value: arrayItem[valueKeyName]\n };\n });\n}", "title": "" }, { "docid": "419d8134e86c84487cfbd4160d38c7da", "score": "0.48598942", "text": "function __recieve_field(index){\n\treturn buildform.form_fields[index];\n}", "title": "" }, { "docid": "c740a56c513e9b8e695636e691608039", "score": "0.48578337", "text": "setInputValue(formIndex, value) {\n this.setState({\n inputValues: this.state.inputValues.map((item, valueIndex) => {\n if (formIndex == valueIndex) {\n return Object.assign(item, { value: value });\n }\n return item;\n })\n });\n }", "title": "" } ]
4809479d5ae35cbc8c401d58c6071b85
METHOD 3: split string into words, split words into chars, map over each character to return char uppercase or lower case
[ { "docid": "7e22388733bc9e77c95126f94b8255fe", "score": "0.6369253", "text": "function titleCase(str) {\n return str\n .split(\" \")\n .map((word) => {\n return word\n .split(\"\")\n .map((char, i) => {\n if (i === 0) return char.toUpperCase();\n else return char.toLowerCase();\n })\n .join(\"\");\n })\n .join(\" \");\n}", "title": "" } ]
[ { "docid": "5d560ec33042fddcdbc45ab5dd496b33", "score": "0.71821254", "text": "function titleCaseMap(str){\n\n //break string into array\n var arr = str.split(\" \");\n var mapped = arr.map(function(word){\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n })\n return mapped.join(' ');\n\n}", "title": "" }, { "docid": "797469bad5597ee5a8c9bfe94246b0e2", "score": "0.7122949", "text": "function wordUpper(str){\n var wordArray=str.split(\" \");\n for(let i=0;i<wordArray.length;i++){\n var char=wordArray[i].charAt(0);\n wordArray[i]=wordArray[i].replace(char,function replace(char){\n return char.toUpperCase();\n })\n }\n return wordArray.join(\" \");\n}", "title": "" }, { "docid": "dcc5e3892bd909226c091dde8430dda5", "score": "0.70561624", "text": "function capitalizeLetters(str) {\n\n // 1. USING A FOR LOOP\n // const strArr = str.toLowerCase().split(' ');\n // for (let i = 0; i < strArr.length; i++) {\n // strArr[i] = strArr[i]\n // .substring(0, 1)\n // .toUpperCase() +\n // strArr[i].substring(1);\n // }\n // return strArr.join(' ');\n\n // 2. USING A MAP FUNCTION\n // return str\n // .toLowerCase()\n // .split(' ')\n // .map(word => word[0].toUpperCase() + word.substr(1))\n // .join(' ');\n\n // 3. REGULAR EXPRESSIONS\n return str.replace(/\\b[a-z]/gi, char => char.toUpperCase());\n}", "title": "" }, { "docid": "b67e598b994c7bc5ab9951e7f693cd2b", "score": "0.69995785", "text": "function capitaliseLetter(str){\n\n //convert all to lowercase\n //split the acceptem params into individual words\n //in each word , isolate first letter and uppercase it , concat the rest of the character\n //join back all character to return a proper sentence with space\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ')\n}", "title": "" }, { "docid": "224a797026bf8b4c1eb4fee89a2105d7", "score": "0.69908184", "text": "function CapitalizeLetters(str){\n return str\n .toLowerCase()\n .split(' ')//split by word, add a space\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "title": "" }, { "docid": "8b9578548f6d93f63b656b2eeaefac72", "score": "0.6958199", "text": "function initCaps(str){\n words = str.split(' ');\n\n for(var i = 0; i < words.length; i++) {\n var letters = words[i].split('');\n letters[0] = letters[0].toUpperCase();\n words[i] = letters.join('');\n }\n return words.join(' ');\n }", "title": "" }, { "docid": "72555b152e3256f27f442cfb38614081", "score": "0.69490296", "text": "function titleCase(str) {\n // Step 1. Lowercase the string\n str = str.toLowerCase() // str = \"i'm a little tea pot\";\n\n // Step 2. Split the string into an array of strings\n .split(' ') // str = [\"i'm\", \"a\", \"little\", \"tea\", \"pot\"];\n\n // Step 3. Map over the array\n .map(function(word) {\n return (word.charAt(0).toUpperCase() + word.slice(1));\n /* Map process\n 1st word: \"i'm\" => (word.charAt(0).toUpperCase() + word.slice(1));\n \"i'm\".charAt(0).toUpperCase() + \"i'm\".slice(1);\n \"I\" + \"'m\";\n return \"I'm\";\n 2nd word: \"a\" => (word.charAt(0).toUpperCase() + word.slice(1));\n \"a\".charAt(0).toUpperCase() + \"\".slice(1);\n \"A\" + \"\";\n return \"A\";\n ...\n 5th word: \"pot\" => (word.charAt(0).toUpperCase() + word.slice(1));\n \"pot\".charAt(0).toUpperCase() + \"pot\".slice(1);\n \"P\" + \"ot\";\n return \"Pot\";\n End of the map() method */\n});\n\n // Step 4. Return the output\n return str.join(' '); // [\"I'm\", \"A\", \"Little\", \"Tea\", \"Pot\"].join(' ') => \"I'm A Little Tea Pot\"\n}", "title": "" }, { "docid": "358ef7f7f80b1ba937856b48d70a8f2a", "score": "0.69411325", "text": "caseFix(str){\n var splitStr = str.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n }", "title": "" }, { "docid": "90308856c1d53cbcaa4ee5d427b04cdf", "score": "0.6904841", "text": "function upperWords(string) {\n return string.split(' ').map(word => {\n return word.substr(0, 1).toUpperCase() + word.substr(1);\n }).join(' ');\n}", "title": "" }, { "docid": "94929721a4aaf0795828ed9c85cfecb5", "score": "0.68849677", "text": "function capitalizeEachWords(str){\n return str.toUpperCase();\n}", "title": "" }, { "docid": "7e518e71060db94b78ecb49f98896676", "score": "0.68735594", "text": "function solution1(s){ \n var answer = s.split(' ').map((content)=>{\n return content.charAt(0).toUpperCase()+content.substring(1);\n }).join('');\n\n return answer;\n}", "title": "" }, { "docid": "dda09a54610bd6e060faf3ea5d678ba1", "score": "0.6861468", "text": "function ucwords(string) {\n return string.split(\" \").map((word) => {\n return word.charAt(0).toUpperCase() + word.slice(1);\n }).join(\" \");\n}", "title": "" }, { "docid": "fce4ca93e8f5044daab1a89609b506c6", "score": "0.6831807", "text": "function capitalize_words(string) {\n //** map is chainable while forEach is not chainable **\n\n string = string.split(' ').map(function(wrd) {\n wrd = wrd.split('').map(function(letter, index) {\n if (index === 0)\n return letter.toUpperCase();\n else return letter;\n }).join('');\n return wrd;\n }).join(' ');\n return string;\n }", "title": "" }, { "docid": "dd4483332f5c9a9dccd18a16ff8d2b19", "score": "0.6810547", "text": "function staggeredCase2(string) {\n let needUpper = true;\n let newChar;\n\n return string.split('').map(char => {\n if (char.match(/[a-z]/i)) {\n if (needUpper) {\n newChar = char.toUpperCase();\n } else {\n newChar = char.toLowerCase();\n }\n\n // flips the boolean each time through the loop when the char is a letter\n needUpper = !needUpper;\n return newChar;\n } else {\n return char;\n }\n }).join('');\n}", "title": "" }, { "docid": "a65a745a4db05ea9bbccedf71b0bbdb6", "score": "0.68015605", "text": "function makeAllFirstLettersCaps(str){\r\n\t// str.split(' ')\r\n\t// .map(word => console.log(word[0].toUpperCase()))\r\n\tvar convert = str.split(' ')\r\n\t .map(word =>word[0].toUpperCase()+word.substring(1))\r\n\t .join(' ')\r\n\treturn convert;\r\n}", "title": "" }, { "docid": "2089e0b4e2bcf91bf403a006dd0d91bb", "score": "0.6789601", "text": "function wordCap(str) {\n let result = str\n .split(' ')\n .map(word => word[0].toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n console.log(result);\n return result;\n}", "title": "" }, { "docid": "cb3115ba7ca60b70860646767fdd0bd8", "score": "0.67851424", "text": "function capitalizeAllWords(string) {\n // variable to hold string split up into an array at each space and converted to lowercase\n var splitStr = string.toLowerCase().split(' ');\n // loop through varialbe array \n for (var i = 0; i < splitStr.length; i++) {\n // concatente first character.toUpperCase of array element i and remainder that same string\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n // join array into a string seperated by space\n return splitStr.join(' '); \n\n \n}", "title": "" }, { "docid": "b96c6e7fcc5f977ad7be9d6eb3a321de", "score": "0.6774994", "text": "function titleCase(str) {\n // Step 1. Lowercase the string\n str = str.toLowerCase() // str = \"i'm a little tea pot\";\n \n // Step 2. Split the string into an array of strings\n .split(' ') // str = [\"i'm\", \"a\", \"little\", \"tea\", \"pot\"];\n \n // Step 3. Map over the array\n .map(function(word) {\n return word.replace(word[0], word[0].toUpperCase());\n /* Map process\n 1st word: \"i'm\" => word.replace(word[0], word[0].toUpperCase());\n \"i'm\".replace(\"i\", \"I\");\n return word => \"I'm\"\n 2nd word: \"a\" => word.replace(word[0], word[0].toUpperCase());\n \"a\".replace(\"a\", \"A\");\n return word => \"A\"\n 3rd word: \"little\" => word.replace(word[0], word[0].toUpperCase());\n \"little\".replace(\"l\", \"L\");\n return word => \"Little\"\n 4th word: \"tea\" => word.replace(word[0], word[0].toUpperCase());\n \"tea\".replace(\"t\", \"T\");\n return word => \"Tea\"\n 5th word: \"pot\" => word.replace(word[0], word[0].toUpperCase());\n \"pot\".replace(\"p\", \"P\");\n return word => \"Pot\" \n End of the map() method */\n});\n\n // Step 4. Return the output\n return str.join(' '); // [\"I'm\", \"A\", \"Little\", \"Tea\", \"Pot\"].join(' ') => \"I'm A Little Tea Pot\"\n}", "title": "" }, { "docid": "926fcb88f9e2ebbb21784bc65076ace4", "score": "0.67649996", "text": "function capitalizeAllWords(string) {\n \n}", "title": "" }, { "docid": "5c1181f3bac35c88e4e294264352250a", "score": "0.675343", "text": "function capitalize_Words(str){\n return str.split(' ').map(v => (v[0].toUpperCase() + v.slice(1) )).join(' ');\t\n}", "title": "" }, { "docid": "280990c402cbc35b93d6c35ef47e7389", "score": "0.6738448", "text": "function stringTransformer(str) {\n return str\n .split(\"\")\n .map(eachLetter => {\n if(eachLetter.toLowerCase() === eachLetter ){\n return eachLetter.toUpperCase()\n } else {\n return eachLetter.toLowerCase()\n }\n })\n .join(\"\")\n .split(\" \")\n .reverse()\n .join(\" \");\n}", "title": "" }, { "docid": "936c1f7fb30ae2cd8f2b80ef6f534c91", "score": "0.6736439", "text": "function toWeirdCase(str){\r\n return str.split(\" \").map(function(word){\r\n return word.split(\"\").map(function(char, index){\r\n return (index % 2 === 0) ? char.toUpperCase() : char.toLowerCase();\r\n }).join(\"\");\r\n }).join(\" \");\r\n}", "title": "" }, { "docid": "69ed250ef9fe1007fa92e924cee8b018", "score": "0.6731953", "text": "function capitalizeLetters(str) {\n // First solution\n // const strArr = str.toLowerCase().split(' ');\n // for (let i = 0; i < strArr.length; i++) {\n // strArr[i] =\n // strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\n // }\n // return strArr.join(' ');\n ////////////////////////////\n // Second solution\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n ///////////////////////\n // Third solution\n // return str.replace(/\\b[a-z]/gi, char => char.toUpperCase());\n}", "title": "" }, { "docid": "4f651515c3df025521dcfc8b340d25dd", "score": "0.67173374", "text": "function titleCase(str) {\n\n let newWord = str.split(\" \");\n\n newWord = newWord.map((i) => {\n const firstLet = i.charAt(0).toUpperCase();\n\n i = firstLet.concat(i.slice(1 ,i.length));\n\n return i\n\n });\n\n newWord = newWord.join(\" \");\n return newWord; \n\n\n}", "title": "" }, { "docid": "f6be6d0b1d4c1f357bcfe8e7dc4ab71e", "score": "0.66811335", "text": "function capWords(str)\n{\nreturn str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "93b783716a881be0ae8d788e3beb70ce", "score": "0.6664677", "text": "function stringTransformer(str) {\n return str\n .split(' ')\n .map(word => [...word]\n .map(letter => letter.toLowerCase() === letter ? letter.toUpperCase() : letter.toLowerCase())\n .join('')\n )\n .reverse()\n .join(' ');\n}", "title": "" }, { "docid": "e4924ec2deb66a6b1416848ce390cac2", "score": "0.66643757", "text": "function capitalizeAllWords(string) {\n //turn string into all lowercase\n string = string.toLowerCase();\n //split string into array with .split (easier access to indivdual word manipulation)\n let stringArray = string.split(\" \");\n //for loop to access words in array \n for (let i = 0; i < stringArray.length; i++) {\n //assign each word to first letter cap'd using same method as above but with .substr (same effect as .slice)\n stringArray[i] = stringArray[i][0].toUpperCase() + stringArray[i].substr(1)\n }\n //assign string array to string with .join\n let capString = stringArray.join(\" \");\n //return string \n return capString;\n}", "title": "" }, { "docid": "155a92b17da2e6e7deb61dbbe9be496c", "score": "0.6642558", "text": "function upperCaseFirst(str) {\r\n return str.split(' ').map(function(word){\r\n return word[0].toUpperCase() + word.substr(1);\r\n })\r\n}", "title": "" }, { "docid": "9ba9d124db7a04c8a540437e464db734", "score": "0.6638935", "text": "function titleCase(str) {\n const lowerCaseString = str.toLowerCase();\n const wordsAsArray = lowerCaseString.split(\" \");\n console.log(wordsAsArray); // returns [ \"I'm\", 'a', 'little', 'tea', 'pot' ]\n const capitalizedWords = wordsAsArray.map((word) => {\n return word.replace(word.charAt(0), word.charAt(0).toUpperCase());\n });\n console.log(capitalizedWords); // returns [ \"I'm\", 'A', 'Little', 'Tea', 'Pot' ]\n return capitalizedWords.join(\" \");\n}", "title": "" }, { "docid": "7efa65af280ff9e7d3fe4d4ff1e61cff", "score": "0.6625265", "text": "strToCapitalizedWords(str) {\n return this.leaveOnlyAlphaNumericAndSpaces(str).replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function(letter) {\n return letter.toUpperCase();\n }).replace(/\\s+/g, \"\");\n }", "title": "" }, { "docid": "d12705b7d968967babfb0dd64a352256", "score": "0.6615863", "text": "function mountainCase(string) {\n\n}", "title": "" }, { "docid": "d12705b7d968967babfb0dd64a352256", "score": "0.6615863", "text": "function mountainCase(string) {\n\n}", "title": "" }, { "docid": "6ddedf539573b3b44844f938c7621a65", "score": "0.6610745", "text": "function camelize() {\r\n var str = document.getElementById(\"word_camelize\").value;\r\n document.getElementById(\"result_camelize\").innerHTML = \"The result is : \" +\r\n str.replace(/\\W+(.)/g, function(match, chr) {return chr.toUpperCase();});\r\n}", "title": "" }, { "docid": "50186bc7ceb861023cfcaf715f9d51cd", "score": "0.659729", "text": "function capitalizeWords(str){\n const words = str.split(' ')\n const upperWords = words.map( word => capitalize(word) )\n return upperWords.join(' ')\n}", "title": "" }, { "docid": "7824e550906d4bda25bb44d09f13260c", "score": "0.65967447", "text": "static camelise(inp, options={enforceCase:false}) {\n if (typeof(inp) !== 'string') return null;\n const words = inp.split(/[\\s_]+/g);\n return words.map((w,i) => {\n const wPre = i > 0 ? w[0].toUpperCase() : w[0].toLowerCase();\n const wSuf = options.enforceCase ? w.slice(1).toLowerCase() : w.slice(1);\n return `${wPre}${wSuf}`;\n }).join('');\n }", "title": "" }, { "docid": "17bb01205bdf7173ad7a7fc57e61bdc6", "score": "0.65916204", "text": "function letterCapitalize(str) {\n words = str.toLowerCase().split(' ');\n\n for(var i = 0; i < words.length; i++) {\n var letters = words[i].split('');\n letters[0] = letters[0].toUpperCase();\n words[i] = letters.join('');\n }\n return words.join(' ');\n}", "title": "" }, { "docid": "47e1364316384d5339e822c43a6e3f54", "score": "0.65872854", "text": "function wordsUppercase(string){\n\n result = string.toUpperCase().match(/\\w+/g).join(\", \");\n return result;\n\n}", "title": "" }, { "docid": "d18196276f60e511bb0ca134b6de2062", "score": "0.6572339", "text": "function upperFirst(str){\nstr = str.split(\" \")\nreturn str.map((str1)=>{return str1[0].toUpperCase()+str1.substring(1)}).join(\" \")\n\n}", "title": "" }, { "docid": "5d2d41c0fb21ff925fa12a22d75a3f32", "score": "0.65687823", "text": "function owoCasing(input) {\n return input\n .split(/(?<=[!.?]\\s*)/g)\n .map(satz => satz[0].toUpperCase() + satz.slice(1).toLowerCase())\n .join(\"\");\n}", "title": "" }, { "docid": "c5a6a2d821854851ebbecb61f115ff91", "score": "0.6564671", "text": "function capitalizeWord(string) {\n \n}", "title": "" }, { "docid": "adb1cd3e95c1d22bea843670e1a386d7", "score": "0.6562639", "text": "function capitalize_Words(input)\n{\nlet str = input.split(' ');\nfor(let i=0 ; i < str.length ; i++)\n{\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n}\nreturn str.join(' ') ;\n}", "title": "" }, { "docid": "fc5b1575edb63ba208cd2c167e2f3200", "score": "0.6561206", "text": "function wordCap(string) {\n let arr = string.split(\" \");\n let newArr = [];\n \n for (let i = 0; i < arr.length; i++) {\n newArr.push(arr[i][0].toUpperCase() + arr[i].slice(1, arr[i].length).toLowerCase());\n }\n \n console.log(newArr.join(\" \"));\n return newArr.join(\" \");\n}", "title": "" }, { "docid": "fb86e3e5bc53adf821baa379d3146d19", "score": "0.65482205", "text": "function setFirstLetterOfEachWordToUpperCase (str) {\n const SPACE = \" \";\n let words = str.split(SPACE);\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i].slice(0, 1).toUpperCase() + words[i].slice(1);\n }\n\n return words.join(SPACE);\n}", "title": "" }, { "docid": "eb06961a710b32a46580e3698d9f5350", "score": "0.65413225", "text": "function capitalizeWords(str){\r\n \r\n let words=str.split(' ');\r\n console.log(words)\r\n \r\n for(i=0; i<words.length; i++){\r\n \r\n let selectedWord=words[i]\r\n newWord=\"\"\r\n for (j = 0; j <selectedWord.length; j++) { \r\n if(j===0){\r\n newWord= newWord+selectedWord[j].toUpperCase() \r\n } \r\n else{\r\n newWord= newWord+selectedWord[j]\r\n }\r\n } \r\n console.log(newWord) \r\n } \r\n}", "title": "" }, { "docid": "b7bd0d8d5c40ba5523633793c914691f", "score": "0.6536645", "text": "function capitalizeAllWords(string) {\n // capitalizeAllWords() : Should take a string of words and return a string with all the words capitalized (2, 0, 2)\n //make all caps per every word in my index\n var newString = '';\n var stringArr = string.split(' ');\n for (var i = 0; i < stringArr.length; i++){\n stringArr[i] = stringArr[i][0].toUpperCase() + stringArr[i].substring(1);\n newString += stringArr[i] + ' ';\n }\n return newString = newString.slice(0, newString.length-1);\n}", "title": "" }, { "docid": "46aa7e93046cfe59b49b766cb1de3a13", "score": "0.6526965", "text": "function capitalize_words(string) {\n return string.replace(/\\b\\w+\\b/g,function(w){return w.charAt(0).toUpperCase()+w.slice(1);});\n}", "title": "" }, { "docid": "4d9b4a22cff97c709f80ea34053aaaaa", "score": "0.6526389", "text": "function stringTransformer(str) {\n // Your code here\n const myStr = str\n .split(\"\")\n\n const resultArr = [] \n \n myStr.forEach(char =>{\n charNum = char.charCodeAt()\n if(charNum >= 97 && charNum <= 122){\n resultArr.push(char.toUpperCase())\n }else if(charNum >= 65 && charNum <= 90){\n resultArr.push(char.toLowerCase())\n }else{\n resultArr.push(char)\n }\n\n \n })\n resultArr.join(\"\")\n \n return resultArr.join(\"\").split(\" \").reverse().join(\" \")\n }", "title": "" }, { "docid": "67f9b1a509769b3ecc010769b64cc67e", "score": "0.6526042", "text": "function LetterChanges(str) { \n var t = str.split('');\n var newStr = '';\n t.forEach(function(t){\n var letters = /^[A-Za-z]+$/;\n var vowels =/^[A,I,E,U,O,a,e,i,u,o]+$/;\n var temp = String.fromCharCode(t.charCodeAt()+1);\n if(t.match(letters)){\n if(temp.match(vowels)){\n newStr = newStr + temp.toUpperCase()\n }else{\n \n newStr = newStr + temp\n }\n }else{\n newStr = newStr + t\n }\n \n })\n return newStr; \n \n}", "title": "" }, { "docid": "2a2393de6ee10353bee9177a80a01b41", "score": "0.6514522", "text": "function toWeirdCase(string){\n return string.toLowerCase().split(' ').map(function(word){\n return word.split('').map(function(char, index){\n return index%2==0 ? char.toUpperCase() : char;\n }).join('')\n }).join(' ');\n}", "title": "" }, { "docid": "d1f903acdc9a15c57ae429e76220faae", "score": "0.6503895", "text": "function CapitalizeLetters(str){\n const strArr = str.toLowerCase().split(' ');\n\n for(let i =0; i < strArr.length; i ++){\n strArr[i] = strArr[i].substring(0,1).toUpperCase()+ //plucking out the first letter then we uppercase the rest\n strArr[i].substring(1); \n }\n\n return strArr.join(' ')//space because we are separating the words in an array not the characters\n}", "title": "" }, { "docid": "66587bc344eee3ce152674b6054db1ff", "score": "0.64987695", "text": "function alienLanguage(str) {\n let arr = str.split(/\\s+/);\n return arr.map(el => el.slice(0, -1).toUpperCase() + el.slice(-1).toLowerCase());\n}", "title": "" }, { "docid": "4b276f4176b0322f508d81592f23b6f1", "score": "0.6481368", "text": "function capitalizeLetters(str) {\n var wordArray = []; \n var splitStr = str.split(' '); // split returns an array\n\n for (var i = 0; i < splitStr.length; i++) {\n var splitWord = splitStr[i].split(''); // split returns an array of letters\n splitWord.splice(0, 1, splitWord[0].toUpperCase());//replace letter 1:caps\n splitWord = splitWord.join(''); // turns array to string\n wordArray.push(splitWord);\n };\n str = wordArray.join(' ');\n return str; \n}", "title": "" }, { "docid": "8c373075dd3186346fa51a573fe56625", "score": "0.6480809", "text": "function ucwords(str) {\n return (str + '').replace(/^([a-z])|\\s+([a-z])/g, function($1) {\n return $1.toUpperCase();\n });\n}", "title": "" }, { "docid": "252a2e094fa5bcf6d77e616b80d603f0", "score": "0.64791805", "text": "function capitalizeLetters(str) {\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substring(1))\n .join(' ');\n\n}", "title": "" }, { "docid": "927290b2221d40296d0f3cbd6e92c3fb", "score": "0.64785874", "text": "function capitalizeAllWords(string) {\n //we will split the string at each space into an array variable\n let split = string.split(\" \");\n //make an arrany to store the Capitalised strings\n let cap = [];\n //we will loop through the array, split, to capitalise eacch first letter\n for (let i = 0; i < split.length; i++){\n cap.push(split[i].charAt(0).toUpperCase() + split[i].slice(1));\n }\n //return split joined into a string.\n return cap.join(\" \");\n}", "title": "" }, { "docid": "8f56c1cfbe0ea0c3c62981965f3acd65", "score": "0.6477116", "text": "function titleCase(str) {\n var strSplit = str.split(\" \");\n\t//console.log(strSplit);\n\tvar currWord;\n\tvar firstLetter;\n\tvar remainingLetters;\n\tvar firstLetterUpper;\n\tvar result = \"\";\n \n\tfor (var i=0; i<strSplit.length; i++) {\n\t\tcurrWord = strSplit[i];\n\t // console.log(currWord);\n\t\tfirstLetter = currWord.substring(0,1);//to get the first letter\n\t\t//console.log(firstLetter);\n\t\tremainingLetters = currWord.substring(1);// to get the rest of the letters\n\t\t//console.log(remainingLetters);\n\t\tfirstLetterUpper = firstLetter.toUpperCase();//convert the first letter to uppercase.\n \n\t result = result + \" \" + (firstLetterUpper + remainingLetters.toLowerCase());\n \n\t}\n\t//console.log(result);\n\treturn result.trim();\n}", "title": "" }, { "docid": "d143f65099784e45fb6e3772969f6f9f", "score": "0.6471449", "text": "function CapitalizeLetters(str){\n return str.replace(/\\b[a-z]/gi,function(char){\n return char.toUpperCase();\n })\n}", "title": "" }, { "docid": "18506418e41e6f4037eff1f79d624d21", "score": "0.64686275", "text": "function capitalizeEachWord(string){\n var array = string.split(\" \");\n var words = [];\n for ( var i = 0; i < array.length; i++){\n var firstLetter = array[i][0].toUpperCase();\n var remainingLetters = array[i].substring(1, array[i].length); \n var joinedWords = firstLetter+remainingLetters;\n words.push(joinedWords);\n } \n return words.join(\" \");\n}", "title": "" }, { "docid": "2fded37725695ee7f9bdb96086f3f3f2", "score": "0.64619225", "text": "function toWeirdCase(string){\n var words = string.split(\" \");\n var newWords = words.map(function(word) {\n var wa = word.split(\"\");\n var newWa = [];\n for (var i = 0; i < wa.length; i++) {\n l = wa[i];\n if (i % 2 === 0) { l = l.toUpperCase(); }\n if (i % 2 !== 0) { l = l.toLowerCase(); }\n newWa.push(l);\n }\n return newWa.join(\"\");\n });\n return newWords.join(\" \");\n}", "title": "" }, { "docid": "8fd1b0a486b10d2330a3ef45ea5b6d53", "score": "0.64605206", "text": "function camelize(string) {\n \nvar arr = string.split('');\n\narr[0] = arr(/^\\w/).toUpperCase();\narr[string.length-1] = arr[string.length-1].toUpperCase();\n\nfor(i=0; i<arr.length; i++) {\n if(arr[i]===' ') {\n \tarr[i+1] = arr[i+1].toUpperCase();\n }\n if(arr[i]===' ') {\n \tarr[i-1] = arr[i-1].toUpperCase();\n }\n}\nreturn arr.join('');\n}", "title": "" }, { "docid": "0b6040c592b85b4bb2107df5fec7b4e8", "score": "0.64512116", "text": "camelCaseToCapitalizedWords(str) {\n return this.strToFirstLetterUpperCase(str.replace(/([A-Z]+)/g, \" $1\").replace(/([A-Z][a-z])/g, \"$1\"));\n }", "title": "" }, { "docid": "84365e89a0aac1e663e6458876bd508e", "score": "0.6448619", "text": "function changeToUpperCase(sentence){\n words = sentence.split(\" \");\n for (let i = 0; i < words.length; i++){\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n console.log(words[i])\n }\n }", "title": "" }, { "docid": "2541b14956b0946c9230afc13d01a4bc", "score": "0.64450264", "text": "function swap(str){\n return str.split('').map(char => char === char.toUpperCase() ? char.toLowerCase() : char.toUpperCase()).join('')\n}", "title": "" }, { "docid": "70528da2e4a8b5ecfcd306d7d3000303", "score": "0.64447147", "text": "function upperFirst(string){\n let separateWord = string.toLowerCase().split(' ');\n for (let i = 0; i < separateWord.length; i++) {\n separateWord[i] = separateWord[i].charAt(0).toUpperCase() +\n separateWord[i].substring(1);\n }\n return separateWord.join(' ');\n}", "title": "" }, { "docid": "e473b8998a1b7073587f012a313cbe4c", "score": "0.64411503", "text": "function jadenCase (str){\n\treturn str.split(' ').map(eachStr => eachStr.replace(eachStr.charAt(0), eachStr.charAt(0).toUpperCase())).join(' ')\n\n}", "title": "" }, { "docid": "d4effd86d628f974272544d446c46b14", "score": "0.6433525", "text": "function capitalize(str) {\n\t// MY SOLUTION\n\t// var stra = '';\n\t// stra += str[0].toUpperCase();\n\n\t// for (var i = 1; i<str.length; i++){\n // \t\tif(str.charCodeAt(i) === 32){\n // \t\t\tstra += \" \" + str[i+1].toUpperCase();\n // \t\t\ti++;\n // \t\t}\n // \t\telse{\n // \t\t\tstra+= str[i];\n // \t\t}\n // \t\t}\n\t// return stra;\n\n\t// INSTRUCTOR'S SOLUTION\n\tconst words = [];\n\n\tfor (let word of str.split(' ')){\n\t\twords.push(word[0].toUpperCase() + word.slice(1))\n\t}\n\treturn\twords.join(' ');\n}", "title": "" }, { "docid": "56a00d7e3041e5ee06de0e5dd11d9756", "score": "0.64295685", "text": "function jadenCase(word) {\n let words = word.toLowerCase();\n let arr = words.split(' ');\n let temps = \"\";\n for(let i = 0; i < arr.length; i++) {\n arr[i]= arr[i][0].toUpperCase() + arr[i].slice(1);\n temps = arr.join(' ');\n }\n return temps\n}", "title": "" }, { "docid": "3448d06921b6a55bc28089b2b0eaa4cf", "score": "0.6427413", "text": "function convertCase(string){\n var stringLength = string.length;\n\n //Create array from text\n var textArray = string.split(\"\");\n\n // Loop through the array to see wich char is an uppercase or lowrcase\n // Then inverse the uppercase to lowercase and vise versa\n for (var i = 0; i < stringLength; i++){\n var textPosition = textArray[i];\n\n if (isUpperCase(textPosition)){\n textArray[i] = textPosition.toUpperCase();\n } else {\n textArray[i] = textPosition.toLowerCase();\n }\n }\n\n // Convert the array to string\n return textArray.join(\"\");\n}", "title": "" }, { "docid": "19574b00ab8cfc646213d824db913b16", "score": "0.6417194", "text": "function titleCase(str) {\n array = str.split;\n\nreturn str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n \n}", "title": "" }, { "docid": "f270c13998f93136df556efd816c0250", "score": "0.64118904", "text": "function capitalizeAllWords(string) {\n //create an Array by using the split method on the string \n let newArr = string.split(\" \");\n //create another array\n let updateArr = [];\n //loop over the new array\n for(let i = 0; i < newArr.length; i++){\n updateArr.push(newArr[i][0].toUpperCase() + newArr[i].slice(1));\n }\nreturn updateArr.join(\" \"); //use the join method to concatenate the values into one string\n}", "title": "" }, { "docid": "743681dc49797de6d0bc2f631727066b", "score": "0.6406919", "text": "function capitalizeWords (input) {\n let words = input.split(' ').map(word => word.toLowerCase());\n let result = [];\n\n for (let word of words) {\n result.push(word[0].toUpperCase() + word.substring(1));\n }\n\n console.log(result.join(' '));\n}", "title": "" }, { "docid": "f2599b8de13a9ee6d3ad2fa30e87b0ca", "score": "0.6395955", "text": "function MPBCUCWords(thisString) {\r\nvar thisArray = thisString.split(' ');\r\nvar newString = '';\r\nfor (var n=0; n<thisArray.length; n++) {\r\n var firstChar = thisArray[n].charAt(0).toUpperCase();\r\n var theRest = thisArray[n].substring(1, thisArray[n].length);\r\n newString += firstChar+theRest+' ';\r\n }\r\nreturn newString.substring(0, newString.length - 1);\r\n}", "title": "" }, { "docid": "0b20f31959d027ea6a8e2e4e040d7c12", "score": "0.638098", "text": "titleIt(str) {\n\n str = str.split(\" \")\n str.map((word, i) => {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n })\n return str.join(\" \")\n }", "title": "" }, { "docid": "2a3574b3f652895869a618fb90b36995", "score": "0.63807195", "text": "function myReplace(str, before, after) {\n let arr = str.split(\" \");\n \n let arr2 = arr.map((word) =>{\n if(word === before){\n if(word.charAt(0) === word.charAt(0).toUpperCase()){\n after = after.charAt(0).toUpperCase()+after.slice(1);\n word = after;\n } else if(word.charAt(0) === word.charAt(0).toLowerCase()) {\n after = after.charAt(0).toLowerCase()+after.slice(1);\n word = after;\n }\n }\n return word;\n })\n \n let str2 = arr2.join(\" \")\n \n return str2;\n \n }", "title": "" }, { "docid": "e18091fa3d7710a93ad9ac7c1f898956", "score": "0.63686866", "text": "function LetterCapitalize(str) { \n\n str = str.split(\" \");\n \n for(var i = 0; i < str.length; i++){\n str[i] = str[i].split(\"\");\n str[i][0] = str[i][0].toUpperCase();\n str[i] = str[i].join(\"\");\n }\n \n str = str.join(\" \");\n // code goes here \n return str; \n \n}", "title": "" }, { "docid": "7c5ca6db605e56963ca690fccd4b81fe", "score": "0.63662374", "text": "function LetterChanges(str) { \n var key = 1;\n var tmpStr = str.split();\n \n for (var i=0; i<str.length; i++){\n if (IsAlpha(str[i])){\n tmpStr[i] = (ApplyKey(str[i], key));\n if (IsVowel(tmpStr[i])){\n tmpStr[i] = tmpStr[i].toUpperCase();\n }\n }\n else{\n tmpStr[i] = str[i];\n }\n }\ntmpStr = tmpStr.join('');\nreturn tmpStr;\n}", "title": "" }, { "docid": "985ec200e1e39fe6e56ee91ee4c8ab86", "score": "0.63650876", "text": "function capitalizeAllWords(string) {\n var newString = string.split(\" \");\n //loop over newString\n for (let i = 0; i < newString.length; i++) {\n //access the first letter charAt(0) and change with .toUpperCase and add this to the remainder of the word slice at (1)\n newString[i] = newString[i].charAt(0).toUpperCase() + newString[i].slice(1);\n }\n\t//join our words back together and assign to a new variable\n var joinedString = newString.join(' ');\n //return the newly created variable\n return joinedString;\n}", "title": "" }, { "docid": "3696dd6dc34d5d812f6b17d49a119c8b", "score": "0.6363423", "text": "function capitalizeAllWords(string) {\n /**\n * input: string\n * output: string\n * edge cases: none\n * constraints: argument must be string\n **/\n \n //create an array of individual words in string\n var words = string.split(\" \");\n //capitalize each words in array\n for (let i = 0; i < words.length; i++){\n //capitalize first letter in each array element\n words[i] = words[i][0].toUpperCase() + words[i].slice(1);\n }//end loop\n \n return words.join(\" \");\n \n}//end function", "title": "" }, { "docid": "4933f6c48799e1ceb8a2b4798e8578e9", "score": "0.63617444", "text": "function capitalizeLetters(str) { \r\n const r = str.toLowerCase().split(' ');\r\n const result = r.map(e => {\r\n const res = e[0].toUpperCase() + e.substring(1);\r\n return res\r\n });\r\n\r\n return result.join(' ');\r\n}", "title": "" }, { "docid": "004019d7f2a26c349f2aaec3a1780821", "score": "0.635393", "text": "function capitals(word) {\n\n const output = [];\n arrword = word.split(\"\");\n\n arrword.forEach((letter, index) => {\n if (letter.match(/[A-Z]/)) {\n output.push(index);\n }\n });\n return output;\n}", "title": "" }, { "docid": "32d954a631e1b034f077402f56b79201", "score": "0.635052", "text": "function capitalizeAllWords(string) {\n let newArry = string.split(' ');\n for(let i = 0; i < newArry.length; i++){\n newArry[i] = capitalizeWord(newArry[i]);\n }\n return newArry.join(' ');\n \n}", "title": "" }, { "docid": "e3103135bf6f89801727db8a70aac2a5", "score": "0.6349579", "text": "function myReplace(str, before, after) {\n const arr = str.split(\" \");\n for(let i in arr){\n if(arr[i] === before){\n if(/[A-Z]/.test(before[0])){\n const newWord = after[0].toUpperCase() + after.slice(1);\n arr[i] = newWord; \n } else {\n arr[i] = after;\n }\n }\n }\n return arr.join(\" \");\n}", "title": "" }, { "docid": "95e867afcb0c69d56441ce0433489b6f", "score": "0.6344982", "text": "function capitalizeWords(str) {\n const splitStr = str.toLowerCase().split(' ');\n for (let i = 0; i < splitStr.length; i++) {\n // Assign it back to the array\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n // Directly return the joined string\n return splitStr.join(' ');\n}", "title": "" }, { "docid": "fa3d9135a03c7dda3d44b845f06949ee", "score": "0.6344192", "text": "function wordCap(string) {\n return string\n .split(\" \")\n .map((word) => word[0].toUpperCase() + word.slice(1))\n .join(\" \");\n}", "title": "" }, { "docid": "8996b8f149652b5e5f87f03d213dccee", "score": "0.6334606", "text": "function capitalizeAllWords(str){\n var words = str.split(\" \");\n for (let i = 0; i < words.length; i++){\n words[i] = capitalizeWord(words[i]);\n }\n return words.join(\" \");\n}", "title": "" }, { "docid": "071a26e4c85fb03a053b7764aaa6b7d3", "score": "0.63310516", "text": "function capitalizeAllWords(string) {\n // convert string to array of words separated by commas\n var result = string.split(' ');\n // element to be returned\n var resulted = [];\n // loop through array\n\n for (var i = 0; i < result.length; i++) {\n // isolate the first character in every string \n\n var firstChar = result[i].charAt(0).toUpperCase()\n // isolate the rest of the string\n var remainingString = result[i].slice(1, result[i].length)\n // push capworded string into resulting array\n resulted.push(`${firstChar}${remainingString}`)\n\n }\n\n // return the array as a joined string\n return resulted.join(' ')\n\n\n}", "title": "" }, { "docid": "06fcae00b53e53c07cc55479946c125f", "score": "0.6330363", "text": "function capitalize(str) {\n // solution #1\n const words = []\n for (let word of str.split(' ')) {\n words.push( word[0].toUpperCase() + word.slice(1))\n }\n return words.join(' ')\n}", "title": "" }, { "docid": "b5578a9a7d5e21697cd686c63b8dbbd0", "score": "0.6323553", "text": "function unCapitalize_Words()\r\n{\r\n var str = document.getElementById(\"word_unCapitalize_Words\").value;\r\n document.getElementById(\"result_unCapitalize_Words\").innerHTML = \"The result is : \" + str.replace(/\\w\\S*/g,\r\n function(txt)\r\n {\r\n return txt.charAt(0).toLowerCase() + txt.substr(1).toLowerCase();});\r\n}", "title": "" }, { "docid": "fa680b787ba2ca150116f6683039b781", "score": "0.6310106", "text": "function uppercase(str) {\n var words=str.split(' ');\n newStrArr=[];\n words.forEach(function (word) {\n var eachChar = word.split('');\n eachChar[0]=eachChar[0].toUpperCase();\n newStrArr.push(eachChar.join(''));\n });\n return newStrArr.join(' ');\n}", "title": "" }, { "docid": "16cf86bc62353c6fbe650db8b8cc7cdc", "score": "0.6306312", "text": "function capitalization(str) {\n var items = [];\n for (let word of str.split(' ')) {\n word = word[0].toUpperCase() + word.slice(1)\n items.push(word)\n }\n return items.join(\" \");\n}", "title": "" }, { "docid": "ae0f54c6f319b6e43361850b0cb93859", "score": "0.6305784", "text": "function camelize2(str) {\n\treturn str.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, function(match, index) {\n \tif (+match === 0) return ''; // or if (/\\s+/.test(match)) for white spaces\n \treturn index == 0 ? match.toLowerCase() : match.toUpperCase();\n \t});\n}", "title": "" }, { "docid": "a03d6330c607844154d80fc565f89ded", "score": "0.6303736", "text": "function titleCase(str) {\n const titleCaseArry = str.toLowerCase.split(\" \");\n titleCaseArry.map((word) => {\n const capWords = word.charAt(0).toUpperCase() + word.slice(1);\n // const finalSentence = capWords.join(\"\");\n // console.log(capWords);\n return capWords.word;\n });\n // console.log(titleCaseArry);\n // return console.log((str = titleCaseArry.join(\" \"))); //(str = capWords.join(\"\"));\n // return console.log((str = capWords.join(\"\")));\n}", "title": "" }, { "docid": "c12a3eb5855573e7512159b7ea650291", "score": "0.62989897", "text": "function myReplace(str, before, after) {\n //lets convert the text into array of words\n let arr = text_to_wordsArray(str);\n\n //we'll start iterating thru each item of the array to build the new array 'newarr' from them\n let newarr = arr.map(item => {\n //for current item of arr, lets see if is equal to the word stored in the variable 'before' \n if (item == before) {\n //so it is the word we're looking for\n\n //lets check if the first letter in this word is a capital letter or not\n if (item.charAt(0) == item.charAt(0).toUpperCase()) {\n //so it is a capital letter\n\n //lets replace this word by the word stored in the variable 'after' but using a capital letter as first letter\n item = after.charAt(0).toUpperCase() + after.substring(1);\n }\n else {\n //so it is not a capital letter\n\n //lets replace this word by the word stored in the variable 'after'\n item = after;\n }\n }\n return item;\n })\n return newarr.join(\" \");\n}", "title": "" }, { "docid": "3dcc7f2a08af458e01a79e33cbfc38bf", "score": "0.62988305", "text": "function applyCase(wordA, wordB) {\n\t// Exception to avoid words like \"I\" being converted to \"ME\"\n\tif (wordA.length === 1 && wordB.length !== 1) return wordB;\n\t// Uppercase\n\tif (wordA === wordA.toUpperCase()) return wordB.toUpperCase();\n\t// Lowercase\n\tif (wordA === wordA.toLowerCase()) return wordB.toLowerCase();\n\t// Capitialized\n\tvar firstChar = wordA.slice(0, 1);\n\tvar otherChars = wordA.slice(1);\n\tif (firstChar === firstChar.toUpperCase() && otherChars === otherChars.toLowerCase()) {\n\t\treturn wordB.slice(0, 1).toUpperCase() + wordB.slice(1).toLowerCase();\n\t}\n\t// Other cases\n\treturn wordB;\n}", "title": "" }, { "docid": "edf989e6770590ed5736a5a9b5cf2ca4", "score": "0.6294682", "text": "function capitalizeAllWords(strings){\n var allCaps = [];\n var splitWords = strings.split(' ');\n splitWords.forEach(function(word){\n allCaps.push(capitalizeWord(word)) \n });\n return allCaps.join(' ');\n}", "title": "" }, { "docid": "3e376f003a02b7f766125e57a6f2dc0e", "score": "0.62933314", "text": "function capitalizeAllWords(string) {\n //final result array to join together at the end\n let result = [];\n //array to put my split up string to alter each element\n let manipulationArr = string.split(\" \");\n //for loop to change every element of array\n for(let i = 0; i < manipulationArr.length; i++){\n //push manipulated array, manipulated by taking each element's first letter, capitalizing it\n // then adding the rest of each element with their first letters sliced off\n result.push(manipulationArr[i][0].toUpperCase() + manipulationArr[i].slice(1));\n }\n //joined back into initial string, now capitalized\n return result.join(\" \");\n}", "title": "" }, { "docid": "e2d6bf36691e2ee2ac03035f1de6e35b", "score": "0.6279309", "text": "function staggeredCase(string) {\n var upperCase = false;\n return string.split('').map(function (char) {\n if (char.match(/[a-z]/i)) {\n upperCase = !upperCase;\n return upperCase ? char.toUpperCase() : char.toLowerCase();\n } else {\n return char;\n }\n }).join('');\n}", "title": "" }, { "docid": "3b57356ba0a66c74300e05e2c6e7a391", "score": "0.6270374", "text": "function upper_lower(word) {\n if (word.length < 3) {\n return word.toUpperCase();\n }\n let firstPart = (word.substring(0, 3)).toLowerCase();\n let secondPart = word.substring(3, word.length).toUpperCase(); \n return firstPart + secondPart;\n }", "title": "" }, { "docid": "24e14b9e6a73eb7d3917636a53409e7a", "score": "0.62697864", "text": "function camelize(str) {\n return str\n .split('-') // splits 'my-long-word' into array ['my', 'long', 'word']\n .map(\n // capitalizes first letters of all array items except the first one\n // converts ['my', 'long', 'word'] into ['my', 'Long', 'Word']\n (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1)\n )\n .join(''); // joins ['my', 'Long', 'Word'] into 'myLongWord'\n }", "title": "" }, { "docid": "211472e6d2a5f5f8d63336a2acaa8537", "score": "0.62696266", "text": "function capital_letter(str) \n{\n str = str.split(\" \");\n\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n\n return str.join(\" \");\n}", "title": "" } ]
220f5ea3a5a83f6739526899e3aa923b
^ PUBLIC METHOD(S) ^ v PRIVATE METHOD(S) v
[ { "docid": "d6d38ff8db0586111034705a23958f3e", "score": "0.0", "text": "function Tweenable() {\n\t var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t (0, _classCallCheck3.default)(this, Tweenable);\n\n\t // pipe function for _o object\n\t // before creating tween/timeline\n\t var _this = (0, _possibleConstructorReturn3.default)(this, _Module.call(this, o));\n\t // super of Module\n\n\n\t _this._transformTweenOptions();\n\t // make tween only if isTweenLess option is not set\n\t !_this._o.isTweenLess && _this._makeTween();\n\t // make timeline only if isTimelineLess option is not set\n\t !_this._o.isTimelineLess && _this._makeTimeline();\n\t return _this;\n\t }", "title": "" } ]
[ { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.695408", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "436632995e3fe68df51c2ef5a924f0cd", "score": "0.66064763", "text": "function _privateMethods() {}", "title": "" }, { "docid": "5a7ca3cf8b648a840e833e57fbc6278d", "score": "0.647835", "text": "regularMethod() {}", "title": "" }, { "docid": "7fcc2feb16543a5f1f7de48b0056d3fd", "score": "0.64382625", "text": "function private() {}", "title": "" }, { "docid": "1b9e3b57eefe47874a6a2d8cae0a6a1a", "score": "0.634511", "text": "function publicMethod() {\n _privateMethod();\n }", "title": "" }, { "docid": "a96c6a228350e83674557ede3d5eb436", "score": "0.62486017", "text": "function privateMethod(){\n return \"I am private\";\n }", "title": "" }, { "docid": "e50f70ee409d0837f1ac185ea5b779a5", "score": "0.60466933", "text": "_method_private() {\n this.log('This is private');\n }", "title": "" }, { "docid": "b3aa4f558101d1057c3afd741f9c3d3d", "score": "0.5824499", "text": "methodHeader(src){\n let mod = this.modifier(src), raw=null, tmp=null, args=null, ret=null, sa=0, ea=0;\n let argTypes = null;\n // clean src with identified modifier\n for(let i=0; i<mod._match; i++) src.shift();\n\n if(src.length > 1){\n console.log(src,mod);\n console.log(\"[!] Method has more modifiers\");\n }\n\n this.__tmp_meth.modifiers = mod;\n raw = ut.trim(src[src.length-1]);\n\n // risque d'UTF8 / autre dans le nom, quid des regexp;\n tmp = raw.substr(0,sa=raw.indexOf(LEX.TOKEN.METH_ARG_B)); \n this.__tmp_meth.name = tmp;\n \n args = raw.substr(sa+1,(ea=raw.indexOf(LEX.TOKEN.METH_ARG_E))-sa-1)\n argTypes = this.type(ut.trim(args));\n this.__tmp_meth.args = argTypes;\n this.__tmp_meth.argsNb = this.__tmp_meth.args.length;\n\n ret=raw.substr(ea+1);\n ret = this.type(ut.trim(ret))\n if(ret.length == 0)\n console.log(\"[!] this.method error : return type of '\"+tmp+\"(\"+args+\")' cannot be parsed.\")\n //exit(0);\n\n this.__tmp_meth.enclosingClass = this.obj;\n this.__tmp_meth.ret = ret[0];\n\n this.__tmp_meth._hashcode = this.__tmp_meth.hashCode();\n }", "title": "" }, { "docid": "0fb15df733b52ef3ede4d78c87e12865", "score": "0.56708896", "text": "function _privateMethod() {\n\t\tconsole.log('do some private stuff');\n\t}", "title": "" }, { "docid": "2e9e247743746e2e5c7e4e2648a24f89", "score": "0.5640079", "text": "function private_function()\n\t {\n\n\t }", "title": "" }, { "docid": "da654bca037824213843ea932766efeb", "score": "0.56395805", "text": "[examplePrivateMethod](example_parameter) {\n // FIXME: return this instead\n console.log('I should not be accessible.');\n }", "title": "" }, { "docid": "8c1faebb2603c4a857a5bb5d7a991b35", "score": "0.56330943", "text": "function publicMethod(){\n\n // call private method(\n var retString = privateMethod();\n\n retString += \"\\n\" + \"Return from someMethod()\";\n\n return retString;\n }", "title": "" }, { "docid": "3126b82eb1eff07d7f6ca19cbf6c53af", "score": "0.5563748", "text": "function ANOTHER_METHOD_TYPE$static_(){ChainedConstants.ANOTHER_METHOD_TYPE=( ChainedConstants.METHOD_TYPE_GET.substr(0, 1));}", "title": "" }, { "docid": "d365948d6c5baae04257172008c3a677", "score": "0.5556101", "text": "function privateMethod(){\n console.log( \"I am private\" );\n }", "title": "" }, { "docid": "0a72eedea09446b2ff2914eb24e7c3bb", "score": "0.5540896", "text": "function privateMethod(){\n console.log( \"I am private\" );\n }", "title": "" }, { "docid": "673af67e840bc2f8fd69cf1d8e79ae1e", "score": "0.5517912", "text": "function myPrivateMethod1($this) {\n // TODO: Write real private methods.\n }", "title": "" }, { "docid": "53ed87da706502483e6218b45de02031", "score": "0.5510745", "text": "function privateMethod(){\n\n return \"Return from privateMethod()\";\n }", "title": "" }, { "docid": "a47ed574e8b14823688688ae14f37c5c", "score": "0.55087036", "text": "function _privateMethod() {\n\t\tconsole.log('do some stuff');\n\t}", "title": "" }, { "docid": "75d8b6c066765bc31f67f0e1d9ea4d76", "score": "0.5485141", "text": "function privateMethod() {\n console.log(\"I am private\");\n }", "title": "" }, { "docid": "6fec2480a665785de1973116fe6c53e3", "score": "0.54818135", "text": "function constructor() {\n // Private members\n var privateVar1 = \"Nishant\";\n var privateVar2 = [1,2,3,4,5];\n\n function privateMethod1() {\n // code stuff\n }\n\n function privateMethod1() {\n // code stuff\n }\n\n return {\n attribute1 : \"Nishant\",\n publicMethod: function() {\n alert(\"Nishant\");// some code logic\n }\n }\n }", "title": "" }, { "docid": "1ed978e2913d4bb89ddabd8b9c8bb032", "score": "0.54688317", "text": "function dummy(){return this}", "title": "" }, { "docid": "bc85e0eb05738d44c003887b1b616c07", "score": "0.546132", "text": "static cross(v1, v2)\r\n\t{\r\n\t\t\r\n\t}", "title": "" }, { "docid": "4c5c9bf3416ea753b4ad827eb68ef429", "score": "0.544921", "text": "function myPrivateFunction()\n\t\t{\n\t\t}", "title": "" }, { "docid": "9892a41c5c3f12fe54dcf72729cb58a0", "score": "0.5400254", "text": "function public_function() \n\t{\n\t\t/**\n\t\t * Note that we can still call\n\t\t * private functions within the scope\n\t\t * of the \"class\".\n\t\t */\n\t\tprivate_function();\n\t}", "title": "" }, { "docid": "c5b53b021c8f15997fe5fb244c9ebbf5", "score": "0.5369299", "text": "static staticRegularMethod() {}", "title": "" }, { "docid": "326c44d279d171163fa5f119c015332e", "score": "0.5354274", "text": "function priv1(){\n ;\n }", "title": "" }, { "docid": "b31df02d3004ba3856f11a23e6e25c18", "score": "0.53433144", "text": "bitneg() {\n throw 'abstract';\n }", "title": "" }, { "docid": "f4fefb9a22c215aac9584d949c2d9659", "score": "0.53429914", "text": "publicMethodWithouParams() {\n\n }", "title": "" }, { "docid": "b9b596b725c1d0df29637da0c2a02524", "score": "0.53303266", "text": "function Lo(){var t=this;Kt()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&Re()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "title": "" }, { "docid": "e6da138d548fc536af8357b78b6feb22", "score": "0.5305062", "text": "function Constructor(privateMessage, publicMessage) {\n var me = this; // The variable \"me\" is declared to save the \"this\" value in\n // the closure, so that private methods can access public properties and\n // methods. By default private methods cannot access them cause in that\n // case \"this\" would mean the owner of the private method called.\n // Properties \n var privateProperty = privateMessage;\n this.publicProperty = publicMessage;\n // Methods\n var privateMethod = function() {\n writeToConsole('CLOSURE', privateProperty);\n writeToConsole('CLOSURE', me.publicProperty);\n };\n this.publicMethod = function() {\n privateMethod();\n };\n }", "title": "" }, { "docid": "728c746e2eb1683938458eec545f27c8", "score": "0.52664864", "text": "function ge_neg(pub) {\n\t\tpub[31] ^= 0x80;\n\t}", "title": "" }, { "docid": "8d635f5343d4d7e232cf242fdf74d012", "score": "0.5225701", "text": "function _() { }", "title": "" }, { "docid": "e7651017bc96c237b6843bdd9758d647", "score": "0.5215437", "text": "method() {\r\n\t\tthrow new Error('Not implemented');\r\n\t}", "title": "" }, { "docid": "b32296c9277f12125b2b12f11cd351cf", "score": "0.52116036", "text": "function Vy(){var t=this;hr()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&ll()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "title": "" }, { "docid": "2f2245d7c2f6e448668454c2775ebbc5", "score": "0.5206749", "text": "function cProxy(\n)\n{\n\n\n}", "title": "" }, { "docid": "97b3ccb1ab5be1a467fdf3d4ccc60f97", "score": "0.51931226", "text": "function ge_neg(pub) {\n pub[31] ^= 0x80;\n}", "title": "" }, { "docid": "97b3ccb1ab5be1a467fdf3d4ccc60f97", "score": "0.51931226", "text": "function ge_neg(pub) {\n pub[31] ^= 0x80;\n}", "title": "" }, { "docid": "2f55f4efc702b47e066d2ca02581a2d9", "score": "0.51601136", "text": "function _init() {\n\t\t_privateMethod();\n\t}", "title": "" }, { "docid": "74bbfe38c702e2949f0daba9b7a00f7e", "score": "0.51596075", "text": "[MATCH]() { // eslint-disable-line class-methods-use-this\n\t\t\treturn undefined;\n\t\t}", "title": "" }, { "docid": "946de63778df5e05a0d4d148e0bdff91", "score": "0.5155474", "text": "static source(trans) { return CTL.AP(ROBDD.False, trans) }", "title": "" }, { "docid": "56e75be4f5089f395a411c9aedfdac26", "score": "0.51340145", "text": "enterInterfaceMethodModifier(ctx) {\n\t}", "title": "" }, { "docid": "745896b0be2ff4208f834fda49b2248d", "score": "0.5133489", "text": "function zS(){R.call(this)}", "title": "" }, { "docid": "c0a9ae83ce1f9e95aff0fec6e3358b32", "score": "0.5120907", "text": "method() {}", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.5115897", "text": "function foo(..) { .. }", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.5115897", "text": "function foo(..) { .. }", "title": "" }, { "docid": "941f94648583cae1fd1f631704ba6162", "score": "0.51142067", "text": "clone() {}", "title": "" }, { "docid": "a359f00e0aa862dc622d9e6a1acf9ef0", "score": "0.5113543", "text": "Deny() {\n\n }", "title": "" }, { "docid": "bc28f8d3ef8dd8ba0f9cc056e34f20d2", "score": "0.5083986", "text": "function AltConstructor () {}", "title": "" }, { "docid": "76b189c5c94c6f8061067a8576898f3e", "score": "0.50793105", "text": "function Vu(){}", "title": "" }, { "docid": "934d383043d8b8de2e9b59bc2aa406cf", "score": "0.5078533", "text": "function PipeObj()\n{}", "title": "" }, { "docid": "ae36559c85a832d09b3c297c36c1f562", "score": "0.5076386", "text": "function W(){}", "title": "" }, { "docid": "ae36559c85a832d09b3c297c36c1f562", "score": "0.5076386", "text": "function W(){}", "title": "" }, { "docid": "d4626656cf1a87d53ba439a524822b9e", "score": "0.5073147", "text": "function Sedan(){}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5047078", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "52ddaf83107d1a4217dae05c206cafd7", "score": "0.5045117", "text": "function Xc(a,b){return Vc(this,a,b,-1)}", "title": "" }, { "docid": "fbf75bd631e85c005449a73387d5b475", "score": "0.50384206", "text": "xor (a, b) { return new instr_pre(0x85, this, [a, b]) }", "title": "" }, { "docid": "e0b7c3d1ac9939f0142d135a8c93588a", "score": "0.50379866", "text": "_makeItSo() {}", "title": "" }, { "docid": "ed38fa56d71503fa0a835fb8ccd4b15c", "score": "0.50376654", "text": "function Z(){this.name=\"Python Framework\";this.c=new V;this.a=\"\"}", "title": "" }, { "docid": "d7a058197ab92533af224e2f6c3bb984", "score": "0.5034061", "text": "xor (a, b) { return new instr_pre(0x73, this, [a, b]) }", "title": "" }, { "docid": "086d158248775bb150aeedc440ba7926", "score": "0.502808", "text": "xor(other) {\n throw 'abstract';\n }", "title": "" } ]
d983d161dbb8a357464a141249ee7b7b
Parse a Class Definition Table in a GSUB, GPOS or GDEF table. Returns a function that gets a class value from a glyph ID.
[ { "docid": "d152e956f0a6ca55510fc498f91cd6f2", "score": "0.68145853", "text": "function parseClassDefTable(data, start) {\n var p = new parse.Parser(data, start);\n var format = p.parseUShort();\n if (format === 1) {\n // Format 1 specifies a range of consecutive glyph indices, one class per glyph ID.\n var startGlyph = p.parseUShort();\n var glyphCount = p.parseUShort();\n var classes = p.parseUShortList(glyphCount);\n return function (glyphID) {\n return classes[glyphID - startGlyph] || 0;\n };\n } else if (format === 2) {\n // Format 2 defines multiple groups of glyph indices that belong to the same class.\n var rangeCount = p.parseUShort();\n var startGlyphs = [];\n var endGlyphs = [];\n var classValues = [];\n for (var i = 0; i < rangeCount; i++) {\n startGlyphs[i] = p.parseUShort();\n endGlyphs[i] = p.parseUShort();\n classValues[i] = p.parseUShort();\n }\n\n return function (glyphID) {\n var l = 0;\n var r = startGlyphs.length - 1;\n while (l < r) {\n var c = l + r + 1 >> 1;\n if (glyphID < startGlyphs[c]) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n\n if (startGlyphs[l] <= glyphID && glyphID <= endGlyphs[l]) {\n return classValues[l] || 0;\n }\n\n return 0;\n };\n }\n }", "title": "" } ]
[ { "docid": "0d16f33d64132f45ee41996a9c8efacf", "score": "0.6993817", "text": "function parseClassDefTable(data, start) {\n var p = new parse.Parser(data, start);\n var format = p.parseUShort();\n if (format === 1) {\n // Format 1 specifies a range of consecutive glyph indices, one class per glyph ID.\n var startGlyph = p.parseUShort();\n var glyphCount = p.parseUShort();\n var classes = p.parseUShortList(glyphCount);\n return function(glyphID) {\n return classes[glyphID - startGlyph] || 0;\n };\n } else if (format === 2) {\n // Format 2 defines multiple groups of glyph indices that belong to the same class.\n var rangeCount = p.parseUShort();\n var startGlyphs = [];\n var endGlyphs = [];\n var classValues = [];\n for (var i = 0; i < rangeCount; i++) {\n startGlyphs[i] = p.parseUShort();\n endGlyphs[i] = p.parseUShort();\n classValues[i] = p.parseUShort();\n }\n\n return function(glyphID) {\n var l = 0;\n var r = startGlyphs.length - 1;\n while (l < r) {\n var c = (l + r + 1) >> 1;\n if (glyphID < startGlyphs[c]) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n\n if (startGlyphs[l] <= glyphID && glyphID <= endGlyphs[l]) {\n return classValues[l] || 0;\n }\n\n return 0;\n };\n }\n}", "title": "" }, { "docid": "4626f9e7984ea8e1175000cb054093ee", "score": "0.69817823", "text": "function parseClassDefTable(data, start) {\n var p = new parse.Parser(data, start);\n var format = p.parseUShort();\n if (format === 1) {\n // Format 1 specifies a range of consecutive glyph indices, one class per glyph ID.\n var startGlyph = p.parseUShort();\n var glyphCount = p.parseUShort();\n var classes = p.parseUShortList(glyphCount);\n return function(glyphID) {\n return classes[glyphID - startGlyph] || 0;\n };\n }\n else if (format === 2) {\n // Format 2 defines multiple groups of glyph indices that belong to the same class.\n var rangeCount = p.parseUShort();\n var startGlyphs = [];\n var endGlyphs = [];\n var classValues = [];\n for (var i = 0; i < rangeCount; i++) {\n startGlyphs[i] = p.parseUShort();\n endGlyphs[i] = p.parseUShort();\n classValues[i] = p.parseUShort();\n }\n\n return function(glyphID) {\n var l = 0;\n var r = startGlyphs.length - 1;\n while (l < r) {\n var c = (l + r + 1) >> 1;\n if (glyphID < startGlyphs[c]) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n\n if (startGlyphs[l] <= glyphID && glyphID <= endGlyphs[l]) {\n return classValues[l] || 0;\n }\n\n return 0;\n };\n }\n}", "title": "" }, { "docid": "4626f9e7984ea8e1175000cb054093ee", "score": "0.69817823", "text": "function parseClassDefTable(data, start) {\n var p = new parse.Parser(data, start);\n var format = p.parseUShort();\n if (format === 1) {\n // Format 1 specifies a range of consecutive glyph indices, one class per glyph ID.\n var startGlyph = p.parseUShort();\n var glyphCount = p.parseUShort();\n var classes = p.parseUShortList(glyphCount);\n return function(glyphID) {\n return classes[glyphID - startGlyph] || 0;\n };\n }\n else if (format === 2) {\n // Format 2 defines multiple groups of glyph indices that belong to the same class.\n var rangeCount = p.parseUShort();\n var startGlyphs = [];\n var endGlyphs = [];\n var classValues = [];\n for (var i = 0; i < rangeCount; i++) {\n startGlyphs[i] = p.parseUShort();\n endGlyphs[i] = p.parseUShort();\n classValues[i] = p.parseUShort();\n }\n\n return function(glyphID) {\n var l = 0;\n var r = startGlyphs.length - 1;\n while (l < r) {\n var c = (l + r + 1) >> 1;\n if (glyphID < startGlyphs[c]) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n\n if (startGlyphs[l] <= glyphID && glyphID <= endGlyphs[l]) {\n return classValues[l] || 0;\n }\n\n return 0;\n };\n }\n}", "title": "" }, { "docid": "4626f9e7984ea8e1175000cb054093ee", "score": "0.69817823", "text": "function parseClassDefTable(data, start) {\n var p = new parse.Parser(data, start);\n var format = p.parseUShort();\n if (format === 1) {\n // Format 1 specifies a range of consecutive glyph indices, one class per glyph ID.\n var startGlyph = p.parseUShort();\n var glyphCount = p.parseUShort();\n var classes = p.parseUShortList(glyphCount);\n return function(glyphID) {\n return classes[glyphID - startGlyph] || 0;\n };\n }\n else if (format === 2) {\n // Format 2 defines multiple groups of glyph indices that belong to the same class.\n var rangeCount = p.parseUShort();\n var startGlyphs = [];\n var endGlyphs = [];\n var classValues = [];\n for (var i = 0; i < rangeCount; i++) {\n startGlyphs[i] = p.parseUShort();\n endGlyphs[i] = p.parseUShort();\n classValues[i] = p.parseUShort();\n }\n\n return function(glyphID) {\n var l = 0;\n var r = startGlyphs.length - 1;\n while (l < r) {\n var c = (l + r + 1) >> 1;\n if (glyphID < startGlyphs[c]) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n\n if (startGlyphs[l] <= glyphID && glyphID <= endGlyphs[l]) {\n return classValues[l] || 0;\n }\n\n return 0;\n };\n }\n}", "title": "" }, { "docid": "4626f9e7984ea8e1175000cb054093ee", "score": "0.69817823", "text": "function parseClassDefTable(data, start) {\n var p = new parse.Parser(data, start);\n var format = p.parseUShort();\n if (format === 1) {\n // Format 1 specifies a range of consecutive glyph indices, one class per glyph ID.\n var startGlyph = p.parseUShort();\n var glyphCount = p.parseUShort();\n var classes = p.parseUShortList(glyphCount);\n return function(glyphID) {\n return classes[glyphID - startGlyph] || 0;\n };\n }\n else if (format === 2) {\n // Format 2 defines multiple groups of glyph indices that belong to the same class.\n var rangeCount = p.parseUShort();\n var startGlyphs = [];\n var endGlyphs = [];\n var classValues = [];\n for (var i = 0; i < rangeCount; i++) {\n startGlyphs[i] = p.parseUShort();\n endGlyphs[i] = p.parseUShort();\n classValues[i] = p.parseUShort();\n }\n\n return function(glyphID) {\n var l = 0;\n var r = startGlyphs.length - 1;\n while (l < r) {\n var c = (l + r + 1) >> 1;\n if (glyphID < startGlyphs[c]) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n\n if (startGlyphs[l] <= glyphID && glyphID <= endGlyphs[l]) {\n return classValues[l] || 0;\n }\n\n return 0;\n };\n }\n}", "title": "" }, { "docid": "403f618cd9522bcc48692460dfe8e268", "score": "0.5581297", "text": "function getCellClass(id) {\n cell_classes = $('#' + id).attr('class').split(' ');\n if (cell_classes.indexOf('tws') !== -1){\n return 'tws';\n }\n if (cell_classes.indexOf('dws') !== -1){\n return 'dws';\n }\n if (cell_classes.indexOf('tls') !== -1){\n return 'tls';\n }\n if (cell_classes.indexOf('dls') !== -1){\n return 'dls';\n }\n}", "title": "" }, { "docid": "50fe56aec63b0c4bfe9ad30c666aeadf", "score": "0.51026684", "text": "function myfunction(d,i) {return 'rect.class'+i}", "title": "" }, { "docid": "2be09eac5f7153b02476d0891a7c1e54", "score": "0.50400114", "text": "function getClass(t) {\r\n //gco: indicates if we're on the lan section\r\n let gco = false;\r\n\r\n let gcl = t.length;\r\n let gcr = 'b_ei_';\r\n\r\n //iterate for each char of \"t\"\r\n for (gci = 0; gci < gcl; gci++) {\r\n gcc = t.charAt(gci);\r\n\r\n //it's the end of header? then return\r\n if (gcc == ']') {\r\n //we update the start of the actual code\r\n currIn = ++gci;\r\n return gcr;\r\n }\r\n\r\n //are we on the lan section, and not on a quote? add the char to the class name\r\n if (gco && gcc != '\"') {\r\n gcr += gcc;\r\n }\r\n\r\n //if we're on the \"=\", we start to add chars to the class name\r\n if (gcc == '=') {\r\n gco = true;\r\n }\r\n }\r\n\r\n //if no value found, return void\r\n return '';\r\n}", "title": "" }, { "docid": "8415fea7556a4a6addc24931c4ff8aa7", "score": "0.49006593", "text": "function _getClassById(classId) {\n return _idToClass[classId];\n}", "title": "" }, { "docid": "9aa065556558e318e08756133e4d9ad6", "score": "0.4849858", "text": "function extractColumn(square) {\n return Number((square.attr('class')).substring(10));\n}", "title": "" }, { "docid": "ebc4155b1f3644918f2f253d0fac8674", "score": "0.47691748", "text": "function getPseudoClass() {\n var start = scanner.tokenStart;\n\n scanner.eat(COLON);\n scanIdent(false);\n\n if (scanner.tokenType === LEFTPARENTHESIS) {\n return getFunction(SCOPE_SELECTOR, getInfo(start), scanner.substrToCursor(start + 1));\n }\n\n return {\n type: 'PseudoClass',\n info: getInfo(start),\n name: scanner.substrToCursor(start + 1),\n sequence: null\n };\n}", "title": "" }, { "docid": "2745d4cd4d89ddfb4b32c5e5b1817e62", "score": "0.47560644", "text": "function typeClass(definition) {\n if (definition.nodeType === \"YulTypedName\") {\n //for handling Yul variables\n return \"bytes\";\n }\n return typeIdentifier(definition).match(/t_([^$_0-9]+)/)[1];\n}", "title": "" }, { "docid": "9904cb02ba8e5a967402ab9bbcc17739", "score": "0.47266924", "text": "function parseGposTable(data, start, font) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseFixed();\n check.argument(tableVersion === 1, 'Unsupported GPOS table version.');\n\n // ScriptList and FeatureList - ignored for now\n parseTaggedListTable(data, start + p.parseUShort());\n // 'kern' is the feature we are looking for.\n parseTaggedListTable(data, start + p.parseUShort());\n\n // LookupList\n var lookupListOffset = p.parseUShort();\n p.relativeOffset = lookupListOffset;\n var lookupCount = p.parseUShort();\n var lookupTableOffsets = p.parseOffset16List(lookupCount);\n var lookupListAbsoluteOffset = start + lookupListOffset;\n for (var i = 0; i < lookupCount; i++) {\n var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);\n if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;\n }\n }", "title": "" }, { "docid": "4245edfea7d0bce861ae299e98e94456", "score": "0.47187594", "text": "function parseGposTable(data, start, font) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseFixed();\n check.argument(tableVersion === 1, 'Unsupported GPOS table version.');\n\n // ScriptList and FeatureList - ignored for now\n parseTaggedListTable(data, start + p.parseUShort());\n // 'kern' is the feature we are looking for.\n parseTaggedListTable(data, start + p.parseUShort());\n\n // LookupList\n var lookupListOffset = p.parseUShort();\n p.relativeOffset = lookupListOffset;\n var lookupCount = p.parseUShort();\n var lookupTableOffsets = p.parseOffset16List(lookupCount);\n var lookupListAbsoluteOffset = start + lookupListOffset;\n for (var i = 0; i < lookupCount; i++) {\n var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);\n if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;\n }\n}", "title": "" }, { "docid": "4245edfea7d0bce861ae299e98e94456", "score": "0.47187594", "text": "function parseGposTable(data, start, font) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseFixed();\n check.argument(tableVersion === 1, 'Unsupported GPOS table version.');\n\n // ScriptList and FeatureList - ignored for now\n parseTaggedListTable(data, start + p.parseUShort());\n // 'kern' is the feature we are looking for.\n parseTaggedListTable(data, start + p.parseUShort());\n\n // LookupList\n var lookupListOffset = p.parseUShort();\n p.relativeOffset = lookupListOffset;\n var lookupCount = p.parseUShort();\n var lookupTableOffsets = p.parseOffset16List(lookupCount);\n var lookupListAbsoluteOffset = start + lookupListOffset;\n for (var i = 0; i < lookupCount; i++) {\n var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);\n if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;\n }\n}", "title": "" }, { "docid": "4245edfea7d0bce861ae299e98e94456", "score": "0.47187594", "text": "function parseGposTable(data, start, font) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseFixed();\n check.argument(tableVersion === 1, 'Unsupported GPOS table version.');\n\n // ScriptList and FeatureList - ignored for now\n parseTaggedListTable(data, start + p.parseUShort());\n // 'kern' is the feature we are looking for.\n parseTaggedListTable(data, start + p.parseUShort());\n\n // LookupList\n var lookupListOffset = p.parseUShort();\n p.relativeOffset = lookupListOffset;\n var lookupCount = p.parseUShort();\n var lookupTableOffsets = p.parseOffset16List(lookupCount);\n var lookupListAbsoluteOffset = start + lookupListOffset;\n for (var i = 0; i < lookupCount; i++) {\n var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);\n if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;\n }\n}", "title": "" }, { "docid": "4245edfea7d0bce861ae299e98e94456", "score": "0.47187594", "text": "function parseGposTable(data, start, font) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseFixed();\n check.argument(tableVersion === 1, 'Unsupported GPOS table version.');\n\n // ScriptList and FeatureList - ignored for now\n parseTaggedListTable(data, start + p.parseUShort());\n // 'kern' is the feature we are looking for.\n parseTaggedListTable(data, start + p.parseUShort());\n\n // LookupList\n var lookupListOffset = p.parseUShort();\n p.relativeOffset = lookupListOffset;\n var lookupCount = p.parseUShort();\n var lookupTableOffsets = p.parseOffset16List(lookupCount);\n var lookupListAbsoluteOffset = start + lookupListOffset;\n for (var i = 0; i < lookupCount; i++) {\n var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);\n if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;\n }\n}", "title": "" }, { "docid": "4245edfea7d0bce861ae299e98e94456", "score": "0.47187594", "text": "function parseGposTable(data, start, font) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseFixed();\n check.argument(tableVersion === 1, 'Unsupported GPOS table version.');\n\n // ScriptList and FeatureList - ignored for now\n parseTaggedListTable(data, start + p.parseUShort());\n // 'kern' is the feature we are looking for.\n parseTaggedListTable(data, start + p.parseUShort());\n\n // LookupList\n var lookupListOffset = p.parseUShort();\n p.relativeOffset = lookupListOffset;\n var lookupCount = p.parseUShort();\n var lookupTableOffsets = p.parseOffset16List(lookupCount);\n var lookupListAbsoluteOffset = start + lookupListOffset;\n for (var i = 0; i < lookupCount; i++) {\n var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);\n if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;\n }\n}", "title": "" }, { "docid": "d6b334baa093b3de8f4608c32b830bbf", "score": "0.47137403", "text": "getClazz(id, ref = '') {\n var fullId = this.getRefClazzId(id, ref)\n var clazz = this.getClazzes()[fullId]\n if (clazz == null) {\n clazz = this.createClazzFromId(fullId)\n if (clazz == null) {\n throw new Error('Cannot get clazz from ID ' + fullId)\n }\n this.getClazzes()[fullId] = clazz\n }\n return clazz\n }", "title": "" }, { "docid": "18ebba74443fc82f94df7c2c07aed4c4", "score": "0.47006512", "text": "function whatLetter(id) {\n let classes = $('#' + id).attr('class').split(' ');\n return classes[classes.length - 1];\n}", "title": "" }, { "docid": "3b0b5f42b4aee724025a20cafe25eae6", "score": "0.46792093", "text": "function classFinder(document_root) {\n\n // xpath to the main table, relative to document_root\n var table_xpath = '//*[@id=\"service_content\"]/div[1]/table';\n var table_element = getElementByXpathFromRoot(table_xpath);\n\n // get rows\n var rows = table_element.getElementsByTagName('tr');\n \n // gets classes in html tag form (table data)\n var classlist = []\n for (var i = 0; i < rows.length; i++){\n var row = rows[i].getElementsByTagName('td')\n if (row){\n classlist.push(row)\n }\n }\n\n // get class data in list form\n classes = []\n for (var i = 1; i < classlist.length; i++){\n // extract class data from the html tag form of classes in the table\n var classattributes = []\n for (var j = 0; j < classlist[i].length; j++){\n var attribute = classlist[i][j].innerText\n if (attribute == \"Dropped\"){continue}\n if (attribute!=\"\"){\n classattributes.push(attribute)\n }\n }\n console.log(classattributes)\n \n // combine course number + name (cs 313e, elems of SE -> cs 313e: elems of software design)\n var classspecs =[]\n for (var k = 0; k<classattributes.length;k++){\n attributes = classattributes[k]\n if (k==1){\n attributes += \": \" + classattributes[k+1] \n }\n if (k==2){\n continue\n }\n if (k==3){\n attributes += \" \" + classattributes[k+1]\n }\n if (k==4){\n continue\n }\n classspecs.push(attributes)\n }\n classes.push(classspecs) \n }\n return classes\n}", "title": "" }, { "docid": "a87554b1a611beeb352bfe32a6ac56b3", "score": "0.46789515", "text": "function getClassName(classID) {\n var className = '';\n\n switch(classID){\n case 1:\n className = 'Warrior'\n break;\n case 2:\n className = 'Paladin'\n break;\n case 3:\n className = 'Hunter'\n break;\n case 4:\n className = 'Rogue'\n break;\n case 5:\n className = 'Priest'\n break;\n case 6:\n className = 'Death Knight'\n break;\n case 7:\n className = 'Shaman'\n break;\n case 8:\n className = 'Mage'\n break;\n case 9:\n className = 'Warlock'\n break;\n case 10:\n className = 'Monk'\n break;\n case 11:\n className = 'Druid'\n break;\n case 12:\n className = 'Demon Hunter'\n break;\n default:\n className = 'Unknown'\n } \n\n return className;\n}", "title": "" }, { "docid": "eac962d5166da82949308b649737541a", "score": "0.46581903", "text": "parseClass(node, isStatement, optionalId) {\n this.next();\n this.takeDecorators(node);\n this.parseClassId(node, isStatement, optionalId);\n this.parseClassSuper(node);\n this.parseClassBody(node);\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\");\n }", "title": "" }, { "docid": "ad0bf30220cd591cb47e6ba8ff8d9e8d", "score": "0.46515888", "text": "readClassName(){\n\t\tif (this.findNextToken(\"class\")){\n\t\t\tthis.matchNextToken(\"class\");\n\t\t\tthis.matchNextToken(\"of\");\n\t\t\tvar value = this.readIdentifierName();\n\t\t\treturn new OpClassName(value);\n\t\t}\n\t\tif (this.findNextToken(\"classof\")){\n\t\t\tthis.matchNextToken(\"classof\");\n\t\t\tvar value = this.readIdentifierName();\n\t\t\treturn new OpClassName(value);\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "1dbca212c1c20dad795f82f68f85ea52", "score": "0.46481696", "text": "function getClass(class_id) {\n //console.log(\"Getting class with id \" + class_id);\n\n // add listener for class rooms\n classRoomsDatabase.child(class_id).on(\"value\", function(snapshot) {\n if (snapshot.val()) {\n onClassRoomsChange(class_id, Object.values(snapshot.val()));\n }\n });\n\n // get class name\n var xhr = new XMLHttpRequest();\n xhr.open('GET', \"/get_class/\" + class_id, true); // responds with the class's name and room_ids\n xhr.send();\n\n xhr.onreadystatechange = function(e) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n\n // store the class\n var response = JSON.parse(xhr.responseText);\n //update UI\n $scope.class_names[class_id] = response.name;\n //class_names[class_id] = response.name;\n\n //console.log(\"class name is: \" + response.name);\n\n //apply changes (needed)\n $scope.$apply();\n }\n }\n }", "title": "" }, { "docid": "065392563d42dcc73f9c28f17baf9ce0", "score": "0.4621295", "text": "function parseClassNames(className) {\n var field_classes = className\n .split(\" \")\n .filter((value) => ![\"\", \"form-field\", \"pd-hidden\", \"hidden\"].includes(value));\n for (var i in field_classes) {\n if (field_classes[i].includes(\"CP_\")) {\n return field_classes[i];\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "7a373119e6bbf509c5e98c130801bb69", "score": "0.4594777", "text": "function getClassFromData(table, md) {\n\tmin = Math.min.apply(null, table);\n\tmax = Math.max.apply(null, table);\n\tif(md>=min & md<(max/4)) return 0;//jaune\n\tif(md>=(max/4) & md<(max/2)) return 1;//vert\n\tif(md>=(max/2) & md<(max*3/4)) return 2;//rouge\n\tif(md>=(max*3/4) & md<=max) return 3;//bleu\n\tif(max==min) return 3;\n}", "title": "" }, { "docid": "26ca18a3e4d7093b197a8e812055890b", "score": "0.45699766", "text": "function findClassAnnotation(tableHTML, remainCols, pageName) {\n // console.log(\"Page Name is: \"+pageName);\n // console.log(\"Table HTML is: \");\n // console.log(tableHTML);\n // console.log(remainCols);\n let selectedTable = tableHTML;\n let tempTable = [];\n\n // We first fetch the plain, unprocessed version of the table.\n // Note: this function potentially needs to be modified.\n // Instead of using innerText for cell data, if its href exists, we should use its href instead\n for (let i = 0; i < selectedTable.rows.length; ++i) {\n let tempRow = [];\n for (let j = 0; j < selectedTable.rows[i].cells.length; ++j) {\n let curCellText = HTMLCleanCell(selectedTable.rows[i].cells[j].innerText);\n\n // Note: We want to use the href as data for the first column (if such href exists) instead of its innerText.\n if (i === 1) {\n // We get all the links from this current cell (there may be more than one)\n let anchorArray = selectedTable.rows[i].cells[j].getElementsByTagName(\n \"a\"\n );\n // we want to use the first valid link as the search element for this cell\n // Definition of being valid: its associated innerText is not empty (thus not the link of a picture)\n // and it is not a citation (so [0] is not \"[\")\n for (let k = 0; k < anchorArray.length; ++k) {\n if (\n anchorArray[k].innerText !== \"\" &&\n anchorArray[k].innerText[0] !== \"[\"\n ) {\n let hrefArray = anchorArray[k].href.split(\"/\");\n // console.log(\"InnerText is \"+anchorArray[k].innerText);\n // console.log(\"It exists in DBPedia as \"+hrefArray[hrefArray.length-1]);\n curCellText = hrefArray[hrefArray.length - 1];\n // if (curCellText.includes(\"UEFA\")) {\n // console.log(curCellText);\n // }\n }\n }\n }\n let curRowSpan = selectedTable.rows[i].cells[j].rowSpan;\n let curColSpan = selectedTable.rows[i].cells[j].colSpan;\n // console.log(curColSpan);\n tempRow.push({\n data: curCellText,\n rowSpan: curRowSpan,\n colSpan: curColSpan,\n });\n }\n tempTable.push(tempRow);\n }\n\n // We first deal with colspans.\n for (let i = 0; i < tempTable.length; ++i) {\n for (let j = 0; j < tempTable[i].length; ++j) {\n let curCellText = tempTable[i][j].data;\n if (tempTable[i][j].colSpan > 1) {\n for (let k = 1; k < tempTable[i][j].colSpan; ++k) {\n tempTable[i].splice(j + 1, 0, {\n data: curCellText,\n rowSpan: 1,\n colSpan: 1,\n });\n }\n }\n }\n }\n\n // We now deal with rowspans.\n for (let i = 0; i < tempTable.length; ++i) {\n for (let j = 0; j < tempTable[i].length; ++j) {\n let curCellText = tempTable[i][j].data;\n if (tempTable[i][j].rowSpan > 1) {\n for (let k = 1; k < tempTable[i][j].rowSpan; ++k) {\n // Note: the if condition is necessary to take care of error conditions (the original HTML table element has errors)\n if (i + k < tempTable.length) {\n tempTable[i + k].splice(j, 0, {\n data: curCellText,\n rowSpan: 1,\n colSpan: 1,\n });\n }\n }\n }\n }\n }\n\n // console.log(\"Table data is: \");\n // console.log(tempTable);\n\n // Now tempTable contains the clean data we can use\n let promiseArray = [];\n // We take the minimum of (1, tempTable.length-1) number of values from each column to determine its class annotation\n // Note!! This -1 here is important. It excludes the row corresponding to the column headers\n let remainEntries = Math.min(1, tempTable.length - 1);\n\n // This is a placeholder array to solve the 2D problem. It's a 1D array containing remainEntries number of -1's\n // let placeHolderArray = [];\n // let notFoundArray = [];\n // for (let i=0;i<remainEntries;++i) {\n // placeHolderArray.push(-1);\n // notFoundArray.push(\"null\");\n // }\n\n // Let's loop through the table to ask our queries.\n // If remainCols are undefined, we take every columns from the tempTable;\n if (remainCols === undefined) {\n remainCols = [];\n for (let j = 0; j < tempTable[0].length; ++j) {\n remainCols.push(j);\n }\n }\n\n // console.log(\"Remain columns are: \"+remainCols);\n for (let j = 0; j < remainCols.length; ++j) {\n // console.log(\"We are taking this number of entries from this table: \"+remainEntries);\n // Find the current column index\n let curColIndex = remainCols[j];\n // console.log(\"Current column index is: \"+curColIndex);\n\n // Loop through the first three (or one) entries from this column\n for (let i = 1; i <= remainEntries; ++i) {\n // Here we make the query\n let prefixURL =\n \"https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=\";\n let suffixURL =\n \"format=application%2Fsparql-results%2Bjson&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on&run=+Run+Query+\";\n // console.log(tempTable[i][j].data);\n // console.log(regexReplace(tempTable[i][j].data));\n // console.log(tempTable[i][curColIndex]);\n let curEntry =\n tempTable[i][curColIndex] === undefined\n ? \"NONEXISTING\"\n : regexReplace(tempTable[i][curColIndex].data);\n // console.log(curEntry);\n // console.log(regexReplace(tempTable[i][curColIndex].data));\n // console.log(!isNaN(Number(curEntry)));\n // console.log(\"Replaced data is \"+curEntry);\n // console.log(curEntry === \"\");\n\n // If we found out that the current entry is a number, we do not want to send a query.\n // Note: Number(\"\") will show up as a number!! This was one of the bugs that we fixed\n if (!isNaN(Number(curEntry)) && curEntry !== \"\") {\n promiseArray.push(Promise.resolve([\"Number\"]));\n }\n // Else if we find the curEntry is too long, it will likely not exist in DBPedia\n else if (curEntry.length > 40) {\n promiseArray.push(Promise.resolve([\"Null\"]));\n }\n // Else we construct the query\n else {\n // console.log(\"Cur Entry is \"+curEntry);\n if (curEntry === undefined || curEntry === \"\") {\n curEntry = \"NONEXISTING\";\n }\n // if (curEntry === \"Sergio_Agüero\") {\n // console.log(\"We have another problem here\");\n // }\n // console.log(curEntry);\n // console.log(tempTable[i][curColIndex].data);\n // console.log(regexReplace(tempTable[i][curColIndex].data));\n let queryBody =\n \"SELECT+%3Fo%0D%0AWHERE+%7B%0D%0A++++++dbr%3A\" +\n curEntry +\n \"+rdf%3Atype+%3Fo.%0D%0A++++++BIND%28STR%28%3Fo%29+AS+%3FoString+%29.%0D%0A++++++FILTER%28regex%28%3FoString%2C%22dbpedia.org%2Fontology%2F%22%2C%22i%22%29%29%0D%0A%7D%0D%0A&\";\n let queryURL = prefixURL + queryBody + suffixURL;\n // if (curEntry === \"Bangor_City_F%5Cu002EC%5Cu002E\") {\n // console.log(\"There is something wrong with this entry\")\n // console.log(queryURL);\n // }\n // console.log(\"Query is constructed!\");\n // if (queryURL === \"https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=SELECT+%3Fo%0D%0AWHERE+%7B%0D%0A++++++dbr%3A\") {\n // console.log(\"Here is where the problem occurs\");\n // }\n // console.log(queryURL);\n promiseArray.push(fetchJSON(queryURL));\n // console.log(\"Query pushed successfully. This is queryBody: \");\n // console.log(queryBody);\n }\n }\n }\n return allPromiseReady(promiseArray).then((values) => {\n // console.log(values);\n // for (let i=0;i<values.length;++i) {\n // console.log(values[i]);\n // }\n // console.log(\"Query results from Virtuoso are:\");\n // console.log(values);\n let classAnnotation = [];\n for (let j = 0; j < remainCols.length; ++j) {\n // console.log(\"Number of remain cols is \"+remainCols.length);\n let curColumnClass = [];\n // If we are dealing with number results, we just want to push on an array with one element \"Number\"\n if (values[remainEntries * j] !== undefined) {\n if (values[remainEntries * j][0] !== undefined) {\n if (values[remainEntries * j][0] === \"Number\") {\n classAnnotation.push([\"Number\"]);\n }\n // If we are dealing with invalid results, we just want to push on an empty array\n else if (values[remainEntries * j][0] === \"Null\") {\n classAnnotation.push([]);\n }\n }\n // if (values[remainEntries*j][0] === -1) {\n // classAnnotation.push([\"Number\"]);\n // }\n // // If we are dealing with invalid results, we just want to push on an empty array\n // else if (values[remainEntries*j][0] === \"null\") {\n // classAnnotation.push([]);\n // }\n // Else, we find its class annotation from query results\n else {\n for (let i = 0; i < remainEntries; ++i) {\n let curCellClass = [];\n // console.log(remainEntries*j+i);\n let bindingArray = values[remainEntries * j + i].results.bindings;\n for (let k = 0; k < bindingArray.length; ++k) {\n curCellClass.push(bindingArray[k].o.value.slice(28));\n }\n curColumnClass = [...new Set([...curColumnClass, ...curCellClass])];\n }\n classAnnotation.push(curColumnClass);\n }\n }\n }\n // return classAnnotation;\n // console.log(\"Current class annotation is \");\n // if (pageName === \"2009–10_Premier_League\") {\n // console.log(\"TableData is \");\n // console.log(tempTable);\n // console.log(classAnnotation);\n // }\n // console.log(classAnnotation);\n\n return Promise.resolve(classAnnotation);\n });\n}", "title": "" }, { "docid": "1b1f4efaf18eac8069e04e54c37af605", "score": "0.45386776", "text": "function getClass(_class, num){\r\n \tvar className = _class.split(' '),\r\n \t className = className[num];\r\n \treturn className;\r\n }", "title": "" }, { "docid": "57afc817192d477caea4d6330b35ee06", "score": "0.45197487", "text": "function decompose_css_id(css_id) {\n var pieces = css_id.split('_');\n var id = pieces.pop();\n var klass = pieces.map(function(p) {return p.capitalize();}).join('');\n return [klass, id];\n}", "title": "" }, { "docid": "c12c9a6bf280aa9869e7571b5d84e585", "score": "0.45097733", "text": "function getClasses(inputString) {\n var regex = /([a-z][a-z][a-z][a-z])\\s*(\\d{1,3})/gi;\n var matches = inputString.match(regex);\n\n var classes = matches.map(function(classEntry) {\n // regex to break out the classes\n var regex = /([a-z][a-z][a-z][a-z])\\s*(\\d{1,3})/gi;\n var match = regex.exec(classEntry);\n\n // extract and upper department identifier\n var department = match[1].toUpperCase();\n // extract and pad class number\n var classNumber = ('00' + match[2]).substr(-3);\n\n return department + classNumber;\n });\n\n return classes;\n}", "title": "" }, { "docid": "500ec30f74bc36353dc55f243e7802ea", "score": "0.4496029", "text": "computeTdClassName(cellData) {\n return this.computeWithPlugins('tdClassName', cellData);\n }", "title": "" }, { "docid": "4c75325a61ac28ac31bd57fb84cb1f8d", "score": "0.44792312", "text": "function parseCFFTable(data, start, font, opt) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(\n data,\n header.endOffset,\n parse.bytesToString\n );\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(\n data,\n topDictIndex.endOffset,\n parse.bytesToString\n );\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictArray = gatherCFFTopDicts(\n data,\n start,\n topDictIndex.objects,\n stringIndex.objects\n );\n if (topDictArray.length !== 1) {\n throw new Error(\n \"CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = \" +\n topDictArray.length\n );\n }\n\n var topDict = topDictArray[0];\n font.tables.cff.topDict = topDict;\n\n if (topDict._privateDict) {\n font.defaultWidthX = topDict._privateDict.defaultWidthX;\n font.nominalWidthX = topDict._privateDict.nominalWidthX;\n }\n\n if (topDict.ros[0] !== undefined && topDict.ros[1] !== undefined) {\n font.isCIDFont = true;\n }\n\n if (font.isCIDFont) {\n var fdArrayOffset = topDict.fdArray;\n var fdSelectOffset = topDict.fdSelect;\n if (fdArrayOffset === 0 || fdSelectOffset === 0) {\n throw new Error(\n 'Font is marked as a CID font, but FDArray and/or FDSelect information is missing'\n );\n }\n fdArrayOffset += start;\n var fdArrayIndex = parseCFFIndex(data, fdArrayOffset);\n var fdArray = gatherCFFTopDicts(\n data,\n start,\n fdArrayIndex.objects,\n stringIndex.objects\n );\n topDict._fdArray = fdArray;\n fdSelectOffset += start;\n topDict._fdSelect = parseCFFFDSelect(\n data,\n fdSelectOffset,\n font.numGlyphs,\n fdArray.length\n );\n }\n\n var privateDictOffset = start + topDict.private[1];\n var privateDict = parseCFFPrivateDict(\n data,\n privateDictOffset,\n topDict.private[0],\n stringIndex.objects\n );\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex;\n if (opt.lowMemory) {\n charStringsIndex = parseCFFIndexLowMemory(\n data,\n start + topDict.charStrings\n );\n font.nGlyphs = charStringsIndex.offsets.length;\n } else {\n charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n }\n\n var charset = parseCFFCharset(\n data,\n start + topDict.charset,\n font.nGlyphs,\n stringIndex.objects\n );\n if (topDict.encoding === 0) {\n // Standard encoding\n font.cffEncoding = new CffEncoding(cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) {\n // Expert encoding\n font.cffEncoding = new CffEncoding(cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(\n data,\n start + topDict.encoding,\n charset\n );\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n if (opt.lowMemory) {\n font._push = function (i) {\n var charString = getCffIndexObject(\n i,\n charStringsIndex.offsets,\n data,\n start + topDict.charStrings\n );\n font.glyphs.push(\n i,\n glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)\n );\n };\n } else {\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(\n i,\n glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)\n );\n }\n }\n }", "title": "" }, { "docid": "e533f3d251a08177e9c403f398f7a97f", "score": "0.44585305", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString);\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictArray = gatherCFFTopDicts(data, start, topDictIndex.objects, stringIndex.objects);\n if (topDictArray.length !== 1) {\n throw new Error('CFF table has too many fonts in \\'FontSet\\' - ' + 'count of fonts NameIndex.length = ' + topDictArray.length);\n }\n\n var topDict = topDictArray[0];\n font.tables.cff.topDict = topDict;\n\n if (topDict._privateDict) {\n font.defaultWidthX = topDict._privateDict.defaultWidthX;\n font.nominalWidthX = topDict._privateDict.nominalWidthX;\n }\n\n if (topDict.ros[0] !== undefined && topDict.ros[1] !== undefined) {\n font.isCIDFont = true;\n }\n\n if (font.isCIDFont) {\n var fdArrayOffset = topDict.fdArray;\n var fdSelectOffset = topDict.fdSelect;\n if (fdArrayOffset === 0 || fdSelectOffset === 0) {\n throw new Error('Font is marked as a CID font, but FDArray and/or FDSelect information is missing');\n }\n fdArrayOffset += start;\n var fdArrayIndex = parseCFFIndex(data, fdArrayOffset);\n var fdArray = gatherCFFTopDicts(data, start, fdArrayIndex.objects, stringIndex.objects);\n topDict._fdArray = fdArray;\n fdSelectOffset += start;\n topDict._fdSelect = parseCFFFDSelect(data, fdSelectOffset, font.numGlyphs, fdArray.length);\n }\n\n var privateDictOffset = start + topDict['private'][1];\n var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict['private'][0], stringIndex.objects);\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects);\n if (topDict.encoding === 0) { // Standard encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) { // Expert encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset);\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString));\n }\n}", "title": "" }, { "docid": "e2db17241de4d9b842dd60e9a4da9249", "score": "0.4454233", "text": "function getSymbol(id) {\r\n var cls;\r\n switch(id) {\r\n case \"1\":\r\n cls = new CartographicLineSymbol(\r\n CartographicLineSymbol.STYLE_SOLID,\r\n new Color([255, 0, 0]), 4,\r\n CartographicLineSymbol.CAP_ROUND,\r\n CartographicLineSymbol.JOIN_ROUND, 1\r\n );\r\n break;\r\n case \"2\":\r\n cls = new CartographicLineSymbol(\r\n CartographicLineSymbol.STYLE_SOLID,\r\n new Color([0, 0, 255]), 4,\r\n CartographicLineSymbol.JOIN_MITER, 1\r\n );\r\n break;\r\n case \"3\":\r\n cls = new CartographicLineSymbol(\r\n CartographicLineSymbol.STYLE_SOLID,\r\n new Color([255, 0, 255]), 2,\r\n CartographicLineSymbol.CAP_SQUARE,\r\n CartographicLineSymbol.JOIN_ROUND, 1\r\n );\r\n break;\r\n default:\r\n cls = new CartographicLineSymbol(\r\n CartographicLineSymbol.STYLE_SOLID,\r\n new Color([16, 192, 16]), 4,\r\n CartographicLineSymbol.CAP_ROUND,\r\n CartographicLineSymbol.JOIN_MITER, 1\r\n );\r\n break;\r\n }\r\n return cls;\r\n }", "title": "" }, { "docid": "8ffd23514ee5ad4926fab4e645995ac7", "score": "0.44418195", "text": "function getShipNumberClass(cell) {\n\tvar shipNumberClass = '';\n\tfor (var i = 1; i <= _numberOfShips * 2; i++) {\n\t\tshipNumberClass = ('ship_number_' + i);\n\t\tif (cellContainsClass(cell, shipNumberClass)) {\n\t\t\treturn shipNumberClass;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d793e1fa7a9973a90aadf49795da2806", "score": "0.44272673", "text": "function parseTable(){\n $(tableBodyJQ).children().each(function(){\n let thisClass = [];\n let children = $(this).children();\n thisClass.push(children.eq(0).text().substring(0, 3));\n thisClass.push(children.eq(1).find('a').text());\n thisClass.push(children.eq(2).text(), children.eq(3).text());\n classes.push(thisClass);\n });\n}", "title": "" }, { "docid": "529db8a9c05fa0c4540db8e421f4dc27", "score": "0.4420863", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(\n data,\n topDictIndex.endOffset,\n parse.bytesToString\n );\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictArray = gatherCFFTopDicts(\n data,\n start,\n topDictIndex.objects,\n stringIndex.objects\n );\n if (topDictArray.length !== 1) {\n throw new Error(\n \"CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = \" +\n topDictArray.length\n );\n }\n\n var topDict = topDictArray[0];\n font.tables.cff.topDict = topDict;\n\n if (topDict._privateDict) {\n font.defaultWidthX = topDict._privateDict.defaultWidthX;\n font.nominalWidthX = topDict._privateDict.nominalWidthX;\n }\n\n if (topDict.ros[0] !== undefined && topDict.ros[1] !== undefined) {\n font.isCIDFont = true;\n }\n\n if (font.isCIDFont) {\n var fdArrayOffset = topDict.fdArray;\n var fdSelectOffset = topDict.fdSelect;\n if (fdArrayOffset === 0 || fdSelectOffset === 0) {\n throw new Error(\n 'Font is marked as a CID font, but FDArray and/or FDSelect information is missing'\n );\n }\n fdArrayOffset += start;\n var fdArrayIndex = parseCFFIndex(data, fdArrayOffset);\n var fdArray = gatherCFFTopDicts(\n data,\n start,\n fdArrayIndex.objects,\n stringIndex.objects\n );\n topDict._fdArray = fdArray;\n fdSelectOffset += start;\n topDict._fdSelect = parseCFFFDSelect(\n data,\n fdSelectOffset,\n font.numGlyphs,\n fdArray.length\n );\n }\n\n var privateDictOffset = start + topDict.private[1];\n var privateDict = parseCFFPrivateDict(\n data,\n privateDictOffset,\n topDict.private[0],\n stringIndex.objects\n );\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(\n data,\n start + topDict.charset,\n font.nGlyphs,\n stringIndex.objects\n );\n if (topDict.encoding === 0) {\n // Standard encoding\n font.cffEncoding = new CffEncoding(cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) {\n // Expert encoding\n font.cffEncoding = new CffEncoding(cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(\n data,\n start + topDict.encoding,\n charset\n );\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(\n i,\n glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)\n );\n }\n }", "title": "" }, { "docid": "1b21ebdda371e08655d3d0fe30b98d1a", "score": "0.4400724", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString);\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictData = new DataView(new Uint8Array(topDictIndex.objects[0]).buffer);\n var topDict = parseCFFTopDict(topDictData, stringIndex.objects);\n font.tables.cff.topDict = topDict;\n\n var privateDictOffset = start + topDict['private'][1];\n var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict['private'][0], stringIndex.objects);\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects);\n if (topDict.encoding === 0) {\n // Standard encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) {\n // Expert encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset);\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString));\n }\n }", "title": "" }, { "docid": "938eb7a27bf206385670b8914819e5e2", "score": "0.43897775", "text": "function bg_to_class(BG) {\n if (BG < 50) \n\treturn 'low-urgent';\n if (BG < 60)\n\treturn 'low-attention';\n if (BG < 70)\n\treturn 'low';\n if (BG < 180)\n\treturn 'neutral';\n if (BG < 250)\n\treturn 'high';\n if (BG < 300)\n\treturn 'high-attention';\n return 'high-urgent';\n\n}", "title": "" }, { "docid": "7222855faffb53b44fe088feb5a54ca7", "score": "0.43864614", "text": "function getClassName(cell) {\n var className = `covered cell-${cell.i}-${cell.j}`\n return className\n}", "title": "" }, { "docid": "ef6e7c6789299c850ca2f3852b21019e", "score": "0.43785784", "text": "function tdClass (val, cls = false) {\n return (cls != false)? \"<td class='\" + cls + \"'>\" + val + \"</td>\" : \"<td>\" + val + \"</td>\";\n}", "title": "" }, { "docid": "c62d0772d7157d9157ebaf8f9ff9adf1", "score": "0.4375432", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString);\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictData = new DataView(new Uint8Array(topDictIndex.objects[0]).buffer);\n var topDict = parseCFFTopDict(topDictData, stringIndex.objects);\n font.tables.cff.topDict = topDict;\n\n var privateDictOffset = start + topDict['private'][1];\n var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict['private'][0], stringIndex.objects);\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects);\n if (topDict.encoding === 0) { // Standard encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) { // Expert encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset);\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString));\n }\n}", "title": "" }, { "docid": "c62d0772d7157d9157ebaf8f9ff9adf1", "score": "0.4375432", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString);\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictData = new DataView(new Uint8Array(topDictIndex.objects[0]).buffer);\n var topDict = parseCFFTopDict(topDictData, stringIndex.objects);\n font.tables.cff.topDict = topDict;\n\n var privateDictOffset = start + topDict['private'][1];\n var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict['private'][0], stringIndex.objects);\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects);\n if (topDict.encoding === 0) { // Standard encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) { // Expert encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset);\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString));\n }\n}", "title": "" }, { "docid": "c62d0772d7157d9157ebaf8f9ff9adf1", "score": "0.4375432", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString);\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictData = new DataView(new Uint8Array(topDictIndex.objects[0]).buffer);\n var topDict = parseCFFTopDict(topDictData, stringIndex.objects);\n font.tables.cff.topDict = topDict;\n\n var privateDictOffset = start + topDict['private'][1];\n var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict['private'][0], stringIndex.objects);\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects);\n if (topDict.encoding === 0) { // Standard encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) { // Expert encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset);\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString));\n }\n}", "title": "" }, { "docid": "c62d0772d7157d9157ebaf8f9ff9adf1", "score": "0.4375432", "text": "function parseCFFTable(data, start, font) {\n font.tables.cff = {};\n var header = parseCFFHeader(data, start);\n var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString);\n var topDictIndex = parseCFFIndex(data, nameIndex.endOffset);\n var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString);\n var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);\n font.gsubrs = globalSubrIndex.objects;\n font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);\n\n var topDictData = new DataView(new Uint8Array(topDictIndex.objects[0]).buffer);\n var topDict = parseCFFTopDict(topDictData, stringIndex.objects);\n font.tables.cff.topDict = topDict;\n\n var privateDictOffset = start + topDict['private'][1];\n var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict['private'][0], stringIndex.objects);\n font.defaultWidthX = privateDict.defaultWidthX;\n font.nominalWidthX = privateDict.nominalWidthX;\n\n if (privateDict.subrs !== 0) {\n var subrOffset = privateDictOffset + privateDict.subrs;\n var subrIndex = parseCFFIndex(data, subrOffset);\n font.subrs = subrIndex.objects;\n font.subrsBias = calcCFFSubroutineBias(font.subrs);\n } else {\n font.subrs = [];\n font.subrsBias = 0;\n }\n\n // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.\n var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);\n font.nGlyphs = charStringsIndex.objects.length;\n\n var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects);\n if (topDict.encoding === 0) { // Standard encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffStandardEncoding, charset);\n } else if (topDict.encoding === 1) { // Expert encoding\n font.cffEncoding = new encoding.CffEncoding(encoding.cffExpertEncoding, charset);\n } else {\n font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset);\n }\n\n // Prefer the CMAP encoding to the CFF encoding.\n font.encoding = font.encoding || font.cffEncoding;\n\n font.glyphs = new glyphset.GlyphSet(font);\n for (var i = 0; i < font.nGlyphs; i += 1) {\n var charString = charStringsIndex.objects[i];\n font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString));\n }\n}", "title": "" }, { "docid": "6951ee9f4322c13fc431f1d9599790ee", "score": "0.43504477", "text": "function JSONParseFunc(className) {\n\tFunctionTypeBase.call(this, 0, className || 'Function');\n}", "title": "" }, { "docid": "f3179aadac9c0569bad9e5db87251b60", "score": "0.43430433", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new path.Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var open = false;\n var x = 0;\n var y = 0;\n var subrs;\n var subrsBias;\n var defaultWidthX;\n var nominalWidthX;\n if (font.isCIDFont) {\n var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index];\n var fdDict = font.tables.cff.topDict._fdArray[fdIndex];\n subrs = fdDict._subrs;\n subrsBias = fdDict._subrsBias;\n defaultWidthX = fdDict._defaultWidthX;\n nominalWidthX = fdDict._nominalWidthX;\n } else {\n subrs = font.tables.cff.topDict._subrs;\n subrsBias = font.tables.cff.topDict._subrsBias;\n defaultWidthX = font.tables.cff.topDict._defaultWidthX;\n nominalWidthX = font.tables.cff.topDict._nominalWidthX;\n }\n var width = defaultWidthX;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + subrsBias;\n subrCode = subrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v);\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log('Glyph ' + glyph.index + ': unknown operator ' + v);\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536);\n }\n }\n }\n }\n\n parse(code);\n\n glyph.advanceWidth = width;\n return p;\n}", "title": "" }, { "docid": "0e13f1a7772ba6205189884f6be29c10", "score": "0.43357664", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var open = false;\n var x = 0;\n var y = 0;\n var subrs;\n var subrsBias;\n var defaultWidthX;\n var nominalWidthX;\n if (font.isCIDFont) {\n var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index];\n var fdDict = font.tables.cff.topDict._fdArray[fdIndex];\n subrs = fdDict._subrs;\n subrsBias = fdDict._subrsBias;\n defaultWidthX = fdDict._defaultWidthX;\n nominalWidthX = fdDict._nominalWidthX;\n } else {\n subrs = font.tables.cff.topDict._subrs;\n subrsBias = font.tables.cff.topDict._subrsBias;\n defaultWidthX = font.tables.cff.topDict._defaultWidthX;\n nominalWidthX = font.tables.cff.topDict._nominalWidthX;\n }\n var width = defaultWidthX;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + subrsBias;\n subrCode = subrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log(\n 'Glyph ' +\n glyph.index +\n ': unknown operator ' +\n 1200 +\n v\n );\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log(\n 'Glyph ' + glyph.index + ': unknown operator ' + v\n );\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(\n ((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536\n );\n }\n }\n }\n }\n\n parse(code);\n\n glyph.advanceWidth = width;\n return p;\n }", "title": "" }, { "docid": "4ae03720cf09ef2dd74349a45c24e9cf", "score": "0.43277863", "text": "function getNameOfClass(class_id) {\n for (var name in allClassesNameToID) {\n if (allClassesNameToID[name] == class_id) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "8cc6e6fafc7b9c3cdf06b9be8ffa286c", "score": "0.43232203", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var open = false;\n var x = 0;\n var y = 0;\n var subrs;\n var subrsBias;\n var defaultWidthX;\n var nominalWidthX;\n if (font.isCIDFont) {\n var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index];\n var fdDict = font.tables.cff.topDict._fdArray[fdIndex];\n subrs = fdDict._subrs;\n subrsBias = fdDict._subrsBias;\n defaultWidthX = fdDict._defaultWidthX;\n nominalWidthX = fdDict._nominalWidthX;\n } else {\n subrs = font.tables.cff.topDict._subrs;\n subrsBias = font.tables.cff.topDict._subrsBias;\n defaultWidthX = font.tables.cff.topDict._defaultWidthX;\n nominalWidthX = font.tables.cff.topDict._nominalWidthX;\n }\n var width = defaultWidthX;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse$$1(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + subrsBias;\n subrCode = subrs[codeIndex];\n if (subrCode) {\n parse$$1(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log(\n 'Glyph ' + glyph.index + ': unknown operator ' + 1200 + v\n );\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse$$1(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log('Glyph ' + glyph.index + ': unknown operator ' + v);\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536);\n }\n }\n }\n }\n\n parse$$1(code);\n\n glyph.advanceWidth = width;\n return p;\n }", "title": "" }, { "docid": "e55d156ff856b49c30ba194d961e3bf2", "score": "0.43157065", "text": "processNamedClass() {\n if (!this.tokens.matches2(_types.TokenType._class, _types.TokenType.name)) {\n throw new Error(\"Expected identifier for exported class name.\");\n }\n const name = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);\n this.processClass();\n return name;\n }", "title": "" }, { "docid": "efebffddfca3a50ece4d6f93426aaa7b", "score": "0.4312235", "text": "getClass(knex, id) {\n return knex.select(\"*\").from(\"classes\").where({ id });\n }", "title": "" }, { "docid": "66099d2f1cf21ad32c4002a5cb7976d9", "score": "0.4300938", "text": "function getStyleClass (className) {\n var regex = new RegExp('\\\\.' + className + '\\$', \"i\"); \n if (document.all) {\n\tfor (var s = 0; s < document.styleSheets.length; s++) {\n for (var r = 0; r < document.styleSheets[s].rules.length; r++) {\n if (document.styleSheets[s].rules[r].selectorText &&\n\t\t document.styleSheets[s].rules[r].selectorText.match(regex)) {\n return document.styleSheets[s].rules[r];\n }\n }\n }\n }\n else if (document.getElementById) {\n for (var s = 0; s < document.styleSheets.length; s++) {\n for (var r = 0; r < document.styleSheets[s].cssRules.length; r++) {\n if (document.styleSheets[s].cssRules[r].selectorText &&\n\t\t document.styleSheets[s].cssRules[r].selectorText.match(regex)) {\n return document.styleSheets[s].cssRules[r];\n }\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "a30b2609cdccc5e713e985dfb275478b", "score": "0.4284587", "text": "function getClassForCell(cell) {\n switch (cell) {\n case 'w':\n return 'wall';\n case 'f':\n return 'floor';\n case 'b':\n return 'box floor';\n case 's':\n return 'storage floor';\n case 'p':\n return 'player floor';\n }\n}", "title": "" }, { "docid": "e4f0aef53ec2d8842fb77d9b2af33a5b", "score": "0.42812583", "text": "function className( input_str){\n input_str=trim(input_str);\n var class_name;\n var begin=find_not_in_string(input_str,\"class \")+6;\n var end;\n if(find_not_in_string(input_str,\" extends \")==-1){\n end=find_from_index(input_str,\":\",begin+1);\n if(end==-1){\n printf(\"@@ |\"+CURRENT_INPUT_STR+\"|\\n\");\n\n printf(\"class define mistake occurred. please check.\\nThe format should be 'class hi:' or 'class hi extends hello:\");\n exit(0);\n }\n class_name=substr(input_str,begin,end);\n class_name=trim(class_name);\n }\n else{\n end=find_from_index(input_str,\" extends \",begin+1);\n class_name=substr(input_str,begin,end);\n class_name=trim(class_name);\n }\n return class_name;\n}", "title": "" }, { "docid": "d681caf463798170f60b05437d0dd234", "score": "0.42756978", "text": "function alignmentClass(alignment) {\n switch (alignment) {\n case alignment_1.Alignment.LEFT:\n return exports.ALIGN_LEFT;\n case alignment_1.Alignment.RIGHT:\n return exports.ALIGN_RIGHT;\n default:\n return undefined;\n }\n}", "title": "" }, { "docid": "d681caf463798170f60b05437d0dd234", "score": "0.42756978", "text": "function alignmentClass(alignment) {\n switch (alignment) {\n case alignment_1.Alignment.LEFT:\n return exports.ALIGN_LEFT;\n case alignment_1.Alignment.RIGHT:\n return exports.ALIGN_RIGHT;\n default:\n return undefined;\n }\n}", "title": "" }, { "docid": "f52e0d7bb4af95082142dd3369fea9dc", "score": "0.42683443", "text": "function parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}", "title": "" }, { "docid": "f52e0d7bb4af95082142dd3369fea9dc", "score": "0.42683443", "text": "function parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}", "title": "" }, { "docid": "f52e0d7bb4af95082142dd3369fea9dc", "score": "0.42683443", "text": "function parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}", "title": "" }, { "docid": "f52e0d7bb4af95082142dd3369fea9dc", "score": "0.42683443", "text": "function parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}", "title": "" }, { "docid": "f52e0d7bb4af95082142dd3369fea9dc", "score": "0.42683443", "text": "function parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}", "title": "" }, { "docid": "f52e0d7bb4af95082142dd3369fea9dc", "score": "0.42683443", "text": "function parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}", "title": "" }, { "docid": "59bcf6ced91a35e9b947eed6a6d3e1cf", "score": "0.42670512", "text": "function highlightClass(x, y, w, h, whichClass) {\n fill(0, 255, 0);\n rect(x, y + whichClass*h, w, h);\n fill(\"black\");\n text(allCharClasses[whichClass], x, y + whichClass*h + height*0.05);\n fill(255, 0, 0);\n}", "title": "" }, { "docid": "9ae9d3f26dba0e8d7e5e3ddcbd42765c", "score": "0.4253996", "text": "getClassSelector() {\n var parser = (this.parser === SmoLyric.parsers.lyric ? 'lyric' : 'chord');\n return 'g.'+parser+'-'+this.verse;\n }", "title": "" }, { "docid": "cda5cb3007098a7401f3e801a7c856a2", "score": "0.42491522", "text": "function fc_map_field(classname) \n{\n var field_name;\n\n switch(classname) \n {\n \tcase \"aingr.ForwardingClass\":\n \tcase \"aengr.ForwardingClass\":\n \tcase \"sasqos.AccessIngressForwardingClass\":\n \tcase \"sasqos.PortAccessIngressForwardingClass\":\n \t\tfield_name=\"containingPolicyId\";\n \tbreak;\n \tcase \"nqueue.ForwardingClass\":\n \t\t//field_name=\"policyId\";\n \t\tfield_name=\"containingPolicyDisplayedName\";\n \tbreak;\n \tdefault:\n \t\tlogP6Msg(\"fc_map_field\", \"SAMIF\", \"Don't recognize class \"+classname);\n }\n\n return(field_name);\n}", "title": "" }, { "docid": "8e0c746b1456c2dda564818b87c5d037", "score": "0.42491052", "text": "function checkClass(classId) {\n return Classes.getClassById(classId);\n}", "title": "" }, { "docid": "3743dc4d7ac0c7c5255a61c740bb7573", "score": "0.42433414", "text": "function parse_PtgFunc(blob, length, opts) {\n //var ptg = blob[blob.l] & 0x1F;\n var type = (blob[blob.l] & 0x60) >> 5;\n blob.l += 1;\n var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n return [FtabArgc[iftab], Ftab[iftab], type];\n }", "title": "" }, { "docid": "3743dc4d7ac0c7c5255a61c740bb7573", "score": "0.42433414", "text": "function parse_PtgFunc(blob, length, opts) {\n //var ptg = blob[blob.l] & 0x1F;\n var type = (blob[blob.l] & 0x60) >> 5;\n blob.l += 1;\n var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n return [FtabArgc[iftab], Ftab[iftab], type];\n }", "title": "" }, { "docid": "ea2cba3aa716ad1d214d0e25ce969cb0", "score": "0.42406356", "text": "deleteClassMethod(cell, relationId) {\n\t\tconst code = this.getCodeByNode(cell);\n\t\tthis.deleteRelation(code, relationId);\n\t}", "title": "" }, { "docid": "ef6276fb830f6e2a04ef47ff9d39e3fa", "score": "0.423906", "text": "function parseValue(what, classes, direction) {\n for (j = 0; j < classes.length; j++) {\n var level = classes[j].split('-')[2];\n if (new RegExp(direction + what + /\\d+/.source).test(level)) {\n switch(what) {\n case \"TH\":\n return parseInt(level.slice(5));\n case \"Troph\":\n return parseInt(level.slice(8));\n default:\n return 0;\n }\n }\n }\n return 0;\n}", "title": "" }, { "docid": "a1f78603e52542fe556692f680f3502f", "score": "0.4234468", "text": "function typeClassLongForm(definition) {\n return typeIdentifier(definition).match(/t_([^$_]+)/)[1];\n}", "title": "" }, { "docid": "6fb15ec11ecd63d1680c6ee95ec6c86e", "score": "0.42311564", "text": "function classStats(charClass) {\n switch (charClass) {\n case \"Barbarian\":\n stats = {\n STR: 15,\n DEX: 13,\n CON: 14,\n INT: 8,\n WIS: 10,\n CHA: 12\n };\n statMod = {\n STRMOD: \"+2\",\n DEXMOD: \"+1\",\n CONMOD: \"+2\",\n INTMOD: \"-1\",\n WISMOD: \"0\",\n CHAMOD: \"+1\"\n };\n charData = {\n AC: 13,\n HP: 14,\n HD: \"1d12\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+1\",\n animalHandling: \"0\",\n arcana: \"-1\",\n athletics: \"+4\",\n deception: \"+1\",\n history: \"-1\",\n insight: \"0\",\n intimidation: \"+1\",\n investigation: \"-1\",\n medicine: \"0\",\n nature: \"-1\",\n perception: \"+2\",\n performance: \"+1\",\n persuasion: \"+1\",\n religion: \"-1\",\n sleightOfHand: \"+1\",\n stealth: \"+1\",\n survival: \"0\"\n };\n savingThrows = {\n strength: \"+4\",\n dexterity: \"+1\",\n constitution: \"+4\",\n inteligence: \"-1\",\n wisdom: \"0\",\n charisma: \"+1\"\n };\n spells = {\n cantrips: [\n \"None\"\n ],\n levelOne: [\n \"None\"\n ]};\n console.log(data);\n break;\n //data case for the bard class\n case \"Bard\":\n stats = {\n STR: 8,\n DEX: 14,\n CON: 13,\n INT: 10,\n WIS: 12,\n CHA: 15\n };\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+2\",\n CONMOD: \"+1\",\n INTMOD: \"0\",\n WISMOD: \"+1\",\n CHAMOD: \"+2\"\n };\n charData = {\n AC: 13,\n HP: 9,\n HD: \"1d8\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+2\",\n animalHandling: \"+1\",\n arcana: \"0\",\n athletics: \"-1\",\n deception: \"+4\",\n history: \"0\",\n insight: \"+1\",\n intimidation: \"+2\",\n investigation: \"0\",\n medicine: \"+1\",\n nature: \"0\",\n perception: \"+1\",\n performance: \"+4\",\n persuasion: \"+4\",\n religion: \"0\",\n sleightOfHand: \"+2\",\n stealth: \"+2\",\n survival: \"+1\"\n };\n savingThrows = {\n strength: \"-1\",\n dexterity: \"+4\",\n constitution: \"+1\",\n inteligence: \"0\",\n wisdom: \"+1\",\n charisma: \"+4\"\n };\n getSpells(\"bard\");\n break;\n\n //data case for cleric stats\n case \"Cleric\":\n stats = {\n STR: 14,\n DEX: 8,\n CON: 12,\n INT: 10,\n WIS: 15,\n CHA: 13\n };\n statMod = {\n STRMOD: \"+2\",\n DEXMOD: \"-1\",\n CONMOD: \"+1\",\n INTMOD: \"0\",\n WISMOD: \"+2\",\n CHAMOD: \"+1\"\n };\n charData = {\n AC: 15,\n HP: 9,\n HD: \"1d8\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"-1\",\n animalHandling: \"+2\",\n arcana: \"0\",\n athletics: \"+2\",\n deception: \"+1\",\n history: \"0\",\n insight: \"+2\",\n intimidation: \"+1\",\n investigation: \"0\",\n medicine: \"+2\",\n nature: \"0\",\n perception: \"+2\",\n performance: \"+1\",\n persuasion: \"+3\",\n religion: \"+2\",\n sleightOfHand: \"-1\",\n stealth: \"-1\",\n survival: \"+2\"\n };\n savingThrows = {\n strength: \"+2\",\n dexterity: \"-1\",\n constitution: \"+1\",\n inteligence: \"0\",\n wisdom: \"+4\",\n charisma: \"+3\"\n };\n getSpells(\"cleric\");\n break;\n\n case \"Druid\":\n stats = {\n STR: 12,\n DEX: 8,\n CON: 14,\n INT: 10,\n WIS: 15,\n CHA: 13\n };\n statMod = {\n STRMOD: \"+1\",\n DEXMOD: \"-1\",\n CONMOD: \"+2\",\n INTMOD: \"0\",\n WISMOD: \"+2\",\n CHAMOD: \"+1\"\n };\n charData = {\n AC: 10,\n HP: 10,\n HD: \"1d8\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"-1\",\n animalHandling: \"+4\",\n arcana: \"0\",\n athletics: \"+1\",\n deception: \"+1\",\n history: \"0\",\n insight: \"+2\",\n intimidation: \"+1\",\n investigation: \"0\",\n medicine: \"+2\",\n nature: \"+2\",\n perception: \"+2\",\n performance: \"+1\",\n persuasion: \"+1\",\n religion: \"0\",\n sleightOfHand: \"-1\",\n stealth: \"-1\",\n survival: \"+2\"\n };\n savingThrows = {\n strength: \"+2\",\n dexterity: \"-1\",\n constitution: \"+1\",\n inteligence: \"+2\",\n wisdom: \"+4\",\n charisma: \"+1\"\n };\n getSpells(\"druid\");\n break;\n\n case \"Fighter\":\n stats = {\n STR: 15,\n DEX: 8,\n CON: 14,\n INT: 12,\n WIS: 10,\n CHA: 13\n },\n statMod = {\n STRMOD: \"+2\",\n DEXMOD: \"-1\",\n CONMOD: \"+2\",\n INTMOD: \"+1\",\n WISMOD: \"0\",\n CHAMOD: \"+1\"\n };\n charData = {\n AC: 16,\n HP: 12,\n HD: \"1d10\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"-1\",\n animalHandling: \"0\",\n arcana: \"+1\",\n athletics: \"+2\",\n deception: \"+1\",\n history: \"+1\",\n insight: \"0\",\n intimidation: \"+1\",\n investigation: \"+1\",\n medicine: \"0\",\n nature: \"+1\",\n perception: \"0\",\n performance: \"+1\",\n persuasion: \"+1\",\n religion: \"+1\",\n sleightOfHand: \"-1\",\n stealth: \"-1\",\n survival: \"0\"\n };\n savingThrows = {\n strength: \"+4\",\n dexterity: \"-1\",\n constitution: \"+4\",\n inteligence: \"+1\",\n wisdom: \"+0\",\n charisma: \"+1\"\n };\n spells = {\n cantrips: [\n \"None\"\n ],\n levelOne: [\n \"None\"\n ]};\n break;\n\n case \"Monk\":\n stats = {\n STR: 8,\n DEX: 15,\n CON: 13,\n INT: 12,\n WIS: 14,\n CHA: 10\n },\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+2\",\n CONMOD: \"+1\",\n INTMOD: \"+1\",\n WISMOD: \"+2\",\n CHAMOD: \"0\"\n };\n charData = {\n AC: 13,\n HP: 9,\n HD: \"1d8\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+4\",\n animalHandling: \"2\",\n arcana: \"+1\",\n athletics: \"-1\",\n deception: \"0\",\n history: \"+1\",\n insight: \"+4\",\n intimidation: \"0\",\n investigation: \"+1\",\n medicine: \"+2\",\n nature: \"+1\",\n perception: \"+2\",\n performance: \"0\",\n persuasion: \"0\",\n religion: \"+1\",\n sleightOfHand: \"+2\",\n stealth: \"+2\",\n survival: \"2\"\n };\n savingThrows = {\n strength: \"+1\",\n dexterity: \"+4\",\n constitution: \"+1\",\n inteligence: \"+1\",\n wisdom: \"+2\",\n charisma: \"+1\"\n };\n spells = {\n cantrips: [\n \"None\"\n ],\n levelOne: [\n \"None\"\n ]\n };\n break;\n\n case \"Paladin\":\n stats = {\n STR: 15,\n DEX: 8,\n CON: 13,\n INT: 12,\n WIS: 10,\n CHA: 14\n };\n statMod = {\n STRMOD: \"+2\",\n DEXMOD: \"-1\",\n CONMOD: \"+1\",\n INTMOD: \"+1\",\n WISMOD: \"0\",\n CHAMOD: \"+2\"\n };\n charData = {\n AC: 16,\n HP: 11,\n HD: \"1d10\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"-1\",\n animalHandling: \"0\",\n arcana: \"+1\",\n athletics: \"+4\",\n deception: \"+2\",\n history: \"+1\",\n insight: \"0\",\n intimidation: \"+2\",\n investigation: \"+1\",\n medicine: \"0\",\n nature: \"+1\",\n perception: \"0\",\n performance: \"+2\",\n persuasion: \"+2\",\n religion: \"+3\",\n sleightOfHand: \"-1\",\n stealth: \"-1\",\n survival: \"0\"\n };\n savingThrows = {\n strength: \"+2\",\n dexterity: \"-1\",\n constitution: \"+1\",\n inteligence: \"+1\",\n wisdom: \"+2\",\n charisma: \"+4\"\n };\n spells = {\n cantrips: [\n \"None\"\n ],\n levelOne: [\n \"None\"\n ]};\n break;\n\n case \"Ranger\":\n stats = {\n STR: 8,\n DEX: 15,\n CON: 13,\n INT: 12,\n WIS: 14,\n CHA: 10\n },\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+2\",\n CONMOD: \"+1\",\n INTMOD: \"+1\",\n WISMOD: \"+2\",\n CHAMOD: \"0\"\n };\n charData = {\n AC: 13,\n HP: 11,\n HD: \"1d10\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+2\",\n animalHandling: \"+2\",\n arcana: \"+1\",\n athletics: \"-1\",\n deception: \"0\",\n history: \"+1\",\n insight: \"+2\",\n intimidation: \"0\",\n investigation: \"+3\",\n medicine: \"+2\",\n nature: \"+1\",\n perception: \"+4\",\n performance: \"0\",\n persuasion: \"0\",\n religion: \"+1\",\n sleightOfHand: \"-1\",\n stealth: \"-1\",\n survival: \"+2\"\n };\n savingThrows = {\n strength: \"+1\",\n dexterity: \"+4\",\n constitution: \"+1\",\n inteligence: \"+1\",\n wisdom: \"+2\",\n charisma: \"0\"\n };\n spells = {\n cantrips: [\n \"None\"\n ],\n levelOne: [\n \"None\"\n ]};\n break;\n\n case \"Rogue\":\n stats = {\n STR: 8,\n DEX: 15,\n CON: 10,\n INT: 12,\n WIS: 13,\n CHA: 14\n },\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+2\",\n CONMOD: \"0\",\n INTMOD: \"+1\",\n WISMOD: \"+1\",\n CHAMOD: \"+2\"\n };\n charData = {\n AC: 13,\n HP: 8,\n HD: \"1d8\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+6\",\n animalHandling: \"+1\",\n arcana: \"+1\",\n athletics: \"-1\",\n deception: \"+4\",\n history: \"+1\",\n insight: \"+1\",\n intimidation: \"+2\",\n investigation: \"+5\",\n medicine: \"+1\",\n nature: \"+1\",\n perception: \"+3\",\n performance: \"+2\",\n persuasion: \"+2\",\n religion: \"+1\",\n sleightOfHand: \"+4\",\n stealth: \"+2\",\n survival: \"+1\"\n };\n savingThrows = {\n strength: \"-1\",\n dexterity: \"+4\",\n constitution: \"0\",\n inteligence: \"+3\",\n wisdom: \"+1\",\n charisma: \"+2\"\n };\n spells = {\n cantrips: [\n \"None\"\n ],\n levelOne: [\n \"None\"\n ]};\n break;\n\n case \"Sorcerer\":\n stats = {\n STR: 8,\n DEX: 13,\n CON: 14,\n INT: 12,\n WIS: 10,\n CHA: 15\n },\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+1\",\n CONMOD: \"+2\",\n INTMOD: \"+1\",\n WISMOD: \"0\",\n CHAMOD: \"+2\"\n };\n charData = {\n AC: 11,\n HP: 8,\n HD: \"1d6\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+1\",\n animalHandling: \"0\",\n arcana: \"+3\",\n athletics: \"-1\",\n deception: \"+2\",\n history: \"+1\",\n insight: \"+2\",\n intimidation: \"+2\",\n investigation: \"+1\",\n medicine: \"0\",\n nature: \"+1\",\n perception: \"0\",\n performance: \"+2\",\n persuasion: \"+2\",\n religion: \"+1\",\n sleightOfHand: \"+1\",\n stealth: \"+1\",\n survival: \"0\"\n };\n savingThrows = {\n strength: \"-1\",\n dexterity: \"+1\",\n constitution: \"+4\",\n inteligence: \"+1\",\n wisdom: \"0\",\n charisma: \"+4\"\n };\n getSpells(\"sorcerer\");\n break;\n\n case \"Warlock\":\n stats = {\n STR: 8,\n DEX: 13,\n CON: 14,\n INT: 12,\n WIS: 10,\n CHA: 15\n },\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+1\",\n CONMOD: \"+2\",\n INTMOD: \"+1\",\n WISMOD: \"0\",\n CHAMOD: \"+2\"\n };\n charData = {\n AC: 12,\n HP: 10,\n HD: \"1d8\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+1\",\n animalHandling: \"0\",\n arcana: \"+3\",\n athletics: \"-1\",\n deception: \"+2\",\n history: \"+3\",\n insight: \"0\",\n intimidation: \"+2\",\n investigation: \"+1\",\n medicine: \"0\",\n nature: \"+1\",\n perception: \"0\",\n performance: \"+2\",\n persuasion: \"+2\",\n religion: \"+1\",\n sleightOfHand: \"+1\",\n stealth: \"+1\",\n survival: \"0\"\n };\n savingThrows = {\n strength: \"-1\",\n dexterity: \"+1\",\n constitution: \"+2\",\n inteligence: \"+1\",\n wisdom: \"+2\",\n charisma: \"+4\"\n };\n $.get(\"http://www.dnd5eapi.co/api/classes/warlock/spells\", function(data) {\n console.log(data);\n spells = {\n cantrips: [\"Eldritch Blast\", \"Prestidigitation\"],\n levelOne: [\"Charm Person\", \"Hellish Rebuke\"]};\n });\n break;\n\n case \"Wizard\":\n stats = {\n STR: 8,\n DEX: 13,\n CON: 14,\n INT: 15,\n WIS: 10,\n CHA: 12\n },\n statMod = {\n STRMOD: \"-1\",\n DEXMOD: \"+1\",\n CONMOD: \"+2\",\n INTMOD: \"+2\",\n WISMOD: \"0\",\n CHAMOD: \"+1\"\n };\n charData = {\n AC: 11,\n HP: 8,\n HD: \"1d6\",\n INIT: statMod.DEXMOD\n };\n skills = {\n acrobatics: \"+1\",\n animalHandling: \"0\",\n arcana: \"+4\",\n athletics: \"-1\",\n deception: \"+1\",\n history: \"+2\",\n insight: \"0\",\n intimidation: \"+1\",\n investigation: \"+4\",\n medicine: \"0\",\n nature: \"+2\",\n perception: \"0\",\n performance: \"+1\",\n persuasion: \"+1\",\n religion: \"+2\",\n sleightOfHand: \"+1\",\n stealth: \"+1\",\n survival: \"0\"\n };\n savingThrows = {\n strength: \"-1\",\n dexterity: \"+1\",\n constitution: \"+2\",\n inteligence: \"+4\",\n wisdom: \"+2\",\n charisma: \"+1\"\n };\n getSpells(\"wizard\");\n break;\n }\n }", "title": "" }, { "docid": "2da6b70c1005b6e8fada325946e3b4d3", "score": "0.42276728", "text": "function parse_PtgFunc(blob, length, opts) {\n //var ptg = blob[blob.l] & 0x1F;\n var type = (blob[blob.l] & 0x60) >> 5;\n blob.l += 1;\n var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n return [FtabArgc[iftab], Ftab[iftab], type];\n }", "title": "" }, { "docid": "980fc3c5345c92d075d0dff84ae4ec3a", "score": "0.42224187", "text": "function placemark(cell, currentClass) {\r\n cell.classList.add(currentClass)\r\n}", "title": "" }, { "docid": "10bfc82fb758b4d5c47361715ee46958", "score": "0.42186785", "text": "function gettheclasses(tableClass,inst,classId){ \n tableClass.clear();\n tableClass.draw();\n tableClass.select.style( 'multi' );\n $.ajax({\n url: '/back/Student_Classes.php?id='+classId+\"&inst=\"+inst,\n async: false,\n dataType: 'json',\n success: function (json) { \n if( json.data[0] != null){\n for(var i=0; i<json.data.length; i++){\n var arrSpl = json.data[i].DT_RowId.split('_'); \n var rowNode = tableClass\n .row.add( [arrSpl[1],json.data[i].ems_person[\"lname\"],json.data[i].ems_person[\"fname\"],json.data[i].ems_person[\"mname\"],json.data[i].ems_person[\"telephone\"],json.data[i].ems_person[\"town\"]] )\n .draw()\n .node(); \n }\n \n \n }else{\n \n }\n }\n });\n \n}", "title": "" }, { "docid": "c140cf09e71a745f89fd4764078c0559", "score": "0.42033452", "text": "function setClass(character, classFromDB, newClass){\n\n var classfunc = classes[newClass];\n character.classId = newClass;\n character.classLevel = classFromDB.classLevel;\n character.classExp = classFromDB.classExp;\n character.hpEq += classfunc.BASE_HP_EQ;\n character.powEq += classfunc.BASE_POW_EQ;\n character.wisEq += classfunc.BASE_WIS_EQ;\n character.sklEq += classfunc.BASE_SKL_EQ;\n character.defEq += classfunc.BASE_DEF_EQ;\n character.resEq += classfunc.BASE_RES_EQ;\n character.spdEq += classfunc.BASE_SPD_EQ;\n character.lukEq += classfunc.BASE_LUK_EQ;\n character.turnEq += classfunc.BASE_TURN_EQ;\n character.aggroEq += classfunc.BASE_AGGRO_EQ;\n\n //If classLevel is 0, level up to 1\n if(character.classLevel <= 0){\n\n character.classExp = CLASS_EXP_TO_LEVEL;\n exports.levelUpClass(character, null);\n\n //Save class to DB\n var classRow = {\n _id: character._id + newClass,\n character: character._id,\n classId: newClass,\n classLevel: character.classLevel,\n classExp: character.classExp\n }\n dbfunc.updateClass(classRow);\n }\n else{\n\n //Start at level 1\n for(var i = 1; i <= character.classLevel; i++){\n\n var functionId = character.classId + i;\n if(classfunc.setClassLevelFunc[functionId] != null){\n\n classfunc.setClassLevelFunc[functionId](character);\n }\n }\n }\n}", "title": "" }, { "docid": "ed603318e87e991814a7e613947cc2b4", "score": "0.42032397", "text": "deleteClassField(cell, relationId) {\n\t\tconst code = this.getCodeByNode(cell);\n\t\tthis.deleteRelation(code, relationId);\n\t}", "title": "" }, { "docid": "71dfcabf804ed1b29b8fc6cdec327b39", "score": "0.42020103", "text": "function classParse(classList) {\n const re = /highcharts-series-(\\d{0,2})/\n const res = re.exec(classList)\n if(res !== null) {\n return res[1]\n } else {\n return null\n }\n }", "title": "" }, { "docid": "636b177ad879c63648476a2462d796ce", "score": "0.41987827", "text": "function getCharacterClass(job) {\r\n switch(job) {\r\n case 1:\r\n return \"Warrior\";\r\n break;\r\n case 2:\r\n return \"Paladin\";\r\n break;\r\n case 3:\r\n return \"Hunter\";\r\n break;\r\n case 4:\r\n return \"Rogue\";\r\n break;\r\n case 5:\r\n return \"Priest\";\r\n break;\r\n case 6:\r\n return \"Death Knight\";\r\n break;\r\n case 7:\r\n return \"Shaman\";\r\n break;\r\n case 8:\r\n return \"Mage\";\r\n break;\r\n case 9:\r\n return \"Warlock\";\r\n break;\r\n case 10:\r\n return \"Monk\";\r\n break;\r\n case 11:\r\n return \"Druid\";\r\n break;\r\n case 12:\r\n return \"Demon Hunter\";\r\n break;\r\n default:\r\n return \"Uhhh wut\";\r\n }\r\n}", "title": "" }, { "docid": "7be7ae27b4163c27ddbe6bdd88bf9bc8", "score": "0.41974595", "text": "function findSpanValueForClass(i,dc){\n var ga=i.getElementsByTagName(_spanTag);\n if(ga){\n for(var f=0; f<ga.length; ++f){\n if(ga[f].className==dc){\n var value=ga[f].innerHTML;\n if(value==\"&nbsp;\") {\n return\"\";\n } else{\n var z=stripCRFromString(value);\n return z\n }\n }\n }\n }else{\n return\"\"\n }\n}", "title": "" }, { "docid": "4d8be4ffa204615a2c788834daddae67", "score": "0.41920745", "text": "function getClasses(id) {\r\n\t\t\tvar deferred = $q.defer();\r\n\t dbDataManager.findData(\"SELECT c.* FROM \" + subjectsTableName + \" s JOIN CLASSES c ON s.id=c.subject_id WHERE s.id=\" + id)\r\n\t .then(function(success) {\r\n\t deferred.resolve(success);\r\n\t })\r\n\t .catch(function(error) {\r\n\t deferred.reject(error);\r\n\t })\r\n\t\t\treturn deferred.promise;\r\n\t\t}", "title": "" }, { "docid": "4dba68c7c3d903ca12defa92bf719ff0", "score": "0.41907415", "text": "function getPseudoClass() {\n var info = getInfo();\n var ident = eat(TokenType.Colon) && getIdentifier(false);\n\n if (scanner.token !== null && scanner.token.type === TokenType.LeftParenthesis) {\n return getFunction(SCOPE_SELECTOR, ident);\n }\n\n return {\n type: 'PseudoClass',\n info: info,\n name: ident.name\n };\n}", "title": "" }, { "docid": "6c396e2c02b3a47f1df417fd8dcd96d7", "score": "0.41907158", "text": "function lookup(value) {\n const kind = kind_of_1.default(value);\n if (kind === 'function' && /^class\\s/.test(toString.call(value))) {\n return 'class';\n }\n return kind;\n}", "title": "" }, { "docid": "610a6b9113ccf803a35aa642ee686c4f", "score": "0.41767392", "text": "function getClassName(location) {\n var cellClass = 'cell-' + location.i + '-' + location.j;\n return cellClass;\n}", "title": "" }, { "docid": "b6251a13b1e648efd4b7223a6bc27f09", "score": "0.41755438", "text": "function fetchClass(char, affl, cName){\n\t\tvar c = findClass(cName);\n\n\t\tvar weaknesses = c[3].split(\",\");\n\t\tif(affl != undefined && char != undefined){\n\t\t\tif(affl.indexOf(\"Reaper\") != -1 || char == \"Fallacy\" || char == \"Dolour\" || char == \"Damian\" || char == \"Charry\" || char == \"Chitin\" || char == \"Chronology\")\n\t\t\t\tweaknesses.push(\"Reaper\");\n\t\t\tif(affl == \"Loveless\"|| char == \"The Gentleman\")\n\t\t\t\tweaknesses.push(\"Loveless\");\n\t\t\tif(affl == \"Lettie\")\n\t\t\t\tweaknesses.push(\"Cloud\");\n\t\t\tif(char == \"Ravager\")\n\t\t\t\tweaknesses.push(\"Beast\");\n\t\t\tif(char == \"Devastator\")\n\t\t\t\tweaknesses.push(\"Reptile\");\n\t\t\tif(char == \"Eviscerator\")\n\t\t\t\tweaknesses.push(\"Flying\");\n\t\t\tif(char == \"Deceiver\")\n\t\t\t\tweaknesses.push(\"Insect\");\n\t\t}\n\n\t\tvar weakObj = {};\n\t\tfor(var i = 0; i < 4; i++){\n\t\t\tif(weaknesses[i] == \"NPC-only\") weaknesses.splice(i,1);\n\t\t\tif(weaknesses.length > i) weakObj[\"weak_\"+i] = weaknesses[i].trim();\n\t\t\telse weakObj[\"weak_\"+i] = \"\";\n\t\t}\n\n\t\treturn {\n\t\t\t'name' : c[0],\n\t\t\t'desc' : c[1],\n\t\t\t'terrainType' : c[2],\n\t\t\t'weaknesses' : weakObj\n\t\t}\n\t}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.41714734", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.41714734", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.41714734", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.41714734", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.41714734", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "4983ee22758ad63bc76f350fb520cfef", "score": "0.41692743", "text": "function getCommentScoreClass(ctx, done) {\n let error, classes;\n\n try {\n // scores are currently rendered as two spans: '<span>X point[s]</span><span> · </span>'\n // points are somtimes replaced by 'score hidden'\n const scoreEx = new RegExp(/(\\d+.*\\spoint[s]?)|(score)/i);\n const dotEx = new RegExp(/\\s·\\s/);\n\n if (\n scoreEx.test(ctx.innerHTML) &&\n dotEx.test(ctx.nextSibling.innerHTML)\n ) {\n classes = ctx.className.split(' ').map(c => `.${c}`).join('');\n }\n } catch (e) {\n error = e || true;\n }\n\n return done(error, classes);\n}", "title": "" }, { "docid": "a4a59c08b3f356c3928f649a90b2f34b", "score": "0.41611353", "text": "function extractRow(square) {\n return Number((square.parent().attr('class')).substring(3));\n}", "title": "" }, { "docid": "b8e54ed7cdf23a765ca67e1f8fe5ab06", "score": "0.41577578", "text": "parseFactor() {\n if(this.lookahead.type === 'number') {\n const value = this.match(this.lookahead.value)\n return new Numeral(value)\n }\n else if(this.lookahead.type === 'id') {\n const value = this.match(this.lookahead.value)\n\n if(this.lookahead.value=== '(') {\n this.match('(')\n const args = this.parseArguments()\n this.match(')')\n return new FunctionCallExpr(new Id(value), args)\n }\n else if(this.lookahead.value === '=') {\n this.match('=')\n const expr = this.parseExpr()\n return new AssignExpr(new Id(value), expr)\n }\n \n return new Id(value)\n }else if (this.lookahead.type === 'string') {\n throw 'not impl.'\n }else{\n throw `syntax error, expect a factor but ${this.lookahead.value} found`\n }\n }", "title": "" }, { "docid": "61c26161fa34568c2179047dbe9a0926", "score": "0.4154006", "text": "function getClassName(id) {\n\tvar elem = document.getElementById(id);\n\tif (elem) {\n\t\treturn elem.className;\n\t}\n}", "title": "" }, { "docid": "02c71d7075fa4a1bb738f122e7dfa759", "score": "0.41395596", "text": "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "title": "" }, { "docid": "02c71d7075fa4a1bb738f122e7dfa759", "score": "0.41395596", "text": "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "title": "" }, { "docid": "bf77b8c01a1f0b4e9007994a04648fb9", "score": "0.4137631", "text": "function codeClass (status) {\n\t return Number(String(status).charAt(0) + '00')\n\t}", "title": "" }, { "docid": "bf77b8c01a1f0b4e9007994a04648fb9", "score": "0.4137631", "text": "function codeClass (status) {\n\t return Number(String(status).charAt(0) + '00')\n\t}", "title": "" } ]
9f4d36f5f186fafc1e2c2831d2335489
Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does. During a batch `onBecomeUnobserved` will be called at most once per observable. Avoids unnecessary recalculations.
[ { "docid": "141d05a7271077bc51b4ed658730f131", "score": "0.5388366", "text": "function startBatch() {\n globalState.inBatch++;\n}", "title": "" } ]
[ { "docid": "525115d100379485723088a6ef3e88bf", "score": "0.61157566", "text": "beginBatch() {\n this.transactionManager.beginBatch(null);\n this.batchActive = true;\n this.batchTransactions = [];\n }", "title": "" }, { "docid": "a19fd0e200578963adb1e1a0180168a5", "score": "0.593001", "text": "function sync_batch_txs() {}", "title": "" }, { "docid": "338aee85357a84d525b128e755a1646c", "score": "0.54926836", "text": "function startBatch() {\n globalState.inBatch++;\n}", "title": "" }, { "docid": "3a93957a12fd4a04c19c54b4d6da597a", "score": "0.54831326", "text": "updateBatch() {\n this.batchSize++;\n if (this.batchSize >= 495) {\n this.batchSize = 0;\n this.batchCount++;\n this.batches[this.batchCount] = firestore.batch();\n }\n }", "title": "" }, { "docid": "a33292ceaf7571323cb46bca8b4cd986", "score": "0.5481813", "text": "function startBatch() {\n\t globalState.inBatch++;\n\t}", "title": "" }, { "docid": "bbb825609e1c27c9aab68afcc5966c50", "score": "0.5446663", "text": "function startBatch() {\n\t globalState.inBatch++;\n\t}", "title": "" }, { "docid": "bbb825609e1c27c9aab68afcc5966c50", "score": "0.5446663", "text": "function startBatch() {\n\t globalState.inBatch++;\n\t}", "title": "" }, { "docid": "f91729c85f76d637a24ac41e7553e494", "score": "0.52641004", "text": "_batch (batch, callback) {\n this._isBatch = true\n this._query(batch, callback)\n }", "title": "" }, { "docid": "7e53200d88b30cd8573b86692eb4c756", "score": "0.52390444", "text": "function batch() {\n init();\n for (var i = 0; i < vendors.length; i++) {\n inventory = prepData(vendors[i]);\n syncInventory(vendors[i], inventory);\n }\n}", "title": "" }, { "docid": "c8f85445c00a4dc5b42e9d7f3ec42ac8", "score": "0.51707107", "text": "sendBatch(batch) {\n const success = this.rateLimiter.tryMakeRequest(batch.opCount);\n assert(success, 'Batch should be under rate limit to be sent.');\n batch\n .bulkCommit()\n .then(results => {\n batch.processResults(results);\n })\n .catch((error) => {\n batch.processResults([], error);\n })\n .then(() => {\n // Remove the batch from the BatchQueue after it has been processed.\n const batchIndex = this.batchQueue.indexOf(batch);\n assert(batchIndex !== -1, 'The batch should be in the BatchQueue');\n this.batchQueue.splice(batchIndex, 1);\n this.sendReadyBatches();\n });\n }", "title": "" }, { "docid": "a1f063e8157e1287db158f1e64769aa4", "score": "0.5145542", "text": "function startBatch$$1() {\n globalState$$1.inBatch++;\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "bf802c23e6be0a70fd8ef3aa422379f2", "score": "0.51420236", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "5af662f09b3fbe88fb9308400a8e1309", "score": "0.5138912", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "b801e857a3b2a0f6265e5e0762aa8949", "score": "0.5103726", "text": "function transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}", "title": "" }, { "docid": "9eeb142e0fc839a86becc46c8bca6d12", "score": "0.5048762", "text": "function useBatchAsync(ms = 0) {\n const [value, setValue] = useState(0);\n const mounted = useRef(true);\n\n useEffect(() => {\n const run = async () => {\n for (let i = 0; i < 3; i++) {\n await wait(ms);\n if (!mounted.current) return;\n setValue((v) => v + 1);\n }\n };\n\n run();\n return () => {\n mounted.current = false;\n };\n }, [ms]);\n\n return value;\n}", "title": "" }, { "docid": "8a642287b2392437df8029f0af310fa4", "score": "0.50024384", "text": "function transaction(action, thisArg) {\n\t if (thisArg === void 0) {\n\t thisArg = undefined;\n\t }\n\n\t startBatch();\n\n\t try {\n\t return action.apply(thisArg);\n\t } finally {\n\t endBatch();\n\t }\n\t}", "title": "" }, { "docid": "f472b09ef2690605adb312cb9fe7d596", "score": "0.49927422", "text": "processTransactions() {\n return __awaiter(this, void 0, void 0, function* () {\n const processedTxs = [];\n let messages = [];\n let nonce = yield this.wallet.getNonce(this.nonce);\n const batchNonce = nonce;\n for (const tx of this.txs) {\n tx.tx.nonce = nonce++;\n switch (tx.type) {\n case 'Withdraw':\n messages.push(this.wallet.getWithdrawEthMessagePart(tx.tx));\n const withdraw = { tx: yield this.wallet.getWithdrawFromSyncToEthereum(tx.tx) };\n processedTxs.push(withdraw);\n break;\n case 'Transfer':\n messages.push(this.wallet.getTransferEthMessagePart(tx.tx));\n const transfer = { tx: yield this.wallet.getTransfer(tx.tx) };\n processedTxs.push(transfer);\n break;\n case 'ChangePubKey':\n // ChangePubKey requires its own Ethereum signature, we either expect\n // it to be signed already or do it here.\n const changePubKey = tx.alreadySigned\n ? tx.tx\n : (yield this.wallet.signSetSigningKey(tx.tx)).tx;\n const currentPubKeyHash = yield this.wallet.getCurrentPubKeyHash();\n if (currentPubKeyHash === changePubKey.newPkHash) {\n throw new Error('Current signing key is already set');\n }\n messages.push(this.wallet.getChangePubKeyEthMessagePart({\n pubKeyHash: changePubKey.newPkHash,\n feeToken: tx.token,\n fee: changePubKey.fee\n }));\n processedTxs.push({ tx: changePubKey });\n break;\n case 'ForcedExit':\n messages.push(this.wallet.getForcedExitEthMessagePart(tx.tx));\n const forcedExit = { tx: yield this.wallet.getForcedExit(tx.tx) };\n processedTxs.push(forcedExit);\n break;\n }\n }\n messages.push(`Nonce: ${batchNonce}`);\n return {\n txs: processedTxs,\n message: messages.filter((part) => part.length != 0).join('\\n')\n };\n });\n }", "title": "" }, { "docid": "da9495dceb3efd21156f07132241eee0", "score": "0.49843678", "text": "batch(fn) {\n if (!this.initialized) {\n throw new Error(\"Could not call Database.batch as the database isn't initialized yet.\");\n }\n const rootDb = __classPrivateFieldGet(this, _rootStore).db;\n const batch = this.db.batch();\n const originalPut = rootDb.put;\n const originalDel = rootDb.del;\n rootDb.put = batch.put.bind(batch);\n rootDb.del = batch.del.bind(batch);\n let prom;\n try {\n const ret = fn();\n // PSA: don't let vscode (or yourself) rewrite this to `await` the\n // `batch.write` call. The `finally` block needs to run _before_ the\n // write promise has resolved.\n prom = batch.write().then(() => ret);\n }\n finally {\n rootDb.put = originalPut;\n rootDb.del = originalDel;\n }\n return prom;\n }", "title": "" }, { "docid": "4153a256a169163b09ba286bbe5a78f2", "score": "0.49820513", "text": "function useBatchFrameState() {\n var _useState = useState({}),\n _useState2 = _slicedToArray(_useState, 2),\n forceUpdate = _useState2[1];\n\n var statesRef = useRef([]);\n var destroyRef = useRef(false);\n var walkingIndex = 0;\n var beforeFrameId = 0;\n useEffect(function () {\n return function () {\n destroyRef.current = true;\n };\n }, []);\n\n function createState(defaultValue) {\n var myIndex = walkingIndex;\n walkingIndex += 1; // Fill value if not exist yet\n\n if (statesRef.current.length < myIndex + 1) {\n statesRef.current[myIndex] = defaultValue;\n } // Return filled as `setState`\n\n\n var value = statesRef.current[myIndex];\n\n function setValue(val) {\n statesRef.current[myIndex] = typeof val === 'function' ? val(statesRef.current[myIndex]) : val;\n wrapperRaf.cancel(beforeFrameId); // Flush with batch\n\n beforeFrameId = wrapperRaf(function () {\n if (!destroyRef.current) {\n forceUpdate({});\n }\n });\n }\n\n return [value, setValue];\n }\n\n return createState;\n}", "title": "" }, { "docid": "42f0f8faa449ea34844101d4b8a3a666", "score": "0.49659154", "text": "function TableBatch() {\n this.operations = [];\n this.pk = null;\n this.retrieve = false;\n}", "title": "" }, { "docid": "42f0f8faa449ea34844101d4b8a3a666", "score": "0.49659154", "text": "function TableBatch() {\n this.operations = [];\n this.pk = null;\n this.retrieve = false;\n}", "title": "" }, { "docid": "42f0f8faa449ea34844101d4b8a3a666", "score": "0.49659154", "text": "function TableBatch() {\n this.operations = [];\n this.pk = null;\n this.retrieve = false;\n}", "title": "" }, { "docid": "e98a7205fe56e3f432c2fa9b3e0ec325", "score": "0.49646643", "text": "function transaction(action, thisArg) {\n\t if (thisArg === void 0) { thisArg = undefined; }\n\t startBatch();\n\t try {\n\t return action.apply(thisArg);\n\t }\n\t finally {\n\t endBatch();\n\t }\n\t}", "title": "" }, { "docid": "e98a7205fe56e3f432c2fa9b3e0ec325", "score": "0.49646643", "text": "function transaction(action, thisArg) {\n\t if (thisArg === void 0) { thisArg = undefined; }\n\t startBatch();\n\t try {\n\t return action.apply(thisArg);\n\t }\n\t finally {\n\t endBatch();\n\t }\n\t}", "title": "" }, { "docid": "6200a8b5038a2babb4eb03d440ced189", "score": "0.49383798", "text": "function bo(t, e) {\n var n = m(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", function (t) {\n return void 0 === e && (e = -1), n.vr.Lo(t, e);\n });\n}", "title": "" }, { "docid": "759ae356cdcf8b60a6226c475b77246f", "score": "0.49353012", "text": "inBatch(batch) {\r\n if (this.batch !== null) {\r\n throw Error(\"This query is already part of a batch.\");\r\n }\r\n if (objectDefinedNotNull(batch)) {\r\n this._batch = batch;\r\n this._batchDependency = batch.addDependency();\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "10a1876e8a4dde093a3db5292c739bbd", "score": "0.49094787", "text": "createNewBatch() {\n const newBatch = new BulkCommitBatch(this.firestore.batch(), this.maxBatchSize);\n if (this.batchQueue.length > 0) {\n this.batchQueue[this.batchQueue.length - 1].markReadyToSend();\n this.sendReadyBatches();\n }\n this.batchQueue.push(newBatch);\n return newBatch;\n }", "title": "" }, { "docid": "a7d0a9b744cbf92d2ab176afff68026f", "score": "0.48311532", "text": "beginBatchUpdate() {\n this.batchMode_ = true;\n }", "title": "" }, { "docid": "49b175ed5283a7e79c54b87f10d28b36", "score": "0.48267648", "text": "function worker_insertTransactions(state) {\n waitState(state);\n while (getState(dbName) == state) {\n for (var i=0; i < opBatch; i++) {\n insertTransaction(dbName,maxCollections,maxAccounts,maxAmount,writeConcern);\n pausecomp(opPause);\n }\n }\n}", "title": "" }, { "docid": "af904ccb0f244ce3d952c8208e937675", "score": "0.48262593", "text": "function dr(t, e) {\n var n = B(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", function (t) {\n return void 0 === e && (e = -1), n.In.getNextMutationBatchAfterBatchId(t, e);\n });\n}", "title": "" }, { "docid": "3cc0a44575e1a73076706dbeeaeac9f8", "score": "0.48187205", "text": "function Ti(t, e) {\n var n = v(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", function (t) {\n return void 0 === e && (e = -1), n.Gn.gr(t, e);\n });\n}", "title": "" }, { "docid": "39912b910bceb2f21acd601eedd995c7", "score": "0.4817998", "text": "function loadTransactions() {\n transactions.forEach(createTransaction);\n updateValues();\n }", "title": "" }, { "docid": "ebe9f3982399cfb91f057844998abed7", "score": "0.47983295", "text": "bulkCommit() {\n assert(this.state === BatchState.READY_TO_SEND, 'The batch should be marked as READY_TO_SEND before committing');\n this.state = BatchState.SENT;\n // Capture the error stack to preserve stack tracing across async calls.\n const stack = Error().stack;\n return this.writeBatch.bulkCommit().catch(err => {\n throw util_1.wrapError(err, stack);\n });\n }", "title": "" }, { "docid": "78ab7416eb28aecd37966f5323d53888", "score": "0.47929484", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n onChangesQueue[i]();\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "78ab7416eb28aecd37966f5323d53888", "score": "0.47929484", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n onChangesQueue[i]();\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "78ab7416eb28aecd37966f5323d53888", "score": "0.47929484", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n onChangesQueue[i]();\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "306fa5fe29837748e9372d3980b6191e", "score": "0.47520843", "text": "function flushOnChangesQueue() {\r\n try {\r\n if (!(--onChangesTtl)) {\r\n // We have hit the TTL limit so reset everything\r\n onChangesQueue = undefined;\r\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\r\n }\r\n // We must run this hook in an apply since the $$postDigest runs outside apply\r\n $rootScope.$apply(function() {\r\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\r\n onChangesQueue[i]();\r\n }\r\n // Reset the queue to trigger a new schedule next time there is a change\r\n onChangesQueue = undefined;\r\n });\r\n } finally {\r\n onChangesTtl++;\r\n }\r\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "bffbefa027852ab67a26981c3097bca7", "score": "0.47420698", "text": "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "title": "" }, { "docid": "5e97e9c68e0b097ef6ba2117e82552b0", "score": "0.4733981", "text": "function useBatchFrameState() {\n\t var _useState = (0, _react.useState)({}),\n\t _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n\t forceUpdate = _useState2[1];\n\t\n\t var statesRef = (0, _react.useRef)([]);\n\t var destroyRef = (0, _react.useRef)(false);\n\t var walkingIndex = 0;\n\t var beforeFrameId = 0;\n\t (0, _react.useEffect)(function () {\n\t return function () {\n\t destroyRef.current = true;\n\t };\n\t }, []);\n\t\n\t function createState(defaultValue) {\n\t var myIndex = walkingIndex;\n\t walkingIndex += 1; // Fill value if not exist yet\n\t\n\t if (statesRef.current.length < myIndex + 1) {\n\t statesRef.current[myIndex] = defaultValue;\n\t } // Return filled as `setState`\n\t\n\t\n\t var value = statesRef.current[myIndex];\n\t\n\t function setValue(val) {\n\t statesRef.current[myIndex] = typeof val === 'function' ? val(statesRef.current[myIndex]) : val;\n\t\n\t _raf.default.cancel(beforeFrameId); // Flush with batch\n\t\n\t\n\t beforeFrameId = (0, _raf.default)(function () {\n\t if (!destroyRef.current) {\n\t forceUpdate({});\n\t }\n\t });\n\t }\n\t\n\t return [value, setValue];\n\t }\n\t\n\t return createState;\n\t}", "title": "" }, { "docid": "6a54aa2a661e4524bd63ce4f2b1dc963", "score": "0.47318268", "text": "function transaction$$1(action$$1, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch$$1();\n try {\n return action$$1.apply(thisArg);\n }\n finally {\n endBatch$$1();\n }\n}", "title": "" }, { "docid": "3817df3f28bc15beb8acd57a9e6a5033", "score": "0.4726263", "text": "function Bi(t, e) {\n var n = P(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", function (t) {\n var r = e.batch.keys(), i = n.On.newChangeBuffer({\n trackRemovals: !0\n });\n return (function (t, e, n, r) {\n var i = n.batch, o = i.keys(), s = br.resolve();\n return (o.forEach(function (t) {\n s = s.next(function () {\n return r.getEntry(e, t);\n }).next(function (e) {\n var o = n.docVersions.get(t);\n (O(null !== o), e.version.compareTo(o) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.addEntry(e, n.commitVersion)));\n });\n }), s.next(function () {\n return t._n.removeMutationBatch(e, i);\n }));\n })(n, t, e, i).next(function () {\n return i.apply(t);\n }).next(function () {\n return n._n.performConsistencyCheck(t);\n }).next(function () {\n return n.Mn.pn(t, r);\n });\n });\n}", "title": "" }, { "docid": "abec206ac613521d87bc91fc6807fa7d", "score": "0.4709089", "text": "function batchNotify() {\n var notifying = false;\n var requestNotify = false;\n\n function notify() {\n if (notifying) {\n requestNotify = true;\n } else {\n notifying = true;\n requestNotify = false;\n\n raf.call(rafContext, function () {\n // Actual notify code\n try {\n var evs = events.splice(0, events.length);\n listeners.slice().forEach(function (listener) {\n return listener(evs, requestNotify);\n });\n } catch (e) {\n error(e);\n }\n\n notifying = false;\n if (requestNotify) {\n notify();\n }\n });\n }\n }\n\n return notify;\n }", "title": "" }, { "docid": "a6e5662724f6fe8042dec1e951a5c827", "score": "0.4707096", "text": "update() {\n for (const batch of this.batches) {\n batch.update();\n }\n }", "title": "" }, { "docid": "17657bd9c1a7b878aefc19a90ff91f91", "score": "0.47004172", "text": "function mo(t, e) {\n var n = m(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", function (t) {\n var r = e.batch.keys(),\n i = n.Sc.ia({\n ra: !0\n });\n return function (t, e, n, r) {\n var i = n.batch,\n o = i.keys(),\n s = yr.resolve();\n return o.forEach(function (t) {\n s = s.next(function () {\n return r.Ar(e, t);\n }).next(function (e) {\n var o = e,\n s = n._r.get(t);\n\n g(null !== s), (!o || o.version.L(s) < 0) && (o = i.ar(t, o, n)) && // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.Tr(o, n.lr);\n });\n }), s.next(function () {\n return t.vr.Qo(e, i);\n });\n }(n, t, e, i).next(function () {\n return i.apply(t);\n }).next(function () {\n return n.vr.Go(t);\n }).next(function () {\n return n.Dc.$r(t, r);\n });\n });\n}", "title": "" }, { "docid": "84c0eeafdc2c3bd8b6b9548449534a09", "score": "0.46964476", "text": "function createMessageBatch(bufferState) {\n let addSingleMessage = (newMessage) => {\n if (bufferState.messagesObj.messageIds[newMessage.id]) {\n return;\n }\n bufferState.updateLatestMessages(newMessage);\n bufferState.messagesObj.messages.push(newMessage);\n bufferState.messagesObj.messageIds[newMessage.id] = newMessage;\n if (bufferState.isMessageTrimming) {\n trimMessages();\n }\n bufferTools.orderedMessages(bufferState, { inPlace: true, noFilter: true });\n bufferState.message_count++;\n };\n let addMultipleMessages = (newMessages) => {\n let toAdd = newMessages.filter((msg) => !bufferState.messagesObj.messageIds[msg.id]);\n if (toAdd.length > 0) {\n bufferState.messagesObj.messages = bufferState.messagesObj.messages.concat(toAdd);\n toAdd.forEach((msg) => {\n bufferState.updateLatestMessages(msg);\n bufferState.messagesObj.messageIds[msg.id] = msg;\n });\n if (bufferState.isMessageTrimming) {\n trimMessages();\n }\n bufferTools.orderedMessages(bufferState, { inPlace: true, noFilter: true });\n }\n // Trigger Vue's reactivity on the buffer whether messages were added or not, just in case\n // anything was depending on the batch queue which has now been emptied.\n bufferState.message_count++;\n };\n let trimMessages = () => {\n let scrollbackSize = bufferState.setting('scrollback_size');\n let length = bufferState.messagesObj.messages.length;\n if (bufferState.messagesObj.messages.length > scrollbackSize) {\n let removed = bufferState.messagesObj.messages.splice(0, length - scrollbackSize);\n removed.forEach((msg) => delete bufferState.messagesObj.messageIds[msg.id]);\n }\n };\n\n return batchedAdd(addSingleMessage, addMultipleMessages, 4);\n}", "title": "" }, { "docid": "44bf4c0fe42f5aa682e6c39f0e56268f", "score": "0.46904507", "text": "function _i(t, e) {\n var n = v(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", function (t) {\n var r = e.batch.keys(),\n i = n.Ah.jr({\n Gr: !0\n });\n return function (t, e, n, r) {\n var i = n.batch,\n o = i.keys(),\n s = Fn.resolve();\n return o.forEach(function (t) {\n s = s.next(function () {\n return r.Ln(e, t);\n }).next(function (e) {\n var o = e,\n s = n.Pn.get(t);\n y(null !== s), (!o || o.version.o(s) < 0) && (o = i.En(t, o, n)) && // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.xn(o, n.Rn);\n });\n }), s.next(function () {\n return t.Gn.br(e, i);\n });\n }(n, t, e, i).next(function () {\n return i.apply(t);\n }).next(function () {\n return n.Gn.Cr(t);\n }).next(function () {\n return n.Rh.Zn(t, r);\n });\n });\n}", "title": "" }, { "docid": "29327ac9275044089aad92973451a51e", "score": "0.46723568", "text": "function _batch()\n{\n\targs = arrayfromargs(arguments);\n\tswitch(args[0])\n\t{\n\t\tcase 'grid':\n\t\t\tsurface.call('receive_grid_all', args[1]);\n\t\t\tvar i=3;do{\n\t\t\t\tstored_grid[i]=[];\n\t\t\t\tvar j=3;do{\n\t\t\t\t\tstored_grid[i][j] = args[1];\n\t\t\t\t}while(j--)\n\t\t\t}while(i--)\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "38b5455247675357190a42debcf9cfb7", "score": "0.46666783", "text": "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "title": "" }, { "docid": "d0caae56d5a6e378646ef3be53a5bf9f", "score": "0.46666345", "text": "batchUpdate(flag = true) {\n this.engine.batchUpdate(flag);\n if (!flag) {\n this._triggerRemoveEvent();\n this._triggerAddEvent();\n this._triggerChangeEvent();\n }\n return this;\n }", "title": "" }, { "docid": "4ff8f5652396c3d3b019ad264ef62c6e", "score": "0.4666266", "text": "function so(t, e) {\n var n = R(t);\n return n.persistence.runTransaction(\"Get next mutation batch\", \"readonly\", function (t) {\n return void 0 === e && (e = -1), n.rs.Fr(t, e);\n });\n}", "title": "" }, { "docid": "aca1049ebfb80b584b3a0023cfaf4b4e", "score": "0.46585912", "text": "function useBatchFrameState() {\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useState\"])({}),\n _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n forceUpdate = _useState2[1];\n\n var statesRef = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useRef\"])([]);\n var destroyRef = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useRef\"])(false);\n var walkingIndex = 0;\n var beforeFrameId = 0;\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () {\n return function () {\n destroyRef.current = true;\n };\n }, []);\n\n function createState(defaultValue) {\n var myIndex = walkingIndex;\n walkingIndex += 1; // Fill value if not exist yet\n\n if (statesRef.current.length < myIndex + 1) {\n statesRef.current[myIndex] = defaultValue;\n } // Return filled as `setState`\n\n\n var value = statesRef.current[myIndex];\n\n function setValue(val) {\n statesRef.current[myIndex] = typeof val === 'function' ? val(statesRef.current[myIndex]) : val;\n rc_util_es_raf__WEBPACK_IMPORTED_MODULE_2__[\"default\"].cancel(beforeFrameId); // Flush with batch\n\n beforeFrameId = Object(rc_util_es_raf__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function () {\n if (!destroyRef.current) {\n forceUpdate({});\n }\n });\n }\n\n return [value, setValue];\n }\n\n return createState;\n}", "title": "" }, { "docid": "7482421943b33e53d42c1ab30c66bc78", "score": "0.4657227", "text": "function useBatchFrameState() {\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}),\n _useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__.default)(_useState, 2),\n forceUpdate = _useState2[1];\n\n var statesRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]);\n var destroyRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);\n var walkingIndex = 0;\n var beforeFrameId = 0;\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n return function () {\n destroyRef.current = true;\n };\n }, []);\n\n function createState(defaultValue) {\n var myIndex = walkingIndex;\n walkingIndex += 1; // Fill value if not exist yet\n\n if (statesRef.current.length < myIndex + 1) {\n statesRef.current[myIndex] = defaultValue;\n } // Return filled as `setState`\n\n\n var value = statesRef.current[myIndex];\n\n function setValue(val) {\n statesRef.current[myIndex] = typeof val === 'function' ? val(statesRef.current[myIndex]) : val;\n rc_util_es_raf__WEBPACK_IMPORTED_MODULE_2__.default.cancel(beforeFrameId); // Flush with batch\n\n beforeFrameId = (0,rc_util_es_raf__WEBPACK_IMPORTED_MODULE_2__.default)(function () {\n if (!destroyRef.current) {\n forceUpdate({});\n }\n });\n }\n\n return [value, setValue];\n }\n\n return createState;\n}", "title": "" }, { "docid": "dc275dc728c24b65a992465a2940f838", "score": "0.4654715", "text": "function flushOnChangesQueue() {\n\t try {\n\t if (!(--onChangesTtl)) {\n\t // We have hit the TTL limit so reset everything\n\t onChangesQueue = undefined;\n\t throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n\t }\n\t // We must run this hook in an apply since the $$postDigest runs outside apply\n\t $rootScope.$apply(function() {\n\t var errors = [];\n\t for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n\t try {\n\t onChangesQueue[i]();\n\t } catch (e) {\n\t errors.push(e);\n\t }\n\t }\n\t // Reset the queue to trigger a new schedule next time there is a change\n\t onChangesQueue = undefined;\n\t if (errors.length) {\n\t throw errors;\n\t }\n\t });\n\t } finally {\n\t onChangesTtl++;\n\t }\n\t }", "title": "" }, { "docid": "dc275dc728c24b65a992465a2940f838", "score": "0.4654715", "text": "function flushOnChangesQueue() {\n\t try {\n\t if (!(--onChangesTtl)) {\n\t // We have hit the TTL limit so reset everything\n\t onChangesQueue = undefined;\n\t throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n\t }\n\t // We must run this hook in an apply since the $$postDigest runs outside apply\n\t $rootScope.$apply(function() {\n\t var errors = [];\n\t for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n\t try {\n\t onChangesQueue[i]();\n\t } catch (e) {\n\t errors.push(e);\n\t }\n\t }\n\t // Reset the queue to trigger a new schedule next time there is a change\n\t onChangesQueue = undefined;\n\t if (errors.length) {\n\t throw errors;\n\t }\n\t });\n\t } finally {\n\t onChangesTtl++;\n\t }\n\t }", "title": "" }, { "docid": "7b9a98a2040571e5d7dace392ffcf6fd", "score": "0.46415666", "text": "constructor() {\n this.TIMEOUT = 1050;\n this.BATCHMAX = 495;\n this.batchSize = 0;\n this.batchCount = 0;\n this.batches = [];\n this.batches[this.batchCount] = firestore.batch();\n }", "title": "" }, { "docid": "e302f571e29fcf6e0a3f79df5481aecd", "score": "0.46390027", "text": "function Batch(concurrency) {\n if (concurrency === void 0) { concurrency = 5; }\n /**\n * Number of active operations under execution.\n */\n this.actives = 0;\n /**\n * Number of completed operations under execution.\n */\n this.completed = 0;\n /**\n * Offset of next operation to be executed.\n */\n this.offset = 0;\n /**\n * Operation array to be executed.\n */\n this.operations = [];\n /**\n * States of Batch. When an error happens, state will turn into error.\n * Batch will stop execute left operations.\n */\n this.state = BatchStates.Good;\n if (concurrency < 1) {\n throw new RangeError(\"concurrency must be larger than 0\");\n }\n this.concurrency = concurrency;\n this.emitter = new events.EventEmitter();\n }", "title": "" }, { "docid": "e302f571e29fcf6e0a3f79df5481aecd", "score": "0.46390027", "text": "function Batch(concurrency) {\n if (concurrency === void 0) { concurrency = 5; }\n /**\n * Number of active operations under execution.\n */\n this.actives = 0;\n /**\n * Number of completed operations under execution.\n */\n this.completed = 0;\n /**\n * Offset of next operation to be executed.\n */\n this.offset = 0;\n /**\n * Operation array to be executed.\n */\n this.operations = [];\n /**\n * States of Batch. When an error happens, state will turn into error.\n * Batch will stop execute left operations.\n */\n this.state = BatchStates.Good;\n if (concurrency < 1) {\n throw new RangeError(\"concurrency must be larger than 0\");\n }\n this.concurrency = concurrency;\n this.emitter = new events.EventEmitter();\n }", "title": "" }, { "docid": "cc078a8e6fed734dab1c84fb44cbed81", "score": "0.4636299", "text": "function batch(effects) {\n\t return _defineProperty({\n\t effects: effects,\n\t type: effectTypes.BATCH\n\t }, isEffectSymbol, true);\n\t}", "title": "" }, { "docid": "4e296e6058dddc0f0dab7c5495f823df", "score": "0.46091586", "text": "endBatch() {\n this.transactionManager.endBatch(false);\n this.batchActive = false;\n }", "title": "" }, { "docid": "32d067164680f7055afdf7bf950f5b45", "score": "0.45985487", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "85b0a148b11f53390885af30275aad3c", "score": "0.45879593", "text": "function AbstractChainedBatch(db) {\n this._db = db;\n this._operations = [];\n this._written = false;\n}", "title": "" }, { "docid": "fac0e00b3e0ea1a2dee26e5d47984201", "score": "0.4584461", "text": "endBatchUpdate() {\n this.batchMode_ = false;\n this.notifyObservers_(this.data);\n }", "title": "" }, { "docid": "163ed2efc0f6e8f3b26b43b1964c1f69", "score": "0.4580227", "text": "function qi(t, e) {\n var n = L(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", (function(t) {\n var r = e.batch.keys(), i = n.$n.newChangeBuffer({\n trackRemovals: !0\n });\n return function(t, e, n, r) {\n var i = n.batch, o = i.keys(), s = gr.resolve();\n return o.forEach((function(t) {\n s = s.next((function() {\n return r.getEntry(e, t);\n })).next((function(e) {\n var o = n.docVersions.get(t);\n O(null !== o), e.version.compareTo(o) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && \n // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.addEntry(e, n.commitVersion));\n }));\n })), s.next((function() {\n return t._n.removeMutationBatch(e, i);\n }));\n }(n, t, e, i).next((function() {\n return i.apply(t);\n })).next((function() {\n return n._n.performConsistencyCheck(t);\n })).next((function() {\n return n.Mn.pn(t, r);\n }));\n }));\n}", "title": "" }, { "docid": "4a7f26efe0f0473351a7ccc056ed00a4", "score": "0.45777857", "text": "function Bu(t, e, n) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var r, i, o, u;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(s) {\n switch (s.label) {\n case 0:\n r = ms(t), s.label = 1;\n\n case 1:\n return s.trys.push([ 1, 5, , 6 ]), [ 4 /*yield*/ , function(t, e) {\n var n, r = O(t), i = K.now(), o = e.reduce((function(t, e) {\n return t.add(e.key);\n }), mn());\n return r.persistence.runTransaction(\"Locally write mutations\", \"readwrite\", (function(t) {\n return r.Tc.Xo(t, o).next((function(o) {\n n = o;\n for (\n // For non-idempotent mutations (such as `FieldValue.increment()`),\n // we record the base state in a separate patch mutation. This is\n // later used to guarantee consistent values and prevents flicker\n // even if the backend sends us an update that already includes our\n // transform.\n var u = [], s = 0, a = e; s < a.length; s++) {\n var c = a[s], h = je(c, n.get(c.key));\n null != h && \n // NOTE: The base state should only be applied if there's some\n // existing document to override, so use a Precondition of\n // exists=true\n u.push(new Qe(c.key, h, kt(h.proto.mapValue), Re.exists(!0)));\n }\n return r.zo.Ri(t, i, u, e);\n }));\n })).then((function(t) {\n var e = t.xs(n);\n return {\n batchId: t.batchId,\n ri: e\n };\n }));\n }(r.bh, e) ];\n\n case 2:\n return i = s.sent(), r.Vl.Ca(i.batchId), function(t, e, n) {\n var r = t.$l[t.currentUser.A()];\n r || (r = new rn(C)), r = r.zt(e, n), t.$l[t.currentUser.A()] = r;\n }(r, i.batchId, n), [ 4 /*yield*/ , is(r, i.ri) ];\n\n case 3:\n return s.sent(), [ 4 /*yield*/ , pu(r.yl) ];\n\n case 4:\n return s.sent(), [ 3 /*break*/ , 6 ];\n\n case 5:\n return o = s.sent(), u = Er(o, \"Failed to persist write\"), n.reject(u), [ 3 /*break*/ , 6 ];\n\n case 6:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.45753744", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.45753744", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.45753744", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.45753744", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.45753744", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" } ]
96285d6236146d538e097a540330485b
Now write the function that the event listener will run. It will take what's in the user input and remove it from the todo list array.
[ { "docid": "66c3dcc8334c0066438780869348b2a0", "score": "0.6470433", "text": "function removeItemOnDom() {\n const addIndexInputBox = document.querySelector(\".index-input\");\n let inputedText = addIndexInputBox.value;\n let index = Number(inputedText);\n todos.splice(index, 1);\n clearDom();\n printList();\n addIndexInputBox.value = \"\";\n}", "title": "" } ]
[ { "docid": "776f355446aee713542c22eb2138afd6", "score": "0.75740993", "text": "function delToDo()\n {\n var index = prompt(\"Enter item no. to delete an item\");\n todo.splice(index-1,1);\n console.log(\"To-Do item deleted from the list\");\n }", "title": "" }, { "docid": "92e2aece6cf4fa66aebd56e5077d3a09", "score": "0.73485255", "text": "function deleteToDo(event) {\n const btn = event.target; //target the btn\n const li = btn.parentNode; //target the parent of btn which is li\n toDoList.removeChild(li); //from ul remove the targetted li\n let cleanToDos = toDosArray.filter(function(something) {\n return something.id !== parseInt(li.id); //eliminate function something and return only those with id that is not clicked\n }); //parsed is to make the li.id into integer\n toDosArray = cleanToDos; //now original toDosArray is the new cleanToDos\n saveToDos(); //saves the fact that an object was deleted from the array\n}", "title": "" }, { "docid": "7dc32d89829eb9c6d27896062d52909b", "score": "0.7282039", "text": "function deleteToDo(event) {\n const btn = event.target; // button to remove. to find, already do console.log(event), and console.dir(event.target);and .parentNode\n const li = btn.parentNode; // make li to delete\n toDoList.removeChild(li); //remove child li\n const cleanToDos = toDos.filter(function(toDo) {\n // filter execute for every item on the list\n return toDo.id !== parseInt(li.id); //console.log(toDo.id, li.id); and checked li.id is string. parseInt(); makes string to number\n }); //filter runs some function and it runs with each of items\n toDos = cleanToDos; //console.log(cleanToDos); and checked\n saveToDos(); // it saves toDos\n}", "title": "" }, { "docid": "486087dd7b0685a240f622d787ec0e49", "score": "0.72780675", "text": "function eventFunction() {\r\n\r\n const toDo = input.value;\r\n if (toDo) {\r\n addTodo(toDo, id, false, false);\r\n\r\n listArray.push({\r\n name: toDo,\r\n id: id,\r\n done: false,\r\n trash: false\r\n });\r\n id++;\r\n } else // input is empty\r\n {\r\n if (toDo == \"\") {\r\n alert(\"you must write something\");\r\n }\r\n }\r\n input.value = \"\";\r\n}", "title": "" }, { "docid": "e9e5b59da0bed46437c132272f234d4f", "score": "0.71063036", "text": "function removeFromList(event) {\n // Make sure page doesn't reload on button press.\n event.preventDefault();\n\n // Get the index we'll remove from the input field.\n let index = document.querySelector('').value;\n\n // Remove the number at that index from the list.\n\n /*\n ### Hints:\n\n * You can either loop through... or use array methods. Check out concat!\n\n * Either way, though, we've declared out array using `let` this time,\n and reassigning the array is probably the best approach with our current\n tools.\n */\n\n // Update our html.\n\n\n}", "title": "" }, { "docid": "d79c4b58dde075bd11ee6c3167efc220", "score": "0.7102103", "text": "function deleteToDo(event){\n const btn = event.target;\n const li = btn.parentNode; \n toDoList.removeChild(li);\n\n const cleanToDos = toDos.filter( function(toDo){\n return toDo.id !== parseInt(li.id);\n });\n\n toDos = cleanToDos;\n saveToDos();\n}", "title": "" }, { "docid": "921fe957f04d8d3a5ce4da7600a63939", "score": "0.7022404", "text": "function deleteItem() {\n\n var item = prompt(\"What have you completed?\");\n\n if (typeof(checkList(item)) !== \"string\") {\n\n toDo.splice(checkList(item), 1);\n\n // //EASILY COULD BE MORE MODULAR HERE: SAME LOGIC AS IN BOTH ADD FUNCTIONS, too lazy to abstract right now\n\n for (var i = 0; i < toDo.length; i ++) {\n\n toDo[i] = toDo[i] = (toDo[i].slice(3, toDo[i].length));\n\n toDo[i] = (i + 1) + \") \" + toDo[i];\n }\n\n return toDo;\n }\n\n return \"That's not on your to-do list!\"\n }", "title": "" }, { "docid": "62476fd216cd1015bbeab557172b0556", "score": "0.6953782", "text": "function remove() {\n let updated = document.getElementById(\"todo-list\");\n updated.onclick = function(event) {\n var target = getEventTarget(event);\n listEle.removeTodo(target.innerText);\n console.log(\"current ...........\", listEle.getList); // obteniendo método\n };\n }", "title": "" }, { "docid": "138d277b602d2d3878f9993fec9bbc00", "score": "0.6860895", "text": "function removeSpecific() {\n if (bufferStack.isEmpty()) {\n alert(\"Your to-do list is already empty - nothing to do except put your feet up!\")\n } else {\n var toRemove = document.getElementById(\"remove-from-todo\").value;\n console.log(toRemove);\n console.log(typeof (toRemove));\n\n for (let i = 0; i < bufferArray.length; i++) {\n if (bufferArray[i].toUpperCase() == toRemove.toUpperCase()) {\n bufferStack.splice(i, 1);\n printStack(bufferArray);\n document.getElementById(\"remove-from-todo\").value = \"\";\n return;\n }\n }\n alert(\"Could not find \" + toRemove + \" in your list. Please try again\")\n }\n}", "title": "" }, { "docid": "7dc180aa94de2d1cd912818f23aca837", "score": "0.6849826", "text": "function remove(event) {\n Todos.splice(event.target.id, 1);\n ListAllTodos();\n saveTodosInLocalStorage();\n succesMessage(\"Task was removed!\");\n return false;\n}", "title": "" }, { "docid": "68cf45409632fc1dc2541932a1933f5f", "score": "0.68287593", "text": "function remove() {\r\n let updated = document.getElementById(\"todo-list\");\r\n updated.onclick = function (event) {\r\n var target = getEventTarget(event);\r\n listEle.removeTodo(target.innerText);\r\n console.log(\"current ...........\", listEle.getList);\r\n };\r\n\r\n}", "title": "" }, { "docid": "24e83f5e88be9d9610c5780a1c238052", "score": "0.68212515", "text": "function addTodo() {\n var todoItem = input.value;\n todos.push(todoItem);\n console.log(todos);\n addToList(todoItem);\n input.value = \"\";\n\n}", "title": "" }, { "docid": "11fe48d7592cb5d1904109232cabb408", "score": "0.6676654", "text": "function deleteTodo(event){\n $(this).parent().remove();\n let remove = $(this).parent(); \n todoList.splice($.inArray(remove, todoList),1);\n event.stopPropagation();\n}", "title": "" }, { "docid": "e832bf5a3dcac6dcd92ba7928ce61779", "score": "0.66698086", "text": "function addTodo(){\n// if enter nothing show alert\n if(todo.value===\"\"){\n alert(\"Enter a to-do\")\n }else {\n// create new div \n var newEl= document.createElement(\"div\") ;\n// add class \"todo\"\n newEl.classList.add(\"todo\");\n// create input tag\n var inputChild= document.createElement(\"input\");\n// set type of this input\n inputChild.type=\"checkbox\";\n// add input to div\n newEl.appendChild(inputChild);\n// create p tag for this div\n var newContent=document.createElement(\"p\");\n//content of this <p> is value of user entered\n newContent.textContent=todo.value; \n\n// div add <p>\n newEl.appendChild(newContent);\n// create delete icon\n var delIcon=document.createElement(\"i\");\n// add class for this icon\n delIcon.classList.add(\"fas\");\n delIcon.classList.add(\"fa-trash\")\n// add delete icon to div\n newEl.appendChild(delIcon);\n// add this div to list( parent div )\n list.appendChild(newEl);\n// all the div have class \".todo\"\n var todoWork=document.querySelectorAll(\".todo\");\n// loop through all class \".todo\"\n for(var i=0;i<todoWork.length; i++){\n/* user added to-do element then they want to delete it after completed */\n// set event to the child of div have a class \".todo\" when user click for checking \"work done\" then show that work is done\n todoWork[i].children[0].addEventListener(\"click\",addClass);\n }\n// loop through delete icon\n for(var i=0;i<todoWork.length; i++){\n todoWork[i].children[2].addEventListener(\"click\",delwork);\n }\n \n\n }\n \n}", "title": "" }, { "docid": "965edc7d343bed203d285ff3a60a447a", "score": "0.6640825", "text": "function removecompleted(event) {\n CompletedTodos.splice(event.target.id, 1);\n ListAllTodos();\n saveTodosInLocalStorage();\n succesMessage(\"Task was removed!\");\n return false;\n}", "title": "" }, { "docid": "bcbea5e15925b0d2b43bd546b4ef711e", "score": "0.6604241", "text": "function addTodo(event) {\n // Stop the default action\n event.preventDefault();\n\n var item = input.value;\n // Clear the form\n form.reset();\n\n // Put the user input into a list item\n list.innerHTML += '<li>' + item + '</li>';\n}", "title": "" }, { "docid": "1db25a8f9dbba050479de3a5388e5405", "score": "0.6598021", "text": "function deleteTask(ev) {    \n \n //makes sure this event only fires once from the one click\n ev.stopImmediatePropagation();\n \n //grab the task test from the clicked list item\n var taskText = $(ev.target).prev().text();\n \n //loop through the whole list array and find the match to the grabbed text\n for (var i=0; i < shopList.length; i++){\n \n if (shopList[i].task == taskText){\n \n shopList.splice(i,1); //found a match, remove task from list\n } \n }\n \n //refresh the list and local storage\n localStorage[\"groceryabde0089\"] = JSON.stringify(shopList);\n displayList();\n}", "title": "" }, { "docid": "becda6a7dd5f13320cca35bb65e42314", "score": "0.65938693", "text": "function removeTask(removeValue) {\n var removed = parseInt(removeValue); // Otetaan painetun napin arvo ulos kokonaislukuna\n for (var i = removed; i < toDoList.length - 1; i++) { // Käydään lista läpi poistettavasta alkiosta loppuun \n toDoList [i] = toDoList[i + 1]; // Siirretään kaikkia alkioita yksi askel listalla ylöspäin\n }\n toDoList.pop(); // Poistetaan listan viimeinen alkio\n showList(); // Tulostetaan lista\n}", "title": "" }, { "docid": "a7b587f0cd47cc7bbd4acdbb09599a51", "score": "0.6564333", "text": "function deleteTodo() {\n var indexToDelete = prompt(\"What index would you like to delete?\");\n todos.splice(indexToDelete, 1);\n console.log(\"Todo with id \" + indexToDelete + \" deleted\");\n}", "title": "" }, { "docid": "8a9743f22e9902260091c05a589a4bce", "score": "0.6555846", "text": "function checkOrRemoveToDo(event) {\n\n let obj = event.target;\n let btn = obj.parentNode;\n let li = btn.parentNode;\n let task = li.getAttribute('id');\n let todos = [];\n\n //uncheck to-do\n if(obj.getAttribute('class') == \"far fa-check-circle\") {\n for (let i = 0; i < DATA.length; i++) {\n if(DATA[i].list = LIST) {\n todos = DATA[i].todos;\n for (let j = 0; j < todos.length; j++) {\n if(todos[j].task == task) {\n todos[j].check = false;\n DATA[i].todos = todos;\n localStorage.setItem('toDoList', JSON.stringify(DATA));\n\n obj.setAttribute('class', \"far fa-circle\");\n li.style.opacity = \"1\";\n li.style.textDecoration = \"none\";\n \n countCompleted();\n }\n } \n }\n }\n }\n\n //check to-do\n else if(obj.getAttribute('class') == \"far fa-circle\") {\n for (let i = 0; i < DATA.length; i++) {\n if(DATA[i].list = LIST) {\n todos = DATA[i].todos;\n for (let j = 0; j < todos.length; j++) {\n if(todos[j].task == task) {\n todos[j].check = true;\n DATA[i].todos = todos;\n localStorage.setItem('toDoList', JSON.stringify(DATA));\n\n obj.setAttribute('class', \"far fa-check-circle\");\n li.style.opacity = \"0.7\";\n li.style.textDecoration = \"line-through\";\n\n countCompleted();\n }\n } \n }\n }\n }\n\n\n //delete to-do\n if(obj.getAttribute('class') == \"fas fa-times\") {\n for (let i = 0; i < DATA.length; i++) {\n if(DATA[i].list == LIST) {\n todos = DATA[i].todos;\n for (let j = 0; j < todos.length; j++) {\n if(todos[j].task == task) {\n todos.splice(j, 1);\n DATA[i].todos = todos;\n localStorage.setItem('toDoList', JSON.stringify(DATA));\n\n li.remove();\n }\n }\n }\n \n }\n }\n}", "title": "" }, { "docid": "bc1bd034a552b3b1c583691b06cd537a", "score": "0.6549983", "text": "function deleteAllCompletedTodos(event) {\n // Write your code here...\n event.preventDefault();\n /*\n let allLi = document.querySelectorAll(\"#todo-list li\");\n allLi.forEach((li) => {\n if (li.style.textDecoration === \"line-through\"){\n li.remove();\n }\n })\n */\n todos = todos.filter((todo) => !todo.completed);\n populateTodoList(todos);\n}", "title": "" }, { "docid": "362d92fc07851467b6390c16fe24cb14", "score": "0.65457594", "text": "function deleteToDo(position){\ntoDos.splice(position, 1);\ndisplayToDos();\n}", "title": "" }, { "docid": "362d92fc07851467b6390c16fe24cb14", "score": "0.65457594", "text": "function deleteToDo(position){\ntoDos.splice(position, 1);\ndisplayToDos();\n}", "title": "" }, { "docid": "48ac4d20a3d4fb1d740c3971b92cd130", "score": "0.65291446", "text": "function toDoList(){\n let taskInput = document.querySelector('#taskInput');\n const addButton = document.querySelector('#addTaskButton');\n const taskList = document.querySelector('#taskList');\n const removeFinished = document.querySelector('#removeFinishedTasksButton');\n addButton.addEventListener('click',(e)=>{\n if(taskInput.value.length >= 5 && taskInput.value.length < 100){\n let newTask = document.createElement('li');\n let delBut = document.createElement('button');\n delBut.innerText = 'Delete';\n let complete = document.createElement('button');\n complete.innerText = 'Complete';\n let taskName = document.createElement('h1');\n taskName.innerText = taskInput.value;\n taskInput.value = '';\n newTask.appendChild(taskName);\n newTask.appendChild(delBut);\n newTask.appendChild(complete);\n taskList.appendChild(newTask);\n delBut.addEventListener('click',(e)=>{\n let currentTask = e.currentTarget.parentElement;\n currentTask.parentElement.removeChild(currentTask);\n });\n complete.addEventListener('click',(e)=>{\n e.currentTarget.parentElement.classList.toggle('done');\n });\n }\n });\n removeFinished.addEventListener('click',(e)=>{\n let completedTasks = document.querySelectorAll('.done');\n completedTasks.forEach(el => {\n el.parentElement.removeChild(el);\n });\n });\n }", "title": "" }, { "docid": "2b894d987bf5defec5072ec55385449f", "score": "0.64985037", "text": "function remove() {\r\n var remStd = prompt(\"Which Name Would You Like To Remove?: \")\r\n var index = roster.indexOf(remStd);\r\n roster.splice(index,1)\r\n}", "title": "" }, { "docid": "ed7bf8238e44b04bf99e1a8f9e3d9ccc", "score": "0.649574", "text": "function removeBookTitle(){\n //the user writes what book it want removed by its title\n let title = prompt(\"What is the title of the book you want to remove?\")\n\n /*I'm using a for-loop here because I want to run through every element of the list \n and compare it too what the user-imput*/\n for(let i = 0; i < books.length; i++){\n //if the user input match with a title in the list it will remove the object(book) from the list\n if(books[i].title === title){\n books.splice(i, 1);\n return console.table(books); \n } \n}\n //if the user hase entered an invalid input it display an error message\n alert(\"You've entered an invalid title. Make sure that they're no typo's :)\");\n}", "title": "" }, { "docid": "b0e60cb2ad32e24db0ddfd1e9efecf14", "score": "0.6493869", "text": "function addToDo(event){\n event.preventDefault();\n//Use document.createElement to create a new li element that will hold our new todo item.\n const item =document.createElement('li')\n item.innerText = document.getElementById('item').value\n item.addEventListener('click', completeToDo);\n\n const button = document.createElement('button');\n button.innerText = 'x';\n button.addEventListener('click', removeToDo);\n item.appendChild(button);\n\n\n const list = document.querySelector('ul');\n list.appendChild(item)\n\n document.getElementById('item').value = ''\n}", "title": "" }, { "docid": "c8c7acb58378f28a9582eea90c2e421f", "score": "0.6459545", "text": "function deleteTaskOrDone(event) {\n // capture the clicked element\n let li = event.target.parentElement.parentElement;\n let deletedTaskId = li.dataset.id;\n\n // Delete event\n if (event.target.classList.contains(\"deleteTask\")) {\n // Delete from LocalStorage\n // Get the task from local Storage\n let tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n let newTasks = tasks.filter((task) => task.id != deletedTaskId);\n console.log(newTasks);\n changeLocal(newTasks);\n // Remove The Element\n li.classList.add(\"fadeOut\");\n setTimeout(() => li.remove(), 400);\n // Update task number\n updateTaskNumber();\n\n if (newTasks.length === 0) {\n taskContent.innerHTML = \"\";\n }\n }\n\n if (event.target.classList.contains(\"doneTask\")) {\n // Update the Local Storage\n // Get the task from local Storage\n let tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n let newTasks = [];\n tasks.forEach((task) => {\n if (task.id == deletedTaskId) {\n task.completed = true;\n }\n newTasks.push(task);\n });\n changeLocal(newTasks);\n // Add Shake Animation\n let taskLi = event.target.closest(\".task-item\");\n taskLi.classList.add(\"shake\");\n // StrikeThrough the Task Header\n let taskHeader = taskLi.firstElementChild;\n taskHeader.classList.add(\"strike\");\n // Congration Voice message\n let word = `Congratulations ,You have completed a task`;\n speak(word);\n }\n }", "title": "" }, { "docid": "d0d8246382496b3dcc72db8e1aeefb47", "score": "0.64582205", "text": "function toDo2() {\n var toDoList = [];\n function add() {\n var userAdd = prompt(\"What would you like to add?\");\n toDoList.push(userAdd);\n console.log(\"Item added!\");\n var anotherChoice = prompt(\"Would you like to add another?\").toLowerCase(); //options are \"yes/no\"\n anotherChoice === \"yes\" ? add() : ask();\n }\n function deleter() {\n var userDelete = Number(prompt(\"Which item number should be deleted?\"));\n toDoList.splice(userDelete, 1);\n console.log(\"Item deleted!\");\n list();\n var anotherChoice = prompt(\"Would you like to change another?\").toLowerCase(); //options are \"yes/no\"\n anotherChoice === \"yes\" ? deleter() : ask();\n }\n function list() {\n console.log(\"Here is your current list:\");\n toDoList.forEach(function(ele, index){\n var listItem = index + \". \" + ele;\n console.log(listItem);\n });\n ask();\n }\n function ask() {\n var userChoice = prompt(\"What would you like to do?\").toLowerCase(); //options are \"add/delete/list/quit\"\n if (userChoice === \"add\") {\n add();\n } else if (userChoice === \"delete\") {\n deleter();\n } else if (userChoice === \"list\") {\n list();\n } else if (userChoice === \"quit\") {\n console.log(\"see ya!\");\n }\n }\n ask();\n}", "title": "" }, { "docid": "4172a8f94da6b786cd5d096b1d9a4c0a", "score": "0.6443352", "text": "function deleteTodoList (e) {\n\n const el = e.target.dataset.target;\n const index = e.target.dataset.index;\n\n if (!e.target.classList.contains('ion-ios-trash')) return;\n console.log(e.target);\n \n items.forEach(item => { // loop through an array of items\n if (item.text === el) { // check if data attribute is match to items object of text\n if (confirm('Are You Sure ?')) {\n\n items.splice(index, 1); // remove list based on selected index\n }\n }\n })\n\n localStorage.setItem('items', JSON.stringify(items));\n populateList(items, listItem);\n\n}", "title": "" }, { "docid": "ba4a060bd4b1b3f61f0164e0a8a8e2be", "score": "0.6434737", "text": "function removeTodo(todos) {\n return inquirer.prompt([{\n name : 'remove',\n message: 'Choose todo to remove:',\n type : 'checkbox',\n choices: todos\n }])\n .then(answers => {\n answers.remove.forEach(todo => {\n console.log(todo);\n return connection.query('DELETE FROM Todos WHERE todo_id=?', [todo], error => {\n if (error) {\n throw error;\n }\n });\n });\n\n return editList();\n });\n}", "title": "" }, { "docid": "c0f650ca7306353356e5fb0a36aa90a1", "score": "0.6398875", "text": "function remove(){\r\n // 'this' represents the current DOM-object which is the remove button. Retrieves value of its id using getAttribute.\r\n var id = this.getAttribute('id');\r\n var todos = get_todos();\r\n // Removes specific element from array\r\n todos.splice(id,1);\r\n // Stores new list back into database\r\n localStorage.setItem('todo', JSON.stringify(todos));\r\n // Update list in the browser\r\n show();\r\n // Stops propagination of click event\r\n return false;\r\n}", "title": "" }, { "docid": "34daabc05d98a479bf1d247592e483a5", "score": "0.63920975", "text": "function mainFunction(event) {\n if (input.value === '') {\n // alert('Input cannot be empty!')\n } else if (event.keyCode === 13) {\n let todo = {\n text: event.target.value,\n isDone: false,\n id: Date.now()\n }\n arr.push(todo);\n loopArray(arr);\n }\n localStorage.setItem('todoArr', JSON.stringify(arr));\n}", "title": "" }, { "docid": "eaeaaaf3a70f2cfea61b30a9245bb069", "score": "0.6386165", "text": "function onAdd(e){\n\te.preventDefault();\t\n\n\tif(todoInput.value === ''){\n\t\tmsg.innerHTML = 'please enter a task to add';\n\n\t\t// Remove error after 5 seconds\n \tsetTimeout(() => msg.remove(), 5000)\n\n\t}else {\n\t\tconst li=document.createElement('li');\n\t\tli.appendChild(document.createTextNode(`${todoInput.value}`));\n\t\t//append check button to todolist item of li\n\t\tconst completedButton = document.createElement('button');\n\t completedButton.innerHTML = \"\\u2713\";\n\t completedButton.classList.add('complete_btn');\n\t li.appendChild(completedButton);\n\n\t //append delete button to todolist item of li\n\t\tconst button = document.createElement(\"button\");\n\t const txt = document.createTextNode(\"\\u00D7\");\n\t\tbutton.className = \"deleteBtn\";\n\t\tbutton.appendChild(txt);\n\t\tli.appendChild(button);\n\n\t\t//append li element to todoList\n\t\ttodoList.appendChild(li);\n\t\tconsole.log(todoList)\n\n\n\t\t//clear Fields\n\t\ttodoInput.value='';\n\t}\n}", "title": "" }, { "docid": "68821559f79f61be660aa6d0a1904be0", "score": "0.6382078", "text": "function removeTodo() {\n removeButtons = document.querySelectorAll(\".removeBtn\");\n\n for (let i = 0; i < removeButtons.length; i++) {\n removeButtons[i].addEventListener(\"click\", () => {\n todoItems.pop(i);\n renderTodoList();\n });\n }\n}", "title": "" }, { "docid": "25d943b6aeb16a2981c43a6620814dc8", "score": "0.63748115", "text": "function createNewTodoList() {\r\n const text = inputText.value;\r\n if (!text) {\r\n window.alert(\"Please input TODO LIST!\");\r\n return;\r\n }\r\n // Add Item to undoListArray\r\n undoListArray.push(text);\r\n // Get Index from undoListArray\r\n const undoListIndex = undoListArray.length - 1;\r\n createTodoDOM(text, undoListIndex, undoListArray, completeListArray);\r\n // Save undoListArray to Local Storage\r\n localStorage.setItem(\"undoListArray\", JSON.stringify(undoListArray));\r\n // Delete InputBox Text\r\n inputText.value = \"\";\r\n}", "title": "" }, { "docid": "b4f1c5da1f49b382a6a8cd85eb99870e", "score": "0.6369536", "text": "function remove(){\n var name = prompt('Which name would you like to remove?')\n index = roster.indexOf(name);\n roster.splice(index,1);\n\n\n }", "title": "" }, { "docid": "23c666cb7a030494f780ab61aa921785", "score": "0.6367553", "text": "function removeItem() {\n//Get the li item for that entry\nvar item = this.parentNode.parentNode;\n//get the parent (ul) class/id for the item\nvar parent = item.parentNode;\n//Get the id of the item\nvar id = parent.id;\nvar value = item.innerText;\nif(id === 'todo') {\ndata.todo.splice(data.todo.indexOf(value), 1);\n}else {\ndata.completed.splice(data.completed.indexOf(value), 1);\n}\n//Remove the item\nparent.removeChild(item);\ndataObjectUpdated();\n}", "title": "" }, { "docid": "c505edb7cbabe4898b20f2e51afa19a2", "score": "0.635695", "text": "function appendTodo(listItem){\n var list = document.getElementById('todo_list');\n list.appendChild(listItem);\n addListeners();\n document.getElementById('input_todo').value = '';\n}", "title": "" }, { "docid": "279740afc0369507658267d87bd7240b", "score": "0.63550454", "text": "function addNewTodo(event) {\n event.preventDefault();\n // Write your code here... and remember to reset the input field to be blank after creating a todo!\n \n const inputTodo = document.getElementById(\"todoInput\"); \n let newTodo = {task: inputTodo.value, completed: false};\n todos.push(newTodo);\n populateTodoList(todos);\n inputTodo.value = \"\";\n \n}", "title": "" }, { "docid": "33002055af654881d66147e60f27fb74", "score": "0.63474244", "text": "function removeTodos(e){\n let todos = JSON.parse(localStorage.getItem(\"todos\"));\n todos.splice(e, 1);\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n displayTodos();\n}", "title": "" }, { "docid": "516e264ad06d7bdc1cf3cfa8599af50f", "score": "0.63449365", "text": "function removeNew(){\n var re = prompt(\"What name you would like to remove? \")\n var pos = roster.indexOf(re)\n\n roster.splice(pos,1)\n\n}", "title": "" }, { "docid": "415f94f491ea1b2807203bc565dcd6a1", "score": "0.6344701", "text": "function createNewToDo() {\n const listItem = document.createElement('li');\n const buttonContainer = document.createElement('div');\n const doneButton = document.createElement('button');\n const deleteButton = document.createElement('button');\n\n listItem.innerText = toDoInput.value;\n\n buttonContainer.className = \"buttonContainer\";\n doneButton.className = \"doneButton\";\n doneButton.innerText = \"Done\";\n deleteButton.className = \"deleteButton\";\n deleteButton.innerText = \"Delete\";\n\n toDos.appendChild(listItem);\n listItem.appendChild(buttonContainer);\n buttonContainer.appendChild(doneButton);\n buttonContainer.appendChild(deleteButton);\n document.getElementById('toDoInput').value = '';\n\n /* Moves completed to do to 'done deal' list and\n removes 'done' button */\n doneButton.addEventListener('click', function () {\n buttonContainer.className = \"deleteButtonContainer\";\n doneToDo.appendChild(listItem);\n doneButton.remove();\n })\n\n function removeItems() {\n listItem.classList.add('fadeOut');\n setTimeout(function () {\n listItem.remove();\n }, 200);\n }\n\n // Deletes todo from 'stuff to do' list when clicked\n deleteButton.addEventListener('click', function () {\n removeItems();\n })\n\n // Deletes every to do on both lists\n emptyAllButton.addEventListener('click', function () {\n removeItems();\n })\n}", "title": "" }, { "docid": "9cf3b68f24b753a79816017f80d407cf", "score": "0.6342993", "text": "function remove(text){\n if(text==='remove\\n'){\n task.pop()\n }\n else if(textsplit[1]<1 || textsplit[1]>task.length){\n console.log('\\n'+\"number doesn't exist\"); \n }\n \n else if(textsplit[1]=='1'){\n task.splice(0,1)\n }\n else if(textsplit[1]=='2'){\n task.splice(1,1)\n }\n list(text);\n \n}", "title": "" }, { "docid": "7729dfacdd1ca3c53a6e2d93595aeabf", "score": "0.63294333", "text": "function delete2(){\n questionWindow(\"Delete 1 item at position i from movies array movies, i entered by users\");\n let position = prompt(`What position want to delete? List movies have ${listMovies.length} movie\\n${printListMovies1()}`);\n let n = prompt(`How many movies want to delete from position ${position}? List movies have ${listMovies.length} movie\\n${printListMovies1()}`);\n listMovies.splice(position-1,n);\n printListMovies();\n}", "title": "" }, { "docid": "63676b5f6ac74d2f14214f35335cbb40", "score": "0.63241047", "text": "function removeItem(target) {\n target.remove();\n var index = taskArray.indexOf(target.innerText);\n taskArray.splice(index, 1);\n}", "title": "" }, { "docid": "84afeda65e41ddcb1f740fdd5b17a103", "score": "0.632189", "text": "function removeElement(){\n var arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n var userInput=parseFloat(prompt(\"Index number: \"));\n\n if(userInput >= arr.length){\n alert(\"Please enter a valid index number\");\n return;\n }\n\n arr.splice(userInput, 1);\n console.log(arr);\n}", "title": "" }, { "docid": "68b3f43c8b94addf6e0b36600dc35343", "score": "0.63153476", "text": "function saveChange(event){\n let newTodo = $(this).parent().find('#editText').val().trim();\n if(newTodo.length < 1){\n alert(\"You have to insert a To Do!\");\n }\n else if($.inArray(newTodo, todoList) !== -1){\n alert(\"You already have this To Do!\");\n }\n else {\n $(this).hide();\n deleteTodo(event); \n $(this).parent().find('#editText').hide();\n $(this).parent().find(\".textItem\").text(newTodo);\n $(this).parent().find('.textItem').show();\n todoList.push(newTodo);\n event.stopPropagation();\n }\n}", "title": "" }, { "docid": "73cf85b08a984faef13b2b69a91d9767", "score": "0.6314148", "text": "function deleteToDo (pos)\r\n{ \r\n // remove um item do array a partir de uma posiçao\r\n // fornece uma posicao e a quantidade de itens que serao removidos a partir dela\r\n // renderiza os elementos novamente\r\n toDos.splice(pos,1);\r\n\r\n // renderiza os ToDos novamente\r\n // salva os ToDos em localStorage\r\n renderToDos();\r\n saveToStorage();\r\n}", "title": "" }, { "docid": "159f9ab57c5f7bd7c25e2eabefce32a7", "score": "0.6313698", "text": "function displayTodos() {\r\n todoListElement.innerHTML = ''\r\n document.querySelector('#myInput').value = ''\r\n\r\n todoList.forEach(item => {\r\n const listElement = document.createElement('li')\r\n const delBtn = document.createElement('i')\r\n\r\n listElement.innerHTML = item.todoText\r\n listElement.setAttribute('data-id', item.id)\r\n\r\n delBtn.setAttribute('data-id', item.id)\r\n delBtn.classList.add('far')\r\n delBtn.classList.add('fa-trash-alt')\r\n delBtn.setAttribute('data-id', item.id)\r\n\r\n if (item.isDone) {\r\n listElement.classList.add('checked')\r\n }\r\n\r\n listElement.addEventListener('click', function (e) {\r\n const selectedId = e.target.getAttribute('data-id')\r\n doneTodo(selectedId)\r\n })\r\n\r\n delBtn.addEventListener('click', function (e) {\r\n const delId = e.target.getAttribute('data-id')\r\n deleteItem(delId)\r\n })\r\n\r\n todoListElement.appendChild(listElement)\r\n listElement.appendChild(delBtn)\r\n })\r\n}", "title": "" }, { "docid": "77bcfec1c14aadf27f7557697bfc8734", "score": "0.6312827", "text": "function delete1(){\n questionWindow(\"Delete 1 item at position i from movies array movies, i entered by users\");\n let position = prompt(`What position want to delete? List movies have ${listMovies.length} movie\\n${printListMovies1()}`);\n listMovies.splice(position-1,1);\n printListMovies();\n}", "title": "" }, { "docid": "a55057deaa1ac19e594ef7620d1b07b6", "score": "0.6301174", "text": "function todoBlurred(todo, event) {\n var trimmedText = event.target.value.trim()\n if (!trimmedText) {\n dbData.remove(todo)\n } else {\n todo.title = trimmedText\n dbData.put(todo)\n }\n }", "title": "" }, { "docid": "56088f7d8e94006c955c3ace82426975", "score": "0.62921995", "text": "function removeItem(){\r\n\tconst item = this.parentNode.parentNode; //'this' contains the value of the element that called the function\r\n\tconst currentListId = item.parentNode.id;\r\n\tconst text = item.innerText;\r\n\r\n\titem.remove();\r\n\r\n\tif (currentListId === 'todo-list'){\r\n\t\ttodos.splice(todos.indexOf(text),1); //splice takes 2 arguments: where to start deleting and how many items must me deleted\r\n\t} \r\n\telse {\r\n\t\tcompleted.splice(completed.indexOf(text),1);\r\n\t}\r\n\r\n\tupdateStorage();\r\n}", "title": "" }, { "docid": "9636ccdf4faf53c2fc576e926eca6c66", "score": "0.62884474", "text": "function handleRemoveClick() {\n removeToDo(toDo.id)\n }", "title": "" }, { "docid": "08ed972b0dbba8b80f249d78ed4bd57c", "score": "0.6266687", "text": "function toDoList() {\r\n var task = document.getElementById('toDoInput').value;\r\n if (toDoInput.value === '') {\r\n alert('No such thing as empty tasks!');\r\n }\r\n else {\r\n // kreiranje tekstualnog segmenta, list elementa, i appendovanje tekstualne vrednosti unete u input u kreirani list element\r\n var text = document.createTextNode(task);\r\n var newTask = document.createElement('li');\r\n newTask.appendChild(text);\r\n document.getElementById('toDolist').appendChild(newTask);\r\n // kada se zadatak doda, input se prazni\r\n toDoInput.value=\"\";\r\n }\r\n //precrtavanje, u CSS-u kreirana klasa koja ukrašava tekst na koji se primeni svojstvom \"line-through\"\r\nfunction crossOut() {\r\n newTask.classList.toggle(\"done\");\r\n }\r\n // precrtavanje se dešava na 1 click miša\r\n newTask.addEventListener(\"click\",crossOut);\r\n // individualno brisanje, u CSS-u kreirana klasa koja dodaje svojstvo elementu na koji je primenjena \"display: none\"\r\n function deleteItem() {\r\n newTask.classList.toggle(\"delete\");\r\n }\r\n // individualno brisanje se dešava na dupli click miša\r\n newTask.addEventListener(\"dblclick\",deleteItem);\r\n}", "title": "" }, { "docid": "335842128977fb7c8130371d91442ede", "score": "0.6266312", "text": "function addItem () {\n // add a new task to the list\n var item = document.getElementById('todo-item')\n if(event.key == 'Enter') {\n // if all the items are deleted instead of null it resets to []\n if (todoList == null) {\n todoList = [];\n }\n todoList.push([item.value, false])\n addToLocalStorage();\n clearChanges();\n displayList();\n }\n if(event.key == 'Enter'){\n document.getElementById('todo-item').value = ''\n }\n}", "title": "" }, { "docid": "35de644ae3e954105eb94ea4ba1f6799", "score": "0.62604475", "text": "function deleteTodo (position) {\n todos.splice(position, 1)\n displayTodos() // run functions inside other functions\n}", "title": "" }, { "docid": "08b565d3068a39b7a0e6da727e45ab8a", "score": "0.6255711", "text": "function handleClearToDo(e){\n const newTodos = todos.filter(todo => !todo.complete)\n setTodos(newTodos)\n }", "title": "" }, { "docid": "f8e13cd7e46fd4e44365ef63b2d9d407", "score": "0.62409496", "text": "function removeTaskInput(taskInputContainer) {\n removeTaskInputContainer.addEventListener(\"click\", function () {\n taskInputContainer.remove();\n });\n}", "title": "" }, { "docid": "d9a30ec0e7a0d80a58de016963f467ae", "score": "0.62392384", "text": "function addTask(e)\n{\n e.preventDefault();\n if(taskInput.value ==='')\n alert(\"Enter task!\")\n //adding taskInput to taskList \n const li=document.createElement('li');\n li.className = 'collection-item';\n li.appendChild(document.createTextNode(taskInput.value));\n //adding delete button to list items\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 taskList.appendChild(li);\n taskInput.value=null;\n //save task inputs to local storage\nsaveTaskToLocal(taskInput.value);\n \n\n}", "title": "" }, { "docid": "e3a5494b8d4999ecb3005176da8996d6", "score": "0.62357813", "text": "function delBtnEvent(quote, delBtn, li) {\n delBtn.addEventListener(\"click\", function(event) {\n event.preventDefault()\n removeQuote(quote)\n li.remove()\n })\n}", "title": "" }, { "docid": "160e3f87ec48204fa77bd30f7d606a49", "score": "0.6233204", "text": "function createListElement() {\n\tvar li = document.createElement(\"li\");\n\tli.appendChild(document.createTextNode(input.value));\n\tli.addEventListener('click', toggleDone);\n\tul.appendChild(li);\n\tinput.value = \"\";\n\n//create new delte button\n\tvar delBtn = document.createElement(\"button\");\t\n\tdelBtn.classList.add(\"delete\");\n\tdelBtn.textContent = \"delete\";\n\tli.appendChild(delBtn);\n\n// toggle line through on click\n\tfunction toggleDone(){\n\t\tli.classList.toggle(\"done\");\n\t}\n\n// delete when click on delBtn\n\tvar btns = document.querySelectorAll(\".delete\");\n\tfor (var i = 0; i < btns.length; i++) {\n\t\tbtns[i].addEventListener(\"click\",function(e){\n\t\tvar li = e.target.parentElement;\n\t\tli.parentNode.removeChild(li)\n\t\t});\n\t}\n}", "title": "" }, { "docid": "79bcfd7474b56f3e5a52d31b4c44ba38", "score": "0.62210983", "text": "function createTask() {\n \n //create user input task, add to unordered list, clear user input\n var li = document.createElement(\"li\");\n li.appendChild(document.createTextNode(input.value));\n ul.appendChild(li);\n input.value = \"\";\n\n //mark a task as complete by toggling the \"done\" CSS class properties on click\n function completeTask() {\n li.classList.toggle(\"done\");\n }\n li.addEventListener(\"click\",completeTask);\n\n //add a button to each task to remove it from the list by toggling the \"delete\" CSS class properties on click\n var dBtn = document.createElement(\"button\");\n dBtn.appendChild(document.createTextNode(\"remove\"));\n li.appendChild(dBtn);\n dBtn.addEventListener(\"click\", deleteListItem);\n function deleteListItem(){\n li.classList.add(\"delete\")\n }\n}", "title": "" }, { "docid": "d346add196a53a4c9ae1b309bdce53c7", "score": "0.6218285", "text": "function addEvents() {\r\n // This event is fired when the user remove an item from the list\r\n [...document.querySelectorAll(\".done-button\")].forEach((element) => {\r\n element.addEventListener(\"click\", (e) => {\r\n removeItemFromNodeAndArray(e.target);\r\n });\r\n });\r\n}", "title": "" }, { "docid": "5755aa32637765205d53bae92e452467", "score": "0.6213428", "text": "function updateTodoList(newValue) {\n // reads the text in the add todo input\n newValue = newTodo.val();\n if (newValue != '') {\n // add the text to the todo list array\n todoList.push(newValue.trim());\n console.log(todoList);\n newTodo.val('');\n newValue = '';\n // update the list on the webpage\n let appendString = '<li>' + '<span class=\"delete-button\"><i class=\"fas fa-trash-alt\"></i></span>' + '<span class=\"todo-text\">' + todoList[todoList.length - 1] + '</span>' + '<span class=\"dbl-ticks\"><i class=\"fas fa-check-double\"></i></span>' + '</li>' ;\n $(appendString).appendTo(\"#todo-list-display ul\");\n }\n}", "title": "" }, { "docid": "c2ed01d43b924a09df532d44b5e0050e", "score": "0.6211815", "text": "removeFromList() {\n /**\n * Show the elements in the list and ask to enter the name of the company to remove\n */\n console.log(this.linkedList.printShares());\n var company = read.question(\"Enter company name or symbol: \");\n this.linkedList.removeStock(company);\n /**\n * Display the elements after removing\n */\n console.log(this.linkedList.printShares());\n }", "title": "" }, { "docid": "b6bb7656d878ffa8592bdbb05b49da7a", "score": "0.6197706", "text": "deleteTodo(todoItem) { \n console.log(todoItem);\n todoItem.remove();\n}", "title": "" }, { "docid": "e0af2f0bec1ef79aa9cd77d175c8a252", "score": "0.61905587", "text": "function removeSelectedQuestion(){\n if (userInput === 1) {\n for (var i=0; i < questionsClone.length; i++) {\n if (questionOne === questionsClone[i]) {\n questionsClone.splice(i, 1);\n }\n }\n } else if (userInput === 2) {\n for (var i=0; i < questionsClone.length; i++) {\n if (questionTwo === questionsClone[i]) {\n questionsClone.splice(i, 1);\n }\n }\n }\n }", "title": "" }, { "docid": "cee9870a9c81ad46ae69b90f81ce76eb", "score": "0.6186613", "text": "function ClickEvent(e) {\n e.preventDefault();\n var todoEntery = document.getElementById(\"newEntery\").value;\n var list = document.getElementById(\"list\");\n if (todoEntery.length == 0) {\n console.log('Im empty');\n } else {\n console.log(todoEntery);\n var li = document.createElement('li');\n li.appendChild(document.createTextNode(todoEntery));\n li.setAttribute(\"class\", \"list-group-item\");\n list.appendChild(li);\n document.getElementById(\"newEntery\").value = null;\n }\n}", "title": "" }, { "docid": "54753bd2c4e9c4e84940efd1cec09676", "score": "0.6186549", "text": "function removeFromLocal(event){\n\n\n let values ;\n if(localStorage.getItem(\"inputs\") == null ){\n values = []\n \n }else {\n values = JSON.parse(localStorage.getItem(\"inputs\"))\n \n }\n\n\n const item = event.target\n const newArr = item.previousSibling.textContent //getting text in the li\n let newArr1 = values.indexOf(newArr) //checking which index it is\n\n // I was getting -1 on index 0 which this will fix the issue\n if(newArr1 === -1){\n newArr1 ++\n }else{\n newArr1\n }\n\n values.splice(newArr1,1) //removing index \n localStorage.setItem(\"inputs\", JSON.stringify(values)) //reset \n}", "title": "" }, { "docid": "0abb1fbf99711295f93437f4ff1c0f67", "score": "0.6185816", "text": "function handleRemove() {\n console.log('removed')\n setInputs([\n { location: \"campinas\", coordinates: ['Latitude', 'Longitude' ]},\n ])\n }", "title": "" }, { "docid": "fd23348b70f6ffe3a5ef80e37512a850", "score": "0.61857826", "text": "function removeTask(event) {\n var taskToDelete = event.target.parentElement.parentElement;\n var taskId = taskToDelete.dataset.noteId;\n var indexToDelete = tasks.findIndex(obj => obj.timeStamp == taskId );\n console.log( taskToDelete );\n var finishedTask = tasks[indexToDelete];\n removeFromLS( indexToDelete );\n\n saveToLS( 'finished', finishedTask );\n taskToDelete.remove();\n}", "title": "" }, { "docid": "94adb9b3f1da6378f1f079f982976adc", "score": "0.61820304", "text": "function deleteTodo(todo) {\r\n todo.parentNode.parentNode.parentNode.removeChild(todo.parentNode.parentNode);\r\n var index = todo.parentNode.parentNode.getAttribute(\"index\");\r\n for (var i = 0; i < array.length; i++) {\r\n if (i == index) {\r\n array.splice(i, 1);\r\n setLocalStorage();\r\n break;\r\n }\r\n }\r\n generator();\r\n}", "title": "" }, { "docid": "d4abf017b1aab2208a4556e756ef8b95", "score": "0.6182029", "text": "function removeTask(e) {\n // We target the correct li\n var li = e.target.parentElement.parentElement;\n // We target the correct a\n var a = e.target.parentElement;\n // we check if the a contains the added class delete-item\n if (a.classList.contains(\"delete-item\")) {\n // When the event is trig we need to confirm the remove\n if (confirm(\"Are You Sure ?\")) {\n // remove the li\n li.remove();\n // remove the data from local-storage\n removeFromLocalStorage(li);\n }\n }\n}", "title": "" }, { "docid": "c95a51d40a6429282c888f6bfcb6dc34", "score": "0.6181251", "text": "function addTodoToList() {\n if (mainInputEl.value === \"\") return;\n new Todo(mainInputEl.value);\n mainInputEl.value = \"\";\n}", "title": "" }, { "docid": "b78327a3aa66f7e4bc302648929b452d", "score": "0.6180307", "text": "function createListElement() {\n\n var li = document.createElement(\"li\");\n li.appendChild(document.createTextNode(input.value));\n ul.appendChild(li);\n input.value = \"\";\n\n\n //This function turns the background of a task salmon to show it is done\n function complete() {\n li.classList.toggle(\"done\");\n }\n\n li.addEventListener(\"click\",complete);\n\n //Remove Button\n var dBtn = document.createElement(\"button\");\n dBtn.appendChild(document.createTextNode(\"remove\"));\n li.appendChild(dBtn);\n dBtn.addEventListener(\"click\", deleteListItem);\n\n //This function helps the user remove a task\n function deleteListItem(){\n li.classList.add(\"delete\")\n }\n }", "title": "" }, { "docid": "748fd0440b7e31c42393e04b8589ba67", "score": "0.617977", "text": "function removeTask(e){\n if((e.target.parentElement.classList.contains('delete-item')) || e.target.classList.contains('delete-item')){\n if(confirm(\"Are you sure you want to delete?\")){\n let taskValue;\n if(e.target.parentElement.nodeName === 'LI'){\n taskValue=e.target.parentElement.textContent;\n e.target.parentElement.remove();\n }\n else{\n taskValue=e.target.parentElement.parentElement.textContent;\n e.target.parentElement.parentElement.remove();\n }\n removeTaskFromLocalStorage(taskValue);\n }\n }\n}", "title": "" }, { "docid": "60cc49d855a1a924dd846b4364ae74cf", "score": "0.6179228", "text": "function addToDo() {\n if(input.value) {\n var text = input.value;\n input.value = \"\";\n toDoList.push(text);\n renderizaToDos();\n salvaNoStorage();\n }\n}", "title": "" }, { "docid": "0572b2bc81e879bd8a49b5010e27aeb3", "score": "0.6178669", "text": "function removeToDo(element){\r\n element.parentNode.parentNode.removeChild(element.parentNode);\r\n \r\n LIST[element.id].trash = true;\r\n}", "title": "" }, { "docid": "4be04ed4362d2300edb768a2937c0c07", "score": "0.6174114", "text": "function todoClicked(e){\n var el = e.target;\n var tagName = el.tagName.toLowerCase(),\n type = el.type;\n if (tagName === \"input\" && el.id == \"todoInput\"){\n return;\n }\n if (tagName !== 'li'){\n el = el.parentElement;\n }\n if (type === \"checkbox\"){\n return deleteTodo(el.id, function(err){\n if (err){\n return alert('An error occured deleting your Todo: ' + code + ' : ' + errorprops);\n }\n el.remove();\n }); \n }\n return editTodo(el);\n}", "title": "" }, { "docid": "6f96e309c9393baa3fd3652ef02d3355", "score": "0.6173946", "text": "function clearInputBtn_Clicked() {\n if (inputBoxIds.length == 1) {\n // Clear the final text box.\n removeInput();\n return;\n }\n\n var index = Number(inputBoxIds.length - 1);\n\n var html = $(\"#input-list\").html();\n\n var removeIndex = -1;\n for (var i = 0; i < inputBoxIds.length; ++i) {\n if (inputBoxIds[i] == index) {\n removeIndex = i;\n break;\n }\n }\n\n var listEles = html.split(\"</li>\");\n\n for (var i = 0; i < listEles.length; ++i) {\n if (listEles[i] == \"\") {\n listEles.splice(i--, 1);\n continue;\n }\n\n listEles[i] = listEles[i] + \"</li>\";\n }\n\n if (removeIndex == -1) {\n // Some error message thing goes here.\n }\n\n listEles.splice(removeIndex, 1);\n\n html = \"\";\n for (var i = 0; i < listEles.length; ++i) {\n html += listEles[i];\n }\n\n $(\"#input-list\").html(html);\n\n inputBoxIds.splice(index, 1);\n\n updateInputBoxes();\n\n mathInputChanged();\n}", "title": "" }, { "docid": "2631b72677aecadd9d1903b3166a916b", "score": "0.61695886", "text": "function remove(){\n //this refers to the current dom element which the user clicks on the remove button\n //we get the value of the id by getAttribute method\n var id = this.getAttribute('id');\n var todos = get_todos();\n //we use splice to remove a specific element from the javascript array\n todos.splice(id, 1);\n localStorage.setItem('todo', JSON.stringify(todos));\n\n show();\n\n return false;\n}", "title": "" }, { "docid": "3839ab19fbd96a658830061c569e1790", "score": "0.6169167", "text": "function delItem(event) {\n let current = event.target,\n item = current.parentElement,\n items = document.querySelectorAll(\".todo__item\"),\n itemsArr = [...items];\n\n item.classList.add(\"remove\");\n item.addEventListener(\n \"transitionend\",\n () => {\n item.remove();\n countItems();\n },\n false\n );\n\n if (itemsArr.length - 1 <= 0) {\n item.addEventListener(\n \"transitionend\",\n () => {\n content.style.cssText = \"display: none\";\n },\n false\n );\n }\n}", "title": "" }, { "docid": "19ca53b36a8e56a0256c424128b80b89", "score": "0.6166467", "text": "function deleteButtonPressed(todo) {\n let index = currentNotes.findIndex(x => x._id === todo._id)\n console.log(currentNotes[index])\n currentNotes.splice(index,1)\n setItem('notes',currentNotes)\n redrawTodosUI(currentNotes)\n }", "title": "" }, { "docid": "f22cf1b483a21c07d157054837614841", "score": "0.61661583", "text": "removeCurrentList() {\n let indexOfList = -1;\n let txt = \"\";\n var confirmElement = confirm(\"Proceed with list deletion?\");\n if (confirmElement == false) {\n txt = \"You pressed Cancel!\";\n } else {\n txt = \"You pressed OK!\";\n \n for (let i = 0; (i < this.toDoLists.length) && (indexOfList < 0); i++) {\n if (this.toDoLists[i].id === this.currentList.id) {\n indexOfList = i;\n }\n }\n this.toDoLists.splice(indexOfList, 1);\n this.currentList = null;\n this.view.clearItemsList();\n }\n this.view.refreshLists(this.toDoLists);\n }", "title": "" }, { "docid": "18502b036ee1b5478298c2692a35782e", "score": "0.6159186", "text": "function deleteList(event) {\n let liClass = (event.target);\n\n //Finding if the clicked element is the dustbin Button\n if (liClass.classList[0] === \"trashButtonClass\") {\n //Selecting the parent of the list element\n const todoDiv = liClass.parentElement;\n // Animation\n todoDiv.classList.add(\"listDeleteAnimation\");\n //Wait for transition to end and Removing the list\n todoDiv.addEventListener(\"transitionend\", () => {\n todoDiv.remove();\n });\n }\n // If the clicked element is the Tick Button\n else if (liClass.classList[0] === \"checkButtonClass\") {\n const todoDiv = liClass.parentElement;\n //Toggle between 2 Classes in the parent\n todoDiv.classList.toggle(\"strikeThough\");\n }\n}", "title": "" }, { "docid": "23f6480933fc76db1a76a54f186a6f7c", "score": "0.61579573", "text": "function createList() {\r\n const row = document.querySelector(\".listBox .row .col-12\");\r\n\r\n // Create list box\r\n const div = document.createElement(\"div\");\r\n\r\n //ada class to list box\r\n div.classList.add(\"list\");\r\n\r\n // Create list text\r\n const p1 = document.createElement(\"p\");\r\n\r\n //append userInput to list text\r\n p1.appendChild(document.createTextNode(userInput.value));\r\n\r\n // create delete button\r\n const delButton = document.createElement(\"span\");\r\n delButton.appendChild(document.createTextNode(\"X\"));\r\n delButton.classList.add(\"delete\");\r\n\r\n // append del button and list text to list box\r\n div.appendChild(p1);\r\n div.appendChild(delButton);\r\n\r\n // append list box to row\r\n row.appendChild(div);\r\n\r\n //reset input value\r\n input.value = \"\";\r\n\r\n // ! add events list done and del\r\n // * List done\r\n p1.addEventListener(\"click\", function() {\r\n p1.classList.toggle(\"listDone\");\r\n });\r\n\r\n // * List del\r\n delButton.addEventListener(\"click\", function(event) {\r\n event.target.parentElement.remove();\r\n console.log(\"work\");\r\n });\r\n}", "title": "" }, { "docid": "13365ec323f76deba7020bb35e60a21e", "score": "0.614928", "text": "function removeTodo(index) {\n\tif(index.target.id == 'delete-item') {\n\t\tlet li = index.target.parentElement;\n\t\tlet ul = li.parentNode;\n\t\tlet ind = Array.prototype.indexOf.call(ul.children,li);\n\t\tif(confirm('Are you sure you want to delete '+todos[ind].name+' ?')){\n\t\t\ttodos.splice(ind, 1);\n\t\t}\n\t\tsaveTodos();\n\t\tlistTodos();\n\t}\n}", "title": "" }, { "docid": "f44c7b145c790b914cbcf6acbd8426fe", "score": "0.61477005", "text": "function deletetodo(key) {\n // we’ll locate the todo item in the array using its id and remove it.\n todoItems = todoItems.filter(item => item.id !== Number(key));\n const item = document.querySelector(`[data-value=\"${key}\"]`);\n const details = document.querySelector(\".details\");\n const li = document.querySelector(\".todo-item\");\n // remove the todo\n item.remove();\n if (todoItems.length === 0) {\n info.style.display = \"block\";\n details.style.display = \"none\";\n info.classList.add(\"info\");\n myform.classList.remove(\"myform-lg\");\n myform.classList.add(\"myform\");\n todolist.style.width = \"50%\";\n greetings.innerHTML = \"Greetings, comrade.\";\n }\n }", "title": "" }, { "docid": "091789c4c7a37981af29aa3a4b72c94a", "score": "0.6146205", "text": "function createTodo(){ \n let todoText = $(\"#newTodo\").val().trim();\n if(todoText.length < 1){\n alert(\"You have to insert a To Do!\");\n }\n else if($.inArray(todoText, todoList) !== -1){\n alert(\"You already have this To Do!\");\n }\n else {\n todoList.push(todoText);\n $(\"#newTodo\").val(\"\");\n $(\"ul\").append(\n \"<li><span class='textItem'>\" + \n todoText + \"</span>\" + \".\" + \"<input type='text' id='editText'><button id='saveTodo'>save</button><i id='delete' class='fas fa-trash-alt'></i><i id='check' class='fas fa-check-square'></i><i id='modify' class='fas fa-edit'></i><i id='exclamation' class='fas fa-exclamation-triangle'></i></li>\"\n )}; \n}", "title": "" }, { "docid": "4c500d03a75bf28ba2fcc1e8d029638c", "score": "0.6141373", "text": "function deleteChoice(event) {\n //console.log(event.target.value);\n //var delBtnId = event.target.id; NOTE: this is not working.\n //stack overflow said to create event.target.value to identify object that led to event.\n var delBtnValue = event.target.value;\n document.getElementById(delBtnValue + '_choice').remove();\n event.target.remove();\n\n //NOTE: tutor recommended that I use indexOf and splice the index to get my for loop to work\n var index = ingredientArray.indexOf(delBtnValue);\n if (index > -1) {\n ingredientArray.splice(index, 1);\n }\n\n var ingredients = '';\n\n for (i = 0; i < ingredientArray.length; i++) {\n ingredients += ingredientArray[i];\n if (i < ingredientArray.length - 1) {\n ingredients += ',';\n }\n }\n searchDrink(ingredients);\n }", "title": "" }, { "docid": "7573e3f41370688e2f621f38fd14f288", "score": "0.61411595", "text": "function removeFromUserList(input) {\n var data = {\n username: input['username'],\n room: input['room'],\n notice: 'left'\n };\n updateConversation(data);\n userList[input['room']].splice(userList[input['room']].indexOf(input['username']), 1);\n if (input['room'] == currentRoom) {\n showUserList(input['room']);\n }\n}", "title": "" }, { "docid": "d3a32984f80e2df4ff0ba888e20b7732", "score": "0.6136572", "text": "function clearTask(event) {\r\n var listItemToRemove = event.target.parentElement;\r\n var parent = (event.target.parentElement.parentElement);\r\n parent.removeChild(listItemToRemove);\r\n}", "title": "" }, { "docid": "5c7442c57d2954fbf16ef5aa77619369", "score": "0.6133735", "text": "function clickToDo(event) {\n // Check to see if the element being clicked is the delete icon\n if (event.target.parentElement.classList.contains('delete-to-do')) {\n event.preventDefault()\n\n // Remove the To Do li, which is the parent of the <a> tag which is the parent of the <i> delete icon\n event.target.parentElement.parentElement.remove()\n\n // Remove To Do from local storage\n removeToDoFromLocalStorage(event.target.parentElement.parentElement)\n\n // Hide filter input if To Do list length is under 2\n if (JSON.parse(localStorage.getItem('toDos')).length < 2) {\n filter.style.display = 'none';\n }\n\n // Check if the element being clicked is the To Do text and is currently crossed out\n } else if(event.target.classList.contains(\"line-through\")) {\n let toDo = event.target\n // Remove the class that crosses out the To Do\n toDo.classList.remove(\"line-through\")\n // Add class that tells us the To Do is not crossed out\n toDo.classList.add(\"no-line\")\n // Update the To Do in local storage so it will remain not crossed out on a page refresh\n updateToDo(toDo, event.target)\n\n // Check if the element being clicked is the To Do text and is currently not crossed out\n } else if (event.target.classList.contains(\"no-line\")) {\n let toDo = event.target\n // Remove the class telling us the To Do is not crossed out\n toDo.classList.remove(\"no-line\")\n // Add class that crosses out the To Do\n toDo.classList.add(\"line-through\")\n // Update the To Do in local storage so it will remain crossed out on a page refresh\n updateToDo(toDo, event.target)\n }\n}", "title": "" }, { "docid": "cf8a2c9d1b67328df5956abb0a58dc62", "score": "0.6129559", "text": "function todoMaker(input) {\n let newTodo = document.createElement('li');\n newTodo.textContent = input;\n todosList.appendChild(newTodo);\n userInput.value = '';\n}", "title": "" }, { "docid": "dc39e1314cd8f32fe71cfd3eed319e22", "score": "0.6126658", "text": "function delName() {\n const name = prompt(\"Name to delete\");\n if (names.includes(name)) {\n const index = names.indexof(name);\n names.splice(index, 1);\n } else {\n alert(\"Name not found!\");\n }\n // console.log(names);\n}", "title": "" }, { "docid": "9a6deee790cb6fdc88eb6be9e41c2f7b", "score": "0.6123573", "text": "function addToDo(event) {\n event.preventDefault()\n\n if(toDoInput.value === '') {\n // Add invalid class for bootstrap invalid-feedback\n if(!toDoInput.className.includes('is-invalid')) {\n toDoInput.classList += \" is-invalid\"\n }\n } else {\n // Reset input class\n toDoInput.className = \"form-control\"\n // Create li element\n const li = document.createElement('li')\n // Add class\n li.className = \"d-flex align-items-center to-do-li\"\n\n // Create div for li text\n const text = document.createElement('div')\n // Add class to text div\n text.className = \"ml-3 no-line to-do-text\"\n\n // Set text div's id\n // text.setAttribute(\"id\", length + 1)\n\n // Create a text node and append it to text div\n text.appendChild(document.createTextNode(toDoInput.value))\n // Append text div to li\n li.appendChild(text)\n\n // Create new link element\n const link = document.createElement('a')\n // Add class\n link.className = \"badge delete-to-do ml-auto\"\n // Add icon HTML\n link.innerHTML = '<i class=\"fa fa-remove fa-2x\"></i>'\n // Append link to li\n li.appendChild(link)\n\n // Append li to ul\n toDoList.appendChild(li)\n\n // Store in Local Storage\n storeToDoInLocalStorage(text)\n\n // Clear input\n toDoInput.value = \"\"\n }\n\n if (JSON.parse(localStorage.getItem('toDos')).length >= 2) {\n filter.style.display = '';\n }\n}", "title": "" }, { "docid": "64cc98e56a3ac2a7c89fecbbc9557328", "score": "0.6120999", "text": "function deleteTodo(){\n this.parentElement.remove(); // Remove from ul\n \n const todoName = String(this.previousSibling.innerText); // Remove from the todo array\n const index = todos.indexOf(todoName);\n if(todos[index] == todoName){\n todos.splice(index, 1);\n };\n \n localStorage.setItem('todos', JSON.stringify(todos)); // Update local storage\n \n \n const completedName = String(this.previousSibling.innerText); // Remove from the completed array\n var indexCompleted = completed.indexOf(completedName);\n if(completed[indexCompleted] == completedName){\n completed.splice(indexCompleted, 1);\n };\n \n localStorage.setItem('completed', JSON.stringify(completed)); // Update local storage\n \n // Hide \"Delete all\" button when the last todo is deleted\n if(todoList.children.length == 0){\n deleteAllButton.classList.remove('show');\n };\n \n if(completedList.children.length == 0){\n deleteAllCompletedButton.classList.remove('show');\n };\n}", "title": "" }, { "docid": "315f77f98eeeba23fcc8c3905979af7d", "score": "0.611981", "text": "function remove(event) {\r\n let item = event.target;\r\n // let idOfLi = event.target.parentNode.id;\r\n \r\n if (item.classList[0] === 'delete-btn') {\r\n let itemTodo = event.target.parentNode;\r\n itemTodo.classList.add('fall');\r\n itemTodo.addEventListener('transitionend', function() {\r\n itemTodo.remove();\r\n })\r\n}\r\n\r\n // document.getElementById(idOfLi).remove();\r\n}", "title": "" }, { "docid": "e7ee025ab64d856109af32d26a161505", "score": "0.61162156", "text": "function addTodo(initialTodoText) {\r\n if (inputTodo.value.trim() === \"\") {\r\n alert(\"You must enter a todo item.\");\r\n return;\r\n }\r\n\r\n // Finds the UL and creates the Li element\r\n\r\n let todoUl = document.getElementById(\"todo-list\");\r\n let todoLi = document.createElement(\"li\");\r\n let todoLiEdit = document.createElement(\"input\");\r\n todoLiEdit.setAttribute(\"type\", \"text\");\r\n todoLiEdit.id = \"input-edit\";\r\n\r\n // Creates a div for li element and buttons to sit in\r\n\r\n let liDiv = document.createElement(\"div\");\r\n liDiv.classList.add(\"todo-div-li\");\r\n\r\n // Delete Button\r\n\r\n let deleteButton = document.createElement(\"button\");\r\n deleteButton.classList.add(\"delete-btn\");\r\n deleteButton.innerHTML = '<i class=\"fas fa-trash\"></i>';\r\n deleteButton.addEventListener(\"click\", remove);\r\n\r\n // Toggle Button\r\n\r\n let toggleOnButton = document.createElement(\"button\");\r\n toggleOnButton.classList.add(\"toggle-on-btn\");\r\n toggleOnButton.innerHTML = '<i class=\"fas fa-toggle-on\"></i>';\r\n toggleOnButton.addEventListener(\"click\", toggle);\r\n\r\n // Toggle Button Div\r\n\r\n let toggleBtn = document.createElement(\"div\");\r\n toggleBtn.classList.add(\"button\");\r\n toggleBtn.classList.add(\"r\");\r\n toggleBtn.classList.add(\"center\");\r\n toggleBtn.id = \"togBtn\";\r\n let toggleBox = document.createElement(\"input\", \"checkbox\");\r\n toggleBox.setAttribute(\"type\", \"checkbox\");\r\n toggleBox.classList.add(\"checkbox\");\r\n let toggleKnob = document.createElement(\"div\");\r\n toggleKnob.classList.add(\"knobs\");\r\n let toggleLayer = document.createElement(\"div\");\r\n toggleLayer.classList.add(\"layer\");\r\n\r\n toggleBtn.addEventListener(\"click\", toggle);\r\n\r\n // Edit Button\r\n\r\n let editButton = document.createElement(\"button\");\r\n editButton.classList.add(\"edit-btn\");\r\n editButton.innerHTML = '<i class=\"fas fa-edit\"></i>';\r\n editButton.addEventListener(\"click\", edit);\r\n\r\n initialTodoText = inputTodo.value;\r\n\r\n todos.push(initialTodoText);\r\n\r\n // Appends the li, div and buttons to the UL.\r\n\r\n todoUl.appendChild(liDiv);\r\n liDiv.appendChild(todoLi);\r\n todoLi.appendChild(todoLiEdit);\r\n\r\n // toggle div button\r\n\r\n liDiv.appendChild(toggleBtn);\r\n toggleBtn.appendChild(toggleBox);\r\n toggleBtn.appendChild(toggleKnob);\r\n toggleBtn.appendChild(toggleLayer);\r\n\r\n // Edit and Delete Buttons at the end of div.\r\n liDiv.appendChild(editButton);\r\n liDiv.appendChild(deleteButton);\r\n\r\n todoLi.innerText = initialTodoText;\r\n\r\n let uuid = create_UUID();\r\n liDiv.id = uuid;\r\n let uuid_li = create_UUID();\r\n todoLi.id = uuid_li;\r\n\r\n // Input value is reset.\r\n\r\n inputTodo.value = \"\";\r\n}", "title": "" } ]
8e3afc66003b962e03862ad5432b1089
Leftpadding singledigit byte values with left zero
[ { "docid": "4bb42865d4fb53ed39aebbc83b499c8e", "score": "0.632604", "text": "function byte(b){\n if(b.length < 2)\n b = \"0\" + b;\n return b;\n}", "title": "" } ]
[ { "docid": "091b59406a405caf0f11dca404bf8414", "score": "0.64885247", "text": "function withLeadingZero2Dig(s) {\n return (\"0\" + s).slice(-2);\n }", "title": "" }, { "docid": "75e70352af5643d0538a9ce2ff746399", "score": "0.6428373", "text": "function fromBinary(input){\n // We assume input is 8 digits long\n var result = 0;\n for ( i = 0 ; i < 8 ; i += 1 ){\n if ((input[i]) !== \"0\") result = result + Math.pow(2, 7 - i);\n }\n console.log(result);\n return result;\n }", "title": "" }, { "docid": "3ce8915222b4059d5b66070050291dc3", "score": "0.6347746", "text": "function toAddZero(n) {\n return ('0' + n).slice(-2);\n}", "title": "" }, { "docid": "bff7d23a2e9a5586933ce38b4b9fba50", "score": "0.63455266", "text": "function add8(a, b) {\n return (a + b) & 0xFF;\n}", "title": "" }, { "docid": "bff7d23a2e9a5586933ce38b4b9fba50", "score": "0.63455266", "text": "function add8(a, b) {\n return (a + b) & 0xFF;\n}", "title": "" }, { "docid": "a2ad02e129ec34a71692b3038ff8b9dc", "score": "0.62769604", "text": "function pad(n) { return (\"0\" + n).slice(-2); }", "title": "" }, { "docid": "8a6cc11ca6e3183feabc4f7bfa4efed8", "score": "0.62494326", "text": "function zeroPadded(val) {\n if (val >= 10)\n return val;\n else\n return '0' + val;\n }", "title": "" }, { "docid": "c53f1444bac0f4f49012dad987e51311", "score": "0.62358075", "text": "function doubleZero(){\n if (foo.register === '0' || foo.register.length > 8) {\n return;\n } else {\n foo.key = '00';\n };\n foo.numPad();\n return;\n }", "title": "" }, { "docid": "99a47c9f796d8b9c95a21c00ba1650e9", "score": "0.6185688", "text": "function zero_padding(num) {\r\n let result = Math.round(num).toString(16);\r\n if (result.length < 2)\r\n result = \"0\" + result;\r\n return result;\r\n}", "title": "" }, { "docid": "0ad8ff52ffbb3d33d0b3f60c1ab68ebc", "score": "0.61726516", "text": "function g(a) {\n if (a) {\n var b = i(a);\n b && b.length > 8 && (b = b.substr(0, 8));\n return (\"1\" + b + h(11)).substr(0, 12)\n }\n return \"0\" + h(11)\n }", "title": "" }, { "docid": "73a80494de4d2471334db67a5023b95b", "score": "0.61681134", "text": "function pad(a,b){return(1e15+a+\"\").slice(-b)}", "title": "" }, { "docid": "c2859d4dccaf8eee4d1dbae564427902", "score": "0.61665475", "text": "calcSimpleSum(data) {\n\t\tlet sum = 0;\n\t\tfor (let i = 0; i < (data.length >> 2) - 1; i++) {\n\t\t\tsum += Number(utils.bin2dec(data.slice(i * 4, (i + 1) * 4).reverse().join('')));\n\t\t}\n\t\treturn sum & 0xf;\n\t}", "title": "" }, { "docid": "001ed06baf600989315bc8ba83cacfee", "score": "0.6140894", "text": "function format8Bit(input) {\n\n while (input.length < 8) {\n\tinput = 0 + input;\n }\n \n return input;\n}", "title": "" }, { "docid": "ab91ffa5d84eb1a43db6b0f06ec4b4e6", "score": "0.6109873", "text": "function pad0(num, len){\r\n\t\t\t\treturn ('0000'+num).split('').reverse().splice(0,len).reverse().join('');\r\n\t\t\t}", "title": "" }, { "docid": "8f56d799095ccf8808f19ebdc0971285", "score": "0.6059318", "text": "function adler32(data){var a=1;var b=0;for(var i=0;i<data.length;i++){a=(a+data.charCodeAt(i))%MOD;b=(b+a)%MOD;}return a|b<<16;}", "title": "" }, { "docid": "2d45e0434114f579ceed79b5d3dfd8e5", "score": "0.60369724", "text": "function addZeroPaddingSingle(number){\n\tvar result=number;\n\tif(number<10 && number>-1) result=\"0\"+number;\n\treturn result;\n}", "title": "" }, { "docid": "53fdc14b67dd658ea75bd41810bac349", "score": "0.6025159", "text": "function summing(d)\n {\n var carry = 0;\n for (var i = 0; i < Sum.length; i++)\n {\n var sum = (Sum[i] & 0xff) + (d[i] & 0xff) + carry;\n\n Sum[i] = sum;\n\n carry = sum >>> 8;\n }\n }", "title": "" }, { "docid": "864dbfb30c680556889c6bd228e62220", "score": "0.6017134", "text": "function pad0(i,w) { return (\"000\" + String(i)).slice(-w); }", "title": "" }, { "docid": "9512e0d14d4061feefd1062999080b65", "score": "0.6008282", "text": "toBytes(bytes) {\r\n const carry = new Int32Array(FieldElement.FIELD_ELEMENT_SIZE);\r\n let q = ((19 * this.data[9]) + (1 << 24)) >> 25;\r\n q = (this.data[0] + q) >> 26;\r\n q = (this.data[1] + q) >> 25;\r\n q = (this.data[2] + q) >> 26;\r\n q = (this.data[3] + q) >> 25;\r\n q = (this.data[4] + q) >> 26;\r\n q = (this.data[5] + q) >> 25;\r\n q = (this.data[6] + q) >> 26;\r\n q = (this.data[7] + q) >> 25;\r\n q = (this.data[8] + q) >> 26;\r\n q = (this.data[9] + q) >> 25;\r\n // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20.\r\n this.data[0] += 19 * q;\r\n // Goal: Output h-2^255 q, which is between 0 and 2^255-20.\r\n carry[0] = this.data[0] >> 26;\r\n this.data[1] += carry[0];\r\n this.data[0] -= carry[0] << 26;\r\n carry[1] = this.data[1] >> 25;\r\n this.data[2] += carry[1];\r\n this.data[1] -= carry[1] << 25;\r\n carry[2] = this.data[2] >> 26;\r\n this.data[3] += carry[2];\r\n this.data[2] -= carry[2] << 26;\r\n carry[3] = this.data[3] >> 25;\r\n this.data[4] += carry[3];\r\n this.data[3] -= carry[3] << 25;\r\n carry[4] = this.data[4] >> 26;\r\n this.data[5] += carry[4];\r\n this.data[4] -= carry[4] << 26;\r\n carry[5] = this.data[5] >> 25;\r\n this.data[6] += carry[5];\r\n this.data[5] -= carry[5] << 25;\r\n carry[6] = this.data[6] >> 26;\r\n this.data[7] += carry[6];\r\n this.data[6] -= carry[6] << 26;\r\n carry[7] = this.data[7] >> 25;\r\n this.data[8] += carry[7];\r\n this.data[7] -= carry[7] << 25;\r\n carry[8] = this.data[8] >> 26;\r\n this.data[9] += carry[8];\r\n this.data[8] -= carry[8] << 26;\r\n carry[9] = this.data[9] >> 25;\r\n this.data[9] -= carry[9] << 25;\r\n // h10 = carry9\r\n // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20.\r\n // Have h[0]+...+2^230 h[9] between 0 and 2^255-1;\r\n // evidently 2^255 h10-2^255 q = 0.\r\n // Goal: Output h[0]+...+2^230 h[9].\r\n bytes[0] = (Math.trunc(this.data[0]));\r\n bytes[1] = (this.data[0] >> 8);\r\n bytes[2] = (this.data[0] >> 16);\r\n bytes[3] = ((this.data[0] >> 24) | (this.data[1] << 2));\r\n bytes[4] = (this.data[1] >> 6);\r\n bytes[5] = (this.data[1] >> 14);\r\n bytes[6] = ((this.data[1] >> 22) | (this.data[2] << 3));\r\n bytes[7] = (this.data[2] >> 5);\r\n bytes[8] = (this.data[2] >> 13);\r\n bytes[9] = ((this.data[2] >> 21) | (this.data[3] << 5));\r\n bytes[10] = (this.data[3] >> 3);\r\n bytes[11] = (this.data[3] >> 11);\r\n bytes[12] = ((this.data[3] >> 19) | (this.data[4] << 6));\r\n bytes[13] = (this.data[4] >> 2);\r\n bytes[14] = (this.data[4] >> 10);\r\n bytes[15] = (this.data[4] >> 18);\r\n bytes[16] = (Math.trunc(this.data[5]));\r\n bytes[17] = (this.data[5] >> 8);\r\n bytes[18] = (this.data[5] >> 16);\r\n bytes[19] = ((this.data[5] >> 24) | (this.data[6] << 1));\r\n bytes[20] = (this.data[6] >> 7);\r\n bytes[21] = (this.data[6] >> 15);\r\n bytes[22] = ((this.data[6] >> 23) | (this.data[7] << 3));\r\n bytes[23] = (this.data[7] >> 5);\r\n bytes[24] = (this.data[7] >> 13);\r\n bytes[25] = ((this.data[7] >> 21) | (this.data[8] << 4));\r\n bytes[26] = (this.data[8] >> 4);\r\n bytes[27] = (this.data[8] >> 12);\r\n bytes[28] = ((this.data[8] >> 20) | (this.data[9] << 6));\r\n bytes[29] = (this.data[9] >> 2);\r\n bytes[30] = (this.data[9] >> 10);\r\n bytes[31] = (this.data[9] >> 18);\r\n }", "title": "" }, { "docid": "d74d5fb61c0fce01f4dfbc87c957d4e7", "score": "0.60004735", "text": "function r(e) {\n for (var t = 1, n = 0, r = 0, i = e.length, a = -4 & i; r < a; ) {\n for (var s = Math.min(r + 4096, a); r < s; r += 4) n += (t += e.charCodeAt(r)) + (t += e.charCodeAt(r + 1)) + (t += e.charCodeAt(r + 2)) + (t += e.charCodeAt(r + 3));\n t %= o, n %= o;\n }\n for (;r < i; r++) n += t += e.charCodeAt(r);\n return t %= o, n %= o, t | n << 16;\n }", "title": "" }, { "docid": "45ceaba88b7783ad1a7c9570e9ebce58", "score": "0.5994632", "text": "function adler32(data){var a=1;var b=0;for(var i=0;i < data.length;i++) {a = (a + data.charCodeAt(i)) % MOD;b = (b + a) % MOD;}return a | b << 16;}", "title": "" }, { "docid": "d4b11b7458c844fb1dfc253f5ef372b7", "score": "0.59834987", "text": "function zeroPad(val, len) {\n return ('00000000' + val).substr(-len);\n }", "title": "" }, { "docid": "e45b8ebfc00a886d32109f970634c5f9", "score": "0.5967256", "text": "function addZero (str) {\n str = str.toString();\n return str.length < 6 ? addZero(\"0\" + str) : str;\n }", "title": "" }, { "docid": "8c161eb3d8122abfb337953ae3d6e651", "score": "0.59516746", "text": "function addBinary(a,b) {\n var result = a + b;\n var binaryResult = '';\n \n \n while ( result > 0 ){\n \n if ( result % 2 == 0){\n binaryResult = binaryResult.concat(0);\n } else if ( result % 2 !== 0) {\n binaryResult = binaryResult.concat(1);\n }\n \n result = Math.floor( result / 2 );\n \n }\n \n return binaryResult.split(\"\").reverse().join(\"\");\n \n}", "title": "" }, { "docid": "bf2ac66cce6eaa9176797e42ff4b2b03", "score": "0.59469384", "text": "function tp_zero_pad(n, l)\n{\n\tn = n.toString();\n\tl = Number(l);\n\tvar pad = '0';\n\twhile (n.length < l) {n = pad + n;}\n\treturn n;\n}", "title": "" }, { "docid": "7c5e20ed9adcae256da442c31681833e", "score": "0.5942117", "text": "function prefixInteger(num,len){//\n return (Array(len).join('0') + num).slice(-len);\n}", "title": "" }, { "docid": "bb08911734dbdb38d05d07f44d3c4daf", "score": "0.59413517", "text": "function addBinary(a,b){\n return (a +b).toString(2)\n}", "title": "" }, { "docid": "30887cf0cfd88ac0950dd69c34cef9b0", "score": "0.59320736", "text": "full_u64() {\n this.throw_if_less_than(8);\n\n let val = 0;\n for (let i = 0; i < 8; i++) {\n val = (val * 256) + this.buffer[this.pos];\n this.pos += 1;\n }\n return val;\n }", "title": "" }, { "docid": "304714f981e75b610c55733db38e9f3e", "score": "0.5928353", "text": "static completeLeftWithZeros(value, n) {\n value = this.completeWithChar(value, '0', n);\n return value;\n }", "title": "" }, { "docid": "325f2b2551330266a4dd6ef7ce0880ab", "score": "0.5912799", "text": "function addZerosLeft(numInStr) {\n while (numInStr.length < 4){\n numInStr = \"0\" + numInStr;\n }\n return numInStr;\n}", "title": "" }, { "docid": "883d23073d1eb30639b47c4abd1d75c0", "score": "0.59041584", "text": "function addZero(number)\n{\n return (\"0\" + number).slice(-2);\n}", "title": "" }, { "docid": "31d403f1ab2d61d7f67a19a0f8c3921b", "score": "0.58849734", "text": "function zweiStellen(s) {\r\n while (s.toString().length < 2) {\r\n\t\ts = \"0\" + s;\r\n }\r\n return s;\r\n}", "title": "" }, { "docid": "d6f96dffe412307d1ef8c4ecc7661133", "score": "0.58753484", "text": "function LZ(x) { if (x<10) return '0'+x; return x; }", "title": "" }, { "docid": "6fdda3a0185b5455018b1b12a24dac0b", "score": "0.58707404", "text": "function zfill(number, size) {\n number = number.toString();\n while (number.length < size) {\n number = '0' + number;\n }\n return number;\n }", "title": "" }, { "docid": "56a23f745e9b463e4d0f917a6ec44f87", "score": "0.58631814", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n }", "title": "" }, { "docid": "2cc914a96239b9cad34fcd8c8dff3a95", "score": "0.58628154", "text": "function add_binary_strings(a, b) {\n let binSum = '';\n let intSum = (parseInt(a) + parseInt(b) + '');\n let carry = 0;\n for (let i = intSum.length - 1; i >= 0; i--) {\n let current = (parseInt(intSum[i]) + carry).toString();\n if(current === '3') {\n binSum = '1' + binSum;\n carry = 1;\n } else if (current === '2') {\n binSum = '0' + binSum;\n carry = 1;\n } else if (current === '1') {\n binSum = '1' + binSum;\n carry = 0;\n } else if (current === '0') {\n binSum = '0' + binSum;\n carry = 0;\n }\n if(carry === 1 && i ===0) {\n binSum = '1' + binSum;\n }\n }\n return binSum;\n}", "title": "" }, { "docid": "50940d81a8cf8cf2e25dafffba3d418d", "score": "0.5855717", "text": "function zero_padding(num,length){\n return ('0000000000' + num).slice(-length);\n}", "title": "" }, { "docid": "e9de834e1574f87d68ed67c5b041dae8", "score": "0.58492625", "text": "function macIncr(macNum, macDigit){\r\n var loru = macDigit > 6 ? 0 : 1; // lower or upper?\r\n var tempDigit = macDigit > 6 ? macDigit-6 : macDigit;\r\n // use bitmask\r\n var bitmask = (Math.pow(16,tempDigit)) - (Math.pow(16,tempDigit-1));\r\n if( (mac[macNum-1][loru]&bitmask) == (bitmask) ){\r\n // if it's an 0xf, reduce by 0xf\r\n mac[macNum-1][loru] = mac[macNum-1][loru] - (bitmask);\r\n }else{\r\n //..otherwise add one\r\n mac[macNum-1][loru] = mac[macNum-1][loru] + Math.pow(16,tempDigit-1);\r\n }\r\n}", "title": "" }, { "docid": "4bfc2df06fd5cddb681855548f9640c4", "score": "0.5841104", "text": "function padNum(binNum, len, value) {\n if (binNum.length >= len) return binNum;\n else return padNum(value + \"\" + binNum, len, value);\n}", "title": "" }, { "docid": "90839596e8124940d63de1071527ae50", "score": "0.5835247", "text": "function padZeroes(s) {\n return String(s).length === 1 ? `0${s}` : s\n}", "title": "" }, { "docid": "872041e9167dda16144e2c30ea49c045", "score": "0.58231443", "text": "function padZeros(num) {\n\twhile (num.length < numV)\n\t\tnum = \"0\" + num;\n\treturn num;\n}", "title": "" }, { "docid": "1f3039f8070197529fbc4e0410d4285d", "score": "0.5822671", "text": "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "title": "" }, { "docid": "0113bde74aa0ff50210805043ea2896b", "score": "0.5818682", "text": "function addbits(s){\n var total= 0, s= s.match(/[+\\-]*(\\.\\d+|\\d+(\\.\\d+)?)/g) || [];\n while(s.length){\n total+= parseFloat(s.shift());\n }\n return total;\n}", "title": "" }, { "docid": "0d21445c0b3f5af166e4b038b42a4513", "score": "0.5818495", "text": "function pad(n){\n if (('' + n).length == 1) return '0' + n;\n else return n;\n }", "title": "" }, { "docid": "d0a01cf7ae0b875887ac88793e0824f9", "score": "0.5813965", "text": "function binaryAddition2(a, b) {\n let carry = 0\n let res = \"\"\n\n while (a || b || carry) {\n //sum the unit digit\n let sum = +a.slice(-1) + +b.slice(-1) + carry\n\n if (sum > 1) {\n //update result string\n res = (sum % 2) + res\n carry = 1\n } else {\n res = sum + res\n carry = 0\n }\n\n //update string by removing last element\n a = a.slice(0, -1)\n b = b.slice(0, -1)\n }\n return res\n}", "title": "" }, { "docid": "cde5978dd65bf016932f2396e0c02c93", "score": "0.58132267", "text": "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else {if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else {e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "title": "" }, { "docid": "eec2fc42e631c88a90ee88401f5beabd", "score": "0.5809886", "text": "function zerofill(n) {\n n = n.toString();\n return \"0\".repeat(2 - n.length) + n;\n}", "title": "" }, { "docid": "0c01725f2352bbc7d9eec23fdc6bbe75", "score": "0.580833", "text": "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "title": "" }, { "docid": "0c01725f2352bbc7d9eec23fdc6bbe75", "score": "0.580833", "text": "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "title": "" }, { "docid": "0c01725f2352bbc7d9eec23fdc6bbe75", "score": "0.580833", "text": "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "title": "" }, { "docid": "0c01725f2352bbc7d9eec23fdc6bbe75", "score": "0.580833", "text": "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "title": "" }, { "docid": "c8caf8a00f5686b094d1b157d0d0ff80", "score": "0.58051646", "text": "function lbit(x) {\n if (x == 0) return -1;\n var r = 0;\n if ((x & 65535) == 0) {\n x >>= 16;\n r += 16;\n }\n if ((x & 255) == 0) {\n x >>= 8;\n r += 8;\n }\n if ((x & 15) == 0) {\n x >>= 4;\n r += 4;\n }\n if ((x & 3) == 0) {\n x >>= 2;\n r += 2;\n }\n if ((x & 1) == 0)++r;\n return r;\n}", "title": "" }, { "docid": "c2f965cf378e0274770e244f44e3b1b8", "score": "0.5800589", "text": "function addLeadingZero(n) {\r\n\t\t\tn = parseInt(n, 10);\r\n\t\t return (n < 10) ? (\"0\" + n) : n;\r\n\t\t}", "title": "" }, { "docid": "44656b0da071f7e8ad82f070e4f60c1e", "score": "0.58001995", "text": "function pad2(c) {\n\t return c.length == 1 ? '0' + c : '' + c;\n\t}", "title": "" }, { "docid": "44656b0da071f7e8ad82f070e4f60c1e", "score": "0.58001995", "text": "function pad2(c) {\n\t return c.length == 1 ? '0' + c : '' + c;\n\t}", "title": "" }, { "docid": "44656b0da071f7e8ad82f070e4f60c1e", "score": "0.58001995", "text": "function pad2(c) {\n\t return c.length == 1 ? '0' + c : '' + c;\n\t}", "title": "" }, { "docid": "7bf8b12432a0667ee4d2f6fd00acf4fe", "score": "0.57940644", "text": "function x24_r64(x) {\n \t\treturn rchr(x>>18) + rchr(x>>12) + rchr(x>>6) + rchr(x);\n \t}", "title": "" }, { "docid": "dbe539af9f84a6656315bfa995641b66", "score": "0.5793691", "text": "function padHex(A, l) {\n if (l % 8 !== 0) throw new Error('cannot convert bits into a whole number of bytes');\n return ensure0x(strip0x(A).padStart(l / 4, '0'));\n}", "title": "" }, { "docid": "476e3c0f900f2bc357e9265783657d63", "score": "0.57854086", "text": "function solutionNullify(bits) {\r\n if (bits) {\r\n var alterResult = '';\r\n var bitsLen = bits.length;\r\n for (var i = 0; i < bitsLen; i++) {\r\n var c = bits.charAt(i);\r\n if (c) {\r\n if (c === '1') {\r\n alterResult += c+'00';\r\n } else {\r\n alterResult += c;\r\n }\r\n }\r\n }\r\n return alterResult;\r\n }\r\n}", "title": "" }, { "docid": "eb2584611521a1d2691a135f619585a6", "score": "0.5780598", "text": "function to_zero_filled_hex (n) {\n\tconst t1 = (n >>> 0).toString(16);\n\treturn '00000000'.substr(0, 8 - t1.length) + t1;\n}", "title": "" }, { "docid": "8aaac42a0e11c83f5e00b7ca82acc415", "score": "0.5776943", "text": "function lbit(x) {\n\t\tif (x == 0) return -1;\n\t\tvar r = 0;\n\t\tif ((x & 0xffff) == 0) { x >>= 16; r += 16; }\n\t\tif ((x & 0xff) == 0) { x >>= 8; r += 8; }\n\t\tif ((x & 0xf) == 0) { x >>= 4; r += 4; }\n\t\tif ((x & 3) == 0) { x >>= 2; r += 2; }\n\t\tif ((x & 1) == 0) ++r;\n\t\treturn r;\n\t}", "title": "" }, { "docid": "b6689fc303843e71e6f4b560c20f512c", "score": "0.5774766", "text": "function fromBinary(val) {\n\tlet placeValue = 1;\n\tlet result = 0;\n\t// for (initializer;condition;increment) { body }\n\tfor (let i = 0; i < val.length; i++) {\n\t\tconst bit = val[val.length - 1 - i]\n\t\t\n\t\tif (bit === \"1\") {\n\t\t\tresult += placeValue;\n\t\t}\n\t\t\n\t\tplaceValue *= 2;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "775e6849f2c4a6b53840df1b0ad19d78", "score": "0.577303", "text": "function pad2(c) {\n\t return c.length == 1 ? \"0\" + c : \"\" + c;\n\t}", "title": "" }, { "docid": "e16176b8933db837b0ecbc231bdde661", "score": "0.57706946", "text": "function addLeadingZero(str) {\n return str.length < 2 ? `0${str}` : str\n}", "title": "" }, { "docid": "7079513ca05a3e7bdc1aa10c4cef867e", "score": "0.57656866", "text": "function test() {\n for (let i=0; i<=255; i++) {\n let byte = IntToByte(i);\n let renum = ByteToInt(byte);\n console.log(\"Value: \" + i + \" Binary: \" + byte + \" Recalc Value: \" + renum);\n } \n}", "title": "" }, { "docid": "64bba96a884643c868984b0e1a05d5f5", "score": "0.57654065", "text": "function zeroPad(nr,base){\n\t var len = (String(base).length - String(nr).length)+1;\n\t return len > 0? new Array(len).join('0')+nr : nr;\n\t}", "title": "" }, { "docid": "1621c9e91094be59e24ee0dfeadac1c9", "score": "0.5760703", "text": "function pad2(c) {\n return c.length === 1 ? '0' + c : String(c);\n }", "title": "" }, { "docid": "163193b0f5902f95a707a9479db7afd5", "score": "0.57604283", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n }", "title": "" }, { "docid": "163193b0f5902f95a707a9479db7afd5", "score": "0.57604283", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n }", "title": "" }, { "docid": "163193b0f5902f95a707a9479db7afd5", "score": "0.57604283", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n }", "title": "" }, { "docid": "163193b0f5902f95a707a9479db7afd5", "score": "0.57604283", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n }", "title": "" }, { "docid": "5b9eff3b8dceece1331271dc680f2005", "score": "0.57587427", "text": "function lbit(x) {\n\t if (x == 0) return -1\n\t var r = 0\n\t if ((x & 0xffff) == 0) {\n\t x >>= 16\n\t r += 16\n\t }\n\t if ((x & 0xff) == 0) {\n\t x >>= 8\n\t r += 8\n\t }\n\t if ((x & 0xf) == 0) {\n\t x >>= 4\n\t r += 4\n\t }\n\t if ((x & 3) == 0) {\n\t x >>= 2\n\t r += 2\n\t }\n\t if ((x & 1) == 0)++r\n\t return r\n\t}", "title": "" }, { "docid": "5b9eff3b8dceece1331271dc680f2005", "score": "0.57587427", "text": "function lbit(x) {\n\t if (x == 0) return -1\n\t var r = 0\n\t if ((x & 0xffff) == 0) {\n\t x >>= 16\n\t r += 16\n\t }\n\t if ((x & 0xff) == 0) {\n\t x >>= 8\n\t r += 8\n\t }\n\t if ((x & 0xf) == 0) {\n\t x >>= 4\n\t r += 4\n\t }\n\t if ((x & 3) == 0) {\n\t x >>= 2\n\t r += 2\n\t }\n\t if ((x & 1) == 0)++r\n\t return r\n\t}", "title": "" }, { "docid": "42616a38c9c3064fc3c65272fe256322", "score": "0.575725", "text": "function pad2(c) {\r\n return c.length == 1 ? '0' + c : '' + c;\r\n }", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "eceae31ac9d4cb235a25e4f0fadeddfe", "score": "0.5751169", "text": "function lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}", "title": "" }, { "docid": "6c4c3ddab8eb2f95cee9c2b6df311363", "score": "0.57489145", "text": "function addSpacesToBin(val) {\r\n\tvar newVal = val.charAt(0);\r\n\tfor (i = 1; i < 32; i++) {\r\n\t\tif (i % 4 == 0)\r\n\t\t\tnewVal += \" \";\r\n\t\tnewVal += val.charAt(i);\r\n\t}\r\n\treturn newVal;\r\n}", "title": "" }, { "docid": "93cfaacc86ca3c7cec73c98428c5a3ad", "score": "0.57474196", "text": "function lbit(x)\n{\n if (x == 0) return -1;\n var r = 0;\n if ((x & 0xffff) == 0)\n {\n x >>= 16;\n r += 16;\n }\n if ((x & 0xff) == 0)\n {\n x >>= 8;\n r += 8;\n }\n if ((x & 0xf) == 0)\n {\n x >>= 4;\n r += 4;\n }\n if ((x & 3) == 0)\n {\n x >>= 2;\n r += 2;\n }\n if ((x & 1) == 0)++r;\n return r;\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "26c425679df779b794cf48f0c1ea0d11", "score": "0.57470113", "text": "function lbit(x) {\n if (x == 0) return -1\n var r = 0\n if ((x & 0xffff) == 0) {\n x >>= 16\n r += 16\n }\n if ((x & 0xff) == 0) {\n x >>= 8\n r += 8\n }\n if ((x & 0xf) == 0) {\n x >>= 4\n r += 4\n }\n if ((x & 3) == 0) {\n x >>= 2\n r += 2\n }\n if ((x & 1) == 0)++r\n return r\n}", "title": "" }, { "docid": "11ff66f2c353665a0c492db5bde2c477", "score": "0.57447124", "text": "function beautifulBinaryString(b) {\n // Complete this function\n\n var changes = 0;\n\n while (b.indexOf(\"010\") !== -1) {\n //console.log(b, b.indexOf(\"010\"));\n b = b.replace(\"010\", \"011\");\n changes++;\n }\n\n return changes;\n}", "title": "" }, { "docid": "210d55ceb00020e9b708f4c732d09c66", "score": "0.5743223", "text": "function convertBits2(a, b) { \n return ((a ^ b).toString(2).match(/1/g) || []).length\n}", "title": "" }, { "docid": "7587310922dc34bb06d0fa899b387bda", "score": "0.5740629", "text": "function zeroPad (text, digits) {\r\n\ttext = text.toString();\r\n\twhile (text.length < digits) {\r\n\t\ttext = '0' + text;\r\n\t}\r\n\treturn text;\r\n} //End Add Zero's", "title": "" }, { "docid": "55e58679c18bae8a02d4f5e3563acd06", "score": "0.5736654", "text": "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "title": "" }, { "docid": "55e58679c18bae8a02d4f5e3563acd06", "score": "0.5736654", "text": "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "title": "" }, { "docid": "9748fda3410674b87f213a3d1a0a629f", "score": "0.5735579", "text": "function ZeroFill (number){\r\n var f_tamano= number.length;\r\n var Zsalida='';\r\n var diference=0;\r\n if (number=='0'){\r\n Zsalida='00000000';\r\n return Zsalida;\r\n } else if (f_tamano<8){\r\n diference=8-f_tamano;\r\n for( var i =0; i< diference; i++){\r\n Zsalida=Zsalida+'0';\r\n \r\n }\r\n }\r\n return Zsalida+number;\r\n }", "title": "" }, { "docid": "a4f40f2683dd8840c1b42430f325680c", "score": "0.57294524", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}", "title": "" }, { "docid": "a4f40f2683dd8840c1b42430f325680c", "score": "0.57294524", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}", "title": "" }, { "docid": "a4f40f2683dd8840c1b42430f325680c", "score": "0.57294524", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}", "title": "" }, { "docid": "a4f40f2683dd8840c1b42430f325680c", "score": "0.57294524", "text": "function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}", "title": "" } ]
a790c2fdda3be4849d6706f9aece4159
Get an existing BucketOwnershipControls resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
[ { "docid": "ddf95f4f45297126e9e415c7a5ce9e5a", "score": "0.77861595", "text": "static get(name, id, state, opts) {\n return new BucketOwnershipControls(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" } ]
[ { "docid": "4fc2d4764f3693bc5f9611a0502534d0", "score": "0.5615916", "text": "function GetBucketOwnershipControlsCommand(input) {\n var _this = // Start section: command_constructor\n _super.call(this) || this;\n\n _this.input = input;\n return _this; // End section: command_constructor\n }", "title": "" }, { "docid": "1d6344ea853da990eeeadeda3688d620", "score": "0.5216613", "text": "static get(name, id, state, opts) {\n return new RepositoryPermissionsPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "97765a55a5d5eaca0c14e55aa4d21253", "score": "0.50264484", "text": "function PutBucketOwnershipControlsCommand(input) {\n var _this = // Start section: command_constructor\n _super.call(this) || this;\n\n _this.input = input;\n return _this; // End section: command_constructor\n }", "title": "" }, { "docid": "5444ca33fa42414a50d4ce313ee613ea", "score": "0.50179857", "text": "function getBucketAccessControls() {\n var request = gapi.client.storage.bucketAccessControls.get({\n 'bucket': BUCKET,\n 'entity': GROUP\n });\n executeRequest(request, 'getBucketAccessControls');\n}", "title": "" }, { "docid": "a9b388f0582ffb71f7acb0681d305828", "score": "0.48134562", "text": "function getObjectAccessControls() {\n var request = gapi.client.storage.objectAccessControls.get({\n 'bucket': BUCKET,\n 'object': object,\n 'entity': GROUP\n });\n executeRequest(request, 'getObjectAccessControls');\n}", "title": "" }, { "docid": "7f1a546a3cf3bb4a9c63501cdba6fe98", "score": "0.4737851", "text": "static get(name, id, state, opts) {\n return new SecurityGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "d7f4ba19ee6f09a79f9a3c235e66c910", "score": "0.46294424", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnOriginAccessControlPropsFromCloudFormation(resourceProperties);\n const ret = new CfnOriginAccessControl(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "b4c20ba17822c917c3ffd904b39e81ab", "score": "0.46162584", "text": "function listBucketsAccessControls() {\n var request = gapi.client.storage.bucketAccessControls.list({\n 'bucket': BUCKET\n });\n executeRequest(request, 'listBucketsAccessControls');\n}", "title": "" }, { "docid": "f06482cfe5aa30d2dde4f5396f1fd1c7", "score": "0.46056038", "text": "static get(name, id, state, opts) {\n return new CustomDomainAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "03293e90aad1eec97d55535ecdcf20b9", "score": "0.45409292", "text": "static get(name, id, state, opts) {\n return new ConnectionAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "e89d3b6c66405dd2b6a7ff1dee13d4aa", "score": "0.4538753", "text": "static get(name, id, state, opts) {\n return new WebAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "84eaaeb2cd2d1c3b520c48c421443adb", "score": "0.44229132", "text": "getProperties(controlName) {\n if (this.cache[controlName]) {\n return this.cache[controlName];\n }\n\n // get available properties of the options object inside a Kendo control\n let options1 = this.getWidgetProperties(controlName);\n // get available properties of the pre-generated bindables.json file\n let options2 = bindables[controlName];\n\n if (!options2) {\n throw new Error(`${controlName} not found in generated bindables.js`);\n }\n\n // merge together without duplicates\n let keys = options1.concat(options2.filter(item => options1.indexOf(item) < 0));\n\n this.cache[controlName] = keys;\n\n return keys;\n }", "title": "" }, { "docid": "a2ce5d71b14872dccb5725fab04f2a41", "score": "0.43803987", "text": "static get(name, id, state, opts) {\n return new Zone(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f47de7df8abdcfc1be9fc16da06f28c9", "score": "0.43495443", "text": "static get(name, id, state, opts) {\n return new OrganizationConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "1fa088fff34286177517d5f3ab617439", "score": "0.43426406", "text": "getBucket(id) {\n return __awaiter$6(this, void 0, void 0, function* () {\n try {\n const data = yield get(this.fetch, `${this.url}/bucket/${id}`, { headers: this.headers });\n return { data, error: null };\n }\n catch (error) {\n if (isStorageError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n });\n }", "title": "" }, { "docid": "c06858497227492600fd794637071d15", "score": "0.42759356", "text": "function DeleteBucketOwnershipControlsCommand(input) {\n var _this = // Start section: command_constructor\n _super.call(this) || this;\n\n _this.input = input;\n return _this; // End section: command_constructor\n }", "title": "" }, { "docid": "65de231c090b79f1a6936f1fe6cf88cf", "score": "0.4218981", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnRepositoryPropsFromCloudFormation(resourceProperties);\n const ret = new CfnRepository(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "f6d3f85b0bafb45dfd1f8483ae36625e", "score": "0.4206908", "text": "function getRegion(args, opts) {\n args = args || {};\n if (!opts) {\n opts = {};\n }\n if (!opts.version) {\n opts.version = utilities.getVersion();\n }\n const promise = pulumi.runtime.invoke(\"aws:index/getRegion:getRegion\", {\n \"endpoint\": args.endpoint,\n \"name\": args.name,\n }, opts);\n return pulumi.utils.liftProperties(promise, opts);\n}", "title": "" }, { "docid": "64787f355d3b0095102cab980976f3b1", "score": "0.41527", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPublicRepositoryPropsFromCloudFormation(resourceProperties);\n const ret = new CfnPublicRepository(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "3bd2adc25482a2b413490765a9e5244f", "score": "0.41495702", "text": "static get(name, id, state) {\n return new Volume(name, state, { id });\n }", "title": "" }, { "docid": "9b5a3bf2dc405262254517f4f057eebd", "score": "0.41442424", "text": "function createFormControlState(id, value) {\n return {\n id: id,\n value: verifyFormControlValueIsValid(value),\n errors: {},\n pendingValidations: [],\n isValidationPending: false,\n isValid: true,\n isInvalid: false,\n isEnabled: true,\n isDisabled: false,\n isDirty: false,\n isPristine: true,\n isTouched: false,\n isUntouched: true,\n isSubmitted: false,\n isUnsubmitted: true,\n isFocused: false,\n isUnfocused: true,\n userDefinedProperties: {},\n };\n }", "title": "" }, { "docid": "2369ef14fcc047330176f641e4f06976", "score": "0.41203806", "text": "get(id, cb){\n //TODO make user check\n this.bucket.get(id, (err, data) => {\n cb(err, data.value);\n });\n }", "title": "" }, { "docid": "3a56b6ace087b82cfc1ee27e2324e1f0", "score": "0.41071475", "text": "function fromControls(controlName) {\n return function (target, propertyKey) {\n var _a;\n var ctor = target.constructor;\n ctor._ControlsValues = (_a = ctor._ControlsValues) !== null && _a !== void 0 ? _a : [];\n ctor._ControlsValues.push({\n propertyKey: propertyKey.toString(),\n controlName: controlName !== null && controlName !== void 0 ? controlName : propertyKey.toString(),\n });\n };\n}", "title": "" }, { "docid": "5164ca2b8018927f7281ea8daddc065c", "score": "0.41069847", "text": "function getOwnedProperties(id, playerName) {\n\tvar urlString = \"http://localhost:8080/getownedproperties?gameid=\" + id + \"&player=\" + playerName;\n\treturn $.ajax({\n \turl:`${urlString}`,\n \tasync: false,\n \tsuccess:function(data) {\n return data;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b661175ec85added2f0dc9491486f83f", "score": "0.40810043", "text": "static get(name, id, state, opts) {\n return new RolePolicyAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "cad2264a730bd91491d7bde0e8e0025c", "score": "0.40746006", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnObservabilityConfigurationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnObservabilityConfiguration(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "9c7065ed03b41de2a745f5a391c45a25", "score": "0.40713188", "text": "static get(name, id, state, opts) {\n return new SnapshotCopy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "0763977b8068777d27e1f1095d312419", "score": "0.40249848", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCloudFrontOriginAccessIdentityPropsFromCloudFormation(resourceProperties);\n const ret = new CfnCloudFrontOriginAccessIdentity(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "8f4511292d673fc34e6a2ec3728ab114", "score": "0.40064177", "text": "function listObjectsAccessControls() {\n var request = gapi.client.storage.objectAccessControls.list({\n 'bucket': BUCKET,\n 'object': object\n });\n executeRequest(request, 'listObjectsAccessControls');\n}", "title": "" }, { "docid": "1d8aefd3f68363b857a3faf30ca8cade", "score": "0.39916646", "text": "async function queryLatestComponentPolicyStatesAtResourceScope() {\n const subscriptionId =\n process.env[\"POLICYINSIGHTS_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const resourceId =\n \"subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName\";\n const componentPolicyStatesResource = \"latest\";\n const credential = new DefaultAzureCredential();\n const client = new PolicyInsightsClient(credential, subscriptionId);\n const result = await client.componentPolicyStates.listQueryResultsForResource(\n resourceId,\n componentPolicyStatesResource\n );\n console.log(result);\n}", "title": "" }, { "docid": "ff2ab29c4f638e01e3662f6db6ad71a6", "score": "0.39915237", "text": "function genesisStateById(id) {\n return genesisStates[genesisStates['names'][id]];\n}", "title": "" }, { "docid": "ff2ab29c4f638e01e3662f6db6ad71a6", "score": "0.39915237", "text": "function genesisStateById(id) {\n return genesisStates[genesisStates['names'][id]];\n}", "title": "" }, { "docid": "881244338e85df463230fd698590b889", "score": "0.39903054", "text": "async ReadAccount(ctx, id) {\n\t\tlet queryString = {}\n queryString.selector = {}\n\t\tqueryString.selector.docType = \"account\"\n\t\tqueryString.selector.accountID = id\n\t\tconst accountJSON = await this.QuerryAccount(ctx, JSON.stringify(queryString)); // get the asset from chaincode state\n\t\tif (!accountJSON || accountJSON.length === 0) {\n\t\t\tthrow new Error(`Account ${id} does not exist`);\n\t\t}\n\n\t\treturn JSON.parse(accountJSON);\n\t}", "title": "" }, { "docid": "b80614caa9397260149c6a7403a09e1d", "score": "0.39875507", "text": "function getChange(controlId) {\n var changes = self.personalData.changes;\n\n for (var i = 0; i < changes.length; i++) {\n var obj = changes[i];\n\n if (obj.id === controlId) {\n return obj;\n }\n }\n\n return null;\n }", "title": "" }, { "docid": "d48d54777e2925817a97e377544ee505", "score": "0.39842927", "text": "async function queryLatestComponentPolicyComplianceStateAtResourceScopeFilteredByGivenComponentId() {\n const subscriptionId =\n process.env[\"POLICYINSIGHTS_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const resourceId =\n \"subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName\";\n const componentPolicyStatesResource = \"latest\";\n const filter = \"componentId eq cert-RSA-cert-3\";\n const options = {\n filter,\n };\n const credential = new DefaultAzureCredential();\n const client = new PolicyInsightsClient(credential, subscriptionId);\n const result = await client.componentPolicyStates.listQueryResultsForResource(\n resourceId,\n componentPolicyStatesResource,\n options\n );\n console.log(result);\n}", "title": "" }, { "docid": "d9660f067793c8b29fe15e96a505b494", "score": "0.39810976", "text": "static get(name, id, opts) {\n return new NetworkSecurityGroup(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "3ec200d10b66a2509c7ceeaa0a4df1a4", "score": "0.39726397", "text": "function cfnOriginAccessControlPropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnOriginAccessControlPropsValidator(properties).assertSuccess();\n return {\n OriginAccessControlConfig: cfnOriginAccessControlOriginAccessControlConfigPropertyToCloudFormation(properties.originAccessControlConfig),\n };\n}", "title": "" }, { "docid": "71dccec9d53cf631b688707497062a0c", "score": "0.39625967", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnOriginAccessControl.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudfront_CfnOriginAccessControlProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnOriginAccessControl);\n }\n throw error;\n }\n cdk.requireProperty(props, 'originAccessControlConfig', this);\n this.attrId = cdk.Token.asString(this.getAtt('Id', cdk.ResolutionTypeHint.STRING));\n this.originAccessControlConfig = props.originAccessControlConfig;\n }", "title": "" }, { "docid": "424160aa278827d1f54f2c766f910b3e", "score": "0.39528883", "text": "static get(name, id, state, opts) {\n return new Service(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "e78b92657a729965ec8948b1255e1142", "score": "0.3945157", "text": "async getRawBypass (name) {\n var getObj = null;\n\n try {\n getObj = await this.getEp(name).get();\n } catch (err) {\n if (err.code !== 404) {\n log.error(`Failed to fetch latest \"${name}\" from k8s, error: \"${err}\". Will only use the cached values instead.`);\n }\n }\n\n if (getObj) {\n if (getObj.statusCode === 200) {\n const k8sObj = getObj.body;\n const cachedObj = this.objects[name];\n\n if (!cachedObj) {\n // we still haven't processed the \"ADDED\" event so add it now\n this._processEvent({\n type: 'ADDED',\n object: k8sObj\n });\n } else if (!k8sObj.metadata.generation || cachedObj.metadata.generation < k8sObj.metadata.generation) {\n // the object already exists so modify it\n this._processEvent({\n type: 'MODIFIED',\n object: k8sObj\n });\n }\n } else {\n const code = getObj.statusCode;\n log.error(`Failed to fetch latest \"${name}\" from k8s, code: \"${code}\". Will only use the cached values instead.`);\n }\n }\n\n return this.getRaw(name);\n }", "title": "" }, { "docid": "f3721aa9a0a32458a5b5abe207b45060", "score": "0.39387906", "text": "async readNamespacedPersistentVolumeClaimStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }", "title": "" }, { "docid": "d0cd14712006f8469a61cc6ff5e78c6b", "score": "0.39329645", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnOriginRequestPolicyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnOriginRequestPolicy(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "93bd79628069d741dd4417d34fcce0ba", "score": "0.3929144", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCachePolicyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnCachePolicy(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "56ecef8f44d291d55723dfbdf2df7907", "score": "0.39086387", "text": "async getOrCreateBucket(auth, bucketName){\n const buckets = Buckets.withUserAuth(auth);\n const {root, threadID} = await buckets.getOrCreate(bucketName);\n if (!root) throw Error(\"Bucket has not been created\");\n const bucketKey = root.key;\n return {buckets, bucketKey};\n }", "title": "" }, { "docid": "b0335861c4766701ce0e0dca68eb2309", "score": "0.38866574", "text": "function getContainer (action, id) {\n if (action === 'create') {\n return $qExtensions.booleanAsPromise(true);\n } else {\n return zun.getContainer(id).then(onGetContainer);\n }\n }", "title": "" }, { "docid": "8fad7b6275cd1e6808a43658259f088a", "score": "0.38807616", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnKeyGroupPropsFromCloudFormation(resourceProperties);\n const ret = new CfnKeyGroup(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "7bd18c64e09f8014c836f2fcbcd5c207", "score": "0.3878232", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnEventBusPolicyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnEventBusPolicy(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "585eef804c0089a798bf25bc30179463", "score": "0.38779646", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnDataRepositoryAssociationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnDataRepositoryAssociation(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "87c958b181791654f22c32300e9f0055", "score": "0.38698843", "text": "function getCardFromId(id) {\n\n var cardTypeShortcode = id.substr(0, 3);\n\n // Card IDs are prefixed with card type shortcodes for ease of search\n var cardTypes = { 'BLA': 'black_cards',\n 'BLU': 'blue_cards',\n 'RED': 'red_cards',\n 'GRE': 'green_cards',\n 'ORA': 'orange_cards'\n };\n\n var type = cardTypes[cardTypeShortcode];\n var cardsArr = CARDS_LIBRARY[type]['cards']; // static library\n var cardsProperties = CARDS_LIBRARY[type]['properties'];\n\n // Search in the right card group\n for (card in cardsArr) {\n var card = cardsArr[card];\n\n // is there a better way to do this?\n card.properties = cardsProperties;\n\n if (card.id == id) {\n return card;\n }\n }\n}", "title": "" }, { "docid": "1da4a1a29dfe079b92d3f5be9323b65d", "score": "0.3859136", "text": "static get(name, id, opts) {\n return new ServiceEndpointPolicy(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f5126b3c9bf57c3d9f6f981dd17d9433", "score": "0.385687", "text": "function retrieve(id) {\n return state[id];\n }", "title": "" }, { "docid": "445bc56814ba466066210c2b97564773", "score": "0.38553676", "text": "static get(name, id, opts) {\n return new Volume(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "3fba481de1e06e52588bcd83550afdd5", "score": "0.38279733", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnRegistryPolicyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnRegistryPolicy(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "3fba481de1e06e52588bcd83550afdd5", "score": "0.38279733", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnRegistryPolicyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnRegistryPolicy(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "ef57540c927a50b8ae3dc3d1382af057", "score": "0.38251078", "text": "async function stateDiscriminator(name) {\n // @ts-ignore\n return Buffer.from(sha256.digest(`account:${name}`)).slice(0, 8);\n}", "title": "" }, { "docid": "08f7d4f74120093e5eecff44d4793a6b", "score": "0.3820211", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnEndpointAccessPropsFromCloudFormation(resourceProperties);\n const ret = new CfnEndpointAccess(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "1348c60e66be801b906bbcb0dc81fd02", "score": "0.38170993", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnInstanceAccessControlAttributeConfigurationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnInstanceAccessControlAttributeConfiguration(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "05c3b4ee5452f277bf9af1b717a49059", "score": "0.3816684", "text": "static get(name, id, state, opts) {\n return new UsagePlanKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "d0deed3f66773f5b0e1475d23e0cfb18", "score": "0.3806605", "text": "async ReadAsset(ctx, id) {\n\t\tconst assetJSON = await ctx.stub.getState(id); // get the asset from chaincode state\n\t\tif (!assetJSON || assetJSON.length === 0) {\n\t\t\tthrow new Error(`Asset ${id} does not exist`);\n\t\t}\n\n\t\treturn assetJSON.toString();\n\t}", "title": "" }, { "docid": "c4e91036c41324794ea3fb4875e37630", "score": "0.38057253", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPermissionsPropsFromCloudFormation(resourceProperties);\n const ret = new CfnPermissions(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "bdcd869defcf8189f508750314118caf", "score": "0.3804636", "text": "function cfnDataRepositoryAssociationS3PropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDataRepositoryAssociation_S3PropertyValidator(properties).assertSuccess();\n return {\n AutoExportPolicy: cfnDataRepositoryAssociationAutoExportPolicyPropertyToCloudFormation(properties.autoExportPolicy),\n AutoImportPolicy: cfnDataRepositoryAssociationAutoImportPolicyPropertyToCloudFormation(properties.autoImportPolicy),\n };\n}", "title": "" }, { "docid": "ac467cdbbb6a86f7fb31df1453b55f2c", "score": "0.38015875", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnResourcePropsFromCloudFormation(resourceProperties);\n const ret = new CfnResource(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "f33d8c769abb1d0e01eb974c32e1cd9b", "score": "0.37787786", "text": "constructor(scope, id, props = {}) {\n super(scope, id, { type: CfnRepository.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_ecr_CfnRepositoryProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnRepository);\n }\n throw error;\n }\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrRepositoryUri = cdk.Token.asString(this.getAtt('RepositoryUri', cdk.ResolutionTypeHint.STRING));\n this.encryptionConfiguration = props.encryptionConfiguration;\n this.imageScanningConfiguration = props.imageScanningConfiguration;\n this.imageTagMutability = props.imageTagMutability;\n this.lifecyclePolicy = props.lifecyclePolicy;\n this.repositoryName = props.repositoryName;\n this.repositoryPolicyText = props.repositoryPolicyText;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::ECR::Repository\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "f7c1859beca91c04a31f6013e129e283", "score": "0.37673286", "text": "static get(name, id, state, opts) {\n return new ConformancePack(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "48384744683f4e2a7d691994ebdb244f", "score": "0.3762369", "text": "function cfnOriginAccessControlOriginAccessControlConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnOriginAccessControl_OriginAccessControlConfigPropertyValidator(properties).assertSuccess();\n return {\n Description: cdk.stringToCloudFormation(properties.description),\n Name: cdk.stringToCloudFormation(properties.name),\n OriginAccessControlOriginType: cdk.stringToCloudFormation(properties.originAccessControlOriginType),\n SigningBehavior: cdk.stringToCloudFormation(properties.signingBehavior),\n SigningProtocol: cdk.stringToCloudFormation(properties.signingProtocol),\n };\n}", "title": "" }, { "docid": "b15a3224f33eb10d2c9678d5135ef091", "score": "0.3762349", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPullThroughCacheRulePropsFromCloudFormation(resourceProperties);\n const ret = new CfnPullThroughCacheRule(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "1db4187027c3d725e873e24855129b15", "score": "0.3758646", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPrincipalPermissionsPropsFromCloudFormation(resourceProperties);\n const ret = new CfnPrincipalPermissions(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "079fe5dae4a77ea32b196e4b824b6dc7", "score": "0.37559307", "text": "async GetOneAccessory(id) {\n\n\n return await Accessorio.findById(id);\n }", "title": "" }, { "docid": "d9b402f7c42d9a07d606d97c3cd86069", "score": "0.37546864", "text": "getByControlId(id) {\n return WebPartDefinition(this, `getByControlId('${id}')`);\n }", "title": "" }, { "docid": "d3d085e3241ff89dd46e50edd7bc71bd", "score": "0.37430015", "text": "function publicReadPolicyForBucket(bucketName) {\n return JSON.stringify({\n Version: '2012-10-17',\n Statement: [\n {\n Effect: 'Allow',\n Principal: '*',\n Action: ['s3:GetObject'],\n Resource: [\n `arn:aws:s3:::${bucketName}/*`, // policy refers to bucket name explicitly\n ],\n },\n ],\n })\n}", "title": "" }, { "docid": "459e366ba7ab9c4295b030f919fd8293", "score": "0.37421617", "text": "async readNamespacedReplicationControllerStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }", "title": "" }, { "docid": "3730bfa777c687a521d57297e55c72fb", "score": "0.37414858", "text": "async function queryLatestComponentPolicyStatesAtNestedResourceScope() {\n const subscriptionId =\n process.env[\"POLICYINSIGHTS_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const resourceId =\n \"subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVault\";\n const componentPolicyStatesResource = \"latest\";\n const credential = new DefaultAzureCredential();\n const client = new PolicyInsightsClient(credential, subscriptionId);\n const result = await client.componentPolicyStates.listQueryResultsForResource(\n resourceId,\n componentPolicyStatesResource\n );\n console.log(result);\n}", "title": "" }, { "docid": "9c1695ac27c114995e27c15262538951", "score": "0.37390807", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnResponseHeadersPolicyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnResponseHeadersPolicy(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "fc20d3678718d77937965881740ce4c3", "score": "0.3736559", "text": "static get(name, id, state, opts) {\n return new Pipeline(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "d36dedfcc7ab5b7cdbb682165d6f6495", "score": "0.37223247", "text": "getAlbumByName(state, name) {\n return state.photos.albums.find(item => item.name === name)\n }", "title": "" }, { "docid": "5166e9d7cf6c57da6dda3754157d6b03", "score": "0.37216762", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnEndpointAuthorizationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnEndpointAuthorization(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "b6e7235c33b4419aeac825342c769a9a", "score": "0.37185475", "text": "async readNamespacedPersistentVolumeClaim(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }", "title": "" }, { "docid": "289fd0a96de01582687363641e8d501f", "score": "0.3711104", "text": "selectOwnershipType(id) {\n\t\tconst stmt = this.db.prepare(`SELECT * FROM PG1_OWNERSHIP_TYPE\n\tWHERE ownership_type_id = ?`);\n\t\tconst select = this.db.transaction((id)=>{\n\t\t\treturn stmt.get(id)\n\t\t});\n\n\t\tconst row = select(id);\n\t\tlet ownershipType = new OwnershipType();\n\n\t\tif (row){\n\t\t\tlet ownershipType = new OwnershipType(\n\t\t\t\trow.ownership_type_id,\n\t\t\t\trow.ownership_type_description\n\t\t\t)\n\t\t\treturn ownershipType;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "975f6e5a0796cc89a1e74e1554236032", "score": "0.37044185", "text": "async readNamespacedReplicationController(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }", "title": "" }, { "docid": "fae0142322bd6c41a89814b85ddc6d36", "score": "0.36987448", "text": "__findState(name) {\n return this._states.find(state => state['name'] === name);\n }", "title": "" }, { "docid": "4d14725e3d6df7c61ff74b550e31ee2d", "score": "0.36970526", "text": "static get(name, id, state, opts) {\n return new RestApi(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "36d3003352e46ed0f4dc73fd963d67b9", "score": "0.3689937", "text": "static get(name, id, state, opts) {\n return new Queue(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "539f4e36dfdc3c30d8a8638a2681cd60", "score": "0.36858076", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnRegistryPropsFromCloudFormation(resourceProperties);\n const ret = new CfnRegistry(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "e3b65452e75aa43df0932f91ec7fc0b8", "score": "0.36800286", "text": "static get(name, id, opts) {\n return new BatchAccount(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "69d9e31227ceca9a5762b14d7562e1af", "score": "0.36761203", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnKeySigningKeyPropsFromCloudFormation(resourceProperties);\n const ret = new CfnKeySigningKey(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "37a102770fdaaa39ca977c36c56d892f", "score": "0.36692813", "text": "async ReadAsset(ctx, id) {\n const assetJSON = await ctx.stub.getState(id); // get the asset from chaincode state\n if (!assetJSON || assetJSON.length === 0) {\n throw new Error(`The asset ${id} does not exist`);\n }\n return assetJSON.toString();\n }", "title": "" }, { "docid": "37a102770fdaaa39ca977c36c56d892f", "score": "0.36692813", "text": "async ReadAsset(ctx, id) {\n const assetJSON = await ctx.stub.getState(id); // get the asset from chaincode state\n if (!assetJSON || assetJSON.length === 0) {\n throw new Error(`The asset ${id} does not exist`);\n }\n return assetJSON.toString();\n }", "title": "" }, { "docid": "d9aca107d3fe40acf8e72a6fbc9b4f47", "score": "0.36652", "text": "static get(name, id, state, opts) {\n return new VpcEndpointService(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "c90051340de35eb9ea7678c6bb238aa6", "score": "0.36618197", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnVolumePropsFromCloudFormation(resourceProperties);\n const ret = new CfnVolume(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "a253f74926468506d48000003e7181ed", "score": "0.36588535", "text": "static get(name, id, state, opts) {\n return new CertificateValidation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "e40d9ed51402bc5684d7cb00958d4377", "score": "0.36556396", "text": "function cfnLifecyclePolicyCrossRegionCopyActionPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnLifecyclePolicy_CrossRegionCopyActionPropertyValidator(properties).assertSuccess();\n return {\n EncryptionConfiguration: cfnLifecyclePolicyEncryptionConfigurationPropertyToCloudFormation(properties.encryptionConfiguration),\n RetainRule: cfnLifecyclePolicyCrossRegionCopyRetainRulePropertyToCloudFormation(properties.retainRule),\n Target: cdk.stringToCloudFormation(properties.target),\n };\n}", "title": "" }, { "docid": "1aa953424435cb2dfcbc850dc32962e9", "score": "0.36532974", "text": "getControlContainer(type) {\n if (this._controls[type]) {\n return this._controls[type]._container\n }\n }", "title": "" }, { "docid": "142cf60915fc7465c7f538db149c055e", "score": "0.36465296", "text": "async lookup(name: string): Promise<{|accountID: string, username: string|}> {\n await this._guardInitialized()\n const options = {name}\n const res = await this._runApiCommand({apiName: 'wallet', method: 'lookup', options})\n if (!res) {\n throw new Error('Keybase wallet lookup returned nothing.')\n }\n return res\n }", "title": "" }, { "docid": "f2a224e781dc92b97ba9b6dddac8f4ba", "score": "0.36421636", "text": "function read(id) {\n return wvy.api.read(id);\n }", "title": "" }, { "docid": "1d20078aebd1bdb6e85951e73aeee06c", "score": "0.36357206", "text": "function findResourceId(id) {\n return knex('resources')\n .select('*')\n .where({id})\n .limit(1)\n .then(([resource]) => resource);\n }", "title": "" }, { "docid": "447777298f28f9c93fa5b10e6fde2cf4", "score": "0.36334357", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnVpcConnectorPropsFromCloudFormation(resourceProperties);\n const ret = new CfnVpcConnector(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "5fa483a74f5efc4b619ffb7872a1959c", "score": "0.3628418", "text": "getById(id) {\n return tag.configure(UserCustomAction(this).concat(`('${id}')`), \"ucas.getById\");\n }", "title": "" }, { "docid": "437ddc62f18fc06374c479218a7e9524", "score": "0.36273864", "text": "function getCountry(id) {\n\n return instance.get(`/Countries/${id}`)\n .then(function (response) {\n return (response);\n })\n .catch(function (error) {\n return (error);\n });\n\n }", "title": "" }, { "docid": "a126b07129ab23467940eb4cf1a07ed7", "score": "0.36204097", "text": "function getRegionById(id) {\n return _.find(RegionData, {\"LA_id\": id});\n }", "title": "" }, { "docid": "91c7b5f11594021398957e1612f023da", "score": "0.3615716", "text": "function GetBucketPolicyCommand(input) {\n var _this = // Start section: command_constructor\n _super.call(this) || this;\n\n _this.input = input;\n return _this; // End section: command_constructor\n }", "title": "" } ]
00659233028e89b5d75da6a323c90069
Example For inputString = "aabb", the output should be palindromeRearranging(inputString) = true. We can rearrange "aabb" to make "abba", which is a palindrome.
[ { "docid": "0d8ef7f473e2acf8b0b62f2cf55a726c", "score": "0.8188193", "text": "function palindromeRearranging(inputString) {\n const map = {};\n for (let i = 0; i < inputString.length; i++) {\n if (map[inputString[i]] === undefined) {\n map[inputString[i]] = 1;\n continue;\n }\n if (map[inputString[i]]) {\n map[inputString[i]]++;\n continue;\n }\n }\n //if odd\n if (inputString.length % 2) {\n let odd = 0;\n for (const key in map) {\n if (map[key] % 2) {\n odd++;\n }\n }\n if (odd > 1) return false;\n }\n //if even\n else {\n for (const key in map) {\n if (map[key] % 2) return false;\n }\n }\n return true;\n}", "title": "" } ]
[ { "docid": "9737709364c5acebb7a675365f0f4820", "score": "0.792077", "text": "function palindromeRearranging(inputString) {\n // create object\n // count number of characters\n // if inputstring is even - even number of strings\n // if inputstring is odd - also even Except one character\n // except if string has only one character - applies to both cases\n // if neither of this cases, return false\n \n const obj = {};\n const length = inputString.length;\n const isOdd = length % 2 !== 0;\n let notEvenCount = 0;\n \n for (let i = 0; i < length; i++) {\n const current = inputString[i];\n if (obj[current]) {\n obj[current] += 1;\n } else {\n obj[current] = 1;\n }\n if (obj[current] === length) return true;\n }\n \n let oneKey = {\n key: null,\n falsy: null\n }\n \n Object.entries(obj).forEach( ([key, val]) => { \n if (val % 2 !== 0) {\n if (oneKey.key === null || oneKey.key === key) {\n notEvenCount++;\n oneKey.key = key;\n } else {\n oneKey.falsy = true;\n }\n }\n })\n \n if (oneKey.falsy) return false\n \n \n return isOdd ? (notEvenCount % 2 === 1 ? true : false) \n : (notEvenCount >= 1 ? false : true)\n}", "title": "" }, { "docid": "bf64908131949df6a1d36d916496ac66", "score": "0.76212275", "text": "function palindrome(input){\n\t\tvar str = String(input),\n\t\t\t\t i = 0,\n\t\t\t\t j = str.length -1;\n\n\t\twhile(str[i] === str[j] ){\n\t\t\tif((i === j) || (i > j) ){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ti+=1;\n\t\t\tj-=1;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "3bc585602f0f4026994271c25db30a8b", "score": "0.7561623", "text": "function checkPalindrome(inputString) {\n \n var str = inputString;\n \n var str_split = str.split(\"\");\n \n var str_reverse = str_split.reverse(\"\");\n \n var str_join = str_reverse.join(\"\");\n \n var new_str = str_join;\n \n if(str == new_str){\n \n return true;\n \n } else {\n \n return false;\n }\n\n}", "title": "" }, { "docid": "5216d12d5e1b67c0a0205c9102c95829", "score": "0.741223", "text": "function palindrome(str) {\n const arr = [];\n //adds elements reversedto the beginning of an array use Spread syntax \n [...str].forEach((e) => arr.unshift(e));\n //checking given string with reversed string\n if (str === arr.join('')) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "3a635689ba0a2da50a39441544c1ea60", "score": "0.73979264", "text": "function checkIsPalindrome(inputString) {\n const splitString = inputString.split(\"\");\n const reverseArray = splitString.reverse();\n const reversedString = reverseArray.join(\"\");\n\n if (reversedString !== inputString) {\n return \"No\";\n } else {\n return \"Yes\";\n }\n}", "title": "" }, { "docid": "ff8f3b397421f46808a5fae33dd55baa", "score": "0.7380157", "text": "function checkPalindrome(inputString) {\n\tlet reverse = inputString.split(\"\").reverse().join(\"\");\n\tif (reverse === inputString) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "98efc92e5ac8b952ae4676c8726a4589", "score": "0.73734224", "text": "function palindrome(string) {}", "title": "" }, { "docid": "a55cb8a0c422483146d4170bd77d7e2a", "score": "0.7366599", "text": "function isPalindrome(sampleString) {\n return sampleString.split('').reverse().join('') == sampleString;\n\n}", "title": "" }, { "docid": "b23ea54d14199f6ae2feae4ed85dbc38", "score": "0.73575395", "text": "function palindrome(string){\n let word = string.toString();\n let placeholder = [];\n let reverseWord = '';\n for(let i = 0; i < word.length; i++){\n placeholder.unshift(word[i]);\n }\n reverseWord = placeholder.join('');\n if(word == reverseWord){\n return true;\n }\n else{\n return false;\n }\n}", "title": "" }, { "docid": "74a16d8b7eefe5a7c17a11cd82ce936a", "score": "0.7355689", "text": "function palindrome(string) {\n if (string.length <= 1) return true;\n\n if (string[0] === string[string.length - 1]) return palindrome(string.slice(1, string.length - 1));\n return false;\n}", "title": "" }, { "docid": "d5a9f5e27a4041b5a20ee0762e7727e8", "score": "0.7316565", "text": "function palindrome(string) {\n let processedContent = string.toLowerCase();\n return processedContent === reverse(processedContent);\n}", "title": "" }, { "docid": "5ab10549d664d7ab3d2456cba9b995ad", "score": "0.7279618", "text": "function palindrome2(str){\n return str == str.split('').reverse().join('') ? true : false\n}", "title": "" }, { "docid": "614f1566470967df1fe661de3c73d1c7", "score": "0.7234736", "text": "function isPalindrome(string){\n // Outer variable to reverse string\n var reversed = \"\"; \n \n // Helper function that reverses our string \n function reverse(string){\n // Go through the length of the string, starting at the last letter, until the first \n for (let i = string.length - 1; i >= 0; i--) {\n // Add each letter in reverse order to the empty string\n reversed = reversed + string[i];\n }\n }\n \n // Call the helper function \n reverse(string);\n \n // Check if the reversed is the same as the original \n if (reversed === string) {\n // If yes, return true\n return true; \n }\n \n // If different, return false \n return false; \n }", "title": "" }, { "docid": "bb0f9e1fe755a6e70564fcfa466c9983", "score": "0.72240186", "text": "function palindrome2(str) {\r\n // we define variables for first and last letters\r\n let first = 0,\r\n last = str.length - 1;\r\n // we use while to go over all letters when the index of last letters is bigger than the index of the first letter\r\n while (last > first) {\r\n if (str[first].toLowerCase() !== str[last].toLowerCase()) return false;\r\n first++;\r\n last--;\r\n }\r\n // 4\r\n return true;\r\n}", "title": "" }, { "docid": "916f1f9f51c9c9114f02256977d74414", "score": "0.72045964", "text": "function palindrome(str){\n const rev = str.split('').reverse().join('');\n\n return str === rev;\n}", "title": "" }, { "docid": "8d3fc91f74c6a1b3863e24cd88e155a6", "score": "0.7199151", "text": "function palindrome(str){\n \tconst reversed = str.split('').reverse().join('');\n \treturn str === reversed;\n}", "title": "" }, { "docid": "6e5629736ec3e811270626ea0d27c3a7", "score": "0.71948767", "text": "function palindrome(string) {\n var reverseString = string.split(\"\").reverse().join(\"\");\n return string === reverseString;\n}", "title": "" }, { "docid": "581bca331ea8997743f9f7d58d3058e7", "score": "0.7180779", "text": "function is_palindrome(string) {\n\tstring = string.toLowerCase().replace(/[^a-z]/g, \"\");\n\treturn string.split(\"\").reverse().join(\"\") === string;\n}", "title": "" }, { "docid": "3fd7c059b977fba2a64572450ffa754a", "score": "0.7178926", "text": "function Palindrome(str) {\n\n var forwards = str.split(' ').join('').split('');\n var backwards = [];\n for (var i = 0; i < forwards.length; i++) {\n backwards.unshift(forwards[i]);\n }\n\n return backwards.join('') === forwards.join('');\n}", "title": "" }, { "docid": "fd795ca2e74a0043393b8d3bac8cba9a", "score": "0.7168021", "text": "function palindrome(str){\n \tlet len = Math.floor(str.length/2);\n \tfor(i = 0; i < len; i++){\n \t\tif(str.charAt(i) !== str.charAt(str.length - 1 - i)){\n \t\t\treturn false;\n \t\t}\n \t}\n \treturn true;\n}", "title": "" }, { "docid": "5e110558cae77dfc7a56d2d37d0e2db8", "score": "0.716742", "text": "function palindrome(str) {\n str = str.replace(/[^a-z0-9]+/gi, \"\");\n str = str.toLowerCase();\n var newStr = str.split(\" \" && \"\");\n var revStr = newStr.reverse();\n newStr = revStr.join(\"\");\n \nif(newStr === str) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "084c1f190b2f829c995dde4bc0380f5a", "score": "0.7165649", "text": "function palindrome(string) {\n for (let i = 0, j = string.length - 1; i < j; ++i, --j) {\n if (string[i] !== string[j]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "b6d366454f4e8dc67d515631e62699aa", "score": "0.7164405", "text": "function palindrome(str) {\n // Good luck!\n let regex = /[A-Za-z0-9]/gi;\n let string = str.match(regex);\n let lower = string.join('').toLowerCase();\n\n return lower.toLowerCase() == lower.split('').reverse().join('') ? true : false;\n}", "title": "" }, { "docid": "8121b7bc7e4a44ab4c1b753a1646ba53", "score": "0.7149924", "text": "function isPalindrome(string){\n let array = string.split('');\n let reversedArray = array.reverse();\n let reversed = reversedArray.join('');\n \n if (reversed === string){\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "865c2006a7cc1a7b1e0795cf81547129", "score": "0.714326", "text": "function palindrome(str) {\n // Good luck!\n let strvd, arr;\n let nonAlphNum = /[^a-z0-9]/gi;\n str = str.replace(nonAlphNum, \"\").toLowerCase(); \n arr = str.split(\"\");\n // reverse and convert back to string.\n strvd = arr.reverse().reduce(function(prev, curr) {\n return strvd = prev + curr;\n });\n return str === strvd ? true : false;\n}", "title": "" }, { "docid": "2a667b389eb8276b0e43b46abcc0c23e", "score": "0.7140464", "text": "function palindrome(str) {\n str = str.toLowerCase().replace((/\\W+|_/g), '');\n let strArr = [];\n let reversedArr = [];\n str.split(' ').forEach(e => {\n strArr.push(e);\n reversedArr.push(e.split('').reverse().join(''));\n });\n return strArr.join('') == reversedArr.reverse().join('');\n}", "title": "" }, { "docid": "df14a3badf224f868c9969473896a372", "score": "0.71361893", "text": "function isPal(string) {\n//creating array by method split\n var newString = string.split(\" \");\n //joining items of array by method join\n newString = newString.join(\"\");\n //transforming new string to lower case for comparison characters\n newString = newString.toLowerCase();\n //defining variable result and assigning it value \"palindrome\"\n var result = \"palindrome\";\n //condition for strings with odd length of string\n if (newString.length % 2 > 0) {\n //loop for comparison characters, index i starts from 0(1st character of string),\n //index j starts from length-1 (last character of string)\n for (var i = 0, j = newString.length - 1; i < Math.ceil(newString.length / 2), j > Math.floor(newString.length / 2); i++, j--) {\n //if at list 1 pair of characters doesn't match, result becomes \"not palindrome\"\n //and loop must be finished\n if (newString[i] != newString[j]) {\n result = \"not palindrome\";\n break;\n }\n }\n //condition for string with even length of string\n } else {\n //loop for comparison characters, index i starts from 0(1st character of string),\n //index j starts from length-1 (last character of string)\n for (var i = 0, j = newString.length; i < newString.length, j > newString.length; i++, j--) {\n //if at list 1 pair of characters doesn't match, result becomes \"not palindrome\"\n //and loop must be finished\n if (newString[i] != newString[j]) {\n result = \"not palindrome\";\n break;\n }\n }\n }\n //returning result\n return result;\n}", "title": "" }, { "docid": "fc454aeba9df19d0d4c4aca5aa10ce09", "score": "0.71357054", "text": "function palindrome(string) {\n \n /* Criando uma string e atribuindo a ela a string passada por parâmetro \n porém sem nenhum caracter non-alphanumeric e toda lowerCase. */\n \n var newString = string.replace(/[^A-Za-z0-9]+/g, \"\").toLowerCase();\n \n /* Atribuindo a nova string totalmente lowerCase e sem qualquer \n caracter non-alphanumeric à velha string passada por parâmetro. */\n \n string = newString;\n \n /* Criando um array e passando cada caracter da string para uma posição do array (na sequência em que a string foi passada) ou seja:\n arrayOfNewString = [\"e\", \"y\", \"e\",]; */\n \n var arrayOfNewString = newString.split(\"\");\n \n /* Tornando o array ao contrário (de trás pra frente). */\n \n arrayOfNewString.reverse();\n \n /* Atribuindo o array invertido à nova string criada anteriormente. */\n \n newString = arrayOfNewString.join(\"\");\n \n /* Verificando se as duas strings (string e newString) são iguais, se forem,\n isso significa que o reverso de uma é igual ao normal da outra, ou seja: UM PALÍNDROMO */\n \n if (string == newString) {\n return true;\n } else {\n return false;\n }\n \n}", "title": "" }, { "docid": "d8dfc0b157b2bcd556b702e1bd775f07", "score": "0.7132887", "text": "function palindrom(str) {\n for (let i = 0; i < str.length / 2; i++) {\n if (str[i] != str[str.length - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "072b0aaa673eb88cb34ee30b6ef040a5", "score": "0.71318966", "text": "function palindrome(testString) {\n\ttestString = input.value;\n\tvar paliString = testString.split(\"\").reverse().join(\"\");\n\tif (paliString === testString) {\n\t\tpal.innerHTML = \"Your string is a palindrome\";\n\t} else pal.innerHTML = \"Your string is not a palindrome\";\n}", "title": "" }, { "docid": "69c161245548643532e9b5a593151005", "score": "0.71316546", "text": "function isPalindrome (inStr){\n inStr = inStr.toLowerCase();\n for(let i = 0; i < inStr.length; i++){\n if(inStr[i] !== inStr[inStr.length -1 - i ]){\n // return inStr === inStr.reverse(); but reverse is not a string method, so:\n\n //return inStr === inStr.split(\"\").reverse().join(); \n //better still:\n return (false);\n }\n }\n return (\"palindrome found\")\n}", "title": "" }, { "docid": "fc42b34d861ff1d9c400587625fcdd0d", "score": "0.712445", "text": "function isPalindromeViaReversal(str) {\n str = str.replace(/[\\W_]/g, '').toLowerCase();\n return (str == str.split('').reverse().join(''));\n}", "title": "" }, { "docid": "b3b5bd80e6e624ab665ac6848c83b494", "score": "0.7121795", "text": "function isPalindrome(str) {\n // Method #1\n // let arrayValues = string.split('')\n // let reverseArray = arrayValues.reverse()\n // let reverseString = reverseArray.join('')\n\n // if (str == reverseString) {\n // console.log('is a palindrome')\n // }\n // else { console.log('it is not a palindrome') }\n\n // Method #2\n // return str == str.split('').reverse().join('')\n\n // Method #3\n for (let i = 0; i < Math.floor(str.length / 2); i++) {\n let charStart = str[i]\n let charEnd = str[str.length - 1 - i]\n if (charStart !== charEnd) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "8d74c91d6514830ef229e0a0d3c64e35", "score": "0.708569", "text": "function isPalindrome(str) {\n\n function flip(str, posn = 0, endPosn = 0) {\n if (posn >= endPosn) return \"\";\n\n return flip(str, (posn + 1), endPosn) + str[posn];\n }\n\n // The thinking is for a palindrome, you only need to flip the first half of the string.\n // Take the first half of the string + any 'middle' letter + flipped first half\n // str.slice(0,endPosn) + any 'middle' letter + flip(str, 0, endPosn)\n // any 'middle' letter exists for strings with an odd number of letters:\n // (midPosn === endPosn ? \"\" : str.slice(midPosn, midPosn+1))\n // When midPosn === endPosn, we have a string with an even number so the middle is \"\"\n // When midPosn != endPosn, we have a middle letter, use str.slice(midPosn, midPosn+1)\n // to get it.\n // endPosn is calculated everytime flip runs. Instead, calculate it once and pass it in.\n // Might as well keep str.length / 2 since we can use it to quickly check even or odd string.\n let midPosn = str.length / 2;\n let endPosn = Math.floor(midPosn);\n if ((str.slice(0, endPosn) + (midPosn === endPosn ? \"\" : str.slice(midPosn, midPosn + 1)) + flip(str, 0, endPosn)) === str) {\n return true;\n } else {\n return false;\n }\n\n}", "title": "" }, { "docid": "f21f5b0d67191ce340a1cd92a8399132", "score": "0.7085025", "text": "function isPalindrome(string){\n\tvar splitStr = string.split(\"\"), reverse = \"\";\n\tfor(var i = splitStr.length - 1; i >= 0; i--){\n\t\treverse += splitStr[i];\n\t}\n\treturn (reverse === string) ? true : false;\n}", "title": "" }, { "docid": "eba45abf6421dc996084abb885e76227", "score": "0.70833826", "text": "function isPalindrome(input) {\n var reverseStr = input.split('').reverse().join('');\n\n// console.log(input);\n// console.log(reverseStr);\nif(input == reverseStr)\n return true;\n}", "title": "" }, { "docid": "902f5f5c5e878ad8c183bc3350bdeae2", "score": "0.7074413", "text": "function checkPalindrome(inputString) {\n var arr = inputString.split(\"\");\n var revStr = arr.reverse().join(\"\");\n // return revArr;\n \n if(inputString === revStr){\n //return true;\n console.log(true);\n }\n else console.log(false);\n\n}", "title": "" }, { "docid": "dd9a88768e342d500d25c95c8f7b70a5", "score": "0.70737064", "text": "function palindrome(str) {\n //clean format\n let pattern = /[A-Za-z0-9]/ig;\n let rawArr = str.match(pattern);\n let clean = rawArr.join(\"\");\n clean = clean.toLowerCase();\n\n //check if reverse string is same as normal string. \n let rev = \"\"; \n for (let i =clean.length -1; i > -1; --i){\n rev+=clean[i];\n }\n if(rev == clean){\n return true;\n }\n return false; \n}", "title": "" }, { "docid": "524ac8f6b3c69d35ec8cbdc2323a964d", "score": "0.7073668", "text": "function palindrome(str) {\n var len = str.length;\n\n for (var i = 0; i < Math.floor(len / 2); i++) {\n if (str[i] !== str[len - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b9627c062c28a77a3db8555c8240a981", "score": "0.70713407", "text": "function palindrome(str) {\n var middle = str.length/2;\n for (var i = 0; i < middle; i++) {\n if (str[i] !== str[str.length - 1 - i]) {\n return false;\n }\n middle--;\n }\n return true;\n }", "title": "" }, { "docid": "46256197ab41fe3429bd19e2a2f90286", "score": "0.70710665", "text": "function palindrome(str) {\n var len = str.length;\n for ( var i = 0; i < Math.floor(len/2); i++ ) {\n if (str[i] !== str[len - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5106c95be743268bebba91f1206d6bd4", "score": "0.70684874", "text": "function isPalindrome(str){\n let abc = str.toLowerCase().split(' ').join('')\n let abcReverse = abc.split('').reverse().join('')\n return abc === abcReverse; \n}", "title": "" }, { "docid": "0cce2bab11b3367df7c83ff5d399c405", "score": "0.706635", "text": "function is_palindrome(s) {\n //assign our string to a new string instead, which use toLowerCase() method to lower letters and replace() method passed in 2 arguments\n s = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, \"\");\n // Your code goes here\n //we implement a for loop, which loops through the first half of this string and increases each iteration by one.\n for (let i = 0; i < s.length / 2; i++) {\n //whether it satisfies the condition or not, str[i] are the indexes of first half string, and str[len - i - 1] are the indexes of last ones.\n // need to – 1 because the last element of this string is str[str.length - 1] not str[str.length]\n //minus i because it will just go over the last half of this string.\n if (s[i] !== s[s.length - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "22a25dbf8b1ad6a439d506cab4629a7d", "score": "0.70651466", "text": "function palindrome(str) {\r\n const reversed = str\r\n .split('')\r\n .reverse()\r\n .join('');\r\n\r\n return str === reversed;\r\n}", "title": "" }, { "docid": "2086e507aff5643e2e5e5fa44e7e1027", "score": "0.7062821", "text": "function palindrome(string) {\n return string === reverse(string);\n}", "title": "" }, { "docid": "2d1edbfd6c62fc0d21718360a17ca1e3", "score": "0.70617324", "text": "function palindrome(str) {\n // REMOVE PUNCTUATION\n let punctuationRemoved = str.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g, '');\n\n // LOWERCASE ALL CHARACTERS\n let lowerCasing = punctuationRemoved.toLowerCase();\n\n // REMOVE SPACE\n let spacingRemoved = lowerCasing.replace(/\\s/g, '');\n\n // TEST IF FORWARD MATCHES REVERSE\n function palindromeTest() {\n let forward = spacingRemoved.split('');\n let reverse = spacingRemoved.split('').reverse();\n\n return forward.join('') === reverse.join('');\n }\n\n return palindromeTest();\n}", "title": "" }, { "docid": "2bebc2604ef6e185eacfe4c1000fb6e7", "score": "0.70422834", "text": "function palindromes2(string) {\n let reverseString = string.reverse()\n for(let i = 0; i < string.length; i++) {\n if(reverseString[i].toLowerCase() != string[i].toLowerCase()) {\n return \"Not a Palindrome!\"\n }\n }\n return \"Is a Palindrome!\"\n}", "title": "" }, { "docid": "041f7c9493a94bcd3fe2c3e8f11b1684", "score": "0.7041274", "text": "function palindromeTest() {\n let forward = spacingRemoved.split('');\n let reverse = spacingRemoved.split('').reverse();\n\n return forward.join('') === reverse.join('');\n }", "title": "" }, { "docid": "f47ad9c7555f1b93c8f022ffba147036", "score": "0.7038717", "text": "function isPalindrome(string) {\n // Write your code here.\n return string.split(\"\").reverse().join(\"\") === string ? true : false;\n}", "title": "" }, { "docid": "472569a12ab8310250364cda9c64ca9f", "score": "0.7032908", "text": "function isPalindrome(string) {\n var rev = string.split(\"\").reverse().join(\"\");\n return string == rev;\n }", "title": "" }, { "docid": "51d68afd76141b57e161333fcc2c152b", "score": "0.7028225", "text": "function isPalindrome(str) {\n // Method 1 (My Solution)\n return str === str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "c997a5be3ae8b1cbbc44fd43b613a129", "score": "0.7028023", "text": "function palindrome(str) {\n return str == str.split('').reverse().join('');\n}", "title": "" }, { "docid": "25b42215b3f827fc3c65c3586b6a315d", "score": "0.7024761", "text": "function isPalindrome(string) {\n return (string.split('').reverse().join('') === string);\n}", "title": "" }, { "docid": "218e2e90ab4b9078fe4e0ed459c0979a", "score": "0.7023486", "text": "function palindrome(aString) {\n aString = aString.replace(' ', '');\n let reversedString = '';\n for (let i=aString.length-1; i >= 0; i--) {\n reversedString += aString[i];\n }\n return aString === reversedString;\n}", "title": "" }, { "docid": "306e84222fa899bf78e2a78607fcd778", "score": "0.7022103", "text": "function isPalindrome(str) {\n const newStr = str.split(\" \").join(\"\");\n const midPoint = Math.floor(str.length / 2);\n\n for(let i = 0; i < midPoint; i++) {\n if(str[i] !== str[str.length - 1 - i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "fda2954b8eb89b08c168ae7e2fd0309d", "score": "0.70204103", "text": "function isPalindrome(string) {\n // Write your code here.\n let arr = string.split('')\n let reverse = ''\n \n for(let i=string.length-1; i >= 0; i--) {\n reverse += arr[i]\n }\n \n return reverse === string\n }", "title": "" }, { "docid": "dbbe239782976aa312c3ca441e90ec64", "score": "0.7018417", "text": "function palindrome(input) {\n var tempOutput = \"\";\n var output = true;\n for (var i = 0; i < input.length; i++) {\n if (input[i] === \" \") {\n continue;\n } else {\n tempOutput += input[i];\n }\n }\n for (\n var i = 0, j = tempOutput.length - 1;\n i < tempOutput.length, j >= 0;\n i++, j--\n ) //console.log(i + 'index i ', j + 'index j ')\n {\n if (tempOutput[i] === tempOutput[j]) {\n output;\n } else {\n output = false;\n }\n }\n return output;\n}", "title": "" }, { "docid": "faee59541b65080c141a0cfe4599ef6a", "score": "0.7011903", "text": "function palindrome(str) {\n var letters = str.toLowerCase().replace(/[^A-Za-z0-9]/g, '')\n let str1 = letters.split(\"\").reverse().join()\n let str2 = letters.split(\"\").join()\n if (str1 === str2) {\n return true\n }\n return false\n}", "title": "" }, { "docid": "5441d405d6767a1401e447e7f558dd32", "score": "0.70098895", "text": "function isPalindrome(string) {\n function reverse() {\n return string.split('').reverse().join('')\n }\n\n return string === reverse()\n}", "title": "" }, { "docid": "1ef201748be2a188c80084590e9c4f61", "score": "0.700918", "text": "function palindrome(string1) {\n var stringLength = string1.length - 1;\n for(var i = 0; i <= string1.length/2; i++)\n {\n if(string1[i] !== string1[stringLength - i]) \n return false;\n \n }\n return true;\n }", "title": "" }, { "docid": "d0d84946d113bfcd65fc846bbf4b8eb7", "score": "0.70064837", "text": "function palindrome(string) {\n\n var str = '';\n var isPalindrome = true;\n \n for (var i = 0; i < string.length; i++) {\n if (string[i] !== ' ') {\n str += string[i];\n }\n }\n\n for (var j = 0; j < str.length/2; j++) {\n if (str[j] !== str[str.length - 1 - j]) {\n isPalindrome = false;\n }\n }\n\n return isPalindrome;\n\n}", "title": "" }, { "docid": "5cc6254bcc80a6a343dc2fff800c4970", "score": "0.70025176", "text": "function isPalindrome(string) {\n return string === string.split('').reverse().join('');\n}", "title": "" }, { "docid": "5cc6254bcc80a6a343dc2fff800c4970", "score": "0.70025176", "text": "function isPalindrome(string) {\n return string === string.split('').reverse().join('');\n}", "title": "" }, { "docid": "c47c742bca6ea4870e1351b9320a9b23", "score": "0.69987184", "text": "function palindrome(str) {\n return str === str.split('').reverse().join('') \n}", "title": "" }, { "docid": "b6627987064940a5649a57f2bb15481a", "score": "0.69980335", "text": "function palindrome(str) {\n var input = str.split(\"\");\n var reversed = \"\";\n var output = false;\n for (let s of input) {\n reversed = s + reversed;\n }\n // console.log(reversed);\n // console.log(input.join(\"\"));\n // if (input.join(\"\") == reversed) {\n // output = true;\n // }\n console.log(input.join(\"\") == reversed);\n return input.join(\"\") == reversed;\n console.log(output);\n return output;\n}", "title": "" }, { "docid": "a92674ea790796aacdf30777aef397ee", "score": "0.6996836", "text": "function is_palindrome(string) {\n\tif (string.length === 0) {\n\t\treturn true;\n\t}\n\t//Checks to see if first and last letters are the same.\n\tif (string[0] !== string[string.length -1]) {\n\t\treturn false;\n\t}\n\t//This will truncate the string\n\treturn is_palindrome(string.slice(1,string.length-1));\n}", "title": "" }, { "docid": "c5ea2f2edec078398446e50d884d1f21", "score": "0.69967926", "text": "function palindrome(str) {\n return str === str.split('').reverse().join('');\n}", "title": "" }, { "docid": "e4af17b9c0af7491c3f380fad4415898", "score": "0.69963104", "text": "function palindromeOrNot(string) {\n const arrayValues = string.split(\"\");\n const reverseArrayValues = arrayValues.reverse();\n const reverseString = reverseArrayValues.join(\"\");\n if(string == reverseString) {\n console.log(\"It is a palindrome\");\n return true; \n }\n else {\n console.log(\"It is not a palindrome\");\n return false;\n }\n \n \n}", "title": "" }, { "docid": "3ba0dd238418c3ee708fde5dce9b3039", "score": "0.69937277", "text": "function isPalindrome(str){\n strLst = str.split(\"\");\n // console.log(strLst);\n for (let i = 0, j = strLst.length-1; i < (strLst.length-1) / 2; i++, j--) {\n // console.log(`strLst[${i}]:${strLst[i]} strLst[${j}]:${strLst[j]} `)\n if (strLst[i] !== strLst[j]) {\n return false;\n } else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "7ca2e3041501d0819677c15e45afdd24", "score": "0.69886124", "text": "function palindrome(str) {\n var strL = str.toLowerCase().replace(/[^0-9a-z]/gi, '');\n for (i=0; i < strL.length/2; i++){\n if(strL[i]!=strL[strL.length-1-i]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "c7547bc36c7df40a17724385216272e7", "score": "0.6986991", "text": "function palindrome(str) {\n var re = /\\W+|\\_+/g;\n var cleanString = str.replace(re, '').toLowerCase();\n if (cleanString == cleanString.split('').reverse().join('')) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "1781aaf7be84c22ac9086e35a633ffed", "score": "0.69817364", "text": "function isPalindrome(input){\n const stack = [];\n let output = \"\";\n for(let i = 0; i < input.length; i++){\n stack.push(input[i]);\n }\n while(stack.length){\n output += stack.pop();\n }\n return output == input\n}", "title": "" }, { "docid": "18f372910f2ace78dacb1ac263373d97", "score": "0.6978664", "text": "function palindrome(str) {\n let alphanumeric = /^[a-zA-Z]+$/;\n let char =\"\";\n let reverse =\"\";\n \n for (let i =0; i < str.length; i++){\n if (str[i].match(alphanumeric)){\n char += str[i].toLowerCase();\n }\n }\n \n for (let j = char.length -1; j > -1; j--){\n reverse += char[j];\n }\n return char === reverse;\n\n}", "title": "" }, { "docid": "8a9b7fac6b1faf4848c86445ec1af23e", "score": "0.69772655", "text": "function isPalindrome(string){\n\tlet newString = \"\";\n\tfor (let i = string.length-1; i >= 0; i--){\n\t\tnewString += string[i];\n\t} if (string.toLowerCase() == newString.toLowerCase()){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "1c81afeed750324a023d52486123bf11", "score": "0.6960519", "text": "function palindrome(str) {\r\n if (\r\n str.replace(/[\\W_]/g, '').toLowerCase() ===\r\n str\r\n .replace(/[\\W_]/g, '')\r\n .toLowerCase()\r\n .split('')\r\n .reverse()\r\n .join('')\r\n ) {\r\n console.log('true');\r\n } else {\r\n console.log('false');\r\n }\r\n}", "title": "" }, { "docid": "957ab373802b1091f99ccebe471a4c4a", "score": "0.6960438", "text": "function checkPalindrone(string) {\n if (string.toLowerCase() == string.toLowerCase().split(\"\").reverse().join(\"\")) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "cfc1385528ca7141bf112d2a30435814", "score": "0.69593716", "text": "function isPalindrome(str) {\n\tlet start = 0;\n\tlet end = str.length - 1;\n\tlet res1;\n\tfunction helper(input) {\n\t\tif (start > input.length / 2) {\n\t\t\tres1 = true;\n\t\t\treturn;\n\t\t}\n\t\t// console.log(input[start], input[end]);\n\t\tif (input[start] !== input[end]) {\n\t\t\tres1 = false;\n\t\t\treturn;\n\t\t}\n\t\tstart++;\n\t\tend--;\n\t\thelper(input);\n\t}\n\thelper(str);\n\treturn res1;\n}", "title": "" }, { "docid": "243ef2006d7bc6353de58a7ecbeb35da", "score": "0.69590044", "text": "function isPalindrome(string) {\n\tlet reversed = '';\t\t /// declare an empty string\n\tfor (let i = string.length -1; i >= 0; i--){ \t///// Set i to end of string then i- -\n\t\treversed += string[i]; \t\t//////// add each letter backwards to reversed\n\t}\n\treturn string === reversed\t//// compare string to reversed\n}", "title": "" }, { "docid": "1689d1a35dd04a12420ab5cf89b21dac", "score": "0.69510853", "text": "function checkPalindrom(str) {\n return str.toLowerCase().split('').reverse('').join('');\n}", "title": "" }, { "docid": "2ec8bc6f8bde6d7650e7ae1ebc6d3f34", "score": "0.6950011", "text": "function palindrome(str) {\n\n var len = str.length;\n var mid = Math.floor(len/2);\n\n for ( var i = 0; i < mid; i++ ) {\n if (str[i] !== str[len - 1 - i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "0091603394f18c98b7a630cf78a3e64f", "score": "0.6949408", "text": "function isPalindrome(str) {\n let reversestr = '';\n reversestr = str\n .split('')\n .reverse()\n .join('');\n\n let ispalin = str === reversestr ? true : false;\n return ispalin;\n}", "title": "" }, { "docid": "fe160b9da4f46c738418073e4488c6a9", "score": "0.69469863", "text": "function isPalindrome (str){\n return str === str.split('').reverse().join('');\n\n}", "title": "" }, { "docid": "aa48777132655e9ed8e469cfa1b5b56d", "score": "0.6943855", "text": "function isPalindrome(string) {\n string = string.toLowerCase();\n var charactersArr = string.split('');\n var validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('');\n\n var lettersArr = [];\n charactersArr.forEach(char => {\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char);\n });\n\n return lettersArr.join('') === lettersArr.reverse().join('');\n}", "title": "" }, { "docid": "75e5a33625653492bf7c63b11fe430b9", "score": "0.6940757", "text": "function palindrome(str){\n const re = /[^A-Za-z0–9]/g;\n const lower = str.toLowerCase().replace(re, '');\n const reverse = lower.split('').reverse().join('');\n return reverse ==lower;\n}", "title": "" }, { "docid": "99890d228d3036347f4da51d57dee0a2", "score": "0.6938572", "text": "function palindromeCheck(str) {\n let reverseWord = '';\n for (let i = 0; i < str.length; i++) {\n reverseWord = str[i] + reverseWord;\n if (reverseWord === str) return true;\n }\n return false;\n}", "title": "" }, { "docid": "5b443c4f0f6b654d884d35bea9e10984", "score": "0.693765", "text": "function isPalindrome(input) {\n \n}", "title": "" }, { "docid": "a3d3b48fecf984dc75e57adb4558e9ed", "score": "0.6933422", "text": "function isPalindrome(string) {\n function reverse() {\n return string.split('').reverse().join('');\n }\n\n return string === reverse();\n}", "title": "" }, { "docid": "b244de7ac6af4eef74382e7017e9300a", "score": "0.6929857", "text": "function palindrome(str) {\n // Good luck!\n\n var re = /[^A-Za-z0-9]/g;\n\n var lowerCaseString = str.toLowerCase().replace(re, '');\n\n var reverseString = lowerCaseString.split(\"\").reverse().join(\"\");\n\n console.log(lowerCaseString);\n console.log(reverseString);\n\n return lowerCaseString === reverseString;\n}", "title": "" }, { "docid": "a816275e708b45ed238113bd30852e98", "score": "0.6928585", "text": "function isPalindrome(str) {\n var str = str.toLowerCase();\n // console.log(str);\n for (var i = 0; i < str.length/ 2; i++) {\n if (str[i] != str[str.length - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c2bd4c182468bf2e0ade6e3556006448", "score": "0.69257253", "text": "function palindrome(str) {\n let reg = /[\\W_]/g // regular expression - non alphanumberic characters\n let lowerstr = str.toLowerCase().replace(reg, \"\"); // convert the original str to lowercase and remove the space\n let reverseStr = lowerstr.split(\"\").reverse().join(\"\");\n // console.log(reverseStr);\n return reverseStr === lowerstr ? true : false // comparing reverse str and change str\n\n}", "title": "" }, { "docid": "9196282a377daf112ac8755e7eefa6b9", "score": "0.69231737", "text": "function isPalindrome(str) {\n const arr = str.split(\"\");\n const rev = [...arr].reverse().join(',');\n\n return str === rev ? \"yes\" : \"no\";\n}", "title": "" }, { "docid": "5fc270da12361dc9663b199c84762e8c", "score": "0.6922704", "text": "function palindrome(str) {\n // filter string and convert it to lower case\n const strFilteredArr = str\n .split(/[^a-zA-Z0-9]+/)\n .map(word => word.toLowerCase());\n // seperate each word into an array of single letters\n let letterArr = [];\n strFilteredArr.forEach(word => {\n for (let i = 0; i < word.length; i++) {\n letterArr.push(word.charAt(i));\n }\n });\n // flip the second half of the string onto a new array\n let secondHalfIndex;\n let secondHalfArr = [];\n if (letterArr.length % 2 === 0) {\n secondHalfIndex = letterArr.length / 2;\n } else {\n secondHalfIndex = letterArr.length / 2 + 0.5;\n }\n for (let i = letterArr.length - 1; i >= secondHalfIndex; i--) {\n secondHalfArr.push(letterArr[i]);\n }\n // compare the two arrays to determine whether the string is a palindrome\n let isPalindrome = true;\n for (let i = 0; i < secondHalfArr.length; i++) {\n if (secondHalfArr[i] !== letterArr[i]) {\n isPalindrome = false;\n break;\n }\n }\n return isPalindrome;\n}", "title": "" }, { "docid": "07fedcb9ee33ac3efa5305aeef43c8cc", "score": "0.69226", "text": "function isPalindrome(str) {\n\tstr = str.replace(/\\s/g, ''); // remove spaces\n\t\n var arr = str.split('');\n var j = arr.length - 1;\n\n for (var i = 0; i <= j; i++) {\n if (arr[i] != arr[j]) {\n return false;\n }\n j--;\n }\n return true;\n}", "title": "" }, { "docid": "f4e7c4a08c489355925d7363dd1a3911", "score": "0.6920654", "text": "function palindrome(str){\n let end = str.length-1;\n let start=0;\n while(start<end){\n if(str[start]==' '){\n start++;\n }else if(str[end]==' '){\n end--;\n }else if(str[start]==str[end]){\n start++;\n end--;\n }else{\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b00a87cd5c8b813968de5b855d3c3b26", "score": "0.69187546", "text": "function isPalindrome(str){\n var newStr = str.match(/[a-z]/gi).join('').toLowerCase() // g = global, i = dont care if upper or lower case???\n return newStr === newStr.split('').reverse().join('')\n}", "title": "" }, { "docid": "538ef6de0582449c2d9b4d2b1082cb94", "score": "0.6917317", "text": "function isPalindrome(str) {\n for (let i = 0; i < str.length/2; i++) {\n if (str[i] === str[str.length-1-i]) return true;\n else return false; \n }\n}", "title": "" }, { "docid": "e56c07ef04119e86f4724faa4d2902f8", "score": "0.69128126", "text": "function isPalindrome(str){\n const revString = str.split('').reverse().join('')\n return revString === str\n}", "title": "" }, { "docid": "f8b5e1365c1be4646a0bec2f94ea1c34", "score": "0.6911041", "text": "function palindrome(str) {\n let alphaNum = str.replace(/[^a-z0-9]/gi, \"\").toLowerCase();\n let reverseStr = alphaNum.split(\"\").reverse().join(\"\");\n\n return alphaNum === reverseStr;\n\n}", "title": "" }, { "docid": "6f871b83b7fa57682d08b7f852ac7cd2", "score": "0.69049704", "text": "function palindrome(string) {\n let lowercaseString = string.toLowerCase();\n return lowercaseString === reverse(lowercaseString);\n}", "title": "" }, { "docid": "54aa5722e0393e21edeafb1cf5929ba5", "score": "0.69039726", "text": "function palindrome (str) {\n let cleaned = str.replace(/[\\W_]/g, '').toLowerCase();\n return cleaned.split('').reverse().join('') === cleaned;\n}", "title": "" } ]
3c23954683c259a27c4330f62566fee9
Read binary data (BVARBYTE)
[ { "docid": "4123faa1ed14177b0f8a54e2bf99b22b", "score": "0.7689132", "text": "readBVarByte(callback) {\n this.readUInt8(length => {\n this.readBuffer(length, callback);\n });\n }", "title": "" } ]
[ { "docid": "def56427ab0e544187f021929289be39", "score": "0.6783521", "text": "readBVarChar(callback) {\n this.readUInt8(length => {\n this.readBuffer(length * 2, data => {\n callback(data.toString('ucs2'));\n });\n });\n }", "title": "" }, { "docid": "c1fe8cad2aff241ddfbb7c61aa524aa4", "score": "0.6493491", "text": "readByte() {\n let res = this._buffer.readUInt8(this._currentReadPosition);\n this._currentReadPosition += 1;\n return res;\n }", "title": "" }, { "docid": "b0bf77a11179ea37a2e9cf24ec03d01f", "score": "0.63519084", "text": "readByte(){return this.__readInteger(1,!1)}", "title": "" }, { "docid": "db6ea53e933318550d910eeb3cb37ad3", "score": "0.6313599", "text": "function readByte() {\n reader.read(1, function (err, byte) {\n if (err) {\n return cb(err);\n }\n\n rawMsgSize.push(byte);\n\n if (byte && !isEndByte(byte[0])) {\n readByte();\n return;\n }\n\n var msgSize = varint.decode(Buffer.concat(rawMsgSize));\n readMessage(reader, msgSize, function (err, msg) {\n if (err) {\n return cb(err);\n }\n\n rawMsgSize = [];\n\n cb(null, msg);\n });\n });\n }", "title": "" }, { "docid": "db6ea53e933318550d910eeb3cb37ad3", "score": "0.6313599", "text": "function readByte() {\n reader.read(1, function (err, byte) {\n if (err) {\n return cb(err);\n }\n\n rawMsgSize.push(byte);\n\n if (byte && !isEndByte(byte[0])) {\n readByte();\n return;\n }\n\n var msgSize = varint.decode(Buffer.concat(rawMsgSize));\n readMessage(reader, msgSize, function (err, msg) {\n if (err) {\n return cb(err);\n }\n\n rawMsgSize = [];\n\n cb(null, msg);\n });\n });\n }", "title": "" }, { "docid": "a745d6cfc0ffbc72883607fe9c35d18d", "score": "0.63088715", "text": "readUsVarByte(callback) {\n this.readUInt16LE(length => {\n this.readBuffer(length, callback);\n });\n }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "8d7db445474797062763b2565286a9af", "score": "0.623497", "text": "function bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }", "title": "" }, { "docid": "5b17cc65bcd30264d38201c68b31dcfe", "score": "0.6128025", "text": "ReadBSTR(int, int) {\n\n }", "title": "" }, { "docid": "9635b2026f799012f4374d8622894bf3", "score": "0.61275727", "text": "function read_binary(path$$1) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path$$1);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path$$1); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path$$1);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "adb0e9180d301d9c7b68afe9fc4c8b5b", "score": "0.607716", "text": "function read_binary(path) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}", "title": "" }, { "docid": "4bb22c2f8e97440b83c67ff8de0aa435", "score": "0.60560393", "text": "readUint8() {\n return this._data.getUint8(this.offset++);\n }", "title": "" }, { "docid": "23d502fe5a3b34a27c23607135f08b91", "score": "0.59271336", "text": "static binaryToBytes(binary) {\r\n const bytes = new Uint8Array(Math.ceil(binary.length / 8));\r\n for (let i = 0; i < bytes.length; i++) {\r\n bytes[i] = Number.parseInt(binary.slice(i * 8, (i + 1) * 8), 2);\r\n }\r\n return bytes;\r\n }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.5922226", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "fd817938c91bacc9e074d89b1ff13687", "score": "0.5909165", "text": "function DecodeVarLenUint8(br){if(br.readBits(1)){var nbits=br.readBits(3);if(nbits===0){return 1;}else{return br.readBits(nbits)+(1<<nbits);}}return 0;}", "title": "" }, { "docid": "32f586aff0b5f61a5457dccb93acaf2b", "score": "0.58510995", "text": "function bnByteValue()\n\t {\n\t return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\n\t }", "title": "" }, { "docid": "9d3afb0b24edb979eafa9381d1ebaa94", "score": "0.584604", "text": "function bnByteValue() {\n\t return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\n\t}", "title": "" }, { "docid": "9d3afb0b24edb979eafa9381d1ebaa94", "score": "0.584604", "text": "function bnByteValue() {\n\t return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\n\t}", "title": "" }, { "docid": "757a8c34a452a75e5caed4b77790b475", "score": "0.5844505", "text": "function decodeByteInWav(sound){\n let binary = '';\n for(let i = header, len = sound.data.length; i < len; i++){\n let strBin = sound.data[i].toString(2);\n let tab = strBin.split('');\n binary += tab[tab.length - 1];\n }\n return binary;\n}", "title": "" }, { "docid": "21bdf99d2e885bbb18f1657944f3e488", "score": "0.5840762", "text": "function bnByteValue() {\n return this.t == 0 ? this.s : this[0] << 24 >> 24;\n }", "title": "" }, { "docid": "21bdf99d2e885bbb18f1657944f3e488", "score": "0.5840762", "text": "function bnByteValue() {\n return this.t == 0 ? this.s : this[0] << 24 >> 24;\n }", "title": "" }, { "docid": "49c369d86bcd1b5409320b395b576061", "score": "0.5833417", "text": "function bnByteValue() {\n return this.t == 0 ? this.s : this[0] << 24 >> 24;\n}", "title": "" }, { "docid": "49c369d86bcd1b5409320b395b576061", "score": "0.5833417", "text": "function bnByteValue() {\n return this.t == 0 ? this.s : this[0] << 24 >> 24;\n}", "title": "" }, { "docid": "d4532cbbd5d2e707fa912e0099afe9ab", "score": "0.58221036", "text": "function DecodeVarLenUint8(br) {\n if (br.readBits(1)) {\n var nbits = br.readBits(3);\n if (nbits === 0) {\n return 1;\n } else {\n return br.readBits(nbits) + (1 << nbits);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "d4532cbbd5d2e707fa912e0099afe9ab", "score": "0.58221036", "text": "function DecodeVarLenUint8(br) {\n if (br.readBits(1)) {\n var nbits = br.readBits(3);\n if (nbits === 0) {\n return 1;\n } else {\n return br.readBits(nbits) + (1 << nbits);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "d4532cbbd5d2e707fa912e0099afe9ab", "score": "0.58221036", "text": "function DecodeVarLenUint8(br) {\n if (br.readBits(1)) {\n var nbits = br.readBits(3);\n if (nbits === 0) {\n return 1;\n } else {\n return br.readBits(nbits) + (1 << nbits);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "293ad932ca288e3d4403db9c3806cf20", "score": "0.5819323", "text": "function readByte () {\n reader.read(1, (err, byte) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize.push(byte)\n\n if (byte && !isEndByte(byte[0])) {\n readByte()\n return\n }\n\n const msgSize = varint.decode(Buffer.concat(rawMsgSize))\n if (msgSize > maxLength) {\n return cb('size longer than max permitted length of ' + maxLength + '!')\n }\n readMessage(reader, msgSize, (err, msg) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize = []\n\n cb(null, msg)\n })\n })\n }", "title": "" }, { "docid": "293ad932ca288e3d4403db9c3806cf20", "score": "0.5819323", "text": "function readByte () {\n reader.read(1, (err, byte) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize.push(byte)\n\n if (byte && !isEndByte(byte[0])) {\n readByte()\n return\n }\n\n const msgSize = varint.decode(Buffer.concat(rawMsgSize))\n if (msgSize > maxLength) {\n return cb('size longer than max permitted length of ' + maxLength + '!')\n }\n readMessage(reader, msgSize, (err, msg) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize = []\n\n cb(null, msg)\n })\n })\n }", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.5816624", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "9e53f95c2a83edfcb457c461cc3663d9", "score": "0.5792429", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\n}", "title": "" }, { "docid": "d56a5dd083efc0755a78698f6c486896", "score": "0.5791353", "text": "readUint8(): number {\n var num = this.dataView.getUint8(this.offset);\n this.offset++;\n return num;\n }", "title": "" }, { "docid": "70ff419376a91b1c7e764e9df0c7fcac", "score": "0.5791064", "text": "function bnByteValue() {\r\n return this.t == 0 ? this.s : (this[0] << 24) >> 24\r\n }", "title": "" }, { "docid": "acc01471b5445cc6d9e8af78dec11604", "score": "0.57896805", "text": "readBytes() {\n let n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n const bytes = new Uint8Array(n);\n\n for (let i = 0; i < n; i++) {\n bytes[i] = this.readByte();\n }\n\n return bytes;\n }", "title": "" }, { "docid": "03ca61790f86eb3b844226243cc455a6", "score": "0.5789348", "text": "function bnByteValue() {\r\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\r\n}", "title": "" }, { "docid": "af9eaf0733220b0bddd4431a18cc5c2d", "score": "0.5786585", "text": "function bytesToBinary(ab) {\n var buf = new Buffer(ab.byteLength);\n var view = new Uint8Array(ab);\n for (var i = 0; i < buf.length; ++i) {\n buf[i] = view[i];\n }\n return buf;\n}", "title": "" }, { "docid": "9f18b1eb84b8961d1b505afdb62cf193", "score": "0.5777961", "text": "function bnByteValue(){\nreturn this.t==0?this.s:this[0]<<24>>24;\n}", "title": "" }, { "docid": "9a4e14c312b2867e485f75e6b9f88366", "score": "0.5760355", "text": "function bnByteValue() { return (this.t == 0) ? this.s : (this[0] << 24) >> 24; }", "title": "" }, { "docid": "595fc31566cfa7cfe99f497009bef27d", "score": "0.5721507", "text": "function BinaryFile(strData, iDataOffset, iDataLength) {\r\n var data = strData;\r\n var dataOffset = iDataOffset || 0;\r\n var dataLength = 0;\r\n // added\r\n var doubleMantExpHi = Math.pow(2, -28);\r\n var doubleMantExpLo = Math.pow(2, -52);\r\n var doubleMantExpFast = Math.pow(2, -20);\r\n\r\n var switch_endian = false;\r\n\r\n this.getRawData = function () {\r\n return data;\r\n }\r\n\r\n if (typeof strData == \"string\") {\r\n dataLength = iDataLength || data.length;\r\n\r\n this.getByteAt = function (iOffset) {\r\n return data.charCodeAt(iOffset + dataOffset) & 0xFF;\r\n }\r\n } else if (typeof strData == \"unknown\") {\r\n dataLength = iDataLength || IEBinary_getLength(data);\r\n\r\n this.getByteAt = function (iOffset) {\r\n return IEBinary_getByteAt(data, iOffset + dataOffset);\r\n }\r\n } else {\r\n throw new InvalidBinaryFile(\"Unsupported type \" + (typeof strData));\r\n }\r\n\r\n this.getEndianByteAt = function (iOffset, width, delta) {\r\n if (this.switch_endian)\r\n return this.getByteAt(iOffset + width - delta - 1);\r\n else\r\n return this.getByteAt(iOffset + delta);\r\n }\r\n\r\n this.getLength = function () {\r\n return dataLength;\r\n }\r\n\r\n this.getSByteAt = function (iOffset) {\r\n var iByte = this.getByteAt(iOffset);\r\n if (iByte > 127)\r\n return iByte - 256;\r\n else\r\n return iByte;\r\n }\r\n\r\n this.getShortAt = function (iOffset) {\r\n var iShort = (this.getEndianByteAt(iOffset, 2, 1) << 8) + this.getEndianByteAt(iOffset, 2, 0)\r\n if (iShort < 0)\r\n iShort += 65536;\r\n return iShort;\r\n }\r\n this.getSShortAt = function (iOffset) {\r\n var iUShort = this.getShortAt(iOffset);\r\n if (iUShort > 32767)\r\n return iUShort - 65536;\r\n else\r\n return iUShort;\r\n }\r\n this.getLongAt = function (iOffset) {\r\n var iByte1 = this.getEndianByteAt(iOffset, 4, 0),\r\n iByte2 = this.getEndianByteAt(iOffset, 4, 1),\r\n iByte3 = this.getEndianByteAt(iOffset, 4, 2),\r\n iByte4 = this.getEndianByteAt(iOffset, 4, 3);\r\n\r\n var iLong = (((((iByte4 << 8) + iByte3) << 8) + iByte2) << 8) + iByte1;\r\n if (iLong < 0)\r\n iLong += 4294967296;\r\n return iLong;\r\n }\r\n this.getSLongAt = function (iOffset) {\r\n var iULong = this.getLongAt(iOffset);\r\n if (iULong > 2147483647)\r\n return iULong - 4294967296;\r\n else\r\n return iULong;\r\n }\r\n this.getStringAt = function (iOffset, iLength) {\r\n var aStr = [];\r\n for (var i = iOffset, j = 0; i < iOffset + iLength; i++, j++) {\r\n aStr[j] = String.fromCharCode(this.getByteAt(i));\r\n }\r\n return aStr.join(\"\");\r\n }\r\n\r\n // Added\r\n this.getCStringAt = function (iOffset, iMaxLength) {\r\n var aStr = [];\r\n for (var i = iOffset, j = 0; (i < iOffset + iMaxLength) && (this.getByteAt(i) > 0); i++, j++) {\r\n aStr[j] = String.fromCharCode(this.getByteAt(i));\r\n }\r\n return aStr.join(\"\");\r\n }\r\n\r\n // Added\r\n this.getDoubleAt = function (iOffset) {\r\n var iByte1 = this.getEndianByteAt(iOffset, 8, 0),\r\n iByte2 = this.getEndianByteAt(iOffset, 8, 1),\r\n iByte3 = this.getEndianByteAt(iOffset, 8, 2),\r\n iByte4 = this.getEndianByteAt(iOffset, 8, 3),\r\n iByte5 = this.getEndianByteAt(iOffset, 8, 4),\r\n iByte6 = this.getEndianByteAt(iOffset, 8, 5),\r\n iByte7 = this.getEndianByteAt(iOffset, 8, 6),\r\n iByte8 = this.getEndianByteAt(iOffset, 8, 7);\r\n var iSign = iByte8 >> 7;\r\n var iExpRaw = ((iByte8 & 0x7F) << 4) + (iByte7 >> 4);\r\n var iMantHi = ((((((iByte7 & 0x0F) << 8) + iByte6) << 8) + iByte5) << 8) + iByte4;\r\n var iMantLo = ((((iByte3) << 8) + iByte2) << 8) + iByte1;\r\n\r\n if (iExpRaw == 0)\r\n return 0.0;\r\n if (iExpRaw == 0x7ff)\r\n return undefined;\r\n\r\n var iExp = (iExpRaw & 0x7FF) - 1023;\r\n\r\n var dDouble = ((iSign == 1) ? -1 : 1) * Math.pow(2, iExp) * (1.0 + iMantLo * doubleMantExpLo + iMantHi * doubleMantExpHi);\r\n return dDouble;\r\n }\r\n // added\r\n // Extracts only 4 bytes out of 8, loosing in precision (20 bit mantissa)\r\n this.getFastDoubleAt = function (iOffset) {\r\n var iByte5 = this.getEndianByteAt(iOffset, 8, 4),\r\n iByte6 = this.getEndianByteAt(iOffset, 8, 5),\r\n iByte7 = this.getEndianByteAt(iOffset, 8, 6),\r\n iByte8 = this.getEndianByteAt(iOffset, 8, 7);\r\n var iSign = iByte8 >> 7;\r\n var iExpRaw = ((iByte8 & 0x7F) << 4) + (iByte7 >> 4);\r\n var iMant = ((((iByte7 & 0x0F) << 8) + iByte6) << 8) + iByte5;\r\n\r\n if (iExpRaw == 0)\r\n return 0.0;\r\n if (iExpRaw == 0x7ff)\r\n return undefined;\r\n\r\n var iExp = (iExpRaw & 0x7FF) - 1023;\r\n\r\n var dDouble = ((iSign == 1) ? -1 : 1) * Math.pow(2, iExp) * (1.0 + iMant * doubleMantExpFast);\r\n return dDouble;\r\n }\r\n\r\n this.getCharAt = function (iOffset) {\r\n return String.fromCharCode(this.getByteAt(iOffset));\r\n }\r\n}", "title": "" }, { "docid": "628d8d7581bdb3ec32e2537f9a9f2908", "score": "0.568233", "text": "get binaryData() {\n return { ...this._binaryData };\n }", "title": "" }, { "docid": "b281e7d72ca07b9461ea1664823e03a8", "score": "0.56290996", "text": "function toByteArray(data) { // @param BinaryString: \"\\00\\01\"\n // @return ByteArray: [0x00, 0x01]\n var rv = [], bin2num = _bin2num, remain,\n ary = data.split(\"\"),\n i = -1, iz;\n\n iz = ary.length;\n remain = iz % 8;\n\n while (remain--) {\n ++i;\n rv[i] = bin2num[ary[i]];\n }\n remain = iz >> 3;\n while (remain--) {\n rv.push(bin2num[ary[++i]], bin2num[ary[++i]],\n bin2num[ary[++i]], bin2num[ary[++i]],\n bin2num[ary[++i]], bin2num[ary[++i]],\n bin2num[ary[++i]], bin2num[ary[++i]]);\n }\n return rv;\n}", "title": "" }, { "docid": "b281e7d72ca07b9461ea1664823e03a8", "score": "0.56290996", "text": "function toByteArray(data) { // @param BinaryString: \"\\00\\01\"\n // @return ByteArray: [0x00, 0x01]\n var rv = [], bin2num = _bin2num, remain,\n ary = data.split(\"\"),\n i = -1, iz;\n\n iz = ary.length;\n remain = iz % 8;\n\n while (remain--) {\n ++i;\n rv[i] = bin2num[ary[i]];\n }\n remain = iz >> 3;\n while (remain--) {\n rv.push(bin2num[ary[++i]], bin2num[ary[++i]],\n bin2num[ary[++i]], bin2num[ary[++i]],\n bin2num[ary[++i]], bin2num[ary[++i]],\n bin2num[ary[++i]], bin2num[ary[++i]]);\n }\n return rv;\n}", "title": "" }, { "docid": "053cfcb10ef93591279f83cdb3cbbda2", "score": "0.5615795", "text": "async bytes() {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data;\n }\n else {\n return new Uint8Array(data.buffer);\n }\n }", "title": "" }, { "docid": "3b37e0d1fa9fbcdd46731d2764b2c0b5", "score": "0.56152934", "text": "function _binStringToArrayBuffer(bin){var length=bin.length;var buf=new ArrayBuffer(length);var arr=new Uint8Array(buf);for(var i=0;i<length;i++){arr[i]=bin.charCodeAt(i);}return buf;}//", "title": "" }, { "docid": "dbf6a5d3bab8c165fc1ff66130c4513b", "score": "0.5609678", "text": "readBytes(length){\n\t}", "title": "" }, { "docid": "12e051120d8489cc19cffa15244390f6", "score": "0.558838", "text": "_importFromBinaryBigEndian() {\n let buffer = fs.readFileSync(this.pathTemplate);\n let length = buffer.readUInt32BE(0);\n this.records = new Array(length);\n\n for (let i = 1; i <= length; i++) {\n // because of the first 4 byte, the i-th record starts after i*4 bytes\n this.records[i - 1] = buffer.readUInt32BE(i * 4);\n }\n }", "title": "" }, { "docid": "6c508bf4ee97954f63bbed520dee2344", "score": "0.5570702", "text": "function readByte(a, ref) {\n return a[ref.i++];\n}", "title": "" }, { "docid": "5b51412178d3393de8cf6aa8266e23d4", "score": "0.55218756", "text": "function readValue (buffer, isBigEndian) {\n var low = readUInt(buffer, 16, 8, isBigEndian);\n var high = readUInt(buffer, 16, 10, isBigEndian);\n return (high << 16) + low;\n}", "title": "" }, { "docid": "7a1ab79ad8c23996d65595a4aa840991", "score": "0.55054116", "text": "get b() {\n return this.value & 0xFF;\n }", "title": "" } ]
6b2f404488540009b7a5493aa001e5d1
Use display() to return a string with the value of every node from the linked list Example: After adding to front and back it could look something like this (this is just an example): "Disneyland" "Las Vegas" "Yellowstone" "Mount Rushmore" "Gateway Arch" I've given this to you so you can use it to test and it will help you with the contains method as well (:
[ { "docid": "132163e2b89e18977605824dc9a57daa", "score": "0.76258874", "text": "display() {\n if (this.head == null) { //handles the edge case of an empty list\n return null;\n }\n\n var values = this.head.value; // this will hold all the values of the list, starting with the first node's value\n var runner = this.head.next; // holds the next item in the list since we know it's not empty\n\n while (runner != null) { // as long as the current node we are on isn't empty keep going!\n values += \" - \" + runner.value; // take the current node's value and put it into values\n runner = runner.next; // set runner to the next node, this is what makes us go through the list\n }\n\n return values; // returns the values of all the nodes in the list\n }", "title": "" } ]
[ { "docid": "46841125e60deae7e11c52901e105cd9", "score": "0.7761937", "text": "function display(list) {\n let currentNode = list.head,\n valStr = \"\";\n\n if (!currentNode) {\n console.log(null);\n return null;\n }\n\n // Loop through nodes, adding to string\n while (currentNode.next) {\n valStr += currentNode.val;\n currentNode = currentNode.next;\n }\n\n // We are now on the last node, add to string:\n // This will also run if only one node:\n valStr += currentNode.val;\n \n console.log(valStr);\n return valStr;\n}", "title": "" }, { "docid": "c1efc80f6515c742572a5f6c312bb9d9", "score": "0.76517147", "text": "display() {\n // Creates an empty string\n let str = \"\";\n\n // Sets the runner\n let runner = this.head;\n\n // Runs down the list until the last node is found\n while (runner !== null) {\n // Adds each node data to the empty string\n str += runner.data;\n\n // Adds a comma between numbers\n if (runner.next !== null) {\n str += \", \";\n }\n // Moves the runner to the next node\n runner = runner.next;\n }\n console.log(\"Current Linked List: \", str);\n return str;\n }", "title": "" }, { "docid": "1fe3f8f58b368224cdab34d489a62442", "score": "0.7561351", "text": "function display() {\n var output = \"\";\n var current = this.head;\n output += current.data + \"->\";\n while(current.next !== null) {\n current = current.next;\n output += current.data + \"->\";\n }\n output += \"null\";\n say(output);\n}", "title": "" }, { "docid": "8ec60e3a72babdccb64b51fd07887905", "score": "0.7559641", "text": "function display(list) {\n let currNode = list.head;\n\n while (currNode) {\n console.log(currNode.value)\n currNode = currNode.next;\n }\n}", "title": "" }, { "docid": "852ec5af0b132485b5223161147833a1", "score": "0.7519306", "text": "function display(list) {\n let currNode = list.head;\n\n while (currNode !== null) {\n console.log(currNode.value);\n currNode = currNode.next;\n }\n}", "title": "" }, { "docid": "f7d14e0daee4a869f6dbf8a3bc513c50", "score": "0.7397875", "text": "function display() {\n\tvar currNode = this.head;\n\twhile (!(currNode.next == null)) {\n\t\tconsole.log(currNode.next.element);\n\t\tcurrNode = currNode.next;\n\t}\n}", "title": "" }, { "docid": "75339d6cf72984d47c9ea98c8f3d6089", "score": "0.73903793", "text": "display() {\n let current = this.head;\n\n while (current) {\n console.log(\"Current node is \", current.data);\n current = current.next;\n }\n }", "title": "" }, { "docid": "b796dc038ce59a9a756bd67c58d3d32e", "score": "0.7365043", "text": "display() {\n var output = \"\";\n var runner = this.head;\n while(runner) {\n output += runner.value + \" \"\n runner = runner.next;\n }\n return output;\n\n }", "title": "" }, { "docid": "24d4988860750f4cd2e19c26401bd654", "score": "0.73342", "text": "function display(list) {\n if (list.head === null) {\n return 'List is empty';\n }\n\n let currentNode = list.head\n while (currentNode !== null) {\n console.log(currentNode.value);\n currentNode = currentNode.next;\n }\n}", "title": "" }, { "docid": "cf7cdd94ce931536115e4f7c096156b9", "score": "0.72804314", "text": "display() {\n let currNode = this.head;\n while (currNode.next !== null) {\n console.log(currNode.next.element);\n currNode = currNode.next;\n }\n }", "title": "" }, { "docid": "3034b3d0651fbc8411ce0a10a16766ec", "score": "0.7263086", "text": "toString() {\n let currNode = this.head;\n let display = [];\n while (currNode !== null && currNode.next !== null) {\n display.push(currNode.next.element);\n currNode = currNode.next;\n }\n return display.length ? display.join(' ') : '';\n }", "title": "" }, { "docid": "eb367d9e2fb9f0ba026493d9ac87c637", "score": "0.7254266", "text": "display(list) {\n let listItems = []\n if (list.head === null) {\n return \"list is empty\"\n }\n if (list.head) {\n list = list.head\n }\n while (list.next !== null) {\n listItems.push(list.value)\n list = list.next\n }\n listItems.push(list.value)\n return listItems.join('\\n')\n }", "title": "" }, { "docid": "9021dff012df33318d949069dfdf5c52", "score": "0.72429913", "text": "print() {\n if (this.length === 0) {\n return 'This linked list is empty.';\n }\n let currentNode = this.head;\n let str = currentNode.value;\n for (let i = 0; i < this.length - 1; i++) {\n currentNode = currentNode.next;\n str += ` => ${currentNode.value}`\n }\n return str;\n }", "title": "" }, { "docid": "3da56317c75c120d704c62fd2fcb7eb9", "score": "0.72079796", "text": "display() {\n if (this.top === null) {\n return \"Stack is empty\";\n }\n let node = this.top;\n let nodeValues = \"\";\n while (node) {\n nodeValues += node.value + \" \";\n node = node.next;\n }\n return nodeValues;\n }", "title": "" }, { "docid": "b31c0bfbcaa294c599a85ec524bd403c", "score": "0.7176518", "text": "view() {\n //will have to see all of the nodes....\n //starting from the beginning of our list\n var currentNode = this.head;\n // as long as currentNode exists, or is NOT null\n while(currentNode) {\n console.log(`current nodes value is ${currentNode.value}`)\n // movding on the next node\n currentNode = currentNode.next\n }\n }", "title": "" }, { "docid": "e7d31079f5dd25992177643a26577b8d", "score": "0.7153676", "text": "view() {\n //will have to see all of the nodes...\n //Starting from the beginning of our list\n var currentNode = this.head;\n //as long as curentNode exists , or is NOT null\n while (currentNode) {\n // console.log(`current nodes value is ${curentNode.value}`)\n //moving on to next node\n currentNode = currentNode.next\n }\n }", "title": "" }, { "docid": "4a0708c293c15409960054613844746b", "score": "0.71515405", "text": "printList() {\n // Let's start a runner at the beginning of the singly linked list itself\n var runner = this.head;\n // This string will be added to as we traverse along the SLL\n var string = \"\";\n\n\n // Now we need a way to traverse through the SLL\n\n // If the runner is not null, we're still looking at a node, so we have things to do!\n while(runner != null) {\n // We want to add the node's value to our string, and a fancy little arrow for looks\n string += runner.value + \" -> \";\n // Then, we want to progress the runner to the NEXT node in the SLL\n runner = runner.next;\n }\n \n // Once we've finished moving through the entire list, we want to print the string\n console.log(string);\n }", "title": "" }, { "docid": "bd01df980d24f7d7228078bf219649af", "score": "0.7134142", "text": "function display() {\n let currNode = this.head;\n while(!(currNode.next == null)) {\n console.log(currNode.next.element);\n currNode = currNode.next;\n }\n}", "title": "" }, { "docid": "ded2e88a6432cfad76545a0a7ee903bd", "score": "0.7115485", "text": "printList(){\n let list = []\n let currentNode = this.head\n while(currentNode){\n list.push(currentNode.value)\n currentNode = currentNode.next\n }\n console.log(list.join(\" --> \"))\n }", "title": "" }, { "docid": "ff92e1248d8abab820a4b0816001ac3f", "score": "0.70691735", "text": "printList() {\n var curr = this.head;\n var str = '';\n while (curr) {\n str += curr.element + ' ';\n curr = curr.next;\n }\n console.log(str);\n }", "title": "" }, { "docid": "d2bd6660e9670393ab39ee0fee821a1c", "score": "0.7068592", "text": "printList() {\n var curr = this.head;\n var str = \"\";\n while (curr) {\n str += curr.data + \" \";\n curr = curr.next;\n }\n console.log(str);\n }", "title": "" }, { "docid": "f5d661ace957abc5323bdc2ddb2b24d2", "score": "0.7033347", "text": "display() {\n var runner = this.head;\n var output = '';\n\n while (runner != null) {\n if (runner == this.tail) {\n output += runner.value;\n }\n else {\n output += runner.value + ' - ';\n }\n runner = runner.next;\n }\n\n return output;\n }", "title": "" }, { "docid": "a8167c1cf3567a65b3eb9b76c8c68985", "score": "0.70321935", "text": "function displayLinkedList(list) {\n let currNode = list.head;\n if (!list.head) {\n return null;\n }\n while (currNode !== null) {\n console.log(currNode.value);\n currNode = currNode.next;\n }\n}", "title": "" }, { "docid": "ec809ad696e5171b68a422a058f5163e", "score": "0.6983964", "text": "printList(){\n \n var curr = this.head;\n var str = \"\";\n\n //To iterate over the list use curr != null\n while(curr != null){\n str += \" \" +curr.element;\n curr = curr.next;\n }\n console.log(str);\n }", "title": "" }, { "docid": "2f2e803e05287b15b4e8b9c0a452b053", "score": "0.6969192", "text": "display() {\n var runner = this.head;\n var myList = [];\n while (runner != null) {\n myList.push(runner.val)\n runner = runner.next; // incrementing or changing the value of the runner to the next node\n }\n return myList;\n }", "title": "" }, { "docid": "f8af8d5d08d913761b910edc4ee430fd", "score": "0.6921664", "text": "display() {\n //Start Node Count\n icount = 0;\n //Runner starts at the head\n var runner = this.head;\n //Loop while we have a runner to look at\n while(runner) {\n // log count & node value\n console.log(\"Node\", icount, \"Value = \", runner.value)\n // Get next runner\n runner = runner.next;\n }\n }", "title": "" }, { "docid": "4733c0363cbb87ba10e004f3d9d8408d", "score": "0.6915391", "text": "toString(){\n let output = '';\n var current = this.head;\n while(current){\n output += (`{ ${current.value} } => `);\n // if I'm not pointing to myself...\n if(current !== current.next){ // on the next loop...point to the next node\n current = current.next; // else..I am point to myself becuase I'm at the end\n } else {\n current = null; // so make me null\n }\n }\n output += (`NULL`);\n return output;\n }", "title": "" }, { "docid": "f4c20fbe54b3dadff1bfe9ea76e39023", "score": "0.6898433", "text": "printFrontValue() {\n //Print all of the nodes\n var head = this.head;\n if(head!= null) {\n console.log(head.value); //first 2 nodes will print, but not the rest\n return this;\n }\n else{\n if(this.size == 0){\n return \"List is empty\";\n }\n }\n }", "title": "" }, { "docid": "970023010cad0779ada6de3ba2b39580", "score": "0.68936616", "text": "toString(){//return cadena de todos los valores de c/u nodo\n let aux = this.head, str = this.head.data;\n for(let i = 0; i < this.length-1; i++){\n aux = aux.next\n str += ' ' + aux.data;\n } \n return str; \n }", "title": "" }, { "docid": "1c7cad344a6d8f7d6c43acb91f063692", "score": "0.6859899", "text": "function display(LinkedList) {\n\tvar currNode = LinkedList;\n\twhile(currNode.next !== null) {\n\t\tconsole.log(currNode.element);\n\t\tcurrNode = currNode.next;\n\t}\n\tconsole.log(currNode.element);\n}", "title": "" }, { "docid": "0b17cd6854012f4e1c6e7ba53ca58c63", "score": "0.6854691", "text": "display(){\n var displayValues = '';\n var runner = this.head;\n while(runner != null){\n displayValues += runner.value.toString();\n }\n return displayValues;\n }", "title": "" }, { "docid": "b1ac293a9075b2b9819954866805cfbc", "score": "0.6778961", "text": "printList(){\n let node =''\n let currentHead = this.head\n while(currentHead){\n node =`${node}${currentHead.data} -> `\n currentHead = currentHead.next\n }\n \n console.log(`${node}null`)\n }", "title": "" }, { "docid": "20dc9c975f57a00d9967dda71f8058e6", "score": "0.677665", "text": "toString() {\n if (!this.length) return \"\";\n let str = `${this.head.value}`;\n let current = this.head;\n\n for (let i = 0; i < this.length - 1; i++) {\n current = current.next;\n str += `->${current.value}`;\n }\n return str;\n }", "title": "" }, { "docid": "874c751a9b0954e9752176bbf7f4bcc0", "score": "0.6756526", "text": "function display () {\n afl.display(0)\n\t// console.log('There are ' + all_nodes.size + ' nodes');\n\t// Object.keys(all_nodes).forEach(function (key) {\n\t// var val = all_nodes[key];\n\t// \tfor (var i = 0; i < val.next_hosts.length; i++) {\n\t// \t\tconsole.log('item ' + all_nodes[i]);\n\t// \t console.log(val.hostname + '->' + val.next_hosts[i]);\n\t// \t}\n\t// });\n}", "title": "" }, { "docid": "abce9fc9b10ecdca2cbe63d7b1eb938b", "score": "0.67285967", "text": "printNodes () {\n let node = this.head;\n while (node !== null) {\n console.log(node.value);\n node = node.next;\n }\n }", "title": "" }, { "docid": "82c37516b0f8ea6bfe4d2ce78903e385", "score": "0.66865724", "text": "printListData () {\n let current = this.head; // Set the current to the present node.\n\n while(current) { // If there is a head (this.head, then the variable current will boolean true and execute the following commands. )\n console.table(current.data); // The instructions are to console.table the current data vaalue.\n current = current.next; // The current.next will now equal current so the new node can come into the list. \n }\n }", "title": "" }, { "docid": "98ecb375a68bcfa6968f7264089cda70", "score": "0.6673339", "text": "function display(queue) {\n let s = '-->';\n let curr = queue.first;\n while(curr && curr.next) {\n s += ` ${curr.data},`\n curr = curr.next;\n }\n if (curr) {\n s += ` ${curr.data}`;\n }\n console.log(s);\n}", "title": "" }, { "docid": "e3dbc3c9677f1a474061cc515745f2f8", "score": "0.6659039", "text": "printList() \r\n\t{ \r\n\t var curr = this.head; \r\n\t var str = \" \"; \r\n while (curr) { \r\n str += curr.element; \r\n curr = curr.next; \r\n if(curr){\r\n str += \",\"; \r\n }\r\n }\r\n\t\tconsole.log(str); \r\n\t\treturn document.getElementById('lout').innerHTML = str;\r\n\t}", "title": "" }, { "docid": "62b905ca9738538d2c776d25de50f29e", "score": "0.6644991", "text": "function display(stk) {\n let currNode = stk.top;\n if (stk.top === null) return null;\n while (currNode.next !== null) {\n console.log(currNode.data);\n currNode = currNode.next;\n }\n return;\n}", "title": "" }, { "docid": "dc70775a1520aa4f20d0631dbcb8df35", "score": "0.66427493", "text": "draw() {\n let result = this.head.data+\": \";\n\n if (this.head.next) result += `[${this.head.next.data}]`;\n\n let node = this.head.next.next;\n while (node) {\n result += ` => [${node.data}]`;\n node = node.next;\n }\n\n return result;\n }", "title": "" }, { "docid": "a15363722f8777f0e1beadba3a8f3654", "score": "0.658752", "text": "displayReverse() {\n let currNode = this.head;\n currNode = this.findLast();\n while (currNode.previous !== null) {\n console.log(currNode.element);\n currNode = currNode.previous;\n }\n }", "title": "" }, { "docid": "a6f7680c254534a4a98ab0d5e0f78a1b", "score": "0.65755963", "text": "print() {\n let cur = this.head;\n while (cur) {\n console.log(` --> Node(${cur.key})`);\n cur = cur.next;\n }\n }", "title": "" }, { "docid": "540b2a855031b4cee1cf0af544060141", "score": "0.6573478", "text": "toString()\n {\n if(this.head.getLink() == null){\n return \"NULL\";\n } else {\n s = \"\";\n temp = this.head.getLink();\n while(temp != null){\n s += temp.getData() + \" \";\n temp = temp.getLink();\n }\n return s;\n }\n }", "title": "" }, { "docid": "98ecf779268ad0e1e7e475fcca0c800e", "score": "0.6546346", "text": "printList() {\r\n let currentnode = this.head\r\n if (currentnode == null) {\r\n console.log(\"list is empty\")\r\n return\r\n }\r\n while (currentnode != null) {\r\n console.log(currentnode.data)\r\n currentnode = currentnode.next\r\n }\r\n }", "title": "" }, { "docid": "e6f2f6c66a404cd523993314c6fa6389", "score": "0.6541901", "text": "printList() {\n let currentNode = this.head;\n let output = '';\n \n let list = document.getElementById('list');\n let node = document.createElement('h3');\n let text = document.createElement('p');\n \n // check to see what newest node is and \n // display the corresponding message stating\n // the changes made to the linked list\n if (currentNode === null) {\n text.innerHTML = 'The list is empty';\n list.appendChild(text); node.appendChild(document.createTextNode(currentNode));\n list.appendChild(node);\n } else {\n if (this.addToList && this.addToHead) {\n text.innerHTML = `Add ${this.newestNode} to the head of the linked list`;\n list.appendChild(text);\n } else if (this.addToList && !this.addToHead) {\n text.innerHTML = `Add ${this.newestNode} to the tail of the linked list`;\n list.appendChild(text);\n } else {\n text.innerHTML = 'Remove head from the linked list';\n list.appendChild(text);\n }\n }\n \n // display the current state of the linked list\n while (currentNode !== null) {\n output = currentNode.data + ' ';\n currentNode = currentNode.getNext();\n \n node.appendChild(document.createTextNode(output));\n list.appendChild(node);\n }\n }", "title": "" }, { "docid": "0c449266e66fe0775d929b2ff21f825c", "score": "0.6538982", "text": "printList() {\n let currentNode = this.head\n while (currentNode) {\n console.log(currentNode.element)\n currentNode = currentNode.nextNode\n }\n }", "title": "" }, { "docid": "8b7a4843330356b87cf9df70d45a4212", "score": "0.65381575", "text": "toString() {\n let current = this.head;\n let response = 'Linked List: \\n';\n while (current.next) {\n response += `${current.data} --> ${current.next.data} \\n`;\n current = current.next;\n }\n return response;\n }", "title": "" }, { "docid": "9eff769d2bbe82efde45b7bf1dacc6e8", "score": "0.6525138", "text": "print_tree() {\n let result = \"Traversal using 'next' pointer: \";\n let current = this;\n while (current != null) {\n result += current.value + \" \";\n current = current.next;\n }\n console.log(result);\n }", "title": "" }, { "docid": "f9902088173db85f709978fe054dd175", "score": "0.6521377", "text": "printListData(){\n let currNode = this.head;\n while(currNode){\n console.log(currNode.data );\n currNode = currNode.next;\n }\n }", "title": "" }, { "docid": "c086376e59b839af7ba09c9dca3e7bba", "score": "0.6519025", "text": "print_tree() {\n let result = \"Traversal using 'next' pointer: \";\n let current = this;\n while (current != null) {\n result += current.value + \" \";\n current = current.next;\n }\n console.log(result);\n }", "title": "" }, { "docid": "501ad56ad8324bbd0098aa8b663d416b", "score": "0.6508238", "text": "toString() {\n let string = '';\n let current = this.head;\n while (current !== null) {\n string = string.concat(current.value.toString(), ' ')\n current = current.next;\n }\n return string;\n }", "title": "" }, { "docid": "5340bb609182fb050d858e4983c75f74", "score": "0.64930433", "text": "print(){\n let current = this.head;\n\n while (current !== null) {\n console.log(current.data);\n current = current.next;\n }\n }", "title": "" }, { "docid": "373c6d11f7f86c3c0902c54ce4fdb6d8", "score": "0.64739203", "text": "printList() {\n //Print all of the nodes\n var curr = this.head;\n while(curr!= null) {\n console.log(curr.value); //first 2 nodes will print, but not the rest\n curr = curr.next;\n }\n return this;\n }", "title": "" }, { "docid": "de45bd978ba9120d2900811befbe471d", "score": "0.64721847", "text": "function displayList(list){\n\t//console.log(\"inside displayList \" + list);\n\taddItemToPage(list.head.data);\n\tif (list.head.next !== null){\n\t\tvar nextNode = list.head.next;\n\t\twhile (nextNode !== null){\n\t\t\taddItemToPage(nextNode.data);\n\t\t\tnextNode = nextNode.next;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ad9968abb35822c518f090861a35b8bc", "score": "0.64684093", "text": "function display(linkedList) {\n let tempNode = linkedList.head;\n while (tempNode !== null) {\n console.log(tempNode);\n tempNode = tempNode.next;\n }\n}", "title": "" }, { "docid": "286d550dcd68bab346ba30ad7f347bc5", "score": "0.6415421", "text": "function display(starTrek) {\n let node = starTrek.top;\n while (node !== null) {\n console.log(node.data);\n node = node.next;\n }\n}", "title": "" }, { "docid": "2498279f80bdc8214d27910aadee0807", "score": "0.6409484", "text": "function main() {\n let SLL = new LinkedList();\n\n SLL.insertFirst(\"apollo\");\n SLL.insertFirst(\"boomer\");\n SLL.insertFirst(\"helo\");\n SLL.insertFirst(\"husker\");\n SLL.insertFirst(\"buskler\");\n SLL.insertFirst(\"tahuida\");\n\n SLL.remove(\"buskler\");\n SLL.remove(\"husker\");\n\n SLL.insertBefore(\"Athena\", \"Boomer\");\n\n SLL.insertAfter(\"Hotdog\", \"Helo\");\n\n SLL.insertAt(\"Kat\", 3);\n\n SLL.remove(\"Tauhida\");\n\nconsole.log(display(SLL)); // original display test\nconsole.log(listSize(SLL)); //returns the size of the linked list\nconsole.log(isEmpty(SLL)); // finds if the list is empty or not (without using the size() function)\nconsole.log(findLast(SLL)); //returns the last node in the linked list\nconsole.log(findPrev(SLL, \"Boomer\")); //finds the node before the item you are looking for\nconsole.log(findThird(SLL));\nconsole.log(findMid(SLL));\n\n}", "title": "" }, { "docid": "835f549b0ee90792f6489ad606b4e41f", "score": "0.6393897", "text": "function Tree_display() {\n for(var i=0; i<this.nodes.length; ++i) \n this.nodes[i].display()\n}", "title": "" }, { "docid": "8369d21196b492d719fcf10e247330a4", "score": "0.6388713", "text": "toString() {\n let node = this.head;\n let s = \"[ \"\n while (node != null) {\n if (node.next == null) break;\n s += node.val + \", \";\n node = node.next;\n }\n if (node != null) s += node.val;\n s += \" ]\"\n return s;\n }", "title": "" }, { "docid": "370f18131f4c1eb5769d450fc3923de8", "score": "0.6368673", "text": "function display(queue) {\n let node = queue.first;\n while (node) {\n console.log(node);\n node = node.next;\n }\n}", "title": "" }, { "docid": "626a7f6fa6ac4188ccb25b875afadb6e", "score": "0.63562423", "text": "printList(){\n let currentNode = this.head; \n \n while(currentNode){\n\n console.log(currentNode.data);\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "c34659dbb8a95c3d6e36d3e5ce18c76a", "score": "0.6331923", "text": "show() {\n\n // Temporary variable which will run throught the Queue.\n var temp = this.head;\n\n // For loop will run throughout the Queue & print each node's data.\n for (var i = 0; i < this.size; i++) {\n console.log(temp.data + \" \");\n temp = temp.next;\n }\n }", "title": "" }, { "docid": "ff215e681745ed76c34fee14d7ca6d8c", "score": "0.6322839", "text": "print() {\n let currentNode = this.head;\n while (currentNode) {\n console.log(currentNode);\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "2f1db221ae691bc0349926aad63c9305", "score": "0.63182485", "text": "print()\n { \n let curr_node = this.head;\n console.log(this.size);\n for(let i = 0; i<this.size; i++)\n {\n console.log(`${curr_node.prev.data} <== ${curr_node.data} ==> ${curr_node.next.data}`);\n curr_node = curr_node.next;\n }\n }", "title": "" }, { "docid": "0ca995d1df4846ffa5403b31090ffd9c", "score": "0.6300999", "text": "print() {\n let arr = [];\n let current = this.head;\n while (current) {\n arr.push(current.val);\n current = current.next;\n }\n coonsole.log(arr);\n }", "title": "" }, { "docid": "19a5f24300ff3e0a7364159ec74e7564", "score": "0.62958115", "text": "printList(node) {\n console.log(\"Node is \" + node.getValue());\n if (node.getNext() != null) this.printList(node.getNext());\n }", "title": "" }, { "docid": "0608cb21a223765d2203da06ccf4b021", "score": "0.6277145", "text": "printListData(){\n let current = this.head;\n while(current) {\n console.log(current.data);\n current = current.next;\n }\n }", "title": "" }, { "docid": "cd6ce08142f7bf0e70a8ab61fec0596c", "score": "0.6271887", "text": "toString() {\n let current = this.head;\n let content = '';\n while (current !== null) {\n\n content = content + `{ ${current.data} } -> `;\n current = current.next;\n }\n return content + 'NULL';\n }", "title": "" }, { "docid": "d47ab86cddac8d88f91d915cb811afef", "score": "0.62608165", "text": "printList() {\n // Start at the head\n let currentNode = this.headNode;\n\n while (currentNode.next !== null) {\n console.log(\"print list => \", currentNode);\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "669a120de231b7cb80e6bd3852c47311", "score": "0.62540615", "text": "printListData()\n {\n var current =this.head\n\n while(current)\n {\n console.log(current.data)\n current=current.next\n }\n }", "title": "" }, { "docid": "00b66569aef81f6d396b932f86b00b5e", "score": "0.6251494", "text": "print (){\n let valArr = [];\n let currentVal = this.head;\n while(currentVal){\n valArr.push(currentVal.value);\n currentVal = currentVal.next;\n }\n return valArr;\n }", "title": "" }, { "docid": "4171289c364b976b5ab7285e73d8f89d", "score": "0.6240529", "text": "printList() {\n if (this.head === null) {\n return console.log(\"The list is empty!!!\");\n }\n \n let runner = this.head;\n \n while(runner !== null) {\n console.log(\"Node value is: \" + runner.value);\n runner = runner.next;\n }\n console.log(\"END =================================\")\n return this;\n }", "title": "" }, { "docid": "bb3b541a50aebc9f4a4c66e7d0e202ef", "score": "0.62385184", "text": "printListData() {\n let current = this.head;\n\n while (current) {\n console.log(\"print list data\", current);\n current = current.next;\n }\n }", "title": "" }, { "docid": "1357cbc760cd3ccc98e068466ba08fba", "score": "0.62373227", "text": "printList() {\n let temp = this.head;\n while (temp != null) {\n console.log(temp.data);\n temp = temp.next;\n }\n }", "title": "" }, { "docid": "324360519615b164e0715a80810c25b3", "score": "0.6234887", "text": "print_list_data(){\n var curr_data = this.head;\n while(curr_data){\n console.log(curr_data.data);\n curr_data = curr_data.next;\n }\n }", "title": "" }, { "docid": "6232f7ad7485e961649d9f61572ade90", "score": "0.6234124", "text": "print() {\r\n\t\tlet arr = [];\r\n\t\tlet current = this.head;\r\n\t\twhile(current) {\r\n\t\t\tarr.push(current.val);\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\tconsole.log(arr);\r\n\t}", "title": "" }, { "docid": "6232f7ad7485e961649d9f61572ade90", "score": "0.6234124", "text": "print() {\r\n\t\tlet arr = [];\r\n\t\tlet current = this.head;\r\n\t\twhile(current) {\r\n\t\t\tarr.push(current.val);\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\tconsole.log(arr);\r\n\t}", "title": "" }, { "docid": "87b0d2f958159fce3a44e0a90f6602ca", "score": "0.61765677", "text": "printList() {\n let curNode = this.head;\n\n while(curNode.next !== this.head || curNode.next !== null) {\n console.log(curNode);\n curNode = curNode.next;\n }\n }", "title": "" }, { "docid": "7e8a462c69c816004a60e80e6e7d38bd", "score": "0.6163454", "text": "toString() {\n let collection = '';\n let current = this.head;\n while (current != null) { // current !== null || current !== undefined\n collection += `{ ${current.value} } -> `\n current = current.next;\n }\n collection += 'NULL'\n return collection;\n }", "title": "" }, { "docid": "a4f09a71cc997d027304f8f8dc74c790", "score": "0.6140423", "text": "display(node=this.root, prefix=\"\", isTail=true) {\n\n console.log(prefix + (isTail ? '└──' : '├──') + node.data)\n if (node.left) this.display(node.left, \"\", false)\n if (node.right) this.display(node.right, \"\", false)\n // if(!(node.left && node.right))\n }", "title": "" }, { "docid": "142dcd53e0645aa7655da189b7382a22", "score": "0.6127293", "text": "function outputList(head) {\n let pointer = head;\n while (true) {\n console.log(pointer.value)\n if (pointer.next) {\n pointer = pointer.next;\n } else {\n break;\n }\n }\n}", "title": "" }, { "docid": "794ebb93b5023a3e88d307a68adecbc5", "score": "0.6125695", "text": "printListData() {\n let current = this.head;\n console.log(\"data\");\n while (current) {\n console.log(current.data);\n current = current.next;\n }\n }", "title": "" }, { "docid": "8267c2335cccdf98fa926637e9d4d9fb", "score": "0.61109954", "text": "function displayLL(sll) {\n if (sll.head === null) {\n console.log('no list');\n return;\n }\n let currNode = sll.head;\n \n let arrList = [];\n while (currNode !== null) {\n //console.log(currNode);\n \n arrList.push(currNode.value);\n \n currNode = currNode.next;\n }\n \n return arrList;\n \n }", "title": "" }, { "docid": "965234338c7e8fd09d1b4f9b7a10599c", "score": "0.60980016", "text": "print() {\n let arr = [];\n let current = this.head;\n while(current) {\n arr.push(current.value);\n current = current.next;\n }\n console.log(arr);\n }", "title": "" }, { "docid": "2a7035a2dc975454126ca7ebf4e9ff15", "score": "0.60772765", "text": "display(representation,next) {\n if (next) {\n next(representation) ;\n } \n }", "title": "" }, { "docid": "c14456508cdf2c40df069b5546985b74", "score": "0.60754204", "text": "printList(){\n const array = [];\n let currentNode = this.head;\n while (currentNode !== null){\n array.push(currentNode.value);\n currentNode = currentNode.next;\n }\n return array;\n}", "title": "" }, { "docid": "6469c14baa4467a98a6f358310aa3c3c", "score": "0.60636955", "text": "function printList(node) {\n\t\twhile (node != null) {\n\t\t\tdocument.write(node.data + \" \");\n\t\t\tnode = node.next;\n\t\t}\n\t}", "title": "" }, { "docid": "9928951c294694a7f3b1089f4250c8b8", "score": "0.6060222", "text": "reversePrintList(node) {\n if (node == null){\n return;\n }\n this.reversePrintList(node.getNext());\n console.log(\"Node is \" + node.getValue());\n }", "title": "" }, { "docid": "81748b79c811e28ad63e8def65144d61", "score": "0.6058745", "text": "toString() {\n if (!this.head) {\n throw new CustomError('this linked list is empty!');\n }\n let current = this.head;\n let str = '';\n while (current) {\n str += `{ ${current.value} } -> `;\n current = current.next;\n }\n return `${str}NULL`;\n }", "title": "" }, { "docid": "9de2cf65bcfd59b275aa63368fb48960", "score": "0.6048099", "text": "traverse ()\n {\n let current = this.head;\n while(current)\n {\n console.log(current.value);\n current = current.next;\n }\n \n }", "title": "" }, { "docid": "122ec49f2c746868b181f1be66785bad", "score": "0.6034113", "text": "print() {\n let arr = [];\n let current = this.head;\n while (current) {\n arr.push(current.val)\n current = current.next\n }\n console.log(arr);\n }", "title": "" }, { "docid": "4c6ea044b27ab09ffcceb3874710078a", "score": "0.6020651", "text": "print(){\n var arr= [];\n var current = this.head\n while(current){\n arr.push(current.val)\n current = current.next;\n }\n console.log(arr);\n }", "title": "" }, { "docid": "6e3d62ecc72c65eb3334bf2e7e933015", "score": "0.6017294", "text": "print() {\n let arr = [];\n let current = this.head;\n while (current) {\n arr.push(current.val);\n current = current.next;\n }\n console.log(arr);\n }", "title": "" }, { "docid": "6e3d62ecc72c65eb3334bf2e7e933015", "score": "0.6017294", "text": "print() {\n let arr = [];\n let current = this.head;\n while (current) {\n arr.push(current.val);\n current = current.next;\n }\n console.log(arr);\n }", "title": "" }, { "docid": "826b079d7e0daf7f2f4e8936cc6cadec", "score": "0.59974474", "text": "function main() {\n const SLL = new LinkedList();\n SLL.insertLast(\"Apollo\");\n SLL.insertLast(\"Boomer\");\n SLL.insertLast(\"Helo\");\n SLL.insertLast(\"Husker\");\n SLL.insertLast(\"Starbuck\");\n console.log(SLL.view());\n SLL.insertFirst(\"Tauhida\");\n console.log(SLL.view());\n SLL.insertAt(3, \"Kat\");\n console.log(SLL.view());\n console.log(SLL.getProperties());\n SLL.remove(\"Tauhida\");\n console.log(SLL.getProperties());\n console.log(SLL.view());\n\n //console.log(SLL.find(\"marco\"));\n}", "title": "" }, { "docid": "106bd0a0034232fd785971b88725548e", "score": "0.59953624", "text": "printData() {\n let current = this.head\n\n while (current) {\n console.log(current.data)\n current = current.next\n }\n }", "title": "" }, { "docid": "2e6dfcfafe1fb03a749a1f1b15d3d9cb", "score": "0.59896564", "text": "print(){\n var arr = [];\n var current = this.head\n while(current){\n arr.push(current.val)\n current = current.next\n }\n console.log(arr);\n }", "title": "" }, { "docid": "a91c8a25a278a8ba33ca2069d82a473c", "score": "0.5987847", "text": "print(){\n let arr=[];\n let currNode = this.head;\n while(currNode){\n arr.push(currNode.val);\n currNode = currNode.next;\n }\n console.log(arr);\n }", "title": "" }, { "docid": "f9fd4acca157c15dc7decf2d13798fa5", "score": "0.5985388", "text": "printList() {\n const ar = [];\n let currentNode = this.head;\n while(currentNode!==null) {\n ar.push(currentNode.value);\n currentNode = currentNode.next;\n }\n return ar;\n }", "title": "" }, { "docid": "85bd4690b78a373a679f675c007749d2", "score": "0.59639806", "text": "print() {\n let arr = []\n let current = this.head\n while (current) {\n arr.push(current.val)\n current = current.next\n }\n return arr\n }", "title": "" } ]
a1090bce586f1e0f8cff0cbcff663719
worker methods run under the global channel context and broadcast to all sockets listening to the channel
[ { "docid": "499dbdb29183f5d200561662897db111", "score": "0.5950564", "text": "spawn(channel, domain, node, workers)\n\t\t\t\t{\n\t\t\t\t\tthis.channel = channel;\n\t\t\t\t\tconst {sources, sinks} = channels[channel];\n\t\t\t\t\tconst {state} = application;\n\t\t\t\t\tapplication.nodes([domain, node], {connected:false, error:false, ready:false});\n\t\t\t\t\tconst listen = type => {\n\t\t\t\t\t\t// some tests can be skipped for the collector method since the loop calling the listen function is walking the same source object\n\t\t\t\t\t\tconst collector = sources[domain][type];\n\t\t\t\t\t\t// a corresponding emitter method may not exist if an application does not need to echo a particular data type to clients\n\t\t\t\t\t\tconst emitter = includes([domain, type]).in(sinks) && sinks[domain][type];\n\t\t\t\t\t\treturn async data => {\n\t\t\t\t\t\t\tif (isFunction(collector))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// allow the collector method to complete before attempting to call a corresponding emitter\n\t\t\t\t\t\t\t\tawait collector.call(this, {node, data});\n\t\t\t\t\t\t\t\t// an emitter method should always fire after a corresponding collector method to ensure that clients are kept in sync\n\t\t\t\t\t\t\t\tif (isFunction(emitter))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// the application.cache method will allocate cache storage in the process of walking the cache path\n\t\t\t\t\t\t\t\t\t// don't create storage here for message types that don't need to be cached by the application\n\t\t\t\t\t\t\t\t\t// allow the application to create cache entries only for things that need it\n\t\t\t\t\t\t\t\t\tlet cache;\n\t\t\t\t\t\t\t\t\tincludes([domain, type]).in(state.cache) && (cache = application.cache([domain, type]));\n\t\t\t\t\t\t\t\t\temitter.call(this, cache);\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// global message types appended to sources for all domains\n\t\t\t\t\t// these are reserved types and should not be overridden unless you know what you're doing!\n\t\t\t\t\tconst routes = {\n\t\t\t\t\t\tflags:flags => {\n\t\t\t\t\t\t\tfor (const [type, flag] of iterable(flags)) {application.nodes(this, [domain, node, type], flag);}\n\t\t\t\t\t\t\t// trigger any routines waiting for ready\n\t\t\t\t\t\t\tconst {ready, error} = flags;\n\t\t\t\t\t\t\t(ready || error) && signalReady();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tresponse:response => device.response(response)\n\t\t\t\t\t};\n\t\t\t\t\t// decorate routes with listeners for defined domain sources\n\t\t\t\t\tfor (const type of iterable(sources[domain], KEYS)) {routes[type] = listen(type);}\n\t\t\t\t\tdebugLog({routes, [domain]:node});\n\t\t\t\t\t// spawn a child process to manage device messaging and control\n\t\t\t\t\tconst device = assign(workers[node]).to(new Driver(routes, channel, domain, node, this.respawnTime, this.driverPath));\n\t\t\t\t\tworkers[node] = device;\n\t\t\t\t}", "title": "" } ]
[ { "docid": "5729838c01a7863e41358b9098372b09", "score": "0.6512833", "text": "function broadcast() {\n\twss.clients.forEach(ws => {\n\t\tsend(ws, ...arguments);\n\t});\n}", "title": "" }, { "docid": "210dcb92780020ab0f8b23fb9d6bd828", "score": "0.6490887", "text": "function BroadcastChannel () {}", "title": "" }, { "docid": "3ef2c4960942a46ca86e3c9ab90602b0", "score": "0.6118141", "text": "run() {\n const self = this;\n\n self.scServer.on('connection', (socket) => {\n socket.on('new_message', ({from, to, msg}) => {\n self.scServer.exchange.publish(`new_message_${from}_${to}`, { msg })\n });\n\n socket.on('typing', (from, to) => self.scServer.exchange.publish(`${from}isTyping${to}`));\n socket.on('stop typing', (from, to) => self.scServer.exchange.publish(`${from}stopTyping${to}`));\n });\n }", "title": "" }, { "docid": "795c91b493474fde29fa38ea81a8a0f3", "score": "0.6011661", "text": "function Worker(rpcPort, subPort) {\n events.EventEmitter.call(this);\n\n var self = this;\n\n this.master = new events.EventEmitter();\n\n var sub_sock = this.sub_sock = axon.socket('sub');\n sub_sock.format('json');\n sub_sock.connect(subPort);\n sub_sock.on('message', function(msg) {\n self.master.emit(msg.type, msg.data);\n });\n\n var rpc_sock = this.req = axon.socket('req');\n this.client = new rpc.Client(rpc_sock);\n rpc_sock.connect(rpcPort);\n\n var generateMethods = function(cb) {\n log('Requesting and generating RPC methods');\n self.client.methods(function(err, methods) {\n Object.keys(methods).forEach(function(key) {\n var method_signature, md;\n method_signature = md = methods[key];\n\n log('+-- Creating %s method', md.name);\n\n (function(name) {\n self.master[name] = function() {\n log(\"calling:%s\",name);\n var args = Array.prototype.slice.call(arguments);\n args.unshift(name);\n log(\"with args:%j\", args);\n self.client.call.apply(self.client, args);\n };\n })(md.name);\n\n });\n return cb();\n });\n };\n\n var ready = function() {\n if (self.connected()) {\n generateMethods(function() {\n self.sendToPM2(\"process:ready\",\"Ready to roll!\");\n self.emit('ready');\n });\n }\n };\n\n rpc_sock.on('connect', function() {\n log('rpc_sock:ready');\n self.emit('rpc_sock:ready');\n ready();\n });\n\n rpc_sock.on('close', function() {\n log('rpc_sock:closed');\n self.emit('close');\n });\n\n rpc_sock.on('reconnect attempt', function() {\n log('rpc_sock:reconnecting');\n self.emit('reconnecting');\n });\n\n sub_sock.on('connect', function() {\n log('sub_sock ready');\n self.emit('sub_sock:ready');\n ready();\n });\n\n sub_sock.on('close', function() {\n log('sub_sock:closed');\n self.emit('closed');\n });\n\n sub_sock.on('reconnect attempt', function() {\n log('sub_sock:reconnecting');\n self.emit('reconnecting');\n });\n\n var gracefulShutdown = function() {\n try {\n sub_sock.close();\n rpc_sock.close();\n } catch (e) {}\n };\n\n // listen for TERM signal .e.g. kill \n process.on ('SIGTERM', gracefulShutdown);\n\n // listen for INT signal e.g. Ctrl-C\n process.on ('SIGINT', gracefulShutdown); \n}", "title": "" }, { "docid": "f8204eb5fa097d35940e779833dfb968", "score": "0.59059197", "text": "function broadcast(data) {\n for (c in connections) { // iterate over the array of connections\n connections[c].send(data); // send the data to each connection\n }\n}", "title": "" }, { "docid": "6d748b0b139996fff66841894415258e", "score": "0.5886696", "text": "function messageAll(channel, data) {\n for (let i in SOCKET_LIST) {\n let socketC = SOCKET_LIST[i];\n socketC.emit(channel, data);\n }\n}", "title": "" }, { "docid": "fa2c208a9a479dd33952faa5b52b9036", "score": "0.5858517", "text": "connect() {\n var s_h = this.config.server_host, c_p = this.config.server_port;\n this.socket = io.connect(\"http://\" + s_h + \":\" + c_p);\n for (let channel of this.config.channels) {\n console.log(`Mediator created channel with name = ${channel}`);\n this.socket.on(channel, (o) => {\n this.iqueue.push(o);\n });\n }\n }", "title": "" }, { "docid": "01d48b8431f84d7d9a11dd42fe54e089", "score": "0.58416694", "text": "async function start() {\n for (const result of getIterator()) {\n await sleep(1000); // delay\n parentPort.postMessage(result);\n log(util.inspect(`sent guild: ${result.guild} channel: ${result.channel}`));\n }\n process.exit(0);\n}", "title": "" }, { "docid": "b4589bdf8b0bbedb6c2ab71f869e4e00", "score": "0.5839812", "text": "function openSockets() {\n if ($state.current.name === 'jobResult') {\n $log.debug(\"socket watching on job_events-\" + job_id);\n $scope.$on(`ws-job_events-${job_id}`, function() {\n $log.debug(\"socket fired on job_events-\" + job_id);\n if (api_complete) {\n event_queue++;\n }\n });\n }\n if ($state.current.name === 'adHocJobStdout') {\n $log.debug(\"socket watching on ad_hoc_command_events-\" + job_id);\n $scope.$on(`ws-ad_hoc_command_events-${job_id}`, function() {\n $log.debug(\"socket fired on ad_hoc_command_events-\" + job_id);\n if (api_complete) {\n event_queue++;\n }\n });\n }\n }", "title": "" }, { "docid": "843ad300bb8babb7ee48fbad09596774", "score": "0.5810794", "text": "dispatch(socket, data)\n\t\t\t\t{\n\t\t\t\t\tconst {channel} = this;\n\t\t\t\t\tconst {sources} = channels[channel];\n\t\t\t\t\twalk(sources, data, iteratorFactory(socket));\n\t\t\t\t}", "title": "" }, { "docid": "4650a923b4e63fdf61b85fb07a1b2e6f", "score": "0.5787426", "text": "function Broadcast() {\n this.pool = new WebSocketPool();\n}", "title": "" }, { "docid": "7b9a79be6942f8254faacc9c43de88bf", "score": "0.575306", "text": "function broadcast(data) {\n Object.keys(connections).forEach(function(key) {\n var connection = connections[key];\n if (connection.connected) {\n connection.send(data);\n }\n });\n}", "title": "" }, { "docid": "40323e242bab8ac6812468b57ca65bd3", "score": "0.5750452", "text": "listenBroadcastQueue() {\n\t\tamqp.connect(this.mqHost, (error0, connection) => {\n\t\t\tif (error0) {\n\t\t\t\tLog.info(`p2p.server.get.broadcast.data.connect.error ${error0}`);\n\t\t\t\tthrow error0;\n\t\t\t}\n\t\t\tconnection.createChannel((error1, channel) => {\n\t\t\t\tif (error1) {\n\t\t\t\t\tLog.info(`p2p.server.get.broadcast.data.connect.channel.error ${error1}`);\n\t\t\t\t\tthrow error1;\n\t\t\t\t}\n\n\t\t\t\tchannel.assertQueue(this.broadcastQueue, { durable: false });\n\n\t\t\t\tLog.info(`p2p.server.get.broadcast.data.connect.channel.listen.queue ${this.broadcastQueue}`);\n\n\t\t\t\tchannel.consume(\n\t\t\t\t\tthis.broadcastQueue,\n\t\t\t\t\t(message) => {\n\t\t\t\t\t\tLog.info(`p2p.server.get.broadcast.data.listen.queue ${this.broadcastQueue}`);\n\t\t\t\t\t\tLog.info(`p2p.server.get.broadcast.data.listen.queue.message ${message.content.toString()}`);\n\t\t\t\t\t\tthis.route(JSON.parse(message.content.toString()));\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tnoAck: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t});\n }", "title": "" }, { "docid": "5147c5fce2cfc943e74b0de4a500d9e2", "score": "0.5746877", "text": "function run(worker) {\n var msgChannel = new MessageChannel();\n worker.postMessage(\"setup\", [msgChannel.port2]);\n msgChannel.port1.onmessage = function(evt) {\n var args = evt.data;\n console.log.apply(console, args);\n }\n }", "title": "" }, { "docid": "9b43c3b6d384112767855e1a529e644b", "score": "0.5736199", "text": "setupWorkers() {\n this.AppWorker = new AppWorker();\n this.AppWorker.addEventListener(\"message\", this.handleAppWorkerMessage.bind(this));\n this.AppWorkerCallbacks = {};\n this.AppWorkerCallbackId = 0;\n }", "title": "" }, { "docid": "588107b78df5e3da4d5c5fcca4fc5f55", "score": "0.5728992", "text": "function _broadcast() {\n debug('broadcasting: %j', arguments);\n this.client.broadcast.apply(this.client, arguments);\n this.server.broadcast.apply(this.server, arguments);\n}", "title": "" }, { "docid": "fc1889f357228581d69cca61037d641f", "score": "0.57183063", "text": "function check (){\n\t\t\tif(dummy.length == numCPUs) {\n\t \t\t\tconsole.log(\"broadcasting\");\n\t\t\t\t for (var i in workers) {\n\t\t\t \t \tvar worker = workers[i];\n \t \t\t\t\tworker.send('Master');\n\t \t\t\t }\n\t\t\t}\n \t\t}", "title": "" }, { "docid": "a864b64d29410838511aa8c6b25d0806", "score": "0.57154495", "text": "function broadcast(data) {\n Object.keys(connections).forEach(function(key) {\n const connection = connections[key];\n if (connection.connected) {\n connection.send(data);\n }\n });\n}", "title": "" }, { "docid": "e12c069a8fa26a0a3560bb1bc2d69c9c", "score": "0.57105184", "text": "broadcast() {\n return AsyncM.liftIO(k => k(new Emitter()))\n .bind(e => this.run(x => e.emit(x))\n .fork()\n .bind(p => AsyncM.pure([e, p])));\n }", "title": "" }, { "docid": "5b69d6e393f19714a1c8a3299eb2ae36", "score": "0.56943905", "text": "function main() {\n var server = new grpc.Server();\n server.addProtoService(slack.Dispatch.service, {\n sendMessage: dispatch.sendMessage,\n createChannel: dispatch.createChannel\n });\n server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());\n server.start();\n}", "title": "" }, { "docid": "af4e60855140253ce104b203a0441c6c", "score": "0.5692139", "text": "connect() {\n var host = config.server_host, port = config.server_port;\n console.log(`*** mediator: ${config['_state']} connecting to server ${host}:${port}`);\n this.socket = io.connect(\"http://\" + host + \":\" + port);\n for (let channel of config.channels) {\n this.log(`Mediator created channel with name = ${channel}`);\n this.socket.on(channel, (o) => {\n queue_1.queue.push(o);\n });\n }\n }", "title": "" }, { "docid": "dcf3fbc3002d7eb5ff6f7e54b6c53944", "score": "0.568261", "text": "_broadcast(event) {\n for (let listener of this.listeners) {\n setTimeout(function () {\n listener(event);\n });\n }\n }", "title": "" }, { "docid": "8795b66464fbb9f8f5de3fc5efb65a66", "score": "0.56576836", "text": "run (callback) {\n\t\tif (this.config.broadcastEngine.selected !== 'pubnub') {\n\t\t\treturn callback();\n\t\t}\n\t\tBoundAsync.series(this, [\n\t\t\tthis.listenOnClient,\t\t// listen on the client pubnub for the message we're going to send\n\t\t\tthis.sendRandomFromServer,\t// send a random message, simulating a message sent from the server\n\t\t\tthis.waitForMessage,\t\t// wait for it\n\t\t\tthis.clearTimer\t\t\t\t// clear the timer, so we don't trigger a failure\n\t\t], callback);\n\t}", "title": "" }, { "docid": "428921205c2d2d10565fd4e758a22831", "score": "0.5639377", "text": "listen() {\n //to create the web socket server we can use a server class that is contained in the websocket module and is shared statically\n //this gives the blocking application instance the ability to generate a server for other instances to connect to\n const server = new Websocket.Server({ port: P2P_PORT });\n server.on('connection', socket => this.connectSocket(socket)); //pushes socket to array of sockets\n\n this.connectToPeers();\n\n\n console.log(`Listening for peer-to-peer connections on: ${P2P_PORT}`)\n }", "title": "" }, { "docid": "f67d73a8c12c94fc48ee109e32a01df5", "score": "0.5630523", "text": "listenToIpc () {\n\t\tthis.services.ipc.on('request', this.handleIpcRequest.bind(this));\n\t}", "title": "" }, { "docid": "2aef1574bb2fedc992a34c5a901fa0b9", "score": "0.5612314", "text": "syncCallbacks(){\n log.info(\"Syncing callbacks for new socket connection\");\n for(let route in activeCallbacks){\n this.socket.on(route, (...params)=>{\n activeCallbacks[route](this, this.socket, ...params);\n });\n }\n }", "title": "" }, { "docid": "c885180ceaa4bde1a086b8ea16ecef80", "score": "0.56100005", "text": "function broadcast(msg){\n wss.clients.forEach(function each(client) {\n if (client.readyState === WebSocket.OPEN) {\n client.send(msg);\n }\n });\n}", "title": "" }, { "docid": "28a58a722bab9f2a2e925abc4e08f717", "score": "0.56076086", "text": "function msgFromWorker(msg) {\r\n log(\"master received msg \", msg)\r\n if (msg.broadcast) {\r\n Object.keys(cluster.workers).forEach(function(id) {\r\n cluster.workers[id].send(msg)\r\n })\r\n }\r\n }", "title": "" }, { "docid": "cc2aa769e9787d18600e9fe67e4432bc", "score": "0.56032073", "text": "initWorker() {\n // Setup the message handler\n this.worker.onmessage = (e) => {\n var msg = e.data;\n if (msg.error) {\n console.error(\"Got error back !!! \");\n console.error(msg.error.stack);\n }\n // @TODO handle exceptions better and call callback\n var id = msg.id;\n if (id) {\n var handler = this.registry[id];\n if (handler) {\n delete this.registry[id];\n handler(msg.error, msg.result);\n }\n }\n else {\n var params = msg.params;\n var methodName = msg.method;\n if (methodName && (methodName === \"setBusy\")) {\n Cats.IDE.statusBar.setBusy(params[0], params[1]);\n }\n if (methodName && (methodName === \"console\")) {\n console[params[0]](params[1]);\n }\n }\n };\n }", "title": "" }, { "docid": "ccb7bece2894527c37e5daf7c71fe3aa", "score": "0.55965483", "text": "_spawnWorker() {\n const worker = Cluster.fork({worker_type: this.type, env: this.app.currentEnvironment});\n\n this._workerIds[this.type].push(worker.id+\"\");\n\n this._log(this.type+': started worker id='+worker.id);\n\n // noinspection JSUnusedGlobalSymbols\n worker.on('exit', (code, signal) => {\n\n // Is this our worker?\n const id = worker.id + \"\";\n\n // Remove the reference to the worker id\n this._workerIds[this.type].splice(this._workerIds[this.type].indexOf(id), 1);\n\n if (!this.app.gracefulShutdown && !this.drainOpen) {\n\n if (worker.exitedAfterDisconnect === true) {\n // Death was intentional, so don't spawn again\n this.emit('worker_ended', { id, code, signal, worker });\n } else {\n this.app.report(new Error(this.type + ' worker id='+ worker.id +' died!'), { broker: this.type, worker_id: id, code: code, signal: signal });\n this.emit('worker_death', { id, code, signal, worker });\n }\n\n // Replace this worker in the workforce\n this._spawnWorker();\n\n } else {\n this.emit('worker_ended', { id, code, signal, worker });\n this._log(this.type +': shutting down, will not respawn workers');\n }\n\n });\n\n // noinspection JSUnusedGlobalSymbols\n /* istanbul ignore next */\n worker.on('error', (err) => {\n this.app.report(this.type + ': Worker error!', err);\n });\n\n // noinspection JSUnusedGlobalSymbols\n worker.on('disconnect', () => {\n if (worker._disconnectTimer) {\n this._log(this.type + ': cleared worker id='+worker.id+' disconnect timeout');\n clearTimeout(worker._disconnectTimer);\n } else {\n this._log(this.type + ': Worker id=' + worker.id+' disconnected - No timeout to clear. Did it crash?');\n }\n\n // noinspection JSUnusedGlobalSymbols\n setTimeout(() => {\n if (!worker.isDead()) {\n // Worker is still hanging around. Kick it's butt!\n worker.kill();\n this._log(this.type + ': followup on worker id='+worker.id+': was still alive so we killed it');\n }\n }, 1000);\n\n });\n\n // noinspection JSUnusedGlobalSymbols\n worker.on('message', (msg) => {\n if (typeof msg === \"object\" && msg.type === \"ops\") {\n // TODO – Handle worker metrics by sending to Redis for aggregation (worker.id, msg.data)\n this.emit('worker_ops', msg, worker);\n } else {\n // If anyone cares, pass the event on to the broker's handlers\n this.emit('worker_message', msg, worker);\n }\n });\n }", "title": "" }, { "docid": "bfd58474769172a3e7d6079247bbd890", "score": "0.5585926", "text": "function sendToAll(){\n for (klient in io.sockets.clients()){\n _client = io.sockets.clients()[klient];\n _client.emit.apply(_client, arguments);\n }\n }", "title": "" }, { "docid": "964d1c88821e14fab05ee594c3f8c1aa", "score": "0.5578511", "text": "@dispatch.on('game')\n _broadcastGame(game)\n {\n for (const c of this.clients) {\n c.send('game', game);\n }\n }", "title": "" }, { "docid": "ca64e3882b3fbf002da3f138d420c031", "score": "0.5560158", "text": "function run() {\n\tlog.info('starting cluster worker %s', config.getGsid());\n\tsegfaultHandler.registerHandler();\n\tRQ.init();\n\t// initialize and wait for modules required for GS operation\n\tasync.series([\n\t\tpersInit,\n\t\tauthInit,\n\t\trpcInit,\n\t],\n\tfunction callback(err, res) {\n\t\tif (err) throw err; // bail if anything went wrong\n\t\t// otherwise, start listening for requests\n\t\tprocess.on('message', onMessage);\n\t\t// bind SIGINT here too, because it is also sent to child processes\n\t\t// when running the GS from the command line and pressing ctrl+c\n\t\tprocess.on('SIGINT', shutdown);\n\t\tamfServer.start();\n\t});\n\t// gsjs bridge loads stuff in the background (don't need to wait for it)\n\tgsjsBridge.init(function callback(err) {\n\t\tif (err) log.error(err, 'GSJS bridge initialization failed');\n\t\telse log.info('GSJS prototypes loaded');\n\t});\n\t// start REPL server if enabled\n\tif (config.get('debug').repl && config.get('debug:repl:enable')) {\n\t\treplServer.init();\n\t}\n\tif (config.get('slack:chat:token', null)) {\n\t\tslackChat.init();\n\t}\n\tstartGCInterval();\n}", "title": "" }, { "docid": "bf149e59123ab5e988de97cc76c512d0", "score": "0.5550676", "text": "broadcast(message) {\n for (let conn of Connection.all.values()) {\n try {\n conn.ws.send(JSON.stringify(message))\n console.log(\"broadcast \" + JSON.stringify(message))\n } catch(err) {\n console.log(\"caught websocket send error: \" + err)\n }\n }\n }", "title": "" }, { "docid": "b47ed97dac80eebaff79cf2768614b53", "score": "0.5525697", "text": "function startWorker() {\n amqpConn.createChannel( function(err, ch) {\n if (closeOnErr(err)) {\n return;\n }\n\n ch.on(\"error\", function(err) {\n console.error(\"[AMQP] channel error\", err.message);\n });\n\n ch.on(\"close\", function() {\n console.log(\"[AMQP] channel closed\");\n });\n\n ch.prefetch(10);\n\n ch.assertQueue(\"celery\", { durable: true }, function(err, _ok) {\n if (closeOnErr(err)) {\n return;\n } \n\n ch.consume(\"celery\", processMsg, { noAck: false });\n\n console.log(\"Worker is started\");\n });\n\n function processMsg(msg) {\n work(msg, function(ok) {\n try {\n if (ok) {\n ch.ack(msg);\n }\n else {\n ch.reject(msg, true);\n }\n } catch (e) {\n closeOnErr(e);\n }\n });\n } \n });\n}", "title": "" }, { "docid": "150fa015636f89161d6a813e36803045", "score": "0.55251336", "text": "receiveLoop (connection) {\n erlInterface.receive(connection, (status, from, to, buffer) => {\n if (status === 'ok') {\n if (from) {\n from = binary_to_term(from);\n }\n if (!(typeof to === 'string')) {\n to = binary_to_term(to);\n }\n const data = binary_to_term(buffer);\n if (is_tuple(data) && is_reference(get_tuple(data)[0])) {\n const ref = get_tuple(data)[0];\n const reply = get_tuple(data)[1];\n if (typeof this.references.get(this.get_ref_key(ref)) === 'function') {\n this.references.get(this.get_ref_key(ref))(reply);\n this.references.delete(this.get_ref_key(ref));\n }\n }\n try {\n if (typeof this.registeredNames[to] === 'function') {\n this.registeredNames[to](this, from, data);\n } else if (typeof this.registeredNames[to] === 'object' && typeof this.registeredNames[to].receive === 'function') {\n this.registeredNames[to].receive(this, from, data);\n }\n } catch(err) {\n throw new Error('Failed in call to registred server:');\n }\n\n for (let i = 0; i < this.persistentReceiveCallbacks.length; i++) {\n if (typeof this.persistentReceiveCallbacks[i] === 'function') {\n this.persistentReceiveCallbacks[i](from, to, data);\n } // Todo: Else remove item from array?\n }\n for (let i = 0; i < this.receiveCallbacks.length; i++) {\n if (typeof this.receiveCallbacks[i] === 'function') {\n this.receiveCallbacks[i](from, to, data);\n }\n }\n this.receiveCallbacks = [];\n this.receiveLoop(connection);\n } else if (status === 'closed') {\n for (let node in this.connections) {\n if (this.connections[node] === connection) {\n delete this.connections[node];\n }\n }\n }\n })\n }", "title": "" }, { "docid": "c8de246f19c40215ad8fea55137faa78", "score": "0.5521179", "text": "broadcast(event: Event): void {\n this._instances.forEach(instance => instance.send(event));\n }", "title": "" }, { "docid": "ceb4ceaed32740abfb3f482327da5f96", "score": "0.5519801", "text": "function broadcast(data) {\n\tconsole.log(data)\n\t// iterate over the array of clients & send data to each\n\tfor (c in clients) {\n\t\tclients[c].send(JSON.stringify(data));\n\t}\n}", "title": "" }, { "docid": "32734e9a4ea37be1542ddda954da5d43", "score": "0.5512427", "text": "broadcast(message) {\n for (let conn of Connection.all.values()) {\n try {\n conn.ws.send(JSON.stringify(message))\n } catch(err) {\n console.log(\"caught websocket send error: \" + err)\n }\n }\n }", "title": "" }, { "docid": "064348221137d40b7c5f200b852822c0", "score": "0.54995924", "text": "connect () {\n if (!this.tc.onlineConns.has(this)) {\n this.tc.onlineConns.add(this);\n const encoder = createEncoder();\n writeSyncStep1(encoder, this);\n // publish SyncStep1\n broadcastMessage(this, toUint8Array(encoder));\n this.tc.onlineConns.forEach(remoteYInstance => {\n if (remoteYInstance !== this) {\n // remote instance sends instance to this instance\n const encoder = createEncoder();\n writeSyncStep1(encoder, remoteYInstance);\n this._receive(toUint8Array(encoder), remoteYInstance);\n }\n });\n }\n }", "title": "" }, { "docid": "9115cb64e1085171b2c0cd268a5b3f8f", "score": "0.54967296", "text": "function setupWebServer(){\n\tvar admin = chain.getRegistrar();\n\tconsole.log('------------------------------------------ Websocket Up ------------------------------------------');\n\n\twss = new ws.Server({server: server});\t\t\t\t\t\t\t\t\t\t\t\t//start the websocket now\n\twss.on('connection', function connection(ws) {\n\t\tws.on('message', function incoming(message) {\n\t\t\tconsole.log('received ws msg:', message);\n\t\t\ttry{\n\t\t\t\tvar data = JSON.parse(message);\n\t\t\t\tpart1.process_msg(ws, data);\t\t\t\t\t\t\t\t\t\t\t//pass the websocket msg to part 1 processing\n\t\t\t\tpart2.process_msg(ws, data);\t\t\t\t\t\t\t\t\t\t\t//pass the websocket msg to part 2 processing\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log('ws message error', e);\n\t\t\t\tconsole.log(e.stack);\n\t\t\t}\n\t\t});\n\n\t\tws.on('error', function(e){console.log('ws error', e);});\n\t\tws.on('close', function(){console.log('ws closed');});\n\t});\n\n\twss.broadcast = function broadcast(data) {\t\t\t\t\t\t\t\t\t\t\t//send to all connections\n\t\twss.clients.forEach(function each(client) {\n\t\t\ttry{\n\t\t\t\tclient.send(JSON.stringify(data));\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log('error broadcast ws', e);\n\t\t\t}\n\t\t});\n\t};\n\n\t// ========================================================\n\t// Monitor the height of the blockchain\n\t// ========================================================\n\thfc_util.monitor_blockheight(hfc.getPeer('grpc://localhost:7051'), function(chain_stats) {\t\t\t\t\t\t\t\t\t\t//there is a new block, lets refresh everything that has a state\n\t\tif(chain_stats && chain_stats.height){\n\t\t\tconsole.log('\\nHey new block, lets refresh and broadcast to all', chain_stats.height-1);\n\t\t\thfc_util.getBlockStats(peer, chain_stats.height - 1, cb_blockstats);\n\t\t\twss.broadcast({msg: 'reset'});\n\t\t\thfc_util.queryCC(admin, chaincode_id, \"read\", ['_marbleindex'], cb_got_index);\n\t\t\thfc_util.queryCC(admin, chaincode_id, \"read\", ['_opentrades'], cb_got_trades);\n\t\t}\n\n\t\t//got the block's stats, lets send the statistics\n\t\tfunction cb_blockstats(e, stats){\n\t\t\tif(e != null) console.log('blockstats error:', e);\n\t\t\telse {\n\t\t\t\tchain_stats.height = chain_stats.height - 1;\t\t\t\t\t\t\t//its 1 higher than actual height\n\t\t\t\tstats.height = chain_stats.height;\t\t\t\t\t\t\t\t\t\t//copy\n\t\t\t\twss.broadcast({msg: 'chainstats', e: e, chainstats: chain_stats, blockstats: stats});\n\t\t\t}\n\t\t}\n\n\t\t//got the marble index, lets get each marble\n\t\tfunction cb_got_index(e, index){\n\t\t\tif(e != null) console.log('marble index error:', e);\n\t\t\telse{\n\t\t\t\ttry{\n\t\t\t\t\tvar json = JSON.parse(index);\n\t\t\t\t\tfor(var i in json){\n\t\t\t\t\t\tconsole.log('!', i, json[i]);\n\t\t\t\t\t\t//iter over each, read their values\n\t\t\t\t\t\thfc_util.queryCC(admin, chaincode_id, \"read\", [json[i]], cb_got_marble);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(e){\n\t\t\t\t\tconsole.log('marbles index msg error:', e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//call back for getting a marble, lets send a message\n\t\tfunction cb_got_marble(e, marble){\n\t\t\tif(e != null) console.log('marble error:', e);\n\t\t\telse {\n\t\t\t\ttry{\n\t\t\t\t\twss.broadcast({msg: 'marbles', marble: JSON.parse(marble)});\n\t\t\t\t}\n\t\t\t\tcatch(e){\n\t\t\t\t\tconsole.log('marble msg error', e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//call back for getting open trades, lets send the trades\n\t\tfunction cb_got_trades(e, trades){\n\t\t\tif(e != null) console.log('trade error:', e);\n\t\t\telse {\n\t\t\t\ttry{\n\t\t\t\t\tconsole.log('Found open trades: ' + trades);\n\t\t\t\t\tif (trades !== \"\") {\n\t\t\t\t\t\ttrades = JSON.parse(trades);\n\t\t\t\t\t\tif(trades && trades.open_trades){\n\t\t\t\t\t\t\twss.broadcast({msg: 'open_trades', open_trades: trades.open_trades});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tconsole.log(\"No open trades\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(e){\n\t\t\t\t\tconsole.log('trade msg error', e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1d8097815cdaa866511821d9b84154a6", "score": "0.54910916", "text": "function WorkerFn(root) {\n var timers = {};\n\n root.onmessage = function (event) {\n switch (event.data.type) {\n case 'ping':\n root.postMessage({ type: 'pong' });\n break;\n\n case 'set_timeout':\n timers[event.data.id] = setTimeout(function () {\n root.postMessage({ type: 'tick', id: event.data.id });\n }, event.data.delay);\n break;\n\n case 'clear_timeout':\n clearTimeout(timers[event.data.id]);\n break;\n\n case 'set_interval':\n timers[event.data.id] = setInterval(function () {\n root.postMessage({ type: 'tick', id: event.data.id });\n }, event.data.interval);\n break;\n\n case 'clear_interval':\n clearInterval(timers[event.data.id]);\n break;\n }\n };\n}", "title": "" }, { "docid": "5098c6578b4cadf9dc37cbb27a9ce486", "score": "0.5483991", "text": "function cb_deployed(e, d){\n if(e != null){\n //look at tutorial_part1.md in the trouble shooting section for help\n console.log('! looks like a deploy error, holding off on the starting the socket\\n', e);\n if(!process.error) process.error = {type: 'deploy', msg: e.details};\n }\n else{\n console.log('------------------------------------------ Websocket Up ------------------------------------------');\n \n wss = new ws.Server({server: server}); //start the websocket now\n wss.on('connection', function connection(ws) {\n ws.on('message', function incoming(message) {\n console.log('received ws msg:', message);\n try{\n var data = JSON.parse(message);\n part1.process_msg(ws, data);\n // part2.process_msg(ws, data);\n }\n catch(e){\n console.log('ws message error', e);\n }\n });\n \n ws.on('error', function(e){console.log('ws error', e);});\n ws.on('close', function(){console.log('ws closed');});\n });\n \n wss.broadcast = function broadcast(data) { //send to all connections \n wss.clients.forEach(function each(client) {\n try{\n data.v = '2';\n client.send(JSON.stringify(data));\n }\n catch(e){\n console.log('error broadcast ws', e);\n }\n });\n };\n \n // ========================================================\n // Monitor the height of the blockchain\n // ========================================================\n ibc.monitor_blockheight(function(chain_stats){ //there is a new block, lets refresh everything that has a state\n if(chain_stats && chain_stats.height){\n console.log('hey new block, lets refresh and broadcast to all');\n ibc.block_stats(chain_stats.height - 1, cb_blockstats);\n wss.broadcast({msg: 'reset'});\n chaincode.query.read(['_itemindex'], cb_got_index);\n // chaincode.query.read(['_opentrades'], cb_got_trades);\n }\n \n //got the block's stats, lets send the statistics\n function cb_blockstats(e, stats){\n if(e != null) console.log('error:', e);\n else {\n if(chain_stats.height) stats.height = chain_stats.height - 1;\n // wss.broadcast({msg: 'chainstats', e: e, chainstats: chain_stats, blockstats: stats});\n }\n }\n \n //got the marble index, lets get each marble\n function cb_got_index(e, index){\n if(e != null) console.log('error:', e);\n else{\n try{\n var json = JSON.parse(index);\n console.log(index);\n console.log(json);\n for(var i in json){\n console.log('!', i, json[i]);\n chaincode.query.read([json[i]], cb_got_marble); //iter over each, read their values\n }\n }\n catch(e){\n console.log('marbles index msg error:', e);\n }\n }\n }\n \n //call back for getting a marble, lets send a message\n function cb_got_marble(e, marble){\n if(e != null) console.log('error:', e);\n else {\n try{\n console.log(\"printing marble\");\n console.log(JSON.parse(marble));\n // wss.broadcast({msg: 'marbles', marble: JSON.parse(marble)});\n }\n catch(e){\n console.log('marble msg error', e);\n }\n }\n }\n \n //call back for getting open trades, lets send the trades\n function cb_got_trades(e, trades){\n if(e != null) console.log('error:', e);\n else {\n try{\n trades = JSON.parse(trades);\n if(trades && trades.open_trades){\n wss.broadcast({msg: 'open_trades', open_trades: trades.open_trades});\n }\n }\n catch(e){\n console.log('trade msg error', e);\n }\n }\n }\n });\n }\n}", "title": "" }, { "docid": "a53d1244282b4a3c0c69989c513a05d7", "score": "0.5454529", "text": "listen() {\n // Work as mirror\n this.editorSocket.on('project', (p) => this.vsCodeSocket.broadcast('project', p.data));\n this.vsCodeSocket.on('refresh', () => this.editorSocket.broadcast('refresh'));\n this.editorSocket.on('behavior-codes', (c) => this.vsCodeSocket.broadcast('behavior-codes', c.data));\n this.vsCodeSocket.on('update-behavior-code', (s) => this.editorSocket.broadcast('update-behavior-code', s.data));\n this.editorSocket.on('material-codes', (c) => this.vsCodeSocket.broadcast('material-codes', c.data));\n this.vsCodeSocket.on('update-material-code', (c) => this.editorSocket.broadcast('update-material-code', c.data));\n this.editorSocket.on('post-process-codes', (c) => this.vsCodeSocket.broadcast('post-process-codes', c.data));\n this.vsCodeSocket.on('update-post-process-code', (c) => this.editorSocket.broadcast('update-post-process-code', c.data));\n this.editorSocket.on('behavior-graphs', (c) => this.vsCodeSocket.broadcast('behavior-graphs', c.data));\n this.vsCodeSocket.on('update-behavior-graph', (c) => this.editorSocket.broadcast('update-behavior-graph', c.data));\n this.editorSocket.on('scene-infos', (i) => this.vsCodeSocket.broadcast('scene-infos', i.data));\n this.editorSocket.on('set-selected-object', (i) => this.vsCodeSocket.broadcast('set-selected-object', i.data));\n }", "title": "" }, { "docid": "13919c53caad757dfae54863510b1079", "score": "0.5432829", "text": "function go() {\n\t\t\tcallback(filteredChannels);\n\t\t}", "title": "" }, { "docid": "73bdb2a3d3895a9912c6df2e6f350368", "score": "0.5426355", "text": "function syncChannels () {\n joinChannels()\n leaveChannels()\n }", "title": "" }, { "docid": "099c874d37bc2b0d188360d0ca60e410", "score": "0.54262507", "text": "syncChain(){\n this.sockets.forEach(socket =>{\n this.sendChain(socket);\n });\n }", "title": "" }, { "docid": "dc0f24a08412c4f9233f59d350c65416", "score": "0.54184204", "text": "function broadcast(thisClient, data) {\n function sendToAll(client) {\n if (client !== thisClient) {\n console.log('broadcasting from:' + client.clientName);\n client.send(JSON.stringify(data));\n }\n }\n // run the sendToAll function on each element of wss.clients:\n wss.clients.forEach(sendToAll);\n}", "title": "" }, { "docid": "2914d8c68f11a1b7cc2fbc6bc16ef539", "score": "0.5417546", "text": "emit(socket, data)\n\t\t\t\t{\n\t\t\t\t\tconst {channel} = this;\n\t\t\t\t\tconst {sinks} = channels[channel];\n\t\t\t\t\twalk(sinks, data, iteratorFactory(socket));\n\t\t\t\t}", "title": "" }, { "docid": "3bb7f428590daf77088b4679f410eb76", "score": "0.5410331", "text": "joinSwarm (channel, app) {\n console.log('joinSwarm', channel)\n this.hub = signalhub(channel, ['localhost:8080'])\n this.sw = swarm(this.hub)\n\n this.sw.on('peer', (peer, id) => {\n console.log(`peer ${id} joined.`)\n peer.on('data', data => this.handleData(data, peer, app))\n })\n\n this.sw.on('disconnect', (peer, id) => {\n console.log(`peer ${id} disconnected.`)\n })\n }", "title": "" }, { "docid": "7e83d14f1a9b66889a7cb66880e619bc", "score": "0.5407132", "text": "socketManagement() {\r\n socket.on('firstPlayerConnected', this.firstPlayerConnected());\r\n socket.on('secondPlayerConnected', this.secondPlayerConnected());\r\n socket.on('youCanStart', this.youCanStart());\r\n socket.on('paddleRightUp', () => this.rightPaddleUp());\r\n socket.on('paddleRightDown', () => this.rightPaddleDown());\r\n socket.on('paddleRightStop', this.paddleRightstop());\r\n socket.on('newBallWasSend', this.newBallWasSend());\r\n socket.on('synchroBallWasSend', this.synchroBallWasSend());\r\n }", "title": "" }, { "docid": "7ae29ca49b938a70356e69dbfef1561e", "score": "0.53984076", "text": "invoke(event) {\n var self = this;\n if (self._state == CHANNEL_OPEN) {\n //Enqueue the message in the buffer\n self._inBuffer.add(event);\n self._inBuffer.decrementCapacity();\n //Call each callback one at a time, similar to connect middleware.\n //This is done asyncronously to take advantage of the buffer.\n setTimeout(function () {\n var event = self._inBuffer.remove();\n var i = -1;\n //Update the remote process with how much open capacity we have in\n //our buffer - but only if the event is not one that is going to\n //close the channel; otherwise we'll send a _zpc_more event, and\n //the server won't know how to route it\n // if(event.name === \"STREAM\" && self._inBuffer.getCapacity() < self._capacity / 2) {\n // self._resetCapacity();\n // }\n var next = function () {\n i++;\n if (i < self._callbacks.length) {\n self._callbacks[i].call(self, event, next);\n }\n };\n next();\n }, 0);\n }\n }", "title": "" }, { "docid": "6be435a90605aceeb525ed0aca6e9a73", "score": "0.5396924", "text": "function workerConnected(worker){\n connectedWorkers[worker] = {};\n connectedWorkers[worker].worker = defs.workers[worker];\n\n mqtt.subscribe(worker); // subscribe to the worker\n \n // controller emitted some jobs for the worker\n controller.on(worker, function(executables){\n connectedWorkers[worker].ready = false;\n connectedWorkers[worker].jobs = executables.jobs;\n\n mqtt.publish(worker, JSON.stringify({status: 'new jobs', jobs: executables.jobs}));\n mqttToSocketIoEE.emit('queue update');\n mqttToSocketIoEE.emit('worker update', worker)\n });\n}", "title": "" }, { "docid": "f61584de500a8d88e4f8be5d074f3dae", "score": "0.5389686", "text": "function listen_for_broadcasts() {\n if (broadcaster_is_listening)\n return;\n broadcaster_is_listening = true;\n port = chrome.extension.connect({name: \"Broadcast receiver\"});\n port.onMessage.addListener(function(request) {\n if (dispatcher[request.fn] == null) {\n log(\"No dispatch function '\" + request.fn + \"'\");\n } else {\n dispatcher[request.fn](request.options);\n }\n });\n}", "title": "" }, { "docid": "629880cff9d99f7d1fbd45ba207bac72", "score": "0.5389619", "text": "registerChefWorker() {\n log.debug(\"Registering new background ChefWorker\");\n this.chefWorker = new ChefWorker();\n this.chefWorker.addEventListener(\"message\", this.handleChefMessage.bind(this));\n this.chefWorker.postMessage({\n action: \"setLogPrefix\",\n data: \"BGChefWorker\"\n });\n this.chefWorker.postMessage({\n action: \"setLogLevel\",\n data: log.getLevel()\n });\n\n let docURL = document.location.href.split(/[#?]/)[0];\n const index = docURL.lastIndexOf(\"/\");\n if (index > 0) {\n docURL = docURL.substring(0, index);\n }\n this.chefWorker.postMessage({\"action\": \"docURL\", \"data\": docURL});\n }", "title": "" }, { "docid": "73d2be9fb9da0d8177171269337ea864", "score": "0.53868604", "text": "function go() {\n\t\t\tcallback(allChannelsByServiceId);\n\t\t}", "title": "" }, { "docid": "1b5984e27b0c0da29f6342a4aec59354", "score": "0.53826416", "text": "function updateWorker() {\n // sendResponse(\"message\", \"Hello!\", \"\", \"\", \"\")\n}", "title": "" }, { "docid": "ca5278eb56b6d5e775990279cac1b3ac", "score": "0.5379726", "text": "listen(event, cb): WebRockets {\n if (!this.listeners[event]) {\n this.listeners[event] = [];\n }\n\n this.listeners[event].push(cb);\n\n // If listen is called when there are already clients connected\n // then these clients are not listening - so we'll make them listen here\n\n process.nextTick(() => {\n if (this.status && this.io.sockets) {\n for (let socket in this.io.sockets.sockets) {\n const $socket = this.io.sockets.sockets[socket];\n $socket.on(event, cb.bind(null, $socket));\n }\n }\n });\n\n this.on(event, cb);\n\n return this;\n }", "title": "" }, { "docid": "3c544786f6434ad3caa14754a1b5ac68", "score": "0.53758985", "text": "function theConch (openSocket) {\n global.eventQueue = []\n openSocket.on('connect', connected => {\n global.socket = connected\n store.dispatch({type: 'READY'})\n connected.on('TC', data => {\n console.time()\n enqueue(data)\n while (this.eventQueue.length !== 0) {\n const event = dequeue()\n const action = lookup(event)\n delegate(action)\n }\n console.timeEnd()\n })\n })\n openSocket.on('disconnnect', reason => {\n console.log(`Disconnected: ${reason}`)\n delete global.socket\n })\n}", "title": "" }, { "docid": "374dbfbbac7dccdbcb58e2d9f80f95fd", "score": "0.53726447", "text": "listen() {}", "title": "" }, { "docid": "374dbfbbac7dccdbcb58e2d9f80f95fd", "score": "0.53726447", "text": "listen() {}", "title": "" }, { "docid": "374dbfbbac7dccdbcb58e2d9f80f95fd", "score": "0.53726447", "text": "listen() {}", "title": "" }, { "docid": "dbf36c3113ccc0841e149b05a3b8e0fc", "score": "0.5367122", "text": "newMessageChannel(key, config) {\n if (!navigator.serviceWorker || !navigator.serviceWorker.controller) return setTimeout(() => {\n this.newMessageChannel(key, config)\n }, 1000)\n let messageChannel = new MessageChannel()\n messageChannel.port1.onmessage = (e) => {\n if (e.data.error) return false\n else this.message(e.data, config)\n }\n navigator.serviceWorker.controller.postMessage(key, [messageChannel.port2])\n }", "title": "" }, { "docid": "fbc7aec61d9414583bb9a06884effa5d", "score": "0.53645575", "text": "connect() {\n\n const self = this;\n const ipc = this._ipc;\n\n // Connect to the server.\n ipc.connectTo( self._serverID, () => {\n\n // Get the local server stub.\n const server = ipc.of[self._serverID];\n\n // Handle connection & disconnection events.\n server.on('connect', () => self._connected = true );\n server.on('disconnect', () => self._connected = false );\n\n // Plumbing for server events - emit as local events from this object.\n self._events.forEach( eid => {\n server.on(`event.${eid}`, data => {\n let { id, message } = data;\n self.emit( eid, message );\n });\n });\n\n // -- See note in index.js on client/server messages. --\n\n // A unique message ID counter.\n let midx = 0;\n\n // Maps of pending message promises and timeout timers.\n const pendings = {};\n\n // Clear a pending message promise.\n function clear( id ) {\n // Lookup the pending by message ID.\n let pending = pendings[id];\n if( !pending ) {\n // Pending not found - return a stub object.\n return { resolve: () => {}, reject: () => {} };\n }\n // Delete the pending and delete the timeout timer.\n delete pendings[id];\n let { timerID } = pending;\n clearTimeout( timerID );\n // Return the pending object.\n return pending;\n }\n\n // Resolve a pending message promise.\n function resolve( data ) {\n let { id, message } = data;\n let { resolve } = clear( id );\n resolve( message );\n }\n\n // Reject a pending message promise.\n function reject( data ) {\n let { id, message } = data;\n let { reject } = clear( id );\n reject( message );\n }\n\n // Plumbing for server messages. Create methods on this object named\n // after the message name, and which emit events to the server.\n self._messages.forEach( name => {\n const mid = `message.${name}`;\n // Bind a method to send the message to the server.\n self[name] = function() {\n const id = `${name}.${midx++}`;\n const args = Array.from( arguments );\n server.emit( mid, { id, args });\n // Create a promise to wait for the result.\n return new Promise( ( resolve, reject ) => {\n // Create a request timeout.\n const timerID = setTimeout( () => {\n const message = 'IPC message dispatch timeout';\n reject({ id, message });\n }, MessageTimeout );\n // Register the promise.\n pendings[id] = { resolve, reject, timerID };\n });\n };\n // Register event handler for handling message responses.\n server.on( mid, resolve );\n // Register event handler for handling message errors.\n server.on(`error.${name}`, reject );\n });\n\n });\n }", "title": "" }, { "docid": "0a262603456405b59f54714f77294001", "score": "0.53644854", "text": "_broadcast () {\n const peer = {\n publicKey: this.libp2p.peerId.pubKey.bytes,\n addrs: this.libp2p.multiaddrs.map(ma => ma.bytes)\n }\n\n const encodedPeer = PB.Peer.encode(peer)\n for (const topic of this.topics) {\n log('broadcasting our peer data on topic %s', topic)\n this.libp2p.pubsub.publish(topic, encodedPeer)\n }\n }", "title": "" }, { "docid": "f83a3ac1a0f96c8c0089c5c3399d73ca", "score": "0.53639525", "text": "setupListener(){ \n this.dataChannel.on('channel:opened:test', (id, dataChannel) => {\n // Listen event channel open \n // mean has peer connect to channel 'test'. \n // if statisfying conditions add peer to swarm\n this.onChannelOpened(id, dataChannel)\n }) \n \n this.dataChannel.on('channel:closed:test', (id, dataChannel) => {\n // Listen event channel closed\n // mean has peer disconnect to channel 'test'\n // remove peer in swarm\n this.onChannelClosed(id, dataChannel)\n })\n }", "title": "" }, { "docid": "501121cf63fa25123dd6a0e38efe962a", "score": "0.536293", "text": "ipcListener() {\n browser.runtime.onMessage.addListener((message, sender) => {\n return new Promise((resolve, reject) => {\n if (message.data) {\n // Add extra contextual information about sender to payload.\n message.data.sender = sender\n // It may have a callback, but functions can't pass through\n // the request.data, so map sendResponse.\n message.data.callback = resolve\n }\n // The frame option can be used to specifically target a\n // callstatus or observer script. Otherwise the event is\n // ignored, because otherwise all events emitted on the tab will\n // also be processed by the callstatus and observer scripts.\n if (this.env.section.callstatus || this.env.section.observer) {\n if (this.env.section.observer && message.data.frame && message.data.frame === 'observer') {\n this.emit(message.event, message.data, true)\n }\n } else {\n this.emit(message.event, message.data, true)\n }\n })\n })\n }", "title": "" }, { "docid": "28a8a9ceec5a86c46a14951b3ee34fec", "score": "0.53587663", "text": "register() {\n this.io.sockets.on('connection', (socket) => {\n socket.on('announce_node', (message) => {\n this.log.info(\"Registering new node \" + JSON.stringify(message));\n this.announce_node(socket, message);\n this.logCount();\n });\n\n socket.on('announce_web_client', (message) => {\n this.log.info(\"Registering new web_client\");\n this.announce_web_client(socket);\n\n this.logCount();\n\n socket.emit('statusreport', {status: this.status});\n\n socket.on('run', (msg) => {\n stat.clear();\n msg.agent = _.size(this.nodes);\n console.log('server begin notify client to run machine...');\n this.runconfig = msg;\n let i = 0;\n _.each(this.nodes, function (ele) {\n //web.log(i++);\n msg.index = i++;\n ele.socket.emit('run', msg);\n });\n //this.io.sockets.in('nodes').emit('run',msg);\n this.status = STATUS_RUNNING;\n this.sendStatus();\n });\n\n socket.on('ready', (msg) => {\n console.log('server begin ready client ...');\n this.io.sockets.in('nodes').emit('disconnect', {});\n stat.clear();\n this.status = STATUS_READY;\n this.sendStatus();\n this.runconfig = msg;\n starter.run(this.conf.mainFile, msg, this.conf.clients);\n });\n\n socket.on('exit4reready', () => {\n _.each(this.nodes, (obj) => obj.socket.emit('exit4reready'));\n this.nodes = {};\n });\n });\n });\n\n // Broadcast heartbeat to all clients\n setInterval(() => this.io.sockets.emit('heartbeat'), HEARTBEAT_INTERVAL);\n }", "title": "" }, { "docid": "654f1b8fd28bf290c0accbbcbaa32a95", "score": "0.53578305", "text": "listen() {\n this.eventsNames.forEach((eventName) => {\n process.on(eventName, this.handler);\n });\n }", "title": "" }, { "docid": "59b5f85eb3545c8cf0812a4f2637ce4b", "score": "0.5353527", "text": "clusterSws(options = {}) { \r\n processOptions(options);\r\n swsProcessorkoa = new SwsProcessorKoa();\r\n let ev = new EventEmitter()\r\n ev.setMaxListeners(0) // allows the limit to be modified for this specific\r\n swsProcessorkoa.init(options)\r\n cluster.on('online', (worker) => {\r\n addListenMessage(worker.id)\r\n });\r\n }", "title": "" }, { "docid": "193fd1625375836a39518f754fec389e", "score": "0.5347264", "text": "async processQueueWorker() {\n this.log.debug(`Listening the send queue [${this.queueName}]`);\n\n queue.channel.consume(this.queueName, (msg) => {\n const queueMessage = JSON.parse(msg.content);\n const message = `Seu código de verificação é ${queueMessage.verificationCode}`;\n this.notificationService.send(queueMessage.type, queueMessage.destination, message);\n queue.channel.ack(msg);\n });\n }", "title": "" }, { "docid": "193838c2eec05c3140a33fd684139a29", "score": "0.5332808", "text": "initBroadcast() {\n Router.getByWriter(this.alias).forEach(destination => {\n this.getOrCreateChannel(destination.group, destination.name)\n //.then(() => Logger.info(`Channel ${destination.name} initialized`))\n .catch(reason => Logger.warn('Unable to initialize broadcast channel', {\n destination: destination,\n reason: reason\n }));\n });\n }", "title": "" }, { "docid": "3ff36cc5ecca531fe6946fca0d433b22", "score": "0.5322251", "text": "function runWorker(config) {\n var child = new Child();\n child.registerAllFunctionsExportedFromAsResponders(config.workerImplementation);\n var master = child.sendAllToIpc(config.masterContract);\n return { child: child, master: master };\n}", "title": "" }, { "docid": "2b5bbefe01ee98bb718cc64d30d41104", "score": "0.5315322", "text": "function broadcast() {\n return null\n}", "title": "" }, { "docid": "65221a659f13c648f86fdb7a6f7e56a2", "score": "0.5315289", "text": "async broadcast() {\n this.socket = io(SERVER);\n\n // Connect to room server and set state\n this.socket.on('connect', () => {\n this.setState({\n connected: true,\n connecting: true\n });\n });\n\n // Listening to inbound WebRTC signalling\n this.socket.on('signalling', data => {\n \n if (data.client.id === this.state.id) {\n this.state.peer.signal(data.peerAnswer);\n console.log('signalling', this.state.peer);\n }\n });\n\n // Listening for all known public broadcasts (WebRTC Offers)\n this.socket.on('clients', clients => {\n this.setState({\n clients\n });\n });\n\n // Listen for room server disconnects\n this.socket.on('disconnect', () => {\n this.setState({\n connected: false\n })\n });\n }", "title": "" }, { "docid": "609e04f49c93fa81e52d90b8978aab7e", "score": "0.5306412", "text": "startMainLoop() {\n\t\tthis.workerSystem.start();\n\t}", "title": "" }, { "docid": "487f67cf26bfc72e2b98b0cde8f66580", "score": "0.5282991", "text": "go() {\n\t\tconst Web3 = require('web3');\n\t\tconst ipfsAPI = require('ipfs-api');\n\t\tconst Pinner = require('./Pinner');\n\t\tconst ThrottledIPFS = require('./ThrottledIPFS');\n\t\tconst OwnershipTracker = require('./OwnershipTracker');\n\n\t\tconst ipfs = ipfsAPI({\n\t\t\thost: this.options.IPFSAPIHOST,\n\t\t\tport: this.options.IPFSAPIPORT,\n\t\t\tprotocol: 'http',\n\t\t});\n\n\t\t// const ipfs = ipfsAPI({\n\t\t// \thost: 'ipfs.infura.io',\n\t\t// \tport: 5001,\n\t\t// \tprotocol: 'https',\n\t\t// });\n\t\t// const topic = 'quaak'; // this.options.CONTRACTADDRESS;\n\n\t\t// const receiveMsg = (msg) => {\n\t\t// \tconsole.log('received message:', msg.data.toString())\n\t\t// }\n\n\t\t// ipfs.pubsub.subscribe(topic, receiveMsg).then(() => {\n\t\t// \tthis.logger.info('subscribed to %s', topic);\n\n\t\t// \tconst msg = new Buffer('banana')\n\n\n\t\t// \tipfs.pubsub.ls((err, topics) => {\n\t\t// \t\tif (err) {\n\t\t// \t\t\tthrow err\n\t\t// \t\t}\n\t\t// \t\tconsole.log('subscribed to');\n\t\t// \t\tconsole.log(topics);\n\t\t// \t})\n\n\n\t\t// \tipfs.pubsub.publish(topic, msg, (err) => {\n\t\t// \t\tif (err) {\n\t\t// \t\t\tthis.logger.error(err);\n\t\t// \t\t}\n\t\t// \t\tthis.logger.info('message BCAST');\n\t\t// \t\t// msg was broadcasted\n\t\t// \t})\n\n\t\t// })\n\n\t\tconst IPFSProxy = require(\n\t\t\t'../node_modules/ipfsconsortiumcontracts/build/contracts/IPFSProxy.json');\n\t\tconst IPFSEvents = require(\n\t\t\t'../node_modules/ipfsconsortiumcontracts/build/contracts/IPFSEvents.json');\n\n\t\tconst web3 = new Web3(new Web3.providers.WebsocketProvider(this.options.WEB3HOSTWS));\n\t\tconst contract = new web3.eth.Contract(IPFSProxy.abi, this.options.CONTRACTADDRESS);\n\n\t\tlet localData = {\n\t\t\tmemberInfo: {},\n\t\t\thashexpiry: {},\n\t\t\tepochtohash: {},\n\t\t\tlastblock: this.options.STARTBLOCK,\n\t\t\tsizelimit: new web3.utils.BN(0),\n\t\t\thashInfo: {},\n\t\t};\n\n\t\tlet throttledIPFS = new ThrottledIPFS({\n\t\t\tipfs: ipfs,\n\t\t\tlogger: this.logger\n\t\t});\n\n\t\tlet pinner = new Pinner({\n\t\t\tipfs: ipfs,\n\t\t\tthrottledIPFS : throttledIPFS,\n\t\t\tlogger: this.logger\n\t\t});\n\n\n\t\tlet ownershiptracker = new OwnershipTracker();\n\n\t\tcontract.methods.persistLimit().call((err, res) => {\n\t\t\tif (err) {\n\t\t\t\tthis.logger.error('cannot read contract %s : %s. Exiting',\n\t\t\t\t\tthis.options.CONTRACTADDRESS, err.message);\n\t\t\t\tprocess.exit();\n\t\t\t}\n\n\t\t\tlocalData.sizelimit = new web3.utils.BN(res);\n\t\t\tthis.logger.info('sizelimit= %d bytes', localData.sizelimit.toNumber(10));\n\n\t\t\tpinner.setLimit(localData.sizelimit);\n\n\t\t\t// TODO : move this to plugin method..\n\t\t\tif (this.plugins.peepeth) {\n\t\t\t\taddWatch({\n\t\t\t\t\ttype: 'peepeth',\n\t\t\t\t});\n\t\t\t}\n\t\t\t// the watcher on the IPFS consortium contract\n\t\t\tcontract.events.allEvents({\n\t\t\t\tfromBlock: this.options.STARTBLOCK,\n\t\t\t}, (error, result) => {\n\t\t\t\tif (error == null) {\n\t\t\t\t\t// for accounting purposes\n\t\t\t\t\tif (result.blockNumber > this.lastblock){\n\t\t\t\t\t\tthis.lastblock = result.blockNumber;\n\t\t\t\t\t}\n\t\t\t\t\tweb3.eth.getTransaction(result.transactionHash).then((transaction) => {\n\t\t\t\t\t\tswitch (result.event) {\n\t\t\t\t\t\t\tcase 'ContractAdded':\n\t\t\t\t\t\t\t\tthis.logger.info('ContractAdded address=%s, startBlock=%d, member=%s',\n\t\t\t\t\t\t\t\t\tresult.returnValues.pubKey,\n\t\t\t\t\t\t\t\t\tresult.returnValues.startBlock,\n\t\t\t\t\t\t\t\t\ttransaction.from);\n\t\t\t\t\t\t\t\tconst contractAddress = cleanAddress(result.returnValues.pubKey);\n\t\t\t\t\t\t\t\tif (contractAddress !== this.options.CONTRACTADDRESS) {\n\t\t\t\t\t\t\t\t\townershiptracker.setOwner(contractAddress, transaction.from);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taddWatch({\n\t\t\t\t\t\t\t\t\ttype: 'ipfsconsortium',\n\t\t\t\t\t\t\t\t\tcontractAddress: contractAddress,\n\t\t\t\t\t\t\t\t\tstartBlock: result.returnValues.startBlock\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'MetadataObjectAdded':\n\t\t\t\t\t\t\t\tthis.logger.info('MetadataContractAdded hash=%s',\n\t\t\t\t\t\t\t\t\tresult.returnValues.hash);\n\t\t\t\t\t\t\t\taddWatch({\n\t\t\t\t\t\t\t\t\ttype: 'ipfsconsortiumobject',\n\t\t\t\t\t\t\t\t\thash: result.returnValues.hash,\n\t\t\t\t\t\t\t\t\ttransaction: transaction,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tmetadataContractAdded(transaction.from, result.returnValues.hash);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t// case 'ContractRemoved':\n\t\t\t\t\t\t\t\t// \tthis.logger.info('ContractRemoved member=%s address=%s',\n\t\t\t\t\t\t\t\t// \t\tresult.returnValues.member,\n\t\t\t\t\t\t\t\t// \t\tresult.returnValues.pubKey);\n\t\t\t\t\t\t\t\t// \tremoveContract(result.returnValues.pubKey, result.returnValues.member);\n\t\t\t\t\t\t\t\t// \tbreak;\n\t\t\t\t\t\t\t\t// case 'MemberAdded':\n\t\t\t\t\t\t\t\t// \tthis.logger.info('MemberAdded pubkey=%s',\n\t\t\t\t\t\t\t\t// \t\tresult.returnValues.newMember);\n\t\t\t\t\t\t\t\t// \taddMember(result.returnValues.newMember);\n\t\t\t\t\t\t\t\t// \tbreak;\n\t\t\t\t\t\t\t\t// case 'Banned':\n\t\t\t\t\t\t\t\t// case 'BanAttempt':\n\t\t\t\t\t\t\t\t// \tthis.logger.warn('Event handler not implemented: %s', result.event);\n\t\t\t\t\t\t\t\t// \tbreak;\n\t\t\t\t\t\t\tcase 'PersistLimitChanged':\n\t\t\t\t\t\t\t\tthis.logger.info('Changing PersistLimit to %s bytes per member',\n\t\t\t\t\t\t\t\t\tresult.returnValues.limit);\n\t\t\t\t\t\t\t\tpinner.setLimit(new web3.utils.BN(result.returnValues.limit));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'MemberAdded':\n\t\t\t\t\t\t\tcase 'HashAdded':\n\t\t\t\t\t\t\tcase 'HashRemoved':\n\t\t\t\t\t\t\tcase 'MemberRemoved':\n\t\t\t\t\t\t\t\t// the contract listener will catch these, We can ignore these here.\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t// case 'MemberRemoved':\n\t\t\t\t\t\t\t\t// \tthis.logger.info('MemberRemoved pubkey=%s',\n\t\t\t\t\t\t\t\t// \t\tresult.returnValues.oldMember);\n\t\t\t\t\t\t\t\t// \tremoveMember(result.returnValues.oldMember);\n\t\t\t\t\t\t\t\t// \tbreak;\n\t\t\t\t\t\t\tcase 'Confirmation':\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthis.logger.warn('unknown Event: %s', JSON.stringify(result));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((e)=>{\n\t\t\t\t\t\tdebugger;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Error: %s', error.message);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\n\n\t\t// watchers\n\t\t//let watchers = {};\n\t\tlet addWatch = (options) => {\n\t\t\tthis.logger.info('Adding an event listener type %s - options %j', options.type, options);\n\n\t\t\tif (this.plugins[options.type]) {\n\t\t\t\toptions.web3 = web3;\n\t\t\t\toptions.logger = this.logger;\n\t\t\t\toptions.pinner = pinner;\n\t\t\t\toptions.ownershiptracker = ownershiptracker;\n\t\t\t\toptions.contractAddress = cleanAddress(options.contractAddress);\n\t\t\t\toptions.ipfs = ipfs;\n\t\t\t\toptions.throttledIPFS = throttledIPFS;\n\t\t\t\tthis.plugins[options.type].addWatch(options);\n\t\t\t} else {\n\t\t\t\tthis.logger.info('no such plugin %s', options.type);\n\t\t\t}\n\t\t}\n\n\t\tlet cleanAddress = (address) => {\n\t\t\tif (!address) return;\n\t\t\treturn address.toLowerCase();\n\t\t};\n\n\t\tlet metadataContractAdded = (member, metadataHash) => {\n\n\t\t\t// Obtaining contract metadata info\n\t\t\tThrottledIPFS.cat(metadataHash).then((file) => {\n\t\t\t\tlet contractMetadata = JSON.parse(file.toString('utf8'));\n\t\t\t\tif (!contractMetadata.abi ||\n\t\t\t\t\t!contractMetadata.contract ||\n\t\t\t\t\t!contractMetadata.events ||\n\t\t\t\t\t!contractMetadata.networkId ||\n\t\t\t\t\t!contractMetadata.ttl ||\n\t\t\t\t\t!contractMetadata.startblock) {\n\t\t\t\t\tthis.logger.warn('Not valid metadataHash contract: %s', metadataHash);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// The metadata hashes of a contract are pinned by default\n\t\t\t\t\t// to prevent them from being lost\n\t\t\t\t\tThrottledIPFS.pin(metadataHash, (err, res) => {\n\t\t\t\t\t\tif (!err) {\n\t\t\t\t\t\t\tthis.logger.info('pinning metadataHash complete... %s', JSON.stringify(res));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.logger.error('Error pinning metadataHash %s', err.message);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst contract = new web3.eth.Contract(contractMetadata.abi, contractMetadata.contract);\n\n\t\t\t\tlet listeners = [];\n\n\t\t\t\t// for each contract event, an own listener is generated\n\t\t\t\tcontractMetadata.events.forEach((event) => {\n\t\t\t\t\tlet listener = contract.events[event.event]({\n\t\t\t\t\t\tfromBlock: contractMetadata.startblock,\n\t\t\t\t\t}, (error, result) => {\n\t\t\t\t\t\tif (event.type == 'HashAdded') {\n\t\t\t\t\t\t\tif (result.returnValues[event.ipfsParam] == '') return;\n\t\t\t\t\t\t\taddHash(result.returnValues[event.ipfsParam], member, result.blockNumber, contractMetadata.ttl, contractMetadata.contract);\n\t\t\t\t\t\t} else if (event.type == 'HashRemoved') {\n\t\t\t\t\t\t\tremoveHash(result.returnValues[event.ipfsParam], contractMetadata.contract);\n\t\t\t\t\t\t\t// events of type 'HashWithIndex' allow to maintain an index of hashes based on a defined key\n\t\t\t\t\t\t} else if (event.type == 'HashWithIndex') {\n\t\t\t\t\t\t\tlet index = result.returnValues[event.indexKey];\n\t\t\t\t\t\t\t// it gets the old hash, if it exists it'll be replaced by the new one\n\t\t\t\t\t\t\tlet oldHash = localData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(contractMetadata.contract))].index[index];\n\t\t\t\t\t\t\tif (oldHash) {\n\t\t\t\t\t\t\t\tremoveHash(oldHash, contractMetadata.contract);\n\t\t\t\t\t\t\t\tif (result.returnValues[event.ipfsParam] == '') return;\n\t\t\t\t\t\t\t\taddHash(result.returnValues[event.ipfsParam], member, result.blockNumber, contractMetadata.ttl, contractMetadata.contract, index);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (result.returnValues[event.ipfsParam] == '') return;\n\t\t\t\t\t\t\t\taddHash(result.returnValues[event.ipfsParam], member, result.blockNumber, contractMetadata.ttl, contractMetadata.contract, index);\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\tlisteners.push(listener);\n\t\t\t\t});\n\n\t\t\t\tlocalData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(contractMetadata.contract))] = {\n\t\t\t\t\tlisteners: listeners,\n\t\t\t\t\thashes: {},\n\t\t\t\t\tindex: {},\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\n\t\tlet removeContract = (contractaddress, member) => {\n\t\t\tthis.logger.info('Member %s removeContract address %s ', member, contractaddress);\n\t\t\tif (!localData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(contractaddress))]) return;\n\n\t\t\tObject.keys(localData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(contractaddress))].hashes).forEach((hash) => {\n\t\t\t\tremoveHash(hash, contractaddress);\n\t\t\t});\n\n\t\t\tdelete localData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(contractaddress))];\n\t\t};\n\n\t\tlet removeHash = (IPFShash, hashOwner = '') => {\n\t\t\tif (!localData.hashInfo[IPFShash]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (hashOwner != '') {\n\t\t\t\tlocalData.hashInfo[IPFShash].owner[cleanAddress(hashOwner)] = 0;\n\t\t\t}\n\n\t\t\t// it's marked to be erased\n\t\t\tif (localData.hashInfo[IPFShash].status == 'pending') {\n\t\t\t\tlocalData.hashInfo[IPFShash].removeHash = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet needToDelete = 1;\n\t\t\tObject.keys(localData.hashInfo[IPFShash].owner).forEach((owner) => {\n\t\t\t\tif (localData.hashInfo[IPFShash].owner[owner]) {\n\t\t\t\t\tneedToDelete = 0;\n\t\t\t\t} else {\n\t\t\t\t\tif (localData.memberInfo[cleanAddress(localData.hashInfo[IPFShash].member)].contracts[(cleanAddress(owner))].hashes[IPFShash]) {\n\t\t\t\t\t\tdelete localData.memberInfo[cleanAddress(localData.hashInfo[IPFShash].member)].contracts[(cleanAddress(owner))].hashes[IPFShash];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!needToDelete) return;\n\n\n\t\t\tthis.logger.info('removing hash %s', IPFShash);\n\t\t\tipfs.pin.rm(IPFShash, (err, res) => {\n\t\t\t\tif (err && err.code === 0) {\n\t\t\t\t\tthis.logger.warn('already unpinned hash %s', IPFShash);\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.info('unpinned hash %s', IPFShash, res);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet member = localData.hashInfo[IPFShash].member;\n\t\t\tlet hashByteSize = localData.hashInfo[IPFShash].hashByteSize;\n\n\t\t\tif (localData.hashexpiry[IPFShash]) {\n\t\t\t\tlet myEpoch = timestamptoepoch(localData.hashexpiry[IPFShash]);\n\t\t\t\tif (localData.epochtohash[myEpoch]) {\n\t\t\t\t\tdelete localData.epochtohash[myEpoch][IPFShash];\n\t\t\t\t}\n\t\t\t\tdelete localData.hashexpiry[IPFShash];\n\t\t\t}\n\n\t\t\tObject.keys(localData.hashInfo[IPFShash].owner).forEach((hashOwner) => {\n\t\t\t\tif (localData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(hashOwner))].hashes[IPFShash]) {\n\t\t\t\t\tdelete localData.memberInfo[cleanAddress(member)].contracts[(cleanAddress(hashOwner))].hashes[IPFShash];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdelete localData.hashInfo[IPFShash];\n\n\t\t\tsubToQuota(member, hashByteSize);\n\t\t};\n\n\t\tlet timestamptoepoch = (timestamp) => {\n\t\t\treturn Math.floor(timestamp / (1000 * 60 * 60));\n\t\t};\n\n\t\tlet dumpstate = () => {\n\t\t\tweb3.eth.getBlockNumber()\n\t\t\t\t.then((blockNumber) => {\n\t\t\t\t\tlet pluginStats = {};\n\t\t\t\t\tfor (let i=0;i<Object.keys(this.plugins).length;i++){\n\t\t\t\t\t\tpluginStats[Object.keys(this.plugins)[i]] = \n\t\t\t\t\t\tthis.plugins[Object.keys(this.plugins)[i]].getStats();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.logger.info('state %s', JSON.stringify({\n\t\t\t\t\t\tcurrentBlock : blockNumber,\n\t\t\t\t\t\tlastProcessedBlock : this.lastblock,\n\t\t\t\t\t\tpinning: pinner.getAccountingStats(),\n\t\t\t\t\t\townership: ownershiptracker.getOwnerStats(),\n\t\t\t\t\t\tthrottledIPFS : throttledIPFS.getStats(),\n\t\t\t\t\t\tplugins: pluginStats,\n\t\t\t\t\t}, true, 2));\n\t\t\t\t}).catch((e)=>{\n\n\t\t\t\t});\n\t\t};\n\n\t\t// let cleanepoch = () => {\n\t\t// \tdumpstate();\n\t\t// \tlet now = Date.now();\n\t\t// \tlet currentEpoch = timestamptoepoch(now);\n\t\t// \tthis.logger.info('current epoch is %d', currentEpoch);\n\t\t// \tif (localData.epochtohash[currentEpoch]) {\n\t\t// \t\tfor (let hash in localData.epochtohash[currentEpoch]) {\n\t\t// \t\t\tif (localData.epochtohash[currentEpoch].hasOwnProperty(hash)) {\n\t\t// \t\t\t\tif (localData.hashexpiry[hash] && localData.hashexpiry[hash] < now) {\n\t\t// \t\t\t\t\tremoveHash(hash);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t\t// \t}\n\t\t// };\n\n\t\t// clean the hashtaglist every hour.\n\t\t//setInterval(cleanepoch, 1000 * 60 * 60);\n\t\tsetInterval(dumpstate, 1000 * 10);\n\t}", "title": "" }, { "docid": "a529cbb1b94b0bb6fbb7ddf4cf3800c1", "score": "0.5268974", "text": "connectedCallback() {\n this.subscribeMessageChannel();\n\n }", "title": "" }, { "docid": "81612271313e4ab9f4d5da97e3348ce2", "score": "0.52614665", "text": "function broadcast(fromClient, message) {\r\n for (let i=0; i<clients.length; i++) {\r\n if (i!=fromClient && clients[i] && \r\n clients[i].ws.readyState == WebSocket.OPEN) {\r\n\t console.log(`Sending ${message} to ${i}.`);\r\n clients[i].ws.send(message);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d12253375e3eb79f7232bb621eb70f50", "score": "0.5247371", "text": "broadcast(subscriptionID, vals) {\n this._subscriptions[subscriptionID].forEach(fn=>{\n fn.apply(this, [].concat(vals));\n })\n }", "title": "" }, { "docid": "a03aea8c9ffa9e858ae3c60e9053b4c4", "score": "0.5245534", "text": "apply_broadcast() {\n var _this5 = this;\n\n return _asyncToGenerator(function* () {\n\n const applyTime = new Date().getTime();\n const subs = [];\n const errors = [];\n\n const whileNoError = (() => {\n var _ref = _asyncToGenerator(function* () {\n subs.push(_this5.bc.$.filter(function (msg) {\n return !!_this5.isApplying;\n }).filter(function (msg) {\n return msg.t >= applyTime;\n }).filter(function (msg) {\n return msg.type == 'apply';\n }).filter(function (msg) {\n if (msg.data < applyTime || msg.data == applyTime && msg.it > _this5.token) return true;else return false;\n }).filter(function (msg) {\n return errors.length < 1;\n }).subscribe(function (msg) {\n return errors.push('other is applying:' + msg.it);\n }));\n subs.push(_this5.bc.$.filter(function (msg) {\n return !!_this5.isApplying;\n }).filter(function (msg) {\n return msg.t >= applyTime;\n }).filter(function (msg) {\n return msg.type == 'tell';\n }).filter(function (msg) {\n return errors.length < 1;\n }).subscribe(function (msg) {\n return errors.push('other is leader' + msg.it);\n }));\n subs.push(_this5.bc.$.filter(function (msg) {\n return !!_this5.isApplying;\n }).filter(function (msg) {\n return msg.type == 'apply';\n }).filter(function (msg) {\n if (msg.data > applyTime || msg.data == applyTime && msg.it > _this5.token) return true;else return false;\n }).subscribe(function (msg) {\n return _this5.bc.write('apply', applyTime);\n }));\n\n let circles = 3;\n while (circles > 0) {\n circles--;\n yield _this5.bc.write('apply', applyTime);\n yield util.promiseWait(300); // give others time to respond\n if (errors.length > 0) return false;\n }\n return true;\n });\n\n return function whileNoError() {\n return _ref.apply(this, arguments);\n };\n })();\n const ret = yield whileNoError();\n subs.map(function (sub) {\n return sub.unsubscribe();\n });\n return ret;\n })();\n }", "title": "" }, { "docid": "71e1e3959b3421f892459a05fba15837", "score": "0.5243908", "text": "function forEachWorker(callback) {\n for (var id in cluster.workers) {\n callback(cluster.workers[id]);\n }\n}", "title": "" }, { "docid": "d201ccd879d94b8efd567e30d29f8f62", "score": "0.5243701", "text": "onMessage(data) {\n //enviar a informação para todos clientes até mesmo quem enviou\n this.socket.broadcastToAll(\"message\", data);\n }", "title": "" }, { "docid": "e309c321a1be2b99c9d58f4f1e88fffa", "score": "0.5241705", "text": "static listenSocketEvents() {\n Socket.shared.on(\"notification:alert:created\", (data) => {\n let logger = Logger.create(\"notification:alert:created\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(NotificationAlert.actions.notificationAlertCreatedEvent(data));\n });\n\n Socket.shared.on(\"notification:alert:updated\", (data) => {\n let logger = Logger.create(\"notification:alert:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(NotificationAlert.actions.notificationAlertUpdatedEvent(data));\n });\n }", "title": "" }, { "docid": "d83e4791525a9528da6f6fd39efa4b52", "score": "0.52414364", "text": "bindSocketIO() {\n this.io.on('connection', socket_controller_1.SocketController.handleConnection);\n }", "title": "" }, { "docid": "080496aa5ba71aa9e97e4a656dfc5817", "score": "0.52371275", "text": "function go() {\n\t\t\tcallback(allChannelsForMapArray);\n\t\t}", "title": "" }, { "docid": "7e1f1cdad8e80c9f1a893ce283134285", "score": "0.52339", "text": "zetOnMessage() {\n this.on('message', (bericht) => {\n if (bericht.type === 'console') {\n console.log(`\n ${this.workerNaam} worker\n ${bericht.data}`);\n }\n });\n }", "title": "" }, { "docid": "da72341bef34f37d17fe50e016cc2d8b", "score": "0.52329564", "text": "broadcast_(datum) {\n // TODO(applmak): We could be more efficient here by only sending updates\n // to specific peers that are likely to care, versus ALL peers.\n let msg = {msg: 'persistent-update', datum: datum};\n this.clients.forEach((client) => {\n client.conn.send(msg);\n });\n }", "title": "" }, { "docid": "0d90954267f0341e6a4ab07dca805d91", "score": "0.5224564", "text": "gotMessage(channel, data) {\n\n // Send to WebSocket clients\n var payload = JSON.stringify({ channel: channel, data: data })\n for (var client of this.connections)\n if (client.channels.includes(channel))\n client.send(payload)\n\n // Append to buffers\n for (var buffer of this.buffers) {\n\n // Check if listening to this channel\n if (!buffer.channels.includes(channel))\n continue\n\n // Ensure we don't run out of memory, limit buffer size\n if (buffer.messages.length > 1024 * 4)\n continue\n\n // Append to buffer\n buffer.messages.push(payload)\n\n }\n\n }", "title": "" }, { "docid": "b228d101747622ec7c914feb83a5e7ed", "score": "0.5219836", "text": "_registerMasterListeners () {\n this.server.setListener('reduce', data => {\n let ip = data.sourceIP\n this.reduceCollector[ip] = data.result\n console.log('GO: Receive result from the worker')\n console.log(data.result)\n })\n }", "title": "" }, { "docid": "76dbba79e42f0edc9374029086e3da6a", "score": "0.5218664", "text": "function Worker(vfs) {\n Agent.call(this, {\n\n // Endpoints for writable streams at meta.stream (and meta.process.stdin)\n write: write,\n end: end,\n\n // Endpoint for readable stream at meta.stream (and meta.process.{stdout,stderr})\n destroy: destroy,\n\n // Endpoints for readable streams at options.stream\n onData: onData,\n onEnd: onEnd,\n\n // Endpoint for writable streams at options.stream\n onClose: onClose,\n\n // Endpoints for processes at meta.process\n kill: kill,\n\n // Endpoint for watchers at meta.watcher\n close: closeWatcher,\n\n // Endpoint for apis at meta.api\n call: call,\n\n // Endpoints for vfs itself\n subscribe: subscribe,\n unsubscribe: unsubscribe,\n emit: vfs.emit,\n\n // special vfs-socket api\n ping: ping,\n\n // Route other calls to the local vfs instance\n spawn: route(\"spawn\"),\n exec: route(\"exec\"),\n connect: route(\"connect\"),\n readfile: route(\"readfile\"),\n mkfile: route(\"mkfile\"),\n rmfile: route(\"rmfile\"),\n readdir: route(\"readdir\"),\n stat: route(\"stat\"),\n mkdir: route(\"mkdir\"),\n rmdir: route(\"rmdir\"),\n rename: route(\"rename\"),\n copy: route(\"copy\"),\n symlink: route(\"symlink\"),\n realpath: route(\"realpath\"),\n watch: route(\"watch\"),\n changedSince: route(\"changedSince\"),\n extend: route(\"extend\")\n });\n\n var proxyStreams = {};\n var streams = {};\n var watchers = {};\n var processes = {};\n var apis = {};\n var handlers = {};\n var remote = this.remoteApi;\n\n function subscribe(name, callback) {\n handlers[name] = function (value) {\n remote.onEvent(name, value);\n };\n vfs.on(name, handlers[name], callback);\n }\n\n function unsubscribe(name, callback) {\n if (!handlers[name]) return;\n vfs.off(name, handlers[name], callback);\n delete handlers[name];\n }\n\n // Resume readable streams that we paused when the channel drains\n // Forward drain events to all the writable proxy streams.\n this.on(\"drain\", function () {\n Object.keys(streams).forEach(function (id) {\n var stream = streams[id];\n if (stream.readable && stream.resume) stream.resume();\n });\n Object.keys(proxyStreams).forEach(function (id) {\n var stream = proxyStreams[id];\n if (stream.writable) stream.emit(\"drain\");\n });\n });\n\n // Cleanup streams, proxy streams, proxy processes, and proxy apis on disconnect.\n this.on(\"disconnect\", function () {\n var err = new Error(\"EDISCONNECT: vfs socket disconnected\");\n err.code = \"EDISCONNECT\";\n Object.keys(streams).forEach(function (id) {\n var stream = streams[id];\n delete streams[id];\n stream.emit(\"error\", err);\n });\n Object.keys(proxyStreams).forEach(function (id) {\n var proxyStream = proxyStreams[id];\n delete proxyStreams[id];\n proxyStream.emit(\"error\", err);\n });\n Object.keys(processes).forEach(function (pid) {\n var process = processes[pid];\n delete processes[pid];\n process.emit(\"error\", err);\n });\n Object.keys(watchers).forEach(function (id) {\n var watcher = watchers[id];\n delete watchers[id];\n watcher.emit(\"error\", err);\n });\n Object.keys(apis).forEach(function (name) {\n var api = apis[name];\n delete apis[name];\n api.emit(\"error\", err);\n });\n });\n\n function makeStreamProxy(token) {\n var stream = new Stream();\n var id = token.id;\n stream.id = id;\n proxyStreams[id] = stream;\n if (token.hasOwnProperty(\"readable\")) stream.readable = token.readable;\n if (token.hasOwnProperty(\"writable\")) stream.writable = token.writable;\n\n if (stream.writable) {\n stream.write = function (chunk) {\n return remote.write(id, chunk);\n };\n stream.end = function (chunk) {\n if (chunk) remote.end(id, chunk);\n else remote.end(id);\n };\n }\n if (stream.readable) {\n stream.destroy = function () {\n remote.destroy(id);\n };\n }\n\n return stream;\n }\n\n var nextStreamID = 1;\n function storeStream(stream) {\n while (streams.hasOwnProperty(nextStreamID)) { nextStreamID++; }\n var id = nextStreamID;\n streams[id] = stream;\n stream.id = id;\n if (stream.readable) {\n stream.on(\"data\", function (chunk) {\n if (remote.onData(id, chunk) === false) {\n stream.pause();\n }\n });\n stream.on(\"end\", function () {\n remote.onEnd(id);\n delete streams[id];\n nextStreamID = id;\n });\n }\n if (stream.writable) {\n stream.on(\"close\", function () {\n remote.onClose(id);\n delete streams[id];\n nextStreamID = id;\n });\n }\n var token = {id: id};\n if (stream.hasOwnProperty(\"readable\")) token.readable = stream.readable;\n if (stream.hasOwnProperty(\"writable\")) token.writable = stream.writable;\n return token;\n }\n\n function storeProcess(process) {\n var pid = process.pid;\n processes[pid] = process;\n process.on(\"exit\", function (code, signal) {\n remote.onExit(pid, code, signal);\n delete processes[pid];\n delete streams[process.stdout.id];\n delete streams[process.stderr.id];\n delete streams[process.stdin.id];\n });\n var token = {pid: pid};\n token.stdin = storeStream(process.stdin);\n token.stdout = storeStream(process.stdout);\n token.stderr = storeStream(process.stderr);\n return token;\n }\n\n var nextWatcherID = 1;\n function storeWatcher(watcher) {\n while (watchers.hasOwnProperty(nextWatcherID)) { nextWatcherID++; }\n var id = nextWatcherID;\n watchers[id] = watcher;\n watcher.id = id;\n watcher.on(\"change\", function (event, filename) {\n remote.onChange(id, event, filename);\n });\n var token = {id: id};\n return token;\n }\n\n function storeApi(api) {\n var name = api.name;\n apis[name] = api;\n var token = { name: name, names: api.names };\n return token;\n }\n\n // Remote side writing to our local writable streams\n function write(id, chunk) {\n // They want to write to our real stream\n var stream = streams[id];\n stream.write(chunk);\n }\n function destroy(id) {\n var stream = streams[id];\n if (!stream) return;\n stream.destroy();\n delete streams[id];\n nextStreamID = id;\n }\n function end(id, chunk) {\n var stream = streams[id];\n if (!stream) return;\n if (chunk)\n stream.end(chunk);\n else\n stream.end();\n delete streams[id];\n nextStreamID = id;\n }\n\n function kill(pid, code) {\n var process = processes[pid];\n process.kill(code);\n }\n\n function closeWatcher(id) {\n var watcher = watchers[id];\n delete watchers[id];\n watcher.close();\n }\n\n function call(name, fnName, args) {\n var api = apis[name];\n if (!api) return;\n api[fnName].apply(api, args);\n }\n\n function onData(id, chunk) {\n var stream = proxyStreams[id];\n stream.emit(\"data\", chunk);\n }\n function onEnd(id) {\n var stream = proxyStreams[id];\n stream.emit(\"end\");\n delete proxyStreams[id];\n }\n function onClose(id) {\n var stream = proxyStreams[id];\n if (!stream) return;\n stream.emit(\"close\");\n delete proxyStreams[id];\n }\n\n // Can be used for keepalive checks.\n function ping(callback) {\n callback();\n }\n\n function route(name) {\n var fn = vfs[name];\n return function wrapped(path, options, callback) {\n if (typeof callback !== \"function\") {\n throw new Error(name + \": callback must be function\");\n }\n // Call the real local function, but intercept the callback\n if (options.stream) {\n options.stream = makeStreamProxy(options.stream);\n }\n fn(path, options, function (err, meta) {\n // Make error objects serializable\n if (err) {\n var nerr = {\n stack: process.pid + \": \" + err.stack\n };\n if (err.hasOwnProperty(\"code\")) nerr.code = err.code;\n if (err.hasOwnProperty(\"message\")) nerr.message = err.message;\n return callback(nerr);\n }\n // Replace streams with tokens\n if (meta.stream) {\n meta.stream = storeStream(meta.stream);\n }\n if (meta.process) {\n meta.process = storeProcess(meta.process);\n }\n if (meta.watcher) {\n meta.watcher = storeWatcher(meta.watcher);\n }\n if (meta.api) {\n meta.api = storeApi(meta.api);\n }\n // Call the remote callback with the result\n callback(null, meta);\n });\n };\n }\n}", "title": "" }, { "docid": "807d199578948092958be9a1ce12c28e", "score": "0.5216101", "text": "_setupMessageHandlers() {\n config.MESSAGE_TYPES.SERVER.enums.forEach(type => {\n if (type.key === config.MESSAGE_TYPES.SERVER.OPEN.key) {\n this._io.on(type.key, openMessage => {\n if (!openMessage || !openMessage.peerId) {\n return;\n }\n if (!this._isPeerIdSet) {\n // set peerId for when reconnecting to the server\n this._io.io.opts.query += `&peerId=${openMessage.peerId}`;\n this._isPeerIdSet = true;\n }\n this._reconnectAttempts = 0;\n\n this._startPings();\n this._sendQueuedMessages();\n\n if (!this._isOpen) {\n this._isOpen = true;\n\n // To inform the peer that the socket successfully connected\n this.emit(type.key, openMessage);\n }\n });\n } else {\n this._io.on(type.key, message => {\n this.emit(type.key, message);\n });\n }\n });\n }", "title": "" }, { "docid": "a74f957c99cc1362d33e96ed3769b28c", "score": "0.52157503", "text": "initQWebChannel() {\n\n var self = this;\n\n let ip = this.config.host || \"localhost\"\n let port = this.config.port || 9023;\n\n if (!ip || !port) {\n return this\n }\n\n let socket = new WebSocket(`ws://${ip}:${port}`)\n\n socket.on('open', () => {\n\n if (connectionWatchdog != undefined) {\n clearTimeout(connectionWatchdog);\n connectionWatchdog = undefined;\n }\n\n // Establish API connection.\n new QWebChannelEx(socket, (channel) => {\n\n scheduler = channel.objects.scheduler;\n this.scheduler = scheduler;\n\n var self = this;\n\n // companion will assume it's png data\n let includeMimePrefix = false;\n\n // fetch our base image set\n scheduler.getImageSet(\"automation.glow.base\", includeMimePrefix, (reply) => {\n this.images = {};\n Object.assign(this.images, reply);\n });\n\n self.requestCompanionDefinition = function(kind) {\n const promise = new Promise((resolve, reject) => {\n\n //kind = 'actions' | 'presets' | 'feedbacks'\n scheduler._cmp_v1_query(kind, (reply) => {\n\n try {\n if (kind == \"actions\") resolve(reply.companion_actions);\n else if (kind == \"presets\") resolve(reply.companion_presets);\n else if (kind == \"feedbacks\") resolve(reply.companion_feedbacks);\n else if (kind == \"lastUpdateTimestamp\") resolve(reply.lastUpdateTimestamp);\n else {\n throw \"Type not supported\";\n }\n } catch (e) {\n reject(e);\n }\n });\n });\n return promise;\n };\n\n const refreshCompanionDefinitions = debounce(() => self.refreshIntegrations(self));\n\n scheduler._cmp_v1_handleActorRegistryChangeEvent.connect((elementId) => {\n console.log(`****Registry updated`, elementId);\n refreshCompanionDefinitions();\n });\n\n // Titler has informed us that a feedback has changed\n scheduler._cmp_v1_handleFeedbackChangeEvent.connect((actorId, feedbackId, options, state) => {\n\n var feedbackKey = `${actorId}~${feedbackId}`;\n //console.log(`handle change ${feedbackKey}`, actorId, feedbackId, options, state);\n self.pendingFeedbackChanges[feedbackKey] = \"stale\";\n self.checkFeedbacks(feedbackKey);\n });\n\n this.queryFeedbackState = function(actorId, feedbackId, options) {\n\n var self = this;\n const promise = new Promise((resolve, reject) => {\n\n scheduler._cmp_v1_queryFeedbackState(actorId, feedbackId, options, (reply) => {\n try {\n var value = JSON.parse(reply);\n\n //console.log(`_cmp_v1_queryFeedbackState ${actorId} reply: `, reply);\n\n // query for our layer play states, we will use this to fold into our feedback state\n scheduler.getValueForKey(\"newblue.automation.layerstate\", (playStates) => {\n\n //console.log(`playStates for ${actorId}`, playStates);\n\n // do we have a dynamic image properties?\n if (value.hasOwnProperty(\"overlayQueryKey\")) {\n let s = playStates[value.overlayQueryKey];\n if (s == undefined || !s.hasOwnProperty('playState')) {\n // we have a property\n s = {};\n s.playState = \"unknown\"\n }\n\n if (value.hasOwnProperty(\"overlayImageName_running\")) {\n if (s.playState === 'running') {\n value.overlayImageName = value.overlayImageName_running;\n }\n delete value.overlayImageName_running;\n }\n\n if (value.hasOwnProperty(\"overlayImageName_paused\")) {\n if (s.playState === 'paused') {\n value.overlayImageName = value.overlayImageName_paused;\n }\n delete value.overlayImageName_paused;\n }\n\n // done\n delete value.overlayQueryKey;\n }\n\n if (value.hasOwnProperty(\"pngQueryKey\")) {\n let s = playStates[value.pngQueryKey];\n if (s == undefined || !s.hasOwnProperty('playState')) {\n s = {};\n s.playState = \"unknown\";\n }\n\n // we have a property\n\n if (value.hasOwnProperty(\"png_running\")) {\n if (s.playState === 'running') {\n value.png_running = value.png_running;\n }\n delete value.png_running;\n }\n\n if (value.hasOwnProperty(\"png_paused\")) {\n if (s.playState === 'paused') {\n value.png = value.png_paused;\n }\n delete value.png_paused;\n }\n\n // done\n delete value.pngQueryKey;\n }\n resolve(value);\n\n });\n } catch (e) {\n console.log(`Error parsing response for ${feedbackId}`);\n reject(\"Bogus response\");\n }\n });\n\n });\n return promise;\n }\n\n\n this.queryFeedbackDetails = function(actorId, feedbackId, options) {\n //console.log(\"Query feedback details\", feedbackId);\n let self = this;\n const promise = new Promise((resolve, reject) => {\n try {\n self.queryFeedbackState(actorId, feedbackId, options)\n .then((state) => {\n //console.log(\"_cmp_v1_queryFeedbackState: \", feedbackId, state);\n\n if (state.hasOwnProperty(\"overlayImageName\")) {\n let layerImageData = this.images[`${state.overlayImageName}`];\n delete state.layerImageName;\n\n if (!layerImageData) {\n //console.log(\"bad layer data\");\n } else if (state.hasOwnProperty(\"png64\")) {\n const baseImage = Buffer.from(state.png64, 'base64');\n const overlayImage = Buffer.from(layerImageData, 'base64');\n\n const output = sharp(baseImage)\n .composite([\n { input: overlayImage, tile: true, blend: 'over' }\n ]).toBuffer()\n .then((buffer) => {\n let base64data = buffer.toString('base64');\n state.png64 = base64data;\n resolve(state);\n }).catch((e) => {\n resolve(state);\n });\n\n return;\n\n } else {\n // fall back\n state.png64 = this.layerImageData;\n }\n\n } else if (state.hasOwnProperty(\"imageName\")) {\n state.png64 = this.images[`${state.imageName}`];\n delete state.imageName;\n }\n resolve(state);\n\n\n\n\n });\n } catch (e) {\n console.log(\"An error occurred\", e);\n reject(e);\n }\n });\n return promise;\n };\n\n this.refreshIntegrations();\n this.status(this.STATE_OK, \"Connected\");\n\n // let Titler know who we are and that we've connected, to customize behaviour and/or trigger startup logic\n scheduler.notifyClientConnected(\"com.newbluefx.companion-module\", \"1.0\", {}, (reply) => {\n // don't do anything with the reply\n // var hostVersionInfo = JSON.parse(reply);\n // console.log(hostVersionInfo);\n });\n\n });\n\n var self = this;\n\n\n });\n\n socket.on('error', (data) => {\n console.warn(`NewBlue: TitlerLive: Connection error: ${data}`)\n })\n\n socket.on('close', () => {\n //console.warn('NewBlue: TitlerLive: Connection closed.')\n\n if (connectionWatchdog == undefined) {\n\n this.status(this.STATUS_WARNING, 'Disconnected');\n\n // let's periodically try to make a connection again\n connectionWatchdog =\n setInterval(() => {\n self.initQWebChannel();\n }, 5000);\n }\n\n })\n }", "title": "" }, { "docid": "70fefcde7ed45c1ee47889d022e4dcd9", "score": "0.5213999", "text": "static listenSocketEvents() {\n Socket.shared.on(\"order_item:updated\", (data) => {\n let logger = Logger.create(\"order_item:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(OrderItem.actions.orderItemUpdatedEvent(data));\n });\n }", "title": "" }, { "docid": "611427797156243bb030ceb520af5fdb", "score": "0.5212097", "text": "function simpleBroadcaster(events, socket){\n for(var i = 0; i<events.length; i++){\n socket.on(events[i], (function(event){\n return function(data){\n console.log(event);\n socket.broadcast.emit(event, data);\n }\n\n })(events[i]));\n }\n}", "title": "" }, { "docid": "e3068968fcc5a9a3d6354002302bc519", "score": "0.52109265", "text": "function main(){\n ws = new WebSocket(\"ws://192.168.56.101:8080\");\n ws.onmessage = function(e){\n insertNewMessage(e.data);\n }\n}", "title": "" }, { "docid": "2830f4dda372ed0acbc1d5313b422b90", "score": "0.520972", "text": "onWSConnect() {\n this.socket.emit('HELLO', this.wrapMessage());\n let hb = (() => { this.socket.emit('HEARTBEAT', this.wrapMessage())}).bind(this);\n this.heartbeat = setInterval(hb, 2000);\n }", "title": "" }, { "docid": "909972617e9ac96d0374a0350cb0d3fa", "score": "0.5206408", "text": "function sendAllClients (msg) {\n wss.clients.forEach(function each (client) {\n client.send(msg)\n })\n}", "title": "" }, { "docid": "8765ea42455f225d9698f0e4bbf9e7a9", "score": "0.5198642", "text": "function run() {\n self.postMessage({ \n 'notification' : c.NOTIFICATION.STARTED \n });\n doWork();\n}", "title": "" }, { "docid": "6a2d0f08aabd766e75825d8ea77c3d0b", "score": "0.5197455", "text": "function HttpWorker(config){\n Worker.call(this, config);\n this.clients = [];\n //this.init(config, done);\n}", "title": "" } ]
e74176d06616a436f44e5370add0fca6
Response Time vs Request
[ { "docid": "8287b846feb31f4ad2eea35dd529c874", "score": "0.0", "text": "function refreshResponseTimeVsRequest() {\n var infos = responseTimeVsRequestInfos;\n prepareSeries(infos.data);\n if (isGraph($(\"#flotResponseTimeVsRequest\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimeVsRequest\", \"#overviewResponseTimeVsRequest\");\n $('#footerResponseRimeVsRequest .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" } ]
[ { "docid": "2924d18e98c07b54a492fd913a3b2388", "score": "0.7801827", "text": "function response_time(req, res){\n if (!res._header || !req._startAt) return '';\n var diff = process.hrtime(req._startAt);\n var ms = diff[0] * 1e3 + diff[1] * 1e-6;\n return ms.toFixed(3);\n}", "title": "" }, { "docid": "f773e50decd94335add9518c6ab0dfee", "score": "0.73113537", "text": "function getServerTime(res) {\n if (res.headers[\"x-response-time\"]) return parseInt(res.headers[\"x-response-time\"]);\n if (res.headers[\"x-runtime\"]) return Math.floor(res.headers[\"x-runtime\"] * 1000);\n return -1;\n }", "title": "" }, { "docid": "217ef32eef8c57527f73e6e96d7dd734", "score": "0.7165224", "text": "function determineResponseTime(){\n\tvar m = Math.floor(Math.random() * 2000) + 500;\n\treturn m;\n}", "title": "" }, { "docid": "40e8ed840498099cb977a1ed8976f7b3", "score": "0.708736", "text": "async function calcResponseTime(ctx, next) {\n const start = Date.now();\n await next();\n const ms = Date.now() - start;\n ctx.set(responeTimeKey, `${ms} ms`);\n}", "title": "" }, { "docid": "72fa9de3066063384b1097a6b04e6fd6", "score": "0.6770541", "text": "function getServerTime(req, res) {\n\tvar time = new Date();\n\t\n\tvar result = {success: true, time: time};\n\tres.json(result); \n}", "title": "" }, { "docid": "afc7b25b2e82c79aed82fe6e0b6b4ba6", "score": "0.66366976", "text": "get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0\n ? void 0\n : _a.timings;\n }", "title": "" }, { "docid": "be662f81f97b5e1df06dc9a7a237e214", "score": "0.6594776", "text": "function getLastRequestTiming(){\n // Check performance support\n if (performance === undefined) {\n console.log(\"= Calculate Load Times: performance NOT supported\");\n return {};\n }\n\n // Get a list of \"resource\" performance entries\n var resources = performance.getEntriesByType(\"resource\");\n if (resources === undefined || resources.length <= 0) {\n console.log(\"= Calculate Load Times: there are NO `resource` performance records\");\n return;\n }\n logLoadTimes();\n const resource = resources[resources.length - 1];\n const {name, redirectStart, redirectEnd, domainLookupEnd, domainLookupStart, connectEnd, connectStart,\n secureConnectionStart, responseStart, responseEnd, startTime, requestStart, fetchStart} = resource;\n\n const redirectTime = redirectEnd - redirectStart;\n const dns = domainLookupEnd - domainLookupStart;\n const connect = connectEnd - connectStart;\n const ssl = secureConnectionStart > 0 ? connectEnd - secureConnectionStart : 0;\n const responseTime = responseEnd - responseStart;\n const total = fetchStart > 0 ? responseEnd - fetchStart : 0;\n return {\n dns, connect, ssl, receive: responseTime, total,\n }\n}", "title": "" }, { "docid": "59e864959843b233f6cf5fe626959059", "score": "0.652187", "text": "get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }", "title": "" }, { "docid": "59e864959843b233f6cf5fe626959059", "score": "0.652187", "text": "get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }", "title": "" }, { "docid": "59e864959843b233f6cf5fe626959059", "score": "0.652187", "text": "get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }", "title": "" }, { "docid": "83e71d2d46ac52267af8bc0e3d5c4721", "score": "0.6509784", "text": "getCurrentRequestTime() {\n console.warn(\"'getCurrentRequestTime' is deprecated and will be removed in a future version\");\n return this.latency();\n }", "title": "" }, { "docid": "5c4d6fd25108f5ffb5b376d0ab030316", "score": "0.64137584", "text": "function logWebRequest(req, res){\n\tvar success = (res.statusCode === 200 || res.statusCode === 304 || res.statusCode === 206) ? 'SUCCESS' : 'FAIL'\n\t , contentLengthBytes = parseInt(res.get('content-length') || 0, 10)\n\t , contentLengthKiloBytes = contentLengthBytes / 1024\n\t , responseTime = (new Date() - req._startTime) / 1000\n\t , bandwidth = Math.ceil(contentLengthKiloBytes/responseTime,2);\n\tlogger.info('%s %s - %s %s %s %s bytes - %s ms - %s kbps', success, req.ip, req.method, req.url, res.statusCode, contentLengthBytes, responseTime, bandwidth );\n}", "title": "" }, { "docid": "f1dfdb9b07bbaf98a90569b6f5a4a4ad", "score": "0.6402943", "text": "timeRes () { return this._timeRes }", "title": "" }, { "docid": "4994aadf311d6ca9a1d9c77cd3f46b87", "score": "0.6383145", "text": "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "title": "" }, { "docid": "d4f63d8fa30cce4a7fa971eeaf376239", "score": "0.6378166", "text": "async function middleware(ctx, next) {\n\tconst start = new Date();\n\tawait next();\n\tconst ms = new Date() - start;\n\tctx.set(\"X-Response-Time\", `${ms}ms`);\n}", "title": "" }, { "docid": "729584b5d2cc202bf1e8008135389cb4", "score": "0.6349935", "text": "get nextRequestTime() {\n return this._nextRequestTime;\n }", "title": "" }, { "docid": "34d74fb02edbbb8a777c2b1e81aba1aa", "score": "0.6335486", "text": "function get_site_response_time(host, callback) {\n var start = Date.now();\n request('https://ryanseys.com/up', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n if(body == 'yep\\n') {\n var dur = Date.now() - start;\n console.log(\"Site is up and responded in \" + dur + \" ms.\");\n callback(dur);\n }\n else {\n console.log('SITE IS DOWN');\n }\n }\n else {\n callback(null);\n }\n });\n}", "title": "" }, { "docid": "9cccb4ff10e1830a2e32892401b47ceb", "score": "0.6245028", "text": "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "title": "" }, { "docid": "9cccb4ff10e1830a2e32892401b47ceb", "score": "0.6245028", "text": "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "title": "" }, { "docid": "9cccb4ff10e1830a2e32892401b47ceb", "score": "0.6245028", "text": "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "title": "" }, { "docid": "9cccb4ff10e1830a2e32892401b47ceb", "score": "0.6245028", "text": "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "title": "" }, { "docid": "9cccb4ff10e1830a2e32892401b47ceb", "score": "0.6245028", "text": "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "title": "" }, { "docid": "2f77e926d60a901f459b00881fe15a10", "score": "0.62403613", "text": "function process(isRespondedInTime,req,res,connection)\r\n {\r\n if(isRespondedInTime)// if responded less than 90 sec\r\n {\r\n console.log('Responded within 90 seconds');// comment this line\r\n getUserStatus(response_to,req,res,connection);\r\n \r\n }\r\n else\r\n {\r\n console.log('Responded after 90 seconds');// comment this line\r\n\r\n // Treating second user as main user if requestor user is busy in playing or gone offline \r\n user_name=response_by;\r\n user_Lat=response_by_user_lat;\r\n user_Lon=response_by_user_long;\r\n page = 0; // Handled pagination on socket response (Force play)\r\n force_play_request = req;\r\n force_play_resource = res;\r\n from_user = user_name; \r\n\r\n checkOtherParametersFromDB(req,res,connection);\r\n }\r\n }", "title": "" }, { "docid": "66dfc833afa988697db7289b359b4ba0", "score": "0.6208376", "text": "function handleRequest2(req, response){\n request.get('http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx='+IDX2+'&switchcmd=On').on('error', function(err) {\n var thetime = getDatetime();\n\tconsole.log(thetime + \": \" + err);\n });\n}", "title": "" }, { "docid": "30da50f543ee7f66e6f8a5a8317320ba", "score": "0.6189621", "text": "function printTime(req,res,next){\n console.log(\"time: \",new Date())\n next()\n}", "title": "" }, { "docid": "fb7c81bf38e2a6d1030767afbc693313", "score": "0.6063282", "text": "function getTiming(callback) {\n getAppIp();\n var request = $http({\n method: \"POST\",\n //url: 'storage/timing.json'\n url: cfg.server_url + cfg.stat_url\n });\n request.success(function(data) {\n return callback(data);\n }).error(function() {\n console.log('Error: CommunicationStatistics');\n handleError(false, true);\n\n });\n }", "title": "" }, { "docid": "49d895ed81ef388db1869df48e253b76", "score": "0.60624605", "text": "function doRequest() {\n https.request('https://www.google.com', res => {\n res.on('data', () => {});\n res.on('end', () => console.log(Date.now() - start));\n }).end();\n}", "title": "" }, { "docid": "ea3a5e0df17457fab2353ca8d4a629c6", "score": "0.6044759", "text": "responseTime(data) {\n\n var avgTime = 0;\n var nbRequest = 0;\n var maxTime = 0;\n var minTime = Number.MAX_VALUE;\n\n data.map(element => {\n nbRequest++;\n avgTime = avgTime + element.delay;\n maxTime = (maxTime >= element.delay) ? maxTime : element.delay;\n minTime = (minTime <= element.delay) ? minTime : element.delay;\n });\n\n var avg = (nbRequest == 0) ? \"none\" : Math.round(avgTime / nbRequest);\n return {\n \"min\": minTime,\n \"avg\": avg,\n \"max\": maxTime\n };\n }", "title": "" }, { "docid": "7bc75aea5ac3176ca078b198bd5a7e95", "score": "0.6026386", "text": "setCounterTime(state, response) { \r\n state.counterTime = state.counterTime - response;\r\n }", "title": "" }, { "docid": "691d79afc317eeeea968224cb3a6b738", "score": "0.60239196", "text": "function a(){if(!e.s_loadT){var t=(new Date).getTime(),n=e.performance?performance.timing:0,a=n?n.requestStart:e.inHeadTS||0;s_loadT=a?Math.round((t-a)/100):\"\"}return s_loadT}", "title": "" }, { "docid": "89afa79783897808a43e77d1bfd0525f", "score": "0.60194606", "text": "latency() {\n return Date.now() - this.time;\n }", "title": "" }, { "docid": "a35eeace88a90e2d97b084336c733d73", "score": "0.59687173", "text": "function handlePushNotificationResponse(req,res,connection){\r\n\r\n response_time = getCurrentDateTime();//\"0000 00 00 00:00:00\"\r\n getUserResponsetimeDifference(response_to,response_by,response_time,req,res,connection);// check user response less or greater than 90 sec\r\n \r\n \r\n}// End - handle APNS response - anas - 17 Sep 2015", "title": "" }, { "docid": "479404878ab50905698ec7d3fbdfd82d", "score": "0.5953181", "text": "function getUserResponsetimeDifference(response_to,response_by,response_time,req,res,connection)\r\n {\r\n var isRespondedInTime = false;\r\n var sendAt;\r\n var query = \"select DATE_FORMAT(created_at,'%Y/%m/%d %T') As created_At from push_notification where send_from='\"+response_to+\"' AND send_to='\"+response_by+\"' ORDER BY id DESC LIMIT 1\";\r\n //console.log('push notification query: '+query);\r\n connection.query(query,function(err,rows,fields){\r\n if(!err){\r\n for (var i in rows) {\r\n //console.log('rows[i].created_at = '+ rows[i].created_At)\r\n sendAt=rows[i].created_At;\r\n }\r\n\r\n }\r\n else{\r\n console.log('Error in fetching user push notification detail'); //comment this line\r\n }\r\n\r\n console.log('response_time = ' +response_time + ' sendAt = '+sendAt );//Comment this line\r\n if(sendAt == null)\r\n {\r\n isRespondedInTime = false;\r\n }\r\n else if(response_time < sendAt)\r\n {\r\n isRespondedInTime = true;\r\n }\r\n else\r\n {\r\n isRespondedInTime = false;\r\n }\r\n\r\n console.log('isRespondedInTime = ' + isRespondedInTime);// comment this line\r\n process(isRespondedInTime,req,res,connection);\r\n }); \r\n }", "title": "" }, { "docid": "5f0fae10989cdb8c77511ec293bb7bb7", "score": "0.5925947", "text": "function getServerDateTime()\r\n{\r\n\treturn new Date().getTime()+_options.serverTimeDelta;\r\n}", "title": "" }, { "docid": "514077d4f163d373af5161863da21554", "score": "0.58970255", "text": "static get REQUEST_TIMEOUT() {\n return 5000;\n }", "title": "" }, { "docid": "14608e069b47cc3c278b133c1dd6838b", "score": "0.5884257", "text": "function getData(time) {\n lastRequestedTime = time;\n return data\n}", "title": "" }, { "docid": "2327a90522ab7cff03c2debf6959d4fe", "score": "0.58189225", "text": "_getBaton(method, params, res) {\n\t\tvar t = this;\n\t\tvar time = new Date();\n\t\treturn {\n\t\t\t//id to reference detail log\n\t\t\tid: this._generateId(10),\n\t\t\tstart_time: time.getTime(),\n\t\t\terr: [],\n\t\t\t//the original callback set in 'post' / 'get' endpoint calls\n\t\t\tcallOrigCallback: function(data) {\n\t\t\t\tvar end_time = new Date()\n\t\t\t\tthis.duration = end_time.getTime() - this.start_time\n\t\t\t\tconsole.log(this.methods[0] + \" | \" + this.duration)\n\t\t\t\tthis.orig_callback(data)\n\t\t\t},\n\t\t\tres: res,\n\t\t\tparams: params,\n\t\t\t//method sequence\n\t\t\tmethods: [method],\n\t\t\trequestType: 'GET',\n\t\t\taddMethod: function(meth) {\n\t\t\t\tthis.methods.push(meth)\n\t\t\t},\n\t\t\t//the error object & public message to display\n\t\t\tsetError: function(error) {\n\t\t\t\tvar end_time = new Date()\n\t\t\t\tthis.duration = end_time.getTime() - this.start_time\n\t\t\t\tthis.err.push(error);\n\t\t\t},\n\t\t\tsendError: function(data) {\n\t\t\t\tres.status(500).json(data)\n\t\t\t},\n\t\t\tdownload: function(data) {\n\t\t\t\tvar end_time = new Date()\n\t\t\t\tthis.duration = end_time.getTime() - this.start_time\n\t\t\t\tconsole.log(this.methods[0] + \" | \" + this.duration)\n\t\t\t\tthis.res.status((this.requestType == \"GET\" ? 200 : 201)).download(data)\n\t\t\t},\n\t\t\tjson: function(data) {\n\t\t\t\tvar end_time = new Date()\n\t\t\t\tthis.duration = end_time.getTime() - this.start_time\n\t\t\t\tconsole.log(this.methods[0] + \" | \" + this.duration)\n\t\t\t\tthis.res.status((this.requestType == \"GET\" ? 200 : 201)).json(data)\n\t\t\t},\n\t\t\tthrowError: function(keepErrorMessage) {\n\t\t\t\tt._generateError(this, keepErrorMessage)\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "073148f9579fd591e48b93897472df00", "score": "0.5806618", "text": "function processRequest() {\r\n if (req.readyState == 4) {\r\n var d2 = new Date;\r\n var time = d2.getTime() - d.getTime();\r\n // Time will be more variable once you start scanning more than a \r\n // few hosts... so this would need to be re-written.\r\n if (time < timeout) {\r\n if (time > 10) {\r\n //w2g.base.debug(\"Exists: \" + url + \" at \" + time + \"ms.\");\r\n\t\t\t\t\t\tvar info = url.substring(7) + \" live, \" + time + \"ms.\";\r\n\t\t\t\t\t\tw2g.net.steal2db(info, 3);\r\n }\r\n } else {\r\n //w2g.base.debug(\"Doesn't exist: \" + url + \" at \" + time + \"ms.\");\r\n\t\t\t\t\tvar info = url.substring(7) + \" down, \" + time + \"ms.\";\r\n\t\t\t\t\t//w2g.net.steal2db(info, 3);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d4be8d8878a9af77fc8afcbd2262ba13", "score": "0.5804739", "text": "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "title": "" }, { "docid": "a7886facc78ea5c7c2fd9938e48970bf", "score": "0.5751509", "text": "function request_callback (req,res){\n console.log(req.headers); // output the request headers to the console\n res.WriteHead(200, {'Content-Type': 'text/html'}); // set MIME type to HTML\n res.write(`<h1>The server data is: ${Data.now()}</h1>`); //send a repsonse to the client\n res.write(`<h1>The clinet data is:<script>doucment.write(Date.now()); </script></h1>`);\n res.end(); // end the response\n \n}", "title": "" }, { "docid": "c8e5794539e8e82227b80b02eb9d2a7c", "score": "0.57296115", "text": "get time() { return(this.startTime?(new Date()).getTime()-this.startTime:0); }", "title": "" }, { "docid": "51c1fc47fc300191f073a0fe62716ace", "score": "0.5720556", "text": "function alive(req, res){\n\tres.send(new AXResponse(true, moment().valueOf()));\n}", "title": "" }, { "docid": "b72a86abcda09d00d103f8bb466102f5", "score": "0.5715072", "text": "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}", "title": "" }, { "docid": "b72a86abcda09d00d103f8bb466102f5", "score": "0.5715072", "text": "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}", "title": "" }, { "docid": "b72a86abcda09d00d103f8bb466102f5", "score": "0.5715072", "text": "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}", "title": "" }, { "docid": "0624e4095b9f5e5aab5798af9f1cc5d1", "score": "0.57059675", "text": "function HandlerTest(req, res) {\n\n res.send(\"test Time\")\n\n\n}", "title": "" }, { "docid": "11e683f78677f06039f30bbc031afb62", "score": "0.5695538", "text": "function checkRequestTimeout(){\n\tvar currentTime = new Date().getTime();\n\tif(lastRcvRequestTime != 0){\n\t\tif(currentTime - lastRcvRequestTime > 30 * 1000){\n\t\t\tlastRcvRequestTime = 0;\n\t\t\tendRefreshRequest(1);\n\t\t\talert(MESSAGE.DASHBOARD_LABLE_CHECKREQUESTTIMEOUT_ALERT);\n\t\t}\n\t}\n\t\n\tif(lastSndRequestTime != 0){\n\t\tif(currentTime - lastSndRequestTime > 30 * 1000 ){\n\t\t\tlastSndRequestTime = 0;\n\t\t\tendRefreshRequest(2);\n\t\t\talert(MESSAGE.DASHBOARD_LABLE_CHECKREQUESTTIMEOUT_ALERT);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "11e683f78677f06039f30bbc031afb62", "score": "0.5695538", "text": "function checkRequestTimeout(){\n\tvar currentTime = new Date().getTime();\n\tif(lastRcvRequestTime != 0){\n\t\tif(currentTime - lastRcvRequestTime > 30 * 1000){\n\t\t\tlastRcvRequestTime = 0;\n\t\t\tendRefreshRequest(1);\n\t\t\talert(MESSAGE.DASHBOARD_LABLE_CHECKREQUESTTIMEOUT_ALERT);\n\t\t}\n\t}\n\t\n\tif(lastSndRequestTime != 0){\n\t\tif(currentTime - lastSndRequestTime > 30 * 1000 ){\n\t\t\tlastSndRequestTime = 0;\n\t\t\tendRefreshRequest(2);\n\t\t\talert(MESSAGE.DASHBOARD_LABLE_CHECKREQUESTTIMEOUT_ALERT);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9f2ecd42732f0742cb880d3ebb6fa5d8", "score": "0.56831354", "text": "static time () { return performance.now() }", "title": "" }, { "docid": "e9d7b0e215ff5f22e26502b8ba726b72", "score": "0.56774044", "text": "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):\"\";}return s_loadT;}", "title": "" }, { "docid": "3bb257a07f98d7fa4fad075a72354f00", "score": "0.5634749", "text": "listen(request, response) {\n\t\tconst id = this.latency.start();\n\t\trequest.body = '';\n\t\trequest.on('data', data => {\n\t\t\trequest.body += data.toString();\n\t\t});\n\t\trequest.on('error', () => {\n\t\t\t// ignore request\n\t\t\tresponse.end()\n\t\t\tthis.latency.end(id, -1);\n\t\t})\n\t\trequest.on('end', () => {\n\t\t\tthis.totalRequests += 1\n\t\t\tconst elapsedMs = Date.now() - this.debuggedTime\n\t\t\tif (elapsedMs > LOG_HEADERS_INTERVAL_MS) {\n\t\t\t\tthis.debug(request, elapsedMs);\n\t\t\t}\n\t\t\tif (!this.options.delay) {\n\t\t\t\treturn this.end(response, id);\n\t\t\t}\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.end(response, id);\n\t\t\t}, this.options.delay).unref();\n\t\t});\n\t}", "title": "" }, { "docid": "efad1bd3cf633eaaec021619e3b5f39c", "score": "0.5616171", "text": "function time(){\n return Date.now() + time_offset;\n }", "title": "" }, { "docid": "973f40859e85032f5ea9099a27646b59", "score": "0.5595883", "text": "function respuestaTimestampVacio(req, res) //Esta función devuelve como respuesta a la llamada un archivo, en este caso un HTML para \"visualizar la app\"\n{ \n req.utc = new Date(Date.now()).toUTCString();\n req.unix = new Date(Date.now()).getTime();\n res.json({\"unix\": req.unix, \"utc\": req.utc}); \n console.log(\"Recibida una llamada en www.app.com/api/timestamp/\");\n}", "title": "" }, { "docid": "1476bafc8ce8026daaee9264eec9f8f1", "score": "0.55885065", "text": "function handleRequest(req, res) {\n const url = req.url;\n const requestStartTime = new Date().getMilliseconds();\n // start recording a time for request\n try {\n if (url === '/') {\n res.end('healthcheck');\n }\n\n if (url === '/aws-sdk-call') {\n const s3 = new AWS.S3();\n s3.listBuckets(() => { });\n const traceID = returnTraceIdJson();\n res.end(traceID);\n }\n\n if (url === '/outgoing-http-call') {\n http.get('http://aws.amazon.com');\n const traceID = returnTraceIdJson();\n res.end(traceID);\n meter.emitsPayloadMetric(res._contentLength + mimicPayLoadSize(), '/outgoing-http-call', res.statusCode);\n meter.emitReturnTimeMetric(new Date().getMilliseconds() - requestStartTime, '/outgoing-http-call', res.statusCode);\n }\n } catch (err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "a7ac76e48afacd2b7d7910c531c4487b", "score": "0.5586212", "text": "function testAPI (url, requests, rateLimit) {\n\tif (requests > 1) {\n\t\tvar count = new Array(requests).fill(0);\n\t\tvar results = count.map(function() {\n\t\t\tvar startTime = Date.now();\n\t\t\tvar result = request.sync(url);\n\t\t\tvar responsetime = Date.now() - startTime;\n\t\t\t//the below if statement checks if the responsetime is less\n\t\t\t//than 15 minutes/rateLimit, if it is, we wait \n\t\t\tif (responsetime < 900000/rateLimit) {\n\t\t\t\tvar waitTime = (900000/rateLimit)-responsetime;\n\t\t\t\tvar start = Date.now();\n\t\t\t\twhile (Date.now() != start+waitTime) {\n\t\t\t\t}//pretty hacky, but there isn't a nice wait() function\n\t\t\t}\n\t\t\tconsole.log(JSON.parse(result.body).forms[0]);\n\t\t\treturn responsetime;\n\t\t});\n\t\treturn results;\n\t} else {\n\t\tvar startTime = Date.now();\n\t\tvar result = request.sync(url);\n\t\tvar responsetime = Date.now() - startTime;\n\t\treturn responsetime;\n\t}\n}", "title": "" }, { "docid": "f543ce22ff76a56e99d19bdfd64e14db", "score": "0.55849", "text": "function myTimer() {\n counter++;\n feedNo++;\n if (feedNo >= feedsCount) feedNo = 0;\n feed = config.feeds[feedNo];\n if (counter == maxTime) {\n console.log(getDateTime());\n counter = 0;\n } else {\n process.stdout.write('.');\n process.stdout.write(feed.title);\n }\n request({\n url: feed.url, //URL to hit\n qs: {from: 'feed example', time: +new Date()}, //Query string data\n method: 'GET', //Specify the method\n headers: { //We can define headers too\n 'Content-Type': 'MyContentType',\n 'Custom-Header': 'Custom Value'\n }\n }, function(error, response, body){\n // console.log(\"...returned\", error);\n if(error) {\n console.log(\"Feed err: \", error);\n } else {\n if (response.statusCode !== 200) {\n console.log(\"Status code: \", response.statusCode);\n } else {\n // if (!quiet) console.log(body);\n jsonObj = {};\n if (feed.type == \"xml\") {\n jsonObj = xml2json.parser( body );\n } else {\n jsonObj = JSON.parse(body);\n }\n jsonDiff = diff(jsonLast[feedNo], jsonObj);\n jsonLast[feedNo] = JSON.parse(JSON.stringify(jsonObj));\n \n // if (!quiet) console.log(jsonObj);\n\n if (jsonDiff) {\n var timeString = getDateTime().substring(11);\n console.log(timeString, \": \");\n\n jsonObj.logTime = getDateTime();\n jsonObj.title = feed.title;\n log2db(jsonObj, quiet);\n \n var jsonLog = {};\n jsonLog.changes = jsonDiff;\n jsonLog.logTime = getDateTime();\n jsonLog.title = feed.title;\n\n console.log(feedNo, \":::\", JSON.stringify(jsonLog));\n log2diff(jsonLog, quiet);\n \n }\n }\n }\n });\n}", "title": "" }, { "docid": "82bb361ec092485a185d9a597b6b19c1", "score": "0.5581636", "text": "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "title": "" }, { "docid": "82bb361ec092485a185d9a597b6b19c1", "score": "0.5581636", "text": "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "title": "" }, { "docid": "82bb361ec092485a185d9a597b6b19c1", "score": "0.5581636", "text": "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "title": "" }, { "docid": "82bb361ec092485a185d9a597b6b19c1", "score": "0.5581636", "text": "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "title": "" }, { "docid": "82bb361ec092485a185d9a597b6b19c1", "score": "0.5581636", "text": "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "title": "" }, { "docid": "9f988e839ed80a1705d771940baa0057", "score": "0.55547965", "text": "function getStartTime() {\n sendAjaxRequest('timer', null, function (xhttp) {\n responseCallback(xhttp, onError, function (xhttp) {\n var resObj = JSON.parse(xhttp.response);\n console.log(resObj);\n if(resObj['response'] !== undefined) {\n var timestamp = resObj['response'].timestamp;\n if(isNaN(timestamp) || timestamp === '\"\"' || timestamp === \"\") {\n getStartTime();\n } else {\n interval.timestamp = setInterval(countDown, 10, timestamp);\n }\n } else if(resObj['error'] !== undefined) {\n console.log(resObj);\n setStatus('disconnected', resObj['error']);\n } else {\n console.log(resObj);\n setStatus('disconnected', resObj['exception']);\n }\n });\n });\n}", "title": "" }, { "docid": "3dee5d499351e7e2fbaa3f06def93fcb", "score": "0.55094326", "text": "function getEndTime(request){\n request.endTime = new Date(request.date);\n switch (request.duration){\n case \"30 分鐘\":\n request.endTime.setMinutes(request.date.getMinutes() + 30);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"45 分鐘\":\n request.endTime.setMinutes(request.date.getMinutes() + 45);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"1 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 60);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"2 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 120);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"3 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 180);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"4 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 240);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"5 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 300);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"6 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 360);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"7 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 420);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"8 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 480);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"9 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 540);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n case \"10 小時\":\n request.endTime.setMinutes(request.date.getMinutes() + 600);\n request.endTimeString = request.endTime.toLocaleTimeString();\n break;\n }\n}", "title": "" }, { "docid": "fc1a6ee59f32147ec89a43a526a02bb3", "score": "0.55050945", "text": "setFirstCounterTime(state, response) { \r\n state.counterTime = response;\r\n }", "title": "" }, { "docid": "12f9e539654da477fc147c26786c6197", "score": "0.54995996", "text": "calculate() {\n const {\n requestsFailed,\n requestsFinished,\n requestTotalFailedDurationMillis,\n requestTotalFinishedDurationMillis,\n } = this.state;\n const totalMillis = Date.now() - this.instanceStart;\n const totalMinutes = totalMillis / 1000 / 60;\n\n return {\n requestAvgFailedDurationMillis: Math.round(requestTotalFailedDurationMillis / requestsFailed) || Infinity,\n requestAvgFinishedDurationMillis: Math.round(requestTotalFinishedDurationMillis / requestsFinished) || Infinity,\n requestsFinishedPerMinute: Math.round(requestsFinished / totalMinutes) || 0,\n requestsFailedPerMinute: Math.floor(requestsFailed / totalMinutes) || 0,\n requestTotalDurationMillis: requestTotalFinishedDurationMillis + requestTotalFailedDurationMillis,\n requestsTotal: requestsFailed + requestsFinished,\n crawlerRuntimeMillis: totalMillis,\n };\n }", "title": "" }, { "docid": "87b414b4a70328a773004da13d88339f", "score": "0.5490174", "text": "function targetResponseTime(change) {\n return metric(\"TargetResponseTime\", Object.assign({}, change));\n }", "title": "" }, { "docid": "4f8edb4817f80da41148315ffbbe9297", "score": "0.54844046", "text": "function countDelay(delay) {\n\t //showtime.print('Getting difference between:'+lastRequest+\" and \"+showtime.time());\n\t var timeDiff = getTimeDifference(lastRequest,showtime.time())*1000;\n\t //showtime.print(\"time sinse last call:\"+timeDiff);\n\t if(timeDiff<delay) {\n\t //wait for the delay time to end\n\t return delay-timeDiff;\n\t }\n\t else {\n\t return 0; \n\t }\n\t \n\t}", "title": "" }, { "docid": "f54a7ccf936c11010e070c3139367365", "score": "0.5469932", "text": "function requestsSent () {\n\n }", "title": "" }, { "docid": "8d0c0747a54c18aa6bc56085b4fff482", "score": "0.5463994", "text": "function now(){\n return (new Date()).getTime() - timeDifference;\n}", "title": "" }, { "docid": "71b8e9897a26f76b987312fd3bada09b", "score": "0.54617393", "text": "function http_time(args) {\n var port = args[2];\n var network = require(\"net\");\n var server = network.createServer(function(socket) {\n var date = new Date();\n var dateStr = \"\";\n function addZero(num) {\n return (num < 10 ? \"0\" : \"\") + num;\n }\n\n dateStr += addZero(date.getFullYear()) + \"-\";\n dateStr += addZero(date.getMonth() + 1) + \"-\";\n dateStr += addZero(date.getDate()) + \" \";\n dateStr += addZero(date.getHours()) + \":\";\n dateStr += addZero(date.getMinutes()) + \"\\n\";\n\n socket.end(dateStr); //writes the data the socket object and then closes the socket\n });\n\n server.listen(port);\n}", "title": "" }, { "docid": "996b9b4268a50b3b27a087b57e3c58b5", "score": "0.545753", "text": "add(time, errorCode) {\n\t\tlog.debug('New value: %s', time);\n\t\tthis.partialTime += time;\n\t\tthis.partialRequests++;\n\t\tthis.totalTime += time;\n\t\tthis.totalRequests++;\n\t\tif (errorCode) {\n\t\t\terrorCode = '' + errorCode;\n\t\t\tthis.partialErrors++;\n\t\t\tthis.totalErrors++;\n\t\t\tif (!(errorCode in this.errorCodes)) {\n\t\t\t\tthis.errorCodes[errorCode] = 0;\n\t\t\t}\n\t\t\tthis.errorCodes[errorCode] += 1;\n\t\t}\n\t\tlog.debug('Partial requests: %s', this.partialRequests);\n\t\tconst rounded = Math.floor(time);\n\t\tif (rounded > this.maxLatencyMs) {\n\t\t\tthis.maxLatencyMs = rounded;\n\t\t}\n\t\tif (rounded < this.minLatencyMs) {\n\t\t\tthis.minLatencyMs = rounded;\n\t\t}\n\t\tif (!this.histogramMs[rounded]) {\n\t\t\tlog.debug('Initializing histogram for %s', rounded);\n\t\t\tthis.histogramMs[rounded] = 0;\n\t\t}\n\t\tthis.histogramMs[rounded] += 1;\n\t\tif (this.isFinished()) {\n\t\t\tthis.finish();\n\t\t}\n\t}", "title": "" }, { "docid": "9ba78fc6ba0977703fd8d629002439fa", "score": "0.54388136", "text": "async lastAccessed(url) {\n let domain = this.getDomain(url);\n\n //console.log(\"Hi, so, we are accessing a time for \" + url);\n return new Promise((resolve) => {\n this.postMessage({\"kind\": \"lastAccessed\", \"domain\": domain}, (data) => {\n //console.log(\"Here is the time we read \" + data.time);\n resolve(data.time);\n });\n });\n }", "title": "" }, { "docid": "a49febf24815c1c2cf0c8f166f01abd7", "score": "0.5436822", "text": "debug(request) {\n\t\tif (this.options.quiet) return\n\t\tconst headers = util.inspect(request.headers)\n\t\tconst now = Date.now()\n\t\tconst elapsedMs = now - this.debuggedTime\n\t\tconst rps = (this.totalRequests / elapsedMs) * 1000\n\t\tif (rps > 1) {\n\t\t\tconsole.info(`Requests per second: ${rps.toFixed(0)}`)\n\t\t}\n\t\tconsole.info(`Headers for ${request.method} to ${request.url}: ${headers}`)\n\t\tif (request.body) {\n\t\t\tconsole.info(`Body: ${request.body}`);\n\t\t}\n\t\tthis.debuggedTime = now;\n\t\tthis.totalRequests = 0\n\t}", "title": "" }, { "docid": "a9764ce569761b62f01dacd439439818", "score": "0.54235095", "text": "function calcResponseTime(site, iterations, siteIndex, numOfSites, testHandle, currentResponse) {\r\n\t// Map which stores the calculated results for given site.\r\n\tvar result = {};\r\n\tvar startTime = Date.now();\r\n\tvar siteHostName = getHostFromUrl(site);\r\n\t\r\n /*console.log('Calucating response for site [%s] with iterations [%s], this is site [%d] / [%d] . TestHandle = [%s]',\r\n siteHostName, iterations, siteIndex+1, numOfSites, testHandle);*/\r\n\r\n // Update global map with empty test result for this site.\r\n // TODO: Ideally response times should be zeroed based on user given iterations, instead of hardcoding it here.\r\n var siteResult = {\r\n \tsite : siteHostName,\r\n\t\tavg : 0,\r\n\t\tmax : 0,\r\n\t\tmin : 0,\r\n\t\tstartTestTime : startTime,\r\n\t\tendTestTime : Date.now(),\r\n\t\titerations : iterations,\r\n\t\tcurIterations : 0,\r\n\t\tcurResponseTimes : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\r\n };\r\n var curSiteResultsMap = testHandleToResultMap[testHandle];\r\n if (curSiteResultsMap === null) {\r\n \t/*console.log('Current site results map empty for testHandle [%s]. Initializaing Map with empty results for site [%s]',\r\n \t\ttestHandle, siteHostName);*/\r\n \tcurSiteResultsMap = {};\r\n }\r\n curSiteResultsMap[siteHostName] = siteResult;\r\n // Put it back with testHandle\r\n testHandleToResultMap[testHandle] = curSiteResultsMap;\r\n\r\n\r\n // Trigger HTTP GET on given site and callback function has all the logic to update test results in global map.\r\n var request = {\r\n\t\thost : siteHostName,\r\n\t\tport : 80\r\n\t};\r\n\tfor (iterationCount = 0; iterationCount < iterations; iterationCount++) {\r\n\thttp.get(request, function (res) {\r\n\t\t// Compute the response time.\r\n\t\tvar responseTime = Date.now()-startTime;\r\n\t\t// Lets use Host name as the key for storing site results.\r\n\t\tvar host = res.req._headers.host;\r\n // Retrieve the test result from testHandle.\r\n console.log('Received response for site [%s] testHandle [%s], request took [%d]', host, testHandle, responseTime);\r\n var curSiteResultsMap = testHandleToResultMap[testHandle];\r\n if (curSiteResultsMap === null) {\r\n \tconsole.error(\"ERROR: Cannot find testHandle [%s] associated with site[%s]\", testHandle, host);\r\n \treturn;\r\n }\r\n // Retrieve existing result for this site from TestResult.\r\n var curSiteResult = curSiteResultsMap[host];\r\n if (curSiteResult === null) {\r\n \tconsole.error(\"ERROR: Cannot find siteResult for site [%s], associated with testHandle [%s]\", host, testHandle);\r\n return;\r\n }\r\n\r\n //console.log(\"Will update the response info for site [%s]\", host);\r\n var curIterations = curSiteResult.curIterations;\r\n // Add the response time to internal array, using iteration as index. Array is zero-indexed to increment curIterations later.\r\n var curResponseTimes = curSiteResult.curResponseTimes;\r\n curResponseTimes[curIterations] = responseTime;\r\n // Increment and Update iteration count.\r\n curIterations++;\r\n curSiteResult.curIterations = curIterations;\r\n // Compute and update average, min and max, by iterating through all the responseTimes we have so far.\r\n var newAvg = 0; \r\n for (valIndex = 0; valIndex < curSiteResult.iterations; valIndex++) {\r\n \tnewAvg = newAvg + curResponseTimes[valIndex];\r\n \tif (curSiteResult.min > responseTime || curSiteResult.min === 0) {\r\n \t\tcurSiteResult.min = responseTime;\r\n \t}\r\n \tif (curSiteResult.max < responseTime) {\r\n \t\tcurSiteResult.max = responseTime;\r\n \t}\r\n }\r\n newAvg = newAvg / curSiteResult.iterations;\r\n curSiteResult.avg = newAvg;\r\n\r\n // If TEST HAS COMPLETED!!, Update end time only if this is last iteration of test for this site.\r\n if (curSiteResult.iterations == curIterations) {\r\n \tcurSiteResult.endTestTime = Date.now();\r\n \t// Nullify non-required fields from result.\r\n \tdelete curSiteResult[\"curIterations\"];\r\n \tdelete curSiteResult[\"curResponseTimes\"];\r\n \t// Update status of Test\r\n \ttestStatusMap[testHandle] = \"finished\";\r\n \t// Write test result to file.\r\n \twriteTestToFile(\"alltests.txt\", curSiteResult);\r\n }\r\n // Push the site result back in the map.\r\n curSiteResultsMap[host] = curSiteResult;\r\n // Push the site results map back to global Test Results Map.\r\n testHandleToResultMap[testHandle] = curSiteResultsMap;\r\n\r\n /*console.log(\"Updated Response for site [%s] after iteration [%d] is : %s\",\r\n \thost, curIterations, JSON.stringify(curSiteResult));*/\r\n //console.log(\"Updated TestResult for handle [%s] is : %s\", testHandle, JSON.stringify(testHandleToResultMap));\r\n\t}); // http GET handler ends here.\r\n } // iteration for loop ends here.\r\n}", "title": "" }, { "docid": "928d0a05f6717111bfe2c5be2fc75c17", "score": "0.54227805", "text": "function getAccessTime(data) {\r\n let {\r\n blockSize,\r\n cacheTime,\r\n memoryTime,\r\n loadType,\r\n currentScore,\r\n cacheHit,\r\n cacheMiss\r\n } = data;\r\n\r\n let aveTime, totalTime;\r\n let missPenalty;\r\n\r\n nBlockSize = parseInt(blockSize);\r\n nMemoryTime = parseFloat(memoryTime);\r\n nCacheTime = parseFloat(cacheTime);\r\n\r\n /* Calculations */\r\n let hitRate = cacheHit / currentScore;\r\n let missRate = cacheMiss / currentScore;\r\n\r\n // Non-Load Through\r\n if(loadType == \"nonload\") {\r\n missPenalty = nCacheTime + (nBlockSize * nMemoryTime) + nCacheTime;\r\n totalTime = cacheMiss * nBlockSize * (nCacheTime + nMemoryTime);\r\n // Load Through\r\n }\r\n else {\r\n missPenalty = nCacheTime + nMemoryTime;\r\n totalTime = cacheMiss * nBlockSize * nMemoryTime;\r\n }\r\n\r\n aveTime = (hitRate * nCacheTime) + (missRate * missPenalty);\r\n totalTime += (cacheHit * nBlockSize * nCacheTime) + (cacheMiss * nCacheTime);\r\n\r\n return {aveTime, missPenalty, totalTime};\r\n}", "title": "" }, { "docid": "a229c48ee2240a7bc145d1fbb831e733", "score": "0.5417209", "text": "function myHttpRequest() {\n return {\n get(url, cb, time = 10000) {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.timeout = time;\n\n xhr.addEventListener('load', () => {\n // if status of server response is not 2**\n if(Math.floor(xhr.status / 100) != 2) {\n console.log(`Error. Status of server response is ${xhr.status}`);\n return;\n }\n const response = JSON.parse(xhr.response);\n cb(response);\n });\n\n xhr.addEventListener(\"timeout\", () => {\n console.log(\"Server is not answer\");\n });\n \n xhr.addEventListener(\"error\", () => {\n console.log(\"Connection to server is failed\");\n });\n\n xhr.send();\n } catch (error) {\n console.log(error);\n }\n },\n post(url, body, cb, headers = {}, time = 10000) {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url);\n xhr.timeout = time;\n\n xhr.addEventListener('load', () => {\n // if status of server response is not 2**\n if(Math.floor(xhr.status / 100) !== 2) {\n console.log(`Error. Status of server response is ${xhr.status}`, xhr);\n return;\n }\n const response = JSON.parse(xhr.response);\n cb(response);\n });\n\n xhr.addEventListener(\"timeout\", () => {\n console.log(\"Server is not answer\");\n });\n \n xhr.addEventListener(\"error\", () => {\n console.log(\"Connection to server is failed\");\n });\n\n Object.entries(headers).forEach(([key, value]) => {\n xhr.setRequestHeader(key, value);\n });\n\n xhr.send(JSON.stringify(body));\n\n } catch (error) {\n console.log(error);\n }\n }\n }\n}", "title": "" }, { "docid": "2cbc4123532e157c584416aaff32f4bc", "score": "0.54094034", "text": "function responseCheck() {\n if(count === resCount) {\n return res.json(resObj); // send total response object\n }\n }", "title": "" }, { "docid": "55614b0ad38588b6c1b6e1d36a0f70fb", "score": "0.5404884", "text": "async function offsetFunc() {\n try {\n let clientTime = (new Date()).getTime()\n let res = await get(constants.server + 'verify?clientTime=' + clientTime)\n let nowTime = (new Date()).getTime()\n let serverClientRequestDiffTime = res.diff\n let serverTime = res.serverTime\n let serverClientResponseDiffTime = nowTime - serverTime\n let responseTime = (serverClientRequestDiffTime - nowTime + clientTime - serverClientResponseDiffTime) / 2\n this.setState({ serverOffset: serverClientResponseDiffTime - responseTime })\n } catch(error) { console.error(error) }\n }", "title": "" }, { "docid": "47b11393365c737ebd9b805ea667d76a", "score": "0.5402918", "text": "function requestHandler2(request, response) {\n // Setting mathRandom for array value\n var randomResponse = meanResponses[Math.floor(Math.random() * meanResponses.length)];\n \n // Send the below string to the client when the user visits PORT 7000\n response.end(randomResponse);\n}", "title": "" }, { "docid": "52a798707434afb85f3767ceeeb87861", "score": "0.5395473", "text": "function parsetime (time) {//定义个对象,从请求传入的date获取时、分、秒\n\tvar json_time = {\n hour: time.getHours(),\n minute: time.getMinutes(),\n second: time.getSeconds()\n }\n return json_time\n }", "title": "" }, { "docid": "fea1e4034af6684c1aeefcc3399a490f", "score": "0.5381163", "text": "calculateTimeToFirstByte(navEntry) {\n if (navEntry.requestStart && navEntry.responseStart) {\n // Works for both levels of the Navigation Timing API.\n return navEntry.responseStart - navEntry.requestStart;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "74d499adc5c302ab9ee4c1206ff2e9fc", "score": "0.5375739", "text": "_requestIfNeeded() {\n if (this._requestId === null && this._head.next) {\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n }", "title": "" }, { "docid": "7d354fb5e04b2e35183707d81b54194a", "score": "0.5372417", "text": "async function send_req(){\n\n let d1 = new Date();\n let v=Math.random().toString(36).substring(2, 15)+d1.getTime();\n\n performance.clearResourceTimings();\n\n //console.log(npet)\n if(npet==0){\n urlf=\"http://\"+Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)+\".dnsprivacytester.tlm.unavarra.es/resource.php?t=\";\n }\n\n let urls=urlf+v;\n\n console.log(urls);\n\n let req = new XMLHttpRequest();\n\n if (!req) return false;\n\n if (typeof exito != 'function') exito = function () {};\n error = function () {alert(\"connection error.\");};\n\n req.open(\"GET\", urls, true);\n\n req.onreadystatechange = function(){\n\n if(req.readyState == 4) {\n if(req.status===200) {\n\n console.log()\n\n let p = performance.getEntries();\n let pr=p[p.length-1];\n i=i+1;\n let result=parseFloat(pr['domainLookupEnd']-pr['domainLookupStart']);\n result=result.toFixed(2);\n sendResults(result,urlf);\n }\n }\n }\n req.send();\n\n return false;\n\n}", "title": "" }, { "docid": "2b4561f46e729cd8c59fb8fa0297c6aa", "score": "0.5369459", "text": "function ask_time() {\n last_ask_time = Date.now();\n last_ask_numb = ++last_ask_numb;\n ws_send(lib.hexs_to_bytes([\n lib.u8_to_hex(lib.TIME),\n lib.u64_to_hex(last_ask_numb),\n ]));\n }", "title": "" }, { "docid": "bbfce34a7520bd3983b5431bba3e3e46", "score": "0.5357433", "text": "function getTime(req,res,next){\n console.log('We will give the time');\n today = new Date();\n // Set Data for sending it across \n req.newDate = `${today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds()}`\n next()\n}", "title": "" }, { "docid": "68569fde9afa37349e0068ae78c3b418", "score": "0.53516227", "text": "function get_time() {\n return Date.now() + delta_time; \n }", "title": "" }, { "docid": "c65710300fe5133fcbf402457e013989", "score": "0.53486836", "text": "maxAge() {\n if (!this.storable() || this._rescc[\"no-cache\"]) {\n return 0;\n }\n\n // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default\n // so this implementation requires explicit opt-in via public header\n if (\n this._isShared &&\n this._resHeaders[\"set-cookie\"] &&\n !this._rescc.public &&\n !this._rescc.immutable\n ) {\n return 0;\n }\n\n if (this._resHeaders.vary === \"*\") {\n return 0;\n }\n\n if (this._isShared) {\n if (this._rescc[\"proxy-revalidate\"]) {\n return 0;\n }\n // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field.\n if (this._rescc[\"s-maxage\"]) {\n return toNumberOrZero(this._rescc[\"s-maxage\"]);\n }\n }\n\n // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field.\n if (this._rescc[\"max-age\"]) {\n return toNumberOrZero(this._rescc[\"max-age\"]);\n }\n\n const defaultMinTtl = this._rescc.immutable\n ? this._immutableMinTtl\n : 0;\n\n const serverDate = this.date();\n if (this._resHeaders.expires) {\n const expires = Date.parse(this._resHeaders.expires);\n // A cache recipient MUST interpret invalid date formats, especially the value \"0\", as representing a time in the past (i.e., \"already expired\").\n if (Number.isNaN(expires) || expires < serverDate) {\n return 0;\n }\n return Math.max(defaultMinTtl, (expires - serverDate) / 1000);\n }\n\n if (this._resHeaders[\"last-modified\"]) {\n const lastModified = Date.parse(this._resHeaders[\"last-modified\"]);\n if (isFinite(lastModified) && serverDate > lastModified) {\n return Math.max(\n defaultMinTtl,\n ((serverDate - lastModified) / 1000) * this._cacheHeuristic\n );\n }\n }\n\n return defaultMinTtl;\n }", "title": "" }, { "docid": "eab7e0e9831b9af30783a996f3c13cc4", "score": "0.533563", "text": "function getRequestTimeCookie() {\n var cookie = new Cookie('__uzmd', parseInt((new Date().getTime()) / 1000));\n cookie.setMaxAge(315360000);\n cookie.setPath('/');\n if (shieldSquareAdvanceConfig._is_secure != 'False') {\n cookie.setSecure(true);\n }\n cookie.setHttpOnly(true);\n response.addHttpCookie(cookie);\n return cookie.value;\n}", "title": "" }, { "docid": "d096ddb948ef8ea0c42c7f904df69715", "score": "0.53291833", "text": "function reqPing() {\n // increment request counter\n node.reqCount++;\n\n var timeout;\n\n var online = {\n fill: 'blue',\n shape: 'ring',\n text: 'Webex Teams API: online (' + node.reqCount + ')'\n };\n\n var recieving = {\n fill: 'blue',\n shape: 'dot',\n text: 'Webex Teams API: online (' + node.reqCount + ')'\n };\n\n if(node.reqReceiving) {\n clearTimeout(timeout);\n } else {\n node.status(recieving);\n }\n\n node.reqReceiving = true;\n\n timeout = setTimeout(function() {\n node.reqReceiving = false;\n node.status(online);\n }, 200);\n }", "title": "" }, { "docid": "561f7f6eec7565e51344b03a8cccdf26", "score": "0.53251094", "text": "getRequestDate(){\n return this._Request.RequestMessage.RequestHeader.RequestDate;\n }", "title": "" }, { "docid": "dfd1848da745372be103878309c62cf9", "score": "0.5318926", "text": "request(options) {\n return lastValueFrom(_request(this, __privateGet(this, _httpRequest2), options));\n }", "title": "" }, { "docid": "ddbe44c063aced0e7db411315ef3c5a2", "score": "0.5314801", "text": "function time() { return Math.round((new Date()).getTime() / 1000); }", "title": "" }, { "docid": "dbf7dcdab0eef305a65091f42a9a7714", "score": "0.530367", "text": "async getTime(req, res) {\n try {\n // Extract time reference of path (now, tomorrow, yesterday)\n const timeReference = req.path.split('/')[1];\n // Timezone passed on route parameters\n const timezone = req.params.timezone;\n // Axios request\n const response = await axios.get(`${timezone}/${timeReference}`);\n\n return res.status(response.status).json(response.data);\n } catch (error) {\n //Error handling\n return res.status(400).send(JSON.stringify(error));\n }\n }", "title": "" }, { "docid": "b812e159dfefd3f368939342ebb28822", "score": "0.5299102", "text": "function time() {\r\n return Math.round((new Date()).getTime() / 1000); \r\n }", "title": "" }, { "docid": "444da775be25ffce46614264f6a4f278", "score": "0.52969605", "text": "function ajaxBestTime(type, myTime) {\n $.ajax({\n type : type,\n url : \"/path-to/hosting/save\",\n data : JSON.stringify({\n 'myTime': myTime\n }),\n dataType : 'json',\n timeout : 100000,\n contentType:'application/json',\n success : function(data) {\n console.log(\"SUCCESS: \", data);\n },\n error : function(e) {\n console.log(\"ERROR: \", e);\n },\n done : function(e) {\n console.log(\"DONE\");\n }\n });\n\n }", "title": "" }, { "docid": "4f4e2cdf57523ccdd205afcc44a85894", "score": "0.5291786", "text": "async function getRequestSize(request){\n const obj = request.clone();\n const buffer = await obj.arrayBuffer()\n var view = new DataView(buffer);\n const offset = 3000;\n var requestSize = view.byteLength;\n var it = request.headers.entries();\n var header = it.next();\n var size = 0;\n while(!header.done){\n size += header.value[0].length;\n size += header.value[1].length;\n\n header = it.next();\n }\n requestSize += size\n requestSize += offset;\n\n // In case something goes wrong it is better to estimate the size with 0 than NaN,\n // to prevent the cache to be completely emptied\n if(isNaN(requestSize)){\n requestSize = 0;\n }\n\n return requestSize;\n}", "title": "" }, { "docid": "f88a389b2c421f6db757d59acc532c1b", "score": "0.528878", "text": "function getGeneralUpdateTime(callback){\n $.ajax({\n url: app_url + \"settings/settings/getGeneralUpdateTimeAjax\",\n type: \"POST\",\n dataType: \"json\",\n async: false,\n success: function(response){callback(response.time);},\n error: function(request, error) { callback(30);}\n });\n }", "title": "" }, { "docid": "bd4dbd60ed3d8ed615fd641f528eb30f", "score": "0.52837086", "text": "function detect_latency(tt) {\n\t var adjusted_time = rnow() - TIME_DRIFT;\n\t return adjusted_time - tt / 10000;\n\t }", "title": "" }, { "docid": "36366d1949c61dd474550f6d094290a4", "score": "0.5276524", "text": "function getAsyncTimestamp() {\n\t//define our request to the server script\n\tvar postDataArray = new Array(2);\n\tpostDataArray[0] = 'action';\n\tpostDataArray[1] = 'get-timestamp';\n\n\t//get the needed information\n\tnew AsyncManager('statusdiv', \n\t\tgetAsyncTimestamp_callback, \n\t\t'asyncreceiver.php', \n\t\tpostDataArray); \n}", "title": "" }, { "docid": "8cf5c9af0fe266e8ae73570e934231aa", "score": "0.5271426", "text": "function process_obs_req(req, res){\n\n \n}", "title": "" }, { "docid": "4bbee8f05645324c98b1f2e1dfd946ce", "score": "0.526795", "text": "function new_time_result(data){\n var latency = (Date.now() - data.c_time) / 2;\n var offset = data.s_time - Date.now();\n time_results.push({latency: latency, offset: offset});\n _choose_time_offset();\n }", "title": "" } ]
52ca050780eec3161c7e09f9fc345508
(String, Array[Patch]) > TurtleSet
[ { "docid": "cd84d74c406210a7c0c7f58883e97717", "score": "0.6868628", "text": "breedOn(breedName, patches) {\n var turtles;\n turtles = flatMap(function(p) {\n return p.breedHereArray(breedName);\n })(patches);\n return new TurtleSet(turtles, this._world);\n }", "title": "" } ]
[ { "docid": "fa43e3f1d58767810238e22a4dccb9af", "score": "0.56101024", "text": "set tangents(value) {}", "title": "" }, { "docid": "b6d5c173381eb5fb0d993aef15143197", "score": "0.55628294", "text": "set triangles(value) {}", "title": "" }, { "docid": "f772db4671cb628c1f80d174dea77e54", "score": "0.5499073", "text": "function LightSet() {\n this.mSet = [];\n}", "title": "" }, { "docid": "3a0129be3ae947bd61856c79fd285778", "score": "0.543108", "text": "SetTangents() {}", "title": "" }, { "docid": "8058363d18950d28637c7ee3df92dc1d", "score": "0.53339183", "text": "SetTriangles() {}", "title": "" }, { "docid": "70572e6716fa7eebdcef5267e0e79a85", "score": "0.5323548", "text": "get tangents() {}", "title": "" }, { "docid": "d2702f2b9525010a614105e753c35b07", "score": "0.529473", "text": "_initialize(nodeSet) {\n var agt, ax, ay, tMap, turtles;\n ax = [];\n ay = [];\n tMap = [];\n agt = [];\n turtles = nodeSet.shuffled().toArray();\n forEach(function(i) {\n var turtle;\n turtle = turtles[i];\n agt[i] = turtle;\n tMap[turtle.id] = i;\n ax[i] = 0.0;\n ay[i] = 0.0;\n })(rangeUntil(0)(turtles.length));\n return [ax, ay, tMap, agt];\n }", "title": "" }, { "docid": "ab24b34b7134eeac918261f3407027c4", "score": "0.52523637", "text": "_turtleMap() {\n return {\n breed: [\n \"BREED\",\n function(turtle) {\n return turtle.getBreedName();\n }\n ],\n color: [\n \"COLOR\",\n function(turtle) {\n return turtle._color;\n }\n ],\n heading: [\n \"HEADING\",\n function(turtle) {\n return turtle._heading;\n }\n ],\n who: [\n \"WHO\",\n function(turtle) {\n return turtle.id;\n }\n ],\n 'label-color': [\n \"LABEL-COLOR\",\n function(turtle) {\n return turtle._labelcolor;\n }\n ],\n 'hidden?': [\n \"HIDDEN?\",\n function(turtle) {\n return turtle._hidden;\n }\n ],\n label: [\n \"LABEL\",\n (turtle) => {\n return this._dump(turtle._label);\n }\n ],\n 'pen-size': [\n \"PEN-SIZE\",\n function(turtle) {\n return turtle.penManager.getSize();\n }\n ],\n 'pen-mode': [\n \"PEN-MODE\",\n function(turtle) {\n return turtle.penManager.getMode().toString();\n }\n ],\n shape: [\n \"SHAPE\",\n function(turtle) {\n return turtle._getShape();\n }\n ],\n size: [\n \"SIZE\",\n function(turtle) {\n return turtle._size;\n }\n ],\n xcor: [\n \"XCOR\",\n function(turtle) {\n return turtle.xcor;\n }\n ],\n ycor: [\n \"YCOR\",\n function(turtle) {\n return turtle.ycor;\n }\n ]\n };\n }", "title": "" }, { "docid": "f4570f2f18051a6a42074433e1617302", "score": "0.5195931", "text": "function setTilesColorSchemes() {\r\n var arr = [];\r\n arr.push({\"name\" : \"lightblue-white\" , \"backgroundColor\" : \"rgb(23, 137, 230)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"blue-white\" , \"backgroundColor\" : \"rgb(71, 132, 230)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"darkblue-white\" , \"backgroundColor\" : \"rgb(58, 111, 180)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"deepblue-white\" , \"backgroundColor\" : \"rgb(57, 68, 143)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"tinyblue-white\" , \"backgroundColor\" : \"rgb(58, 74, 180)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"lightaqua-white\" , \"backgroundColor\" : \"rgb(92, 177, 230)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"aqua-white\" , \"backgroundColor\" : \"rgb(58, 180, 135)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"darkaqua-white\" , \"backgroundColor\" : \"rgb(71, 166, 199)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"lightyellow-white\" , \"backgroundColor\" : \"rgb(240, 201, 44)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"yellow-white\" , \"backgroundColor\" : \"rgb(245, 163, 0)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"orange-white\" , \"backgroundColor\" : \"rgb(245, 131, 0)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"white-lightblue\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(45, 132, 164)\"});\r\n arr.push({\"name\" : \"white-blue\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(59, 75, 181)\"});\r\n arr.push({\"name\" : \"white-darkblue\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(32, 84, 151)\"});\r\n arr.push({\"name\" : \"white-tinyblue\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(65, 113, 164)\"});\r\n arr.push({\"name\" : \"white-aqua\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(72, 167, 199)\"});\r\n arr.push({\"name\" : \"white-green\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(85, 147, 31)\"});\r\n arr.push({\"name\" : \"white-lightred\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(179, 35, 35)\"});\r\n arr.push({\"name\" : \"white-red\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(209, 0, 0)\"});\r\n arr.push({\"name\" : \"white-darkred\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(164, 50, 65)\"});\r\n arr.push({\"name\" : \"white-gray\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(185, 113, 49)\"});\r\n arr.push({\"name\" : \"white-yellow\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(240, 201, 45)\"});\r\n arr.push({\"name\" : \"white-pink\" , \"backgroundColor\" : \"rgb(255, 255, 255)\" , \"color\" : \"rgb(104, 48, 136)\"});\r\n arr.push({\"name\" : \"lightgray-white\" , \"backgroundColor\" : \"rgb(218, 126, 44)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"gray-white\" , \"backgroundColor\" : \"rgb(187, 114, 49)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"darkgray-white\" , \"backgroundColor\" : \"rgb(224, 107, 0)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"lime-white\" , \"backgroundColor\" : \"rgb(115, 180, 58)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"darklime-white\" , \"backgroundColor\" : \"rgb(85, 147, 31)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"lightgreen-white\" , \"backgroundColor\" : \"rgb(79, 196, 118)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"darkgreen-white\" , \"backgroundColor\" : \"rgb(58, 180, 58)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"tinygreen-white\" , \"backgroundColor\" : \"rgb(58, 176, 180)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"ligthred-white\" , \"backgroundColor\" : \"rgb(229, 76, 41)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"red-white\" , \"backgroundColor\" : \"rgb(217, 26, 20)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"darkred-white\" , \"backgroundColor\" : \"rgb(164, 51, 67)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"ligthpink-white\" , \"backgroundColor\" : \"rgb(200, 70, 201)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"pink-white\" , \"backgroundColor\" : \"rgb(134, 58, 180)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n arr.push({\"name\" : \"tinypink-white\" , \"backgroundColor\" : \"rgb(104, 48, 137)\" , \"color\" : \"rgba(255, 255, 255, 0.95)\"});\r\n return arr;\r\n }", "title": "" }, { "docid": "ce017025c0ca448929c7f6d253af6800", "score": "0.51240474", "text": "get triangles() {}", "title": "" }, { "docid": "0cbaa09b519528e840da32f26f87601e", "score": "0.5062895", "text": "function Tourset() {\r\n this.CruiseIndex = 0, // Track number, up to 4 path 1-4\r\n this.PpCount = 0, //The number of preset\r\n this.PauseSecs = 5, // Preset time,5-240\r\n this.Speed = 1, //running speed,1-63\r\n this.Pps = [] //32 preset collection points, the biggest support\r\n}", "title": "" }, { "docid": "65012a5eaf4a6148fcac9c9876d1bea3", "score": "0.5047435", "text": "constructor(){\n this.smallTrunk = new BoxGeometry(2,2,2);\n this.trunkGeometry = new BoxGeometry(5,5,5);\n let n_palms = 6;\n let palms = [];\n for (let i =0; i< n_palms; i++){\n let trunkGeometry = this._getTrunkGeometry(i);\n let leafGeometry = new LeafGeometry(this.leafOptions()[i]);\n let curve = this.getCurves()[i];\n let palm = new PalmGenerator(leafGeometry,\n trunkGeometry,\n this.palmOptions()[i],\n curve\n );\n let geometry = palm.geometry;\n let bufGeometry = new BufferGeometry().fromGeometry(geometry);\n let palmBuffers = palm.buffers;\n bufGeometry.addAttribute( 'angle', new BufferAttribute(\n palmBuffers.angle,\n 1));\n\n palms.push(bufGeometry);\n }\n return palms;\n }", "title": "" }, { "docid": "2ff6b115c82eacfb9e5b0f0a6858625f", "score": "0.5029834", "text": "function animateTurtle(){\r\n\tvar dt = clock.getDelta();\r\n\r\n time1 += dt;\r\n if(time1 > 8){\r\n time1 = 0;\r\n }\r\n\r\n time2 += dt;\r\n if(time2 > 8){\r\n time2 = 0;\r\n }\r\n\r\n\tfor(var n = 0; n<multipleTurtles;n ++){\r\n\t\tdx[n] = sx[n] * dt;\r\n\t\tdy[n] = sy[n] * dt;\r\n\t\tturtleArray[n].position.z += dy[n];\r\n\t\tturtleArray[n].position.x += dx[n];\r\n\t}\r\n\r\n\tfor (var n = 0; n < multipleTurtles; n++){\r\n\t\tturtleArray[n].getObjectByName('neck').rotation.x = interpolator([0,1,2,3,4,5,6,7,8], [0, 0, 0, -0.261,-0.523, -0.261, 0, 0, 0], time1);\r\n\t\tturtleArray[n].getObjectByName('turtleTail').rotation.x = interpolator([0,1,2,3,4,5,6,7,8], [0, 0, 0, -0.261,-0.523, -0.261, 0, 0, 0], time1);\r\n\t\tturtleArray[n].getObjectByName('FRLeg').rotation.y = interpolator([0,1,2,3,4,5,6,7,8], [-2.617, -2.878, -3.14, -2.878, -2.617, -2.356, -2.093, -2.356, -2.617], time2);\r\n\t\tturtleArray[n].getObjectByName('FLLeg').rotation.y = interpolator([0,1,2,3,4,5,6,7,8], [-0.523, -0.262, 0, -0.262, -0.523, -0.784, -1.047, -0.784, -0.523], time2);\r\n\t\tturtleArray[n].getObjectByName('RRLeg').rotation.y = interpolator([0,1,2,3,4,5,6,7,8], [-3.67, -3.931, -4.19, -3.931, -3.67, -3.409, -3.14, -3.409, -3.67], time2);\r\n\t\tturtleArray[n].getObjectByName('RLLeg').rotation.y = interpolator([0,1,2,3,4,5,6,7,8], [0.523, 0.784, 1.047, 0.784, 0.523, 0.262, 0, 0.262, 0.523], time2);\r\n\t}\r\n}", "title": "" }, { "docid": "56b46b4ec39b039c3a665ec1522000d1", "score": "0.50110203", "text": "_withEachTiedTurtle(f, seenTurtlesSet) {\n var turtles;\n seenTurtlesSet[this.id] = true;\n turtles = this._tiedTurtles().filter(function({id}) {\n return seenTurtlesSet[id] == null;\n });\n turtles.forEach(function({id}) {\n return seenTurtlesSet[id] = true;\n });\n turtles.forEach(f(seenTurtlesSet));\n }", "title": "" }, { "docid": "3998340d749bab7208d9b9977e6e25c9", "score": "0.49459067", "text": "function vt(e,t){void 0===t&&(t=!1);var n=mt.get(e.object);pt(n.value,e.object,e.patches,\"\",t),e.patches.length&&at(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}", "title": "" }, { "docid": "7c65e78fdbbcdf27b481cdab7e746dc4", "score": "0.4917523", "text": "function triangulate(){\n\t\t// Create new array for the triangles and colors, \n\t\t// but keep all polygon data.\n\t\tthis.triangles = [];\n\t\tthis.orgPolygonVertices = this.polygonVertices;\n\t\tthis.triangleColors = [];\n\t\tthis.orgPolygonColors = this.polygonColors;\t\t\n\t\tthis.orgPolygonTextureCoord = this.polygonTextureCoord;\n\t\tthis.trianglePolygonTextureCoord = [];\n\t\t\n\t\tvar nbTris = 0;\t\t\n\t\t// Loop over polygons.\n\t\tfor(var p = 0; p < this.polygonVertices.length; p++) {\n\t\t\tvar polygon = this.polygonVertices[p];\n\t\t\tif(polygon.length < 3) {\n\t\t\t\tconsole.error(\"triangulate: skip polygon: \"+p);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Loop over vertices of polygon.\n\t\t\tvar firstVertex = polygon[0];\n\t\t\tfor(var v = 1; v < polygon.length-1; v++) {\n\t\t\t\t// Crate the triangle fan.\n\t\t\t\tthis.triangles[nbTris] = [firstVertex, polygon[v], polygon[v+1]];\n\t\t\t\tthis.triangleColors.push(this.polygonColors[p]);\n\t\t\t\t// Adjust the texture coordinates.\n\t\t\t\tif((this.textureURL != \"\") && (this.polygonTextureCoord.length != 0)){\n\t\t\t\t\tthis.trianglePolygonTextureCoord[nbTris] = [];\n\t\t\t\t\tthis.trianglePolygonTextureCoord[nbTris].push(this.polygonTextureCoord[p][0]);\n\t\t\t\t\tthis.trianglePolygonTextureCoord[nbTris].push(this.polygonTextureCoord[p][v]);\n\t\t\t\t\tthis.trianglePolygonTextureCoord[nbTris].push(this.polygonTextureCoord[p][v+1]);\n\t\t\t\t}\n\t\t\t\t// Count created triangles.\n\t\t\t\tnbTris++;\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\t\n\t\t// Set triangles as new polygons.\n\t\tthis.polygonVertices = this.triangles;\n\t\tthis.polygonColors = this.triangleColors;\n\t\tthis.polygonTextureCoord = this.trianglePolygonTextureCoord;\t\t\n\t}", "title": "" }, { "docid": "a6e2efffcd46bbba215060b323bc222d", "score": "0.49073848", "text": "function PathSet() {\n this._pathArray = [];\n }", "title": "" }, { "docid": "26c0f4dea0c9a9107516751ccf774cee", "score": "0.48785582", "text": "function mark_tiles(tiles) {\n for (var i = 0; i < tiles.length; i++) {\n for (var j = 0; j < 4; j++) {\n tiles[i].edge[j].strokeColor = 'pink';\n tiles[i].edge[j].strokeWidth = '4';\n }\n }\n}", "title": "" }, { "docid": "5f4592c4ee9a63228e118416d22cbf0b", "score": "0.4874246", "text": "function applyPatchToArrayFct(patch, arrayOfElements, targetCollection, branchElements) {\n const keys = Object.keys(patch);\n // a key is the id of an element\n keys.forEach((key) => {\n let requestset = {};\n // a patch[key] is an array of patches on a element\n // We are using JSON-patch standard except that the path would be \"location.x\" instead of \"location/x\"\n patch[key].forEach((patchelem) => {\n if (patchelem.op == \"add\") {\n var elem = targetCollection.getLastElementVersion(key);\n if (!elem) {\n elem = branchElements.find(function (elem) {\n return elem._id._str == key;\n });\n }\n delete elem._parent;\n delete elem.save;\n arrayOfElements.push(elem);\n } else if (patchelem.op == \"replace\") {\n var tokens = patchelem.path.split(\".\");\n var elem = arrayOfElements.find(function (elem) {\n return elem._id._str == key;\n });\n applyPatchToElem(patchelem.value, tokens, elem);\n } else if (patchelem.op == \"remove\") {\n arrayOfElements.remove(arrayOfElements.find(function (elem) {\n return elem._id._str == key;\n }))\n } else {\n console.error(\"ELSE NOT IMPLEMENTED, SEE mongo_json_patch.js\");\n }\n });\n })\n}", "title": "" }, { "docid": "3d7a51e30221a03e9595820e5f5afcd2", "score": "0.4871816", "text": "getPlanets() {\n \n return [\n new Planet({\n name: 'Thozetis I', \n radius: 0.2, \n color: 0xA06153, \n rotation: 0.001, \n orbitRotation: 0.009,\n orbitRadius: 12, \n orbitSkew: 0.4, \n skew: 0.1, \n tags: ['barren', 'volcanic', 'radioactive'], \n satelite:[],\n texture: \"thozetis_1\"\n }),\n new Planet({\n name: 'Thozetis II', \n radius: 0.3, \n color: 0xA06153, \n rotation: 0.01, \n orbitRotation: 0.008,\n orbitRadius: 14, \n orbitSkew: -0.03, \n skew: -0.1, \n tags: ['barren', 'volcanic', 'radioactive'], \n satelite:[],\n texture: \"thozetis_2\"\n }),\n new Planet({\n name: 'Thozetis III', \n radius: 1.2, \n color: 0x0000ff, \n rotation: 0.005, \n orbitRotation: 0.005, \n orbitRadius: 25, \n orbitSkew: 0, \n skew: 0.15, \n texture: 'thozetis_3',\n atmosphere: {color: 0xccffcc, clouds: true}, \n tags: ['oceanic', 'invasive', 'radioactive'], \n satelites: [\n new Planet({ \n name: 'Thozetis III A',\n radius: 0.1, \n color: 0xcccccc, \n rotation: 0.01, \n orbitRotation: 0.01, \n orbitRadius: 3, \n orbitSkew: 0.3, \n skew: 0, \n tags: ['test'], \n texture: 'thozetis_3a',\n satelite: [] \n }),\n new Planet({ \n name: 'Thozetis III B',\n radius: 0.15, \n color: 0xcccccc, \n rotation: 0.01, \n orbitRotation: 0.015, \n orbitRadius: 4.5, \n orbitSkew: 0.3, \n skew: 0, \n tags: ['test'], \n texture: 'thozetis_3b',\n satelite: [] \n }),\n new Planet({ \n name: 'Thozetis III C',\n radius: 0.17, \n color: 0xcccccc, \n rotation: 0.01, \n orbitRotation: 0.02, \n orbitRadius: 6, \n orbitSkew: 0, \n skew: 1, \n tags: ['test'], \n texture: 'thozetis_3c',\n satelite: [] \n })\n ]\n })\n ]\n }", "title": "" }, { "docid": "3cffef865e0d7778b28a2d47f06f117d", "score": "0.4864796", "text": "function triangulate(){\n\t\t// Create new array for the triangles and colors, \n\t\t// but keep all polygon data.\n\t\tthis.triangles = [];\n\t\tthis.orgPolygonVertices = this.polygonVertices;\n\t\tthis.triangleColors = [];\n\t\tthis.orgPolygonColors = this.polygonColors;\n\t\t\n\t\tvar nbTris = 0;\t\t\n\t\t// Loop over polygons.\n\t\tfor(var p = 0; p < this.polygonVertices.length; p++) {\n\t\t\tvar polygon = this.polygonVertices[p];\n\t\t\tif(polygon.length < 3) {\n\t\t\t\tconsole.error(\"triangulate: skip polygon: \"+p);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Loop over vertices of polygon.\n\t\t\tvar firstVertex = polygon[0];\n\t\t\tfor(var v = 1; v < polygon.length-1; v++) {\n\t\t\t\tthis.triangles[nbTris] = [firstVertex, polygon[v], polygon[v+1]];\n\t\t\t\tthis.triangleColors.push(this.polygonColors[p]);\n\t\t\t\tnbTris++;\n\t\t\t}\t\t\n\t\t}\n\t\t// Set triangles a new polygons.\n\t\tthis.polygonVertices = this.triangles;\n\t\tthis.polygonColors = this.triangleColors;\n\t}", "title": "" }, { "docid": "6a67d443be8f8007c5464cf984484534", "score": "0.4858635", "text": "function packFace(face, set) {\n let ret = {\n scaledMesh: [],\n };\n for (let i = 0; i < set.length; i++) {\n let j = set[i];\n ret.scaledMesh[i] = [\n face.scaledMesh[j][0],\n face.scaledMesh[j][1],\n face.scaledMesh[j][2],\n ];\n }\n return ret;\n}", "title": "" }, { "docid": "6ddf56d347158e2d656ec5024c0fd6b9", "score": "0.48583138", "text": "GetTangents() {}", "title": "" }, { "docid": "365d30df819c9db8c65a77da48e0ab54", "score": "0.4850901", "text": "_patchMap() {\n return {\n id: [\n \"WHO\",\n function(patch) {\n return patch.id;\n }\n ],\n pcolor: [\n \"PCOLOR\",\n function(patch) {\n return patch._pcolor;\n }\n ],\n plabel: [\n \"PLABEL\",\n (patch) => {\n return this._dump(patch._plabel);\n }\n ],\n 'plabel-color': [\n \"PLABEL-COLOR\",\n function(patch) {\n return patch._plabelcolor;\n }\n ],\n pxcor: [\n \"PXCOR\",\n function(patch) {\n return patch.pxcor;\n }\n ],\n pycor: [\n \"PYCOR\",\n function(patch) {\n return patch.pycor;\n }\n ]\n };\n }", "title": "" }, { "docid": "1b70d5f2eb6f75554689166e291c6018", "score": "0.4842532", "text": "constructor (agentSet) {\n Object.assign(this, patchVariables)\n this.defaults = this\n this.agentSet = agentSet\n this.world = agentSet.world\n this.patches = agentSet.baseSet\n }", "title": "" }, { "docid": "1e7e800c41ee5fcf8d02c7958de54b90", "score": "0.48303935", "text": "set Wireframe(value) {}", "title": "" }, { "docid": "3fb5f3cdb4c6308dcf6a9c2edc9802d4", "score": "0.48294067", "text": "layoutTutte(nodeSet, linkSet, radius) {\n var anchors, turtleXYTriplets;\n anchors = pipeline(flatMap(function({end1, end2}) {\n return [end1, end2];\n }), unique, filter(function(t) {\n return !nodeSet.contains(t);\n }))(linkSet.toArray());\n this.layoutCircle(anchors, radius);\n turtleXYTriplets = nodeSet.shuffled().toArray().map((turtle) => {\n var allOfMyLinks, compute, computeCor, degree, neighbors, relevantLinks, x, y;\n computeCor = function(turtle, neighbors, degree) {\n return function(getCor, max, min) {\n var adjustedValue, limit, limitedValue, readjustedValue, value;\n value = pipeline(map(getCor), foldl(function(a, b) {\n return a + b;\n })(0))(neighbors);\n adjustedValue = (value / degree) - getCor(turtle);\n limit = 100; // This voodoo magic makes absolutely no sense to me --JAB (11/7/16)\n limitedValue = adjustedValue > limit ? limit : adjustedValue < -limit ? -limit : adjustedValue;\n readjustedValue = limitedValue + getCor(turtle);\n if (readjustedValue > max) {\n return max;\n } else if (readjustedValue < min) {\n return min;\n } else {\n return readjustedValue;\n }\n };\n };\n allOfMyLinks = turtle.linkManager.myLinks(\"LINKS\").toArray();\n relevantLinks = pipeline(unique, filter(function(link) {\n return linkSet.contains(link);\n }))(allOfMyLinks);\n neighbors = relevantLinks.map(function({end1, end2}) {\n if (end1 === turtle) {\n return end2;\n } else {\n return end1;\n }\n });\n degree = relevantLinks.length;\n compute = computeCor(turtle, neighbors, degree);\n x = compute((function(t) {\n return t.xcor;\n }), this._world.topology.maxPxcor, this._world.topology.minPxcor);\n y = compute((function(t) {\n return t.ycor;\n }), this._world.topology.maxPycor, this._world.topology.minPycor);\n return [turtle, x, y];\n });\n turtleXYTriplets.forEach(function([turtle, x, y]) {\n return turtle.setXY(x, y);\n });\n }", "title": "" }, { "docid": "a5a6c8211b36e8ff1a3f577e006e0690", "score": "0.48278657", "text": "function getShapeBag() {\n\t\t\treturn shuffle(getShapeArray());\n\t\t}", "title": "" }, { "docid": "2993cddaefce3ba11a45706a4bb0f103", "score": "0.48231038", "text": "set shapes(a) {\n this._shapes = a;\n }", "title": "" }, { "docid": "2993cddaefce3ba11a45706a4bb0f103", "score": "0.48231038", "text": "set shapes(a) {\n this._shapes = a;\n }", "title": "" }, { "docid": "93f0086301dd5ba2d4c59cfaec811aaa", "score": "0.48119736", "text": "arrayToSet(setArray) {\n return new Set(setArray);\n }", "title": "" }, { "docid": "76ca3c751d5c62cafa8dc55eca213e02", "score": "0.48072785", "text": "constructor(world, id1, _genUpdate, _registerLineDraw, _registerTurtleStamp, _registerDeath, _createTurtle, _removeTurtle, _color = 0, _heading = 0, xcor1 = 0, ycor1 = 0, breed = null, _label = \"\", _labelcolor = 9.9, _hidden = false, _size = 1.0, _givenShape, genPenManager = (self) => { // (Number) => Unit, Number, Number, Number, Number // Breed, String, Number, Boolean\n return new PenManager(this._genUpdate(self));\n }) { // Number, Boolean, Number, String, (Updatable) => PenManager\n var varNames;\n // (Number, Number) => Patch\n this.patchAt = this.patchAt.bind(this);\n this.world = world;\n this.id = id1;\n this._genUpdate = _genUpdate;\n this._registerLineDraw = _registerLineDraw;\n this._registerTurtleStamp = _registerTurtleStamp;\n this._registerDeath = _registerDeath;\n this._createTurtle = _createTurtle; // World, Number, (Updatable) => (String*) => Unit, RegLinkDrawFunc, RegTurtleStampFunc, (Number) => Unit, GenTurtleType\n this._removeTurtle = _removeTurtle;\n this._color = _color;\n this._heading = _heading;\n this.xcor = xcor1;\n this.ycor = ycor1;\n this._label = _label;\n this._labelcolor = _labelcolor;\n this._hidden = _hidden;\n this._size = _size;\n this._givenShape = _givenShape;\n breed = breed != null ? breed : this.world.breedManager.turtles();\n this._updateVarsByName = this._genUpdate(this);\n this.penManager = genPenManager(this);\n this.linkManager = new TurtleLinkManager(this.id, this.world);\n varNames = this._varNamesForBreed(breed);\n this._varManager = this._genVarManager(varNames);\n Setters.setBreed.call(this, breed);\n if (this._givenShape != null) {\n Setters.setShape.call(this, this._givenShape);\n }\n this.getPatchHere().trackTurtle(this);\n }", "title": "" }, { "docid": "7123a49760c5ae38e69c5256dc02cd42", "score": "0.4804979", "text": "get shapes() {\n return this._shapes;\n }", "title": "" }, { "docid": "7123a49760c5ae38e69c5256dc02cd42", "score": "0.4804979", "text": "get shapes() {\n return this._shapes;\n }", "title": "" }, { "docid": "a8c146454be843744945b8cc870f0677", "score": "0.47917387", "text": "function createTurtle(){\r\n\t/*turtle body*/\r\n\ttorso = createTorso();\r\n\tconsole.log(torso);\r\n\tscene.add(torso);\r\n\r\n\t/*turtle head*/\r\n\thead = createHead();\r\n\tconsole.log(head);\r\n\ttorso.add(head);\r\n\r\n\t/*FRLeg*/\r\n\tFRLeg = createLeg();\r\n\tFRLeg.name = 'FRLeg';\r\n\tFRLeg.position.x = -0.75;\r\n\tFRLeg.position.z = 0.433;\r\n\tFRLeg.rotation.y = Math.PI / 0.857;\r\n\tconsole.log(FRLeg);\r\n\ttorso.add(FRLeg);\r\n\r\n\t/*FLLeg*/\r\n\tFLLeg = createLeg();\r\n\tFLLeg.name = 'FLLeg';\r\n\tFLLeg.position.x = 0.75;\r\n\tFLLeg.position.z = 0.433;\r\n\tFLLeg.rotation.y = Math.PI / -6;\r\n\tconsole.log(FLLeg);\r\n\ttorso.add(FLLeg);\r\n\r\n\t/*RRLeg*/\r\n\tRRLeg = createLeg();\r\n\tRRLeg.name = 'RRLeg';\r\n\tRRLeg.position.x = -0.75;\r\n\tRRLeg.position.z = -0.433;\r\n\tRRLeg.rotation.y = Math.PI / 1.2;\r\n\tconsole.log(RRLeg);\r\n\ttorso.add(RRLeg);\r\n\r\n\t/*RLLeg*/\r\n\tRLLeg = createLeg();\r\n\tRLLeg.name = 'RLLeg';\r\n\tRLLeg.position.x = 0.75;\r\n\tRLLeg.position.z = -0.433;\r\n\tRLLeg.rotation.y = Math.PI / 6;\r\n\tconsole.log(RLLeg);\r\n\ttorso.add(RLLeg);\r\n\r\n\t/*turtle tail*/\r\n\ttail = createTail();\r\n\tconsole.log(tail);\r\n\ttorso.add(tail);\r\n\r\n\treturn torso;\r\n}", "title": "" }, { "docid": "844cdf33deb00fd30334fee84d63426e", "score": "0.47868806", "text": "set materials(value) {}", "title": "" }, { "docid": "dff58f69a641fba65b37a0fb5b4e1009", "score": "0.4781358", "text": "function createBricks(){\n let bricks = new Array;\n bricks.push({shape:[[1,1],[1,1]],colour:\"#FF0000\"}); //square\n bricks.push({shape:[[1,1,1,1]],colour:\"#00FF00\"}); //long\n bricks.push({shape:[[1,1,0],[0,1,1]],colour:\"#0000FF\"})//S\n bricks.push({shape:[[0,1,1],[1,1,0]],colour:\"#FFFF00\"})//Z\n bricks.push({shape:[[0,1,0],[1,1,1]],colour:\"#FF00FF\"})//T\n bricks.push({shape:[[1,1],[0,1],[0,1]],colour:\"#00FFFF\"})//L\n bricks.push({shape:[[1,1],[1,0],[1,0]],colour:\"#FF8000\"})//Shit L\n return bricks;\n }", "title": "" }, { "docid": "bb727d3baad1e734bba1e6044deee429", "score": "0.47736168", "text": "_setXandY(newX, newY, seenTurtlesSet = {}) {\n var dx, dy, f, oldX, oldY, originPatch, xcor, ycor;\n originPatch = this.getPatchHere();\n oldX = this.xcor;\n oldY = this.ycor;\n xcor = this.world.topology.wrapX(newX);\n ycor = this.world.topology.wrapY(newY);\n // DO NOT SET `xcor` AND `ycor` DIRECTLY FROM `wrap*`. `wrap*` can throw a `TopologyException`.\n // If we set only one of the coordinates and then bail with an exception (and without generating the View update),\n // it causes all sorts of bonkers stuff to happen. --JAB (10/17/17)\n this.xcor = xcor;\n this.ycor = ycor;\n this._updateVarsByName(\"xcor\", \"ycor\");\n if (originPatch !== this.getPatchHere()) {\n originPatch.untrackTurtle(this);\n this.getPatchHere().trackTurtle(this);\n }\n this.linkManager._refresh();\n // It's important not to use the wrapped coordinates (`@xcor`, `@ycor`) here.\n // Using those will cause floating point arithmetic discrepancies. --JAB (10/22/15)\n dx = newX - oldX;\n dy = newY - oldY;\n f = (seenTurtles) => {\n return (turtle) => {\n return ignorantly(() => {\n return turtle._setXandY(turtle.xcor + dx, turtle.ycor + dy, seenTurtles);\n });\n };\n };\n this._withEachTiedTurtle(f, seenTurtlesSet);\n }", "title": "" }, { "docid": "32277eba5d6bac997b634aa519ee6479", "score": "0.47563553", "text": "function shapedrpfill(data){\n var shparr=[]\n shapedrpdn.append(\"option\")\n data.forEach((ufo)=>{\n Object.entries(ufo).forEach(([key, value]) => {\n ;\n if (key===\"shape\"){\n shparr.push(value)\n //var cell = shapedrpdn.append(\"option\")\n //cell.text(value)\n };\n\n\n })\n})\nconst distshp= [...new Set(shparr)]\ndistshp.forEach(element=>{\nvar cell = shapedrpdn.append(\"option\")\n cell.text(element)\n})\n}", "title": "" }, { "docid": "658525d161e38bf283e984442aa27237", "score": "0.47501132", "text": "constructor(miniWorkspace, _config, _getViewBase64, _outputClear, _getOutput, _setOutput, extensionPorters, globalNames, interfaceGlobalNames, patchesOwnNames, minPxcor, maxPxcor, minPycor, maxPycor, patchSize, wrappingAllowedInX, wrappingAllowedInY, turtleShapeMap, linkShapeMap, onTickFunction) {\n var onTick;\n // () => PatchSet\n this.patches = this.patches.bind(this);\n // (Number, Number) => Agent\n this.getPatchAt = this.getPatchAt.bind(this);\n // The wrapping and rounding below is setup to avoid creating extra anonymous functions.\n // We could just use @ and fat arrows => but CoffeeScript uses anon funcs to bind `this`.\n // Those anon funcs cause GC pressure and runtime slowdown, so we have to manually setup\n // the context somehow. A lot of rounding and wrapping goes on in models. -JMB 07/2017\n\n // (Number) => Number\n this._thisWrapX = this._thisWrapX.bind(this);\n // (Number) => Number\n this._thisWrapY = this._thisWrapY.bind(this);\n // () => Unit\n this._incrementPatchLabelCount = this._incrementPatchLabelCount.bind(this);\n // () => Unit\n this._decrementPatchLabelCount = this._decrementPatchLabelCount.bind(this);\n // () => Unit\n this._setUnbreededLinksDirected = this._setUnbreededLinksDirected.bind(this);\n // () => Unit\n this._setUnbreededLinksUndirected = this._setUnbreededLinksUndirected.bind(this);\n // () => Unit\n this._declarePatchesNotAllBlack = this._declarePatchesNotAllBlack.bind(this);\n this._config = _config;\n this._getViewBase64 = _getViewBase64;\n this._outputClear = _outputClear;\n this._getOutput = _getOutput;\n this._setOutput = _setOutput;\n this.extensionPorters = extensionPorters;\n this.patchesOwnNames = patchesOwnNames;\n this.patchSize = patchSize;\n this.turtleShapeMap = turtleShapeMap;\n this.linkShapeMap = linkShapeMap;\n ({\n selfManager: this.selfManager,\n updater: this._updater,\n rng: this.rng,\n breedManager: this.breedManager,\n plotManager: this._plotManager\n } = miniWorkspace);\n this._patchesAllBlack = true;\n this._patchesWithLabels = 0;\n this._updater.collectUpdates();\n this._updater.registerWorldState({\n worldWidth: maxPxcor - minPxcor + 1,\n worldHeight: maxPycor - minPycor + 1,\n minPxcor: minPxcor,\n minPycor: minPycor,\n maxPxcor: maxPxcor,\n maxPycor: maxPycor,\n linkBreeds: this.breedManager.orderedLinkBreeds(),\n linkShapeList: this.linkShapeMap,\n patchSize: this.patchSize,\n patchesAllBlack: this._patchesAllBlack,\n patchesWithLabels: this._patchesWithLabels,\n ticks: -1,\n turtleBreeds: this.breedManager.orderedTurtleBreeds(),\n turtleShapeList: this.turtleShapeMap,\n unbreededLinksAreDirected: false,\n wrappingAllowedInX: wrappingAllowedInX,\n wrappingAllowedInY: wrappingAllowedInY\n });\n onTick = () => {\n this.rng.withAux(onTickFunction);\n return this._plotManager.updatePlots();\n };\n this.linkManager = new LinkManager(this, this.breedManager, this._updater, this._setUnbreededLinksDirected, this._setUnbreededLinksUndirected);\n this.observer = new Observer(this._updater.updated, globalNames, interfaceGlobalNames);\n this.ticker = new Ticker(this._plotManager.setupPlots, onTick, this._updater.updated(this));\n this.topology = null;\n this.turtleManager = new TurtleManager(this, this.breedManager, this._updater, this.rng.nextInt);\n this._patches = [];\n this._resizeHelper(minPxcor, maxPxcor, minPycor, maxPycor, wrappingAllowedInX, wrappingAllowedInY);\n }", "title": "" }, { "docid": "fc56b1584f2fa399537817d9667a931f", "score": "0.4738072", "text": "toShape() {\n return new js_Shape([new util_Subpath([this])]);\n }", "title": "" }, { "docid": "eb36e9566fed5fed619701e4cdc93211", "score": "0.47155765", "text": "getFilePatchesContaining(rowSet) {\n const sortedRowSet = Array.from(rowSet);\n sortedRowSet.sort((a, b) => a - b);\n\n const filePatches = [];\n let lastFilePatch = null;\n for (const row of sortedRowSet) {\n // Because the rows are sorted, consecutive rows will almost certainly belong to the same patch, so we can save\n // many avoidable marker index lookups by comparing with the last.\n if (lastFilePatch && lastFilePatch.containsRow(row)) {\n continue;\n }\n\n lastFilePatch = this.getFilePatchAt(row);\n filePatches.push(lastFilePatch);\n }\n\n return filePatches;\n }", "title": "" }, { "docid": "5be418e04ff5a7e7cd7a64cd0f631cf9", "score": "0.47130463", "text": "function toFormBuilder(origin, patches /*: Array<GradientPatch>*/) /*: Array<Patch>*/ {\n return (0, _flatten3.default)(patches.map(patch => {\n return (0, _flatten3.default)(Object.keys(patch).filter(key => key !== 'id').map((type) /*: Array<Patch>*/ => {\n if (type === 'unset') {\n return patch.unset.map(path => {\n return {\n type: 'unset',\n path: path.split('.'),\n origin\n };\n });\n }\n return Object.keys(patch[type]).map(path => {\n if (type === 'insert') {\n const position = 'before' in patch.insert ? 'before' : 'after';\n return {\n type: 'insert',\n position: position,\n path: path.split('.'),\n items: patch[type][path],\n origin\n };\n }\n if (type === 'set') {\n return {\n type: 'set',\n path: path.split('.'),\n value: patch[type][path],\n origin\n };\n }\n return {\n type,\n path: path.split('.'),\n value: patch[type][path],\n origin\n };\n });\n }));\n }));\n}", "title": "" }, { "docid": "4c9b3f2ff80ce252c5b53f945f3b2ac4", "score": "0.47072887", "text": "createTurtles(n, breedName, xcor = 0, ycor = 0) {\n var num, turtles;\n num = n >= 0 ? n : 0;\n turtles = map(() => {\n var color, heading;\n color = ColorModel.randomColor(this._nextInt);\n heading = this._nextInt(360);\n return this._createNewTurtle(color, heading, xcor, ycor, this._breedManager.get(breedName));\n })(rangeUntil(0)(num));\n return new TurtleSet(turtles, this._world);\n }", "title": "" }, { "docid": "f6c95dd006872e79a96a5fa688d8f9f2", "score": "0.46506763", "text": "function C(e,t){void 0===t&&(t=!1);var r=T.get(e.object);D(r.value,e.object,e.patches,\"\",t),e.patches.length&&I(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}", "title": "" }, { "docid": "95d94ec2d19c4ec7f9c09be9e9bdf974", "score": "0.4645702", "text": "turtlesAt(dx, dy) {\n return this.getPatchHere().turtlesAt(dx, dy);\n }", "title": "" }, { "docid": "c97e50b8cdeaf3ab76c35e39aea05afb", "score": "0.46399915", "text": "get Wireframe() {}", "title": "" }, { "docid": "9e2f1240debf984db5ec11cb96b1d71f", "score": "0.46084163", "text": "function getPathList(pathes) {\n return _.map(pathes, function (p) {\n return {\n type: 'Feature',\n geometry: {\n type: 'LineString',\n coordinates: _.map(p.point, function (d) {\n return [+d._lon, +d._lat];\n })\n }\n };\n });\n }", "title": "" }, { "docid": "70d25296c0ef3052e1b6447daf05211a", "score": "0.45756534", "text": "function Le(e,t){void 0===t&&(t=!1);var r=ke.get(e.object);Me(r.value,e.object,e.patches,\"\",t),e.patches.length&&ye(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}", "title": "" }, { "docid": "4c15d4086f7a9903e86cf0998433f437", "score": "0.45741734", "text": "function generatePatches(state, basepath, patches, inversePatches, baseValue, resultValue) {\n if (patches) if (Array.isArray(baseValue)) generateArrayPatches(state, basepath, patches, inversePatches, baseValue, resultValue);else generateObjectPatches(state, basepath, patches, inversePatches, baseValue, resultValue);\n}", "title": "" }, { "docid": "4c15d4086f7a9903e86cf0998433f437", "score": "0.45741734", "text": "function generatePatches(state, basepath, patches, inversePatches, baseValue, resultValue) {\n if (patches) if (Array.isArray(baseValue)) generateArrayPatches(state, basepath, patches, inversePatches, baseValue, resultValue);else generateObjectPatches(state, basepath, patches, inversePatches, baseValue, resultValue);\n}", "title": "" }, { "docid": "3f852afcb751de1ee45797ca3e14974d", "score": "0.45633307", "text": "function Turtle(x, y) {\n this.pos = new Vector(cw / 2, ch / 2);\n\n this.angle = Vector.fromAngle(radians(-90));\n\n this.hideTurtle = false;\n this.pencolor = [0, 0, 0];\n this.pensize = [1, 1];\n\n this.pendown = true;\n\n\n this.lines = [];\n\n //regEx\n this.matchCase = [\n /(setpencolor|setpensize|pendown|penup).*/ig,\n /\\w{0,}$/ig,\n /\\w.*?\\s\\d{1,}$/ig,\n /(repeat)\\s\\d{1,}\\s\\[(.*?)\\]$/ig\n ];\n\n\n // alternate commands\n this.alterCommands = {\n 'FD': 'FORWARD',\n 'BK': 'BACK',\n 'RT': 'RIGHT',\n 'LT': 'LEFT',\n 'CS': 'CLEARSCREEN',\n 'HT': 'HIDETURTLE',\n 'ST': 'SHOWTURTLE',\n 'PU': 'PENUP',\n 'PD': 'PENDOWN',\n 'SETPENSIZE': 'SETPENSIZE',\n 'SETPENCOLOR': 'SETPENCOLOR',\n }\n\n \n this.functions = {\n 'sin': function (value) {\n return Math.sin(value)\n },\n 'random': function (value) {\n return Math.random() * value\n }\n }\n\n let self = this;\n\n // RULES\n this.rules = {\n 'RT': function (value) {\n self.angle.rotate(radians(value));\n },\n\n 'LT': function (value) {\n self.angle.rotate(radians(-value));\n },\n\n 'FD': function (value) {\n let old = self.pos.copy();\n self.angle.setMag(parseFloat(value));\n self.pos.add(self.angle);\n\n let color = Array.prototype.slice.call(self.pencolor, 0);\n let size = Array.prototype.slice.call(self.pensize, 0);\n if (self.pendown) {\n self.lines.push([\n old, self.pos.copy(), color, size\n ]);\n }\n },\n\n 'BK': function (value) {\n let old = self.pos.copy();\n self.angle.setMag(parseFloat(value));\n self.pos.sub(self.angle);\n\n let color = Array.prototype.slice.call(self.pencolor, 0);\n let size = Array.prototype.slice.call(self.pensize, 0);\n if (self.pendown) {\n self.lines.push([\n old, self.pos.copy(), color, size\n ]);\n }\n },\n\n 'HT': function () { self.hideTurtle = true },\n 'ST': function () { self.hideTurtle = false },\n\n 'PU': function () { self.pendown = false },\n 'PD': function () { self.pendown = true },\n\n 'SETPENCOLOR': function (value, data) {\n let tmpC = [];\n console.log(value)\n for (let i = 0; i < data.length; i++) {\n let d = self._parseArray(data[i]);\n if (!isNaN(d)) {\n tmpC.push(Number(d));\n }\n }\n self.pencolor = Array.prototype.slice.call(tmpC, 0);\n },\n 'SETPENSIZE': function (value, data) {\n let tmpS = [];\n for (let i = 0; i < data.length; i++) {\n let d = self._parseArray(data[i]);\n if (!isNaN(d)) {\n tmpS.push(Number(d));\n }\n }\n self.pensize = Array.prototype.slice.call(tmpS, 0);\n },\n\n 'HOME': function () {\n self.pos = new Vector(cw / 2, ch / 2);\n self.angle = Vector.fromAngle(radians(-90));\n self.hideTurtle = false;\n self.pencolor = [0, 0, 0];\n self.pensize = [1, 1];\n },\n 'CS': function () {\n this.HOME();\n self.lines = [];\n }\n }\n}", "title": "" }, { "docid": "01102aa771098e4c175aec9bf279fc0d", "score": "0.45621732", "text": "set Planes(value) {}", "title": "" }, { "docid": "8b32a340ef4713b7b0ccdffab3052b60", "score": "0.45621318", "text": "addPatch(patch) {\n return this.patches.push(patch);\n }", "title": "" }, { "docid": "ddc96079b38a220c9ccdd6a6837cf513", "score": "0.45557538", "text": "createOrderedTurtles(n, breedName) {\n var num, turtles;\n num = n >= 0 ? n : 0;\n turtles = map((index) => {\n var color, heading;\n color = ColorModel.nthColor(index);\n heading = (360 * index) / num;\n return this._createNewTurtle(color, heading, 0, 0, this._breedManager.get(breedName));\n })(rangeUntil(0)(num));\n return new TurtleSet(turtles, this._world);\n }", "title": "" }, { "docid": "1d0b0343fd1afda91747d8d75aa99f95", "score": "0.45455682", "text": "set patch(n) {\n\t\tthis._patch = n;\n\t}", "title": "" }, { "docid": "54d2cd2847573550fe65e74d9904ac09", "score": "0.45379055", "text": "update_sets(set) {\n\n if (this.set == set) { return; }\n this.set = set;\n if (this.edges != undefined) {\n this.edges.forEach(element => element.update_sets(set));\n }\n }", "title": "" }, { "docid": "5a8d8dea61b761433b7c49dbb1ffbe91", "score": "0.4534282", "text": "function Set(){\r\n\tthis.mySet = new Array();\r\n}", "title": "" }, { "docid": "81675165ce14fcda7bc79d0a4f5c6ee7", "score": "0.4532047", "text": "getSetCells() {\n let setCells = [];\n for (let i = 0; i < this[CELLS].length; i++) {\n for (let j = 0; j < this[CELLS][i].length; j++) {\n if (this[CELLS][i][j]) {\n setCells.push({x: j, y: this[CELLS].length - i - 1});\n }\n }\n }\n return setCells;\n }", "title": "" }, { "docid": "80066cccab42f1aa9533ac17b03713de", "score": "0.45163983", "text": "function r(t){return{geometryType:Object(_geometry_support_jsonUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"getJsonType\"])(t[0]),geometries:t.map((e=>e.toJSON()))}}", "title": "" }, { "docid": "6addc133b6c8ccbf8070d3bea594cb2c", "score": "0.45096728", "text": "get blendShapePresetMap() {\r\n return this._blendShapePresetMap;\r\n }", "title": "" }, { "docid": "591cdac4311c2577f0ef1f373c82ab9b", "score": "0.4501535", "text": "torso() {\n const belly_end = this.shifted_extend(this.hip_nexus ,'up', 'belly');\n const ribs_end = this.shifted_extend(belly_end ,'up', 'ribs');\n this.shoulder_nexus = ribs_end;\n return [\n svg_line(this.hip_nexus, belly_end),\n svg_line(belly_end, ribs_end)\n ];\n }", "title": "" }, { "docid": "ed9b638a111dacc78b5c13e598a1ec8b", "score": "0.4501203", "text": "GetTriangles() {}", "title": "" }, { "docid": "9d36ee8c4778e8dba5d4dac0ab04a4dd", "score": "0.44920838", "text": "async function triplesToTurtle(quads) {\n const n3 = await loadN3();\n const format = \"text/turtle\";\n const writer = new n3.Writer({\n format: format\n });\n // Remove any potentially lingering references to Named Graphs in Quads;\n // they'll be determined by the URL the Turtle will be sent to:\n const triples = quads.map(quad => DataFactory.quad(quad.subject, quad.predicate, quad.object, undefined));\n writer.addQuads(triples);\n const writePromise = new Promise((resolve, reject) => {\n writer.end((error, result) => {\n /*istanbul ignore if [n3.js doesn't actually pass an error nor a result, apparently: https://github.com/rdfjs/N3.js/blob/62682e48c02d8965b4d728cb5f2cbec6b5d1b1b8/src/N3Writer.js#L290]*/\n if (error) {\n return reject(error);\n }\n resolve(result);\n });\n });\n const rawTurtle = await writePromise;\n return rawTurtle;\n}", "title": "" }, { "docid": "9b4cabca7a718503760092078330f9dc", "score": "0.4486006", "text": "function mxLeanTruckShipment(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}", "title": "" }, { "docid": "b416c261f7fa13bd8fd57d03f0a5ad5b", "score": "0.44850525", "text": "function collisionTank(){\r\n\tfor(var n = 0; n<multipleTurtles;n ++){\r\n\t\tturtleArray[n].rotation.y = shiftingArray[n];\r\n\r\n\t\tif(( turtleArray[n].position.x >= 30)||( turtleArray[n].position.x <= -30)){\r\n\t\t\tsx[n] = -sx[n];\r\n\t\t\tshiftingArray[n] = Math.acos(sx[n]/s[n]);\r\n\t\t\tturtleArray[n].rotation.y = shiftingArray[n];\r\n\t\t} else if(( turtleArray[n].position.z >= 20)||( turtleArray[n].position.z <= -20)){\r\n\t\t\tsy[n] = -sy[n];\r\n\t\t\tshiftingArray[n] = Math.asin(sy[n]/s[n]);\r\n\t\t\tturtleArray[n].rotation.y = shiftingArray[n];\r\n\t\t}\r\n\t}\t\r\n}", "title": "" }, { "docid": "1a041531794c5d8b4c3b1abfb718999f", "score": "0.4483232", "text": "function patch(node, patches) {\r\n console.log(node);\r\n var walker = {index: 0}\r\n allPathes = patches;\r\n walk(node, walker, allPathes);\r\n}", "title": "" }, { "docid": "f9604d83b769d9a5e6f946e366bc0643", "score": "0.44773573", "text": "function GameObjectSet() {\r\n this.kDelta = 0.5;\r\n \r\n this.mSet = [];\r\n this.mXform = new Transform();\r\n this.mXform.setPosition(0, 0);\r\n this.mXform.setSize(1, 1);\r\n this.mBB = null;\r\n this.posDif = [];\r\n this.sizeDif = [];\r\n this.mCollided = 0;\r\n}", "title": "" }, { "docid": "675de46fb8f78192bc6acddcbc19ff3e", "score": "0.4463355", "text": "difference(set) {\n let diffArray = this.toArray().filter((item) => (!set.contains(item)));\n return new this.constructor(...diffArray);\n }", "title": "" }, { "docid": "458311d041c9061e3a0ced5003f11de2", "score": "0.44604394", "text": "function updateShapes() {\r\n\trebuildLines();\t\r\n}", "title": "" }, { "docid": "089acbf644c89125c72de4c70fe8a975", "score": "0.44567478", "text": "function Changeset() {\n for(var i=0; i<arguments.length; i++) {\n this.push(arguments[i])\n }\n this.addendum = \"\"\n this.removendum = \"\"\n this.initialLength = 0\n}", "title": "" }, { "docid": "fc887d5469da07ff4fc53141a60270dc", "score": "0.4453569", "text": "function addToSet(set, array) {\r\n if (setPrototypeOf) {\r\n // Make 'in' and truthy checks like Boolean(set.constructor)\r\n // independent of any properties defined on Object.prototype.\r\n // Prevent prototype setters from intercepting set as a this value.\r\n setPrototypeOf(set, null);\r\n }\r\n\r\n var l = array.length;\r\n while (l--) {\r\n var element = array[l];\r\n if (typeof element === 'string') {\r\n var lcElement = stringToLowerCase(element);\r\n if (lcElement !== element) {\r\n // Config presets (e.g. tags.js, attrs.js) are immutable.\r\n if (!isFrozen(array)) {\r\n array[l] = lcElement;\r\n }\r\n\r\n element = lcElement;\r\n }\r\n }\r\n\r\n set[element] = true;\r\n }\r\n\r\n return set;\r\n }", "title": "" }, { "docid": "abb8258a5f25adf263f27c31d6dc0869", "score": "0.44412437", "text": "GetTriads() {\n return this.m_triadBuffer.data;\n }", "title": "" }, { "docid": "b011d638cda78414b7517806ad330742", "score": "0.44313952", "text": "getShape() {\n return this.flips(this.rotates())\n }", "title": "" }, { "docid": "fc4e0f27188949b11178442d1bd508d4", "score": "0.44296932", "text": "function StyleSet () {\n\tthis.name = null;\n\t// styles is an array of Styles\n\tthis.styles = [];\n\t// dimensions of the promotion to be drawn\n\tthis.width = 0;\n\tthis.height = 0;\n\tthis.availableImages = [];\n\tthis.defaultImage = null;\n\tthis.paletteColors = [];\n\tthis.logoData = null;\n\n\t// Convert JSON data into data for this Model\n\tthis.populateFromJSON = function (jsonObj) {\n\t\tthis.name = jsonObj.name;\n\t\tthis.width = jsonObj.width;\n\t\tthis.height = jsonObj.height;\n\t\tvar jsonStyles = jsonObj.styles;\n\t\tfor (var i = 0; i < jsonStyles.length; i++) {\n\t\t\tvar jsonStyle = jsonStyles[i];\n\t\t\tvar styl = new Style (jsonStyle.styleType, this);\n\t\t\tthis.styles[i] = styl;\n\t\t\tstyl.index = i;\n\t\t\tstyl.populateFromJSON (jsonStyle);\n\t\t}\n\t};\n\t\n\t\n\t/* Call this before switching style sets to delete all existing fabric objects.\n\t */\n\tthis.killFabricObjects = function () {\n\t\tfor (var i = 0; i < this.styles.length; i++) {\n\t\t\tvar style = this.styles[i];\n\t\t\tif (style.fabricObject) {\n\t\t\t\tstyle.fabricObject.remove();\n\t\t\t\tstyle.fabricObject = null;\n\t\t\t}\n\t\t}\n\t};\n\t\n\t/* Make a copy that will be suitable for a separate display. This\n\t * means all styles are copied, but local styles are SHARED, so\n\t * that a change in one will affect the other.\n\t */\n\tthis.copyForDisplay = function() {\n\t\tvar retval = new StyleSet();\n\t\tretval.name = this.name;\n\t\tretval.width = this.width;\n\t\tretval.height = this.height;\n\t\tretval.styles = [];\n\t\tfor (var i = 0; i < this.styles.length; i++) {\n\t\t\tvar style = this.styles[i];\n\t\t\tvar copyStyle = style.copy(); \n\t\t\tretval.styles.push (style.copy());\n\t\t}\n\t\t\n\t\treturn retval;\n\t};\n\n\t\n\t/* Attach the styles of the styleset to fields of the model.\n\t */\n\tthis.attachToModel = function (model) {\n\t\tvar len = this.styles.length;\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar style = this.styles[i];\n\t\t\tstyle.attachToModel (model);\n\t\t}\n\t};\n\t\n\t/** Assign an array of four palette color strings to the StyleSet.\n\t * Copies them into the StyleSet's own array rather than sharing\n\t * the array. */\n\tthis.assignPaletteColors = function (colors) {\n\t\tthis.paletteColors = [];\t\t// reset\n\t\tfor (var i = 0; i < colors.length; i++) {\n\t\t\tthis.paletteColors.push(colors[i]);\n\t\t}\n\t};\n\t\n\t/** Assign the array of available images to the StyleSet.\n\t * This has to be done to each StyleSet that's activated.\n\t * Repeating it is harmless. Each image objects has the fields\n\t * ID, width, and height.\n\t */\n\tthis.assignAvailableImages = function (imgs) {\n\t\tthis.availableImages = imgs;\n\t\tfor (var i = 0; i < this.styles.length; i++) {\n\t\t\tvar style = this.styles[i];\n\t\t\tstyle.availableImages = imgs;\n\t\t}\n\t};\n\t\n\t/** Reset transient values in the local style to undefined.\n\t */\n\tthis.resetTransientStyles = function () {\n\t\tfor (var i = 0; i < this.styles.length; i++) {\n\t\t\tvar style = this.styles[i];\n\t\t\tstyle.resetTransientValues ();\n\t\t}\n\t};\n}", "title": "" }, { "docid": "0769599affdb4019b6e4b395435dddb1", "score": "0.44274014", "text": "function createTail(){\r\n\tvar tailPoint = createTailJoint();\r\n\r\n\tvar turtleTail = createTriangle();\r\n\ttailPoint.add(turtleTail);\r\n\r\n\tturtleTail.name = 'turtleTail';\r\n\ttailPoint.name = 'tailPoint';\r\n\treturn tailPoint;\r\n\r\n}", "title": "" }, { "docid": "54deacbac3def1d21aaa70c64f61fa4e", "score": "0.44215202", "text": "hatch(n, breedName) {\n var breed, isNameValid, newTurtles, num;\n num = n >= 0 ? n : 0;\n isNameValid = (breedName != null) && breedName !== \"\";\n breed = isNameValid ? this.world.breedManager.get(breedName) : this._breed;\n newTurtles = map(() => {\n return this._makeTurtleCopy(breed);\n })(rangeUntil(0)(num));\n return new TurtleSet(newTurtles, this.world);\n }", "title": "" }, { "docid": "68ef4f220bd143199dcdcb4182a2f9de", "score": "0.4420581", "text": "function triangulize() {\n var delaunay;\n verticesHashTableFlat = verticesHashTable.reduce(function (acc, curr) {\n return acc.concat(curr)\n });\n delaunay = (Delaunator.from(verticesHashTableFlat))\n stepD = 0;\n\n var triangles = (delaunay.triangles)\n triangulations[0] = triangles;\n\n //displayPoints=false;\n //displayTriangulation=false;\n //displayPoints=true;\n displayTriangulation = true;\n css_buttons.displayTriangulation(true);\n stepD = 0;\n\n //Store the corresponding flat vertices for use by other functions\n triangulatedVerticesFlat = JSON.parse(JSON.stringify(verticesHashTableFlat));\n\n}", "title": "" }, { "docid": "cc68566ea68cb3ffc24a06d169b276c0", "score": "0.44187808", "text": "function make_sunburst(theList) {\n face_id = [];\n var vertices_id = [];\n var planeMaterial = new THREE.MeshBasicMaterial({\n color: 0xffffff,\n vertexColors: THREE.FaceColors,\n opacity: 0.95,\n transparent: false,\n morphTargets: true,\n wireframe: false\n });\n\n material = new THREE.MeshBasicMaterial({\n color: 0xffffff,\n wireframe: false,\n morphTargets: true\n });\n //ringGeometry10 = ringGeometry.clone().thetaSegment\n\n var g = new THREE.Geometry();\n\n theList.forEach(function(d, i) {\n sweep = rads(d.x1) - rads(d.x0);\n start_angle = rads(d.x0);\n rotation = radial_rotation;\n if (d == root) {\n segments = 36;\n } else if (d.x1 - d.x0 <= 0.2) {\n segments = 1;\n } else if (d.x1 - d.x0 < 1) {\n segments = 1;\n } else {\n segments = 2;\n }\n\n var ringGeometry = new THREE.RingGeometry(\n d == root ? 0 : (d.depth + 1) * barheight,\n (d.depth + 2) * barheight,\n segments,\n 1,\n start_angle,\n sweep\n );\n\n var mesh = new THREE.Mesh(ringGeometry);\n (d.faces = []), (d.vertices = []);\n for (var j = 0; j < mesh.geometry.faces.length; j++) {\n mesh.geometry.faces[j].color.set(d.color);\n face_id.push(i);\n }\n for (var j = 0; j < mesh.geometry.vertices.length; j++) {\n vertices_id.push(i);\n }\n g.mergeMesh(mesh);\n }); // for each segment\n\n g.morphTargets[0] = {\n name: \"t1\",\n vertices: g.clone().vertices,\n angles: [],\n radius: []\n };\n for (var j = 0; j < g.vertices.length; j++) {\n v = g.vertices[j];\n r = (v.x ** 2 + v.y ** 2) ** 0.5;\n theta = Math.atan2(v.y, v.x);\n //\n g.morphTargets[0].angles[j] = theta;\n g.morphTargets[0].radius[j] = r;\n }\n\n face_id.map(function(d, index) {\n thelist[d].faces.push(index);\n });\n vertices_id.map(function(d, index) {\n thelist[d].vertices.push(index);\n });\n return new THREE.Mesh(g, planeMaterial);\n} // make_sunburst", "title": "" }, { "docid": "e345ce92d358ad9781dcc1896f72771c", "score": "0.44185907", "text": "function createTetrahedron(radius, detail) {\n var geometry = new THREE.TetrahedronGeometry(radius, detail);\n var object = new THREE.Mesh(geometry, objectMaterial);\n object.castShadow = true;\n object.position.set(0.0, radius * 1.1, 0.0);\n object.visible = false;\n object.name = \"Tetrahedron\";\n objectArray.push(object);\n return object;\n }", "title": "" }, { "docid": "f91ed5ad4cd0de056a44b0e2bdb7a112", "score": "0.44170254", "text": "function set_wall_properties() {\n mrt.walls = [\n {\n name: \"wall1\",\n temperature: params.wall1.temperature,\n emissivity: params.wall1.emissivity,\n plane: \"xz\", // 'xy' plane for webgl geometry\n u: mrt.room.width,\n v: mrt.room.height,\n offset: { x: 0, y: 0, z: 0 },\n subsurfaces: [],\n },\n {\n name: \"wall2\",\n temperature: params.wall2.temperature,\n emissivity: params.wall2.emissivity,\n plane: \"yz\",\n u: mrt.room.depth,\n v: mrt.room.height,\n offset: { x: mrt.room.width, y: 0, z: 0 },\n subsurfaces: [],\n },\n {\n name: \"wall3\",\n temperature: params.wall3.temperature,\n emissivity: params.wall3.emissivity,\n plane: \"xz\",\n u: mrt.room.width,\n v: mrt.room.height,\n offset: { x: 0, y: mrt.room.depth, z: 0 },\n subsurfaces: [],\n },\n {\n name: \"wall4\",\n temperature: params.wall4.temperature,\n emissivity: params.wall4.emissivity,\n plane: \"yz\",\n u: mrt.room.depth,\n v: mrt.room.height,\n offset: { x: 0, y: 0, z: 0 },\n subsurfaces: [],\n },\n {\n name: \"ceiling\",\n temperature: params.ceiling.temperature,\n emissivity: params.ceiling.emissivity,\n plane: \"xy\",\n u: mrt.room.width,\n v: mrt.room.depth,\n offset: { x: 0, y: 0, z: mrt.room.height },\n subsurfaces: [],\n },\n {\n name: \"floor\",\n temperature: params.floor.temperature,\n emissivity: params.floor.emissivity,\n plane: \"xy\",\n u: mrt.room.width,\n v: mrt.room.depth,\n offset: { x: 0, y: 0, z: 0 },\n subsurfaces: [],\n },\n ];\n\n var wall1 = _.find(mrt.walls, function (w) {\n return w.name === \"wall1\";\n });\n if (params.wall1.panel.active) {\n wall1.subsurfaces = [\n {\n name: \"wall1panel1\",\n temperature: params.wall1.panel.temperature,\n emissivity: params.wall1.panel.emissivity,\n u: params.wall1.panel.xposition,\n v: params.wall1.panel.yposition,\n width: params.wall1.panel.width,\n height: params.wall1.panel.height,\n },{\n name: \"wall1panel2\",\n temperature: params.wall1.panel.temperature,\n emissivity: params.wall1.panel.emissivity,\n u: params.wall1.panel.xposition+5,\n v: params.wall1.panel.yposition,\n width: params.wall1.panel.width,\n height: params.wall1.panel.height,\n },\n ];\n }\n\n var wall2 = _.find(mrt.walls, function (w) {\n return w.name === \"wall2\";\n });\n if (params.wall2.panel.active) {\n wall2.subsurfaces = [\n {\n name: \"wall2panel1\",\n temperature: params.wall2.panel.temperature,\n emissivity: params.wall2.panel.emissivity,\n u: params.wall2.panel.xposition,\n v: params.wall2.panel.yposition,\n width: params.wall2.panel.width,\n height: params.wall2.panel.height,\n },\n ];\n }\n\n var wall3 = _.find(mrt.walls, function (w) {\n return w.name === \"wall3\";\n });\n if (params.wall3.panel.active) {\n wall3.subsurfaces = [\n {\n name: \"wall3panel1\",\n temperature: params.wall3.panel.temperature,\n emissivity: params.wall3.panel.emissivity,\n u: params.wall3.panel.xposition,\n v: params.wall3.panel.yposition,\n width: params.wall3.panel.width,\n height: params.wall3.panel.height,\n },\n ];\n }\n\n var wall4 = _.find(mrt.walls, function (w) {\n return w.name === \"wall4\";\n });\n if (params.wall4.panel.active) {\n wall4.subsurfaces = [\n {\n name: \"wall4panel1\",\n temperature: params.wall4.panel.temperature,\n emissivity: params.wall4.panel.emissivity,\n u: params.wall4.panel.xposition,\n v: params.wall4.panel.yposition,\n width: params.wall4.panel.width,\n height: params.wall4.panel.height,\n },\n ];\n }\n\n var ceiling = _.find(mrt.walls, function (w) {\n return w.name === \"ceiling\";\n });\n if (params.ceiling.panel.active) {\n ceiling.subsurfaces = [\n {\n name: \"ceilingpanel1\",\n temperature: params.ceiling.panel.temperature,\n emissivity: params.ceiling.panel.emissivity,\n u: params.ceiling.panel.xposition,\n v: params.ceiling.panel.yposition,\n width: params.ceiling.panel.width,\n height: params.ceiling.panel.height,\n },\n ];\n }\n\n var floor = _.find(mrt.walls, function (w) {\n return w.name === \"floor\";\n });\n if (params.floor.panel.active) {\n floor.subsurfaces = [\n {\n name: \"floorpanel1\",\n temperature: params.floor.panel.temperature,\n emissivity: params.floor.panel.emissivity,\n u: params.floor.panel.xposition,\n v: params.floor.panel.yposition,\n width: params.floor.panel.width,\n height: params.floor.panel.height,\n },\n ];\n }\n}", "title": "" }, { "docid": "dd11c7fa9906ba6c7c893f3f6ddc077b", "score": "0.44165528", "text": "static presetLuts() {\n return {\n default: [[0, 0, 0, 0], [1, 1, 1, 1]],\n spectrum: [\n [0, 0, 0, 0],\n [0.1, 0, 0, 1],\n [0.33, 0, 1, 1],\n [0.5, 0, 1, 0],\n [0.66, 1, 1, 0],\n [0.9, 1, 0, 0],\n [1, 1, 1, 1],\n ],\n hot_and_cold: [\n [0, 0, 0, 1],\n [0.15, 0, 1, 1],\n [0.3, 0, 1, 0],\n [0.45, 0, 0, 0],\n [0.5, 0, 0, 0],\n [0.55, 0, 0, 0],\n [0.7, 1, 1, 0],\n [0.85, 1, 0, 0],\n [1, 1, 1, 1],\n ],\n gold: [\n [0, 0, 0, 0],\n [0.13, 0.19, 0.03, 0],\n [0.25, 0.39, 0.12, 0],\n [0.38, 0.59, 0.26, 0],\n [0.5, 0.8, 0.46, 0.08],\n [0.63, 0.99, 0.71, 0.21],\n [0.75, 0.99, 0.88, 0.34],\n [0.88, 0.99, 0.99, 0.48],\n [1, 0.9, 0.95, 0.61],\n ],\n red: [[0, 0.75, 0, 0], [0.5, 1, 0.5, 0], [0.95, 1, 1, 0], [1, 1, 1, 1]],\n green: [[0, 0, 0.75, 0], [0.5, 0.5, 1, 0], [0.95, 1, 1, 0], [1, 1, 1, 1]],\n blue: [[0, 0, 0, 1], [0.5, 0, 0.5, 1], [0.95, 0, 1, 1], [1, 1, 1, 1]],\n walking_dead: [[0, 0.1, 1, 1], [1, 1, 1, 1]],\n random: [\n [0, 0, 0, 0],\n [0.27, 0.18, 0.18, 0.18],\n [0.41, 1, 1, 1],\n [0.7, 1, 0, 0],\n [1, 1, 1, 1],\n ],\n muscle_bone: [\n [0, 0, 0, 0],\n [0.00392156862745098, 0.00784313725490196, 0, 0],\n [0.00784313725490196, 0.0196078431372549, 0, 0],\n [0.011764705882352941, 0.03137254901960784, 0, 0],\n [0.01568627450980392, 0.0392156862745098, 0, 0.00392156862745098],\n [0.0196078431372549, 0.050980392156862744, 0.00392156862745098, 0.00392156862745098],\n [0.023529411764705882, 0.06274509803921569, 0.00392156862745098, 0.00392156862745098],\n [0.027450980392156862, 0.07058823529411765, 0.00392156862745098, 0.00784313725490196],\n [0.03137254901960784, 0.08235294117647059, 0.00392156862745098, 0.00784313725490196],\n [0.03529411764705882, 0.09411764705882353, 0.00784313725490196, 0.00784313725490196],\n [0.0392156862745098, 0.10196078431372549, 0.00784313725490196, 0.00784313725490196],\n [0.043137254901960784, 0.11372549019607843, 0.00784313725490196, 0.011764705882352941],\n [0.047058823529411764, 0.12549019607843137, 0.00784313725490196, 0.011764705882352941],\n [0.050980392156862744, 0.13333333333333333, 0.011764705882352941, 0.011764705882352941],\n [0.054901960784313725, 0.1450980392156863, 0.011764705882352941, 0.01568627450980392],\n [0.058823529411764705, 0.1568627450980392, 0.011764705882352941, 0.01568627450980392],\n [0.06274509803921569, 0.16470588235294117, 0.011764705882352941, 0.01568627450980392],\n [0.06666666666666667, 0.17647058823529413, 0.011764705882352941, 0.0196078431372549],\n [0.07058823529411765, 0.18823529411764706, 0.01568627450980392, 0.0196078431372549],\n [0.07450980392156863, 0.2, 0.01568627450980392, 0.0196078431372549],\n [0.0784313725490196, 0.20784313725490197, 0.01568627450980392, 0.0196078431372549],\n [0.08235294117647059, 0.2196078431372549, 0.01568627450980392, 0.023529411764705882],\n [0.08627450980392157, 0.23137254901960785, 0.0196078431372549, 0.023529411764705882],\n [0.09019607843137255, 0.23921568627450981, 0.0196078431372549, 0.023529411764705882],\n [0.09411764705882353, 0.25098039215686274, 0.0196078431372549, 0.027450980392156862],\n [0.09803921568627451, 0.2627450980392157, 0.0196078431372549, 0.027450980392156862],\n [0.10196078431372549, 0.27058823529411763, 0.023529411764705882, 0.027450980392156862],\n [0.10588235294117647, 0.2823529411764706, 0.023529411764705882, 0.027450980392156862],\n [0.10980392156862745, 0.29411764705882354, 0.023529411764705882, 0.03137254901960784],\n [0.11372549019607843, 0.30196078431372547, 0.023529411764705882, 0.03137254901960784],\n [0.11764705882352941, 0.3137254901960784, 0.023529411764705882, 0.03137254901960784],\n [0.12156862745098039, 0.3254901960784314, 0.027450980392156862, 0.03529411764705882],\n [0.12549019607843137, 0.3333333333333333, 0.027450980392156862, 0.03529411764705882],\n [0.12941176470588237, 0.34509803921568627, 0.027450980392156862, 0.03529411764705882],\n [0.13333333333333333, 0.3568627450980392, 0.027450980392156862, 0.0392156862745098],\n [0.13725490196078433, 0.36470588235294116, 0.03137254901960784, 0.0392156862745098],\n [0.1411764705882353, 0.3764705882352941, 0.03137254901960784, 0.0392156862745098],\n [0.1450980392156863, 0.38823529411764707, 0.03137254901960784, 0.0392156862745098],\n [0.14901960784313725, 0.4, 0.03137254901960784, 0.043137254901960784],\n [0.15294117647058825, 0.40784313725490196, 0.03529411764705882, 0.043137254901960784],\n [0.1568627450980392, 0.4196078431372549, 0.03529411764705882, 0.043137254901960784],\n [0.1607843137254902, 0.43137254901960786, 0.03529411764705882, 0.047058823529411764],\n [0.16470588235294117, 0.4392156862745098, 0.03529411764705882, 0.047058823529411764],\n [0.16862745098039217, 0.45098039215686275, 0.03529411764705882, 0.047058823529411764],\n [0.17254901960784313, 0.4627450980392157, 0.0392156862745098, 0.047058823529411764],\n [0.17647058823529413, 0.47058823529411764, 0.0392156862745098, 0.050980392156862744],\n [0.1803921568627451, 0.4823529411764706, 0.0392156862745098, 0.050980392156862744],\n [0.1843137254901961, 0.49411764705882355, 0.0392156862745098, 0.050980392156862744],\n [0.18823529411764706, 0.5019607843137255, 0.043137254901960784, 0.054901960784313725],\n [0.19215686274509805, 0.5137254901960784, 0.043137254901960784, 0.054901960784313725],\n [0.19607843137254902, 0.5254901960784314, 0.043137254901960784, 0.054901960784313725],\n [0.2, 0.5333333333333333, 0.043137254901960784, 0.058823529411764705],\n [0.20392156862745098, 0.5450980392156862, 0.047058823529411764, 0.058823529411764705],\n [0.20784313725490197, 0.5568627450980392, 0.047058823529411764, 0.058823529411764705],\n [0.21176470588235294, 0.5647058823529412, 0.047058823529411764, 0.058823529411764705],\n [0.21568627450980393, 0.5764705882352941, 0.047058823529411764, 0.06274509803921569],\n [0.2196078431372549, 0.5882352941176471, 0.047058823529411764, 0.06274509803921569],\n [0.2235294117647059, 0.6, 0.050980392156862744, 0.06274509803921569],\n [0.22745098039215686, 0.6078431372549019, 0.050980392156862744, 0.06666666666666667],\n [0.23137254901960785, 0.6196078431372549, 0.050980392156862744, 0.06666666666666667],\n [0.23529411764705882, 0.6313725490196078, 0.050980392156862744, 0.06666666666666667],\n [0.23921568627450981, 0.6392156862745098, 0.054901960784313725, 0.06666666666666667],\n [0.24313725490196078, 0.6509803921568628, 0.054901960784313725, 0.07058823529411765],\n [0.24705882352941178, 0.6627450980392157, 0.054901960784313725, 0.07058823529411765],\n [0.25098039215686274, 0.6705882352941176, 0.054901960784313725, 0.07058823529411765],\n [0.2549019607843137, 0.6823529411764706, 0.058823529411764705, 0.07450980392156863],\n [0.25882352941176473, 0.6941176470588235, 0.058823529411764705, 0.07450980392156863],\n [0.2627450980392157, 0.7019607843137254, 0.058823529411764705, 0.07450980392156863],\n [0.26666666666666666, 0.7137254901960784, 0.058823529411764705, 0.0784313725490196],\n [0.27058823529411763, 0.7254901960784313, 0.058823529411764705, 0.0784313725490196],\n [0.27450980392156865, 0.7333333333333333, 0.06274509803921569, 0.0784313725490196],\n [0.2784313725490196, 0.7450980392156863, 0.06274509803921569, 0.0784313725490196],\n [0.2823529411764706, 0.7568627450980392, 0.06274509803921569, 0.08235294117647059],\n [0.28627450980392155, 0.7647058823529411, 0.06274509803921569, 0.08235294117647059],\n [0.2901960784313726, 0.7764705882352941, 0.06666666666666667, 0.08235294117647059],\n [0.29411764705882354, 0.788235294117647, 0.06666666666666667, 0.08627450980392157],\n [0.2980392156862745, 0.8, 0.06666666666666667, 0.08627450980392157],\n [0.30196078431372547, 0.807843137254902, 0.06666666666666667, 0.08627450980392157],\n [0.3058823529411765, 0.8196078431372549, 0.07058823529411765, 0.08627450980392157],\n [0.30980392156862746, 0.8313725490196079, 0.07058823529411765, 0.09019607843137255],\n [0.3137254901960784, 0.8392156862745098, 0.07058823529411765, 0.09019607843137255],\n [0.3176470588235294, 0.8509803921568627, 0.07058823529411765, 0.09019607843137255],\n [0.3215686274509804, 0.8627450980392157, 0.07058823529411765, 0.09411764705882353],\n [0.3254901960784314, 0.8705882352941177, 0.07450980392156863, 0.09411764705882353],\n [0.32941176470588235, 0.8823529411764706, 0.07450980392156863, 0.09411764705882353],\n [0.3333333333333333, 0.8941176470588236, 0.07450980392156863, 0.09803921568627451],\n [0.33725490196078434, 0.9019607843137255, 0.07450980392156863, 0.09803921568627451],\n [0.3411764705882353, 0.9137254901960784, 0.0784313725490196, 0.09803921568627451],\n [0.34509803921568627, 0.9254901960784314, 0.0784313725490196, 0.09803921568627451],\n [0.34901960784313724, 0.9333333333333333, 0.0784313725490196, 0.10196078431372549],\n [0.35294117647058826, 0.9450980392156862, 0.0784313725490196, 0.10196078431372549],\n [0.3568627450980392, 0.9568627450980393, 0.08235294117647059, 0.10196078431372549],\n [0.3607843137254902, 0.9647058823529412, 0.08235294117647059, 0.10588235294117647],\n [0.36470588235294116, 0.9764705882352941, 0.08235294117647059, 0.10588235294117647],\n [0.3686274509803922, 0.9882352941176471, 0.08235294117647059, 0.10588235294117647],\n [0.37254901960784315, 1, 0.08235294117647059, 0.10588235294117647],\n [0.3764705882352941, 1, 0.09411764705882353, 0.10588235294117647],\n [0.3803921568627451, 1, 0.10588235294117647, 0.10588235294117647],\n [0.3843137254901961, 1, 0.11764705882352941, 0.10196078431372549],\n [0.38823529411764707, 1, 0.12941176470588237, 0.10196078431372549],\n [0.39215686274509803, 1, 0.1411764705882353, 0.10196078431372549],\n [0.396078431372549, 1, 0.15294117647058825, 0.09803921568627451],\n [0.4, 1, 0.16470588235294117, 0.09803921568627451],\n [0.403921568627451, 1, 0.17647058823529413, 0.09803921568627451],\n [0.40784313725490196, 1, 0.18823529411764706, 0.09411764705882353],\n [0.4117647058823529, 1, 0.2, 0.09411764705882353],\n [0.41568627450980394, 1, 0.21176470588235294, 0.09411764705882353],\n [0.4196078431372549, 1, 0.2235294117647059, 0.09019607843137255],\n [0.4235294117647059, 1, 0.23529411764705882, 0.09019607843137255],\n [0.42745098039215684, 1, 0.24705882352941178, 0.08627450980392157],\n [0.43137254901960786, 1, 0.25882352941176473, 0.08627450980392157],\n [0.43529411764705883, 1, 0.27058823529411763, 0.08627450980392157],\n [0.4392156862745098, 1, 0.2823529411764706, 0.08235294117647059],\n [0.44313725490196076, 1, 0.29411764705882354, 0.08235294117647059],\n [0.4470588235294118, 1, 0.3058823529411765, 0.08235294117647059],\n [0.45098039215686275, 1, 0.3176470588235294, 0.0784313725490196],\n [0.4549019607843137, 1, 0.32941176470588235, 0.0784313725490196],\n [0.4588235294117647, 1, 0.3411764705882353, 0.0784313725490196],\n [0.4627450980392157, 1, 0.35294117647058826, 0.07450980392156863],\n [0.4666666666666667, 1, 0.36470588235294116, 0.07450980392156863],\n [0.47058823529411764, 1, 0.3764705882352941, 0.07450980392156863],\n [0.4745098039215686, 1, 0.38823529411764707, 0.07058823529411765],\n [0.47843137254901963, 1, 0.4, 0.07058823529411765],\n [0.4823529411764706, 1, 0.4117647058823529, 0.07058823529411765],\n [0.48627450980392156, 1, 0.4235294117647059, 0.06666666666666667],\n [0.49019607843137253, 1, 0.43529411764705883, 0.06666666666666667],\n [0.49411764705882355, 1, 0.4470588235294118, 0.06274509803921569],\n [0.4980392156862745, 1, 0.4588235294117647, 0.06274509803921569],\n [0.5019607843137255, 1, 0.47058823529411764, 0.06274509803921569],\n [0.5058823529411764, 1, 0.4823529411764706, 0.058823529411764705],\n [0.5098039215686274, 1, 0.49411764705882355, 0.058823529411764705],\n [0.5137254901960784, 1, 0.5058823529411764, 0.058823529411764705],\n [0.5176470588235295, 1, 0.5137254901960784, 0.054901960784313725],\n [0.5215686274509804, 1, 0.5254901960784314, 0.054901960784313725],\n [0.5254901960784314, 1, 0.5372549019607843, 0.054901960784313725],\n [0.5294117647058824, 1, 0.5490196078431373, 0.050980392156862744],\n [0.5333333333333333, 1, 0.5607843137254902, 0.050980392156862744],\n [0.5372549019607843, 1, 0.5725490196078431, 0.050980392156862744],\n [0.5411764705882353, 1, 0.5843137254901961, 0.047058823529411764],\n [0.5450980392156862, 1, 0.596078431372549, 0.047058823529411764],\n [0.5490196078431373, 1, 0.6078431372549019, 0.043137254901960784],\n [0.5529411764705883, 1, 0.6196078431372549, 0.043137254901960784],\n [0.5568627450980392, 1, 0.6313725490196078, 0.043137254901960784],\n [0.5607843137254902, 1, 0.6431372549019608, 0.0392156862745098],\n [0.5647058823529412, 1, 0.6549019607843137, 0.0392156862745098],\n [0.5686274509803921, 1, 0.6666666666666666, 0.0392156862745098],\n [0.5725490196078431, 1, 0.6784313725490196, 0.03529411764705882],\n [0.5764705882352941, 1, 0.6901960784313725, 0.03529411764705882],\n [0.5803921568627451, 1, 0.6941176470588235, 0.0392156862745098],\n [0.5843137254901961, 1, 0.7019607843137254, 0.0392156862745098],\n [0.5882352941176471, 1, 0.7058823529411765, 0.043137254901960784],\n [0.592156862745098, 1, 0.7098039215686275, 0.043137254901960784],\n [0.596078431372549, 1, 0.7137254901960784, 0.047058823529411764],\n [0.6, 1, 0.7176470588235294, 0.047058823529411764],\n [0.6039215686274509, 1, 0.7254901960784313, 0.050980392156862744],\n [0.6078431372549019, 1, 0.7294117647058823, 0.050980392156862744],\n [0.611764705882353, 1, 0.7333333333333333, 0.054901960784313725],\n [0.615686274509804, 1, 0.7372549019607844, 0.058823529411764705],\n [0.6196078431372549, 1, 0.7411764705882353, 0.058823529411764705],\n [0.6235294117647059, 1, 0.7490196078431373, 0.06274509803921569],\n [0.6274509803921569, 1, 0.7529411764705882, 0.06274509803921569],\n [0.6313725490196078, 1, 0.7568627450980392, 0.06666666666666667],\n [0.6352941176470588, 1, 0.7607843137254902, 0.06666666666666667],\n [0.6392156862745098, 1, 0.7647058823529411, 0.07058823529411765],\n [0.6431372549019608, 1, 0.7725490196078432, 0.07058823529411765],\n [0.6470588235294118, 1, 0.7764705882352941, 0.07450980392156863],\n [0.6509803921568628, 1, 0.7803921568627451, 0.07450980392156863],\n [0.6549019607843137, 1, 0.7843137254901961, 0.0784313725490196],\n [0.6588235294117647, 1, 0.788235294117647, 0.08235294117647059],\n [0.6627450980392157, 1, 0.796078431372549, 0.08235294117647059],\n [0.6666666666666666, 1, 0.8, 0.08627450980392157],\n [0.6705882352941176, 1, 0.803921568627451, 0.08627450980392157],\n [0.6745098039215687, 1, 0.807843137254902, 0.09019607843137255],\n [0.6784313725490196, 1, 0.8117647058823529, 0.09019607843137255],\n [0.6823529411764706, 1, 0.8196078431372549, 0.09411764705882353],\n [0.6862745098039216, 1, 0.8235294117647058, 0.09411764705882353],\n [0.6901960784313725, 1, 0.8274509803921568, 0.09803921568627451],\n [0.6941176470588235, 1, 0.8313725490196079, 0.10196078431372549],\n [0.6980392156862745, 1, 0.8352941176470589, 0.10196078431372549],\n [0.7019607843137254, 1, 0.8431372549019608, 0.10588235294117647],\n [0.7058823529411765, 1, 0.8470588235294118, 0.10588235294117647],\n [0.7098039215686275, 1, 0.8509803921568627, 0.10980392156862745],\n [0.7137254901960784, 1, 0.8549019607843137, 0.10980392156862745],\n [0.7176470588235294, 1, 0.8627450980392157, 0.11372549019607843],\n [0.7215686274509804, 1, 0.8666666666666667, 0.11372549019607843],\n [0.7254901960784313, 1, 0.8705882352941177, 0.11764705882352941],\n [0.7294117647058823, 1, 0.8745098039215686, 0.12156862745098039],\n [0.7333333333333333, 1, 0.8784313725490196, 0.12156862745098039],\n [0.7372549019607844, 1, 0.8862745098039215, 0.12549019607843137],\n [0.7411764705882353, 1, 0.8901960784313725, 0.12549019607843137],\n [0.7450980392156863, 1, 0.8941176470588236, 0.12941176470588237],\n [0.7490196078431373, 1, 0.8980392156862745, 0.12941176470588237],\n [0.7529411764705882, 1, 0.9019607843137255, 0.13333333333333333],\n [0.7568627450980392, 1, 0.9098039215686274, 0.13333333333333333],\n [0.7607843137254902, 1, 0.9137254901960784, 0.13725490196078433],\n [0.7647058823529411, 1, 0.9176470588235294, 0.1411764705882353],\n [0.7686274509803922, 1, 0.9215686274509803, 0.1411764705882353],\n [0.7725490196078432, 1, 0.9254901960784314, 0.1450980392156863],\n [0.7764705882352941, 1, 0.9333333333333333, 0.1450980392156863],\n [0.7803921568627451, 1, 0.9372549019607843, 0.14901960784313725],\n [0.7843137254901961, 1, 0.9411764705882353, 0.14901960784313725],\n [0.788235294117647, 1, 0.9450980392156862, 0.15294117647058825],\n [0.792156862745098, 1, 0.9450980392156862, 0.16862745098039217],\n [0.796078431372549, 1, 0.9490196078431372, 0.1843137254901961],\n [0.8, 1, 0.9490196078431372, 0.2],\n [0.803921568627451, 1, 0.9490196078431372, 0.21568627450980393],\n [0.807843137254902, 1, 0.9490196078431372, 0.22745098039215686],\n [0.8117647058823529, 1, 0.9529411764705882, 0.24313725490196078],\n [0.8156862745098039, 1, 0.9529411764705882, 0.25882352941176473],\n [0.8196078431372549, 1, 0.9529411764705882, 0.27450980392156865],\n [0.8235294117647058, 1, 0.9529411764705882, 0.2901960784313726],\n [0.8274509803921568, 1, 0.9568627450980393, 0.3058823529411765],\n [0.8313725490196079, 1, 0.9568627450980393, 0.3215686274509804],\n [0.8352941176470589, 1, 0.9568627450980393, 0.33725490196078434],\n [0.8392156862745098, 1, 0.9568627450980393, 0.35294117647058826],\n [0.8431372549019608, 1, 0.9607843137254902, 0.3686274509803922],\n [0.8470588235294118, 1, 0.9607843137254902, 0.3843137254901961],\n [0.8509803921568627, 1, 0.9607843137254902, 0.4],\n [0.8549019607843137, 1, 0.9607843137254902, 0.4117647058823529],\n [0.8588235294117647, 1, 0.9647058823529412, 0.42745098039215684],\n [0.8627450980392157, 1, 0.9647058823529412, 0.44313725490196076],\n [0.8666666666666667, 1, 0.9647058823529412, 0.4588235294117647],\n [0.8705882352941177, 1, 0.9647058823529412, 0.4745098039215686],\n [0.8745098039215686, 1, 0.9686274509803922, 0.49019607843137253],\n [0.8784313725490196, 1, 0.9686274509803922, 0.5058823529411764],\n [0.8823529411764706, 1, 0.9686274509803922, 0.5215686274509804],\n [0.8862745098039215, 1, 0.9686274509803922, 0.5372549019607843],\n [0.8901960784313725, 1, 0.9725490196078431, 0.5529411764705883],\n [0.8941176470588236, 1, 0.9725490196078431, 0.5686274509803921],\n [0.8980392156862745, 1, 0.9725490196078431, 0.5843137254901961],\n [0.9019607843137255, 1, 0.9725490196078431, 0.6],\n [0.9058823529411765, 1, 0.9725490196078431, 0.611764705882353],\n [0.9098039215686274, 1, 0.9764705882352941, 0.6274509803921569],\n [0.9137254901960784, 1, 0.9764705882352941, 0.6431372549019608],\n [0.9176470588235294, 1, 0.9764705882352941, 0.6588235294117647],\n [0.9215686274509803, 1, 0.9764705882352941, 0.6745098039215687],\n [0.9254901960784314, 1, 0.9803921568627451, 0.6901960784313725],\n [0.9294117647058824, 1, 0.9803921568627451, 0.7058823529411765],\n [0.9333333333333333, 1, 0.9803921568627451, 0.7215686274509804],\n [0.9372549019607843, 1, 0.9803921568627451, 0.7372549019607844],\n [0.9411764705882353, 1, 0.984313725490196, 0.7529411764705882],\n [0.9450980392156862, 1, 0.984313725490196, 0.7686274509803922],\n [0.9490196078431372, 1, 0.984313725490196, 0.7843137254901961],\n [0.9529411764705882, 1, 0.984313725490196, 0.8],\n [0.9568627450980393, 1, 0.9882352941176471, 0.8117647058823529],\n [0.9607843137254902, 1, 0.9882352941176471, 0.8274509803921568],\n [0.9647058823529412, 1, 0.9882352941176471, 0.8431372549019608],\n [0.9686274509803922, 1, 0.9882352941176471, 0.8588235294117647],\n [0.9725490196078431, 1, 0.9921568627450981, 0.8745098039215686],\n [0.9764705882352941, 1, 0.9921568627450981, 0.8901960784313725],\n [0.9803921568627451, 1, 0.9921568627450981, 0.9058823529411765],\n [0.984313725490196, 1, 0.9921568627450981, 0.9215686274509803],\n [0.9882352941176471, 1, 0.996078431372549, 0.9372549019607843],\n [0.9921568627450981, 1, 0.996078431372549, 0.9529411764705882],\n [0.996078431372549, 1, 0.996078431372549, 0.9686274509803922],\n [1, 1, 0.996078431372549, 0.984313725490196],\n ],\n };\n }", "title": "" }, { "docid": "4fee1d38c5cbc62873b41af11bb48c3e", "score": "0.44087687", "text": "function Set(startarray)\n{\n\tthis.Set =[];\n\tfor (var i = 0; i < startarray.length; i++) {\n\t\tvar set = new Array(startarray[i]);\n\t\tthis.Set.push(set);\n\t};\n\n\n\n\tthis.check = function(a, b){\n\n\t\t//Find ud af hvilket set de to vektorer er del af.\n\t\tvar j = this.pointIndex(a);\n\t\tvar x = this.pointIndex(b);\n\t\t\n\t\tif(j != x)\n\t\t{\n\t\t\tthis.union(a, b, j, x);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{ \n\t\t\treturn false; \n\t\t}\n\t\t\n\t}\n\n\n\tthis.union = function(a, b, j, x){\n\t\t//var newSet = this.Set[j];\n\t\tvar newSet = this.Set[j].concat(this.Set[x]);\n\t\tthis.Set[j] = newSet;\n\t\tthis.Set.splice(x, 1);\n\t}\t\n\n\tthis.pointIndex = function(p){\n\t\tfor (var i = 0; i < this.Set.length; i++) {\n\t\t\t//tjek needle i sæt 1\n\t\t\tif(findNeedle(this.Set[i], p)){ \n\t\t\t\t//stop:\n\t\t\t\treturn i;\n\t\t\t}\n\t\t};\n\t}\n\n}", "title": "" }, { "docid": "8eb17e5d0813acc4e6f2a378166262ec", "score": "0.44080514", "text": "static set bakeCollisionMeshes(value) {}", "title": "" }, { "docid": "d582afb728fad34f0d427ea0623c3ba0", "score": "0.44027698", "text": "function getTuplets() {\n\t\t var uniqueTuplets = [];\n\t\t\n\t\t // Go through all of the note groups and inspect for tuplets\n\t\t noteGroups.forEach(function (group) {\n\t\t var tuplet = null;\n\t\t group.forEach(function (note) {\n\t\t if (note.tuplet && tuplet !== note.tuplet) {\n\t\t tuplet = note.tuplet;\n\t\t uniqueTuplets.push(tuplet);\n\t\t }\n\t\t });\n\t\t });\n\t\t return uniqueTuplets;\n\t\t }", "title": "" }, { "docid": "b0106f4c8b5a759b341bf78754571cd9", "score": "0.44007653", "text": "function StraightTet() {\n\t//light blue\n\tvar that = {\n\t grid: [[undefined, undefined, undefined, undefined], [LightBlueBlock(), LightBlueBlock(), LightBlueBlock(), LightBlueBlock()]]\n\t \n\t};\n\n\tthat.grid[1][0].bind.right = true;\n\t\n\tthat.grid[1][1].bind.left = true;\n\tthat.grid[1][1].bind.right = true;\n\n\tthat.grid[1][2].bind.left = true;\n\tthat.grid[1][2].bind.right = true;\n\n\tthat.grid[1][3].bind.left = true;\n\t\n\treturn that;\n\t\n }", "title": "" }, { "docid": "5f7a8334ba11b507cec96fe703e049a3", "score": "0.43999344", "text": "function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }", "title": "" }, { "docid": "5f7a8334ba11b507cec96fe703e049a3", "score": "0.43999344", "text": "function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }", "title": "" }, { "docid": "5f7a8334ba11b507cec96fe703e049a3", "score": "0.43999344", "text": "function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }", "title": "" }, { "docid": "5f7a8334ba11b507cec96fe703e049a3", "score": "0.43999344", "text": "function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }", "title": "" }, { "docid": "edf0b495d381c5e23a12e4a5c494c4eb", "score": "0.4399815", "text": "function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}", "title": "" }, { "docid": "2ebe6254789d5f1d9f316873f5a850a3", "score": "0.43984187", "text": "function generate(i,a){void 0===a&&(a=!1);var u=re.get(i.object);_generate(u.value,i.object,i.patches,\"\",a),i.patches.length&&applyPatch(u.value,i.patches);var w=i.patches;return w.length>0&&(i.patches=[],i.callback&&i.callback(w)),w}", "title": "" }, { "docid": "81fee6b2b342d68d0cd7f08c3740ddda", "score": "0.4393382", "text": "function createAttributeSet() {\n var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var value = initialValue;\n return {\n get: function get() {\n return value;\n },\n add: function add(part) {\n var lastPart = value[value.length - 1];\n if ((lastPart === null || lastPart === void 0 ? void 0 : lastPart.isHighlighted) === part.isHighlighted) {\n value[value.length - 1] = {\n value: lastPart.value + part.value,\n isHighlighted: lastPart.isHighlighted\n };\n } else {\n value.push(part);\n }\n }\n };\n}", "title": "" }, { "docid": "e155c7bbd3373461812df150ab320a3a", "score": "0.4391787", "text": "function SetArtItemSett(sChrStopSett, sArtNameSett, sUrlArtImgSett, sImgArtNameDefaultSett, bIsViewCostSett,iDbIdSett, sDbArtModelIdSett, fDbWeightNrSett,\n fRetailPriceInclExclVatSett, sRetailPriceInclExclVatFormattedSett, sOriginalRetailPriceInclExclVatFormattedSett, sDbStockStatusTranslSett, sLangStockStatusIsEmptySett, sUrlImgSoft_1Sett, sImgFileName_1Sett,\n iWdtNr_1Sett, iHgtNr_1Sett, bIsImgIsArtItemAutoZoomSett, bIsImgIsArtHighslideSett, iSetupShopSizeNrSett, iArtPrmTotalNrSett, iArtPrm_DataTotalNrSett,\n sArtManufacturerModelIdSett)\n{\n sChrStop = sChrStopSett;\n sArtName = sArtNameSett;\n sUrlArtImg = sUrlArtImgSett;\n sImgArtNameDefault = sImgArtNameDefaultSett;\n bIsViewCost = bIsViewCostSett;\n iDbId = iDbIdSett;\n sDbArtModelId = sDbArtModelIdSett;\n fDbWeightNr = fDbWeightNrSett;\n fRetailPriceInclExclVat = fRetailPriceInclExclVatSett;\n sRetailPriceInclExclVatFormatted = sRetailPriceInclExclVatFormattedSett;\n sOriginalRetailPriceInclExclVatFormatted = sOriginalRetailPriceInclExclVatFormattedSett;\n sDbStockStatusTransl = sDbStockStatusTranslSett;\n sLangStockStatusIsEmpty = sLangStockStatusIsEmptySett;\n sUrlImgSoft_1 = sUrlImgSoft_1Sett;\n sImgFileName_1 = sImgFileName_1Sett;\n iWdtNr_1 = iWdtNr_1Sett;\n iHgtNr_1 = iHgtNr_1Sett;\n bIsImgIsArtItemAutoZoom = bIsImgIsArtItemAutoZoomSett;\n bIsImgIsArtHighslide = bIsImgIsArtHighslideSett;\n iSetupShopSizeNr = iSetupShopSizeNrSett;\n iArtPrmTotalNr = iArtPrmTotalNrSett;\n iArtPrm_DataTotalNr = iArtPrm_DataTotalNrSett;\n sArtManufacturerModelId = sArtManufacturerModelIdSett;\n}", "title": "" }, { "docid": "7e66ff1a9d452cd1efc7f60ece85f3e7", "score": "0.4385708", "text": "function generateArrayColors(){\n var thisDocument = require('sketch/dom').getSelectedDocument();\n\n //try{var =}catch{=0;}\n\n //brand pallete\n try{var primary_color=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Brand/Primary/Base\")[0].style.fills[0].color);}catch{primary_color=0;}\n try{var secondary_color=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Brand/Secondary/Base\")[0].style.fills[0].color);}catch{secondary_color=0;}\n //semantic pallete\n try{var color_info=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Info/Base\")[0].style.fills[0].color);}catch{color_info=0;}\n try{var color_info_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Info/Light\")[0].style.fills[0].color);}catch{color_info_light=0;}\n try{var color_success=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Success/Base\")[0].style.fills[0].color);}catch{color_success=0;}\n try{var color_success_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Success/Light\")[0].style.fills[0].color);}catch{color_success_light=0;}\n try{var color_warning=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Warning/Base\")[0].style.fills[0].color);}catch{color_warning=0;}\n try{var color_warning_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Warning/Light\")[0].style.fills[0].color);}catch{color_warning_light=0;}\n try{var color_error=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Error/Base\")[0].style.fills[0].color);}catch{color_error=0;}\n try{var color_error_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Semantic/Error/Light\")[0].style.fills[0].color);}catch{color_error_light=0;}\n //neutral pallete\n try{var color_neutral_0=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 0\")[0].style.fills[0].color);}catch{color_neutral_0=0;}\n try{var color_neutral_1=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 1\")[0].style.fills[0].color);}catch{color_neutral_1=0;}\n try{var color_neutral_2=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 2\")[0].style.fills[0].color);}catch{color_neutral_2=0;}\n try{var color_neutral_3=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 3\")[0].style.fills[0].color);}catch{color_neutral_3=0;}\n try{var color_neutral_4=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 4\")[0].style.fills[0].color);}catch{color_neutral_4=0;}\n try{var color_neutral_5=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 5\")[0].style.fills[0].color);}catch{color_neutral_5=0;}\n try{var color_neutral_6=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 6\")[0].style.fills[0].color);}catch{color_neutral_6=0;}\n try{var color_neutral_7=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 7\")[0].style.fills[0].color);}catch{color_neutral_7=0;}\n try{var color_neutral_8=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 8\")[0].style.fills[0].color);}catch{color_neutral_8=0;}\n try{var color_neutral_9=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 9\")[0].style.fills[0].color);}catch{color_neutral_9=0;}\n try{var color_neutral_10=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Neutral/Neutral 10\")[0].style.fills[0].color);}catch{color_neutral_10=0;}\n //extended base pallete - red\n try{var color_red_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Darkest\")[0].style.fills[0].color);}catch{color_red_darkest=0;}\n try{var color_red_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Darker\")[0].style.fills[0].color);}catch{color_red_darker=0;}\n try{var color_red_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Dark\")[0].style.fills[0].color);}catch{color_red_dark=0;}\n try{var color_red=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Base\")[0].style.fills[0].color);}catch{color_red=0;}\n try{var color_red_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Light\")[0].style.fills[0].color);}catch{color_red_light=0;}\n try{var color_red_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Lighter\")[0].style.fills[0].color);}catch{color_red_lighter=0;}\n try{var color_red_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Red/Lightest\")[0].style.fills[0].color);}catch{color_red_lightest=0;}\n //extended base pallete - orange\n try{var color_orange_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Darkest\")[0].style.fills[0].color);}catch{color_orange_darkest=0;}\n try{var color_orange_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Darker\")[0].style.fills[0].color);}catch{color_orange_darker=0;}\n try{var color_orange_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Dark\")[0].style.fills[0].color);}catch{color_orange_dark=0;}\n try{var color_orange=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Base\")[0].style.fills[0].color);}catch{color_orange=0;}\n try{var color_orange_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Light\")[0].style.fills[0].color);}catch{color_orange_light=0;}\n try{var color_orange_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Lighter\")[0].style.fills[0].color);}catch{color_orange_lighter=0;}\n try{var color_orange_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Orange/Lightest\")[0].style.fills[0].color);}catch{color_orange_lightest=0;}\n //extended base pallete - yellow\n try{var color_yellow_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Darkest\")[0].style.fills[0].color);}catch{color_yellow_darkest=0;}\n try{var color_yellow_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Darker\")[0].style.fills[0].color);}catch{color_yellow_darker=0;}\n try{var color_yellow_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Dark\")[0].style.fills[0].color);}catch{color_yellow_dark=0;}\n try{var color_yellow=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Base\")[0].style.fills[0].color);}catch{color_yellow=0;}\n try{var color_yellow_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Light\")[0].style.fills[0].color);}catch{color_yellow_light=0;}\n try{var color_yellow_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Lighter\")[0].style.fills[0].color);}catch{color_yellow_lighter=0;}\n try{var color_yellow_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Yellow/Lightest\")[0].style.fills[0].color);}catch{color_yellow_lightest=0;}\n //extended base pallete - lime\n try{var color_lime_darkest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Darkest')[0].style.fills[0].color);}catch{color_lime_darkest=0;}\n try{var color_lime_darker=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Darker')[0].style.fills[0].color);}catch{color_lime_darker=0;}\n try{var color_lime_dark=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Dark')[0].style.fills[0].color);}catch{color_lime_dark=0;}\n try{var color_lime=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Base')[0].style.fills[0].color);}catch{color_lime=0;}\n try{var color_lime_light=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Light')[0].style.fills[0].color);}catch{color_lime_light=0;}\n try{var color_lime_lighter=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Lighter')[0].style.fills[0].color);}catch{color_lime_lighter=0;}\n try{var color_lime_lightest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Lime/Lightest')[0].style.fills[0].color);}catch{color_lime_lightest=0;}\n //extended base pallete - green\n try{var color_green_darkest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Darkest')[0].style.fills[0].color);}catch{color_green_darkest=0;}\n try{var color_green_darker=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Darker')[0].style.fills[0].color);}catch{color_green_darker=0;}\n try{var color_green_dark=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Dark')[0].style.fills[0].color);}catch{color_green_dark=0;}\n try{var color_green=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Base')[0].style.fills[0].color);}catch{color_green=0;}\n try{var color_green_light=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Light')[0].style.fills[0].color);}catch{color_green_light=0;}\n try{var color_green_lighter=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Lighter')[0].style.fills[0].color);}catch{color_green_lighter=0;}\n try{var color_green_lightest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Green/Lightest')[0].style.fills[0].color);}catch{color_green_lightest=0;}\n //extended base pallete - teal\n try{var color_teal_darkest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Darkest')[0].style.fills[0].color);}catch{color_teal_darkest=0;}\n try{var color_teal_darker=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Darker')[0].style.fills[0].color);}catch{color_teal_darker=0;}\n try{var color_teal_dark=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Dark')[0].style.fills[0].color);}catch{color_teal_dark=0;}\n try{var color_teal=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Base')[0].style.fills[0].color);}catch{color_teal=0;}\n try{var color_teal_light=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Light')[0].style.fills[0].color);}catch{color_teal_light=0;}\n try{var color_teal_lighter=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Lighter')[0].style.fills[0].color);}catch{color_teal_lighter=0;}\n try{var color_teal_lightest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Teal/Lightest')[0].style.fills[0].color);}catch{color_teal_lightest=0;}\n //extended base pallete - cyan\n try{var color_cyan_darkest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Darkest')[0].style.fills[0].color);}catch{color_cyan_darkest=0;}\n try{var color_cyan_darker=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Darker')[0].style.fills[0].color);}catch{color_cyan_darker=0;}\n try{var color_cyan_dark=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Dark')[0].style.fills[0].color);}catch{color_cyan_dark=0;}\n try{var color_cyan=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Base')[0].style.fills[0].color);}catch{color_cyan=0;}\n try{var color_cyan_light=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Light')[0].style.fills[0].color);}catch{color_cyan_light=0;}\n try{var color_cyan_lighter=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Lighter')[0].style.fills[0].color);}catch{color_cyan_lighter=0;}\n try{var color_cyan_lightest=trimHexadecimal(thisDocument.getLayersNamed('Color | Fill Colors/Extended/Cyan/Lightest')[0].style.fills[0].color);}catch{color_cyan_lightest=0;}\n //extended base pallete - blue\n try{var color_blue_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Darkest\")[0].style.fills[0].color);}catch{color_blue_darkest=0;}\n try{var color_blue_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Darker\")[0].style.fills[0].color);}catch{color_blue_darker=0;}\n try{var color_blue_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Dark\")[0].style.fills[0].color);}catch{color_blue_dark=0;}\n try{var color_blue=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Base\")[0].style.fills[0].color);}catch{color_blue=0;}\n try{var color_blue_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Light\")[0].style.fills[0].color);}catch{color_blue_light=0;}\n try{var color_blue_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Lighter\")[0].style.fills[0].color);}catch{color_blue_lighter=0;}\n try{var color_blue_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Blue/Lightest\")[0].style.fills[0].color);}catch{color_blue_lightest=0;}\n //extended base pallete - indigo\n try{var color_indigo_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Darkest\")[0].style.fills[0].color);}catch{color_indigo_darkest=0;}\n try{var color_indigo_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Darker\")[0].style.fills[0].color);}catch{color_indigo_darker=0;}\n try{var color_indigo_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Dark\")[0].style.fills[0].color);}catch{color_indigo_dark=0;}\n try{var color_indigo=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Base\")[0].style.fills[0].color);}catch{color_indigo=0;}\n try{var color_indigo_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Light\")[0].style.fills[0].color);}catch{color_indigo_light=0;}\n try{var color_indigo_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Lighter\")[0].style.fills[0].color);}catch{color_indigo_lighter=0;}\n try{var color_indigo_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Indigo/Lightest\")[0].style.fills[0].color);}catch{color_indigo_lightest=0;}\n //extended base pallete - violet\n try{var color_violet_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Darkest\")[0].style.fills[0].color);}catch{color_violet_darkest=0;}\n try{var color_violet_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Darker\")[0].style.fills[0].color);}catch{color_violet_darker=0;}\n try{var color_violet_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Dark\")[0].style.fills[0].color);}catch{color_violet_dark=0;}\n try{var color_violet=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Base\")[0].style.fills[0].color);}catch{color_violet=0;}\n try{var color_violet_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Light\")[0].style.fills[0].color);}catch{color_violet_light=0;}\n try{var color_violet_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Lighter\")[0].style.fills[0].color);}catch{color_violet_lighter=0;}\n try{var color_violet_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Violet/Lightest\")[0].style.fills[0].color);}catch{color_violet_lightest=0;}\n //extended base pallete - grape\n try{var color_grape_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Darkest\")[0].style.fills[0].color);}catch{color_grape_darkest=0;}\n try{var color_grape_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Darker\")[0].style.fills[0].color);}catch{color_grape_darker=0;}\n try{var color_grape_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Dark\")[0].style.fills[0].color);}catch{color_grape_dark=0;}\n try{var color_grape=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Base\")[0].style.fills[0].color);}catch{color_grape=0;}\n try{var color_grape_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Light\")[0].style.fills[0].color);}catch{color_grape_light=0;}\n try{var color_grape_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Lighter\")[0].style.fills[0].color);}catch{color_grape_lighter=0;}\n try{var color_grape_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Grape/Lightest\")[0].style.fills[0].color);}catch{color_grape_lightest=0;}\n //extended base pallete - pink\n try{var color_pink_darkest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Darkest\")[0].style.fills[0].color);}catch{color_pink_darkest=0;}\n try{var color_pink_darker=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Darker\")[0].style.fills[0].color);}catch{color_pink_darker=0;}\n try{var color_pink_dark=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Dark\")[0].style.fills[0].color);}catch{color_pink_dark=0;}\n try{var color_pink=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Base\")[0].style.fills[0].color);}catch{color_pink=0;}\n try{var color_pink_light=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Light\")[0].style.fills[0].color);}catch{color_pink_light=0;}\n try{var color_pink_lighter=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Lighter\")[0].style.fills[0].color);}catch{color_pink_lighter=0;}\n try{var color_pink_lightest=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Fill Colors/Extended/Pink/Lightest\")[0].style.fills[0].color);}catch{color_pink_lightest=0;}\n //shadows/elevation\n var shadow_none = \"none\";\n var shadow_xs = createAttribute_Shadow('Shadows/XS');\n var shadow_s = createAttribute_Shadow('Shadows/S');\n var shadow_m = createAttribute_Shadow('Shadows/M');\n var shadow_l = createAttribute_Shadow('Shadows/L');\n var shadow_xl = createAttribute_Shadow('Shadows/XL');\n //spacing\n var space_none = 0;\n try{var space_xs=thisDocument.getLayersNamed(\"Spacing/XS\")[0].frame.width;}catch{space_xs=0;}\n try{var space_s=thisDocument.getLayersNamed(\"Spacing/S\")[0].frame.width;}catch{space_s=0;}\n try{var space_base=thisDocument.getLayersNamed(\"Spacing/Base\")[0].frame.width;}catch{space_base=0;}\n try{var space_m=thisDocument.getLayersNamed(\"Spacing/M\")[0].frame.width;}catch{space_m=0;}\n try{var space_l=thisDocument.getLayersNamed(\"Spacing/L\")[0].frame.width;}catch{space_l=0;}\n try{var space_xl=thisDocument.getLayersNamed(\"Spacing/XL\")[0].frame.width;}catch{space_xl=0;}\n try{var space_xxl=thisDocument.getLayersNamed(\"Spacing/XXL\")[0].frame.width;}catch{space_xxl=0;}\n //border sizes\n var border_size_none = 0;\n try{var border_size_s=thisDocument.getLayersNamed(\"Border/S\")[0].style.borders[0].thickness;}catch{border_size_s=0;}\n try{var border_size_m=thisDocument.getLayersNamed(\"Border/M\")[0].style.borders[0].thickness;}catch{border_size_m=0;}\n try{var border_size_l=thisDocument.getLayersNamed(\"Border/L\")[0].style.borders[0].thickness;}catch{border_size_l=0;}\n //border radius\n var border_radius_none = 0;\n try{var border_radius_soft=thisDocument.getLayersNamed(\"Border/Shapes/Soft\")[0].points[0].cornerRadius;}catch{border_radius_soft=0;}\n try{var border_radius_rounded=thisDocument.getLayersNamed(\"Border/Shapes/Rounded\")[0].points[0].cornerRadius;}catch{border_radius_rounded=0;}\n var border_radius_circle = \"100%\"; \n //layout stuff\n try{var header_color=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Layout Colors/Header Background\")[0].style.fills[0].color);}catch{header_color=0;}\n try{var color_background_body=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Layout Colors/Content Background\")[0].style.fills[0].color);}catch{color_background_body=0;}\n try{var color_background_login=trimHexadecimal(thisDocument.getLayersNamed(\"Color | Layout Colors/Login Background\")[0].style.fills[0].color);}catch{color_background_login=0;}\n try{var header_size=thisDocument.getLayersNamed(\"Layout/Navigation/Top Menu/Desktop\")[0].frame.height;}catch{header_size=0;}\n //typography\n try{var font_family=thisDocument.getLayersNamed(\"Typography | Typeface\")[0].style.fontFamily;}catch{font_family=0;}\n var fontValue = 0;\n try{fontValue=thisDocument.getLayersNamed(\"Typography | FontWeight/Light\")[0].style.fontWeight}catch{fontValue=0;}\n var font_light = validateFontWeight(fontValue);\n try{fontValue=thisDocument.getLayersNamed(\"Typography | FontWeight/Regular\")[0].style.fontWeight}catch{fontValue=0;}\n var font_regular = validateFontWeight(fontValue);\n try{fontValue=thisDocument.getLayersNamed(\"Typography | FontWeight/Semibold\")[0].style.fontWeight}catch{fontValue=0;}\n var font_semi_bold = validateFontWeight(fontValue);\n try{fontValue=thisDocument.getLayersNamed(\"Typography | FontWeight/Bold\")[0].style.fontWeight}catch{fontValue=0;}\n var font_bold = validateFontWeight(fontValue);\n //font sizes desktop\n try{var font_size_display_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/Display\")[0].style.fontSize;}catch{font_size_display_desktop=0;}\n try{var font_size_h1_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/H1\")[0].style.fontSize;}catch{font_size_h1_desktop=0;}\n try{var font_size_h2_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/H2\")[0].style.fontSize;}catch{font_size_h2_desktop=0;}\n try{var font_size_h3_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/H3\")[0].style.fontSize;}catch{font_size_h3_desktop=0;}\n try{var font_size_h4_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/H4\")[0].style.fontSize;}catch{font_size_h4_desktop=0;}\n try{var font_size_h5_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/H5\")[0].style.fontSize;}catch{font_size_h5_desktop=0;}\n try{var font_size_h6_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/H6\")[0].style.fontSize;}catch{font_size_h6_desktop=0;}\n try{var font_size_base_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/Body\")[0].style.fontSize;}catch{font_size_base_desktop=0;}\n try{var font_size_s_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/Body S\")[0].style.fontSize;}catch{font_size_s_desktop=0;}\n try{var font_size_xs_desktop=thisDocument.getLayersNamed(\"Typography | Font Size/Desktop/Body XS\")[0].style.fontSize;}catch{font_size_xs_desktop=0;}\n //font sizes tablet\n try{var font_size_display_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/Display\")[0].style.fontSize;}catch{font_size_display_tablet=0;}\n try{var font_size_h1_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/H1\")[0].style.fontSize;}catch{font_size_h1_tablet=0;}\n try{var font_size_h2_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/H2\")[0].style.fontSize;}catch{font_size_h2_tablet=0;}\n try{var font_size_h3_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/H3\")[0].style.fontSize;}catch{font_size_h3_tablet=0;}\n try{var font_size_h4_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/H4\")[0].style.fontSize;}catch{font_size_h4_tablet=0;}\n try{var font_size_h5_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/H5\")[0].style.fontSize;}catch{font_size_h5_tablet=0;}\n try{var font_size_h6_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/H6\")[0].style.fontSize;}catch{font_size_h6_tablet=0;}\n try{var font_size_base_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/Body\")[0].style.fontSize;}catch{font_size_base_tablet=0;}\n try{var font_size_s_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/Body S\")[0].style.fontSize;}catch{font_size_s_tablet=0;}\n try{var font_size_xs_tablet=thisDocument.getLayersNamed(\"Typography | Font Size/Tablet/Body XS\")[0].style.fontSize;}catch{font_size_xs_tablet=0;}\n //font sizes phone\n try{var font_size_display_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/Display\")[0].style.fontSize;}catch{font_size_display_phone=0;}\n try{var font_size_h1_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/H1\")[0].style.fontSize;}catch{font_size_h1_phone=0;}\n try{var font_size_h2_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/H2\")[0].style.fontSize;}catch{font_size_h2_phone=0;}\n try{var font_size_h3_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/H3\")[0].style.fontSize;}catch{font_size_h3_phone=0;}\n try{var font_size_h4_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/H4\")[0].style.fontSize;}catch{font_size_h4_phone=0;}\n try{var font_size_h5_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/H5\")[0].style.fontSize;}catch{font_size_h5_phone=0;}\n try{var font_size_h6_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/H6\")[0].style.fontSize;}catch{font_size_h6_phone=0;}\n try{var font_size_base_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/Body\")[0].style.fontSize;}catch{font_size_base_phone=0;}\n try{var font_size_s_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/Body S\")[0].style.fontSize;}catch{font_size_s_phone=0;}\n try{var font_size_xs_phone=thisDocument.getLayersNamed(\"Typography | Font Size/Phone/Body XS\")[0].style.fontSize;}catch{font_size_xs_phone=0;}\n //extra stuff that we need to send to plugin\n try{var search_input_padding=thisDocument.getLayersNamed(\"03. Interaction / 11. Search/Desktop\")[0].layers[1].frame.x;}catch{search_input_padding=0;}\n try{var alert_border_radius=thisDocument.getLayersNamed(\"Symbol | Content / Card / Background\")[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{alert_border_radius=0;}\n try{var btn_border_radius=thisDocument.getLayersNamed(\"07. Widgets/01. Buttons/Primary Button/Default\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{btn_border_radius=0;}\n try{var form_control_data_input=thisDocument.getLayersNamed(\"07. Widgets/ 06. Input / Desktop / Basic\")[0].layers[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{form_control_data_input=0;}\n try{var tag_border_radius=thisDocument.getLayersNamed(\"02. Content / 08. Tag / Default\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{tag_border_radius=0;}\n try{var search_border_radius=thisDocument.getLayersNamed(\"03. Interaction / 11. Search/Desktop\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{search_border_radius=0;}\n try{var choices_item=thisDocument.getLayersNamed(\"03. Interaction / 07. Dropdown Tags / Isolated/ Active\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius}catch{choices_item=0;}\n try{var choices_inner=thisDocument.getLayersNamed(\"03. Interaction/06. Dropdown Search/Desktop/Basic\")[0].layers[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius}catch{choices_inner=0;}\n try{var checkbox=thisDocument.getLayersNamed(\"07. Widgets/03. Checkbox / Checkbox / Normal\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{checkbox=0;}\n try{var button_group=thisDocument.getLayersNamed(\"07. Widgets/03. Checkbox / Checkbox / Normal\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{button_group=0;}\n try{var calendar=thisDocument.getLayersNamed(\"03. Interaction / 04. Date Picker / Pieces / Selected Day\")[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{calendar=0;}\n try{var pagination=thisDocument.getLayersNamed(\"04. Navigation / 05. Pagination / Shape 5+/ Mobile\")[0].overrides[2].affectedLayer.points[0].cornerRadius;}catch{pagination=0;}\n try{var dropdown=thisDocument.getLayersNamed(\"07. Widgets/04. Dropdown/Desktop/Basic\")[0].layers[0].layers[0].overrides[0].affectedLayer.points[0].cornerRadius;}catch{dropdown=0;}\n //get colors for login form box\n try{var color_background_login_form=trimHexadecimal(thisDocument.getLayersNamed(\"Layout / Login / Center\")[0].layers[1].layers[0].layers[0].style.fills[0].color);}catch{color_background_login_form=0;}\n try{var color_animated_text_login_form=trimHexadecimal(thisDocument.getLayersNamed(\"Layout / Login / Center\")[0].layers[1].layers[5].layers[1].style.textColor);}catch{color_animated_text_login_form=0;}\n try{var color_label_login_form=trimHexadecimal(thisDocument.getLayersNamed(\"Layout / Login / Center / Checkbox Text\")[0].style.textColor);}catch{color_label_login_form=0;}\n try{var color_link_login_form=trimHexadecimal(thisDocument.getLayersNamed(\"Layout / Login / Center / Link\")[0].style.textColor);}catch{color_link_login_form=0;}\n try{var color_title_login_form=trimHexadecimal(thisDocument.getLayersNamed(\"Layout / Login / Center / Title\")[0].style.textColor);}catch{color_title_login_form=0;}\n \n //array with all values that will be sent yo webview\n var array_value = {\n primary_color,secondary_color,color_info,color_info_light,color_success,color_success_light,color_warning,color_warning_light,color_error,color_error_light,color_neutral_0,color_neutral_1,color_neutral_2,color_neutral_3,color_neutral_4,color_neutral_5,color_neutral_6,color_neutral_7,color_neutral_8,color_neutral_9,color_neutral_10,color_red_darkest,color_red_darker,color_red_dark,color_red,color_red_light,color_red_lighter,color_red_lightest,color_orange_darkest,color_orange_darker,color_orange_dark,color_orange,color_orange_light,color_orange_lighter,color_orange_lightest,color_yellow_darkest,color_yellow_darker,color_yellow_dark,color_yellow,color_yellow_light,color_yellow_lighter,color_yellow_lightest,color_lime_darkest,color_lime_darker,color_lime_dark,color_lime,color_lime_light,color_lime_lighter,color_lime_lightest,color_green_darkest,color_green_darker,color_green_dark,color_green,color_green_light,color_green_lighter,color_green_lightest,color_teal_darkest,color_teal_darker,color_teal_dark,color_teal,color_teal_light,color_teal_lighter,color_teal_lightest,color_cyan_darkest,color_cyan_darker,color_cyan_dark,color_cyan,color_cyan_light,color_cyan_lighter,color_cyan_lightest,color_blue_darkest,color_blue_darker,color_blue_dark,color_blue,color_blue_light,color_blue_lighter,color_blue_lightest,color_indigo_darkest,color_indigo_darker,color_indigo_dark,color_indigo,color_indigo_light,color_indigo_lighter,color_indigo_lightest,color_violet_darkest,color_violet_darker,color_violet_dark,color_violet,color_violet_light,color_violet_lighter,color_violet_lightest,color_grape_darkest,color_grape_darker,color_grape_dark,color_grape,color_grape_light,color_grape_lighter,color_grape_lightest,color_pink_darkest,color_pink_darker,color_pink_dark,color_pink,color_pink_light,color_pink_lighter,color_pink_lightest,shadow_none, shadow_xs, shadow_s, shadow_m, shadow_l, shadow_xl,space_none, space_s, space_xs, space_base, space_m, space_l, space_xl, space_xxl,border_size_none, border_size_s, border_size_m, border_size_l,border_radius_none, border_radius_soft, border_radius_rounded, border_radius_circle,header_color, color_background_body, header_size, color_background_login,font_family, font_light, font_regular, font_semi_bold, font_bold,font_size_display_desktop, font_size_h1_desktop, font_size_h2_desktop, font_size_h3_desktop, font_size_h4_desktop, font_size_h5_desktop, font_size_h6_desktop, font_size_base_desktop, font_size_s_desktop, font_size_xs_desktop,font_size_display_tablet, font_size_h1_tablet, font_size_h2_tablet, font_size_h3_tablet, font_size_h4_tablet, font_size_h5_tablet, font_size_h6_tablet, font_size_base_tablet, font_size_s_tablet, font_size_xs_tablet,font_size_display_phone, font_size_h1_phone, font_size_h2_phone, font_size_h3_phone, font_size_h4_phone, font_size_h5_phone, font_size_h6_phone, font_size_base_phone, font_size_s_phone, font_size_xs_phone,\n search_input_padding, alert_border_radius, btn_border_radius, form_control_data_input, \n tag_border_radius, search_border_radius, choices_item, choices_inner, checkbox, button_group, calendar, pagination, dropdown,\n color_background_login_form, color_animated_text_login_form, color_label_login_form, color_link_login_form, color_title_login_form\n };\n\n return JSON.stringify(array_value); //string to send to webview\n\n}", "title": "" }, { "docid": "0749380518fa11bbd4eb3b9e0e10df52", "score": "0.43853092", "text": "makeSurface() {\n var nurbsSurface = new CGFnurbsSurface(this.degree1, this.degree2, this.controlVertexes);\n this.patch = new CGFnurbsObject(this.scene, this.nparts_u, this.nparts_v, nurbsSurface);\n }", "title": "" }, { "docid": "a704c4c8791e2a7af80e67df956e01e1", "score": "0.43816882", "text": "set vertices(value) {}", "title": "" }, { "docid": "060e21c69ca6a204ca6fcdd9932f6490", "score": "0.43777427", "text": "function GameObjectSet() {\n this.mSet = [];\n}", "title": "" }, { "docid": "5f58cbb4360e4ff9bbb183ea7e1ab1c5", "score": "0.4372091", "text": "layoutRadial(nodeSet, linkSet, root) {\n var adjustPosition, allowedTurtleIDs, lastNode, layerGap, maxDepth, maxPxcor, maxPycor, minPxcor, minPycor, nodeTable, queue, rootNode, rootX, rootY, turtleIsAllowed, visitNeighbors, xDistToEdge, yDistToEdge;\n ({maxPxcor, maxPycor, minPxcor, minPycor} = this._world.topology);\n rootX = (maxPxcor + minPxcor) / 2;\n rootY = (maxPycor + minPycor) / 2;\n rootNode = new TreeNode(root, 0);\n queue = [rootNode];\n nodeTable = {};\n nodeTable[rootNode.getTurtle().id] = rootNode;\n turtleIsAllowed = linkSet.getSpecialName() == null ? (allowedTurtleIDs = pipeline(flatMap(function({end1, end2}) {\n return [end1, end2];\n }), foldl(function(acc, {id}) {\n acc[id] = true;\n return acc;\n })({}))(linkSet.toArray()), function({id}) {\n return allowedTurtleIDs[id] === true;\n }) : function() {\n return true;\n };\n visitNeighbors = function(queue, last) {\n var node;\n if (queue.length === 0) {\n return last;\n } else {\n node = queue.shift();\n node.getTurtle().linkManager.neighborsIn(linkSet).forEach(function(t) {\n var child;\n if (nodeSet.contains(t) && (nodeTable[t.id] == null) && turtleIsAllowed(t)) {\n child = new TreeNode(t, node.getDepth() + 1);\n node.addChild(child);\n nodeTable[t.id] = child;\n queue.push(child);\n }\n });\n return visitNeighbors(queue, node);\n }\n };\n lastNode = visitNeighbors(queue, rootNode);\n rootNode.layoutRadial(0, 360);\n maxDepth = NLMath.max(1, lastNode.getDepth() + .2);\n xDistToEdge = NLMath.min(maxPxcor - rootX, rootX - minPxcor);\n yDistToEdge = NLMath.min(maxPycor - rootY, rootY - minPycor);\n layerGap = NLMath.min(xDistToEdge, yDistToEdge) / maxDepth;\n adjustPosition = function(node) {\n var turtle;\n turtle = node.getTurtle();\n turtle.setXY(rootX, rootY);\n turtle.setVariable(\"heading\", node.getAngle());\n turtle.jumpIfAble(node.getDepth() * layerGap);\n };\n pipeline(values, forEach(adjustPosition))(nodeTable);\n }", "title": "" }, { "docid": "47956986a7f1d0e3f551e9354aeb5194", "score": "0.43702847", "text": "function setColors(arrayName) {\r\n for (i = 0; i < 8; i++) {\r\n arrayName[i] = [];\r\n for (j = 0; j < 8; j++) {\r\n arrayName[i][j] = allTiles[i][j].color;\r\n }\r\n }\r\n}", "title": "" } ]
cc3ed39034ec3809b5dfe389a40feb2a
Rewind history cursor on the last entry
[ { "docid": "074f8479d342c352377982add8b263b9", "score": "0.7130382", "text": "rewind() {\n this.cursor = this.entries.length;\n }", "title": "" } ]
[ { "docid": "2bf2ae57fa2282bdf613c3d299cd8709", "score": "0.6855379", "text": "prev() {\n this.historyIndex -= 1;\n }", "title": "" }, { "docid": "9997d62d341e8c3514632a236878dc81", "score": "0.6849693", "text": "undo() {\n if (this.history.length) {\n let value = this.history.pop();\n this.next(value, true);\n }\n }", "title": "" }, { "docid": "e08814bf1bcb6d046bf9c629d1a4211f", "score": "0.683623", "text": "function decrementHistoryPosition() {\n if (historyPosition > 0) {\n historyPosition--;\n }\n }", "title": "" }, { "docid": "5cfe90f9ba0166e1b27b416e11ff8a88", "score": "0.67061913", "text": "function resetHistoryPosition() {\n historyPosition = history.length;\n }", "title": "" }, { "docid": "e8fcfab85e9eb6da41275c2b3e51f28e", "score": "0.6681077", "text": "function onRewind() {\n\t\t\tif (agent[obs_override] == true) {\n\t\t\t\t//agent[obs_] = true;\n\t\t\t\t//agent[obs_next] = false;\n\t\t\t} else if (!readonly && scriptagent.canUndo()) {\n\t\t\t\twhile (scriptagent.canUndo()) scriptagent.undo();\n\t\t\t\tintextarea.value = scriptagent.snapshot;\n\t\t\t\tupdateEntireHighlight(true);\n\t\t\t\tupdateHistoryButtons();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "de2e550632f4aaf52b11af159d39b60b", "score": "0.66487944", "text": "cycleForward() {\n // cycle command history forward\n if (this.current > 0) {\n this.current--;\n this.root.value = this.history[this.history.length - this.current - 1];\n } else if (this.current === 0) {\n // recall the current entry if they had typed something already\n this.current = -1;\n this.root.value = this.save_current;\n }\n }", "title": "" }, { "docid": "f928df255bbacf510ec14b299bacf12a", "score": "0.6616278", "text": "function back() {\n if (history.length > 1) {\n setHistory([...history.slice(0, -1)]);\n // set the mode to the previous item in our history array, second to last\n setMode(history[history.length - 2]);\n }\n }", "title": "" }, { "docid": "5147710ea8f44a0fb8a3e0b0a19a9619", "score": "0.6570979", "text": "function back() {\n if (history.length > 1) {\n history.pop(); //remove last item from history stack\n setMode(history[history.length - 1]); //setMode with last item in history stack\n }\n }", "title": "" }, { "docid": "3509b0cd41a89614cd1294aa95a326ad", "score": "0.65510076", "text": "cycleBackward() {\n // save the current entry in case we come back\n if (this.current < 0) {\n this.save_current = this.root.value;\n }\n \n // cycle command history backward\n if (this.current < this.history.length - 1) {\n this.current++;\n this.root.value = this.history[this.history.length - this.current - 1];\n }\n }", "title": "" }, { "docid": "1d74f3d54b77f7a5bac3e45cdc4c27ee", "score": "0.64923614", "text": "replaceLastPush () {\n this._history = this.getHistory()\n this._current = this.getCurrent()\n\n this._history.splice(this._current - 1, 1)\n this._current = this._current - 1\n\n this.save()\n }", "title": "" }, { "docid": "4a8853ab5174675bb0c64a1ec1a5218e", "score": "0.64371306", "text": "function back() {\n if (history.length === 1) {\n return;\n }\n setHistory(([_, ...newHistory]) => newHistory);\n }", "title": "" }, { "docid": "9cc7ef68925f6106a18f11982b82927f", "score": "0.6404079", "text": "function incrementHistoryPosition() {\n if (historyPosition < history.length) {\n historyPosition++;\n }\n }", "title": "" }, { "docid": "3f9bae9863e182cd70989f3d2aa21c64", "score": "0.63939023", "text": "updateHistory(){\n this._clearHistory = false;\n }", "title": "" }, { "docid": "d717c1934b14e55189bbd782dd6de490", "score": "0.63066524", "text": "function back (){\n if (history.length > 1) {\n const prevMode = history[history.length-2];\n setHistory(history.slice(0, history.length-1));\n setMode(prevMode);\n }\n }", "title": "" }, { "docid": "b05d8907864c8707e79f445b8bd8c53b", "score": "0.6303969", "text": "function history_undo(){\n\tif(history_past.length < 2)\n\t\treturn;\n\t\n\t//add the currently displayed result to the redo stack\n\tredo_stack.push(history_past.pop());\n\tvar previous = history_past[history_past.length - 1];\n\twriteEverything(previous);\n\t\n\t// enable redo_nappi\n\tdocument.getElementById(\"redo_nappi\").disabled = false;\n\t//history exists, enable undo_nappi\n\tif(history_past.length < 2)\n\t\tdocument.getElementById(\"undo_nappi\").disabled = true;\n}", "title": "" }, { "docid": "67bc48ad62680817ebbdf19db434dc8a", "score": "0.62887067", "text": "function redoHistory() {\n\t\tif (HISTORY.p === HISTORY.l) return;\n\t\t\n\t\tHISTORY.p++;\n\t\tvar item = HISTORY.h[HISTORY.p];\n\t\t\n\t\tif (HISTORY.p === HISTORY.l) $(\"#redo\").attr(\"disabled\", \"disabled\");\n\t\t$(\"#undo\").removeAttr(\"disabled\");\n\t\t\n\t\t// vyhodnoceni typu kroku\n\t\tif (item.action === CHANGE_HISTORY.ACTIONS[\"new\"]) {\n\t\t\t// vytvoreni noveho objektu\n\t\t\tvar newItem = questionary.addItem(item.obj.name(), item.obj.className());\n\t\t\t\n\t\t\t// musime prepsat stare reference na nove\n\t\t\tfor (var i in HISTORY.h) {\n\t\t\t\tif (HISTORY.h[i].obj === item.obj) {\n\t\t\t\t\tHISTORY.h[i].obj = newItem;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"delete\"]) {\n\t\t\t// smazani objektu\n\t\t\tquestionary.removeItem(item.obj);\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"visibility\"]) {\n\t\t\t// vyhodnoceni jestli se ma prvek odkryt nebo skryt\n\t\t\tif (item.params.newStatus) {\n\t\t\t\t// prvek se odkryje\n\t\t\t\tif (item.obj.container()) {\n\t\t\t\t\t// tento pripad teoreticky nemuze ani nastat, ale nechavam zde misto pro necekane situace\n\t\t\t\t} else {\n\t\t\t\t\tvar order = questionary.getItems();\n\t\t\t\t\torder.push(item.obj);\n\t\t\t\t\t\n\t\t\t\t\tquestionary.setOrder(order);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// prvek se skryje\n\t\t\t\tif (item.obj.container()) {\n\t\t\t\t\titem.obj.container().removeItem(item.obj);\n\t\t\t\t} else {\n\t\t\t\t\tquestionary.setRenderable(item.obj, false);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"move\"]) {\n\t\t\t// vygeerovani seznamu prvku\n\t\t\tvar order = new Array();\n\t\t\t\n\t\t\tfor (var i in item.params.itemsNew) {\n\t\t\t\torder.push(questionary.getByName(item.params.itemsNew[i]));\n\t\t\t}\n\t\t\t\n\t\t\t// zapis dat\n\t\t\tif (item.obj) {\n\t\t\t\t// jedna se o kontejner\n\t\t\t\titem.obj.setItems(order);\n\t\t\t} else {\n\t\t\t\tquestionary.setOrder(order);\n\t\t\t}\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"modify\"]) {\n\t\t\titem.obj.setFromArray(item.params.settingsNew);\n\t\t}\n\t\t\n\t\tsendAdd(item);\n\t\t\n\t\trefreshItems();\n\t\trender();\n\t}", "title": "" }, { "docid": "158cf92ef6cd7ec7610069ee91f0ad38", "score": "0.6283628", "text": "function killLastHistoryState()\r{\r // Select the last history state\r var selDesc = new ActionDescriptor();\r var selRef = new ActionReference();\r selRef.putEnumerated( classHistoryState, typeOrdinal, enumLast );\r selDesc.putReference( typeNULL, selRef );\r executeAction( eventSelect, selDesc, DialogModes.NO );\r\r // Nuke it\r var delDesc = new ActionDescriptor();\r var delRef = new ActionReference();\r delRef.putProperty( classHistoryState, keyCurrentHistoryState );\r delDesc.putReference( typeNULL, delRef );\r executeAction( eventDelete, delDesc, DialogModes.NO );\r}", "title": "" }, { "docid": "74da7cdb6639a7ac512b444e3d3b153c", "score": "0.6234105", "text": "undo() {\n let previousSnapshot = this.get('history').pop();\n if (previousSnapshot) {\n this.get('rootNode').innerHTML = previousSnapshot.content;\n this.updateRichNode();\n this.set('currentNode', null);\n this.setCurrentPosition(previousSnapshot.currentSelection[0]);\n this.generateDiffEvents.perform([{noSnapshot: true}]);\n }\n else {\n warn('no more history to undo', {id: 'contenteditable-editor:history-empty'});\n }\n }", "title": "" }, { "docid": "df0a319d6c6bd0b129ea23afe316f55b", "score": "0.6231397", "text": "last() { this.goto(this.size - 1); }", "title": "" }, { "docid": "6522c7754931c381e96fd80769916d6c", "score": "0.62098753", "text": "reset () {\n this._history = []\n this._current = -1\n\n this.save()\n }", "title": "" }, { "docid": "7429a35f8f99f65fe5adb768d8fc7393", "score": "0.6158099", "text": "function undoLastMove() {\n const previousMoves = moveHistory.slice();\n const move = previousMoves.pop();\n setSquares(prevSquares => {\n const squares = prevSquares.slice();\n squares[move] = \"\";\n return squares;\n });\n setIsPlayerX(prevIsPlayerX => {\n return !prevIsPlayerX;\n });\n setMoveHistory(previousMoves);\n }", "title": "" }, { "docid": "6becd315a698ba8dfd411a7a81824a16", "score": "0.6156902", "text": "function redo(history) {\n\t\t debug('redo', { history: history });\n\t\t\n\t\t var past = history.past;\n\t\t var present = history.present;\n\t\t var future = history.future;\n\t\t\n\t\t\n\t\t if (future.length <= 0) return history;\n\t\t\n\t\t return {\n\t\t future: future.slice(1, future.length), // remove element from future\n\t\t present: future[0], // set element as new present\n\t\t past: [].concat(_toConsumableArray(past), [present // old present state is in the past now\n\t\t ])\n\t\t };\n\t\t}", "title": "" }, { "docid": "52f4a609933b09e588b9f83ef96c8740", "score": "0.61135995", "text": "backCursor() {\n this.getFileReader().setCursorToPreviousPosition()\n this.decrementColumn()\n }", "title": "" }, { "docid": "5a782c4a3dee931f545f2a4b88e96775", "score": "0.6095475", "text": "redoTags() {\n this.IncrementTag()\n if (this.redoClick.length !== 0) {\n this.historyClick.push(this.redoClick.pop())\n\n if (this.historyClick.length > 10) {\n this.historyClick.shift()\n }\n console.log(this.historyClick, \"redo\", 'history')\n console.log(this.redoClick, \"redo\", \"redo\")\n }\n }", "title": "" }, { "docid": "9e946f416e2e070f7a5b5a8bf1234d37", "score": "0.60895395", "text": "function last(){\n index--;\n index = (index < 0)? queue.length - 1 : index;\n resetSource()\n }", "title": "" }, { "docid": "90f25bd6b9c2d1a12ff37eaaac320202", "score": "0.6086471", "text": "next() {\n this.historyIndex += 1;\n }", "title": "" }, { "docid": "288e4799367fb3f433c9cfebcc5b1914", "score": "0.6066965", "text": "function last (app) {\n setData(app, {\n ...getData(app),\n current: getLength(app) - 1,\n });\n}", "title": "" }, { "docid": "ac1988c09af8376917197625a8a836e5", "score": "0.5986751", "text": "setFocusToLastItem() {\n const lastNode = this.treedata.findLastNodeToFocus();\n if (lastNode && lastNode.index !== -1) {\n this.setFocusToItem(lastNode);\n }\n }", "title": "" }, { "docid": "6608112648a9caa2482e8ee2e02ca793", "score": "0.5983123", "text": "undoTags() {\n\n this.deIncrementTag()\n\n\n if (this.historyClick.length !== 0) {\n this.redoClick.push(this.historyClick.pop())\n\n if (this.redoClick.length > 10) {\n this.redoClick.shift()\n }\n\n }\n\n\n }", "title": "" }, { "docid": "c241adef1b1dc54a0c7752c18fd2e789", "score": "0.5971098", "text": "function resetChatHistory() {\n $(\"#txtChat\").attr(\"data-hist-index\", \"-1\");\n }", "title": "" }, { "docid": "339a527b408b641dc813929cf5962ba8", "score": "0.59496874", "text": "function undo() {\n var at = world_ref.value.get(\"at\");\n if (at > 0)\n reset(world_ref, world_ref.value.set(\"at\", at-1));\n}", "title": "" }, { "docid": "2a43e65dca8ae66eed52af46fea7f102", "score": "0.5938013", "text": "function manageHistory(loc, historyArr) {\n if (historyArr.length >= MAX_HISTORY_LENGTH) {\n historyArr.splice(0, 1);\n }\n \n historyArr.push(loc);\n return cursorHistory.length - 1;\n }", "title": "" }, { "docid": "f56507a2463b82b337ec26b5960e2a9d", "score": "0.5927783", "text": "clearHistory() {\n this.history = [];\n this.save_current = '';\n this.current = -1;\n }", "title": "" }, { "docid": "396488a7f503f50720395fa86e18e65d", "score": "0.5926964", "text": "reset() {\r\n\t\tthis.actual = this.history[0];\r\n\t}", "title": "" }, { "docid": "5814347faaf1fb70a4716005026f3eea", "score": "0.5917792", "text": "onDisplayEntries() {\n this.props.history.go(-1);\n }", "title": "" }, { "docid": "ea4d845890b38b2d6e919ed704d8a7ff", "score": "0.5907966", "text": "redo() {\n if (this._redoHistory.length === 0) {\n return;\n }\n\n let actionData = this._redoHistory.pop();\n let newData = actionData.function.apply(actionData.context, actionData.args);\n // update undo function\n actionData.undo = newData.undo;\n\n this._undoHistory.push(actionData);\n this._updateHistory();\n }", "title": "" }, { "docid": "870d2142d1a98edc532c25b728b60b90", "score": "0.5903674", "text": "function search_backward(){\n\tif(search_history.length > 1){\n\t\tsearch_history.pop();\n\t\tsearch(search_history.pop());\n\t}\n}", "title": "" }, { "docid": "2523441a9cb048cd0ab60cdd5585e557", "score": "0.59011376", "text": "function redo()\n {\n if(allowedRedo && redoStack.length >= 1)\n {\n jsonVal = arrayCopy(redoStack[redoStack.length - 1]);\n redoStack.pop();\n updateScreenJson(jsonVal);\n allowedRedo = true;\n }\n }", "title": "" }, { "docid": "e650cc6a8003d9d28ef3395399ce6166", "score": "0.5899157", "text": "undo() {\n clearCanvas(this._canvasMain, this._size)\n this._historyIndex = Math.max(this._historyIndex - 1, 0)\n\n if (this._historyIndex >= 0) {\n this.drawActions()\n }\n }", "title": "" }, { "docid": "49884fca3bf26cfebfbc13e5918ddb8e", "score": "0.588049", "text": "function redo(history) {\n\t var past = history.past;\n\t var future = history.future;\n\t var _latestUnfiltered = history._latestUnfiltered;\n\n\n\t if (future.length <= 0) return history;\n\n\t var newPast = _latestUnfiltered != null ? [].concat(_toConsumableArray(past), [_latestUnfiltered]) : past;\n\n\t var newPresent = future[0];\n\t return {\n\t future: future.slice(1, future.length), // remove element from future\n\t present: newPresent, // set element as new present\n\t _latestUnfiltered: newPresent,\n\t past: newPast\n\t };\n\t}", "title": "" }, { "docid": "b4bbc7b75554cf646eab078ef1c5786d", "score": "0.58529335", "text": "_backOnEmptyHistory() {\n\t\tthis.exit();\n\t}", "title": "" }, { "docid": "8496ea1d83c1258ef46f037b8e06334a", "score": "0.5839702", "text": "reset() {\r\n this.now = 'normal';\r\n\r\n this.addHistory();\r\n }", "title": "" }, { "docid": "4e7e2d2d0653c8d011b87fc2e082e71e", "score": "0.58360106", "text": "function revertHistory(){\r\n executeAction( charIDToTypeID( \"Rvrt\" ), undefined, DialogModes.NO );\r\n}// end function------------------------------------------------------", "title": "" }, { "docid": "679b47c4b645ca0fbf26838e38364022", "score": "0.5827588", "text": "undo() {\n if (this._undoHistory.length === 0) {\n return;\n }\n\n let actionData = this._undoHistory.pop();\n actionData.undo.apply(actionData.context);\n\n this._redoHistory.push(actionData);\n this._updateHistory();\n }", "title": "" }, { "docid": "2dca751c2ed7e81c8a45481e554145c3", "score": "0.5805732", "text": "function backfillHistoryState() {\n var newState = null;\n\n jQuery('li.active > [data-tab-history]').each(function () {\n var $activeTabElement = jQuery(this);\n var selector = getTabSelector($activeTabElement);\n\n if(selector) {\n var tabGroup = getTabGroup($activeTabElement);\n\n if(tabGroup) {\n newState = createNewHistoryState(newState || history.state, tabGroup, selector);\n }\n }\n });\n\n if(newState) {\n history.replaceState(newState, '', null);\n }\n }", "title": "" }, { "docid": "dc566b8e7d1dff375a05a106da6b8076", "score": "0.58047545", "text": "clearHistory(){\n this._clearHistory = true;\n }", "title": "" }, { "docid": "c5d29b4220890aab23ea7d39e2ff89b3", "score": "0.5800372", "text": "function undoChange() {\n\tthis.quill.history.undo()\n}", "title": "" }, { "docid": "f280d35fd817c3159d67387dfc4e57c2", "score": "0.57999516", "text": "function historyBottom() {\n\t\treturn _history.length > 0 ? _history[0] : null;\n\t}", "title": "" }, { "docid": "2bb576f358f5f75df6be5f8ec64ece99", "score": "0.5795663", "text": "Back () {\n this.cursor--\n if (this.cursor < 0) {\n this.symbol = null\n return false\n }\n this.symbol = this.data[this.cursor]\n return true\n }", "title": "" }, { "docid": "5d3e5570af26bc7911255982043909d9", "score": "0.5795574", "text": "clearHistory() {\n this.doc.clearHistory();\n }", "title": "" }, { "docid": "7439b134d6116d146a7d144aff5441ac", "score": "0.5787459", "text": "function replayHistory(history) {\n\tif (history.length > 0) {\n\t\tvar state = history.shift();\n\t\tdrawBars(state.arr);\n \tctx.fillStyle = \"#FF0000\";\n\t\tctx.fillRect(state.indices[0]*10, canvas.height-5, 10, 5)\n\t\tctx.fillRect(state.indices[1]*10, canvas.height-5, 10, 5)\n\t}\n}", "title": "" }, { "docid": "fbd9a8fb708fcf6a4d7c487dcf1796cd", "score": "0.5780873", "text": "function updateHistory()\n{\n\tvar i;\n\t\n\tif (actionsHistoryOldestEntry == MAX_ACTIONSHISTORY_ENTRIES)\n\t\ti = MAX_ACTIONSHISTORY_ENTRIES - 1;\n\telse\n\t{\n\t\ti = actionsHistoryOldestEntry;\n\t\tactionsHistoryOldestEntry++;\n\t}\n\t\n\twhile (i > 0)\n\t{\n\t\tactionsHistory[i+1] = actionsHistory[i];\n\t\ti--;\n\t}\n\t\n\tactionsHistory[0] = decision;\n}", "title": "" }, { "docid": "37785a9c267d1e9b536aa825c89941df", "score": "0.57791066", "text": "function redo() {\r\n let nextState;\r\n\r\n if (currentIndex + 1 < history.length) {\r\n currentIndex++;\r\n nextState = history[currentIndex];\r\n\r\n // load state\r\n graph.importGraph(nextState);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "fbfed49fc8c2d20b2dde24275c6f6d19", "score": "0.5775399", "text": "function rt_prev_msg(element_id)\r\n{\r\n // don't try and scroll backwards before start\r\n if (rt_history_cursor <= 1)\r\n {\r\n return;\r\n }\r\n\r\n rt_history_cursor--;\r\n\r\n document.getElementById(element_id).value = rt_send_history[rt_history_cursor-1];\r\n}", "title": "" }, { "docid": "36d2f3f5d5ca5bfeffe95036faf22e17", "score": "0.5774352", "text": "function back(){\n\t//We're at the start of the list, do nothing\n\tif(pokemonId === 0){\n\t\treturn;\n\t}\n\t//Move backward\n\tpokemonId--;\n}", "title": "" }, { "docid": "d91255c3491faec6a4886fc815f3eaaf", "score": "0.57736516", "text": "function undoLastMove(){\n if($('table tr:nth-child('+ (currPos[1]+1) +') td:nth-child('+ (currPos[0]+1) +').cell').hasClass(\"purple\")) {\n $('table tr:nth-child('+ (currPos[1]+1) +') td:nth-child('+ (currPos[0]+1) +').cell').removeClass(\"purple\");\n }\n currPos = stackMove.pop();\n stackCount--;\n $('h2#counter-desc').html((14-stackCount)+'x');\n autoConnectorAlert();\n}", "title": "" }, { "docid": "1e12de63f533b40c812cec1d1f8e1d1e", "score": "0.57511145", "text": "lastRow() {\n this.set(this.x, this.grid.rows - 1)\n }", "title": "" }, { "docid": "808c0ae2a7efa1b07685f1b64f774883", "score": "0.57509905", "text": "lastPosition(x, y) {\n // called after the object is moved to a new position\n // saves it in the motion trail array\n // deletes the first element to constantly update\n this.motionTrailArr.push({ x: x, y: y });\n if (this.motionTrailArr.length > this.motionTrailLength) {\n this.motionTrailArr.shift();\n }\n }", "title": "" }, { "docid": "13aca4581f35ab40c5db8de583d37603", "score": "0.572556", "text": "function onClickUndo() {\n if (history.length) {\n let tempHistory = history.slice()\n let tempArray = tempHistory.pop()\n setHistory(tempHistory)\n setGameArray(tempArray)\n }\n }", "title": "" }, { "docid": "284fd80af0ba5607257e746e305969b9", "score": "0.571737", "text": "clearHistory() {\n if (ref.isNull(this.ptr)) {\n throw \"this is disposed\";\n }\n liveSplitCoreNative.RunEditor_clear_history(this.ptr);\n }", "title": "" }, { "docid": "0d2354f1b595a03c65da936aff01487e", "score": "0.5708735", "text": "redo() {\n this._historyIndex = Math.min(this._historyIndex + 1, this.actions.length)\n\n if (this._historyIndex <= this.actions.length) {\n clearCanvas(this._canvasMain, this._size)\n this.drawActions()\n }\n }", "title": "" }, { "docid": "81cd6a83a751805ada8e29d5a705c217", "score": "0.5700322", "text": "async rewind() {\n return this.cursor.rewind();\n }", "title": "" }, { "docid": "a773a9a666ff59b629e6dc3893b0e8ae", "score": "0.5698668", "text": "function history_push(x){\n\tredo_stack = [];\n\thistory_past.push(x);\n\tif(history_past.length > 20)\n\t\thistory_past.shift();\n\t\n\t//history exists, enable undo_nappi\n\tif(history_past.length > 1)\n\t\tdocument.getElementById(\"undo_nappi\").disabled = false;\n\t// disable redo_nappi\n\tdocument.getElementById(\"redo_nappi\").disabled = true;\n}", "title": "" }, { "docid": "13dafa468771ab3be3eb65626a921a01", "score": "0.56961316", "text": "function revertHistory() {\n\t\tif (HISTORY.p < 0) return;\n\t\t\n\t\tvar item = HISTORY.h[HISTORY.p];\n\t\tHISTORY.p--;\n\t\t\n\t\tif (HISTORY.p < 0) $(\"#undo\").attr(\"disabled\", \"disabled\");\n\t\t$(\"#redo\").removeAttr(\"disabled\");\n\t\t\n\t\t// vyhodnoceni akce\n\t\tif (item.action === CHANGE_HISTORY.ACTIONS[\"new\"]) {\n\t\t\tquestionary.removeItem(item.obj);\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"delete\"]) {\n\t\t\t// vytvoreni noveho objektu\n\t\t\tvar newItem = questionary.addItem(item.obj.name(), item.obj.className());\n\t\t\t\n\t\t\tnewItem.setFromArray(item.obj.toArray());\n\t\t\t\n\t\t\t// vyhodnoceni kontejneru\n\t\t\tvar container;\n\t\t\t\n\t\t\tif (item.params.container) {\n\t\t\t\tcontainer = questionary.getByName(item.params.container);\n\t\t\t} else {\n\t\t\t\tcontainer = questionary;\n\t\t\t}\n\t\t\t\n\t\t\t// zarazeni na spravne misto\n\t\t\tvar items = container.getItems();\n\t\t\tvar order = insertToOrder(newItem, items, item.params.prev, container, true);\n\t\t\t\n\t\t\tif (container instanceof QUESTIONARY.Questionary) {\n\t\t\t\tcontainer.setOrder(order);\n\t\t\t} else {\n\t\t\t\tcontainer.setItems(order);\n\t\t\t}\n\t\t\t\n\t\t\t// nahrazeni zybtku historie novym elementem\n\t\t\tfor (var i in HISTORY.h) {\n\t\t\t\tif (HISTORY.h[i].obj === item.obj) {\n\t\t\t\t\tHISTORY.h[i].obj = newItem;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"visibility\"]) {\n\t\t\t// vyhodnoceni, jestli je prvek vykreslovan\n\t\t\tif (item.obj.container() || questionary.getRenderable(item.obj)) {\n\t\t\t\t// prvek je aktualne vykreslovat, takze se skryje\n\t\t\t\tif (item.obj.container()) {\n\t\t\t\t\titem.obj.container().removeItem(item.obj);\n\t\t\t\t} else {\n\t\t\t\t\tquestionary.setRenderable(item.obj, false);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// prvek je skryt a provede se zobrazeni\n\t\t\t\tif (item.params.container) {\n\t\t\t\t\tvar container = questionary.getByName(item.params.container);\n\t\t\t\t\tvar items = container.getItems();\n\t\t\t\t\tvar order = insertToOrder(item.obj, items, item.params.prev, container, false);\n\t\t\t\t\t\n\t\t\t\t\tcontainer.setItems(order);\n\t\t\t\t} else {\n\t\t\t\t\tvar items = questionary.getItems();\n\t\t\t\t\t\n\t\t\t\t\tvar order = insertToOrder(item.obj, items, item.params.prev, questionary, false);\n\t\t\t\t\tquestionary.setOrder(order);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"move\"]) {\n\t\t\t// vygeerovani seznamu prvku\n\t\t\tvar order = new Array();\n\t\t\t\n\t\t\tfor (var i in item.params.itemsOld) {\n\t\t\t\torder.push(questionary.getByName(item.params.itemsOld[i]));\n\t\t\t}\n\t\t\t\n\t\t\t// zapis dat\n\t\t\tif (item.obj) {\n\t\t\t\t// jedna se o kontejner\n\t\t\t\titem.obj.setItems(order);\n\t\t\t} else {\n\t\t\t\tquestionary.setOrder(order);\n\t\t\t}\n\t\t} else if (item.action === CHANGE_HISTORY.ACTIONS[\"modify\"]) {\n\t\t\titem.obj.setFromArray(item.params.settingsOld);\n\t\t}\n\t\t\n\t\tsendRevert(item);\n\t\t\n\t\trender();\n\t\trefreshItems();\n\t}", "title": "" }, { "docid": "00de94046a8b5c31ae5e3c18a20ad24e", "score": "0.569178", "text": "function histTransaction(history, state, dispatch, redo) {\n var preserveItems = mustPreserveItems(state), histOptions = historyKey.get(state).spec.config;\n var pop = (redo ? history.undone : history.done).popEvent(state, preserveItems);\n if (!pop) { return }\n\n var selection = pop.selection.resolve(pop.transform.doc);\n var added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(),\n histOptions, preserveItems);\n\n var newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0);\n dispatch(pop.transform.setSelection(selection).setMeta(historyKey, {redo: redo, historyState: newHist}).scrollIntoView());\n }", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "c8dc5888dab1ada18621e126a4063505", "score": "0.56810313", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n}", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "664255d945c6a3e59cde8a92847ece75", "score": "0.5678401", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" }, { "docid": "c6952010dd11b107c35b1c093b8cef40", "score": "0.5670303", "text": "function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }", "title": "" } ]
d17f720291077aaab2c86b42fe471660
update x scale when clicking the X axis label
[ { "docid": "e48a3e028b6d4b984ac50b17804344a6", "score": "0.61169463", "text": "function xScale(allData, someX) {\n // console.log(someX)\n let xLinearScale = d3.scaleLinear()\n .domain([d3.min(allData, d => d[someX]) * .5, d3.max(allData, d => d[someX]) * 1.1])\n .range([0, width]);\n return xLinearScale; \n }", "title": "" } ]
[ { "docid": "5de402dd204abc36c78d6ec64dc2d33a", "score": "0.7988376", "text": "function onXScaleChanged() {\r\n var select = d3.select('#xScaleSelect').node();\r\n // Get current value of select element, save to global chartScales\r\n chartScales.x = select.options[select.selectedIndex].value;\r\n // Update chart\r\n scatter_updateChart();\r\n }", "title": "" }, { "docid": "5de402dd204abc36c78d6ec64dc2d33a", "score": "0.7988376", "text": "function onXScaleChanged() {\r\n var select = d3.select('#xScaleSelect').node();\r\n // Get current value of select element, save to global chartScales\r\n chartScales.x = select.options[select.selectedIndex].value;\r\n // Update chart\r\n scatter_updateChart();\r\n }", "title": "" }, { "docid": "793be090bba5597b89e73e98c7f3356e", "score": "0.7782405", "text": "function onXScaleChanged() {\n var select = d3.select('#xScaleSelect').node();\n // Get current value of select element, save to global chartScales\n chartScales.x = select.options[select.selectedIndex].value;\n\n // Update chart\n updateChart();\n}", "title": "" }, { "docid": "eb8f03f587a3fe5fc85ba8df12679476", "score": "0.738445", "text": "function updateXPlot() {\r\n\r\n // Update X axis\r\n x.domain([0,globalxmax])\r\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\r\n }", "title": "" }, { "docid": "8ab733a9a883e373bd9acb4b5405fae1", "score": "0.7371242", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "8ab733a9a883e373bd9acb4b5405fae1", "score": "0.7371242", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "8ab733a9a883e373bd9acb4b5405fae1", "score": "0.7371242", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "bf49f03b1a7bffbffd2bcc88e9da283a", "score": "0.7343711", "text": "function updateXLabel() {\n\t\tif (relative) {\n\t\t\tsvg.select(\".x.axis-label\")\n\t\t\t\t.text(\"Avg(\" + roles[focusRole][0] + \")\");\n\t\t} else {\n\t\t\tsvg.select(\".x.axis-label\")\n\t\t\t\t.text(roles[focusRole][0]);\n\t\t}\n\t}", "title": "" }, { "docid": "0a6c92c959a2d2d165969d7f595c172c", "score": "0.7275997", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "0a6c92c959a2d2d165969d7f595c172c", "score": "0.7275997", "text": "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "title": "" }, { "docid": "aa66a7d07dfc2864c280bf5556e3e9e2", "score": "0.7175783", "text": "function updateXlabel() {\n if (options.xlabel && xlabel) {\n xlabel.text(options.xlabel);\n }\n renderGraph();\n }", "title": "" }, { "docid": "46f66354ecd825f6dff1998fae10a342", "score": "0.7163036", "text": "function xScale(stateData, chosenXAxis) {\n \n }", "title": "" }, { "docid": "cad17fe8323b695bee34228c45bc242f", "score": "0.70785177", "text": "function updateX(x) {\n\n\tvar xMin = d3.min(x);\n\tvar xMax = d3.max(x);\n\n\t// rescale/relabel x axis\n\tscaleX = d3.scaleLinear().domain([Math.floor(xMin), Math.ceil(xMax)]).range([0, scatterWidth]);\n\td3.select('#scatterplot').select('.xAxis').call(d3.axisBottom(scaleX).ticks(5));\n\n\t// update points\n\td3.selectAll('.point')\n\t\t.transition()\n\t\t.duration(100)\n\t\t.attr('cx', function(d,i) {return scaleX(x[i])});\n\n} // end of updateHist()", "title": "" }, { "docid": "cae5b1abdb5b3702180b197b5c6a28c8", "score": "0.67373616", "text": "function updateX(selectedGroup) {\r\n updateXAxis(selectedGroup)\r\n circles\r\n .transition()\r\n .delay(50)\r\n .duration(2000)\r\n .attr(\"cx\", function (d) { return x(d[selectedGroup]); } )\r\n xLabel.text(selectedGroup) \r\n }", "title": "" }, { "docid": "2bfe32c54544ea62f1c3fa86ab670df8", "score": "0.67361945", "text": "function clickXLabel(){\n // Make label black. Make other labels grey.\n // Make label variable stored as the x variable to be displayed on plot\n var label = d3.select(this);\n label.attr('fill','black');\n if(label.attr('id') == 'povLabel'){\n d3.select('#ageLabel').attr('fill','grey');\n d3.select('#incomeLabel').attr('fill','grey');\n xVar = 'poverty';\n }else if (label.attr('id') == 'ageLabel'){\n label.attr('fill','black');\n d3.select('#povLabel').attr('fill','grey');\n d3.select('#incomeLabel').attr('fill','grey');\n xVar = 'age';\n }else{\n label.attr('fill','black');\n d3.select('#povLabel').attr('fill','grey');\n d3.select('#ageLabel').attr('fill','grey');\n xVar = 'income';\n };\n // Adjust scales to new x variable\n xScale.domain([d3.min(data.map(row => row[xVar]))-1, d3.max(data.map(row => row[xVar]))+1]).nice();\n xAxis = d3.axisBottom(xScale);\n xAxisTag.transition(400).call(xAxis);\n\n // Adjust points to new x variable\n pointGroup.transition().attr('transform', d => `translate(${xScale(d[xVar])}, ${yScale(d[yVar])})`);\n\n // Adjust tooltip to new x variable\n tool_tip.html(function(d) { return `<text>${d['abbr']}</text><br/><text>${xVar}: ${d[xVar]}</text><br/><text>${yVar}: ${d[yVar]}</text>`});\n chartStat.call(tool_tip);\n // Adjust title to new x variable\n titleLabel.text(`${xVar.charAt(0).toUpperCase() + xVar.slice(1)} vs. ${yVar.charAt(0).toUpperCase() + yVar.slice(1)} by State`);\n\n}", "title": "" }, { "docid": "c52014a702497464b948a1e9f215ebd5", "score": "0.66984063", "text": "function updateX(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n\n return xAxis;\n}", "title": "" }, { "docid": "d13af8adbbc6db046abc49fdef09a1f0", "score": "0.6664763", "text": "function adjustCirclesTextX(){\n d3.select(this)\n .transition()\n .attr(\"dx\", d => currentChartInfo.xScale(d[currentChartInfo.currentX]))\n .duration(circleDelay);\n }", "title": "" }, { "docid": "ad07e4094953208667d42588b0810b40", "score": "0.6664405", "text": "function adjustCirclesX(){\n d3.select(this)\n .transition()\n .attr(\"cx\", d => currentChartInfo.xScale(d[currentChartInfo.currentX]))\n .duration(circleDelay);\n }", "title": "" }, { "docid": "7fa50b58cbe15f2780ed22208adaac82", "score": "0.6598055", "text": "function updateBarTextX(chosenXAxis, newXScale, textGroup) {\n\n textGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis][0]));\n\n return textGroup; \n}", "title": "" }, { "docid": "f47fa76e3b894b77668cb773976cbf9d", "score": "0.65922546", "text": "function moveX() {\n\t\tvar i = Math.min(Math.round(x.invert(d3.mouse(this)[0])), variables.length-1);\n\t\tdot.attr('cx', x(i)).attr('cy', y(i));\n\t\tvarName.text(variables[i]);\n\t\n\t\t// update the histogram to view the selected variable\n\t\tvar newVar = data.map(function(d) {return +d[variables[i]]});\n\t\tupdateX(newVar);\n\t}", "title": "" }, { "docid": "1273c81b6f5a9756b04fe05caf330f74", "score": "0.6585319", "text": "function xScale(data, currentSelection) {\n let xLinearScale = d3\n .scaleLinear()\n .domain([\n d3.min(data.map(d => parseInt(d[currentSelection]))) * 0.8,\n d3.max(data.map(d => parseInt(d[currentSelection]))) * 1.2\n ])\n .range([0, width])\n\n return xLinearScale\n}", "title": "" }, { "docid": "2ca6f4ef73fcf8762d19bbdb00fd4393", "score": "0.6582948", "text": "function renderCircles_x(circlesGroup, newScale, chosenAxis) {\n circlesGroup.selectAll(\"circle\").transition()\n .duration(1000)\n .attr(\"cx\", d => newScale(d[chosenAxis]));\n circlesGroup.selectAll(\"text\").transition()\n .duration(1000)\n .attr(\"x\", d => newScale(d[chosenAxis]));\n \n \n return circlesGroup;\n}", "title": "" }, { "docid": "7f4d9b46900fcb981801e1aa2be13bba", "score": "0.65759206", "text": "function renderAxes_x(newScale, xAxis) {\n var bottomAxis = d3.axisBottom(newScale);\n\n xAxis.transition()\n .duration(100)\n .call(bottomAxis);\n\n return xAxis;\n}", "title": "" }, { "docid": "bc1bc934ae50ec11b3c8456fe1439d1b", "score": "0.65699947", "text": "function xScale_update(sales_data, chosenXAxis){\n /* Generate yScale based on selected value */\n\n const xLinearScale = d3.scaleLinear()\n .domain([0, d3.max(sales_data, d => d[chosenXAxis])])\n .range([0, chartWidth]);\n\n return xLinearScale;\n }", "title": "" }, { "docid": "1c23912dd038f0d3e7ad5c1cda54ca5d", "score": "0.6532294", "text": "function labelChange(clickedAxisX) {\n d3\n .selectAll(\".x-axis-text\")\n .filter(\".active\")\n // An alternative to .attr(\"class\", <className>) method. Used to toggle classes.\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n clickedAxisX.classed(\"inactive\", false).classed(\"active\", true);\n }", "title": "" }, { "docid": "75145887cb563bc97b144b577186c66a", "score": "0.6501927", "text": "function UpdateXAxis(newLabel, newXAxis) {\n // Defining the parameters of the axes\n let X_min = d3.min(HealthData, d => d[newLabel]); // Get minimum X data\n let X_max = d3.max(HealthData, d => d[newLabel]); // Get maximum X data\n var xLinearScale = d3.scaleLinear()\n .domain([(X_min - 0.01*(X_min+X_max)), // Added padding \n (X_max + 0.01*(X_min+X_max))\n ]) // domain is the range of input values\n .range([0, width]) // range is the range of display values in pixels\n .nice(); // expands both ends to the nearest round value\n // Create axis functions\n var bottomAxis = d3.axisBottom(xLinearScale);\n // Add transition to the newXAxis\n newXAxis.transition()\n .duration(500)\n .call(bottomAxis);\n return newXAxis; // Return updated Axis parameters\n }", "title": "" }, { "docid": "8eee89fa050f90371b8bd2012ed54969", "score": "0.6486014", "text": "function renderAxesX(newXScale, xAxis) \n{\n var bottomAxis = d3.axisBottom(newXScale);\n \n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n \n return xAxis;\n}", "title": "" }, { "docid": "e4a9b696c134439e27acf358b9dab271", "score": "0.6439524", "text": "function _x (d, i, j) {\r\n\t\t\treturn changeXScale ? xScaleCopy( accessors.x(d) ) : xScale( accessors.x(d) );\t\r\n\t\t}", "title": "" }, { "docid": "ceaa5bad4a7e310bc4f70ffcf8b97399", "score": "0.64122826", "text": "function updateXScale(csvData, xAxisChoice){\n const xLinearScale = d3.scaleLinear()\n .domain(d3.extent(csvData, d=>d[xAxisChoice]))\n .range([0,chartWidth]);\n return xLinearScale;\n}", "title": "" }, { "docid": "3c51fab82d9da289f17c9167d04ddde0", "score": "0.64091593", "text": "function update(){\n\t\t\tlet h = xAxis.invert(currentValue),\n\t\t\t\tyear = formatDateIntoYear(h);\n\t\t\tsendYearAndMovingStatus(year,that.isMoving);\n\t\t\thandle.attr(\"cx\", xAxis(h));\n\t\t\tlabel\n\t\t\t\t.attr(\"x\", xAxis(h))\n\t\t\t\t.text(formatDateIntoYear(h));\n\t\t}", "title": "" }, { "docid": "400f7eead1b1f5d474c675ea47eb22fb", "score": "0.64052665", "text": "function xaxislistener(filteredData) {\n xLabelsGroup.selectAll(\"text\")\n .on(\"click\", function () {\n console.log(\"active?\")\n // console.log(xLabelsGroup.selectAll(\"text\").value())\n // get value of selection\n var value = d3.select(this).attr(\"value\");\n\n if (value !== chosenXAxis) {\n\n // replaces chosenXAxis with value\n chosenXAxis = value;\n console.log(\"filtered\", filteredData)\n removeSvg();\n var filteredd = filtermydata()\n createbar(filteredd, \"totalbar\", chosenXAxis, \"green\");\n createbar(filteredd, \"prevbars\", chosenXAxis, \"red\");\n console.log(\"xlabels\", xLabelsGroup)\n xaxislistener(filteredd)\n\n }\n });\n}", "title": "" }, { "docid": "3f346f06526aa760c273916118189496", "score": "0.6393576", "text": "function xScale(data, chosenXaxis){\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXaxis]),\n d3.max(data, d => d[chosenXaxis])])\n .range(([0, width]));\n return xLinearScale;\n }", "title": "" }, { "docid": "8ee8de3fe8941f73f715ab333d4d82db", "score": "0.6387123", "text": "function uc1_rescaleX(data, g, binSize, range, mutationTypes, stacked, showTotal) {\n\n // uc1(data, binSize, range, mutationTypes);\n //return;\n\n console.log(\"rescaling x\");\n g.xAxisScale = d3.scaleLinear().domain([range.min,range.max]).range([0, g.width]);\n\n // g.xAxisScale.domain([range.min,range.max]) \n g.xAxis\n .transition()\n .duration(1000)\n .call(d3.axisBottom(g.xAxisScale).tickFormat(function(d) { return d3.format(\".2s\")(d); }));\n\n uc1_update(data, g, binSize, mutationTypes,stacked, showTotal);\n}", "title": "" }, { "docid": "8eeb3d8a272076425bb0cb3e47335451", "score": "0.63745236", "text": "function redrawAxis() {\n var X = 3e9; var Y = 40e6;\n if (zoom) {\n X = 20e6; Y = 20e6;\n }\n xScale.domain([0, X]);\n svg.select(\".x.axis\").transition().duration(100).call(xAxis);\n yScale.domain([0, Y]);\n svg.select(\".y.axis\").transition().duration(100).call(yAxis);\n\n zoom = !zoom;\n console.log(\"redrawing\");\n\n }", "title": "" }, { "docid": "e91aee7f0654b7d21a88fa2268aa85f0", "score": "0.6364604", "text": "function XAxisUpdate(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n xAxis.transition()\n .duration(500)\n .call(bottomAxis);\n return xAxis;\n }", "title": "" }, { "docid": "c3f9ee17260905e5a3e86c0a24128a72", "score": "0.6364391", "text": "function renderAxesX(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n \n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n \n return xAxis;\n }", "title": "" }, { "docid": "de1814936dac9df7354e91853e330bb6", "score": "0.6362999", "text": "function xScale(stateStats, dataVar1) {\n var scaleX = d3.scaleLinear()\n .domain([d3.min(stateStats, d => d[dataVar1]) - 1 , d3.max(stateStats, d => d[dataVar1]) + 1])\n .range([0, chartWidth]);\n return scaleX;\n }", "title": "" }, { "docid": "1aa28fbd9f3df2f2916718406bf5eb78", "score": "0.6352975", "text": "function zoom() {\n scaleFactor = d3.event.scale;\n translation = d3.event.translate;\n tick(); //update position\n }", "title": "" }, { "docid": "dc1e9278be57cf91a2b196d8b0fa74fb", "score": "0.63404274", "text": "function changeChartX(newVar) {\n window.x_property = newVar;\n var data = gemeenten.features\n\n // set scale for the X axis. \n var x = d3.scaleLinear()\n .domain([d3.min(data, function(d) {\n return +d.properties[x_property];\n }), d3.max(data, function(d) {\n return +d.properties[x_property];\n })]) // the range of the values to plot\n .range([0, widthChart - marginsChart.left - marginsChart.right]); // the pixel range of the x-axis\n\n // set scale for the Y axis. \n var y = d3.scaleLinear()\n .domain([d3.min(data, function(d) {\n return +d.properties[y_property];\n }), d3.max(data, function(d) {\n return +d.properties[y_property];\n })]) // the range of the values to plot\n .range([heightChart - marginsChart.top - marginsChart.bottom, 0]); // the pixel range of the y-axis\n\n // update the X axis\n var xAxis = d3.axisBottom().scale(x);\n main.transition().select(\"g.x.axis\").duration(750).call(xAxis);\n d3.select(\"#xlabel\").text(descriptions[newVar])\n\n // update the circles\n dots.selectAll(\"circle\")\n .transition()\n .duration(750)\n .attr(\"cx\", function(d, i) {\n return x(+d.properties[newVar]);\n })\n\n // get the results of the least squares regression\n var leastSquaresCoeff = leastSquares(getData(data, x_property), getData(data, y_property));\n var x1 = d3.min(data, function(d) {\n return +d.properties[x_property];\n });\n var y1 = x1 * leastSquaresCoeff[0] + leastSquaresCoeff[1];\n var x2 = d3.max(data, function(d) {\n return +d.properties[x_property];\n });\n var y2 = x2 * leastSquaresCoeff[0] + leastSquaresCoeff[1];\n\n // take another value if the trend line exceeds the canvas.\n var y_min = d3.min(data, function(d) {\n return +d.properties[y_property];\n });\n if (y1 < y_min) {\n var x1 = getRightMinValue(x_property, y_property, leastSquaresCoeff[0], leastSquaresCoeff[1])\n var y1 = x1 * leastSquaresCoeff[0] + leastSquaresCoeff[1];\n }\n if (y2 < y_min) {\n var x2 = getRightMaxValue(x_property, y_property, leastSquaresCoeff[0], leastSquaresCoeff[1])\n var y2 = x2 * leastSquaresCoeff[0] + leastSquaresCoeff[1];\n }\n\n var trendData = [\n [x1, y1, x2, y2]\n ];\n\n // update the trendline\n var trendline = main.selectAll(\".trendline\")\n .data(trendData);\n trendline.transition()\n .duration(750)\n .attr(\"x1\", function(d) {\n return x(d[0]);\n })\n .attr(\"y1\", function(d) {\n return y(d[1]);\n })\n .attr(\"x2\", function(d) {\n return x(d[2]);\n })\n .attr(\"y2\", function(d) {\n return y(d[3]);\n })\n .attr(\"stroke\", \"red\")\n .attr(\"stroke-width\", 1);\n\n // update the correlation\n d3.select('#correlation')\n .html(\"<b>Correlation: </b> <br/>\" + +leastSquaresCoeff[2].toFixed(3));\n\n}", "title": "" }, { "docid": "2801155e5e6713532e3a51991884703e", "score": "0.63404053", "text": "function xScale(data, chosenXaxis) {\n var xLinScale = d3.scaleLinear()\n .domain(d3.extent(data, d => d[chosenXaxis]))\n .range([0, width])\n .nice(); // labels max tick\n return xLinScale;\n}", "title": "" }, { "docid": "14c2ea8bd144f454afa197232071c4b3", "score": "0.630502", "text": "function ScaleX (data, SetXAxis) {\n let LScaleX = d3.scaleLinear()\n .domain([d3.min(data, d => d[SetXAxis]) * 0.8,\n d3.max(data, d => d[SetXAxis]) * 1.2\n ])\n .range([0, width]);\n \n return LScaleX;\n \n }", "title": "" }, { "docid": "8fad90ef87f4653d055d0f33f2450e7f", "score": "0.63031125", "text": "function renderXaxis(newXscale, xAxis) {\n var bottomAxis = d3.axisBottom(newXscale);\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n return xAxis;\n}", "title": "" }, { "docid": "d10d74390cc54181bcf0d4544ffacc86", "score": "0.6295547", "text": "function xScale(stateData, selectedXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(stateData, d => d[selectedXAxis])*.95,\n d3.max(stateData, d => d[selectedXAxis])*1.05])\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "b03d00947b5c0974ddd03bddfa0bd1f2", "score": "0.6295505", "text": "function renderAxesX(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n\n return xAxis;\n}", "title": "" }, { "docid": "3de1914496003c3205890affd60ef9dc", "score": "0.6293982", "text": "function renderAxesX(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n\n return xAxis;\n}", "title": "" }, { "docid": "03beaf5c65756138627f7122f7dfc2bf", "score": "0.6288864", "text": "function xScale(data, chosenXAxis) { \r\n \r\n var xLinearScale = d3\r\n .scaleLinear()\r\n .domain([d3.min(data, d => d[chosenXAxis] - 1), d3.max(data, d => d[chosenXAxis])])\r\n .range([0,width]);\r\n\r\n return xLinearScale;\r\n\r\n}", "title": "" }, { "docid": "5946b5f232418dce9c7e3ed7f5a8933a", "score": "0.627999", "text": "function renderXText(stateTextGroup, newXScale, chosenXaxis) {\n stateTextGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXaxis]));\n return stateTextGroup;\n}", "title": "" }, { "docid": "5e9ba72ce5fc70300fdec99286448d27", "score": "0.6272553", "text": "_onChange() {\n\t\tthis.scale = this._steps[this._step];\n\t\t\n\t\tdocument.getElementById('zoomValue').innerText = Math.round(this.scale * 100) + '%';\n\t\tdocument.getElementById('graph').setAttribute('transform', 'scale(' + this.scale + ')');\n\n\t\t// TODO: zoom to mouse position / center\n\n\t\tapp.redrawEdges();\n\t}", "title": "" }, { "docid": "a1e23153393dc81c42f6c64176bbd82c", "score": "0.62599623", "text": "function UpdateXPosition(newLabel, newXPos, fillColor, strokeColor){\n // Calculating new linearScale\n let X_min = d3.min(HealthData, d => d[newLabel]); // Get minimum X data\n let X_max = d3.max(HealthData, d => d[newLabel]); // Get maximum X data\n var xLinearScale = d3.scaleLinear()\n .domain([(X_min - 0.01*(X_min+X_max)), // Added padding \n (X_max + 0.01*(X_min+X_max))\n ]) // domain is the range of input values\n .range([0, width]) // range is the range of display values in pixels\n .nice(); // expands both ends to the nearest round value\n // Add transition to the new_X_Position\n newXPos.transition()\n .duration(500)\n .attr(\"cx\", d => xLinearScale(d[newLabel]))\n .attr(\"fill\", fillColor)\n .attr(\"stroke\", strokeColor);\n return newXPos; // Return updated circle x position\n }", "title": "" }, { "docid": "bfe7865eb16573b21523d767cda316ac", "score": "0.62546265", "text": "function xScale(cenData, chosenXaxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(cenData, d => d[chosenXaxis]) * 0.8,\n d3.max(cenData, d => d[chosenXaxis]) * 1.2\n ]).range([0, chartWidth]);\n\n return xLinearScale; \n}", "title": "" }, { "docid": "516354f50101c8e21bb1767811e5ad89", "score": "0.6243296", "text": "function zoom() {\n if (eventService.getUIMode() == \"manipulate\")\n {\n scaleFactor = d3.event.scale;\n translation = d3.event.translate;\n tick(); //update positions\n }\n }", "title": "" }, { "docid": "b112d12d940ac84bb4dacb1298df64e4", "score": "0.62409276", "text": "_onApplyScaleButtonTap() {\n qx.core.Init.getApplication()\n .getRoot()\n .setFontScale(this.__slider.getValue() / 100);\n\n this._updateDemoImageLabel();\n\n var lastValue = this.__slider.getValue();\n this.__slider.setValue(0);\n this.__slider.setValue(lastValue);\n\n qx.core.Init.getApplication()\n .getRouting()\n .executeGet(\"/theming\", { reverse: false });\n }", "title": "" }, { "docid": "3aa64368a699a9a9d4bc8ccdbf03618f", "score": "0.62324536", "text": "function xScale (data, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([\n d3.min(data, d => d[chosenXAxis]) - (d3.min(data, d => d[chosenXAxis])*.02),\n d3.max(data, d => d[chosenXAxis]) + (d3.min(data, d => d[chosenXAxis])*.02)\n ])\n .range([0, width]);\n \n return xLinearScale\n}", "title": "" }, { "docid": "41a5fe375e7a049b204d213285402a8c", "score": "0.6231725", "text": "function msgLengthChangeXAxisBounds() {\r\n msgLengthOptions.hAxis.viewWindow.min = parseInt(document.getElementById(\"msgLengthMin\").value);\r\n msgLengthOptions.hAxis.viewWindow.max = parseInt(document.getElementById(\"msgLengthMax\").value);\r\n\r\n msgLengthChart.draw(msgLengthData, msgLengthOptions);\r\n}", "title": "" }, { "docid": "23015847a4159b03924dc8687cf2e8b4", "score": "0.62308514", "text": "function xScale(stateData, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(stateData, d => d[chosenXAxis]) * 0.9,\n d3.max(stateData, d => d[chosenXAxis]) * 1.1])\n .range([0, chartWidth]);\n return xLinearScale;\n} // closing xScale function", "title": "" }, { "docid": "7a931b3bee3fe602c9bdd99c46664220", "score": "0.6228109", "text": "function zoom() {\n svgGroup.attr(\"transform\",\n `translate(${d3.event.translate})scale(${d3.event.scale})`);\n renderScaleBar(d3.event.scale)\n }", "title": "" }, { "docid": "5ff0cd72093f76ab5d45e6569e027078", "score": "0.62153685", "text": "function initChart() {\n\n xScale = d3.scale.linear()\n .domain([0,200])\n .range([0, xAxisW]);\n \n xAxisGen = d3.svg.axis()\n .scale(xScale)\n .orient(\"bottom\")\n .ticks(10);\n \n xAxis = svg.append(\"svg:g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\",\"translate(\" + labelW + \",\" + xAxisY + \")\")\n .call(xAxisGen);\n }", "title": "" }, { "docid": "0a0f32fb9bcb0340df108b83710e11ac", "score": "0.6204541", "text": "function calculateXScaleAndValuesShown() {\n var zoomPointDistanceFromGraphLeftEdge = zoomX - leftMargin;\n var leftPortion = zoomPointDistanceFromGraphLeftEdge / graphWidth;\n var rightPortion = 1 - leftPortion;\n \n var measurementIndex = convertXToMeasurementIndex(zoomX);\n var nrOfMeasurementsToInclude = Math.round(signal.getMeasurements().length / zoomLevel);\n var leftIndex, rightIndex;\n var lastIndex = signal.getMeasurements().length - 1;\n var nrOfMeasurementsOnTheLeft = Math.round(leftPortion * nrOfMeasurementsToInclude);\n var nrOfMeasurementsOnTheRight = Math.round(rightPortion * nrOfMeasurementsToInclude);\n\n \n if (measurementIndex - nrOfMeasurementsOnTheLeft < 0) {\n leftIndex = 0;\n rightIndex = nrOfMeasurementsToInclude - 1;\n } else if (measurementIndex + nrOfMeasurementsOnTheRight > lastIndex) { \n rightIndex = lastIndex;\n leftIndex = lastIndex - (nrOfMeasurementsToInclude - 1);\n } else {\n leftIndex = measurementIndex - nrOfMeasurementsOnTheLeft;\n rightIndex = measurementIndex + nrOfMeasurementsOnTheRight;\n }\n \n xLeftMost = {measurementIndex: leftIndex, value: signal.getMeasurements()[leftIndex].time};\n xRightMost = {measurementIndex: rightIndex, value: signal.getMeasurements()[rightIndex].time};\n xScale = graphWidth / (xRightMost.value - xLeftMost.value);\n xTranslation = -xScale * xLeftMost.value + leftMargin;\n }", "title": "" }, { "docid": "28a98f653b7963bdc3edf1f38a20e65e", "score": "0.62041503", "text": "function renderXAxis(newXScale, Xvalue) {\n var bottomAxis = d3.axisBottom(newXScale);\n // Create scales\n xAxis.transition()\n .duration(2000)\n .call(bottomAxis);\n\n return xAxis;\n}", "title": "" }, { "docid": "a49732ed237f0157de8e2ae87fa31fdd", "score": "0.6198406", "text": "function updateChart() {\n // Recover the new scale\n var newX = d3.event.transform.rescaleX(x);\n var newY = d3.event.transform.rescaleY(y); // Update axes with these new boundaries\n\n xAxis.call(d3.axisBottom(newX));\n yAxis.call(d3.axisLeft(newY)); // Update circle position\n\n scat.attr('cx', function (d) {\n return newX(d[\"date\"]);\n }).attr('cy', function (d) {\n return newY(d[yAx]);\n });\n }", "title": "" }, { "docid": "1b65b46a5e29ead58b1b9d20f60792bd", "score": "0.6190651", "text": "function renderXAxis(newXScale, xAxis){\r\n var bottomAxis = d3.axisBottom(newXScale);\r\n xAxis.transition()\r\n .duration(1000)\r\n .call(bottomAxis)\r\n return xAxis;\r\n}", "title": "" }, { "docid": "7a1eb18a3002a24305ec8cb0d0a65bd8", "score": "0.618674", "text": "function xScale(data, chosenXAxis) {\n \n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d.chosenXAxis)-1, d3.max(data, d => d.chosenXAxis)+1])\n .range([0, width]);\n\n return xLinearScale;\n }", "title": "" }, { "docid": "9fda6321862a43530963c7aff9acbb87", "score": "0.6180541", "text": "function renderTextX(textLabels, xAxisScale, someX) {\n textLabels.transition()\n .duration(1000)\n .attr('x', d => xAxisScale(d[someX]));\n return textLabels;\n }", "title": "" }, { "docid": "f55d737ae84da75f9c6372101a78d0b7", "score": "0.6176954", "text": "function updateChart() {\n \n // recover the new scale\n var newX = d3.event.transform.rescaleX(x);\n var newY = d3.event.transform.rescaleY(y);\n \n // update axes with these new boundaries\n xAxis.call(d3.axisBottom(newX))\n yAxis.call(d3.axisLeft(newY))\n \n // update circle position\n scatter\n .selectAll(\"circle\")\n .attr('cx', function(d) {return newX(d.deforest)})\n .attr('cy', function(d) {return newY(d.emission)});\n }", "title": "" }, { "docid": "3fa9389321a61d3fbc3ccdad2613a323", "score": "0.6162578", "text": "function xScale(data, chosenXAxis) {\n // create x-axis scale\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * .5 ,\n d3.max(data, d => d[chosenXAxis] * 1.1)\n ])\n .range([0, chartWidth]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "eb69a18731178d1cbe2806a5bd3fc124", "score": "0.61602205", "text": "function xScale(data, xVariable) {\n const xLinearScale = d3\n .scaleLinear()\n .range([0, chartW])\n .domain([d3.min(data, d => d[xVariable]) * 0.8,\n (d3.max(data, d => d[xVariable])) * 1.2]);\n return xLinearScale;\n}", "title": "" }, { "docid": "0cf6e676f0108743753ee0ab7cc1b4fd", "score": "0.615837", "text": "function tick() {\n \n\n yScale.domain([d3.min(data), d3.max(data)]);\n\n d3.select(this)\n .attr(\"d\", line)\n .attr(\"transform\", null);\n\n // Slide it to the left.\n d3.active(this)\n .attr(\"transform\", \"translate(\" + xScale(0) + \",0)\");\n\n yAxis\n .call(d3.axisLeft(yScale));\n\n\n // Pop the old data point off the front.\n \n\n }", "title": "" }, { "docid": "6c0042694ae4c5944f73c49d53715edc", "score": "0.61559415", "text": "function renderXAxis(newXScale, xAxis){\n var bottomAxis = d3.axisBottom(newXScale);\n xAxis.transition().duration(1000).call(bottomAxis);\n return xAxis;\n}", "title": "" }, { "docid": "698c9212f56bc19a39967ccb84b56dfa", "score": "0.6152554", "text": "function brushedX() {\n var selection = d3.event.selection;\n x.domain(selection.map(x2.invert, x2));\n focus.selectAll(\".dot\")\n .attr(\"cx\", function (d) {return x(d[header[0]]);})\n .attr(\"cy\", function (d) {return y(d[header[1]]);});\n focus.select(\".axis--x\").call(xAxis);\n }", "title": "" }, { "docid": "c2c3940750ba05be82b343f9975db617", "score": "0.6148651", "text": "function zoom() {\n scale = d3.event.scale;\n d3.event.translate[0]+=svg_position.x0*d3.event.scale;\n d3.event.translate[1]+=svg_position.y0*d3.event.scale;\n svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n chart();\n }", "title": "" }, { "docid": "d5f163465a88ad53d00b15b95c1766e1", "score": "0.6144805", "text": "function xScale(acsData, chosenXAxis) {\r\n //create scales\r\n\r\n var xLinearScale = d3.scaleLinear()\r\n .domain([d3.min(acsData, d => d[chosenXAxis] * 0.8),\r\n d3.max(acsData, d=> d[chosenXAxis] * 1.0)\r\n ])\r\n .range([0, width]);\r\n\r\nreturn xLinearScale;\r\n}", "title": "" }, { "docid": "4929f383d952e01b16bc7d2fc2fbbde7", "score": "0.6143754", "text": "function xScale(data, xaxis){\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[xaxis]) * 0.9,\n d3.max(data, d => d[xaxis]) * 1.1\n ])\n .range([0, chartWidth]);\nconsole.log(xLinearScale);\n return xLinearScale;\n \n}", "title": "" }, { "docid": "52f4364ad16a71cb9fdbc8605c37fb70", "score": "0.61361474", "text": "function renderXAxis(newXScale, xAxis) {\n let bottomAxis = d3.axisBottom(newXScale)\n xAxis.transition()\n .duration(2000)\n .call(bottomAxis)\n return xAxis;\n }", "title": "" }, { "docid": "00e650cd1b9f1a6fdd40cdfeb15f348e", "score": "0.61358297", "text": "function updateChart() {\n // recover the new scale\n var newX = d3.event.transform.rescaleX(x);\n var newY = d3.event.transform.rescaleY(y);\n\n // update axes with these new boundaries\n xAxis.call(d3.axisBottom(newX));\n yAxis.call(d3.axisLeft(newY));\n\n // update circle position\n scatter\n .selectAll(\".points\")\n .attr(\"cx\", function (d) {\n return newX(d.x);\n })\n .attr(\"cy\", function (d) {\n return newY(d.y);\n });\n }", "title": "" }, { "docid": "2676ffeaa0c7e2f6ce7f093c52bc86b7", "score": "0.6132741", "text": "function updateScale(increment) {\n var ctx = document.getElementById(\"canvas\").getContext(\"2d\");\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n //var viewportScale = document.getElementById(\"scale\").value;\n axes.scale += increment;\n draw();\n}", "title": "" }, { "docid": "f1187171d512ee17b5b58d271dfcfeac", "score": "0.61327267", "text": "function UpdateXLabels(newLabel, NewCircleLabels){\n // Calculating new linearScale\n let X_min = d3.min(HealthData, d => d[newLabel]); // Get minimum X data\n let X_max = d3.max(HealthData, d => d[newLabel]); // Get maximum X data\n var xLinearScale = d3.scaleLinear()\n .domain([(X_min - 0.01*(X_min+X_max)), // Added padding \n (X_max + 0.01*(X_min+X_max))\n ]) // domain is the range of input values\n .range([0, width]) // range is the range of display values in pixels\n .nice(); // expands both ends to the nearest round value\n // Add transition to the new Circle Labels\n NewCircleLabels.transition()\n .duration(500)\n .attr(\"x\", d => xLinearScale(d[newLabel]))\n .attr(\"text-anchor\", \"middle\");\n return NewCircleLabels; // Return updated label x position\n }", "title": "" }, { "docid": "73305d8eb17173ce1bc4cdd2b4f54d5c", "score": "0.61317676", "text": "set x(value) {\n this._x = value;\n this.root.setAttribute('transform', `translate(${this._x},${this._y})`);\n }", "title": "" }, { "docid": "8776ace4982a08505101deef352effac", "score": "0.61235106", "text": "function xScale(data, axes) {\n // create scales\n var scale = d3.scaleLinear()\n .domain([d3.min(data, d => d[axes]) * 0.8,\n d3.max(data, d => d[axes]) * 1.2\n ])\n .range([0, width]);\n return scale; \n}", "title": "" }, { "docid": "cd9b082ddf43dc73ad53c915c86317d7", "score": "0.6116745", "text": "_valueXChanged(value) {\n if (this.enableX) {\n this._handle.style.left = (this._canvas.scrollWidth)\n * ((value - this.minX) / (this.maxX - this.minX)) + 'px';\n }\n }", "title": "" }, { "docid": "c5cba57431ce4a22c6b2ea145ebff629", "score": "0.611582", "text": "function renderX(nextXScale, xAxis){\n let lowerAxis = d3.axisBottom(nextXScale);\n xAxis.transition()\n .duration(1000)\n .call(lowerAxis);\n return xAxis;\n}", "title": "" }, { "docid": "58733184d7bd654b410d3241471f9903", "score": "0.6115238", "text": "function xScale(healthData, chosenXaxis) {\n const xLinearScale = d3.scaleLinear()\n .domain([d3.min(healthData, d => d[chosenXaxis]*0.8),\n d3.max(healthData, d => d[chosenXaxis]*1.2)\n ])\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "457c9ed655704dedfa6cbc622de06bc9", "score": "0.61141515", "text": "function zoom() {\n tick(); // update position by tick, so the actual d.x, d.y won't change\n }", "title": "" }, { "docid": "69edc65d8a409c1fe63d5212f59779b5", "score": "0.6107945", "text": "function onAxisAfterSetScale() {\n var axis = this;\n if (axis.horiz && !axis.isDirty) {\n axis.isDirty = axis.isOrdinal &&\n axis.chart.navigator &&\n !axis.chart.navigator.adaptToUpdatedData;\n }\n }", "title": "" }, { "docid": "36f97a06538bbae5e853007021735be1", "score": "0.6105213", "text": "function renderAxesX(xAxisScale, xAxis) {\n // console.log(xAxis)\n let bottomAxis = d3.axisBottom(xAxisScale);\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis); \n return xAxis;\n }", "title": "" }, { "docid": "ba1f264e0a5a7cfd2f60c88c04198a78", "score": "0.6104648", "text": "function xScale(data, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.8,\n d3.max(data, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, chartWidth]);\n \n return xLinearScale;\n \n}", "title": "" }, { "docid": "95926f3f4f0e1587b8f126a25f7d7f4c", "score": "0.6104537", "text": "function updateXAxis(xScale2, xAxis){\n const bottomAxis = d3.axisBottom(xScale2);\n\n xAxis.transition()\n .duration(500)\n .call(bottomAxis);\n \n return xAxis;\n}", "title": "" }, { "docid": "a4d7a240f9c2287b38ba3df858cfd1f7", "score": "0.6090369", "text": "function xScale(stateData, chosenXAxis) {\r\n // created scales\r\n var xLinearScale = d3.scaleLinear()\r\n .domain([d3.min(stateData, d => d[chosenXAxis])-1, d3.max(stateData, d => d[chosenXAxis])])\r\n .range([0, width]);\r\n\r\n return xLinearScale;\r\n\r\n}", "title": "" }, { "docid": "c38047f1fc6c3e98b363fd68d22fb57c", "score": "0.6083096", "text": "function updateXCircleText(circlesText, xScale2, xAxisChoice){\n\n circlesText.transition()\n .duration(500)\n .attr('x', d=>xScale2(d[xAxisChoice]));\n \n return circlesText;\n}", "title": "" }, { "docid": "72b9c92a97ebc530a45d1a3ea2ad2ef1", "score": "0.6079676", "text": "function drawXAxis(newXScale, xAxis) {\r\n\r\n var bottomAxis = d3.axisBottom(newXScale);\r\n\r\n xAxis\r\n .transition()\r\n .duration(1000)\r\n .call(bottomAxis);\r\n\r\n return xAxis;\r\n\r\n}", "title": "" }, { "docid": "b83c8dd2d8f03ee1ce24d7135fd27b07", "score": "0.6074529", "text": "function renderXAxis(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n return xAxis;\n }", "title": "" }, { "docid": "4006118791fa12ee8319313188ae04af", "score": "0.6073253", "text": "function renderXAxis(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n \n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n \n return xAxis;\n}", "title": "" }, { "docid": "78c699c5ab3b09f6c24b1de57c27d271", "score": "0.6070909", "text": "function xScale(data) {\n var narray = data.map(d => d[chosenXAxis]);\n var min = d3.min(narray);\n var max = d3.max(narray);\n var linearScale = d3.scaleLinear()\n .domain([min-scaleFactor*(max-min),max+scaleFactor*(max-min)])\n .range([0, width]);\n return linearScale;\n}", "title": "" }, { "docid": "b94690b51aa1fae48a1ecf31f86a4482", "score": "0.60690373", "text": "function xScale(healthData, currentXAxis) {\n //create scale\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(healthData, d => d[currentXAxis] * 0.9),\n d3.max(healthData, d => d[currentXAxis])])\n .range([0, width]);\n\n return xLinearScale;\n\n\n}", "title": "" }, { "docid": "ed944c8d00111c1add30a2372ecc9c58", "score": "0.6064488", "text": "function setXAxis(chart, x, prefix=\"\", suffix=\"\") {\n\tchart.append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", \"translate(0,\" + graph_height + \")\")\n \t.call(d3.axisBottom(x).ticks(5).tickFormat((d)=> { return prefix+d+suffix; }).tickSizeInner([-graph_height]));\n}", "title": "" }, { "docid": "bceedcc30cacac2316aa5bfc9960ab89", "score": "0.60573184", "text": "function renderXAxes(newx_scale, x_axis) {\n var bottomAxis = d3.axisBottom(newx_scale);\n\n x_axis.transition()\n .duration(1000)\n .call(bottomAxis);\n\n return x_axis;\n}", "title": "" }, { "docid": "88d2ea34c5e02b0fa45d417883e03642", "score": "0.60548365", "text": "function renderXAxes(newXScale, xAxis) {\n var bottomAxis = d3.axisBottom(newXScale);\n \n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n \n return xAxis;\n }", "title": "" }, { "docid": "9e8d669adfccd8c6b3fe913fafb870dc", "score": "0.6051186", "text": "function xScale(theData, chosenXAxis){\r\n var xLinearScale = d3.scaleLinear()\r\n .domain([d3.min(theData, d=>d[chosenXAxis]) * 0.8, \r\n d3.max(theData, d=>d[chosenXAxis]) * 1.2])\r\n .range([0, width]);\r\n return xLinearScale;\r\n}", "title": "" }, { "docid": "9ccf58a37a7876676889ccff2dea13fa", "score": "0.6048839", "text": "function xScale(stateData, chosenXAxis) {\n\n // Create x scale\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(stateData, d => d[chosenXAxis]) * 0.8, d3.max(stateData, d => d[chosenXAxis]) * 1.2]) // Add space so circles don't overlap on axes\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "c0f211ce9cdf0b5072849f7ef74dd082", "score": "0.60461295", "text": "function xScale(x) {return 100*x;}", "title": "" }, { "docid": "b383538e7cc68c0e71e401a55babcab9", "score": "0.60432476", "text": "function xScale(data, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) *.8,\n d3.max(data, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, chartWidth]);\n \n return xLinearScale;\n}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "397f66da7d48b26a3a8567a29538968f", "score": "0.0", "text": "function t(e,t,n,i){var r={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?r[n][0]:r[n][1]}", "title": "" } ]
[ { "docid": "10d1879eaeed63952d2503fd69f151f3", "score": "0.8290721", "text": "function g(e,t,r){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[r],e)}//! moment.js locale configuration", "title": "" }, { "docid": "a2cd0265366d469e1711c1dc40af6a12", "score": "0.76963586", "text": "function wa(e,t,n){var a={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}//! moment.js locale configuration", "title": "" }, { "docid": "5d687930143ad23adb51a5822eb657c1", "score": "0.7654697", "text": "function init() {\n if (navigator && navigator.language) {\n moment.locale(navigator.language);\n }\n else {\n moment.locale('es');\n }\n }", "title": "" }, { "docid": "5d67dc8bcb8045ac2d2a13c12bedd632", "score": "0.76467", "text": "function localizeMoment(mom){mom._locale = localeData;}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b5ee0f1824afd8786d73e0ab9ee28fb2", "score": "0.718394", "text": "function localizeMoment(mom) {\r\n\t\tmom._locale = localeData;\r\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "53b156f71f17bcf54c6a9177af5e1045", "score": "0.71614736", "text": "function doTheMagic () {\n moment.locale('pt-BR');\n setDisplay();\n}", "title": "" }, { "docid": "ffeac031b2f05305244a4c7894bb3dd0", "score": "0.7130321", "text": "get lang() {\n return moment.locale();\n }", "title": "" }, { "docid": "96429cc3f1ee77f92477a1c0f838fa77", "score": "0.69832134", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "ef65c75b88e6f3908a65e44dcb470148", "score": "0.68844", "text": "function sd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c];}//! moment.js locale configuration", "title": "" }, { "docid": "ad6199621e48dee2be6e8e4a57acdbfc", "score": "0.68776137", "text": "function init(){\n moment.locale(\"it\");\n printGraphic();\n}", "title": "" }, { "docid": "8636f8bcf2bb73c7efc7501fe0dcbec9", "score": "0.6857098", "text": "function relativeTimeWithPlural$4(number,withoutSuffix,key){return\"m\"===key?withoutSuffix?\"хвилина\":\"хвилину\":\"h\"===key?withoutSuffix?\"година\":\"годину\":number+\" \"+\n//! moment.js locale configuration\nfunction plural$6(word,num){var forms=word.split(\"_\");return num%10==1&&num%100!=11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2]}({ss:withoutSuffix?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:withoutSuffix?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:withoutSuffix?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[key],+number)}", "title": "" }, { "docid": "d67a3b8503ec4102a172573ded84b961", "score": "0.6732808", "text": "defaultLocale() {\n return 'en';\n }", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690814", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "461e6e675fb29fbbf2166539c9213026", "score": "0.66146594", "text": "formatMoment() {\n let lang = window.sessionStorage.getItem('language')\n let moment = require('moment'); /// para capturar o momento\n moment().format();\n moment.locale(lang);\n\n return moment().format('DD/MMMM/YYYY - HH:mm:ss')\n }", "title": "" }, { "docid": "d252e19be518329d10c10006b572f344", "score": "0.65586287", "text": "function setLocaleDateTime () {\n\t var days = [\n\t $.localise.tr(\"Sunday\"),\n\t $.localise.tr(\"Monday\"),\n\t $.localise.tr(\"Tuesday\"),\n\t $.localise.tr(\"Wednesday\"),\n\t $.localise.tr(\"Thursday\"),\n\t $.localise.tr(\"Friday\"),\n\t $.localise.tr(\"Saturday\")\n\t ],\n\t months = [\n\t $.localise.tr(\"January\"),\n\t $.localise.tr(\"February\"),\n\t $.localise.tr(\"March\"),\n\t $.localise.tr(\"April\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"June\"),\n\t $.localise.tr(\"July\"),\n\t $.localise.tr(\"August\"),\n\t $.localise.tr(\"September\"),\n\t $.localise.tr(\"October\"),\n\t $.localise.tr(\"November\"),\n\t $.localise.tr(\"December\")\n\t ],\n\t days_abbrev = [\n\t $.localise.tr(\"Sun\"),\n\t $.localise.tr(\"Mon\"),\n\t $.localise.tr(\"Tue\"),\n\t $.localise.tr(\"Wed\"),\n\t $.localise.tr(\"Thu\"),\n\t $.localise.tr(\"Fri\"),\n\t $.localise.tr(\"Sat\")\n\t ],\n\t months_abbrev = [\n\t $.localise.tr(\"Jan\"),\n\t $.localise.tr(\"Feb\"),\n\t $.localise.tr(\"Mar\"),\n\t $.localise.tr(\"Apr\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"Jun\"),\n\t $.localise.tr(\"Jul\"),\n\t $.localise.tr(\"Aug\"),\n\t $.localise.tr(\"Sep\"),\n\t $.localise.tr(\"Oct\"),\n\t $.localise.tr(\"Nov\"),\n\t $.localise.tr(\"Dec\")\n\t ];\n\t wialon.util.DateTime.setLocale(days, months, days_abbrev, months_abbrev);\n\t}", "title": "" }, { "docid": "7021ea3c212c9bd2f74b6c37d94d6338", "score": "0.6469657", "text": "function getMomentLocale(key) {\n return {\n id: key,\n locale: {\n week: {\n // Angular monday = 0 whereas Moment monday = 1\n dow: ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 1) % 7,\n doy: defaultConfig.doys[key]\n }\n }\n };\n }", "title": "" }, { "docid": "6ead600a845fbd33f37f6d5efb69f1d5", "score": "0.6365162", "text": "function setLocaleLanguage(locale) {\n let fetch = false\n if(locale == 'en') {\n dateFormatter.locale = 'en'\n fetch = true\n }\n else dateFormatter.locale = 'ko-Kore_KR'\n\n localeJSON.year = !fetch ? 'yy년' : 'y,'\n localeJSON.day = !fetch ? 'EEEE' : 'E'\n localeJSON.realtime = !fetch ? '현재' : 'Real-time'\n localeJSON.country = !fetch ? '전국' : 'Korea'\n localeJSON.accumulate = !fetch ? '0시 기준' : 'Total'\n localeJSON.yesterday = !fetch ? '어제' : 'Last'\n localeJSON.count = !fetch ? ' 명' : ''\n localeJSON.calendar = !fetch ? '일정' : 'Calendar'\n localeJSON.reminder = !fetch ? '미리알림' : 'Reminder'\n\n localeJSON.sun = !fetch ? '일' : 'S'\n localeJSON.mon = !fetch ? '월' : 'M'\n localeJSON.tue = !fetch ? '화' : 'T'\n localeJSON.wen = !fetch ? '수' : 'W'\n localeJSON.thu = !fetch ? '목' : 'T'\n localeJSON.fri = !fetch ? '금' : 'F'\n localeJSON.sat = !fetch ? '토' : 'S'\n\n localeJSON.regions = ['Seoul', 'Busan', 'Incheon', 'Daegu',\n 'Gwangju', 'Daejeon', 'Ulsan', 'Sejong',\n 'Gyeonggi', 'Gangwon', 'ChungBuk',\n 'ChungNam', 'GyeongBuk', 'GyeongNam',\n 'JeonBuk', 'JeonNam', 'Jeju']\n}", "title": "" }, { "docid": "f9bdceec711408a9ac249b49874f3f6d", "score": "0.6236138", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key)\n } else {\n data = defineLocale(key, values)\n }\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data\n }\n }\n return globalLocale._abbr\n }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6183774", "text": "function ApexLocale() { }", "title": "" }, { "docid": "6e8eb0a6db712165ad6510dcb331f95c", "score": "0.6168197", "text": "beforeCreate(){\r\n if ( bbn.env && bbn.env.lang && (bbn.env.lang !== dayjs.locale()) ){\r\n dayjs.locale(bbn.env.lang);\r\n }\r\n }", "title": "" }, { "docid": "fcde36f904fbafdad011619f6d86d3ad", "score": "0.6156515", "text": "function overrideMonthNamesInCFPicker() {\n // short months for de locale have a dot at the end which makes java simpledateformat parser nuts\n if (confimoment.lang() == 'de') {\n confimoment.lang('de', {\n monthsShort: \"Jan_Feb_Mär_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez\".split(\"_\")\n });\n }\n if (confimoment.lang() == 'es') {\n confimoment.lang('es', {\n monthsShort: function (a, b) {\n return \"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic\".split(\"_\")[a.month()];\n }\n });\n }\n if (confimoment.lang() == 'ja') {\n confimoment.lang('ja', {\n monthsShort: [\n \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"\n ]\n });\n }\n}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "52559860145ad28417b3ea5a7bcee95b", "score": "0.60859364", "text": "dateFormat(date) {\n return moment(date).locale('fr').format('Do MMMM YYYY')\n }", "title": "" }, { "docid": "e640ff1a70c59d2b6602b4c743d7ecf1", "score": "0.60783803", "text": "function datetimeConfig(moment)\n {\n // Make sure moment is in english and the first day of week is a monday\n moment.lang('en', {\n // customizations.\n week: {\n dow: 1\n },\n calendar: {\n lastDay: '[Yesterday], dddd MMM D',\n sameDay : '[Today], dddd MMM D',\n nextDay : '[Tomorrow], dddd MMM D',\n lastWeek : 'dddd, MMM D',\n nextWeek : 'dddd, MMM D',\n sameElse : 'dddd, MMM D'\n }\n });\n\n // Add America/Detroit timezone, note that this is the same as Toronto\n moment.tz.add(\n [\n 'America/Detroit|EST EDT|50 40|01010101010101010101010|1BQT0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0',\n \"Etc/UTC|UTC|0|0|\"\n ]);\n }", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
8fa25f0a5e32c8056193dfc608d67554
Append a origin to the base
[ { "docid": "b39b80295a6c8ab4a10ba0b180615202", "score": "0.5964105", "text": "function addOrigin(base, handleNumber) {\n var origin = addNodeTo(base, options.cssClasses.origin);\n var handle = addNodeTo(origin, options.cssClasses.handle);\n\n addNodeTo(handle, options.cssClasses.touchArea);\n\n handle.setAttribute(\"data-handle\", handleNumber);\n\n if (options.keyboardSupport) {\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n // 0 = focusable and reachable\n handle.setAttribute(\"tabindex\", \"0\");\n handle.addEventListener(\"keydown\", function(event) {\n return eventKeydown(event, handleNumber);\n });\n }\n\n handle.setAttribute(\"role\", \"slider\");\n handle.setAttribute(\"aria-orientation\", options.ort ? \"vertical\" : \"horizontal\");\n\n if (handleNumber === 0) {\n addClass(handle, options.cssClasses.handleLower);\n } else if (handleNumber === options.handles - 1) {\n addClass(handle, options.cssClasses.handleUpper);\n }\n\n return origin;\n }", "title": "" } ]
[ { "docid": "e7044f1eb8067d41f3ed57adbba4a1a7", "score": "0.6721298", "text": "set origin(value) {}", "title": "" }, { "docid": "bd9f5a30107c526dfff1522b14d52dca", "score": "0.65891916", "text": "origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n }", "title": "" }, { "docid": "bd9f5a30107c526dfff1522b14d52dca", "score": "0.65891916", "text": "origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n }", "title": "" }, { "docid": "96d8c36065653919e2b445290a437d45", "score": "0.65099806", "text": "SetPosition(origin) {\n this.m_origin.Copy(origin);\n }", "title": "" }, { "docid": "ba3498a9832aa3bb819a58fa7c959c93", "score": "0.6453805", "text": "ShiftOrigin(newOrigin) { }", "title": "" }, { "docid": "64e7d4f1ffe8f932f32f3863f8d6f891", "score": "0.63055485", "text": "function addOrigin ( base, handleNumber ) {\n\n var origin = addNodeTo(base, options.cssClasses.origin);\n var handle = addNodeTo(origin, options.cssClasses.handle);\n\n handle.setAttribute('data-handle', handleNumber);\n\n if ( handleNumber === 0 ) {\n addClass(handle, options.cssClasses.handleLower);\n }\n\n else if ( handleNumber === options.handles - 1 ) {\n addClass(handle, options.cssClasses.handleUpper);\n }\n\n return origin;\n }", "title": "" }, { "docid": "375304efd8d79501e64bf702e6d563f0", "score": "0.613514", "text": "function addOrigin ( base, handleNumber ) {\r\n\r\n\t\tvar origin = addNodeTo(base, options.cssClasses.origin);\r\n\t\tvar handle = addNodeTo(origin, options.cssClasses.handle);\r\n\r\n\t\thandle.setAttribute('data-handle', handleNumber);\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\r\n\t\t// 0 = focusable and reachable\r\n\t\thandle.setAttribute('tabindex', '0');\r\n\t\thandle.setAttribute('role', 'slider');\r\n\t\thandle.setAttribute('aria-orientation', options.ort ? 'vertical' : 'horizontal');\r\n\r\n\t\tif ( handleNumber === 0 ) {\r\n\t\t\taddClass(handle, options.cssClasses.handleLower);\r\n\t\t}\r\n\r\n\t\telse if ( handleNumber === options.handles - 1 ) {\r\n\t\t\taddClass(handle, options.cssClasses.handleUpper);\r\n\t\t}\r\n\r\n\t\treturn origin;\r\n\t}", "title": "" }, { "docid": "a03e140908bf8bd812a4a880be5fc841", "score": "0.6113899", "text": "function addOrigin ( base, handleNumber ) {\n\n\t\tvar origin = addNodeTo(base, options.cssClasses.origin);\n\t\tvar handle = addNodeTo(origin, options.cssClasses.handle);\n\n\t\thandle.setAttribute('data-handle', handleNumber);\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n\t\t// 0 = focusable and reachable\n\t\thandle.setAttribute('tabindex', '0');\n\t\thandle.setAttribute('role', 'slider');\n\t\thandle.setAttribute('aria-orientation', options.ort ? 'vertical' : 'horizontal');\n\n\t\tif ( handleNumber === 0 ) {\n\t\t\taddClass(handle, options.cssClasses.handleLower);\n\t\t}\n\n\t\telse if ( handleNumber === options.handles - 1 ) {\n\t\t\taddClass(handle, options.cssClasses.handleUpper);\n\t\t}\n\n\t\treturn origin;\n\t}", "title": "" }, { "docid": "a03e140908bf8bd812a4a880be5fc841", "score": "0.6113899", "text": "function addOrigin ( base, handleNumber ) {\n\n\t\tvar origin = addNodeTo(base, options.cssClasses.origin);\n\t\tvar handle = addNodeTo(origin, options.cssClasses.handle);\n\n\t\thandle.setAttribute('data-handle', handleNumber);\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n\t\t// 0 = focusable and reachable\n\t\thandle.setAttribute('tabindex', '0');\n\t\thandle.setAttribute('role', 'slider');\n\t\thandle.setAttribute('aria-orientation', options.ort ? 'vertical' : 'horizontal');\n\n\t\tif ( handleNumber === 0 ) {\n\t\t\taddClass(handle, options.cssClasses.handleLower);\n\t\t}\n\n\t\telse if ( handleNumber === options.handles - 1 ) {\n\t\t\taddClass(handle, options.cssClasses.handleUpper);\n\t\t}\n\n\t\treturn origin;\n\t}", "title": "" }, { "docid": "bf323e1ddd7aa752652af9ffde509e3b", "score": "0.60958314", "text": "updateOrigin() {\n\n }", "title": "" }, { "docid": "1f2a7dddf27ffb0cb9e61f9b6497b58b", "score": "0.6066399", "text": "SET_ORIGIN(state, data) {\n state.origin = data\n }", "title": "" }, { "docid": "8ab755e5e55627e8cf0771308ce9a1a6", "score": "0.6048774", "text": "setOrigin(origin) {\n this._origin = origin;\n return this;\n }", "title": "" }, { "docid": "8ab755e5e55627e8cf0771308ce9a1a6", "score": "0.6048774", "text": "setOrigin(origin) {\n this._origin = origin;\n return this;\n }", "title": "" }, { "docid": "259ad659ce281b673dbbb13a731147ad", "score": "0.6046462", "text": "function addOrigin(base, handleNumber) {\n var origin = addNodeTo(base, options.cssClasses.origin);\n var handle = addNodeTo(origin, options.cssClasses.handle);\n\n handle.setAttribute(\"data-handle\", handleNumber);\n\n if (options.keyboardSupport) {\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n // 0 = focusable and reachable\n handle.setAttribute(\"tabindex\", \"0\");\n }\n\n handle.setAttribute(\"role\", \"slider\");\n handle.setAttribute(\"aria-orientation\", options.ort ? \"vertical\" : \"horizontal\");\n\n if (handleNumber === 0) {\n addClass(handle, options.cssClasses.handleLower);\n } else if (handleNumber === options.handles - 1) {\n addClass(handle, options.cssClasses.handleUpper);\n }\n\n return origin;\n }", "title": "" }, { "docid": "259ad659ce281b673dbbb13a731147ad", "score": "0.6046462", "text": "function addOrigin(base, handleNumber) {\n var origin = addNodeTo(base, options.cssClasses.origin);\n var handle = addNodeTo(origin, options.cssClasses.handle);\n\n handle.setAttribute(\"data-handle\", handleNumber);\n\n if (options.keyboardSupport) {\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex\n // 0 = focusable and reachable\n handle.setAttribute(\"tabindex\", \"0\");\n }\n\n handle.setAttribute(\"role\", \"slider\");\n handle.setAttribute(\"aria-orientation\", options.ort ? \"vertical\" : \"horizontal\");\n\n if (handleNumber === 0) {\n addClass(handle, options.cssClasses.handleLower);\n } else if (handleNumber === options.handles - 1) {\n addClass(handle, options.cssClasses.handleUpper);\n }\n\n return origin;\n }", "title": "" }, { "docid": "1db751ba5d706dd0de0461473861d717", "score": "0.59959275", "text": "function addOrigin(dest, size, className)\n{\n var radius = Math.max(0.5, Math.min(size.width, size.height)*0.2);\n var originLine = document.createElementNS(\"http://www.w3.org/2000/svg\", \"line\");\n originLine.setAttribute(\"x1\", \"-\" + radius.toString());\n originLine.setAttribute(\"y1\", \"0\");\n originLine.setAttribute(\"x2\", radius.toString());\n originLine.setAttribute(\"y2\", \"0\");\n originLine.setAttribute(\"class\", \"origin \" + className);\n dest.appendChild(originLine);\n\n originLine = document.createElementNS(\"http://www.w3.org/2000/svg\", \"line\");\n originLine.setAttribute(\"x1\", \"0\");\n originLine.setAttribute(\"y1\", \"-\" + radius.toString());\n originLine.setAttribute(\"x2\", \"0\");\n originLine.setAttribute(\"y2\", radius.toString());\n originLine.setAttribute(\"class\", \"origin \" + className);\n dest.appendChild(originLine);\n}", "title": "" }, { "docid": "98b8b74e8cd116a34270e0247873be23", "score": "0.5898523", "text": "get origin() { return this._origin; }", "title": "" }, { "docid": "09e42b2358205524a98b0f5cf8561b1b", "score": "0.5826912", "text": "function setOrigin() {\n\tif ( markers.length < 1 ) {\n\t\treturn;\n\t}\n\torigin = markers[markers.length-1].getPosition();\n\tremovePath();\n\tvar origin_el = document.getElementById(\"origin\");\n\torigin_el.innerHTML = \"&nbsp;Lat: \" + origin.lat().toFixed(6) + \", Long: \" + origin.lng().toFixed(6) + \"&nbsp;\";\n\torigin_el.style.background = \"#080\";\n}", "title": "" }, { "docid": "923987172d8049a2c7ae2999010e2278", "score": "0.5757258", "text": "function setOrigin (newOrigin) {\n\n // update origins\n let originDiff = subtract([], newOrigin, origin)\n origin = newOrigin\n originMax = max([], origin, originMax)\n originMin = min([], origin, originMin)\n\n // get dimensions\n let canvasDimensions = getDimensions(canvas)\n let bufferDimensions = getDimensions(buffer)\n let maxDimensions = add([], canvasDimensions,\n add([], originMax, abs(originMin)))\n\n // resize\n let maxDimensionsDiff = subtract([], maxDimensions, bufferDimensions)\n resizeCanvas({\n canvas: buffer,\n diff: maxDimensionsDiff,\n from: getResizeFrom(buffer, originDiff)\n })\n\n // redraw\n originDraw = min([], [0, 0], add([], originDraw, originDiff))\n refresh()\n }", "title": "" }, { "docid": "214c75628327a2d578e23920b08bf1f8", "score": "0.56816787", "text": "setOrigin(){\n // Check the state of this zone\n if (this.state_o) {\n // If it's already an origin, we deselect it\n this.state_o = false;\n // Remove the red O\n this.g.select(\"#origin\").text(\"\");\n // Remove it from the restrictions\n od_selection.Origins.delete(this.name);\n } else {\n // Otherwise, we set it as an origin\n this.state_o = true;\n // Add it in the restrictions Object\n od_selection.Origins.add(this.name);\n // And show the O\n this.g.select(\"#origin\").text(\"O\");\n }\n }", "title": "" }, { "docid": "ed7a2ee3549089898c83fafc13e27a20", "score": "0.5643047", "text": "setOrigin(origin) {\n this._positionStrategy.setOrigin(origin);\n return this;\n }", "title": "" }, { "docid": "ed7a2ee3549089898c83fafc13e27a20", "score": "0.5643047", "text": "setOrigin(origin) {\n this._positionStrategy.setOrigin(origin);\n return this;\n }", "title": "" }, { "docid": "b298a73fe6e70fd03f5c3db333f19b54", "score": "0.5618142", "text": "get origin() {}", "title": "" }, { "docid": "8294c76bbc1867dedf3ee86da249a5b9", "score": "0.55797607", "text": "ShiftOrigin(newOrigin) {\n this.m_tree.ShiftOrigin(newOrigin);\n }", "title": "" }, { "docid": "4c026b753284bdd1f1339c7f79d8deca", "score": "0.55022854", "text": "function addNodeTo(addTarget, className) {\n var div = scope_Document.createElement(\"div\");\n\n if (className) {\n addClass(div, className);\n }\n\n addTarget.appendChild(div);\n return div;\n } // Append a origin to the base", "title": "" }, { "docid": "b74aa8b07e4ca263e6f6838e70c8077c", "score": "0.5481243", "text": "function addOrigin(){\n chrome.tabs.query({currentWindow: true, active: true}, function(tabs){\n var url = new URL(tabs[0].url);\n var list = loadFromList();\n if(list.indexOf(url.origin) > -1) return;\n list.push(url.origin);\n chrome.storage.local.set({\n whiteList: list,\n }, function() {\n // TO-DO\n // Enable when finished\n // blink(\"url-list\", 1000);\n });\n restore_options();\n });\n}", "title": "" }, { "docid": "b1351902ab299457083ac84c7c3af400", "score": "0.5468683", "text": "get origin() {\n return this._origin;\n }", "title": "" }, { "docid": "9cc8979c9c1fafa1daaf03aea4f265d0", "score": "0.5459226", "text": "function prependOrigin(url) {\r\n if (url.match(/^(http|ws)(s?):/i)) {\r\n // has origin (non-relative) || \r\n return url;\r\n } else if (window && window.location && window.location.origin) {\r\n return window.location.origin + ((url.charAt(0) !== \"/\") ? \"/\" : \"\") + url;\r\n // that's clear right?\r\n } else {\r\n return url;\r\n }\r\n }", "title": "" }, { "docid": "f3c5755158cf4c880df4d9a3da3a2ec3", "score": "0.54188335", "text": "function move (originDiff) {\n setOrigin(add([], origin, originDiff))\n }", "title": "" }, { "docid": "f6c0d689a7863da21a2465a882100897", "score": "0.54125035", "text": "function addNodeTo(addTarget, className) {\n var div = scope_Document.createElement(\"div\");\n\n if (className) {\n addClass(div, className);\n }\n\n addTarget.appendChild(div);\n return div;\n } // Append a origin to the base", "title": "" }, { "docid": "cea5cb7a8c22cc0ce299f7333b7aac34", "score": "0.53660154", "text": "originPlusMatrixTimesXY(origin, x, y, result) {\n return Point3dVector3d_1.Point3d.create(origin.x + this.coffs[0] * x + this.coffs[1] * y, origin.y + this.coffs[3] * x + this.coffs[4] * y, origin.z + this.coffs[6] * x + this.coffs[7] * y, result);\n }", "title": "" }, { "docid": "bfca30e32dd93a337905ec6a20fd7cb5", "score": "0.53649503", "text": "set(origin, normal) {\n this._origin.setFrom(origin);\n this._normal.setFrom(normal);\n }", "title": "" }, { "docid": "feda28b93f80db918d6b05a604d5b093", "score": "0.53649473", "text": "function _appendBase(c) {\n if (_base)\n _base.appendChild(c)\n else\n document.body.append(c)\n return (c)\n}", "title": "" }, { "docid": "32c71c29068eaf70f60cd05bb85b180f", "score": "0.53565913", "text": "constructor(origin, normal) {\n this._origin = origin;\n this._normal = normal;\n }", "title": "" }, { "docid": "630f6cd289f22610e638167a3aff8edb", "score": "0.53360313", "text": "function setOrigin() {\n\t\t// measure elements\n\t\tvar targetOffset = $target.offset();\n\t\tvar frameOffset = $frame.offset();\n\t\tvar targetX = Number(targetOffset.left.toFixed(0));\n\t\tvar targetY = Number(targetOffset.top.toFixed(0));\n\t\tvar frameX = Number(frameOffset.left.toFixed(0));\n\t\tvar frameY = Number(frameOffset.top.toFixed(0));\n\t\tvar frameWidth = $frame.width();\n\t\tvar frameHeight = $frame.height();\n\t\t// calculate origin x\n\t\tvar x = frameX;\n\t\tx -= targetX;\n\t\tx += (frameWidth / 2);\n\t\t// calculate origin y\n\t\tvar y = frameY;\n\t\ty -= targetY;\n\t\ty += (frameHeight / 2);\n\t\t// set css values\n\t\t$target.css({\n\t\t\t'transform-origin': x + 'px ' + y + 'px'\n\t\t});\n\t}", "title": "" }, { "docid": "d118af6d110da9fe267b62f3c296b389", "score": "0.53342414", "text": "function Origin(){\r\n this.ver15_or_later = (parseFloat(version.substr(0, 2)) >= 15); // CS5 or later\r\n this.ver14 = (version.substr(0, 2) == \"14\"); // CS4\r\n \r\n if(this.ver15_or_later){\r\n this.saved_coord_system = app.coordinateSystem;\r\n app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;\r\n\r\n var idx = app.activeDocument.artboards.getActiveArtboardIndex();\r\n this.ab = app.activeDocument.artboards[idx];\r\n \r\n var o = this.ab.rulerOrigin;\r\n var r = this.ab.artboardRect;\r\n this.saved_origin = [o[0], o[1]];\r\n this.ab.rulerOrigin = [0, r[1] - r[3]];\r\n \r\n } else if(this.ver14){\r\n var o = app.activeDocument.rulerOrigin;\r\n this.saved_origin = [o[0], o[1]];\r\n app.activeDocument.rulerOrigin = [0, 0];\r\n }\r\n\r\n this.restore = function(){\r\n if(this.ver15_or_later){\r\n this.ab.rulerOrigin = this.saved_origin;\r\n app.coordinateSystem = this.saved_coord_system;\r\n \r\n } else if(this.ver14){\r\n app.activeDocument.rulerOrigin = this.saved_origin;\r\n }\r\n };\r\n \r\n return this;\r\n}", "title": "" }, { "docid": "b2545efc23a830a00b5b24b8f73aa0e5", "score": "0.53265256", "text": "static addOrigin(originName, originVersion, originParameters) {\n if (typeof originName !== 'string') {\n console.error(`Flurry.addOrigin: originName must be string. Got ${originName}`);\n return;\n }\n\n if (typeof originVersion !== 'string') {\n console.error(`Flurry.addOrigin: originVersion must be string. Got ${originVersion}`);\n return;\n }\n\n if (arguments.length === 2) {\n ReactNativeFlurry.addOrigin(originName, originVersion);\n } else if (arguments.length === 3) {\n if (Object.prototype.toString.call(originParameters).includes('Object')) {\n ReactNativeFlurry.addOriginParams(originName, originVersion, originParameters);\n } else if (Object.prototype.toString.call(originParameters).includes('Map')) {\n ReactNativeFlurry.addOriginParams(originName, originVersion, Object.fromEntries(originParameters));\n }\n }\n }", "title": "" }, { "docid": "91f470cadcfce7438381926a1b4275eb", "score": "0.5230022", "text": "_addOriginDestination() {\n const locations = this._opts.transitMatrix.getLocations().features;\n const labels = this._opts.transitMatrix.getLabels();\n\n this._spliceNetworkWith({\n maxDistance : this._opts.maxDistance,\n points : locations,\n genNode : (corridor, idx) => ({\n label : labels[idx],\n data : { loc : locations[idx], type : \"location\" }\n })\n });\n }", "title": "" }, { "docid": "f1ae952da1e9228c55c397bc03047ce6", "score": "0.51901054", "text": "set origin(eventOrigin) {\n this._origin = eventOrigin;\n }", "title": "" }, { "docid": "02b82330cb0a3aa7b54b14f97e557376", "score": "0.5182696", "text": "constructor(orig, dir){\n\t\tthis.origin = orig;\n\t\tthis.direction = dir;\n\t}", "title": "" }, { "docid": "7897a5691a3b2e3a7cc759e3c10f04b2", "score": "0.51714104", "text": "extendPoint(point) { this.extendXYZ(point.x, point.y, point.z); }", "title": "" }, { "docid": "fcf2c46adcebbb1b2576b871811141fe", "score": "0.51560944", "text": "extendPoint(point) { this.extendXY(point.x, point.y); }", "title": "" }, { "docid": "6fcb4f3490346cd9225b0f3d49b9dd3d", "score": "0.5143536", "text": "append(){}", "title": "" }, { "docid": "a7ec4013fec4781ff8d4f4d6f5f63a6c", "score": "0.5133065", "text": "_originChanged(element, origin, elementInfo) {\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo, origin);\n this._lastFocusOrigin = origin;\n }", "title": "" }, { "docid": "a5636e85b65479d327f70413ee485d23", "score": "0.51327217", "text": "function calStackOrigin(){\r\n\tstackOrigin += origin;\r\n}", "title": "" }, { "docid": "fafa8cbdde6489e4ad4123f2ce982463", "score": "0.5115402", "text": "function setOriginMarker(origin) {\r\n var originMrk = new google.maps.Marker({\r\n map: map,\r\n position: origin, \r\n icon: \"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|000066\"\r\n });\r\n}", "title": "" }, { "docid": "1e50869a4ef0b3f0f8f762a6b2021bf6", "score": "0.51022196", "text": "function _prependBase(base, iri) {\n // skip IRI processing\n if(base === null) {\n return iri;\n }\n // already an absolute IRI\n if(iri.indexOf(':') !== -1) {\n return iri;\n }\n\n // parse base if it is a string\n if(_isString(base)) {\n base = jsonld.url.parse(base || '');\n }\n\n // parse given IRI\n var rel = jsonld.url.parse(iri);\n\n // start hierarchical part\n var hierPart = (base.protocol || '');\n if(rel.authority) {\n hierPart += '//' + rel.authority;\n }\n else if(base.href !== '') {\n hierPart += '//' + base.authority;\n }\n\n // per RFC3986 normalize\n var path;\n\n // IRI represents an absolute path\n if(rel.pathname.indexOf('/') === 0) {\n path = rel.pathname;\n }\n else {\n path = base.pathname;\n\n // append relative path to the end of the last directory from base\n if(rel.pathname !== '') {\n path = path.substr(0, path.lastIndexOf('/') + 1);\n if(path.length > 0 && path.substr(-1) !== '/') {\n path += '/';\n }\n path += rel.pathname;\n }\n }\n\n // remove slashes and dots in path\n path = _removeDotSegments(path, hierPart !== '');\n\n // add query and hash\n if(rel.query) {\n path += '?' + rel.query;\n }\n if(rel.hash) {\n path += rel.hash;\n }\n\n var rval = hierPart + path;\n\n if(rval === '') {\n rval = './';\n }\n\n return rval;\n}", "title": "" }, { "docid": "ff9475f1100206ca25b41a143be59aee", "score": "0.5086597", "text": "function moveOrigin(root) {\n if ('Offset' in root.value) {\n root.value.WEOriginX = {\n type: 'int',\n value: root.value.Offset.value[0]\n };\n root.value.WEOriginY = {\n type: 'int',\n value: root.value.Offset.value[1]\n };\n root.value.WEOriginZ = {\n type: 'int',\n value: root.value.Offset.value[2]\n };\n\n delete root.value.Offset;\n }\n }", "title": "" }, { "docid": "9264940251448238579fcf09a8b98304", "score": "0.5083644", "text": "_originChanged(element, origin, elementInfo) {\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo.subject, origin);\n this._lastFocusOrigin = origin;\n }", "title": "" }, { "docid": "9264940251448238579fcf09a8b98304", "score": "0.5083644", "text": "_originChanged(element, origin, elementInfo) {\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo.subject, origin);\n this._lastFocusOrigin = origin;\n }", "title": "" }, { "docid": "1e5d9393d0813d6dfce67eec6acfaedc", "score": "0.5076871", "text": "function Origin(){\n var ver15_or_later = (parseFloat(version.substr(0, 2)) >= 15); // CS5 or later\n var ver14 = (version.substr(0, 2) == \"14\"); // CS4\n \n if(ver15_or_later){\n var saved_coord_system = app.coordinateSystem;\n app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;\n\n var idx = app.activeDocument.artboards.getActiveArtboardIndex();\n var ab = app.activeDocument.artboards[idx];\n \n var o = ab.rulerOrigin;\n var r = ab.artboardRect;\n var saved_origin = [o[0], o[1]];\n ab.rulerOrigin = [0, r[1] - r[3]];\n \n } else if(ver14){\n var o = app.activeDocument.rulerOrigin;\n var saved_origin = [o[0], o[1]];\n app.activeDocument.rulerOrigin = [0, 0];\n }\n\n this.restore = function(){\n if(ver15_or_later){\n ab.rulerOrigin = saved_origin;\n app.coordinateSystem = saved_coord_system;\n \n } else if(ver14){\n app.activeDocument.rulerOrigin = saved_origin;\n }\n };\n \n return this;\n}", "title": "" }, { "docid": "28d00e8aa3e5f9e255cd02e0c6d0cf66", "score": "0.5071112", "text": "get origin() {\n if (this.$origin) return this.$origin;\n this.$origin = v2_sub(this.global, this.canvasWidget.global);\n return this.$origin;\n }", "title": "" }, { "docid": "5b129819f416f3596e34f5def0623033", "score": "0.5032645", "text": "set(origin, direction) {\n this.origin.setFrom(origin);\n this.direction.setFrom(direction);\n }", "title": "" }, { "docid": "9f4d4ce7360488aadf22a43cfbbc61fd", "score": "0.49980575", "text": "function _prependBase(base, iri) {\n if(iri === '' || iri.indexOf('#') === 0) {\n return base + iri;\n }\n else {\n // prepend last directory for base\n return base.substr(0, base.lastIndexOf('/') + 1) + iri;\n }\n}", "title": "" }, { "docid": "579321b4b3439892fe2be5d4c9defca9", "score": "0.49908596", "text": "function addBase($query_div,base){\n var $base=$('<p></p>')\n .text('Results for the base ')\n .append('<b>'+base.name+'</b>')\n .append(' You can found it here: ');\n addURIElement($base,base.plateforme);\n $($query_div).append($base);\n}", "title": "" }, { "docid": "5b20b1c49d8b195c8610a6074bd6b3c3", "score": "0.4972145", "text": "setFrom(source) { this.set(source.origin, source.direction); }", "title": "" }, { "docid": "639cf7701eb133b058c94c5b8f9aed95", "score": "0.49667266", "text": "moveToOrigin() {\n var dx = (this.startPos.x - this.pos.x);\n\t\tvar dy = (this.startPos.y - this.pos.y);\n\n\t\tthis.pos.x += dx * 0.2;\n\t\tthis.pos.y += dy * 0.2;\n\n var d = Math.sqrt(dx * dx + dy * dy)\n\n\t\tif(d > 100)\n\t\t\tthis.addNoise();\n }", "title": "" }, { "docid": "a6b8daaa88612b7adcd2f297e1923cac", "score": "0.49664703", "text": "constructor(origin, direction) {\n this.origin = origin;\n this.direction = direction;\n }", "title": "" }, { "docid": "20263b92efbae5db7f52272394af332d", "score": "0.49465272", "text": "async showOriginDest() {\n this.removeFeatures(\"originDestination\");\n this.addPoints({\n id : \"originDestination\",\n features : this.getTransitMatrix().getLocations(),\n allowOverlap : true\n });\n }", "title": "" }, { "docid": "8791b3f85984b97f646a1c6f39e1f47d", "score": "0.4929976", "text": "withBase(base) {\n return new Path(this.frag, base);\n }", "title": "" }, { "docid": "8e2b127f71a116535281a55362cadebb", "score": "0.49185878", "text": "setFrom(source) {\n this.set(source._origin, source._normal);\n }", "title": "" }, { "docid": "eb15d1cb052a875da4fe46752a61a85a", "score": "0.49069872", "text": "static reinitializeGeometry(copy, origin) {\n\n for(let i = 0; i < copy.vertices.length; i++) {\n copy.vertices[i].copy(origin.vertices[i]);\n }\n\n for(let i = 0; i < copy.faces.length; i++) {\n copy.faces[i].copy(origin.faces[i]);\n }\n\n copy.matrix.identity();\n }", "title": "" }, { "docid": "d2cb82f2a837a0c1f52b74c6b15ff156", "score": "0.48944092", "text": "function addApprovedOrigin(origin) {\n if (origin) {\n var origins = getApprovedOrigins();\n origins.push(origin);\n _saveApprovedOrigins(origins);\n }\n}", "title": "" }, { "docid": "badb2469b83bf0d2eb8e922b38ca3ed2", "score": "0.48775828", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "9523214fb284e0ebd909728e19d7a272", "score": "0.48602983", "text": "setOrigin(x, y) {\n this._x = -x;\n this._y = -y;\n this.internalX = this._x / this.scaleX;\n this.internalY = this._y / this.scaleY;\n this.draw();\n }", "title": "" }, { "docid": "902bddb5f88d4c11f320f876fbd8566e", "score": "0.484418", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "37d1e8c340aa42f0d0353161c2d5b6af", "score": "0.48286456", "text": "prepend(_location, _content) {\n throw new exceptions_1.MethodNotSupported('prepend', this.constructor.name);\n }", "title": "" }, { "docid": "287c4b5fd666e93c2a55872164258669", "score": "0.48269916", "text": "expandInPlace(delta) {\n this.setDirect(this.low.x - delta, this.low.y - delta, this.low.z - delta, this.high.x + delta, this.high.y + delta, this.high.z + delta, true);\n }", "title": "" }, { "docid": "0f4d36cec91ba536e258af8e8683d4df", "score": "0.4811324", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "f89fe8ec78dd346351e40aa8f14fdc0d", "score": "0.48030618", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}", "title": "" }, { "docid": "f4c6c1c15bc1560dde731de856cf675d", "score": "0.47972366", "text": "function prepend(arr, other) {\n while (arr.length < fullLength) {\n\n // Move to, line to or curve to?\n arr[0] = other[fullLength - arr.length];\n\n // Prepend a copy of the first point\n insertSlice(arr, arr.slice(0, numParams), 0);\n\n // For areas, the bottom path goes back again to the left, so we\n // need to append a copy of the last point.\n if (isArea) {\n insertSlice(\n arr,\n arr.slice(arr.length - numParams), arr.length\n );\n i--;\n }\n }\n arr[0] = 'M';\n }", "title": "" }, { "docid": "f4c6c1c15bc1560dde731de856cf675d", "score": "0.47972366", "text": "function prepend(arr, other) {\n while (arr.length < fullLength) {\n\n // Move to, line to or curve to?\n arr[0] = other[fullLength - arr.length];\n\n // Prepend a copy of the first point\n insertSlice(arr, arr.slice(0, numParams), 0);\n\n // For areas, the bottom path goes back again to the left, so we\n // need to append a copy of the last point.\n if (isArea) {\n insertSlice(\n arr,\n arr.slice(arr.length - numParams), arr.length\n );\n i--;\n }\n }\n arr[0] = 'M';\n }", "title": "" }, { "docid": "1d486b56de78705257a96d77b15c8d16", "score": "0.47971818", "text": "function calculateBasePath( base, zone, target ) {\n if ( zone === zones.zone.insertion ) {\n if (!target) { target = 'unknown'; }\n base += (zones.zone.windowed + '/' + zones.zone.insertion + '/' + target.toLowerCase() + '/');\n } else {\n base += (zone + '/');\n }\n return base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.47961503", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.47961503", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.47961503", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.47961503", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "a6b274e9bb600ceffd7dd7362f22d658", "score": "0.4791049", "text": "function setOrigin(elem,obj) {\n\tvar x = ~~(obj.origin%3);\n\tvar y = ~~(obj.origin/3);\n\t\n\t// Transform origin\n\tvar t = (x*50) + \"% \" + (y*50) + \"%\";\n\telem.style[\"transformOrigin\"] = t;\n\telem.style[\"WebkitTransformOrigin\"] = t;\n\telem.style[\"MozTransformOrigin\"] = t;\n\t\n\t// Match (0px,0px) to origin\n\tx = x/2;\n\ty = y/2;\n\telem.style.top = (-y*elem.height) + \"px\";\n\telem.style.left = (-x*elem.width) + \"px\";\n}", "title": "" }, { "docid": "6d588229517298e8bf03d8bbd0dc42bd", "score": "0.47888902", "text": "function prepend(arr, other) {\n while (arr.length < fullLength) {\n \n // Move to, line to or curve to?\n arr[0] = other[fullLength - arr.length];\n\n // Prepend a copy of the first point\n insertSlice(arr, arr.slice(0, numParams), 0);\n\n // For areas, the bottom path goes back again to the left, so we need\n // to append a copy of the last point.\n if (isArea) {\n insertSlice(arr, arr.slice(arr.length - numParams), arr.length);\n i--;\n }\n }\n arr[0] = 'M';\n }", "title": "" }, { "docid": "a9933ad42286427bcbb41af9a515bf60", "score": "0.47818255", "text": "function pushOrConcat(base, toPush) {\n \tif (toPush) {\n \t\tif (helpers$1.isArray(toPush)) {\n \t\t\t// base = base.concat(toPush);\n \t\t\tArray.prototype.push.apply(base, toPush);\n \t\t} else {\n \t\t\tbase.push(toPush);\n \t\t}\n \t}\n\n \treturn base;\n }", "title": "" }, { "docid": "13c8c0a4906d49d3f974935466c3d08e", "score": "0.47817156", "text": "constructor(origin, direction) {\n this.origin = origin;\n this.direction = direction.normalized();\n }", "title": "" }, { "docid": "8d2ea76f0c8bc06aebf12c9ffb467ce9", "score": "0.47749034", "text": "function Identity$prototype$concat(other) {\n return Identity (Z.concat (this.value, other.value));\n }", "title": "" }, { "docid": "7c525b5e3af26d1a354bfc91a476db1c", "score": "0.47738153", "text": "addCoord(x, y) {\n this.add(new Point(x, y));\n }", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.47670743", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "1cad13d920568cb7a0a19a82c7b94c1a", "score": "0.47637793", "text": "setOrigin(x, y) {\n if (this.version === 3) {\n this.sprite.setOrigin(x, y);\n } else {\n this.sprite.anchor.set(x, y);\n }\n\n this.text.x = this.sprite.width / 2;\n this.text.y = this.sprite.height / 2;\n this.currentTextY = this.sprite.height / 2;\n\n return this;\n }", "title": "" }, { "docid": "bbb8c20de824a3acd2e3c2cf345fca0a", "score": "0.4741826", "text": "function pushOrConcat(base, toPush) {\n\t\t\tif (toPush) {\n\t\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t\t// base = base.concat(toPush);\n\t\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t\t} else {\n\t\t\t\t\tbase.push(toPush);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn base;\n\t\t}", "title": "" } ]
c0b51f1f272675f9eedd5d6ff1d14172
Render the DOM representation of the text of a line. Also builds up a 'line map', which points at the DOM nodes that represent specific stretches of text, and is used by the measuring code. The returned object contains the DOM node, this map, and information about linewide styles that were set by the mode.
[ { "docid": "57f1d0b07ed50992136736cf8ac3ea9e", "score": "0.72590965", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "title": "" } ]
[ { "docid": "1c14b3fabae5325a3496e185014d8a15", "score": "0.7246114", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n\t builder.addToken = buildTokenSplitSpaces(builder.addToken);\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t insertLineContent(line, builder, getLineStyles(cm, line));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t return builder;\n\t }", "title": "" }, { "docid": "9b176fed1d20a7b5a9743415827f4e00", "score": "0.7208202", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "39f05e757b649904b001451428fae9a0", "score": "0.7193241", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "d8a84602c290b8e26dd03b4737830d01", "score": "0.7191644", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content]), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "title": "" }, { "docid": "7b29095c24506c8756682ff7c76140e8", "score": "0.7051668", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "96ca7be49a70fe49dc68d20618218965", "score": "0.70414203", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "3bd01426aa63cbb75cb27e09c7170879", "score": "0.70395267", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n\t lineView.measure = {}\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n\t builder.pos = 0\n\t builder.addToken = buildToken\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n\t builder.map = []\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n\t if (line.styleClasses.textClass)\n\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map\n\t lineView.measure.cache = {}\n\t } else {\n\t ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t { builder.content.className = \"cm-tab-wrap-hack\" }\n\t }\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n\t if (builder.pre.className)\n\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\t\n\t return builder\n\t}", "title": "" }, { "docid": "c0e45be2f1f2d89c980c8601cf0512ca", "score": "0.7030195", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "title": "" }, { "docid": "e11ed4e338e47fa58b8f658b5632196a", "score": "0.6994661", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\n\t return builder;\n\t }", "title": "" }, { "docid": "e11ed4e338e47fa58b8f658b5632196a", "score": "0.6994661", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\n\t return builder;\n\t }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.6986411", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.6986411", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.6986411", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "48a11e2d1d7c52866164d80a6c341c72", "score": "0.6986411", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "df36549f2052ed4b35b30257bfd05131", "score": "0.69811374", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = void 0\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "title": "" }, { "docid": "a0ce7259e5d40e78d5540e80ef2950bd", "score": "0.6976355", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "a0ce7259e5d40e78d5540e80ef2950bd", "score": "0.6976355", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "25c4861b8c44fc636c86c7af5fafb8c9", "score": "0.6968266", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "title": "" }, { "docid": "25c4861b8c44fc636c86c7af5fafb8c9", "score": "0.6968266", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947756", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947756", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947756", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947756", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947756", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "4224e920e04d6da721a80da30b49022d", "score": "0.6944379", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = { pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\") };\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line,\n order = void 0;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) {\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) {\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n }\n if (line.styleClasses.textClass) {\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0) {\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className) {\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n }\n\n return builder;\n }", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.6932289", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "335626072e1ab31f8e3c0a484498746f", "score": "0.6921672", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "335626072e1ab31f8e3c0a484498746f", "score": "0.6921672", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "c7b81bcb063c40a27c64457e97ddccb2", "score": "0.68976045", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null), builder = {\n pre: elt(\"pre\", [ content ], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: !1,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {};\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = void 0;\n builder.pos = 0, builder.addToken = buildToken, // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n hasBadBidiRects(cm.display.measure) && (order = getOrder(line)) && (builder.addToken = buildTokenBadBidi(builder.addToken, order)), \n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)), \n line.styleClasses && (line.styleClasses.bgClass && (builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\")), \n line.styleClasses.textClass && (builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"))), \n // Ensure at least a single node is present, for measuring.\n 0 == builder.map.length && builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))), \n // Store the map and a cache object for the current logical line\n 0 == i ? (lineView.measure.map = builder.map, lineView.measure.cache = {}) : ((lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map), \n (lineView.measure.caches || (lineView.measure.caches = [])).push({}));\n }\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) && (builder.content.className = \"cm-tab-wrap-hack\");\n }\n return signal(cm, \"renderLine\", cm, lineView.line, builder.pre), builder.pre.className && (builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\")), \n builder;\n }", "title": "" }, { "docid": "f1c6051d87a0491e9b89dab1f6c69f65", "score": "0.6891054", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null), builder = {\n pre: eltP(\"pre\", [ content ], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: !1,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {};\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = void 0;\n builder.pos = 0, builder.addToken = buildToken, // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)) && (builder.addToken = buildTokenBadBidi(builder.addToken, order)), \n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)), \n line.styleClasses && (line.styleClasses.bgClass && (builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\")), \n line.styleClasses.textClass && (builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"))), \n // Ensure at least a single node is present, for measuring.\n 0 == builder.map.length && builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))), \n // Store the map and a cache object for the current logical line\n 0 == i ? (lineView.measure.map = builder.map, lineView.measure.cache = {}) : ((lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map), \n (lineView.measure.caches || (lineView.measure.caches = [])).push({}));\n }\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) && (builder.content.className = \"cm-tab-wrap-hack\");\n }\n return signal(cm, \"renderLine\", cm, lineView.line, builder.pre), builder.pre.className && (builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\")), \n builder;\n }", "title": "" }, { "docid": "00fe21043d25a16534f8f34a121f7d79", "score": "0.6335545", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "a2256afa69dd82693aa80ea01b475e9e", "score": "0.6319861", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) {\n lineView.bgClass = built.bgClass;\n }\n if (built.textClass) {\n lineView.textClass = built.textClass;\n }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.6314923", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.6314923", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.6314923", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.6314923", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.6314923", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "33c06800f19b4e4cdaf076be7545230b", "score": "0.62854326", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView)\n\t lineView.text = lineView.node = built.pre\n\t if (built.bgClass) { lineView.bgClass = built.bgClass }\n\t if (built.textClass) { lineView.textClass = built.textClass }\n\t\n\t updateLineClasses(lineView)\n\t updateLineGutter(cm, lineView, lineN, dims)\n\t insertLineWidgets(cm, lineView, dims)\n\t return lineView.node\n\t}", "title": "" }, { "docid": "a91fc5e8b4313c6435e9cfb714ae8ae7", "score": "0.6271952", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "title": "" }, { "docid": "a91fc5e8b4313c6435e9cfb714ae8ae7", "score": "0.6271952", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "title": "" }, { "docid": "a91fc5e8b4313c6435e9cfb714ae8ae7", "score": "0.6271952", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6270997", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6270997", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6270997", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6270997", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6270997", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6270997", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6261712", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "7310a51cd2e4fecc7b04607ea3e67a34", "score": "0.6261371", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "2be3a6b65d8b84b8a34668a649dc39e7", "score": "0.6255469", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "2be3a6b65d8b84b8a34668a649dc39e7", "score": "0.6255469", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "a9c6ff8caf5a93bd089a4b7223ce97ce", "score": "0.6254944", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62524825", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "2937905ab21648d7dd87ddf7ff65edf0", "score": "0.6247814", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n return lineView.text = lineView.node = built.pre, built.bgClass && (lineView.bgClass = built.bgClass), \n built.textClass && (lineView.textClass = built.textClass), updateLineClasses(lineView), \n updateLineGutter(cm, lineView, lineN, dims), insertLineWidgets(cm, lineView, dims), \n lineView.node;\n }", "title": "" }, { "docid": "3ce1ca346f00c46dfed5da8773b7d220", "score": "0.6243044", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n return lineView.text = lineView.node = built.pre, built.bgClass && (lineView.bgClass = built.bgClass), \n built.textClass && (lineView.textClass = built.textClass), updateLineClasses(cm, lineView), \n updateLineGutter(cm, lineView, lineN, dims), insertLineWidgets(cm, lineView, dims), \n lineView.node;\n }", "title": "" }, { "docid": "0659b78047daa542b01cfb67b319a354", "score": "0.62424374", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\t\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "0659b78047daa542b01cfb67b319a354", "score": "0.62424374", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\t\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "9f412e60ecb2dcead868219a63a292ee", "score": "0.6183548", "text": "function Line ( text, styles ) {\n this.styles = styles || [ text, null ];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "title": "" }, { "docid": "56e27b6ecee98bf60f0c7e093c8c014b", "score": "0.60547906", "text": "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "title": "" }, { "docid": "5f0caf6402b65dd79b891bf2ed1427a1", "score": "0.59572875", "text": "function renderLine(line) {\n var extraClass = line.isError ? ' kb-error' : '';\n\n return div({\n class: 'kblog-line' + extraClass\n }, [\n div({ class: 'kblog-num-wrapper' }, [\n div({ class: 'kblog-line-num' }, [\n String(line.lineNumber)\n ])\n ]),\n div({\n class: 'kblog-text',\n style: {\n overflow: 'auto'\n }\n }, [\n div({ style: { marginBottom: '6px' } }, sanitize(line.text))\n ])\n ]);\n }", "title": "" }, { "docid": "04dcb415ce7cba0c43826b6044c773e6", "score": "0.5940476", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "16cf24ba025bbad31e411e9f84650fc4", "score": "0.5894289", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.58930385", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.58930385", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.58930385", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.58930385", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.58930385", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1c6225a17ae1d2ef3d87e62db89258eb", "score": "0.5892478", "text": "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "title": "" }, { "docid": "1c6225a17ae1d2ef3d87e62db89258eb", "score": "0.5892478", "text": "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "title": "" }, { "docid": "1c6225a17ae1d2ef3d87e62db89258eb", "score": "0.5892478", "text": "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "title": "" }, { "docid": "1c6225a17ae1d2ef3d87e62db89258eb", "score": "0.5892478", "text": "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "title": "" }, { "docid": "1c6225a17ae1d2ef3d87e62db89258eb", "score": "0.5892478", "text": "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "title": "" }, { "docid": "365e610e95045da97bf0243ed489989b", "score": "0.5883938", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n return ext && ext.line == lineView.line ? (cm.display.externalMeasured = null, lineView.measure = ext.measure, \n ext.built) : buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "365e610e95045da97bf0243ed489989b", "score": "0.5883938", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n return ext && ext.line == lineView.line ? (cm.display.externalMeasured = null, lineView.measure = ext.measure, \n ext.built) : buildLineContent(cm, lineView);\n }", "title": "" } ]
58c348920e9b67e8856436b03d6bdc80
TODO Add settings and delete buttons to the league table Settings shows a dialog to update the league settings Delete will delete the league after a confirmation
[ { "docid": "1e8a88183908d0de513239597375773b", "score": "0.0", "text": "render() {\n return (\n <Container>\n <Table responsive=\"sm\" size=\"sm\" striped hover>\n <thead>\n <tr>\n {columns.map((title, index) => (\n <th>{title}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {this.props.leagues ? \n this.props.leagues.map(league => (\n <tr key={league._id} team-id={league._id}>\n <LinkContainer to={`/league/${league._id}`}>\n <td component=\"th\" scope=\"row\">{league.name}</td>\n </LinkContainer>\n <td data-league={league} onClick={this.handleEditClick}>Edit</td>\n </tr>\n \n ))\n : <tr><td>Loading...</td></tr>\n }\n </tbody>\n </Table>\n </Container>\n );\n }", "title": "" } ]
[ { "docid": "688a5bec2ae79ea03965f1d60b9c039c", "score": "0.5941201", "text": "function addLeague(league) {\n leagues.push(league); \n }", "title": "" }, { "docid": "0f6328fb01ff735fd129e5798aa4c087", "score": "0.5717912", "text": "function hapusTeam(id){\n deleteById(id);\n getSavedTeams();\n}", "title": "" }, { "docid": "fa9898b9fcb54f02a380faf1f0b0c3c8", "score": "0.5597548", "text": "function loadleaguesForLeagueSection(leagues, leagueCode) {\n $(\"#contentDiv\").empty();\n $(\"#contentDiv\").removeClass(\"text-center\");\n $(\"#footerDiv\").addClass(\"fixed-bottom\");\n $(\"#contentDiv\").append($(\"<section>\")\n .attr(\"id\", \"leagueSection\")\n // User friendly message for league dropdown\n .append($(\"<h3/>\")\n .html(\"Select the Leagues from the dropdown list:\")\n .attr(\"class\", \"font-italic\"))\n // League Dropdown Div and DDL\n .append($(\"<div>\")\n // .attr(\"class\", \"row\")\n .append($(\"<label/>\")\n .attr(\"class\", \"d-none d-md-inline\")\n .attr(\"for\", \"selectLeagueList\")\n .html(\"League Lists\"))\n .append($(\"<select/>\")\n .attr(\"id\", \"selectLeagueList\")\n .attr(\"class\", \"d-none d-inline form-control col-md-3 ml-2\")\n .on(\"change\", function(e) {\n // prevent all default action and do as we direct\n e.preventDefault();\n // Clear all prior error messages\n $(\"#errorMsgId\").empty();\n // Remove the fixed bottom class, as data is loaded and it needs to be responsive now\n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n // clear the team table Div before populating data for respective option\n $(\"#teamTableDiv\").empty();\n getTeams($(\"#selectLeagueList\").val());\n // Store in session storage for goback functionality from team details page\n let leagueSelection = $(\"#selectLeagueList\").val();\n sessionStorage.setItem(\"leagueSelSession\", leagueSelection);\n })\n //Add default option and view all option\n .append($(\"<option/>\")\n .val(\"\")\n .html(\"Select league from dropdown list\"))\n ))\n // table to list the teams under selected league dropdown option\n .append($(\"<div/>\")\n .append($(\"<div/>\")\n .attr(\"id\", \"teamTableDiv\")\n .attr(\"class\", \"col-auto ml-2\")))\n // Add team button in league section\n .append($(\"<div/>\")\n .attr(\"class\", \"col-md-2\")\n .append($(\"<button/>\")\n .attr(\"id\", \"regTeamBtn\")\n .attr(\"class\", \"btn btn-info mt-2\")\n .html(\"Register Team\")\n .on(\"click\", function(e) {\n // prevent all default action and do as we direct\n e.preventDefault();\n // Clear the fixed bottom as register page will have data\n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n // Clear all prior error messages\n $(\"#errorMsgId\").empty();\n // Usage of cache for retrieving JSON object (requires stringify and parse, as cache can have only string)\n let leaguesLocalStorage = JSON.parse(sessionStorage.getItem(\"leaguesLocal\"));\n // Get Add team section template\n getRegTeam(leaguesLocalStorage);\n })))\n );\n\n //Run through league and populate the dropdown\n $.each(leagues, function(key, value) {\n $(\"#selectLeagueList\").append($(\"<option/>\")\n .val(value.Code)\n .html(value.Name))\n });\n\n //Add viewAll option at the end after populating all dropdown\n $(\"#selectLeagueList\").append($(\"<option/>\")\n .val(\"all\")\n .html(\"View All\"));\n\n // Set selection dropdown to the selected league from home section, if chosen\n if (leagueCode != undefined) {\n $(\"#selectLeagueList\").val(leagueCode);\n // Remove the footer to display at bottom always, as default selection is chosen from home section \n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n getTeams(leagueCode);\n } else {\n $(\"#selectLeagueList\").val(\"\");\n }\n}", "title": "" }, { "docid": "69f8ea157861f8e01c4a8703ddc9f98b", "score": "0.55928785", "text": "function loadleaguesForLeagueSection(leagues, leagueCode) {\n $(\"#contentDiv\").empty();\n $(\"#footerDiv\").addClass(\"fixed-bottom\");\n $(\"#contentDiv\").append($(\"<section>\")\n .attr(\"id\", \"leagueSection\")\n // User friendly message for league dropdown\n .append($(\"<h3/>\")\n .html(\"Select the Leagues from the dropdown list:\")\n .attr(\"class\", \"font-italic\"))\n // League Dropdown Div and DDL\n .append($(\"<div>\")\n .attr(\"class\", \"row\")\n .append($(\"<label/>\")\n .attr(\"class\", \"d-none d-md-inline\")\n .attr(\"for\", \"selectLeagueList\")\n .html(\"League Lists\"))\n .append($(\"<select/>\")\n .attr(\"id\", \"selectLeagueList\")\n .attr(\"class\", \"d-none d-inline form-control col-md-3 ml-2\")\n .on(\"change\", function(e) {\n // prevent all default action and do as we direct\n e.preventDefault();\n // Clear all prior error messages\n $(\"#errorMsgId\").empty();\n // Remove the fixed bottom class, as data is loaded and it needs to be responsive now\n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n // clear the team table Div before populating data for respective option\n $(\"#teamTableDiv\").empty();\n getTeams($(\"#selectLeagueList\").val());\n // Store in session storage for goback functionality from team details page\n let leagueSelection = $(\"#selectLeagueList\").val();\n sessionStorage.setItem(\"leagueSelSession\", leagueSelection);\n })\n //Add default option and view all option\n .append($(\"<option/>\")\n .val(\"\")\n .html(\"Select league from dropdown list\"))\n ))\n // table to list the teams under selected league dropdown option\n .append($(\"<div/>\")\n .append($(\"<div/>\")\n .attr(\"id\", \"teamTableDiv\")\n .attr(\"class\", \"col-auto ml-2\")))\n // Add team button in league section\n .append($(\"<div/>\")\n .attr(\"class\", \"col-md-2\")\n .append($(\"<button/>\")\n .attr(\"id\", \"regTeamBtn\")\n .attr(\"class\", \"btn btn-info mt-2\")\n .html(\"Register Team\")\n .on(\"click\", function(e) {\n // prevent all default action and do as we direct\n e.preventDefault();\n // Clear the fixed bottom as register page will have data\n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n // Clear all prior error messages\n $(\"#errorMsgId\").empty();\n // Usage of cache for retrieving JSON object (requires stringify and parse, as cache can have only string)\n let leaguesLocalStorage = JSON.parse(sessionStorage.getItem(\"leaguesLocal\"));\n // Get Add team section template\n getRegTeam(leaguesLocalStorage);\n })))\n );\n\n //Run through league and populate the dropdown\n $.each(leagues, function(key, value) {\n $(\"#selectLeagueList\").append($(\"<option/>\")\n .val(value.Code)\n .html(value.Name))\n });\n\n //Add viewAll option at the end after populating all dropdown\n $(\"#selectLeagueList\").append($(\"<option/>\")\n .val(\"all\")\n .html(\"View All\"));\n\n // Set selection dropdown to the selected league from home section, if chosen\n if (leagueCode != undefined) {\n $(\"#selectLeagueList\").val(leagueCode);\n // Remove the footer to display at bottom always, as default selection is chosen from home section \n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n getTeams(leagueCode);\n } else {\n $(\"#selectLeagueList\").val(\"\");\n }\n}", "title": "" }, { "docid": "b8030f6928804e535c7f038cdee7e8ac", "score": "0.55393744", "text": "createLeague() {\n const league = localStorage.getItem('league');\n if (league) return league;\n localStorage.setItem('league', 'standard');\n return 'standard';\n }", "title": "" }, { "docid": "06f22d5196d22fa00817a892f4d29f93", "score": "0.53326696", "text": "function getleagueSection(leagueCode) {\n let leagues;\n let leaguesLocalStorage = JSON.parse(sessionStorage.getItem(\"leaguesLocal\"));\n\n if (leaguesLocalStorage == \"\") {\n errorMsg = \"Failure to get leagues list from local storage, please refresh the page\"\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").addClass(\"badInput\");\n } else {\n leagues = leaguesLocalStorage;\n if (leagueCode == undefined) {\n // Store the JSON data in javaScript objects (Pull leagues). \n loadleaguesForLeagueSection(leagues, leagueCode);\n } else {\n // Selected particular league\n loadleaguesForLeagueSection(leagues, leagueCode);\n }\n }\n}", "title": "" }, { "docid": "496b3fcfa4aa66a658c9ed2f9722b746", "score": "0.53174347", "text": "function showAddExistingTeam() {\n if (!pageState.isCreator)\n return;\n if (!pageState.globalTeamsLoaded)\n ws.send(\"[\\\"fetchGlobalTeams\\\"]\");\n deleteErrorSuccessBox(dom.errorBoxERROR);\n pageState.addingExistingTeam = true;\n pageState.existingTeam = null;\n pageState.existingGlobalTeacher = null;\n dom.selectGlobalTeam.style.display = \"block\";\n}", "title": "" }, { "docid": "eb737906ed103e1035e1d63dad97820c", "score": "0.5243241", "text": "function initGameLoad() {\n const gameID = settings.get('currentGame');\n if (!gameID) {\n $('#game-select-menu').dropdown('set exactly', 'hots');\n }\n else {\n $('#game-select-menu').dropdown('set exactly', gameID);\n }\n}", "title": "" }, { "docid": "ecd14372ff6eb462e49135d274db233c", "score": "0.52264035", "text": "function addTeam() {\n //Get the value to add\n var team = $(\"#txtTeam\");\n\n //Remove any errors\n if(team.parents('.tooltip').length) {\n $(team).css({\"borderColor\": \"#B9B9B9\"});\n $(team).unwrap();\n $($(team).siblings()[0]).remove();\n }\n\n //Validate the team\n if($.inArray($(team).val(), teams) !== -1) {\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\n $(team).wrap(\"<div class='tooltip'>\");\n $(team).after(\"<span class='tooltipMessage' style='left: 15%'>You've already added that team.</span>\");\n $(team).css({\"borderColor\": \"red\"});\n return;\n }\n\n if($(team).val() === '') {\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\n $(team).wrap(\"<div class='tooltip'>\");\n $(team).after(\"<span class='tooltipMessage' style='left: 15%'>You must enter a team.</span>\");\n $(team).css({\"borderColor\": \"red\"});\n return;\n }\n\n if (!team.val().replace(/\\s/g, '').length) {\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\n $(team).wrap(\"<div class='tooltip'>\");\n $(team).after(\"<span class='tooltipMessage' style='left: 15%'>A venue cannot be a blank string.</span>\");\n $(team).css({\"borderColor\": \"red\"});\n return;\n }\n\n //Add the team to the list\n if(teams.length === 0) {\n $(\"#teamsDiv\").html(\"<table class='tournamentTable'><thead><tr><th>Title</th><th>Action</th></tr></thead><tbody>\" +\n \"<tr><td>\" + $(team).val() + \"</td><input type='hidden' value='\" + $(team).val() +\"' name='teams[]'>\" +\n \"<td><input type='button' value='Edit' class='editBtn'><input type='button' value='Remove' class='removeBtn'></td></tr>\" +\n \"</tbody></table>\");\n teams.push($(team).val());\n } else {\n $($($(\"#teamsDiv\").children()[0]).children()[1]).append(\"<tr><td>\" + $(team).val() + \"</td><input type='hidden' value='\" + $(team).val() +\"' name='teams[]'>\" +\n \"<td><input type='button' value='Edit' class='editBtn'><input type='button' value='Remove' class='removeBtn'></td>\" +\n \"</tr>\");\n teams.push($(team).val());\n }\n\n //Remove text from input\n $($(this).siblings()[0]).val(\"\");\n\n //Register the edit and remove button handlers\n $(\"#teamsDiv .editBtn\").click(function() {\n edit(this, \"team\");\n });\n $(\"#teamsDiv .removeBtn\").off(\"click\").click(function() {\n remove(this, \"team\");\n });\n }", "title": "" }, { "docid": "2c22cb57830cac0d592922cd4f011e8f", "score": "0.5210828", "text": "function buildDialog() {\r\n\r\n var worksheetName = tableau.extensions.settings.get(\"worksheet\");\r\n if (worksheetName != undefined) {\r\n // We restore the look and feel settings.\r\n \r\n\r\n // We restore the plugin settings.\r\n \r\n }\r\n\r\n // Populate the worksheet drop down with a list of worksheets.\r\n // Generated at the time of opening the dialogue.\r\n let dashboard = tableau.extensions.dashboardContent.dashboard;\r\n\r\n $(\"#tableau_db_name\").html(\"<strong>\"+dashboard.name+\"</strong>\");\r\n\r\n dashboard.worksheets.forEach(function (worksheet) {\r\n $(\"#selectWorksheet\").append(\"<option value='\" + worksheet.name + \"'>\" + worksheet.name + \"</option>\");\r\n });\r\n\r\n // Add the column orders it exists\r\n var column_order = tableau.extensions.settings.get(\"column_order\");\r\n if (column_order != undefined && column_order.length > 0) {\r\n var column_names_array = tableau.extensions.settings.get(\"column_names\").split(\"|\");\r\n var column_order_array = tableau.extensions.settings.get(\"column_order\").split(\"|\");\r\n var col_AltNames_array = tableau.extensions.settings.get(\"col_AltNames\").split(\"|\");\r\n var col_d_m_array = tableau.extensions.settings.get(\"col_Dim_Measures\").split(\"|\");\r\n\r\n //for (var i = 0; i < column_names_array.length; i++) { alert(col_d_m_array[i]); }\r\n //alert(\"Dim x Mea : \" + tableau.extensions.settings.get(\"Dimensions_Count\") + \" x \" + tableau.extensions.settings.get(\"Measures_Count\"));\r\n \r\n //$(\"#sort-it ol\").text(\"\");\r\n //for (var i = 0; i < column_names_array.length; i++) {\r\n // //alert(column_names_array[i] + \" : \" + column_order_array[i]);\r\n // $(\"#sort-it ol\").append(\"<li><div class='input-field'><input id='\" + column_names_array[i] + \"' type='text' col_num=\" + column_order_array[i] + \"><label for=\" + column_names_array[i] + \"'>\" + column_names_array[i] + \"</label></div></li>\");\r\n //}\r\n \r\n //alert(\"before binding table to DIV\"); \r\n $(\"#sort-it2\").text(\"\");\r\n var table_tag = '<table id=\"tblFieldInfo\" class=\"table table-sortable table-condensed table-bordered table-hover\" >';\r\n table_tag = table_tag + '<thead> <tr> <th># </th> <th> Field Name </th> <th> Alternate Name </th> <th>Field Type </th> </tr> </thead>';\r\n table_tag = table_tag + '<tbody>';\r\n var tr_tag = ''; // \"badge badge-secondary\"\r\n for (var i = 0; i < column_names_array.length; i++) {\r\n //alert(column_names_array[i] + \" : \" + column_order_array[i]); class=\"glyphicon glyphicon-move\"\r\n //$(\"#sort-it2\").append(\"<li><div class='input-field'><input id='\" + column_names_array[i] + \"' type='text' col_num=\" + column_order_array[i] + \"><label for=\" + column_names_array[i] + \"'>\" + column_names_array[i] + \"</label></div></li>\");\r\n tr_tag = '<tr>';\r\n tr_tag = tr_tag + '<td> <span>::::</span> '+i+' </td> ';\r\n tr_tag = tr_tag + '<td> <h5><label class= class=\"'+fieldType_dim_Measure(column_names_array[i]).badgeCSSClassName+'\" >'+column_names_array[i]+'</label></h5> </td>';\r\n tr_tag = tr_tag + '<td> <input type=\"text\" id=\"alt_fldName_'+i+'\" col_num=\"' + column_order_array[i] + '\" class=\"form-control\" value=\"'+ col_AltNames_array[i] +'\" data-fieldname= \"'+column_names_array[i]+'\" data-fieldtype= \"'+col_d_m_array[i]+'\" /> </td>';\r\n tr_tag = tr_tag + '<td> <select id=\"fldType_'+i+'\" > <option value=\"dimension\">Dimension</option> <option value=\"Measure\">Measure</option> </select> </td>';\r\n tr_tag = tr_tag + '</tr>';\r\n //alert(tr_tag);\r\n table_tag = table_tag + tr_tag;\r\n }\r\n table_tag = table_tag + '</tbody>';\r\n table_tag = table_tag + '</table>'; \r\n $(\"#sort-it2\").append(table_tag);\r\n\r\n $('.table-sortable tbody').sortable({\r\n placeholder: \"ui-state-highlight\"\r\n });\r\n\r\n $(\"#tblFieldInfo\").sortable({\r\n handle: 'span'\r\n });\r\n\r\n /*$('#sort-it ol').sortable({\r\n onDrop: function (item) {\r\n $(item).removeClass(\"dragged\").removeAttr(\"style\");\r\n $(\"body\").removeClass(\"dragging\");\r\n }\r\n });*/\r\n\r\n }\r\n\r\n // Initialise the tabs, select and attach functions to buttons.\r\n $(\"#selectWorksheet\").val(tableau.extensions.settings.get(\"worksheet\"));\r\n $('#selectWorksheet').on('change', '', function (e) {\r\n columnsUpdate();\r\n });\r\n\r\n //$(\"#underlying\").val(tableau.extensions.settings.get(\"underlying\"));\r\n //$('#underlying').on('change', '', function (e) {\r\n // columnsUpdate();\r\n //});\r\n\r\n \r\n\r\n if(tableau.extensions.settings.get(\"tabulator_Type\") == \"tabulator_grid\"){\r\n // reser ==> $('input:radio[name=tabulatorType]').attr('checked',false);\r\n $('input:radio[name=tabulatorType]:nth(0)').attr('checked',true);\r\n }else if(tableau.extensions.settings.get(\"tabulator_Type\") == \"tabulator_nested\"){\r\n $('input:radio[name=tabulatorType]:nth(1)').attr('checked',true);\r\n }else { \r\n $('input:radio[name=tabulatorType]:nth(0)').attr('checked',true); \r\n }\r\n\r\n\r\n //$(\"#max_no_records\").val(tableau.extensions.settings.get(\"max_no_records\"));\r\n //$(\"#optradio_theme\").val(tableau.extensions.settings.get(\"optradio_theme\"));\r\n\r\n if(tableau.extensions.settings.get(\"optradio_theme\") == \"standard\"){\r\n $('input:radio[name=optradio_CSS]:nth(0)').attr('checked',true);\r\n } else if(tableau.extensions.settings.get(\"optradio_theme\") == \"simple\") { \r\n $('input:radio[name=optradio_CSS]:nth(1)').attr('checked',true);\r\n } else if(tableau.extensions.settings.get(\"optradio_theme\") == \"dark\") { \r\n $('input:radio[name=optradio_CSS]:nth(2)').attr('checked',true);\r\n } else {\r\n $('input:radio[name=optradio_CSS]:nth(0)').attr('checked',true);\r\n }\r\n\r\n\r\n\r\n //$('select').formSelect();\r\n //$('.tabs').tabs();\r\n\r\n $('#closeButton').click(closeDialog);\r\n $('#saveButton').click(saveButton);\r\n $('#resetButton').click(resetButton);\r\n // Initialise the tabs, select and attach functions to buttons.\r\n\r\n }", "title": "" }, { "docid": "bbdde8bee6facacc855ebc19c8fdaf1d", "score": "0.51818854", "text": "function getleagueSection(leagueCode) {\n let leaguesLocalStorage = JSON.parse(sessionStorage.getItem(\"leaguesLocal\"));\n\n if (leaguesLocalStorage == \"\") {\n errorMsg = \"Failure to get leagues list from local storage, please refresh the page\"\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").addClass(\"badInput\");\n } else {\n if (leagueCode == undefined) {\n // Store the JSON data in javaScript objects (Pull leagues). \n loadleaguesForLeagueSection(leagues, leagueCode);\n } else {\n // Selected particular league\n loadleaguesForLeagueSection(leagues, leagueCode);\n }\n }\n}", "title": "" }, { "docid": "10d655347f6fd6cb1f35023b578629c2", "score": "0.5157475", "text": "function addTeamDetailsToPage(team)\n{\n /* generates the location dropdown */\n let league;\n $.getJSON(\"api/leagues\", function (data)\n {\n league = data;\n for (let i = 0; i < league.length; i++)\n {\n let newOption = $(\"<option>\", { text: league[i].Name, value: league[i].Code })\n $(\"#leaguecode\").append(newOption);\n }\n //this puts the team info into the input fields\n $(\"#teamname\").val(team.TeamName);\n $(\"#leaguecode\").val(team.League);\n $(\"#managername\").val(team.ManagerName);\n $(\"#managerphone\").val(team.ManagerPhone);\n $(\"#manageremail\").val(team.ManagerEmail);\n $(\"#maxteammembers\").val(team.MaxTeamMembers);\n $(\"#minmemberage\").val(team.MinMemberAge);\n $(\"#maxmemberage\").val(team.MaxMemberAge);\n $(`input[name='teamgender'][value='${team.TeamGender}']`).prop(\"checked\", true);\n });\n}", "title": "" }, { "docid": "b92400af58d2c86746bcfe53a454f4c9", "score": "0.5157417", "text": "function teamAddOnClick () {\n if (module.exports.internal.teamName.value.length > 0) {\n ipc.send('save-team-data', undefined, {name: module.exports.internal.teamName.value})\n }\n}", "title": "" }, { "docid": "2fffcc85519f89e12d7d9874c8ccd517", "score": "0.51546645", "text": "function loadTeams(teams) {\n //Create the team table with table head and table body\n // table = $(\"#teamsList\");\n createTable();\n createTableHead();\n // Run through the teams under the league to create the table rows under tablebody\n $.each(teams, function(key, value) {\n $(\"#teamListTbody\").append($(\"<tr/>\")\n .append($(\"<td/>\")\n .html(value.TeamName))\n .append($(\"<td/>\")\n .html(value.ManagerName))\n .append($(\"<td/>\")\n .html(value.TeamPoints))\n // create button and wire-in an event to provide more details on the team\n .append($(\"<td/>\")\n .append($(\"<a/>\")\n .attr(\"class\", \"btn\")\n .attr(\"href\", \"#\")\n .append($(\"<i/>\")\n .attr(\"class\", \"fa fa-info-circle text-info\"))\n .on(\"click\", function(e) {\n e.preventDefault();\n // Store in session storage for goback functionality from team details page\n let leagueSelection = $(\"#selectLeagueList\").val();\n sessionStorage.setItem(\"leagueSelSession\", leagueSelection);\n // clear any informational message\n $(\"#errorMsgId\").empty();\n getTeamDetail(value.TeamId);\n })))\n )\n })\n}", "title": "" }, { "docid": "2fffcc85519f89e12d7d9874c8ccd517", "score": "0.51546645", "text": "function loadTeams(teams) {\n //Create the team table with table head and table body\n // table = $(\"#teamsList\");\n createTable();\n createTableHead();\n // Run through the teams under the league to create the table rows under tablebody\n $.each(teams, function(key, value) {\n $(\"#teamListTbody\").append($(\"<tr/>\")\n .append($(\"<td/>\")\n .html(value.TeamName))\n .append($(\"<td/>\")\n .html(value.ManagerName))\n .append($(\"<td/>\")\n .html(value.TeamPoints))\n // create button and wire-in an event to provide more details on the team\n .append($(\"<td/>\")\n .append($(\"<a/>\")\n .attr(\"class\", \"btn\")\n .attr(\"href\", \"#\")\n .append($(\"<i/>\")\n .attr(\"class\", \"fa fa-info-circle text-info\"))\n .on(\"click\", function(e) {\n e.preventDefault();\n // Store in session storage for goback functionality from team details page\n let leagueSelection = $(\"#selectLeagueList\").val();\n sessionStorage.setItem(\"leagueSelSession\", leagueSelection);\n // clear any informational message\n $(\"#errorMsgId\").empty();\n getTeamDetail(value.TeamId);\n })))\n )\n })\n}", "title": "" }, { "docid": "32a22d4388b3867b369d53d44de22b82", "score": "0.51401603", "text": "function addLith(newLith){\n $('#lithologies').append('<li class=\"list-group-item\"><span class=\"lith-name\">'+newLith+\n '</span><button type=\"button\" class=\"lith-remove btn float-right btn-outline-danger btn-sm my-0\">' +\n '<em class=\"fas fa-trash-alt\"></em></button></li>');\n $('.lith-remove').on('click', function() {\n const lithID = $(this).parent('li').find('.lith-name').text().trim();\n // remove from list of lithologies \n $(this).parent('li').remove();\n // de-select this lithology \n $('tr').not('.hide').find('select.lith-select[value=\"'+lithID+'\"]').val([])\n // remove from dropdown \n $('.lith-select').find('[value=\"'+lithID+'\"]').remove();\n $('tr').not(\".hide\").find('.lith-select').selectpicker('refresh'); \n });\n \n // update dropdowns\n $('select.lith-select').append(\"<option value='\" + newLith + \"'>\"+newLith+\"</option>\");\n // refresh dropdowns in non-hidden rows\n $('tr').not(\".hide\").find('.lith-select').selectpicker('refresh'); \n}", "title": "" }, { "docid": "ae104a1d213d569f198b02f7662188ca", "score": "0.5137697", "text": "function buildDialog() {\n var worksheetName = tableau.extensions.settings.get(\"worksheet\");\n \n\n // populate the worksheet drop down\n let dashboard = tableau.extensions.dashboardContent.dashboard;\n dashboard.worksheets.forEach(function (worksheet) {\n if (worksheetName != undefined && worksheet.name == worksheetName) {\n $(\"#sheetList\").append(\"<option value='\" + worksheet.name + \"' selected='true'>\" + worksheet.name + \"</option>\");\n } else {\n $(\"#sheetList\").append(\"<option value='\" + worksheet.name + \"'>\" + worksheet.name + \"</option>\");\n }\n });\n\n $(\"#showLabel\").click(function() {\n if(this.checked == true) {\n $(\"#labelField\").removeAttr(\"disabled\");\n $(\"#lblHorAllign\").removeAttr(\"disabled\");\n $(\"#lblVerAllign\").removeAttr(\"disabled\");\n } else {\n $(\"#labelField\").attr(\"disabled\",true);\n $(\"#lblHorAllign\").attr(\"disabled\",true);\n $(\"#lblVerAllign\").attr(\"disabled\",true);\n }\n });\n\n\n if (worksheetName != undefined) {\n fieldListUpdate(worksheetName);\n\n // show label check box\n $(\"#showLabel\").removeAttr(\"disabled\");\n var showLabel = tableau.extensions.settings.get(\"showLabel\");\n if (showLabel != undefined && showLabel == \"Y\") {\n $(\"#showLabel\").attr(\"checked\",true);\n $(\"#labelField\").removeAttr(\"disabled\");\n $(\"#lblHorAllign\").removeAttr(\"disabled\");\n $(\"#lblVerAllign\").removeAttr(\"disabled\");\n }\n\n var lblHorAllign = tableau.extensions.settings.get(\"lblHorAllign\");\n var lblVerAllign = tableau.extensions.settings.get(\"lblVerAllign\");\n\n if (lblHorAllign != undefined) {\n $(\"#lblHorAllign\").val(lblHorAllign);\n }\n\n if (lblVerAllign != undefined) {\n $(\"#lblVerAllign\").val(lblVerAllign);\n }\n\n }\n\n // reset field list on worksheet change\n $(\"#sheetList\").on('change','', function() {\n var wsheetName = $(\"#sheetList\").val();\n fieldListUpdate(wsheetName);\n\n // reset show label check box\n var showLabelCB = document.getElementById(\"showLabel\");\n showLabelCB.checked = false;\n \n $(\"#showLabel\").removeAttr(\"disabled\");\n $(\"#lblHorAllign\").removeAttr(\"disabled\");\n $(\"#lblVerAllign\").removeAttr(\"disabled\");\n\n });\n\n // enable action field list if action is chosen\n $(\"#dbAction\").on('change','', function() {\n if ($(\"#dbAction\").val() != \"none\") {\n $(\"#actionField\").removeAttr(\"disabled\");\n $(\"#parameterSet\").removeAttr(\"disabled\");\n parameterListUpdate();\n } else {\n $(\"#actionField\").attr(\"disabled\",\"true\");\n $(\"#parameterSet\").attr(\"disabled\",\"true\");\n }\n })\n\n // set button functions\n $('#cancelButton').click(closeDialog);\n $('#saveButton').click(saveButton);\n }", "title": "" }, { "docid": "ad8837bfc56d37aca7ff950ffd08d67f", "score": "0.5134547", "text": "function getTeams(leagueCode) {\n switch (leagueCode) {\n case \"\":\n //set the footer at the end of the page, as there is no data other than dropdown\n $(\"#footerDiv\").addClass(\"fixed-bottom\");\n errorMsg = \"Please choose valid dropdown option from the given list\";\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").addClass(\"badInput\");\n break;\n case \"all\":\n getAllTeams();\n break;\n default:\n getTeamsPerLeague(leagueCode);\n break;\n }\n}", "title": "" }, { "docid": "ad8837bfc56d37aca7ff950ffd08d67f", "score": "0.5134547", "text": "function getTeams(leagueCode) {\n switch (leagueCode) {\n case \"\":\n //set the footer at the end of the page, as there is no data other than dropdown\n $(\"#footerDiv\").addClass(\"fixed-bottom\");\n errorMsg = \"Please choose valid dropdown option from the given list\";\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").addClass(\"badInput\");\n break;\n case \"all\":\n getAllTeams();\n break;\n default:\n getTeamsPerLeague(leagueCode);\n break;\n }\n}", "title": "" }, { "docid": "59f424fdeb8dd90d9c1df766afe82239", "score": "0.5133009", "text": "function addMenuButton()\n {\n createDialog();\n //$(\".editor-container\").prepend('<label class=\"collapsibleQuickmessages\">Hurtige svar >></label>');\n\n //$(\".messages-toolbar\").find(\"ul\").eq(0).append('<li class=\"nav-item\"><button id=\"changeQuickmessages\" class=\"btn large btn-link\"\"><span data-v-8b7c5970=\"\" aria-hidden=\"true\"><i data-v-8b7c5970=\"\" class=\"icon icon-Aula_settings\"></i>Tilpas Hurtige svar</span></button></li>');\n $(\".editor-container\").prepend('<button id=\"changeQuickmessages\" class=\"btn large btn-link\"\" title=\"Tilpas hurtige svar\"><span data-v-8b7c5970=\"\" aria-hidden=\"true\"><i data-v-8b7c5970=\"\" class=\"icon icon-Aula_settings\"> </i></span></button>');\n\n $(\"#changeQuickmessages\").button().on( \"click\", function() {\n var farvorits = GM_getValue(\"aula_user_quickmessages\",\"Tak for beskeden jeg svarer tilbage hurtigst muligt., Tak for din besked jeg undersøger sagen og vender tilbage.\");\n $(\"#quickmessages_dialog_input\").val(farvorits);\n dialog.dialog( \"open\" );\n });\n \n }", "title": "" }, { "docid": "730cc6bc102ee9bc661b6818b6777b01", "score": "0.51307803", "text": "function loadEditTeamDetails(team) {\n //Get league details from session storage to use it to populate dropdown\n //Usage of cache for retrieving JSON object (requires stringify and parse, as cache can have only string)\n let leaguesLocalStorage = JSON.parse(sessionStorage.getItem(\"leaguesLocal\"));\n\n //clear the content div before creating team template\n $(\"#contentDiv\").empty();\n\n $(\"#contentDiv\")\n .append($(\"<section/>\")\n .attr(\"id\", \"editTeamSection\")\n .append($(\"<h2/>\")\n .attr(\"class\", \"font-italic\")\n .html(\"Please find the below team details to make allowed changes\"))\n .append($(\"<form/>\")\n .attr(\"id\", \"editTeamForm\")\n .attr(\"action\", \"#\")\n .attr(\"target\", \"_self\")\n .attr(\"method\", \"GET\")\n )\n )\n let inputDiv = getInputDiv(\"teamid\", \"Team Id\", \"\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"teamname\", \"Team Name\", \"Enter Team Name\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"leaguecode\", \"League\", \"\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n //Generate all inputDiv dynamically for editing a team\n inputDiv = getInputDiv(\"managername\", \"Manager Name\", \"Enter Manager Name\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"manageremail\", \"Manager Email\", \"Enter Manager Email\", \"email\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"managerphone\", \"Manager Phone No\", \"Enter Manager Phone No\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"maxteammembers\", \"Maximum No of Team Members\", \"Enter Maximum No Of Team Members\", \"number\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"minmemberage\", \"Minimum Member Age\", \"Enter Minimum Member Age\", \"number\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"maxmemberage\", \"Maximum Member Age\", \"Enter Maximum Member Age\", \"number\");\n $(\"#editTeamForm\").append(inputDiv);\n // Gender selection radio box\n $(\"#editTeamForm\").append($(\"<div>\")\n .attr(\"class\", \"row form-check form-check-inline col-md-8 ml-2 mt-1\")\n .append($(\"<div/>\")\n .attr(\"class\", \"offset-md-6\"))\n .append($(\"<div/>\")\n .attr(\"id\", \"maleDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"teamgender\")\n .attr(\"id\", \"male\")\n .val(\"Male\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \" form-check-label\")\n .attr(\"for\", \"male\")\n .html(\"Male\")))\n .append($(\"<div/>\")\n .attr(\"id\", \"femaleDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"teamgender\")\n .attr(\"id\", \"female\")\n .val(\"Female\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \"form-check-label\")\n .attr(\"for\", \"female\")\n .html(\"Female\")))\n .append($(\"<div/>\")\n .attr(\"id\", \"anyDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"teamgender\")\n .attr(\"id\", \"any\")\n .val(\"Any\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \"form-check-label\")\n .attr(\"for\", \"any\")\n .html(\"Any\"))))\n\n // Submit the form to server & update the teams data\n $(\"#editTeamForm\").append($(\"<div/>\")\n .attr(\"class\", \"row offset-md-4 col-md-8\")\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .attr(\"type\", \"button\")\n .html(\"Submit\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n submitEditForm(team.TeamId, team);\n })))\n // button to reset the registration form\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-danger\")\n .attr(\"type\", \"reset\")\n .html(\"Reset\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n // Populate the details from team received from server during edit details generation\n loadEditTeamDetails(team, leaguesLocalStorage);\n })\n ))\n // button to go back to team details section on cancel \n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .html(\"Cancel\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n // Go back and display the team details section\n getTeamDetail(team.TeamId);\n }))))\n //load team item values\n loadTeamItem(team, leaguesLocalStorage);\n}", "title": "" }, { "docid": "730cc6bc102ee9bc661b6818b6777b01", "score": "0.51307803", "text": "function loadEditTeamDetails(team) {\n //Get league details from session storage to use it to populate dropdown\n //Usage of cache for retrieving JSON object (requires stringify and parse, as cache can have only string)\n let leaguesLocalStorage = JSON.parse(sessionStorage.getItem(\"leaguesLocal\"));\n\n //clear the content div before creating team template\n $(\"#contentDiv\").empty();\n\n $(\"#contentDiv\")\n .append($(\"<section/>\")\n .attr(\"id\", \"editTeamSection\")\n .append($(\"<h2/>\")\n .attr(\"class\", \"font-italic\")\n .html(\"Please find the below team details to make allowed changes\"))\n .append($(\"<form/>\")\n .attr(\"id\", \"editTeamForm\")\n .attr(\"action\", \"#\")\n .attr(\"target\", \"_self\")\n .attr(\"method\", \"GET\")\n )\n )\n let inputDiv = getInputDiv(\"teamid\", \"Team Id\", \"\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"teamname\", \"Team Name\", \"Enter Team Name\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"leaguecode\", \"League\", \"\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n //Generate all inputDiv dynamically for editing a team\n inputDiv = getInputDiv(\"managername\", \"Manager Name\", \"Enter Manager Name\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"manageremail\", \"Manager Email\", \"Enter Manager Email\", \"email\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"managerphone\", \"Manager Phone No\", \"Enter Manager Phone No\", \"text\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"maxteammembers\", \"Maximum No of Team Members\", \"Enter Maximum No Of Team Members\", \"number\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"minmemberage\", \"Minimum Member Age\", \"Enter Minimum Member Age\", \"number\");\n $(\"#editTeamForm\").append(inputDiv);\n inputDiv = getInputDiv(\"maxmemberage\", \"Maximum Member Age\", \"Enter Maximum Member Age\", \"number\");\n $(\"#editTeamForm\").append(inputDiv);\n // Gender selection radio box\n $(\"#editTeamForm\").append($(\"<div>\")\n .attr(\"class\", \"row form-check form-check-inline col-md-8 ml-2 mt-1\")\n .append($(\"<div/>\")\n .attr(\"class\", \"offset-md-6\"))\n .append($(\"<div/>\")\n .attr(\"id\", \"maleDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"teamgender\")\n .attr(\"id\", \"male\")\n .val(\"Male\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \" form-check-label\")\n .attr(\"for\", \"male\")\n .html(\"Male\")))\n .append($(\"<div/>\")\n .attr(\"id\", \"femaleDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"teamgender\")\n .attr(\"id\", \"female\")\n .val(\"Female\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \"form-check-label\")\n .attr(\"for\", \"female\")\n .html(\"Female\")))\n .append($(\"<div/>\")\n .attr(\"id\", \"anyDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"teamgender\")\n .attr(\"id\", \"any\")\n .val(\"Any\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \"form-check-label\")\n .attr(\"for\", \"any\")\n .html(\"Any\"))))\n\n // Submit the form to server & update the teams data\n $(\"#editTeamForm\").append($(\"<div/>\")\n .attr(\"class\", \"row offset-md-4 col-md-8\")\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .attr(\"type\", \"button\")\n .html(\"Submit\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n submitEditForm(team.TeamId, team);\n })))\n // button to reset the registration form\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-danger\")\n .attr(\"type\", \"reset\")\n .html(\"Reset\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n // Populate the details from team received from server during edit details generation\n loadEditTeamDetails(team, leaguesLocalStorage);\n })\n ))\n // button to go back to team details section on cancel \n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .html(\"Cancel\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n // Go back and display the team details section\n getTeamDetail(team.TeamId);\n }))))\n //load team item values\n loadTeamItem(team, leaguesLocalStorage);\n}", "title": "" }, { "docid": "ce62bb4461079acef6ebf391bbb2110b", "score": "0.5117045", "text": "reset_game_table() {\n app.games = app.games_hold;\n app.search_active = false;\n }", "title": "" }, { "docid": "76a4bdf39d403c41d777cc9c09f0f359", "score": "0.51130366", "text": "function closeAddExistingTeam() {\n pageState.addingExistingTeam = false;\n pageState.existingTeam = null;\n pageState.existingGlobalTeacher = null;\n dom.selectGlobalTeam.style.display = \"none\";\n}", "title": "" }, { "docid": "ec91c8afcaf6ebaac33beb8359722f01", "score": "0.50969887", "text": "function loadToDialog(element, actionURL, dialogTitle) {\n var id = element.siblings(\"#id\").val();\n adminDialog.empty();\n $('#adminDialog').dialog({\n title: dialogTitle\n });\n if (dialogTitle == 'Промени категорията') {\n $('#adminDialog').dialog({\n width: 650\n });\n }\n else {\n $('#adminDialog').dialog({\n width: 400\n });\n }\n\n adminDialog.load(actionURL + id);\n adminDialog.dialog('open');\n\n }", "title": "" }, { "docid": "167e0072d8032bee1d8c450fdee12745", "score": "0.50968426", "text": "function procHaupt() {\n const __TEAMPARAMS = getTeamParamsFromTable(getTable(1), __TEAMSEARCHHAUPT); // Link mit Team, Liga, Land...\n\n return buildOptions(__OPTCONFIG, __OPTSET, {\n 'teamParams' : __TEAMPARAMS,\n 'hideMenu' : true\n }).then(async optSet => {\n const __ZATCELL = getProp(getProp(getRows(0), 2), 'cells', { })[0];\n const __NEXTZAT = getZATNrFromCell(__ZATCELL); // \"Der naechste ZAT ist ZAT xx und ...\"\n const __CURRZAT = __NEXTZAT - 1;\n const __DATAZAT = getOptValue(__OPTSET.datenZat);\n\n // Stand der alten Daten merken...\n setOpt(__OPTSET.oldDatenZat, __DATAZAT, false);\n\n if (__CURRZAT >= 0) {\n __LOG[2](\"Aktueller ZAT: \" + __CURRZAT);\n\n // Neuen aktuellen ZAT speichern...\n setOpt(__OPTSET.aktuellerZat, __CURRZAT, false);\n\n if (__CURRZAT !== __DATAZAT) {\n __LOG[2](__LOG.changed(__DATAZAT, __CURRZAT));\n\n // ... und ZAT-bezogene Daten als veraltet markieren (ausser 'skills' und 'positions')\n await __TEAMCLASS.deleteOptions({\n 'datenZat' : true,\n 'oldDatenZat' : true\n }).catch(defaultCatch);\n\n // Neuen Daten-ZAT speichern...\n setOpt(__OPTSET.datenZat, __CURRZAT, false);\n }\n }\n });\n}", "title": "" }, { "docid": "f430aaa4db59f2d981d9bd973e334f23", "score": "0.5094275", "text": "function loadleagues(leagues) {\n //Run through each leagues entry and populate \n\n if (leagues.length != 0) {\n $.each(leagues, function(key, value) {\n $(\"#leagueListUl\").append($(\"<li/>\")\n .attr(\"class\", \"list-inline-item\")\n .append($(\"<a/>\")\n .attr(\"href\", \"#\")\n .attr(\"class\", \"non-underline-link\")\n // Image tag to show the league logo\n .append($(\"<img/>\")\n .attr(\"src\", value.Img)\n .attr(\"alt\", value.Code)\n .attr(\"class\", \"hideimage\"))\n .append($(\"<br/>\"))\n .append($(\"<span/>\")\n .attr(\"class\", \"text-secondary text-center\")\n .text(value.Name))\n .on(\"click\", function(e) {\n // prevent all default action and do as we direct\n e.preventDefault();\n showLeagues();\n getleagueSection(value.Code);\n // Remove the fixed bottom class, as data is loaded and it needs to be responsive now\n $(\"#footerDiv\").removeClass(\"fixed-bottom\");\n })));\n });\n // Get and Show Top teams under Reader Board\n getRankings(leagues);\n } else {\n // Present informational message to user if no leagues currently ongoing\n $(\"#leagueListUl\").append($(\"<li/>\")\n .attr(\"class\", \"list-inline-item text-danger\")\n // .addClass(\"red\")\n .html(\"OOPS!!! No Ongoing Leagues & will be shortly in ACTION\"))\n $(\"#rankingTable\").empty();\n $(\"#readerBoard p\").html(\"Cricket is a bat-and-ball game played between two teams of eleven players on a field at the centre of which is a 20-metre (22-yard) pitch with a wicket at each end, each comprising two bails balanced on three stumps. The batting side scores runs by striking the ball bowled at the wicket with the bat, while the bowling and fielding side tries to prevent this and dismiss each player (so they are 'out').\");\n }\n}", "title": "" }, { "docid": "7c65e75f89ec255cb13647e9f5866f64", "score": "0.50802445", "text": "function initDialogStyle()\n{\n\tlet lobbyWindow = Engine.GetGUIObjectByName(\"lobbyWindow\");\n\tlobbyWindow.sprite = g_Dialog ? \"ModernDialog\" : \"ModernWindow\";\n\tlobbyWindow.size = g_Dialog ? \"42 42 100%-42 100%-42\" : \"0 0 100% 100%\";\n\tEngine.GetGUIObjectByName(\"lobbyWindowTitle\").size = g_Dialog ? \"50%-128 -16 50%+128 16\" : \"50%-128 4 50%+128 36\";\n\n\tEngine.GetGUIObjectByName(\"leaveButton\").caption = g_Dialog ?\n\t\ttranslateWithContext(\"previous page\", \"Back\") :\n\t\ttranslateWithContext(\"previous page\", \"Main Menu\");\n\n\tEngine.GetGUIObjectByName(\"hostButton\").hidden = g_Dialog;\n\tEngine.GetGUIObjectByName(\"joinGameButton\").hidden = g_Dialog;\n\tEngine.GetGUIObjectByName(\"gameInfoEmpty\").size = \"0 0 100% 100%-24\" + (g_Dialog ? \"\" : \"-30\");\n\tEngine.GetGUIObjectByName(\"gameInfo\").size = \"0 0 100% 100%-24\" + (g_Dialog ? \"\" : \"-60\");\n\n\tEngine.GetGUIObjectByName(\"middlePanel\").size = \"20%+5 \" + (g_Dialog ? \"18\" : \"40\") + \" 100%-255 100%-20\";\n\tEngine.GetGUIObjectByName(\"rightPanel\").size = \"100%-250 \" + (g_Dialog ? \"18\" : \"40\") + \" 100%-20 100%-20\";\n\tsetLeftPanelExpanded(true);\n\n\tif (g_Dialog)\n\t{\n\t\tEngine.GetGUIObjectByName(\"lobbyDialogToggle\").onPress = leaveLobby;\n\t\tg_CancelHotkey.push(leaveLobby);\n\n\t\tEngine.GetGUIObjectByName(\"chatInput\").focus();\n\t}\n}", "title": "" }, { "docid": "8a09cdd0808c0816ddd9f0f9289b9715", "score": "0.5044517", "text": "entrarEnLaSala()\n {\n let roomId = $(\"#RoomIdInput\").val();\n roomId = roomId.toUpperCase();\n\n $(\"#exampleModalLongTitle\").text(\"Introduce el ID de una sala\");\n\n showLoading();\n\n firebase.database().ref('rooms/' + roomId).once(\"value\").then(function(snapshot) {\n \n var data = snapshot.val();\n \n if (data && data.gamemode == currentGamemode.name && !data.isInGame && ((Object.keys(data.users).length < currentGamemode.maxPlayers) || currentGamemode.maxPlayers == 0)) {\n \n currentGamemode = gameModes[data.gamemode];\n currentGamemode.roomId = roomId;\n currentGamemode.addToRoom(currentGamemode.roomId);\n \n setGameLobby();\n $(\"#GP-btn_2\").text(\"Salir de la sala\")\n $(\"#GP-btn_1\").css(\"display\", \"none\");\n subscribeToEvent(roomId);\n currentGamemode.changeToLobby();\n $(\"#closeModal\").click();\n \n \n } else {\n \n sendAlert(\"No existe ninguna sala con ese identificador en este modo de juego.\", \"Error\", \"Ok\");\n hideLoading();\n }\n \n });\n }", "title": "" }, { "docid": "dfd2f8d5a4be59885683d8246b83d523", "score": "0.50424594", "text": "function getDelTeam(TeamId) {\n\n //Clear modal upon each execution\n $(\"#unRegisterDiv\").remove();\n let modalDiv = getModalTemplate(\"unRegisterDivLabel\", \"unRegisterDiv\", \"unRegModalBody\", \"unRegModalFooter\");\n $(\"#contentDiv\").append(modalDiv);\n\n //Modal event handler assignment\n //Modal event to show during focus\n $('#unRegisterDiv').on('shown.bs.modal', function() {\n $(\"#unRegisterDiv\").modal(focus);\n });\n\n //Modal event handler during modal closure to show the league page with selected option\n $('#unRegisterDiv').on('hidden.bs.modal', function(e) {\n //\"Success\" status indicates that team has been deleted and good to shift the focus\n if ($(\"#errorMsgId\").html() == \"Success\") {\n let leagueSelection = sessionStorage.getItem(\"leagueSelSession\");\n getleagueSection(leagueSelection);\n //Clear the empty and set successful message\n $(\"#errorMsgId\").empty();\n errorMsg = \"Team has been successfully deleted\";\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").removeClass(\"badInput\");\n setTimeout(\"$('#leagues').focus();\", 200);\n }\n });\n\n //Set title for modal\n $(\"#unRegisterDivLabel\").text(\"Team UnRegistration\");\n //Set modal body content for generated modal template\n $(\"#unRegModalBody\").append($(\"<p/>\")\n .html(\"Please confirm to delete the team\"))\n //button to perform operation\n $(\"#unRegModalFooter\")\n //cancel button will take back to details page through modal setup\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-secondary\")\n .attr(\"data-dismiss\", \"modal\")\n .html(\"Cancel\"))\n //confirm button to submit the delete team to server\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-primary btn-danger\")\n .attr(\"data-dismiss\", \"modal\")\n .html(\"Confirm\")\n .on(\"click\", function(e) {\n e.preventDefault();\n subDelTeam(TeamId);\n }))\n}", "title": "" }, { "docid": "dfd2f8d5a4be59885683d8246b83d523", "score": "0.50424594", "text": "function getDelTeam(TeamId) {\n\n //Clear modal upon each execution\n $(\"#unRegisterDiv\").remove();\n let modalDiv = getModalTemplate(\"unRegisterDivLabel\", \"unRegisterDiv\", \"unRegModalBody\", \"unRegModalFooter\");\n $(\"#contentDiv\").append(modalDiv);\n\n //Modal event handler assignment\n //Modal event to show during focus\n $('#unRegisterDiv').on('shown.bs.modal', function() {\n $(\"#unRegisterDiv\").modal(focus);\n });\n\n //Modal event handler during modal closure to show the league page with selected option\n $('#unRegisterDiv').on('hidden.bs.modal', function(e) {\n //\"Success\" status indicates that team has been deleted and good to shift the focus\n if ($(\"#errorMsgId\").html() == \"Success\") {\n let leagueSelection = sessionStorage.getItem(\"leagueSelSession\");\n getleagueSection(leagueSelection);\n //Clear the empty and set successful message\n $(\"#errorMsgId\").empty();\n errorMsg = \"Team has been successfully deleted\";\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").removeClass(\"badInput\");\n setTimeout(\"$('#leagues').focus();\", 200);\n }\n });\n\n //Set title for modal\n $(\"#unRegisterDivLabel\").text(\"Team UnRegistration\");\n //Set modal body content for generated modal template\n $(\"#unRegModalBody\").append($(\"<p/>\")\n .html(\"Please confirm to delete the team\"))\n //button to perform operation\n $(\"#unRegModalFooter\")\n //cancel button will take back to details page through modal setup\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-secondary\")\n .attr(\"data-dismiss\", \"modal\")\n .html(\"Cancel\"))\n //confirm button to submit the delete team to server\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-primary btn-danger\")\n .attr(\"data-dismiss\", \"modal\")\n .html(\"Confirm\")\n .on(\"click\", function(e) {\n e.preventDefault();\n subDelTeam(TeamId);\n }))\n}", "title": "" }, { "docid": "275d159db7e9449e038f0e0c87050e30", "score": "0.50352323", "text": "showCreateAreaDialog()\n {\n if(!this.create_agent_dialog){\n var create_agent_dialog = this.create_agent_dialog = new LiteGUI.Dialog( { id:\"populate_scenario\", title:'Create Area', close: true, minimize: false, width: 150, height: 100, scroll: false, resizable: false, draggable: true, parent:\"body\"});\n this.create_agent_dialog.setPosition(5,260);\n\n }\n var dlg = this.create_agent_dialog;\n\n if(!this.create_area_inspector){\n var create_area_inspector = this.create_area_inspector = new LiteGUI.Inspector(),\n create_agent_dialog = this.create_agent_dialog;\n\n create_area_inspector.on_refresh = function()\n {\n create_area_inspector.clear();\n create_area_inspector.addInfo(\"Property\", \"Value\");\n create_area_inspector.addButton(null, \"Create smart area\", {callback:function(){\n\t\t\t\t\t\n\t\t\t\t\tscene_mode = NAV_MODE;\n\t\t\t\t\tdocument.getElementById(\"main_canvas\").style.cursor = \"default\";\n if(current_area)\n {\n current_area.fromvertices();\n current_area.node.color = current_area.color;\n current_area.node.flags.two_sided = true;\n GFX.scene.root.addChild(current_area.node);\t\n current_area = null;\n }\n \n\t\t\t\t\tCORE.Player.disableModeButtons(this.id);\n\t\t\t\t\tvar btn = document.getElementById(\"navigate-mode-btn\");\n\t\t\t\t\tif(!btn.classList.contains(\"active\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbtn.classList.add(\"active\");\n\t\t\t\t\t}\n\t\t\t\t\tdlg.close();\n }}) \n \n dlg.adjustSize();\n }\n\t\t\tcreate_agent_dialog.on_close = function(){\n\t\t\t\t\tscene_mode = NAV_MODE;\n\t\t\t\t\tdocument.getElementById(\"main_canvas\").style.cursor = \"default\";\n // if(current_area)\n // {\n // //first delete nodes\n // current_area = null;\n // }\n \n\n\t\t\t\t\tCORE.Player.disableModeButtons(this.id);\n\t\t\t\t\tvar btn = document.getElementById(\"navigate-mode-btn\");\n\t\t\t\t\tif(!btn.classList.contains(\"active\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbtn.classList.add(\"active\");\n\t\t\t\t\t}\n//\t\t\t\t\tdlg.close();\n\t\t\t}\n this.create_agent_dialog.add(create_area_inspector);\n create_area_inspector.refresh();\n }\n\n this.create_agent_dialog.show('fade');\n this.create_agent_dialog.setPosition(5,270);\n }", "title": "" }, { "docid": "f85b40907ebb80e8082832797856e124", "score": "0.50134563", "text": "onEditTablePreferencesClick() {\n // Get a copy of the current options.\n const searchColumns = this.config.searchColumns;\n const options = JSON.parse(JSON.stringify(this.config.options));\n // Defaults and allowables should be set by the coder but if not they will use the TableOptionsConfig defaults.\n // But we still need to set the current options.\n options.currentOptions = {\n columnDefinitions: this.config.columnDefinitions,\n headerDisplay: this.config.headerDisplay,\n headerSticky: this.config.headerSticky,\n paginator: this.config.paginator,\n search: this.config.search,\n searchColumns: this.config.searchColumns,\n sort: this.config.sort,\n };\n // If the coder didn't pass into options the available columns then get a list of all possible columns from the data.\n if (!options.columns.length && this.asset.data && this.asset.data[0]) {\n for (const col in this.asset.data[0]) {\n if (!this.asset.data[0].hasOwnProperty(col))\n continue;\n if (IsString(this.asset.data[0][col]) || IsNumber(this.asset.data[0][col])) {\n options.columns.push(col);\n }\n }\n }\n this.onBubbleEvent('options_open', options);\n const dialogRef = this.srv.dialog.open(PopTableDialogComponent, {\n data: { options: options }\n });\n dialogRef.afterClosed().subscribe(dialog => {\n if (dialog) {\n console.log('here', dialog);\n if (dialog.type === 'save') {\n this.dom.refreshing();\n try {\n this.cdr.detectChanges();\n }\n catch (e) {\n }\n const newOptions = JSON.parse(JSON.stringify(dialog.options));\n this.onBubbleEvent('options_save', newOptions);\n // Build a new config object instead of updating the old one so that Angular's change detection will auto _update the view.\n // - Certain things (column sort / search) wont auto-_update otherwise.\n // - Requires the updating of the column defs in the setTimeout.\n // - Might be an Angular bug: https://github.com/angular/material2/issues/13030\n this.config.headerDisplay = newOptions.currentOptions.headerDisplay;\n this.config.headerSticky = newOptions.currentOptions.headerSticky;\n this.config.paginator = newOptions.currentOptions.paginator;\n this.config.searchColumns = newOptions.currentOptions.searchColumns;\n this.config.sort = newOptions.currentOptions.sort;\n this.config.updateColumnDefinitions(newOptions.currentOptions.columnDefinitions);\n if (searchColumns !== this.config.searchColumns)\n this._setFilterPredicate();\n try {\n this.cdr.detectChanges();\n }\n catch (e) {\n }\n this._resetTable();\n }\n else if (dialog.type === 'reset') {\n this.dom.refreshing();\n try {\n this.cdr.detectChanges();\n }\n catch (e) {\n }\n // Build a new config object instead of updating the old one so that Angular's change detection will auto _update the view.\n // - Certain things (column sort / search) wont auto-_update otherwise.\n // - Requires the updating of the column defs in the setTimeout.\n // - Might be an Angular bug: https://github.com/angular/material2/issues/13030\n this.onBubbleEvent('options_reset', dialog.options);\n this.config.headerDisplay = this.config.options.defaultOptions.headerDisplay;\n this.config.headerSticky = this.config.options.defaultOptions.headerSticky;\n // this.config.paginator = this.config.options.defaultOptions.paginator;\n this.config.searchColumns = this.config.options.defaultOptions.searchColumns;\n this.config.sort = this.config.options.defaultOptions.sort;\n this.config.dealWithAngularChangeDetectionFailure = false;\n const columnDefinitions = JSON.parse(JSON.stringify(dialog.options.defaultOptions.columnDefinitions));\n this.config.updateColumnDefinitions(columnDefinitions);\n if (searchColumns !== this.config.searchColumns)\n this._setFilterPredicate();\n try {\n this.cdr.detectChanges();\n }\n catch (e) {\n }\n this._resetTable();\n }\n else if (dialog.type === 'cancel') {\n this.onBubbleEvent('options_cancel', {});\n }\n }\n else {\n this.onBubbleEvent('options_cancel', {});\n }\n });\n }", "title": "" }, { "docid": "95757bb241e8a42c018b00ec620952f7", "score": "0.5011921", "text": "function initListeners() {\n //Settings Page\n $('#settings_button').click(function() {\n $('#schedule_view').hide();\n $('#settings_view').show();\n });\n $('#back_button').click(function() {\n $('#settings_view').hide();\n $('#schedule_view').show();\n });\n\n //Settings to save on update\n $('.optionCheck').click(function(t) {\n var o = {};\n if ($(t.target).hasClass('usability')) {\n extSettings.usability[t.target.id] = t.target.checked;\n o['usabilitySettings'] = extSettings.usability;\n }\n if ($(t.target).hasClass('leagues')) {\n extSettings.leagues[t.target.id] = t.target.checked;\n o['leagueSettings'] = extSettings.leagues;\n }\n if ($(t.target).hasClass('fantasy')) {\n extSettings.fantasy[t.target.id] = t.target.checked;\n o['fantasySettings'] = extSettings.fantasy;\n }\n\n chrome.storage.local.set(o);\n });\n\n $('.optionRadio').click(function(t) {\n var o = {};\n if ($(t.currentTarget).hasClass('usability')) {\n extSettings.usability[t.currentTarget.id] = t.target.id;\n o['usabilitySettings'] = extSettings.usability;\n }\n if ($(t.currentTarget).hasClass('leagues')) {\n extSettings.leagues[t.currentTarget.id] = t.target.id;\n o['leagueSettings'] = extSettings.leagues;\n }\n if ($(t.currentTarget).hasClass('fantasy')) {\n extSettings.fantasy[t.currentTarget.id] = t.target.id;\n o['fantasySettings'] = extSettings.fantasy;\n }\n\n chrome.storage.local.set(o);\n });\n\n //League Select\n $('#eu').click(function() {\n showTab(\"eu\", null);\n });\n\n $('#na').click(function() {\n showTab(\"na\", null);\n });\n\n /*//Week Select\n for (var i = 1; i <= WEEKS_IN_LCS; i++) {\n (function(i) {\n $('#week' + i + '_select').click(function() {\n showTab(null, i);\n })\n })(i);\n }*/\n\n /*//Game Select\n //Assumes elements all in order\n days = $('.naDay,.euDay');\n for (var i = 0; i < days.length; i++) {\n matches = $(days[i]).find('.naMatch,.euMatch');\n for (var j = 0; j < matches.length; j++) {\n games = $(matches[j]).find('.naGame,.euGame');\n for (var k = 0; k < games.length; k++) {\n (function(dayNum, matchNum, gameNum) {\n $(games[gameNum]).click(function() {\n getAndShowMatch(dayNum, matchNum, gameNum);\n })\n })(i, j, k);\n }\n }\n }*/\n}", "title": "" }, { "docid": "33cc863135f296161e3753bdd37a83cc", "score": "0.4984902", "text": "toggleBrailleTable() {\n let brailleTableType = SettingsManager.getString('brailleTableType');\n let output = '';\n if (brailleTableType === 'brailleTable6') {\n brailleTableType = 'brailleTable8';\n\n // This label reads \"switch to 8 dot braille\".\n output = '@OPTIONS_BRAILLE_TABLE_TYPE_6';\n } else {\n brailleTableType = 'brailleTable6';\n\n // This label reads \"switch to 6 dot braille\".\n output = '@OPTIONS_BRAILLE_TABLE_TYPE_8';\n }\n\n const brailleTable = SettingsManager.getString(brailleTableType);\n SettingsManager.set('brailleTable', brailleTable);\n SettingsManager.set('brailleTableType', brailleTableType);\n this.refresh(brailleTable);\n new Output().format(output).go();\n }", "title": "" }, { "docid": "c13534d4c4612033e672c92e27b681e2", "score": "0.49816284", "text": "function populateTeamDropdowns(listNumber) {\n var league = getSelectedLeague(listNumber);\n getData(league, listNumber);\n}", "title": "" }, { "docid": "21a11c816cefcfd86a751bf9cf13d27d", "score": "0.49815533", "text": "function addEditElements() {\n\n var table = document.getElementById(\"table_nativelanguage\");\n\n for (var i=0, row; row = table.rows[i]; i++) {\n var div_native_language = document.createElement(\"div\");\n div_native_language.id = \"div_native_language_\" + i;\n cell = row.insertCell(1);\n createButton(\"remove_nativelanguage\"+i,\"remove_nativelanguage\"+i,\"Remove\",null,div_native_language);\n cell.appendChild(div_native_language);\n }\n\n //Add the buttons for the native language\n var native_language_container = document.getElementById(\"native_language\");\n\n var div_native = document.createElement(\"div\");\n div_native.id = \"div_native\";\n\n addLanguageSelect(\"native_mainselect\",\"native_mainselect\",div_native);\n createButton(\"button_addnative\", \"button_addnative\", \"Add\", addNewNativeLangauge, div_native);\n\n var native_mainselect = document.getElementById(\"native_mainselect\")\n native_language_container.appendChild(div_native);\n\n var table = document.getElementById(\"table_learninglanguage\");\n\n for (var i=0, row; row = table.rows[i]; i++) {\n var div_learning_language = document.createElement(\"div\");\n div_learning_language.id = \"div_learning_language_\" + i;\n cell = row.insertCell(2);\n createButton(\"remove_nativelanguage\"+i,\"remove_nativelanguage\"+i,\"Remove\",\n $('table').on('click', 'input[type=\"button\"]', function(e){\n $(this).closest('tr').remove()\n })\n\n ,div_learning_language);\n cell.appendChild(div_learning_language);\n\n // Add the langauge box and level box\n cell = row.insertCell(3);\n addLanguageSelect(\"select_learning_language\"+i,\"select_learning_language\"+i, div_learning_language);\n addLanguageLevel(\"select_learning_languagelevel\"+i,\"select_learning_languagelevel\"+i,div_learning_language);\n\n cell.appendChild(div_learning_language);\n\n }\n\n //Add the buttons for the learning language\n var div_learning = document.createElement(\"div\");\n div_learning.id = \"div_learning\";\n\n //Add the \"Language\" \"Level\" \"Add\"\n addLanguageSelect(\"select_learning_language\",\"select_learning_language\", div_learning);\n addLanguageLevel(\"select_learning_languagelevel\",\"select_learning_languagelevel\",div_learning);\n createButton(\"button_addlearning\", \"button_addlearning\", \"Add\", addNewLearningLangauge, div_learning);\n\n var learning_language_container = document.getElementById(\"learning_language_container\");\n learning_language_container.appendChild(div_learning);\n\n // Add the change picture for a user\n var div_picture = document.getElementById(\"profile_picture_box\");\n createButton(\"button_editpicture\", \"button_editpicture\", \"Change picture\", changePicture, div_picture);\n\n}", "title": "" }, { "docid": "160c3974c258d93260e770e36fddc4ac", "score": "0.49712688", "text": "function getGameOptions() {\n // Todo: only show playmode option in modal when questions have been added\n\n /**\n * This function will create a match based on a game. The\n * game has to be specified by its urlsafe key.\n * @param String urlsafeKey a game's urlsafe key\n */\n function createMatch(urlsafeKey) {\n // create_match\n var userName = Cookies.get('userName');\n\n var request = gapi.client.questions.create_match({\n 'user_name': userName,\n 'urlsafe_game_key': urlsafeKey\n });\n\n request.then(function(response) {\n createNotification(\"alert-success\", \"Match successfully created.\");\n getUserMatches();\n }, function(reason) {\n createNotification(\"alert-danger\", reason.result.error.message);\n });\n }\n\n that = $(this);\n if (that.hasClass(\"playable\")) {\n if (confirm(\"Do you want to start a new match?\") == false) {\n return 0;\n }\n urlsafeKey = $(\".urlsafe-key\", that).text();\n createMatch(urlsafeKey);\n } else {\n $(\"#game-modal-title\").text($(\".title\", that).text());\n $(\"#game-modal-urlsafe-key\").val($(\".urlsafe-key\", that).text());\n $(\"#game-modal-playmode-urlsafe-key\").val($(\".urlsafe-key\", that).text());\n\n $(\"#game-modal\").modal(\"show\");\n }\n }", "title": "" }, { "docid": "579b600a9ae6bcc0410f3e85d3250808", "score": "0.4953839", "text": "add_new_game() {\n making_new_game = true;\n // Get the modal\n var modal = document.getElementById('myModal');\n // Get the <span> element that closes the modal\n var span = document.getElementById(\"closeModal\");\n\n // show modal\n modal.style.display = \"block\";\n\n\n // When the user clicks on <span> (x), close the modal\n span.onclick = function() {\n modal.style.display = \"none\";\n }\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n\n // When the user hits ESC, close it\n document.onkeydown = function(e) {\n e = e || window.event;\n var isEscape = false;\n if (\"key\" in e) {\n isEscape = (e.key == \"Escape\" || e.key == \"Esc\");\n } else {\n isEscape = (e.keyCode == 27);\n }\n if (isEscape) {\n modal.style.display = \"none\";\n }\n }\n\n document.getElementsByName(\"game_date\")[0].value = \"\";\n document.getElementsByName(\"game_time\")[0].value = \"\";\n document.getElementsByName(\"game_site\")[0].value = \"\";\n document.getElementById(\"select_site\").selectedIndex = 0;//0 = home, 1 = away, 2 = neutral\n document.getElementById(\"select_league\").selectedIndex = 0;//0 = Yes, 1 = No\n document.getElementsByName(\"sched_note\")[0].value = \"\";\n document.getElementById(\"select_halves\").selectedIndex = 0;//0 = halves, 1 = quarters\n document.getElementsByName(\"min_period\")[0].value = \"\";\n document.getElementsByName(\"min_ot\")[0].value = \"\";\n document.getElementsByName(\"vis_code\")[0].value = \"\";\n document.getElementsByName(\"home_code\")[0].value = \"\";\n document.getElementsByName(\"vis_record\")[0].value = \"\";\n document.getElementsByName(\"home_record\")[0].value = \"\";\n document.getElementsByName(\"officials\")[0].value = \"\";\n document.getElementsByName(\"atten\")[0].value = \"\";\n document.getElementsByName(\"Text1\")[0].value = \"\";\n }", "title": "" }, { "docid": "9831b081cf3fd51a65182490c7225c7d", "score": "0.49514335", "text": "function loadTeamMember(team) {\n\n //Create the table to show the list of members if members are enrolled \n if (team.Members.length > 0) {\n createTeamMemberTable();\n createTableMemberHead();\n // Run through the teams under the league to create the table rows under tablebody\n $.each(team.Members, function(key, value) {\n $(\"#teamMembListTbody\").append($(\"<tr/>\")\n .append($(\"<td/>\")\n .html(value.MemberName))\n .append($(\"<td/>\")\n .html(value.Email))\n .append($(\"<td/>\")\n .html(value.Phone))\n // create button and wire-in an event to provide more details on the team\n .append($(\"<td/>\")\n .append($(\"<a/>\")\n .attr(\"class\", \"btn-sm\")\n .attr(\"href\", \"#\")\n .append($(\"<i/>\")\n .attr(\"class\", \"fa fa-info-circle text-info\"))\n .on(\"click\", function(e) {\n e.preventDefault();\n //clear prior informtional message\n $(\"#errorMsgId\").empty();\n getTeamMembDetails(value.MemberId, team);\n }))))\n })\n } else {\n //Print informational message for team with no members enrolled yet\n $(\"#teamMemberDiv\").append($(\"<p/>\")\n .html(\"No members enrolled yet!!\")\n .attr(\"class\", \"text-success\"));\n }\n}", "title": "" }, { "docid": "9831b081cf3fd51a65182490c7225c7d", "score": "0.49514335", "text": "function loadTeamMember(team) {\n\n //Create the table to show the list of members if members are enrolled \n if (team.Members.length > 0) {\n createTeamMemberTable();\n createTableMemberHead();\n // Run through the teams under the league to create the table rows under tablebody\n $.each(team.Members, function(key, value) {\n $(\"#teamMembListTbody\").append($(\"<tr/>\")\n .append($(\"<td/>\")\n .html(value.MemberName))\n .append($(\"<td/>\")\n .html(value.Email))\n .append($(\"<td/>\")\n .html(value.Phone))\n // create button and wire-in an event to provide more details on the team\n .append($(\"<td/>\")\n .append($(\"<a/>\")\n .attr(\"class\", \"btn-sm\")\n .attr(\"href\", \"#\")\n .append($(\"<i/>\")\n .attr(\"class\", \"fa fa-info-circle text-info\"))\n .on(\"click\", function(e) {\n e.preventDefault();\n //clear prior informtional message\n $(\"#errorMsgId\").empty();\n getTeamMembDetails(value.MemberId, team);\n }))))\n })\n } else {\n //Print informational message for team with no members enrolled yet\n $(\"#teamMemberDiv\").append($(\"<p/>\")\n .html(\"No members enrolled yet!!\")\n .attr(\"class\", \"text-success\"));\n }\n}", "title": "" }, { "docid": "bb9746e4bffd63567447b5bf052d3b41", "score": "0.4950637", "text": "function limpiarVentana(){\n //Limpia las capas antes de hacer una nueva consulta\n limpiarCapas();\n\n winConfiguraciones.hide();\n formConfiguracion.getForm().reset();\n}", "title": "" }, { "docid": "1acf53db8b613609d8bab0bfe5d73edf", "score": "0.49483433", "text": "function llinking_set_url(leaguevine_url) {\r\n\tvar clid = ll_nmb - 1;\r\n\tjQuery('.players-popup').animate({height: 'hide'}, 300); // hide players popup\r\n\tif (leaguevine_url != '') {\r\n\t\t// replace player name by link\r\n\t\tjQuery('.ll'+clid).html('<a href=\"'+leaguevine_url+'\" target=\"_blank\">'+capwords[clid]+'</a>');\r\n\t\t// replace content in wp editor\r\n\t\tjQuery(\"#content_ifr\").contents().find(\"#tinymce\").html(jQuery('.llinking-form-content').html());\r\n\t\tfor (var i=0; i<capwords.length; i++) {\r\n\t\t\t// clear specs tags\r\n\t\t\tjQuery(\"#content_ifr\").contents().find(\"#tinymce .ll\"+i).replaceWith(jQuery(\"#content_ifr\").contents().find(\"#tinymce .ll\"+i).html());\r\n\t\t}\r\n\t}\r\n\tll_flag = true;\r\n\tllinking_next();\r\n}", "title": "" }, { "docid": "66b0faa5bd804a2aaad711c915733962", "score": "0.49368194", "text": "function addVenue() {\n //Get the value to add\n var venue = $(\"#txtVenue\");\n\n //Remove any errors\n if(venue.parents('.tooltip').length) {\n $(venue).css({\"borderColor\": \"#B9B9B9\"});\n $(venue).unwrap();\n $($(venue).siblings()[0]).remove();\n }\n\n //Validate the venue\n if($.inArray($(venue).val(), venues) !== -1) {\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\n $(venue).wrap(\"<div class='tooltip'>\");\n $(venue).after(\"<span class='tooltipMessage' style='left: 15%'>You've already added that venue.</span>\");\n $(venue).css({\"borderColor\": \"red\"});\n return;\n }\n\n if($(venue).val() === '') {\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\n $(venue).wrap(\"<div class='tooltip'>\");\n $(venue).after(\"<span class='tooltipMessage' style='left: 15%'>You must enter a venue.</span>\");\n $(venue).css({\"borderColor\": \"red\"});\n return;\n }\n\n if (!venue.val().replace(/\\s/g, '').length) {\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\n $(venue).wrap(\"<div class='tooltip'>\");\n $(venue).after(\"<span class='tooltipMessage' style='left: 15%'>A venue cannot be a blank string.</span>\");\n $(venue).css({\"borderColor\": \"red\"});\n return;\n }\n\n //Add the venue to the list\n if(venues.length === 0) {\n $(\"#venuesDiv\").html(\"<table class='tournamentTable'><thead><tr><th>Title</th><th>Action</th></tr></thead><tbody>\" +\n \"<tr><td>\" + $(venue).val() + \"</td><input type='hidden' value='\" + $(venue).val() +\"' name='venues[]'>\" +\n \"<td><input type='button' value='Edit' class='editBtn'><input type='button' value='Remove' class='removeBtn'></td></tr>\" +\n \"</tbody></table>\");\n venues.push($(venue).val());\n } else {\n $($($(\"#venuesDiv\").children()[0]).children()[1]).append(\"<tr><td>\" + $(venue).val() + \"</td><input type='hidden' value='\" + $(venue).val() +\"' name='venues[]'>\" +\n \"<td><input type='button' value='Edit' class='editBtn'><input type='button' value='Remove' class='removeBtn'></td>\" +\n \"</tr>\");\n venues.push($(venue).val());\n }\n\n //Remove text from input\n $($(this).siblings()[0]).val(\"\");\n\n //Register the edit and remove button handlers\n $(\"#venuesDiv .editBtn\").click(function() {\n edit(this, \"venue\");\n });\n $(\"#venuesDiv .removeBtn\").off(\"click\").click(function() {\n remove(this, \"venue\");\n });\n }", "title": "" }, { "docid": "84dd1b5faacc281e30e4f125bfcc6441", "score": "0.49094805", "text": "async onHouseSettingsCommand(player) {\n const location = this.manager_.getCurrentHouseForPlayer(player);\n if (!location || location.isAvailable()) {\n player.sendMessage(Message.HOUSE_SETTINGS_OUTSIDE);\n return;\n }\n\n const isOwner = location.settings.ownerId === player.account.userId;\n if (!isOwner && (!player.isAdministrator() || player.isTemporaryAdministrator())) {\n player.sendMessage(Message.HOUSE_SETTINGS_NOT_OWNER);\n return;\n }\n\n const menu = new Menu('What would you like to modify?', ['Option', 'Current value']);\n\n const accessValue = this.toHouseAccessLabel(location.settings.access);\n const vehicleValue = '{FFFF00}' + location.settings.vehicles.size;\n\n menu.addItem('Change the access level', accessValue, async(player) => {\n const accessMenu = new Menu('Who should be able to access your house?');\n const accessLevels = [\n HouseSettings.ACCESS_EVERYBODY,\n HouseSettings.ACCESS_FRIENDS_AND_GANG,\n HouseSettings.ACCESS_FRIENDS,\n HouseSettings.ACCESS_PERSONAL\n ];\n\n accessLevels.forEach(level => {\n const labelPrefix = location.settings.access === level ? '{FFFF00}' : '';\n const label = labelPrefix + this.toHouseAccessLabel(level);\n\n // Add the menu item for the |level| to the sub-menu shown to the player.\n accessMenu.addItem(label, async(player) => {\n await this.manager_.updateHouseSetting(player, location, 'access', level);\n\n // Change casing of the |label| so that it gramatically works in the message.\n const confirmationLabel =\n label.charAt(0).toUpperCase() + label.slice(1).toLowerCase();\n\n // Display a confirmation dialog to the player to inform them of their action.\n await MessageBox.display(player, {\n title: 'Changing the access level',\n message: Message.format(Message.HOUSE_SETTINGS_LEVEL, confirmationLabel)\n });\n });\n });\n\n // Show the access sub-menu to the player.\n await accessMenu.displayForPlayer(player);\n });\n\n menu.addItem('Manage your vehicles', vehicleValue, async(player) => {\n await alert(player, {\n title: 'Manage your vehicles',\n message: 'You are now able to use \"/v save\" while driving any vehicle to save\\n' +\n 'it to a parking lot, or \"/v delete\" in one of your vehicles to delete it.'\n });\n });\n\n // Give house extensions the ability to provide their additional functionality.\n this.manager_.invokeExtensions('onHouseSettingsCommand', player, location, menu);\n\n menu.addItem('Sell this house', '-', async(player) => {\n const offer = this.economy_().calculateHouseValue(\n location.position, location.parkingLotCount, location.interior.getData().value,\n Math.floor(server.clock.currentTime() / 1000) - location.settings.purchaseTime);\n\n const message = isOwner ? Message.format(Message.HOUSE_SETTINGS_SELL_OFFER, offer)\n : Message.format(Message.HOUSE_SETTINGS_SELL_CONFIRM,\n location.settings.ownerName);\n\n const confirmation =\n await Dialog.displayMessage(player, 'Selling the house', message,\n 'Yes' /* leftButton */, 'No' /* rightButton */);\n\n if (!confirmation.response)\n return;\n\n this.announce_().announceToAdministratorsWithFilter(\n Message.HOUSE_ANNOUNCE_SOLD, PlayerSetting.ANNOUNCEMENT.HOUSES, PlayerSetting.SUBCOMMAND.HOUSES_SELL,\n player.name, player.id, location.settings.name, location.settings.id, offer);\n\n await this.manager_.removeHouse(location);\n\n if (isOwner)\n await this.finance_().depositToPlayerAccount(player, offer);\n\n // Display a confirmation dialog to the player to inform them of their action.\n await MessageBox.display(player, {\n title: 'Congratulations on the sell!',\n message: Message.format(\n (isOwner ? Message.HOUSE_SETTINGS_SELL_CONFIRMED\n : Message.HOUSE_SETTINGS_SELL_CONFIRMED_ADMIN), offer)\n });\n });\n\n await menu.displayForPlayer(player);\n }", "title": "" }, { "docid": "29d71d15fb90c410164f6e78014ab19b", "score": "0.4909287", "text": "function onOpen() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var menuEntries = [\n {name: \"Generate Next Round\", functionName: \"generate\"},\n {name: \"Calculate Standings\", functionName: \"calculateStandings\"}\n ];\n ss.addMenu(\"Tournament\", menuEntries);\n}", "title": "" }, { "docid": "6242ea1e0b5ad3d20457a56f828cbaec", "score": "0.49034226", "text": "function btnClick(gladiator) {\n // Prevents player from clicking on an already selected champion\n if (gladiator === player) {\n statusText.css({\n color: \"red\",\n \"font-weight\": \"bold\",\n \"font-size\": \"1.5em\"\n }); // Resets the status text color\n statusText.text(\n \"You've already selected \" +\n gladiator.name +\n \" to represent you in the arena.\"\n ); // Tells the user they already picked this gladiator and prompts them to select an opponent selection\n } else {\n if (playerPicked === false) {\n // If no player is picked, selects the player\n gladiator.status = \"player\"; // sets gladiator status to player\n player = gladiator;\n // Gets player to move\n $(gladiator.divID).appendTo($(\"#playerSlot\")); // Moves the selected character to the player slot\n statusText.css({\n color: \"black\",\n \"font-weight\": \"bold\",\n \"font-size\": \"1.5em\"\n }); // Resets the status text color\n statusText.text(\n gladiator.name +\n \" has been picked to honor you in the arena, choose your opponent.\"\n ); // Tells the user which gladiator they picked and prompts them to make an opponent selection\n playerPicked = true;\n aboutFace(gladiator);\n } else if (playerPicked === true && combat === false) {\n gladiator.status = \"enemy\"; // sets this gladiator to enemey\n enemy = gladiator;\n gladiator.divID.appendTo($(\"#enemySlot\")); // Moves the selected character to the player slot\n statusText.css(\"color\", \"black\"); // Resets the status text color\n statusText.css(\"font-weight\", \"bold\");\n statusText.css(\"font-size\", \"1.5em\");\n statusText.text(\n gladiator.name +\n \" has been chosen as your opponent, click the attack button to fight.\"\n ); // Tells the user which gladiator they picked and prompts them to make an opponent selection\n $(\"#attackSlot\").css(\"visibility\", \"visible\");\n // Shows special attack if avaiable\n if (player.special === true) {\n $(\"#specialSlot\").css(\"visibility\", \"visible\");\n }\n combat = true;\n aboutFace(gladiator);\n } else {\n statusText.css(\"color\", \"red\"); // Resets the status text color\n statusText.css(\"font-weight\", \"bold\");\n statusText.css(\"font-size\", \"1.5em\");\n statusText.text(\n \"Your opponent is waiting for you to advance, click the attack button now.\"\n ); // Tells the user which gladiator they picked and prompts them to make an opponent selection\n }\n }\n}", "title": "" }, { "docid": "5b96636faac0b5df39026f59f447da19", "score": "0.48999584", "text": "function ChangerOptions() {\n $.get(`/api/fournisseur/liste`, function (data) {\n var fournisseurs = data.fournisseurs;\n\n for (i = 0; i < fournisseurs.length; i++) {\n var dataOption = {\n id: Number(fournisseurs[i].id),\n text: fournisseurs[i].nom\n }\n var newOption = new Option(dataOption.text, dataOption.id, false, false);\n $('#fournisseursModal').append(newOption).trigger('change');\n }\n })\n }", "title": "" }, { "docid": "59f76da53fcc6e1b3ca246d268b696fb", "score": "0.4899422", "text": "function activate() {\n\n // TODO: replace hard-coded teamId\n TeamResource.get({teamId: 2}, function (data) {\n teamDisplay.team = data;\n });\n\n }", "title": "" }, { "docid": "9c583dcd3b45b20167390e1f1b46aa63", "score": "0.48808327", "text": "function newMission() {\n\t// open modal\n\t$('#newMissionModal').modal('show');\n\n\t// clear and reset\n\tdocument.getElementById(\"shareWithTeam\").innerHTML = \"\";\n\n\t// fill privacy options with current teams in project\n\tvar count = 0;\n\tvar projectRef = firebase.database().ref(\"projects/\" + projectId + \"/teams/\");\n\tprojectRef.once(\"value\", function(snapshot) {\n\t\tsnapshot.forEach((child) => {\n\t\t\t// dont include current team\n\t\t\tif (child.val().name != teamName) {\n\t\t\t\tcount++;\n\t\t\t\t// display first team as standard and value\n\t\t\t\tif (count === 1) {\n\t\t\t\t\tdocument.getElementById(\"public\").value = child.val().name.toLowerCase();\n\t\t\t\t\tdocument.getElementById(\"dropdownTeams\").innerHTML = child.val().name.capitalizeFirstLetter() + \" (Public to the team)\";\n\t\t\t\t}\n\t\t\t\t// create list element\n\t\t\t\tvar teamOption = document.createElement(\"p\");\n\t\t\t\tteamOption.classList.add(\"dropdown-item\") + teamOption.classList.add(\"teamOption\");\n\t\t\t\tteamOption.innerHTML = child.val().name.capitalizeFirstLetter();\n\t\t\t\tteamOption.addEventListener(\"click\", selectTeamOption);\n\t\t\t\tdocument.getElementById(\"shareWithTeam\").appendChild(teamOption);\n\t\t\t}\n\t\t});\n\t});\n\n\t// init create mission event\n\tdocument.getElementById(\"createMission\").addEventListener(\"click\", createNewMission);\n}", "title": "" }, { "docid": "2f95587cb8dd3c10e4ce1da79e2d8d49", "score": "0.4877308", "text": "function includeDialogue() {\n\t\ttry {\n\t\t\t// if there is dialogue for this disguise\n\t\t\tlet dialogueQueued = Dialogue.showData(Dialogue.getData({\n\t\t\t\tcategory: \"disguise\",\n\t\t\t\tsubcategory: currentDisguiseObj.name\n\t\t\t}), {\n\t\t\t\taddIfInProcess: false\n\t\t\t});\n\t\t\t// otherwise play a random one\n\t\t\tif (!dialogueQueued) {\n\t\t\t\tdialogueQueued = Dialogue.showData(Dialogue.getData({\n\t\t\t\t\tcategory: \"disguise\",\n\t\t\t\t\tsubcategory: \"random\"\n\t\t\t\t}), {\n\t\t\t\t\taddIfInProcess: false\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t}", "title": "" }, { "docid": "bb8e4d19327681d0a58007a1c3ba2662", "score": "0.48756278", "text": "function C101_KinbakuClub_SlaveTwin_HelpPlayer() {\n\tif (C101_KinbakuClub_SlaveTwin_JustBoundOrGagged) {\n\t\tOverridenIntroText = GetText(\"JustAddedBondage\");\n\t\tC101_KinbakuClub_SlaveTwin_CurrentStage = 5;\n\t} else {\n\t\tif (!PlayerHasLockedInventory(\"Cuffs\")) {\n\t\t\tPlayerReleaseBondage();\n\t\t\tPlayerClothes(\"\");\n\t\t}\n\t\tif (PlayerHasLockedInventory(\"Cuffs\")) {\n\t\t\tC101_KinbakuClub_SlaveTwin_CurrentStage = 5;\n\t\t\tif (!Common_PlayerGagged) OverridenIntroText = GetText(\"NoKeys\");\n\t\t\tif (Common_PlayerGagged) {\n\t\t\t\tOverridenIntroText = GetText(\"NoKeysRemoveGag\");\n\t\t\t\tPlayerUngag()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "aed1fee154e597f684b81306417b2722", "score": "0.4867854", "text": "function saveAllianceList() {\n let rows = Array.from(document.querySelector(\"table.messagestyle\").getElementsByTagName(\"tr\"))\n let alliances = JSON.parse(GM_getValue(universe + \"alliances\"));\n rows.splice(0,1);\n rows.forEach( (row) => {\n let id = row.getAttribute(\"onclick\").match(/\\d+/g)[0];\n if (!alliances[id]) {\n alliances[id] = row.children[0].textContent\n }\n })\n GM_setValue(universe + \"alliances\", JSON.stringify(alliances));\n }", "title": "" }, { "docid": "0dd6c6fdb3311870e4ef736773bb003e", "score": "0.4867205", "text": "function updateGameSelection()\n{\n\tlet game = selectedGame();\n\n\tEngine.GetGUIObjectByName(\"gameInfo\").hidden = !game;\n\tEngine.GetGUIObjectByName(\"joinGameButton\").hidden = g_Dialog || !game;\n\tEngine.GetGUIObjectByName(\"gameInfoEmpty\").hidden = game;\n\n\tif (!game)\n\t\treturn;\n\n\tEngine.GetGUIObjectByName(\"sgMapName\").caption = translateMapTitle(game.niceMapName);\n\n\tlet sgGameStartTime = Engine.GetGUIObjectByName(\"sgGameStartTime\");\n\tlet sgNbPlayers = Engine.GetGUIObjectByName(\"sgNbPlayers\");\n\tlet sgPlayersNames = Engine.GetGUIObjectByName(\"sgPlayersNames\");\n\n\tlet playersNamesSize = sgPlayersNames.size;\n\tplayersNamesSize.top = game.startTime ? sgGameStartTime.size.bottom : sgNbPlayers.size.bottom;\n\tplayersNamesSize.rtop = game.startTime ? sgGameStartTime.size.rbottom : sgNbPlayers.size.rbottom;\n\tsgPlayersNames.size = playersNamesSize;\n\n\tsgGameStartTime.hidden = !game.startTime;\n\tif (game.startTime)\n\t\tsgGameStartTime.caption = sprintf(\n\t\t\t// Translation: %(time)s is the hour and minute here.\n\t\t\ttranslate(\"Game started at %(time)s\"), {\n\t\t\t\t\"time\": Engine.FormatMillisecondsIntoDateStringLocal(+game.startTime * 1000, translate(\"HH:mm\"))\n\t\t\t});\n\n\tsgNbPlayers.caption = sprintf(\n\t\ttranslate(\"Players: %(current)s/%(total)s\"), {\n\t\t\t\"current\": game.nbp,\n\t\t\t\"total\": game.maxnbp\n\t\t});\n\n\tsgPlayersNames.caption = formatPlayerInfo(stringifiedTeamListToPlayerData(game.players), null, game.hostUsername);\n\tEngine.GetGUIObjectByName(\"sgMapSize\").caption = translateMapSize(game.mapSize);\n\n\tlet mapTypeIdx = g_MapTypes.Name.indexOf(game.mapType);\n\tEngine.GetGUIObjectByName(\"sgMapType\").caption = g_MapTypes.Title[mapTypeIdx] || \"\";\n\n\tlet mapData = getMapDescriptionAndPreview(game.mapType, game.mapName);\n\tEngine.GetGUIObjectByName(\"sgMapDescription\").caption = mapData.description;\n\n\tsetMapPreviewImage(\"sgMapPreview\", mapData.preview);\n\tclearGameSelectionTooltip(true);\n\n\tif (!g_SelectedGameIP)\n\t\tg_CancelHotkey.splice(2, 0, setGameListBoxUnselected)\n\tg_SelectedGameIP = \"1\";\n}", "title": "" }, { "docid": "3885b7d969914787dfb968dfd79f8338", "score": "0.48565874", "text": "showGeneralOptions(){\n return(\n <Popup trigger={<button className=\"selection_action_button settings_button\">...</button>}\n closeOnDocumentClick\n position={\"left top\"}\n >\n\n\n {/*Affect players to a team*/}\n <span className={\"popup-modal\"}>\n <Popup\n trigger={<div className={\"member_option js-popin-form\"}>{this.props.translations.affect_to_team} ({this.state.selection.length})</div>}\n closeOnDocumentClick\n modal\n >\n <div className={\"popup-modal-content\"}>\n\n <h3>{this.props.translations.assign_players_to_team}</h3>\n\n {this.props.translations.choose_a_team}\n <br/>\n <select onChange={e => this.setState({selected_team_assignation:(e.target.value)})}>\n {this.state.teams_list.map(team => (\n <option value={team.id}>{team.name}</option>\n ))}\n </select>\n <br/><br/>\n {this.props.translations.team_assignation_confirmation}\n <br/><br/>\n {this.showSelection()}\n <br/>\n <button className={\"action_button\"} onClick={() => this.affectSelectionToTeam()}>\n {this.props.translations.assign_members}\n </button>\n\n </div>\n\n\n </Popup>\n </span>\n\n {/*Delete players from club*/}\n <span className={\"popup-modal\"}>\n <Popup\n trigger={<div className={\"warning member_option js-popin-form\"}>{this.props.translations.delete_from_club} ({this.state.selection.length})</div>}\n closeOnDocumentClick\n modal\n >\n <div className={\"popup-modal-content\"}>\n\n <h3>{this.props.translations.delete_players_from_club}</h3>\n\n {this.props.translations.delete_from_club_confirmation}\n <br/><br/>\n {this.showSelection()}\n <br/>\n <button className={\"action_button\"} onClick={() => this.deleteSelectionFromClub()}>\n {this.props.translations.delete_from_club}\n </button>\n\n </div>\n </Popup>\n </span>\n\n\n </Popup>\n )\n }", "title": "" }, { "docid": "d055fd4926a062d37262b13148a034de", "score": "0.485599", "text": "function loadTeamItem(team, leaguesLocalStorage) {\n $(\"#teamid\").val(team.TeamId);\n $(\"#teamid\").parent().hide();\n $(\"#teamname\").val(team.TeamName);\n $(\"#leaguecode\").val(team.League);\n $(\"#managername\").val(team.ManagerName);\n $(\"#managerphone\").val(team.ManagerPhone);\n $(\"#manageremail\").val(team.ManagerEmail);\n $(\"#maxteammembers\").val(team.MaxTeamMembers);\n $(\"#minmemberage\").val(team.MinMemberAge);\n $(\"#maxmemberage\").val(team.MaxMemberAge);\n $(\"input[name=teamgender]:checked\").val(team.TeamGender);\n\n //Set attribute\n $(\"#teamid\").attr(\"readonly\", true);\n //Fix this\n $(\"#leaguecode\").attr(\"readonly\", true);\n let leagueCode = $(\"#leaguecode\").val();\n setGender(leagueCode, leaguesLocalStorage);\n}", "title": "" }, { "docid": "d055fd4926a062d37262b13148a034de", "score": "0.485599", "text": "function loadTeamItem(team, leaguesLocalStorage) {\n $(\"#teamid\").val(team.TeamId);\n $(\"#teamid\").parent().hide();\n $(\"#teamname\").val(team.TeamName);\n $(\"#leaguecode\").val(team.League);\n $(\"#managername\").val(team.ManagerName);\n $(\"#managerphone\").val(team.ManagerPhone);\n $(\"#manageremail\").val(team.ManagerEmail);\n $(\"#maxteammembers\").val(team.MaxTeamMembers);\n $(\"#minmemberage\").val(team.MinMemberAge);\n $(\"#maxmemberage\").val(team.MaxMemberAge);\n $(\"input[name=teamgender]:checked\").val(team.TeamGender);\n\n //Set attribute\n $(\"#teamid\").attr(\"readonly\", true);\n //Fix this\n $(\"#leaguecode\").attr(\"readonly\", true);\n let leagueCode = $(\"#leaguecode\").val();\n setGender(leagueCode, leaguesLocalStorage);\n}", "title": "" }, { "docid": "5687a6cb0c76ca43aa709225e6d2d7f7", "score": "0.48552066", "text": "function addLevel() {\n //append dropdown html\n levelIndexCounter += 1\n $(\".playerCol\").append('<select class=\"selectpicker show-tick removablePlayer\" id=\"PlayerPicker' + levelIndexCounter.toString() + '\" data-style=\"btn-default\" data-width=\"100%\" data-size=\"10\"><option>1</option><option>2</option><option>3</option><option selected>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option></select>');\n $(\".levelCol\").append('<select class=\"selectpicker show-tick removableLevel\" id=\"LevelPicker' + levelIndexCounter.toString() + '\" data-style=\"btn-default\" data-width=\"100%\" data-size=\"10\"><option><selected>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option><option>20</option></select>');\n //initialise dropdowns\n $('#PlayerPicker' + levelIndexCounter.toString()).selectpicker();\n $('#LevelPicker' + levelIndexCounter.toString()).selectpicker();\n //update APL on changes\n $('#PlayerPicker' + levelIndexCounter.toString()).on('changed.bs.select', updateAPLDisplay);\n $('#LevelPicker' + levelIndexCounter.toString()).on('changed.bs.select', updateAPLDisplay);\n\n updateAPLDisplay();\n}", "title": "" }, { "docid": "6bb1186208b311751063a03979e84728", "score": "0.48520884", "text": "updateForTab() {\n // update equipment\n let equipLength = Player.getEquipmentLength();\n let l = Datas.BattleSystems.equipmentsOrder.length;\n let player = Game.current.teamHeroes[this.windowChoicesTabs.currentSelectedIndex];\n let characteristics = player.getCharacteristics();\n let list = new Array(l);\n let j, m, characteristic, isPossible;\n for (let i = 0; i < l; i++) {\n // Check if is possible because of characteristics\n isPossible = true;\n for (j = 0, m = characteristics.length; j < m; j++) {\n characteristic = characteristics[j];\n if (characteristic.kind === Enum.CharacteristicKind.AllowForbidChange &&\n characteristic.changeEquipmentID.getValue() === Datas\n .BattleSystems.equipmentsOrder[i]) {\n isPossible = characteristic.isAllowChangeEquipment;\n }\n }\n list[i] = new Graphic.Equip(player, Datas.BattleSystems\n .equipmentsOrder[i], equipLength, isPossible);\n }\n this.windowChoicesEquipment.setContents(list);\n this.selectedEquipment = -1;\n this.windowChoicesList.unselect();\n this.updateEquipmentList();\n this.updateInformations();\n }", "title": "" }, { "docid": "28623c57bc4578ffd70f95a27dae90f0", "score": "0.48495212", "text": "function setLevel() {\n console.log('setLevel()');\n \n // this depends on race and amount fields being filled into confirmation fields before level field\n var raceval = $( '#race' ).val();\n var racename = $( '#race option[value=' + raceval + ']').text()\n\n var amountid = '#' + $('#race').val() + '-amount'\n var levelid = '#' + $('#race').val() + '-level'\n var amount = $( amountid ).val();\n console.log('setLevel(): racename=\"' + racename + '\" amount=' + amount)\n \n // levels sorted high to low\n var levelname = 'ERROR: Amount not high enough for minimum sponsorship';\n for (i=0; i<levels[racename].length; i++) {\n var level = levels[racename][i];\n if (amount >= level.minsponsorship) {\n levelname = level.levelname;\n break;\n };\n };\n // set level name into {race}-level field\n $( levelid ).val(levelname);\n $( levelid ).trigger('autoresize');\n }", "title": "" }, { "docid": "3c2b14bcc77e54c4e3f63fd2095885b8", "score": "0.48263124", "text": "function showTeams(dt){\n const { address, area, name, venue, website } = dt;\n team = dt;\n getId('name').innerText = name;\n getId('area').innerText = area.name;\n getId('address').innerText = address;\n getId('venue').innerText = venue;\n getId('website').innerText = website;\n\n var teamHTML = '';\n teamHTML += \n ` \n <button class=\"btn red waves-effect waves-light\" id=\"dlt\">\n Delete\n </button>\n <button class=\"btn indigo waves-effect waves-light\" id=\"save\">\n Add\n </button>\n <br> \n `;\n \n dt.squad.forEach(function(dt) {\n const { name, position, countryOfBirth, dateOfBirth, nationality, shirtNumber } = dt;\n const date = new Intl.DateTimeFormat(['ban', 'id'], {\n // Mengubah format tanggal\n day: '2-digit', month: 'short', year: 'numeric'\n }).format(new Date(dateOfBirth));\n\n teamHTML += `<li class=\"collection-item\">\n <b>${name} - ${(shirtNumber || '')}</b>\n <p>\n Position: ${position} || Nationality: ${nationality} <br>\n ${countryOfBirth}, ${date}\n </p>\n </li>`;\n });\n document.getElementById(\"teams\").innerHTML = teamHTML;\n }", "title": "" }, { "docid": "7ceba8603611ac28464f30137ae1d8b2", "score": "0.4823387", "text": "delete_game() {\n if(app.selected_game.date != undefined) {\n if(window.confirm(\"DELETE GAME: \"+ app.selected_game.date + \" at \" + app.selected_game.time + \"?\"))\n {\n for(var index = 0; index < app.games.length; index++)\n {\n if(app.games[index].date == app.selected_game.date)\n {\n app.games.splice(index, 1);\n //UPDATE BACKEND HERE\n break;\n }\n }\n }\n }\n else {\n console.log(\"NO GAME SELECTED\");\n window.alert(\"ERROR NO GAME SELECTED\");\n }\n }", "title": "" }, { "docid": "7fac569be179ffec5f7974c8ba4b1ea5", "score": "0.48228428", "text": "initSettingsUi() {\n\n // When the user clicks on the \"close\" button, close the activity\n $(\"#settings-close\").click(() => this.close());\n\n\n // Fired when the user clicks on the account setting\n $(\"#settings-account-wrapper\").click(() => {\n\n // If the user is a guest\n if (app.isGuest) {\n\n // Alert the user\n utils.createAlert(\n \"\",\n i18next.t(\"dialogs.profileGuest\"),\n i18next.t(\"dialogs.btnNo\"),\n null,\n i18next.t(\"dialogs.btnYes\"),\n () => {\n\n // Log out\n this.logout();\n\n // Set is guest flag to false\n app.isGuest = false;\n\n }\n );\n\n // Return\n return;\n\n }\n\n // If there is no connection\n if (!navigator.onLine) {\n\n // Alert the user\n utils.createAlert(\"\", i18next.t(\"dialogs.profileOffline\"), i18next.t(\"dialogs.btnOk\"));\n\n // Return\n return;\n\n }\n\n // Show the page\n $(\"#page--account-settings\").show();\n\n // Set the opened setting name\n this._openedSetting = \"account\";\n\n });\n\n\n // Fired when the user clicks on the expert checkbox\n $(\"#expert-cbx\").click(() => {\n\n // Change the mode\n localStorage.setItem(\"mode\", (!App.isExpertMode).toString());\n\n });\n\n\n // Fired when the user clicks on the language setting\n $(\"#settings-language-wrapper\").click(() => {\n\n let targetLng;\n\n console.log(`Current language: ${App.appLanguage}`);\n\n if (App.appLanguage === \"en\") {\n targetLng = \"it\"\n }else if (App.appLanguage === \"it\") {\n targetLng = \"vi\"\n }else if (App.appLanguage === \"vi\") {\n targetLng = \"en\"\n } \n\t\t\t\n\n\n i18next.changeLanguage(targetLng, err => {\n\n if (err) {\n console.error(\"Error changing language\", err);\n utils.logOrToast(i18next.t(\"messages.changeLngError\"), \"long\");\n return;\n }\n\n $(\"body\").localize();\n localStorage.setItem(\"lng\", targetLng);\n utils.logOrToast(i18next.t(\"messages.lngChanged\", {lng: targetLng}), \"long\");\n\n });\n\n });\n\n\n // Fired when the user clicks on the help setting\n // $(\"#settings-help-wrapper\").click(() => {\n //\n // utils.logOrToast(i18next.t(\"settings.notImplemented\"), \"long\");\n //\n // });\n\n }", "title": "" }, { "docid": "06c427584545899106da1b09e7e5a5f0", "score": "0.48227918", "text": "Changed() {\n this.mediator.ColleagueChanged(this);\n }", "title": "" }, { "docid": "c9cae127fa436d85cdc13b30e458f4ae", "score": "0.48209438", "text": "function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Kabam Game Jam Tools')\n .addItem('Get Winners', 'getListOfWinners')\n .addToUi();\n}", "title": "" }, { "docid": "523db50a1103a746186c6d22abb11f66", "score": "0.48127252", "text": "function Creation_tableau_options() {\n\t\tvar tableau = document.createElement('table'),\n\t\t\toptions = [\n\t\t\t\t\t\t{ titre : 'Stockage sur Zzzelp', ID : 'lancement_zzzelp', auto : donnees.lancement_zzzelp },\n\t\t\t\t\t\t{ titre : 'Replacer l\\'antisonde', ID : 'placer_antisonde', auto : donnees.placer_antisonde }\n\t\t\t\t\t];\n\t\tif(typeof donnees.aide_relance != 'undefined') {\n\t\t\toptions.push({ titre : 'Prévenir du retour', ID : 'aide_relance', auto : donnees.aide_relance, valeur : donnees.valeur_aide_relance });\n\t\t}\n\t\tif(typeof donnees.anti_synchro != 'undefined') {\n\t\t\toptions.push({ titre : 'Lancer en fin de minute', ID : 'anti_synchro', auto : donnees.anti_synchro, valeur : donnees.seconde_renvoi });\t\t\t\n\t\t}\n\t\ttableau.setAttribute('id', 'tableau_option');\n\t\tdocument.querySelector('.zone_zzzelpfloods').appendChild(tableau);\n\t\tvar ligne = tableau.insertRow(0),\n\t\t\tcell = ligne.insertCell(0),\n\t\t\tlien = document.createElement('a');\n\t\tcell.onclick = function onclick(event) {Affichage_options(); return false };\n\t\tcell.setAttribute('colspan', '2');\n\t\tlien.innerHTML = 'Options du module';\n\t\tcell.appendChild(lien);\n\t\tfor(var i=0; i<options.length; i++) {\n\t\t\tvar ligne = tableau.insertRow(-1);\n\t\t\tligne.setAttribute('style', 'display:none');\n\t\t\tligne.insertCell(0).innerHTML = options[i].titre;\n\t\t\tvar cell = ligne.insertCell(1),\n\t\t\t\tchoix = document.createElement('input');\n\t\t\tchoix.type = 'checkbox';\n\t\t\tchoix.setAttribute('id', options[i].ID);\n\t\t\tchoix.checked = options[i].auto;\n\t\t\tchoix.onchange = function onchange(event) { Actualisation_floods(true); return false; }\n\t\t\tcell.appendChild(choix);\n\t\t\tif(options[i].ID == 'anti_synchro') {\n\t\t\t\tvar ligne = tableau.insertRow(-1),\n\t\t\t\t\tcell = ligne.insertCell(0);\n\t\t\t\t\tchoix = document.createElement('select');\n\t\t\t\tligne.setAttribute('style', 'display:none');\n\t\t\t\tcell.setAttribute('colspan', '2');\n\t\t\t\tchoix.disabled = !options[i].auto;\n\t\t\t\tchoix.id = 'seconde_anti_synchro';\n\t\t\t\tfor(var j=55;j<61;j++) {\n\t\t\t\t\tvar option = document.createElement('option');\n\t\t\t\t\toption.value = j%60;\n\t\t\t\t\toption.innerHTML = j + 'ème seconde'\n\t\t\t\t\tchoix.appendChild(option);\n\t\t\t\t}\n\t\t\t\tcell.appendChild(choix);\n\t\t\t\tchoix.value = options[i].valeur;\n\t\t\t\tchoix.onchange = function onchange(event) { Actualisation_floods(true); return false; }\n\t\t\t}\n\t\t\telse if(options[i].ID == 'aide_relance') {\n\t\t\t\tvar ligne = tableau.insertRow(-1),\n\t\t\t\t\tcell = ligne.insertCell(0);\n\t\t\t\t\tchoix = document.createElement('select'),\n\t\t\t\t\tpossibilites = new Array('Toutes les attaques', 'L\\'attaque principale');\n\t\t\t\tligne.setAttribute('style', 'display:none');\n\t\t\t\tcell.setAttribute('colspan', '2');\n\t\t\t\tchoix.disabled = !options[i].auto;\n\t\t\t\tchoix.id = 'choix_aide_relance';\n\t\t\t\tfor(var j=0; j<possibilites.length; j++) {\n\t\t\t\t\tvar option = document.createElement('option');\n\t\t\t\t\toption.value = j+1;\n\t\t\t\t\toption.innerHTML = possibilites[j];\n\t\t\t\t\tchoix.appendChild(option);\n\t\t\t\t}\n\t\t\t\tcell.appendChild(choix);\n\t\t\t\tchoix.value = options[i].valeur;\n\t\t\t\tchoix.onchange = function onchange(event) { Actualisation_floods(true); return false; }\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "80c1011fe6227f56b97613f09c33d16d", "score": "0.4809649", "text": "loadGameMenu() {\n // Find all the savegames\n var innerHTML = '';\n for (var i = 0; i < localStorage.length; i++){\n var thisKey = localStorage.key(i);\n if (thisKey.startsWith(STORAGE_KEY)) {\n var thisJsXw = JSON.parse(localStorage.getItem(localStorage.key(i)));\n var thisDisplay = thisKey.substr(STORAGE_KEY.length);\n innerHTML += `\n <label class=\"settings-label\">\n <input id=\"${thisKey}\" checked=\"\" type=\"radio\" class=\"loadgame-changer\">\n ${thisDisplay}\n </input>\n </label>\n `;\n }\n }\n if (!innerHTML) {\n innerHTML = 'No save games found.';\n }\n\n // Create a modal box\n var loadgameHTML = `\n <div class=\"loadgame-wrapper\">\n ${innerHTML}\n </div>\n `;\n this.createModalBox('Load Game', loadgameHTML);\n }", "title": "" }, { "docid": "d437057e6b9af2c37c325fcf1bb9e9c5", "score": "0.48072433", "text": "function setup_metric_league_buttons() {\n d3.select('#metric_league_button_bar')\n .selectAll('.btn')\n .on('click', function () {\n // Remove active class from all buttons\n d3.select('#metric_league_button_bar').selectAll('.btn').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var league = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n var team_id = get_winner_id(league);\n redraw_playertype_chart(league, team_id);\n });\n}", "title": "" }, { "docid": "ef5769d001e87838fa6e6091e154af3c", "score": "0.4800559", "text": "displayTeamGamesMade(game){\n\t\t\treturn (\n\t\t\t\t<tr key={game.id+\"m\"}>\n\t\t\t\t\t<td >{game.sport}</td>\n\t\t\t\t\t<td >{game.name}</td>\n\t\t\t\t\t<td >{game.location}</td>\n\t\t\t\t\t<td><Link to={'/teamgames:'+game.id}>Link</Link></td>\n\t\t\t\t\t<td><button className='btn btn-danger'\n\t\t\t\t\t\tonClick={()=>{this.deleteTeamGame(game.id,game.teams)}}>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</button></td>\n\t\t\t\t</tr>\n\t\t\t)\n\t\t}", "title": "" }, { "docid": "7975fdbb332af711890803969f875dc7", "score": "0.47996697", "text": "function buildAdminTeamTable(text, user) {\n resetPage();\n\n // Show team table and add team button\n document.querySelector(\"#adminTeamTable\").classList.remove(\"hidden\");\n document.querySelector(\"#btnAddTeam\").classList.remove(\"hidden\");\n\n // The table\n let arr = JSON.parse(text);\n let theTable = document.querySelector(\"#adminTeamTable\");\n let html = theTable.querySelector(\"tr\").innerHTML;\n\n html += \"<div>\";\n\n for (let i = 0; i < arr.length; i++) {\n let row = arr[i];\n\n html += \"<tr>\";\n html += \"<td>\" + row.teamID + \"</td>\";\n html += \"<td>\" + row.teamName + \"</td>\";\n if (row.earnings === null) {\n html += \"<td>$0.00</td>\";\n } else {\n html += \"<td><strong>$\" + row.earnings + \"</strong></td>\";\n }\n html += \"<td><button class=viewPlayers>View Players</button></td>\";\n html += \"<td><button class=editTeam>Edit Team</button></td>\";\n html += \"<td><button class=deleteTeam>Delete Team</button></td>\";\n html += \"</tr>\";\n }\n\n html += \"</div>\";\n theTable.innerHTML = html;\n // End of table\n\n // Adding event listeners for the 'View Players' buttons\n let players = document.querySelectorAll(\".viewPlayers\");\n let edit = document.querySelectorAll(\".editTeam\");\n let del = document.querySelectorAll(\".deleteTeam\");\n for (var i = 0; i < players.length; i++) {\n let temp = players[i];\n let tempEdit = edit[i];\n let tempDel = del[i];\n temp.addEventListener(\"click\", getPlayers);\n tempEdit.addEventListener(\"click\", editTeam);\n tempDel.addEventListener(\"click\", deleteTeam);\n }\n\n // Reset user variable\n user = \"\";\n}", "title": "" }, { "docid": "847edd24ae9c89f918cdfdab1d5f0d6d", "score": "0.47751862", "text": "edit_game() {\n if(app.selected_game.date != undefined) {\n // See laptop for game edit screen\n // Might require loading from backend\n\n making_new_game = false;\n\n // Get the modal\n var modal = document.getElementById('myModal');\n // Get the <span> element that closes the modal\n var span = document.getElementById(\"closeModal\");\n\n // show modal\n modal.style.display = \"block\";\n\n // When the user clicks on <span> (x), close the modal\n span.onclick = function() {\n modal.style.display = \"none\";\n }\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n\n // When the user hits ESC, close it\n document.onkeydown = function(e) {\n e = e || window.event;\n var isEscape = false;\n if (\"key\" in e) {\n isEscape = (e.key == \"Escape\" || e.key == \"Esc\");\n } else {\n isEscape = (e.keyCode == 27);\n }\n if (isEscape) {\n modal.style.display = \"none\";\n }\n }\n\n document.getElementsByName(\"game_date\")[0].value = app.selected_game.date;\n document.getElementsByName(\"game_time\")[0].value = app.selected_game.time;\n document.getElementsByName(\"game_site\")[0].value = app.selected_game.site;\n document.getElementById(\"select_site\").selectedIndex = 1;//0 = home, 1 = away, 2 = neutral\n document.getElementById(\"select_league\").selectedIndex = 1;//0 = Yes, 1 = No\n document.getElementsByName(\"sched_note\")[0].value = app.selected_game.schedule_note;\n document.getElementById(\"select_halves\").selectedIndex = 1;//0 = halves, 1 = quarters\n document.getElementsByName(\"min_period\")[0].value = app.selected_game.min_period;\n document.getElementsByName(\"min_ot\")[0].value = app.selected_game.min_ot;\n document.getElementsByName(\"vis_code\")[0].value = app.selected_game.vis_team;\n document.getElementsByName(\"home_code\")[0].value = app.selected_game.home_team;\n document.getElementsByName(\"vis_record\")[0].value = app.selected_game.vis_record;\n document.getElementsByName(\"home_record\")[0].value = app.selected_game.home_record;\n document.getElementsByName(\"officials\")[0].value = app.selected_game.officials;\n document.getElementsByName(\"atten\")[0].value = app.selected_game.attendance;\n document.getElementsByName(\"Text1\")[0].value = app.selected_game.comments;\n }\n else {\n app.run_search();\n }\n }", "title": "" }, { "docid": "6ffc9feacaaabd5171e706c58aa1eb5c", "score": "0.4774807", "text": "displayTeamsMade(team){\n\t\t\treturn (\n\t\t\t\t<tr key={team._id+\"m\"}>\n\t\t\t\t\t<td >{team.sport}</td>\n\t\t\t\t\t<td >{team.name}</td>\n\t\t\t\t\t<td >{team.location}</td>\n\t\t\t\t\t<td><Link to={'/teams:'+team._id}>Link</Link></td>\n\t\t\t\t\t<td><button className='btn btn-danger'\n\t\t\t\t\t\tonClick={()=>{this.deleteTeam(team._id,team.members)}}>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</button></td>\n\t\t\t\t</tr>\n\t\t\t)\n\t\t}", "title": "" }, { "docid": "54ab76c445f90b2b3062213a50348088", "score": "0.4773551", "text": "function submitLeague(newLeague) {\n $.post(\"/api/createleague\", newLeague, function() {\n // window.location.href = \"/login\";\n });\n }", "title": "" }, { "docid": "caad3965568c4c6b2bb50b0df0bebc1a", "score": "0.4771323", "text": "function joinGame() {\n name = $('input#name').val();\n gameId = $('input#gameid').val().toUpperCase();\n id = ds.getUid();\n recordName = 'player/' + id;\n\n // Retrieve the record for the player's control data. When the record\n // was deleted previously it will be created again here\n ds.record.getRecord(recordName).whenReady(function (r) {\n\n record = r;\n setSize();\n\n record.set({\n id: id,\n gameId: gameId,\n name: name,\n active: false,\n direction: -1,\n });\n\n record.once('delete', function () {\n ingame = false;\n // Show the gameover screen\n $('#tabs-controls').tabs('select_tab', 'game-over');\n\n // Bind play again button\n $('#game-over button').one('touch click', joinGame);\n\n // Unsubscribe from the satus event (the same happens if the\n // client goes offline)\n ds.event.unsubscribe('status/' + gameId + \"/\" + id);\n });\n\n ds.event.subscribe('status/' + gameId + \"/\" + id, function () {\n });\n\n // That's it, we're in!\n $('#tabs-controls').tabs('select_tab', 'controls');\n ingame = true;\n });\n }", "title": "" }, { "docid": "8fa575d7f6161fba58c5ebe459d2a464", "score": "0.47685653", "text": "function gui_datablock(type, id)\n{\n switch (type)\n {\n case \"pilot_general\":\n {\n return \"<div class='dialog_box_title'><font>\" + string(\"dialog_general\") + \"</font></div>\"\n + \"<div class='dialog_box_content' class='player'>\"\n + \"Name: \" + game.player.ship.name\n + \"<br>\" + string(\"dialog_alliance\") + \": <a onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); new game.Dialog(\"+alliance+\")'>\" + game.player.ship.alliance + \"</a>\"\n + \"<br>Credits: \" + money(game.player.credits) + \" Cr\"\n + \"<br>\" + string(\"dialog_location\") + \": \" + string(game.current.sector.name)\n + \"<br>\" + string(\"dialog_playtime\") + \": \" + show_time(game.player.game_time)\n + \"</div>\"\n } break;\n\n case \"pilot_titles\":\n {\n return \"<div class='dialog_box_title'>\" + string(\"dialog_titles\") + \"</div>\"\n + \"<div class='dialog_box_content'>\"\n + game.player.traderank + \" (\" + game.player.tradepoints + \" \" + string(\"dialog_tradepoints\") + \")\"\n + \"<br>\" + game.player.fightrank + \" (\" + game.player.fightpoints + \" \" + string(\"dialog_fightpoints\") + \")\"\n + \"</div>\"\n } break;\n\n case \"pilot_statistics\":\n {\n return \"<div class='dialog_box_title'>\" + string(\"dialog_statistics\") + \"</div>\"\n + \"<div class='dialog_box_content'>\"\n + string(\"dialog_fired\") + \" \" + string(\"dialog_shots\") + \": \" + game.player.shots_fired\n + \"<br>\" + string(\"dialog_fired\") + \" \" + string(\"dialog_rockets\") + \": \" + game.player.rockets_fired\n + \"<br>\" + string(\"dialog_accuracy\") + \" \" + string(\"dialog_shots\") + \": \" + rounded2(game.player.shots_hit / game.player.shots_fired * 100) + \" % \"\n + \"<br>\" + string(\"dialog_accuracy\") + \" \" + string(\"dialog_rockets\") + \": \" + rounded2(game.player.rockets_hit / game.player.rockets_fired * 100) + \" % \"\n + \"<br>\" + string(\"dialog_distance\") + \": \" + rounded2(game.player.traveled_distance) + \" km\"\n + \"<br>\" + string(\"dialog_gates\") + \": \" + game.player.passed_gates\n + \"</div>\"\n } break;\n\n case \"ship_general\":\n {\n return \"<div class='dialog_box_content'>\"\n + string(\"dialog_shield\") + \": \" + rounded(game.player.ship.shield.points) + \" / \" + game.player.ship.shield.points_max + \" (\" + rounded(game.player.ship.shield.points / game.player.ship.shield.points_max * 100) + \" %)\"\n + \"<br>\" + string(\"dialog_hull\") + \": \" + rounded(game.player.ship.hull) + \" / \" + game.player.ship.hull_max + \" (\" + rounded(game.player.ship.hull / game.player.ship.hull_max * 100) + \" %)\"\n + \"<br>\" + string(\"dialog_weapons\") + \": \" + rounded(game.player.ship.generator) + \" / \" + game.player.ship.generator_max + \" (\" + rounded(game.player.ship.generator / game.player.ship.generator_max * 100) + \" %)\"\n + \"<br>\" + string(\"dialog_speed\") + \": \" + rounded(game.player.ship.mspeed) + \" m/s\"\n + \"<br>\" + string(\"dialog_freight\") + \": 0 / \" + game.player.ship.cargo.size + \" \" + string(\"dialog_units\")\n + \"</div>\"\n } break;\n\n case \"ship_turrets\":\n {\n // Get ship turrets\n var turrets = \"\";\n for (var i = 0; i < game.player.ship.turrets.length; i++)\n {\n if (game.player.ship.turrets[i].type !== null)\n {\n turrets += string(\"item_\" + game.player.ship.turrets[i].type) + \"<br>\";\n }\n }\n\n return \"<div class='dialog_box_title'>\" + string(\"dialog_turrets\") + \"</div>\"\n + \"<div class='dialog_box_content'>\"\n + turrets\n + \"</div>\"\n } break;\n\n case \"ship_details\":\n {\n\n return \"<div class='dialog_box_title'>\" + string(\"dialog_details\") + \"</div>\"\n + \"<div class='dialog_box_content'>\"\n + string(\"dialog_maxspeed\") + \": \" + game.player.ship.mspd + \" m/s (\" + string(\"dialog_upgradeable\") + \" \" + game.player.ship.mspd_max + \" m/s)\"\n + \"<br>\" + string(\"dialog_acceleration\") + \": \" + game.player.ship.mspd/10 + \" m/s² (\" + string(\"dialog_upgradeable\") + \" \" + game.player.ship.mspd_max/10 + \" m/s²)\" \n + \"<br>\" + string(\"dialog_mobility\") + \": \" + game.player.ship.steer + \" % (\" + string(\"dialog_upgradeable\") + \" \" + game.player.ship.steer_max + \" %)\"\n + \"</div>\"\n\n + \"<div class='dialog_box_content'>\"\n + string(\"dialog_cargohold\") + \": \" + game.player.ship.cargo.size + \" \" + string(\"dialog_units\") + \" (\" + string(\"dialog_upgradeable\") + \" \" + game.player.ship.cargo.size_max + \" \" + string(\"dialog_units\") + \")\"\n + \"<br>\" + string(\"dialog_cargoclass\") + \": \" + game.player.ship.cargo.name\n + \"</div>\"\n\n + \"<div class='dialog_box_content'>\"\n + string(\"dialog_turrets\") + \": \" + Object.keys(game.db.ships[game.player.ship.ship].weapons.slots).length\n + \"<br>\" + string(\"dialog_maxshield\") + \": \" + string(\"item_\" + game.db.ships[game.player.ship.ship].shields.compatible[Object.keys(game.db.ships[game.player.ship.ship].shields.compatible).length-1])\n + \"</div>\"\n } break;\n }\n}", "title": "" }, { "docid": "1d584654bfaf8676eb936ceaf8cf0760", "score": "0.47664562", "text": "function changeOptions(data){\n\tconsole.log(data);\n\n\n\tif (!data) {\n //message('Error: No value specified');\n return;\n }\n\t\n\tchrome.storage.local.set({'game_choice': data}, function() {\n console.log('Settings saved');\n //console.log(localStorage[\"game_choice\"]);\n });\n //console.log(localStorage[\"game_choice\"]);\n}", "title": "" }, { "docid": "37376ad34992eaf2bd080f7c7e591a11", "score": "0.476368", "text": "function setBotGame() {\n\t\tvar game = {\n\t\t\tname: config.game\n\t\t};\n\t\tif(config.game==\"default\") {\n\t\t\tgame = {\n\t\t\t\tname: \"awesomebot.xyz\",\n\t\t\t\turl: \"http://awesomebot.xyz\"\n\t\t\t};\n\t\t}\n\t\tbot.editStatus(config.status, game);\n\t\tstartMessageCount();\n\t}", "title": "" }, { "docid": "a546cf21b4f78ba0642615a3580f918c", "score": "0.47581393", "text": "leagueTeamData() {\n getLeagueTeamData(2005);\n }", "title": "" }, { "docid": "97f0f968e0a21f280b72ecb587f66152", "score": "0.47577986", "text": "function insertIntoPlayerSelect()\n{\n\t\n\t\n\tvar playerId;\n\tvar playerName;\n\tremoveAllOption(\"playerSelect\");\n\tplayerId = game.getMe();\n\tplayerName = game.getPlayerName(playerId);\n\tappendOptionLast(playerName, playerId, \"playerSelect\", 'img/' + game.getPlayerIcon(playerId));\n\t\n\t\n\tfor ( var i = 0; i < playerNumTotal; i++) {\n\t\tplayerId = game.getPlayerId(i);\n\t\tif(game.getisPlayerMe(playerId) != \"true\")\n\t\t{\n\t\t\tvar found = false;\n\t\t\tfor(var j =0 ; j < game.numOfGolals &&!found ; j++)\n\t\t\t{\n\t\t\t\tif(game.goals[j].type%10 == playerId)\n\t\t\t\t{\n\t\t\t\t\tplayerName = game.getPlayerName(playerId);\n\t\t\t\t\tappendOptionLast(playerName, playerId, \"playerSelect\", 'img/' + game.getPlayerIcon(playerId));\n\t\t\t\t\tfound =true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\t\n\t$(\"#playerSelect\").msDropDown();\n\t\n\t\n\t//gil\n\t// var playersIconsDropDown = document.getElementById('playerSelect_title');\n\t//\t\n\t//\tplayersIconsDropDown.style.width = '120px';\n\t//\tplayersIconsDropDown.style.height = '30px';\n\t//\t\n\t//gilend\n\t\n}", "title": "" }, { "docid": "b543ea023bfd84b6ff0999976646ab8d", "score": "0.4756398", "text": "function no_match_options(obj_result){\r\n\r\n var team = [];\r\n if (obj_result !== undefined){\r\n for(var i=0; i < obj_result.length; ++i){\r\n /* split the result */\r\n var errors = obj_result[i].error.split('**');\r\n //alert(errors[1]);\r\n var el = $('<div></div>'); el.html(errors[1]);\r\n var text_reference = $('i', el).text();\r\n /* find team for reference */\r\n var t = text_reference.split('|');\r\n reference_box.append('<div class=\"panel panel-default\" title=\"Add current player to lookup list\">\\\r\n <div class=\"panel-heading\" role=\"tab\">\\\r\n <h4 class=\"panel-title\">\\\r\n <a class=\"collapsed\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#\" aria-expanded=\"false\" player_name=\"'+t[0].trim()+'\">\\\r\n '+text_reference+'\\\r\n </a>\\\r\n </h4>\\\r\n </div>\\\r\n </div>');\r\n //alert(t[1]);\r\n //team.push(t[1].trim());\r\n /* prevent to duplicate team names */\r\n if (team.toString().match(t[1].trim()) == null){\r\n team.push(t[1]);\r\n }\r\n }\r\n }\r\n /* populate team options */\r\n for (var j=0; j < team.length; ++j){\r\n team_select_ref.append('<option value=\"'+team[j]+'\">'+team[j]+'</option>');\r\n }\r\n /* initialise button event on click */\r\n $('.panel-default').each(function(){\r\n $(this).on('click', function(){\r\n add_player_reference($(this).find('a').attr('player_name'), $(this));\r\n });\r\n });\r\n //console.log(team);\r\n}", "title": "" }, { "docid": "3cf330bc099ffa5ee680bdfb5f8d0333", "score": "0.4755356", "text": "function handleOnButtonClick(btn) {\r\n switch (btn) {\r\n case 'ADDTEAM':\r\n commonAddRow(\"regionalTeamListGrid\");\r\n break;\r\n case 'DELETETEAM':\r\n commonDeleteRow(\"regionalTeamListGrid\");\r\n break;\r\n case 'ADDMEMBER':\r\n commonAddRow(\"regionalTeamMemberListGrid\");\r\n break;\r\n case 'DELETEMEMBER':\r\n commonDeleteRow(\"regionalTeamMemberListGrid\");\r\n break;\r\n case 'CURRENT':\r\n // Get the time of today.\r\n var today = formatDate(new Date, \"mm/dd/yyyy\");\r\n today = getRealDate(today, \"mm/dd/yyyy\").getTime();\r\n var currentTeamDataGrid = getXMLDataForGridName(\"regionalTeamListGrid\");\r\n var regionalTeamId = currentTeamDataGrid.recordset(\"ID\").value;\r\n setTableProperty(eval(\"regionalTeamMemberListGrid\"), \"selectedTableRowNo\", null);\r\n regionalTeamMemberListGrid_filter(\"CREGIONALTEAMID = \" + regionalTeamId + \" and CEFFECTIVETODATELONG > \" + today);\r\n doDispControl();\r\n currentTeamDataGrid.recordset(\"CISSHOWCURRENTAVAILABLE\").value = 'N';\r\n currentTeamDataGrid.recordset(\"CISSHOWALLAVAILABLE\").value = 'Y';\r\n var functionExists = eval(\"window.pageEntitlements\");\r\n if (functionExists) {\r\n pageEntitlements(true, \"regionalTeamListGrid\");\r\n }\r\n break;\r\n case 'ALL':\r\n var currentTeamDataGrid = getXMLDataForGridName(\"regionalTeamListGrid\");\r\n var regionalTeamId = currentTeamDataGrid.recordset(\"ID\").value;\r\n setTableProperty(eval(\"regionalTeamMemberListGrid\"), \"selectedTableRowNo\", null);\r\n regionalTeamMemberListGrid_filter(\"CREGIONALTEAMID = \" + regionalTeamId);\r\n doDispControl();\r\n currentTeamDataGrid.recordset(\"CISSHOWCURRENTAVAILABLE\").value = 'Y';\r\n currentTeamDataGrid.recordset(\"CISSHOWALLAVAILABLE\").value = 'N';\r\n var functionExists = eval(\"window.pageEntitlements\");\r\n if (functionExists) {\r\n pageEntitlements(true, \"regionalTeamListGrid\");\r\n }\r\n break;\r\n default:break;\r\n }\r\n}", "title": "" }, { "docid": "ad76fbbf3a744e84694bb09a7ac181a4", "score": "0.47419944", "text": "function manageTurn()\n{\n\tif (nowPlaying == \"white\")\n\t{\n\t\t$(\"#whoisplaying-table-name\").html(playerName2);\n\t\t$(\"#whoisplaying-table-color-support\").css(\"background-color\", \"black\");\n\t\tnowPlaying = \"black\";\n\t}\n\telse\n\t{\n\t\t$(\"#whoisplaying-table-name\").html(playerName1);\n\t\t$(\"#whoisplaying-table-color-support\").css(\"background-color\", \"white\");\n\t\tnowPlaying = \"white\";\n\t}\n\n\tsetDragTurn();\n\tmanageTimer();\n\t\n\t//manageRotation();\n}", "title": "" }, { "docid": "89b531323609bd817777dd67d94b8ff4", "score": "0.47412407", "text": "async onAchievementsCommand(currentPlayer, targetPlayer) {\n const player = targetPlayer || currentPlayer;\n const achievements = this.manager_.getDelegate(CollectableDatabase.kAchievement);\n\n const dialog = new Menu('Achievements', [\n 'Name',\n 'Description',\n\n ], { pageSize: 25 });\n\n for (const [ achievement, { name, text } ] of kAchievements) {\n const achieved = achievements.hasAchievement(player, achievement, /* round= */ false);\n const colour = achieved ? '{FFFF00}' : '{CCCCCC}';\n\n dialog.addItem(colour + name, colour + text);\n }\n\n await dialog.displayForPlayer(currentPlayer);\n }", "title": "" }, { "docid": "fbd2f37f53c036acf9cc893e00af8f0a", "score": "0.47403464", "text": "function deleteGame(){\n var deleteButton = document.getElementById('gamedetails_delete');\n if (deleteState == 0) {\n deleteButton.value = \"Press again to confirm\";\n deleteState = 1;\n setTimeout(function() {\n deleteState = 0;\n deleteButton.value = \"Delete Game\";\n }, 1000);\n } \n else {\n var state = mainState.getState();\n var teamID = state.teamID;\n var gameID = state.gameID;\n var currGame = getTeamGame(teamID, gameID);\n var games = api.getTeamGames(teamID);\n currGame.active = false;\n api.setTeamGame(teamID, gameID, currGame);\n window.location = 'schedule.html';\n console.log(\"DELETED\")\n }\n\n}", "title": "" }, { "docid": "15781f127ad7b8cca799400d101a5ace", "score": "0.4738116", "text": "function setPlayers() {\n\tval = []\n\tif ((i = tab.findIndex((str) => RegExp('.*pset', 'i').test(str))) == -1) return Utils.errorMessage(\"Aucun joueur trouvé.\")\n\twhile (regId.test(tab[++i])) {\n\t\tval.push(findPlayer(tab[i]))\n\t}\n\tif (!val || !val[0]) return Utils.errorMessage('Aucun utilisateur trouvé')\n\tlg.players = val\n\tif (save()) chan.send(\"L'affectation s'est correctement déroulée. Les membres sont maintenant \" + lg.players.length + \" : \" + sendPlayerList())\n}", "title": "" }, { "docid": "c00bc277819e1cca683abbf1b9ffb130", "score": "0.4738054", "text": "static async addGameTest () {\n // Vérification de la gestion d'erreur\n runner('rejects', DatabaseTest.object.addGame('Test'), /2,INSERT 1 0/)\n dbKO = true\n runner('rejects', DatabaseTest.object.addGame('Test'))\n dbKO = false\n\n // Vérification de l'ajout d'une partie\n runner('equal', await DatabaseTest.object.addGame('truc'), '2')\n }", "title": "" }, { "docid": "6ea3fd8af8f0500468f31e41314f51f0", "score": "0.47372103", "text": "function showAllClues()\n\t\t{\n\t\tresetGuess();\n\t\tsettingsData.current.clueNo = CLUES - 1;\n\t\tsettingsData.current.allCluesRevealed = true;\n\t\tsaveSettings();\n\t\tGAME.sound.play('ding');\n\t\tshowClue();\n\t\t}", "title": "" }, { "docid": "4cc2595e4b4759bb865c3589188c8661", "score": "0.47359833", "text": "function updateForNewGame(){\n orignalSettings();\n buttonAble();\n \n}", "title": "" }, { "docid": "c79668722ff2c55f0f54b2f1206dd02a", "score": "0.4730465", "text": "function insertIntoGoalSelect()\n{\n\t\n\tremoveAllOption(\"goalSelect\");\n\t// appendOptionLast(\"Choose Goal\",0,\"goalSelect\");\n\tvar dropdownIndex = document.getElementById('playerSelect').selectedIndex;\n\tvar goalType;\n\t//var playerName = document.getElementById('playerSelect')[dropdownIndex].text;\n\tvar playerId = document.getElementById('playerSelect')[dropdownIndex].value;\n\t//var playerSerial=game.getPlayerSerial(playerId); \n\tvar goalNum=0;\n\t//alert(\"insertIntoGoalSelect -revelation game.numOfGolals \"+game.numOfGolals);\n\t\n\tfor(var j =0 ; j < game.numOfGolals; j++)\n\t{\n\t\tgoalType=game.goals[j].type;\n\t\t\n\t\t//gil\n\t\t//alert(\" goalType \" +goalType);\n\t\t//gilend\n\t\t\n\t\t\tgoalNum++;\n\t\t\tappendOptionLast(goalNum,goalType,\"goalSelect\", '');\n\t\t\t\t\t\t\n\t}\t\n\t\n\t\n}", "title": "" }, { "docid": "cda2a4e37fb1040b606fbfbc2bc9cf64", "score": "0.47296578", "text": "function addEditTurnOff(){\n var name = $.trim($(\"#con_name\").val());\n var pause = $.trim($(\"#pause\").val());\n var resume = $.trim($(\"#resume\").val());\n var pausing_resaon = $.trim($(\"#pausing_resaon\").val());\n var id =$.trim($(\"#id\").val());\n\n var y1=pause.split(\"-\");\n var date1=new Date(y1[0],(y1[1]-1),y1[2]);\n var y2=resume.split(\"-\");\n var date2=new Date(y2[0],(y2[1]-1),y2[2]);\n \n \n var today = new Date();\n\n if(name == ''){\n $(\"#errormsg\").addClass('errormsg').html(\"Please Select the Contractor\");\n \t\t$(\"#con_name\").focus();\n \t\treturn false;\n }else{\n $(\"#errormsg\").addClass('errormsg').html(\"\");\n }\n if(pause == ''){\n $(\"#errormsg\").addClass('errormsg').html(\"Please select the Pause Leads on date\");\n \t\t$(\"#pause\").focus();\n \t\treturn false;\n }else{\n $(\"#errormsg\").addClass('errormsg').html(\"\");\n }\n if(date1 < today){\n $(\".errormsg\").addClass('errormsg').html(\"Pause Leads on date Must be in future\");\n $(\"#pause\").focus();\n return false;\n }\n if(resume == ''){\n $(\"#errormsg\").addClass('errormsg').html(\"Please select the Resume Leads on date\");\n \t\t$(\"#resume\").focus();\n \t\treturn false;\n }else{\n $(\"#errormsg\").addClass('errormsg').html(\"\");\n }\n if(date2 < today || date2 < date1){\n $(\".errormsg\").addClass('errormsg').html(\"Resume Leads on date Must be in future\");\n $(\"#resume\").focus();\n return false;\n }else{\n $(\"#errormsg\").addClass('errormsg').html(\"\");\n }\n if(pause == resume){\n $(\".errormsg\").html(\"Pause Leads on and Resume Leads on should not be same\");\n $(\"#resume\").focus();\n return false;\n }else{\n $(\"#errormsg\").addClass('errormsg').html(\"\");\n }\n if(pausing_resaon == ''){\n $(\"#errormsg\").addClass('errormsg').html(\"Please select the Pausing Reason\");\n \t\t$(\"#pausing_resaon\").focus();\n \t\treturn false;\n }else{\n $(\"#errormsg\").addClass('errormsg').html(\"\");\n }\n \n }", "title": "" }, { "docid": "f58a6a3aa6f6b79bcf08408d6756b3aa", "score": "0.47294143", "text": "function registerForTournamentButtonClicked() {\n loadAthleteInformation(); // to check if filled\n\n // retrieve values\n var poomsae = eventsPoomsaeElement.checked;\n var sparring = eventsSparringElement.checked;\n var needEquipmentBuddy = needEquipmentBuddyElement.checked;\n var needEquipmentBuddyHogu = needEquipmentBuddyHoguElement.checked;\n var needEquipmentBuddyHelmet = needEquipmentBuddyHelmetElement.checked;\n var needEquipmentBuddyArmGuards = needEquipmentBuddyArmGuardsElement.checked;\n var needEquipmentBuddyShinGuards = needEquipmentBuddyShinGuardsElement.checked;\n var needEquipmentBuddyGloves = needEquipmentBuddyGlovesElement.checked;\n var needEquipmentBuddyFeetProtectors = needEquipmentBuddyFeetProtectorsElement.checked;\n var needEquipmentBuddyESocks = needEquipmentBuddyESocksElement.checked;\n var canBeEquipmentBuddy = canBeEquipmentBuddyElement.checked;\n var canBeEquipmentBuddyHogu = canBeEquipmentBuddyHoguElement.checked;\n var canBeEquipmentBuddyHelmet = canBeEquipmentBuddyHelmetElement.checked;\n var canBeEquipmentBuddyArmGuards = canBeEquipmentBuddyArmGuardsElement.checked;\n var canBeEquipmentBuddyShinGuards = canBeEquipmentBuddyShinGuardsElement.checked;\n var canBeEquipmentBuddyGloves = canBeEquipmentBuddyGlovesElement.checked;\n var canBeEquipmentBuddyFeetProtectors = canBeEquipmentBuddyFeetProtectorsElement.checked;\n var canBeEquipmentBuddyESocks = canBeEquipmentBuddyESocksElement.checked;\n var notes = tournamentRegistrationNotesElement.value;\n var confirmation = tournamentRegistrationConfirmationElement.checked;\n\n // check for missing required fields\n if ((!poomsae && !sparring) ||\n !confirmation) {\n snackbar('Please fill out all required fields');\n return;\n }\n\n // check that athlete information is completed\n if (athleteNameElement.value == \"\" ||\n athleteYearElement.value == \"\" ||\n athleteGenderElement.value == \"\" ||\n athleteKerberosElement.value == \"\" ||\n athletePhoneNumberElement.value == \"\" ||\n athleteBeltElement.value == \"\" ||\n athleteWeightDivisionElement.value == \"\" ||\n athleteWeightElement.value == \"\" ||\n athleteEmergencyContactNameElement.value == \"\" ||\n athleteEmergencyContactPhoneElement.vlue == \"\") {\n snackbar(\"Please complete all information on the 'Edit Information' tab first\");\n return;\n }\n\n // check that equipment sizes are filled out\n if (needEquipmentBuddy || canBeEquipmentBuddy) {\n if ((needEquipmentBuddyHogu || canBeEquipmentBuddyHogu) && hoguSizeElement.value == 0 ||\n (needEquipmentBuddyHelmet || canBeEquipmentBuddyHelmet) && helmetSizeElement.value == 0 ||\n (needEquipmentBuddyArmGuards || canBeEquipmentBuddyArmGuards) && armGuardsSizeElement.value == 0 ||\n (needEquipmentBuddyShinGuards || canBeEquipmentBuddyShinGuards) && shinGuardsSizeElement.value == 0 ||\n (needEquipmentBuddyGloves || canBeEquipmentBuddyGloves) && glovesSizeElement.value == 0 ||\n (needEquipmentBuddyFeetProtectors || canBeEquipmentBuddyFeetProtectors) && socksSizeElement.value == 0 ||\n (needEquipmentBuddyESocks || canBeEquipmentBuddyESocks) && socksSizeElement.value == 0) {\n snackbar(\"Please fill out sizes for checked equipment on the 'Equipment Sizes' tab\");\n return;\n }\n }\n\n var textQuestionResponses = [];\n var textResponses = document.getElementsByClassName('optionalTextInput');\n for (var i = 0; i < textResponses.length; i++)\n textQuestionResponses.push(textResponses[i].value);\n\n var checkboxQuestionResponses = [];\n var checkboxResponses = document.getElementsByClassName('optionalCheckboxInput');\n for (var i = 0; i < checkboxResponses.length; i++) {\n var str = '';\n var children = checkboxResponses[i].children;\n for (var j = 0; j < children.length; j++) {\n if (children[j].type != 'checkbox' || !children[j].checked)\n continue;\n if (str.length > 0)\n str += ', ';\n str += children[j].name;\n }\n checkboxQuestionResponses.push(str);\n }\n\n var selectQuestionResponses = [];\n var selectResponses = document.getElementsByClassName('optionalSelectInput');\n for (var i = 0; i < selectResponses.length; i++)\n selectQuestionResponses.push(selectResponses[i].children[1].value);\n \n // submit data\n var registeredAthletesRef = firestore.collection(\"tournaments\").doc(openRegistrationTournamentDocName).collection('registeredAthletes');\n registeredAthletesRef.doc('sharedInfo').get().then(function(doc) {\n var timestamp = 1;\n if (doc.exists) {\n // retrieve the document's data\n var data = doc.data();\n // get timestamp, the order in which the athlete registered\n timestamp = (data.timestamp == null ? 0 : data.timestamp) + 1;\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document: tournaments/\" + openRegistrationTournamentDocName + \"/registeredAthletes/sharedInfo\");\n }\n\n // send registration information to database\n registeredAthletesRef.doc(getUserUID()).set({\n userUID: getUserUID(),\n poomsae: poomsae,\n sparring: sparring,\n needEquipmentBuddy: needEquipmentBuddy,\n needEquipmentBuddyHogu: needEquipmentBuddyHogu,\n needEquipmentBuddyHelmet: needEquipmentBuddyHelmet,\n needEquipmentBuddyArmGuards: needEquipmentBuddyArmGuards,\n needEquipmentBuddyShinGuards: needEquipmentBuddyShinGuards,\n needEquipmentBuddyGloves: needEquipmentBuddyGloves,\n needEquipmentBuddyFeetProtectors: needEquipmentBuddyFeetProtectors,\n needEquipmentBuddyESocks: needEquipmentBuddyESocks,\n canBeEquipmentBuddy: canBeEquipmentBuddy,\n canBeEquipmentBuddyHogu: canBeEquipmentBuddyHogu,\n canBeEquipmentBuddyHelmet: canBeEquipmentBuddyHelmet,\n canBeEquipmentBuddyArmGuards: canBeEquipmentBuddyArmGuards,\n canBeEquipmentBuddyShinGuards: canBeEquipmentBuddyShinGuards,\n canBeEquipmentBuddyGloves: canBeEquipmentBuddyGloves,\n canBeEquipmentBuddyFeetProtectors: canBeEquipmentBuddyFeetProtectors,\n canBeEquipmentBuddyESocks: canBeEquipmentBuddyESocks,\n notes: notes,\n textQuestionResponses: textQuestionResponses,\n checkboxQuestionResponses: checkboxQuestionResponses,\n selectQuestionResponses: selectQuestionResponses,\n timestamp: timestamp\n }).then(function() {\n // snackbar\n snackbar('Successfully registered for tournament!');\n // update timestamp/number of registered athletes\n registeredAthletesRef.doc('sharedInfo').set({\n timestamp: timestamp\n }).then(function() {\n console.log('Successfully updated timestamp in sharedInfo');\n }).catch(function(error){\n console.log('Was not able to update timestamp in sharedInfo');\n console.log(error);\n });\n // reload page\n setTimeout(function(){ location.reload(); }, 3000);\n }).catch(function(error) {\n console.error(\"Error writing new athlete's registration information to Firebase Database\", error);\n });\n }).catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n}", "title": "" }, { "docid": "a7b12ef499862363b9744686ef8ac3aa", "score": "0.47186154", "text": "function limpiarVentana(){\n //Limpia las capas antes de hacer una nueva consulta\n limpiarCapas();\n\n winResporteHistorico.hide();\n formReporteHistorico.getForm().reset();\n}", "title": "" }, { "docid": "b43116fa01ca04a7ef7c1a3d359c1112", "score": "0.47137687", "text": "function populatePlayerList() {\n\tlogging('BEGIN populatePlayerList()');\n\tif ($('#sltTeeTime').val() != '0') {\n\t\tvar db = getLocalDB();\n\t\tdb.transaction(function(tx){\n\t\t\tvar sqlString = \"SELECT First_Name, Last_Name, MID FROM ES WHERE Start = '\" + $('#sltTeeTime').val() + \"'\";\n\t\t\ttx.executeSql(sqlString, [], function(tx, qryResults){\n\t\t\t\tvar numRows = qryResults.rows.length;\n\t\t\t\tvar dbRecords = qryResults.rows;\n\t\t\t\t$('#sltPlayers').find('option').remove().end();\n\t\t\t\t$('#sltPlayers').append(new Option('Select a player','0'));\n\t\t\t\tvar selectOptions = '';\n\t\t\t\tfor (var i=0; i<numRows; i++) {\n\t\t\t\t\tselectOptions = dbRecords.item(i).First_Name + ' ' + dbRecords.item(i).Last_Name;\n\t\t\t\t\t$('#sltPlayers').append(new Option(selectOptions,dbRecords.item(i).MID));\n\t\t\t\t}\n\t\t\t\t$('#sltPlayers').selectmenu('refresh');\n\t\t\t}, errorCallback);\n\t\t}, errorCallback);\n\t}\n}//END populatePlayerList", "title": "" }, { "docid": "b8208c9ef53d8938015123026c142945", "score": "0.47126147", "text": "manageTeam(teamId) {\n console.log( `Manage the team with the id : '${teamId}'` )\n }", "title": "" }, { "docid": "f599b571cbe52f434c7b614cc6fc6d6d", "score": "0.47124907", "text": "function updateSettings(){\n updatePlayerNames();\n updateWinningScore();\n updateToggleSettings();\n}", "title": "" }, { "docid": "ea0d625c8bbe0f18ccb73be32d5bc9af", "score": "0.47044423", "text": "function teamsettings() {\n\n $('.mt-team').parent().addClass('align-center');\n $('.mt-team').on('mouseenter', function(){\n $(this).find('.mt-team-description').addClass('mt-is-visible')\n }).on('mouseleave', function(){\n $(this).find('.mt-team-description').removeClass('mt-is-visible');\n });\n\n }", "title": "" }, { "docid": "c7c513a8ad247b0bd7eee4741b59a5c2", "score": "0.47040918", "text": "function setLeagues(array, index) {\n var idx = index + 1;\n var league = \"\";\n while (array[idx].charAt(0) !== \"-\") {\n league = league + \" \" + array[idx++];\n }\n league = league.replace(/['\"]+/g, \"\");\n leagues = league.split(\",\");\n console.log(\"Leagues: \" + league);\n leagues.forEach(function (val, index, array) {\n array[index] = array[index].trim();\n console.log(\"-\" + array[index]);\n });\n }", "title": "" }, { "docid": "6195004737b88090add98e743454b642", "score": "0.47021616", "text": "function populateSurvey() {\n\tif ($('#sltPlayers').val() > 0) {\n\t\tvar db = getLocalDB();\n\t\tdb.transaction(function(tx){\n\t\t\ttx.executeSql(\"SELECT * FROM ES WHERE MID = '\" + $('#sltPlayers').val() + \"'\", [], function(tx, qryResults){\n\t\t\t\tvar numRows = qryResults.rows.length;\n\t\t\t\tvar dbRecord = qryResults.rows.item(0);\n\t\t\t\t$('#Ball').val(dbRecord.Ball).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Driver').val(dbRecord.Driver).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Irons').val(dbRecord.Irons).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Putter').val(dbRecord.Putter).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#FairwayWood').val(dbRecord.FairwayWood).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#PitchingWedge').val(dbRecord.PitchingWedge).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#GapWedge').val(dbRecord.GapWedge).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#SandWedge').val(dbRecord.SandWedge).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#GolfBag').val(dbRecord.GolfBag).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Glove').val(dbRecord.Glove).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Hat').val(dbRecord.Hat).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Shirt').val(dbRecord.Shirt).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Shoes').val(dbRecord.Shoes).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Grips').val(dbRecord.Grips).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#ShaftsIrons').val(dbRecord.ShaftsIrons).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#HybridWood').val(dbRecord.HybridWood).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#GripsWoods').val(dbRecord.GripsWoods).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#RangeFinder').val(dbRecord.RangeFinder).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#PushCart').val(dbRecord.PushCart).attr('selected', true).selectmenu('refresh');\n\t\t\t\t$('#Bottoms').val(dbRecord.Bottoms).attr('selected', true).selectmenu('refresh');\n\t\t\t\tif (dbRecord.Done == '1') {\n\t\t\t\t\t$('#btnWSUpdate').buttonMarkup({icon:'check'}).show().find('.ui-btn-text').html('Done');\n\t\t\t\t} else {\n\t\t\t\t\t$('#btnWSUpdate').buttonMarkup({icon:'plus'}).show().find('.ui-btn-text').html('Save');\t\n\t\t\t\t}\n\t\t\t}, errorCallback);\n\t\t}, errorCallback);\n\t} else {\n\t\talert('Please select a player');\n\t}\n}//END prePopulateTeeTimeList", "title": "" }, { "docid": "5c35c118fccdfbb2294a7b9f27d61f77", "score": "0.47016585", "text": "function OnLevelUpClicked()\n{\n\tif ( Game.IsInAbilityLearnMode() )\n\t{\n\t\tGame.EndAbilityLearnMode();\n\t\tUpdateAbilityList();\n\t}\n\telse\n\t{\n\t\tGame.EnterAbilityLearnMode();\n\t\tUpdateAbilityList();\n\t}\n}", "title": "" }, { "docid": "2370a23454dc6e7d96b00e7464bd172e", "score": "0.46985924", "text": "function arenaSetup(){\n\tPlayer1.setName($('#txtP1Name').val());\n\tPlayer2.setName($('#txtP2Name').val());\n\tPlayer2.setType($('#p2Select').val());\n\n\t$('#Player1NameLi').html(`<h1>${Player1.playerName}</h1>`);\n\t$('#Player2NameLi').html(`<h1>${Player2.playerName}</h1>`);\n\t\n\t$('#player1Image').attr('src', Player1.type.url);\n\t$('#player2Image').attr('src', Player2.type.url);\n\n\tp1MaxHP = Player1.type.health;\n\tp2MaxHP = Player2.type.health;\n\tupdateHealth();\n\n\t$('#playerSetup').addClass('hidden');\n\t$('#startFooter').addClass('hidden');\n\n\t$('#attackBtn').click(() => {\n\t\tfight();\n\t});\n\n$('#battleLog').html(`<br/><h2>~~~~~~~~~~~~~~~~~ PRESS THE <popGreen>ATTACK</popGreen> BUTTON TO BEGIN!! ~~~~~~~~~~~~~~~~~</h2>`);\n\trandomizeBG();\n\t$('#battleArena').removeClass('hidden');\n}", "title": "" }, { "docid": "c434ae4a2c8077ac69065e33ce51210b", "score": "0.46926", "text": "function addNewLearningLangauge() {\n //Inset a new row at the end\n var table = document.getElementById(\"table_learninglanguage\");\n var row = table.insertRow(-1);\n cell = row.insertCell(0);\n\n // [\"Language\" \"Flag\"] [Language Level]\n var div = document.createElement(\"div\");\n var selected_language = document.getElementById(\"select_learning_language\");\n var country = selected_language.options[selected_language.selectedIndex].text;\n div.style = \"font-size: 14px;\";\n div.innerHTML += country;\n div.innerHTML += '<img class = flag src = \"' + getFlagFromCountry(country) + '\"/>';\n\n var selected_language_level = document.getElementById(\"select_learning_languagelevel\");\n var level = selected_language_level.options[selected_language_level.selectedIndex].text;\n cell.appendChild(div);\n\n cell = row.insertCell(1);\n var div = document.createElement(\"div\");\n div.className = \"language_level\";\n\n if (level == \"Beginner\") {\n div.innerHTML += '<img src=\"images/01.png\"/></br>';\n } else if (level == \"Elementary\"){\n div.innerHTML += '<img src=\"images/02.png\"/></br>';\n } else if (level == \"Intermediate\"){\n div.innerHTML += '<img src=\"images/03.png\"/></br>';\n } else if (level == \"Advanced\"){\n div.innerHTML += '<img src=\"images/04.png\"/></br>';\n } else {\n div.innerHTML += '<img src=\"images/05.png\"/></br>';\n }\n\n cell.appendChild(div);\n}", "title": "" } ]
84b596bd810d743b014d5fd0b90bcc62
Tablas dinamicas puerta 1 3/4 pulgadas
[ { "docid": "ff19e83f8787ccacb282ad00352922cd", "score": "0.0", "text": "function mostrarDisplay_puerta1_d(id) {\n for(i=1;i<18;i++){\n fila = document.getElementById(id).rows[i].style.display='';\n }\n document.getElementById(\"boton_menu\").setAttribute(\"onclick\",\"ocultarDisplay_puerta1_d('\"+id+\"');\");\n}", "title": "" } ]
[ { "docid": "acfb75c2fb857c3a7427d73b046a5e5f", "score": "0.6642946", "text": "function montarTabela(){\n montarTabela({dados: [ {id:1,nome:\"Mayra\", p1:6,p2:5}\n ,{id:2,nome:\"Pedro\", p1:6,p2:5}\n ,{id:3,nome:\"Wesley\", p1:6,p2:5}\n ,{id:4,nome:\"BLA\", p1:6,p2:5}\n ]\n \n })\n}", "title": "" }, { "docid": "30344f3c5b128d87a7f4015af9319e06", "score": "0.6610342", "text": "function tabl() {\n if (donnees.length != 0) {\n var stat = \"\";\n var tableau = \"<table class='table table-bordered table-striped table-condensed'>\"\n tableau += \"<thead><tr><td>Date</td><td>Temp</td><td>Humid</td></tr></thead><tbody>\";\n for (var meas in donnees) {\n temp.push(parseInt(donnees[meas]['temp']));\n humd.push(parseInt(donnees[meas]['humid']));\n date.push(donnees[meas]['date']);\n /* construction du tableau d'affichage */\n tableau += \"<tr><td>\" + donnees[meas]['date'] + \"</td><td>\" + donnees[meas]['temp'] + \" °C</td><td>\" + donnees[meas]['humid'] + \" %</td></tr>\";\n }\n tableau += \"</tbody></table>\";\n /* calcul et préparation affichage des extras */\n stat += \"<p>Température mini : \" + Math.min(...temp) + \"<br>\";\n stat += \"Température max : \" + Math.max(...temp) + \"<br>\";\n var moyen = 0;\n for (var i in temp) moyen += temp[i];\n stat += \"Température moyenne : \" + (moyen / temp.length).toFixed(2) + \"<br></p>\";\n stat += \"<p>Humidité mini : \" + Math.min(...humd) + \"<br>\";\n stat += \"Humidité max : \" + Math.max(...humd) + \"<br>\";\n var moyen = 0;\n for (var i in humd) moyen += humd[i];\n stat += \"Humidité moyenne : \" + (moyen / humd.length).toFixed(2) + \"<br></p>\";\n $('.tableau').append(stat+tableau);\n } else {\n $('.tableau').html(\"<p>Pas de données à afficher !</p>\");\n }\n }", "title": "" }, { "docid": "f5837b9db68b6af6658c0142f178f219", "score": "0.65505993", "text": "function fillTable() {\n for (let i = 0; i < 4; i++) {\n fillTableDay('bench', i+1, variant);\n fillTableDay('squat', i+1, variant);\n fillTableDay('shoulder', i+1, variant);\n fillTableDay('deadlift', i+1, variant);\n }\n }", "title": "" }, { "docid": "66d0596833c4ed608d9a438c55a86d4f", "score": "0.65303105", "text": "function tabla(data){\n//console.log(dato)\ntablatar.innerHTML = ''\n for(let value of data){//Recorre el array de objetos, y lo separa en los objetos que tenga con \"valor\" para acceder a sus propiedades\n console.log(value.codE)\n tablatar.innerHTML += `\n \n <tr>\n <th scope=\"row\">${ value.codT }</th>\n <td>${ value.sem }</td>\n <td>${ value.fechC }</td>\n <td>${ value.codE }</td>\n <td>${ value.sede }</td>\n <td>${ value.usuario }</td>\n \n `\n }\n//Con el += va ir concatenando las tablas, es decir, muestra la primera tabla, luego muestra la segunda sin borrar la primera\n}", "title": "" }, { "docid": "51090267cd79e80c26d9139d2163bcde", "score": "0.6527867", "text": "listadoPuntosConductor(){\r\n let sTabla = '<table border=\"1\">';\r\n\r\n sTabla += \"<thead><tr>\";\r\n sTabla += \"<th>NIF</th>\";\r\n sTabla += \"<th>Total Puntos</th>\";\r\n sTabla += \"</tr></thread>\";\r\n\r\n // ABRE body tabla\r\n sTabla += \"<tbody>\";\r\n\r\n let oConductor = this.personas.filter(oP => oP instanceof Conductor);\r\n let multasGraves = this.multas.filter(oP => oP instanceof Grave );\r\n\r\n for(let k = 0; k<oConductor.length; k++){\r\n let sumPuntos = 0;\r\n\r\n for(let x = 0; x<multasGraves.length; x++){\r\n \r\n if(oConductor[k].NIF == multasGraves[x].NIFConductor){\r\n sumPuntos = sumPuntos + multasGraves[x].puntos;\r\n }\r\n }\r\n if(sumPuntos>0){\r\n sTabla += \"<tr><td>\"+oConductor[k].NIF+\"</td>\";\r\n sTabla += \"<td>\"+sumPuntos+\"</td></tr>\";\r\n }\r\n \r\n }\r\n sTabla += \"</tbody></table>\";\r\n\r\n return sTabla;\r\n }", "title": "" }, { "docid": "3325f9d480bce927d6fc7014ebf42cbc", "score": "0.64973164", "text": "printTable(data) {\n const tableuOrigin = data || [...this.table]\n\n const headers = []\n for (let i = 1; i <= this.naoNegativos + this.restrictions.length; i++) { // criando um array com os headers do tableau\n headers.push(`x${i}`)\n }\n\n // instantiate\n const table = new Table({\n head: [...headers, 'b']\n })\n\n // inserindo cada linha no tableau\n tableuOrigin.map(data => {\n table.push(data.slice(1))\n })\n\n if (data) {\n return table.toString()\n } else {\n console.log(table.toString())\n }\n }", "title": "" }, { "docid": "cf5cee62ebc7876c43545da0e1670ad9", "score": "0.64887136", "text": "function tabulate(){\n connection.query('SELECT * FROM products', function(err, results) {\n if(err) throw err;\n var table = new Table({\n head: ['ID','PRODUCT', 'DEPT', 'PRICE', 'STOCK']\n , colWidths: [5, 20, 10, 15, 10]\n });\n var resLength = results.length;\n \n for(var i=0; i< resLength; i++){ \n \n table.push([results[i].id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]);\n }\n console.log(` \n${table.toString()} \n `);\n recurz();\n });\n \n}", "title": "" }, { "docid": "2a75a9db136a1663fecacdc40aa69c47", "score": "0.64657253", "text": "function atualizaTabela(){\n for (var k = 1; k < 2*qtd.length; k++) {\n $('#qtd').remove();\n }\n \n for (var k = 1; k < nome.length; k++) {\n $('#nomeTabela').append('<th id=\"qtd\"><center>' + nome[k] + '</center></th>');\n $('#qtdTabela').append('<th id=\"qtd\"><center>' + qtd[k] + '</center></th>');\n }\n}", "title": "" }, { "docid": "197033e11359d197ed55334527217164", "score": "0.6425844", "text": "function tableQualy(nameVariable,vetE, vetFi, vetFr, vetFac, vetFacP,vetModa,vetMediana) {\n let linha = vetE.length;\n let line1 =/*html*/ `<tr>\n <td class=\"tdVet tableTitle\">${nameVariable}</td>\n <td class=\"tdVet tableTitle tableLines\">Fi</td>\n <td class=\"tdVet tableTitle tableLines\">Fr%</td>\n <td class=\"tdVet tableTitle tableLines\">Fac</td>\n <td class=\"tdVet tableTitle tableLines\">FacP%</td>\n </tr>`\n $('#tableDemonstration').append(line1);\n for (let i = 0; i < linha; i++) {\n let table =/*html*/ `<tr><td class=\"tdVet\"><p>${vetE[i]}</p></td>\n <td class=\"tdVet tableLines\"><p>${vetFi[i]} </p></td>\n <td class=\"tdVet tableLines\"><p>${vetFr[i]}% </p></td>\n <td class=\"tdVet tableLines\"><p>${vetFac[i]} </p></td>\n <td class=\"tdVet tableLines\"><p>${vetFacP[i]}% </p></td>\n </tr>`\n\n $('#tableDemonstration').append(table);\n }\n let tableSoma = /*html*/`<tr><td class=\"tdVet \"><p></p></td>\n <td class=\"tdVet\"><p>${vetFac[vetFac.length - 1]} </p></td>\n <td class=\"tdVet tableLines\"><p>${vetFacP[vetFacP.length - 1]}%</p></td>\n <td class=\"tdVet \"><p> </p></td>\n <td class=\"tdVet \"><p></p></td>\n </tr>`\n$('#tableDemonstration').append(tableSoma);\n\n\n if (screen.width < 640 || screen.height < 480) {\n let tableMobie = /*html*/`<tr>\n <td class=\"tdVet tableTitle\">Moda</td>\n <td class=\"tdVet tableTitle tableLines\"><p>${vetModa} </p></td>\n </tr>\n <tr>\n <td class=\"tdVet tableTitle\">Mediana</td>\n <td class=\"tdVet tableTitle tableLines\"><p>${vetMediana}</p></td>\n </tr>\n \n `\n $('#tableDemonstration-Medias').append(tableMobie);\n } else{\n let table2 =/*html*/ `<tr>\n <td class=\"tdVet tableTitle\">Moda</td>\n <td class=\"tdVet tableTitle tableLines\">Mediana</td>\n </tr>`\n $('#tableDemonstration-Medias').append(table2);\n let table3 =/*html*/ `<tr><td class=\"tdVet tableTitle\"><p>${vetModa} </p></td>\n <td class=\"tdVet tableTitle tableLines\"><p>${vetMediana}</p></td>\n </tr>`\n $('#tableDemonstration-Medias').append(table3);\n }\n \n}", "title": "" }, { "docid": "0ced06d97c6f85b951b93df912d56368", "score": "0.6418744", "text": "function multiTable() { // mnozenje brojeva\n \n var rez = 1;\n \n for (var i = 1; i <= 12; i++) {\n for (var j = 1; j <= 10; j++) {\n rez = i * j;\n console.log(i, 'x', j, '=', rez, '\\n');\n }\n }\n \n}", "title": "" }, { "docid": "a53c214e6f0961eb3e3b824fc8d2010c", "score": "0.64172375", "text": "function showTables(){\n\t\t\tvm.headers=vm.initialTable[0];\t\n\t\t\tsimplexMethod(vm.initialTable);\n\t\t\tvm.basicSOlution= vm.basicSOlution.join(\", \");\n\t\t\tvm.optimalSolution=vm.basicSOlution;\n\t\t\tplotGraph();\n\t\t\tvm.showTable=true;\n\t\t}", "title": "" }, { "docid": "280b094a6a6d54ebd4a0e99c0530fcc2", "score": "0.64100134", "text": "function tablaDetergenteJabonLiquidoSuavizanteCLoroLavandina(productos, progrouppresentacion, cate) {\n let regsob = renglonesPorHoja;\n let renglonesOcupados = 0;\n let filas = '';\n filas += `\n <h1 id=\"nombreCategoria\">\n ${cate} \n </h1>\n \n <table class=\"table table-sm\" id=\"listaPrecios\">\n <tr class=\"tamanoEncabezadoLista\">\n <th></th>\n <th style=\"text-align: center;\"> Minimo 200 litros<br>(sin envase) </th> \n <th style=\"text-align: center;\"> Minimo 20 litros<br>(sin envase) </th> \n <th style=\"text-align: center;\"> <br>5 Litros envasado </th>\n </tr> \n `\n let nameanterior = '';\n for (let i = 0; i < productos.length; i++) {\n if (productos[i].name != nameanterior) {\n if (productos[i].categoria.name == cate) {\n renglonesOcupados++\n filas += `\n <tr class=\"estiloListaPrecios\">\n <td style=\"font-size: 12px;\"> ${productos[i].name} </td> \n `\n for (const b in progrouppresentacion) {\n if (productos[i].presentacion != null && productos[i].presentacion.name == b) {\n filas += `<td style=\"text-align: center; font-size: 12px;\"> ${productos[i].price} </td>`\n console.log(b)\n console.log(productos[i].progrouppresentacion)\n }\n }\n filas += `</tr>`\n }\n }\n\n nameanterior = productos[i].name;\n }\n filas += `</table>`\n\n renglonesOcupados = renglonesOcupados + 5;\n\n if (renglonesOcupados > regsob) {\n var br = '';\n for (let i = 0; i < renglonesSobrantes; i++) {\n br += `<br>`;\n }\n filas = br + filas;\n renglonesPorHoja = 45\n }\n\n renglonesSobrantes = renglonesPorHoja - renglonesOcupados;\n renglonesPorHoja = renglonesSobrantes;\n return filas;\n}", "title": "" }, { "docid": "b5379417dc3edde56b82a7ae95cfd8d3", "score": "0.6405862", "text": "function teeTable(data) {\n let suunta = \"Saapuu\";\n if (buttonState == \"DEPARTURE\") {\n suunta = \"Lähtee\";\n }\n let output = `<table class=\"table table-striped table-hover\">\n <thead>\n <th class=\"text-muted\">Juna</th>\n <th class=\"text-muted\">Lähtöasema</th> \n <th class=\"text-muted\">Pääteasema</th> \n <th class=\"text-muted\">${suunta}</th>\n </thead>\n <tbody>`;\n\n let lkm = data.length;\n for (let i = 0; i < lkm; i++) {\n let peruttu = \"<tr>\";\n let peruttuCancell = '<td>';\n\n if (data[i].cancelled == true) {\n peruttu = '<tr class=\"text-muted\">';\n peruttuCancell = '<td> <div class=\"text-danger\" >Cancelled</div>';\n }\n let aika = formatoiAika(data[i].AikaTaulu);\n let arvio = data[i].arvio.getTime();\n let taulu = data[i].AikaTaulu.getTime();\n\n // haetaan arvion ja aikataulun erotus\n let ero = arvio - taulu;\n var minuutit = Math.floor((ero / 1000) / 60);\n // jos erotus on 1 minuutti tai enemmän, se tulostetaan\n if (arvio > taulu && minuutit >= 1) {\n arvio = formatoiAika(data[i].arvio);\n peruttuCancell = '<td class=\"text-muted\">('\n aika += `) <div class=\"text-danger\">${arvio} </div> `\n }\n\n let nimiNro = data[i].trainType + \" \" + data[i].trainNumber;\n // Jos commuter train niin, Commuter train + lineID\n if (data[i].trainCategory == \"Commuter\") {\n nimiNro = \"Commuter train \" + data[i].commuterLineID;\n }\n\n //Table rivien tulostus\n try {\n output += `\n ${peruttu}\n <td>${nimiNro}</td>\n <td>${data[i].lahtoANimi}</td>\n <td>${data[i].paateANimi}</td>\n ${peruttuCancell}${aika}</td>\n </tr>\n \n `;\n } catch (e) {\n console.log(e);\n }\n };\n output += `\n </tbody>\n </table>\n `\n document.getElementById('table').innerHTML = output;\n}", "title": "" }, { "docid": "88a93f61af43f9f400159a60d6474ba5", "score": "0.6347295", "text": "function formato_tabla(indice)\n{\n // obtenemos la fecha\n var fecha = mi_tabla[indice][0];\n\n // obtenemos las cabeceras\n var heads = mi_tabla[0][2];\n\n // obtenemos el cuerpo\n var body = $.extend(true, [], mi_tabla[indice][2]);\n\n var retorna = \"<table id='tabla-\"+indice+\"' class='cell-border hover' width='100%' cellspacing='0'>\"\n +\"<thead><tr style='background:#bbb;'>\";\n\n // agregamos las cabeceras\n for (var i in heads) {\n var elemento = heads[i];\n retorna += \"<th>\"+elemento+\"</th>\";\n }\n retorna += \"<th>Operación</th>\";\n retorna += \"</tr></thead><tbody>\";\n\n // agregamos el cuerpo\n for (var i in body) {\n\n // obtenemos la fila completa\n var fila = body[i];\n\n // iniciamos la fila\n retorna += \"<tr class='sol-fila' grupo='\"+indice+\"' fila='\"+i+\"'>\";\n\n // variables que identifican a una fila\n var rut = \"\";\n var estado = \"\";\n var codigo = \"\";\n var numero = \"\";\n var turno = \"\";\n\n // recorremos los elementos de la fila\n for (var j in fila) {\n\n // obtenemos el rut\n if (j == 0) rut = fila[j].split(\"-\")[0];\n\n // obtenemos el codigo y numero de maquina\n if (j == 2) codigo = fila[j];\n if (j == 3) numero = fila[j];\n\n // obtenemos el estado registrado en la base de datos\n if (j == 4) {\n estado = fila[j];\n\n // formateamos el estado\n if (fila[j] == \"0\") fila[j] = \"Pendiente\";\n else if (fila[j] == \"1\") fila[j] = \"Aceptada\";\n else if (fila[j] == \"2\") fila[j] = \"Invalidada\";\n else if (fila[j] == \"3\") fila[j] = \"Validada\";\n else if (fila[j] == \"4\") fila[j] = \"Rechazada\";\n }\n\n // obtenemos el turno\n if (j == 5) turno = fila[j];\n\n // agregamos el elemento a la tabla\n retorna += \"<td>\"+fila[j]+\"</td>\";\n }\n\n // obtenemos la opcion general, para cargarla a la tabla si es necesario\n var grupo_opcion = \"\";\n for (var j in resultado_general[fecha]) {\n var mi_elemento = resultado_general[fecha][j];\n if (mi_elemento[0] == rut\n && mi_elemento[1] == codigo\n && mi_elemento[2] == numero\n && mi_elemento[3] == turno){\n grupo_opcion = mi_elemento[4];\n }\n }\n\n // convertimos fecha y obtenemos la actual\n var mi_fecha = moment(fecha,\"DD/MM/YYYY\").toDate();\n var actual = moment(new Date()).toDate();\n\n // agregamos el selector por fila dependiendo del estado\n if (estado == \"0\") {\n retorna += \"<td width='230px'><div class='form-group' style='margin-bottom:0px'>\";\n retorna += \"<select class='form-control sol-ind'>\";\n retorna += \"<option value='' \";\n if (grupo_opcion == \"\") retorna += \"selected\";\n retorna += \">Sin acciones</option>\";\n retorna += \"<option value='1' \";\n if (grupo_opcion == \"1\") retorna += \"selected\";\n retorna += \">Aceptar</option>\";\n retorna += \"<option value='4' \";\n if (grupo_opcion == \"4\") retorna += \"selected\";\n retorna += \">Rechazar</option>\";\n }\n else if (estado == \"1\") {\n retorna += \"<td width='230px'><div class='form-group' style='margin-bottom:0px'>\";\n retorna += \"<select class='form-control sol-ind'>\";\n retorna += \"<option value='' \";\n if (grupo_opcion == \"\") retorna += \"selected\";\n retorna += \">Sin acciones</option>\";\n if (mi_fecha <= actual) {\n retorna += \"<option value='3' \";\n if (grupo_opcion == \"3\") retorna += \"selected\";\n retorna += \">Validar</option>\";\n retorna += \"<option value='2' \";\n if (grupo_opcion == \"2\") retorna += \"selected\";\n retorna += \">Invalidar</option>\";\n }\n retorna += \"<option value='4' \";\n if (grupo_opcion == \"4\") retorna += \"selected\";\n retorna += \">Rechazar</option>\";\n }\n else if (estado == \"2\") {\n retorna += \"<td width='230px'><div class='form-group' style='margin-bottom:0px'>\";\n retorna += \"<select class='form-control sol-ind' disabled>\";\n retorna += \"<option value='' disabled selected hidden>No hay acciones</option>\"\n }\n else if (estado == \"3\") {\n retorna += \"<td width='230px'><div class='form-group' style='margin-bottom:0px'>\";\n retorna += \"<select class='form-control sol-ind' disabled>\";\n retorna += \"<option value='' disabled selected hidden>No hay acciones</option>\"\n }\n else if (estado == \"4\") {\n retorna += \"<td width='230px'><div class='form-group' style='margin-bottom:0px'>\";\n retorna += \"<select class='form-control sol-ind'>\";\n retorna += \"<option value='' \";\n if (grupo_opcion == \"\") retorna += \"selected\";\n retorna += \">Sin acciones</option>\";\n retorna += \"<option value='1' \";\n if (grupo_opcion == \"1\") retorna += \"selected\";\n retorna += \">Aceptar</option>\";\n }\n retorna += \"</select>\";\n retorna += \"</div>\";\n retorna += \"</td>\";\n retorna += \"</tr>\";\n }\n\n retorna += \"</tbody></table>\";\n return retorna;\n}", "title": "" }, { "docid": "19956967cf80eed5f1406a9b2a19931d", "score": "0.63396", "text": "function inicializaTablero(){\n var tablero = [];\n for(var i=0; i<10; i++) {\n tablero[i] = [];\n for(var j=0; j<10; j++) {\n tablero[i][j] = 'O'; //no hay nada (o mayuscula)\n }\n }\n\n //Se agregan 15 trampas al inicio\n for (var i=0;i<15;i++){\n //Math.floor(Math.random() * 9) = numero aleatorio entre 0 y 9\n tablero[getRandomInt(0, 9)][getRandomInt(0, 9)]='T'// T de trampa\n }\n\n //Se agrega la salida, alejada del inicio , con 6 celdas de lejania tanto de forma horizontal como vertical\n //Si es necesario sobreEscribe una trampa\n tablero [getRandomInt(6, 9)][getRandomInt(6, 9)]='S';\n\n //Al final se agrega al raton al inicio\n tablero[0][0]='@' //raton\n\n return tablero;\n\n}//Fin funcion inicializarTablero", "title": "" }, { "docid": "9650b20753b1ddd69c7ecc511bee3e49", "score": "0.6307837", "text": "function populate_tab() {\n let cpt = 0 ;\n let quarter = ALPH_SIZE / 4 ;\n\n var tab_body = $('#f-quarter').find('tbody') ;\n\n for (key in ALPHA) {\n if (cpt > quarter * 3) {\n tab_body = $('#l-quarter').find('tbody') ;\n }\n else if (cpt > quarter * 2 - 1) {\n tab_body = $('#t-quarter').find('tbody') ;\n }\n else if (cpt > quarter) {\n tab_body = $('#s-quarter').find('tbody') ;\n }\n\n tab_body.append($('<tr>')\n .append($('<td>')\n .append($('<p>')\n .attr('id', 'tab')\n .html(key)\n )\n )\n .append($('<td>')\n .append($('<p>')\n .attr('id', 'tab')\n .html(ALPHA[key])\n )\n )\n ) ;\n\n ++cpt ;\n }\n}", "title": "" }, { "docid": "a03bc0abb17034cb5c4e0cebd83f7109", "score": "0.6307283", "text": "function limparTabelas() {\n cartasEscolhidas.splice(0, 2);\n idEscolhidos.splice(0, 2);\n }", "title": "" }, { "docid": "72840e06f26658a53db11ac65efe5286", "score": "0.6306699", "text": "function teste() {\n frame_tabuleiro.cria_tabuleiro(5, 3);\n for (i = 0; i < 4; i++) {\n frame_tabuleiro.coloca_peca(7, 9, 'verde', (i * 3) + 1);\n frame_tabuleiro.coloca_peca(7, 9, 'vermelho', (i * 3) + 2);\n frame_tabuleiro.coloca_peca(7, 9, 'amarelo', (i * 3) + 3);\n }\n frame_tabuleiro.coloca_peca(7, 10, 'vermelho', 6);\n frame_tabuleiro.coloca_peca(7, 11, 'amarelo', 0);\n}", "title": "" }, { "docid": "a8e953dce042a7d9f40e5250e8c44ea2", "score": "0.630518", "text": "function tablaDePrecio(productos) {\n\n progroupFrag = productos.reduce((r, a) => {\n\n r[a.categoria.name] = [...r[a.categoria.name] || [], a];\n\n return r;\n }, {});\n console.log(progroupFrag)\n progrouppresentacion = productos.reduce((r, a) => {\n if (a.presentacion != null) {\n r[a.presentacion.name] = [...r[a.presentacion.name] || [], a];\n }\n return r;\n }, {});\n\n let filas = '';\n for (const a in progroupFrag) {\n if (a == 'Detergentes' || a == 'Jabones Liquidos para Ropa' || a == 'Suavizantes para Ropa') {\n filas += tablaDetergenteJabonLiquidoSuavizanteCLoroLavandina(productos, progrouppresentacion, a)\n } else if (a == 'Quita Manchas') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Cloro y Lavandinas') {\n filas += tablaDetergenteJabonLiquidoSuavizanteCLoroLavandina(productos, progrouppresentacion, a)\n } else if (a == 'Desengrasantes') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Limpiavidrios') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Cera concentrada Autobrillo') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Jabón Liquido para Manos') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Jabón en Polvo y en Pan') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Desodorantes concentrado p/ piso antibacterial') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Desinfectantes e insectisidas') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Automotor') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Artículos para pileta') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Aerosoles') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Difusor Aromático con Varillas') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Equipos y Combos') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Aromatizador para Auto') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Perfuminas al Alcohol. ( Hogar/ Ambiente/ Auto)') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Papelería') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } else if (a == 'Bolsas') {\n filas += tablaQuitaManchasDesengrasantes(productos, a)\n } \n }\n return filas;\n}", "title": "" }, { "docid": "aa00a83a46fd5f6797a4db2854187df2", "score": "0.6305038", "text": "function nacrtajTablu()\r\n{\r\n\tvar i, j; \t// Brojaci\r\n\r\n\ttabla.innerHTML = \"\"; // Brisanje table\r\n\r\n\t// Tabla se popunjava karticama\r\n\tfor(i = 0; i < 4; i++)\r\n\t{\r\n\t\tfor(j = 0; j < 4; j++)\r\n\t\t{\r\n\r\n\t\t\t// Pravljenje novog elementa div sa klasom polje\r\n\t\t\tpolje = document.createElement('div');\r\n\t\t\tpolje.setAttribute('class', 'polje');\r\n\r\n\t\t\t// Pravljenje novog elementa img sa vrednostima atributa:\r\n\t\t\t// src=\"images/back.png\", data-okrenuta=\"0\" data-broj=\"Element matrice na poziciji i,j.\"\r\n\t\t\t// atribut data-okrenuta cuva informaciju da li je kartica okrenuta (1) ili nije (0).\r\n\t\t\t// atribut data-broj cuva informaciju o broju kartice koja se nalazi na toj poziciji\r\n\t\t\tkartica = document.createElement('img');\r\n\t\t\tkartica.setAttribute('src', 'images/back.png');\r\n\t\t\tkartica.setAttribute('data-okrenuta', 0);\r\n\t\t\tkartica.setAttribute('data-broj', matrica[i][j]);\r\n\r\n\t\t\t// Zadavanje CSS svojstva transition na 0.3s\r\n\t\t\tkartica.style.transition = '0.3s';\r\n\r\n\t\t\t// Dodavanje dogadjaja vezanih za kartice\r\n\t\t\tkartica.addEventListener('click', okreniKarticu); // Klik na karticu\r\n\t\t\tkartica.addEventListener('mouseover', prikaziSenku); // Prelaz kursora preko kartice\r\n\t\t\tkartica.addEventListener('mouseleave', skloniSenku); // Izlazak kursora sa kartice\r\n\r\n\r\n\t\t\t// Elementu div sa klasom polje dodeljujemo dete cvor sa slikom\r\n\t\t\tpolje.appendChild(kartica);\r\n\r\n\t\t\t// Dodajemo div sa karticom elementu tabla.\r\n\t\t\ttabla.appendChild(polje);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "5c13b2fd96c5fe2a0570e4b4db220931", "score": "0.6297159", "text": "function inicioTabla() {\n contenido = '<table class=\"table table-active table-hover table-borderless table-striped\">';\n contenido += '<th class=\"table-info\">officialName</th>';\n contenido += '<th class=\"table-info\">Party</th>';\n contenido += '<th class=\"table-info\">state</th>';\n contenido += '<th class=\"table-info\">Seniority</th>';\n contenido += '<th class=\"table-info\">Porcentages</th>';\n}//OPCIONAL", "title": "" }, { "docid": "1035e6b8a0b00002e3c1729ca77261ec", "score": "0.62912035", "text": "function tablificar(juego,array){\n var tableStart = \"<table>\"+\n \"<tr>\"+\n \"<th colspan='3'>\"+juego+\"</th>\"+\n \"</tr>\"+\n \"<tr>\"+\n \"<td class='class'>Nombre</td>\"+\n \"<td class='class'>Puntaje</td>\"+\n \"<td class='class'>Fecha</td>\"+\n \"</tr>\";\n var content = \"\";\n for (var i = 0; i < array.length; i++) {\n let name = array[i].name;\n let score = array[i].score;\n let date = array[i].score;\n content += \"<tr>\"+\n \"<td>\"+name+\"</td>\"+\n \"<td>\"+score+\"</td>\"+\n \"<td>\"+date+\"</td>\"+\n \"</tr>\";\n }\n tableStart += content;\n tableStart += \"</table>\";\n $(\".scoreJuego1\").html(tableStart);\n}", "title": "" }, { "docid": "33350e2c242b21a3a952bec97bf442f0", "score": "0.62868154", "text": "function CreateTableForPeriodoCorriente(compras, index) {\n var rows = \"\";\n var totalRows = \"\";\n\n compras.Totals = CalculateTotals(compras.Detalle);\n var total = 0;\n compras.Totals.forEach(function (totalItem, totalItemIndex, array) {\n total += totalItem.Total;\n });\n\n $.each(compras.Detalle, function(compraIndex, compra) {\n rows = rows + GenerateDetalleRow(compra);\n });\n\n $.each(compras.Totals, function(totalIndex, total) {\n totalRows = totalRows + GenerateTotalRow(total);\n });\n\n $(\"#tbComprasDetalle .gm-Fecha\").html(compras.Mes + \" - \" + compras.Anio + \" - Total:\" + total);\n $(\"#tbDetalle\").find(\"tr:gt(0)\").remove();\n $('#tbDetalle').append(rows);\n $(\"#tbTotales\").find(\"tr:gt(0)\").remove();\n $('#tbTotales').append(totalRows);\n }", "title": "" }, { "docid": "302d3ab3ad42590e1346f30df5aa53c5", "score": "0.6279399", "text": "function gerarTabela(){\n\n for (var x = students.length-1; x <= students.length-1; x++){\n var tabela = document.getElementById('tabela');\n var linha = document.createElement('tr');\n var linha2 = document.createElement('td');\n var linha3 = document.createElement('td');\n var linha4 = document.createElement('td');\n var linha5 = document.createElement('td');\n var linha6 = document.createElement('td');\n \n tabela.appendChild(linha)\n linha2.append(students[x]);\n linha.appendChild(linha2);\n linha3.append(nota1[x]);\n linha.appendChild(linha3);\n linha4.append(nota2[x]);\n linha.appendChild(linha4);\n linha5.append(mediaA[x]);\n linha.appendChild(linha5);\n linha6.append(aprovado[x])\n linha.appendChild(linha6);\n }\n}", "title": "" }, { "docid": "e522ebd9ce878311dc6b8a0c7b3f453e", "score": "0.62571347", "text": "static getTables(numb){\n let tables = [];\n for(let i = 1; i <= numb; i++){\n tables.push(new Table(i));\n }\n UI.displayTables(tables);\n }", "title": "" }, { "docid": "358fac7bff93e564fc80c66dd307b300", "score": "0.6255475", "text": "async function rellenarTablaClasificacionPilotos() {\r\n let pilotos_json;\r\n\r\n await fetch('json/Pilotos.json')\r\n .then(response => response.json())\r\n .then(data => pilotos_json = data);\r\n\r\n //Esta funcio ordena el json\r\n function ordenarJSON(data, key, orden) {\r\n return data.sort(function (a, b) {\r\n var x = a[key],\r\n y = b[key];\r\n\r\n if (orden === 'asc') {\r\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\r\n }\r\n\r\n if (orden === 'desc') {\r\n return ((x > y) ? -1 : ((x < y) ? 1 : 0));\r\n }\r\n });width\r\n }\r\n\r\n // Ordenamos el json. Li pasem les dades, el atribut que volem ordenar. Per ultim si ascendent o descendent.\r\n //I ho guardem el json ordenat en una variable.\r\n var jsonOrdenadoPilotos = ordenarJSON(pilotos_json, 'posicion_actual_pilotos', 'asc'); //Funcio autoinvocada, perque guardem el resultat\r\n // de la funcio en una variable cridant a una funcio que esta declarada dalt. Despres el resultat guardat en jsonOrdenadoPilotos el gaste\r\n //per a mostrar x piloto ordenat\r\n\r\n var tablas2 = []; //Creamos el array tablas donde le meteremos con el forEach\r\n //cada uno de los equipos que tengamos\r\n let posicionActualTablaPilotos = 0;\r\n jsonOrdenadoPilotos.forEach(e => { //Al llamar a la variable equipos_json es llamar al mismo atributo y ya lo añade\r\n tablas2.push(`<tr>\r\n <td class=\"text-center\">` + (++posicionActualTablaPilotos) + `</td>\r\n <td class=\"text-center\">` + e.nombre + `</td>\r\n <td class=\"text-center\">` + e.puntos_actuales_pilotos + `</td>\r\n <td class=\"text-center\">` + e.escuderia_actual + `</td>\r\n <td class=\"text-center\"> <img src=\"../imagenes/w80/`+ e.bandera + `.png\" height=\"20px\" width=\"30px\"> </td>\r\n </tr>`);\r\n });\r\n\r\n return tablas2;\r\n}", "title": "" }, { "docid": "b6ca2d77ae039f711a19d1d1a62b1e62", "score": "0.6250583", "text": "function getTable(idx)\n{\n\tvar str=\"<h5 align='center'>\"+getTitle(data[idx])+\"</h5>\"\n\t\n\tstr+=\"<div class='table-responsive2'>\";\n\t str+=\"<table class='table table-striped'>\";\n\t\n\tvar labels=getLabels1(data[idx]);\n\tvar values=getValues1(data[idx]);\n\tvar num=getNoOfVariables(idx);\n\tstr+=\"<tr><th>Labels</th>\";\n\t\n\t\n\tif(num>1)\n\t{\n\tfor(var i=0;i<num;i++){\n\t \n\tstr+=\"<th>\"+getVariableMulti(data[idx],i)+\"</th>\"; \n\t\t\t}\n\tstr+=\"</tr>\";\n}\nelse\n\tstr+=\"<th>\"+getVariable(data[idx])+\"</th></tr>\";\n\t\n\tfor(var i=0; i< labels.length;i++)\n\t\t{\n\t\tstr+=\"<tr><td>\"+labels[i]+\"</td>\";\n\t\tif(num>1)\n\t\t{\n\t\tfor(var j=0;j<num;j++){\n\t\t \n\t\tstr+=\"<td>\"+values[i][j]+\"</td>\"; \n\t\t\t\t}\n\t\tstr+=\"</tr>\";\n\t}\n\telse\n\t\tstr+=\"<td>\"+values[i]+\"</td></tr>\";\n\n\t\t}\n\tstr+=\"</table></div></div>\"\n\t\t\n\tdocument.getElementById(\"myTable\"+idx).innerHTML=str;\n\tdocument.getElementById(\"myChart\"+idx).style.display=\"none\";\n\t\n\tdocument.getElementById(\"myTable\"+idx).style.display=\"block\";\n}", "title": "" }, { "docid": "d6420b22fa6324fef0523c2067f49f81", "score": "0.62494326", "text": "function crearFilaTabla() {\n filaActual ++;\n let fila = resultados.insertRow(filaActual);\n\tlet numPartida = filaActual + 1;\n fila.insertCell(0).innerHTML = \"Partida \" + numPartida;\n\tfila.insertCell(1).innerHTML = 0;\n\tfila.insertCell(2).innerHTML = 0;\n}", "title": "" }, { "docid": "046bda51a5a7e80326ed7924b27f2011", "score": "0.6236695", "text": "function cargarTablaAnalisis(arrTemporal, sitio){ \n if(sitio){\n for(var fila=0; fila < arrTemporal.length -1; fila++){\n var webMember = \"<a href='\" + arrTemporal[fila].url + \"' target='_blank'>\" + arrTemporal[fila].first_name + \" \" + arrTemporal[fila].last_name + \"</a>\";\n var hilera = document.createElement(\"tr\");\n hilera.insertCell().innerHTML = webMember;\n hilera.insertCell().innerHTML = arrTemporal[fila].missed_votes;\n hilera.insertCell().innerHTML = arrTemporal[fila].missed_votes_pct;\n sitio.append(hilera);\n if (fila % 2==0)\n {\n hilera.className=\"pares\";\n if (fila == arrTemporal.length -2)\n {\n hilera.className=\"ultima_par\";\n }\n }\n else\n {\n hilera.className=\"impares\";\n if (fila == arrTemporal.length -2)\n {\n hilera.className=\"ultima_impar\"; \n }\n }\n }\n var pieTabla = document.createElement(\"tr\");\n pieTabla.insertCell().innerHTML = \"TOTAL members listed: \" + (arrTemporal.length -1);\n sitio.append(pieTabla);\n pieTabla.className=\"pieTabla\";\n }\n }", "title": "" }, { "docid": "65601f4381cf073626543dd8f83bf021", "score": "0.6229971", "text": "function creartabla2(){\n\t\n\tcrear2();//BORRA TABLA CREADA\n\tprocesos();//GENERA PROCESOS PRINCIPALES\n\nvar col = columnas;\nvar filas = periodostotales;\nvar jj=4;\nvar tabla=\"<table border='1' class='resultado'>\";\n//GENERA EL ENCABEZADO DE LA TABLA\ntabla+=\"<tr><td>\"+\"PERIODO\"+\"</td><td>\"+\"FECHA DE PAGO\"+\"</td><td>\"+\"SALDO CAPITAL\"+\"</td><td>\"+\"AMORTIZACION\"+\"</td><td>\"+\"PAGO INTERESES\"+\"</td><td>\"+\"SEG. DE VIDA\"+\"</td><td>\"+\"CUOTA FIJA\"+\"</td><td>\"+\"FLUJO DE CAJA\"+\"</td></tr>\"\nfor(i=0;i<=filas;i++){\ntabla+=\"<tr>\";\nfor(j=0;j<col;j++){\n\t//GENERA LA COLUMNA 0 DE LA TABLA\n\t\n\tif(j==0){\n\ttabla+=\"<td> \"+i+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 1 DE LA TABLA\n\tif(j==1){\n\tvar fecha = new Date(fechascredito[i]);\n\ttabla+=\"<td> \"+fecha.toDateString()+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 2 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][0], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t\t}\n\t//GENERA LA COLUMNA 3 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][1], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 4 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][2], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 5 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][3], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 6 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][5], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 7 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][4], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t\n\t}\n\t\n}\ntabla+=\"</tr>\";\n}\ntabla+=\"</table>\";\ndocument.getElementById(\"resultado\").innerHTML=tabla;\n}//FIN DE CREACION DE LA LINEA 2", "title": "" }, { "docid": "65d32dcd9462f93f5825335ca220b570", "score": "0.6229476", "text": "function tablaPot(num){\r\n let tab=[];\r\n for(let i=1; i<=num; i++){\r\n tab.push([i, i**2, i**3]);\r\n }\r\n return tab;\r\n}", "title": "" }, { "docid": "b63e15e15c7bf0b94cab257b7b123be6", "score": "0.6220197", "text": "function carga_tabla(arr) {\n\t\t var out = \"<th>Fecha</th><th>Bloque</th><th>Sala</th><th>Contenido</th><th>Asistencia</th>\";\n\t\t var i;\n\t\t for(i = 0; i < arr.length; i++) {\n\t\t out += \"<tr class='clase'><td>\" + arr[i].id + '</td><td>' + arr[i].fecha + '</td><td>' + arr[i].bloque + '</td><td>'+ arr[i].sala + '</td><td>'+\n\t\t arr[i].contenido + '</td><td>'+(Number(arr[i].p_asistencia)).toFixed()+'%</td></tr>';\n\t\t }\n\t\t document.getElementById(\"clases\").innerHTML = out;\n\t\t}", "title": "" }, { "docid": "c594ecc98f85b64aa8fdd0a03562ddeb", "score": "0.6195309", "text": "function tabFour(){\r\n\t\tgoogle.charts.load('current', { 'packages': ['table'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawTable);\r\n\t\tfunction drawTable() {\r\n\t\t\tvar data = new google.visualization.DataTable();\r\n\t\t\tdata.addColumn('string', 'Campaña');\r\n\t\t\tdata.addColumn('number', 'Enviados');\r\n\t\t\tdata.addColumn('number', 'Recibidos');\r\n\t\t\tdata.addColumn('number', 'Abiertos');\r\n\t\t\tdata.addColumn('number', 'Clics');\r\n\t\t\tdata.addRows([\r\n\t\t\t['Club tvgo', { v: 1210894, f: '1,210,894' }, { v: 1206946, f: '1,206,946 (99.67%)' }, { v: 34047, f: '34,047' }, { v: 1407, f: '1,407' }],\r\n\t\t\t['Series', { v: 67919, f: '67,919' }, { v: 67030, f: '67,030 (98.69%)' }, { v: 3861, f: '3,861' }, { v: 196, f: '196' }],\r\n\t\t\t['Películas', { v: 178245, f: '178,245' }, { v: 176846, f: '176,846 (99.22%)' }, { v: 4385, f: '4,385' }, { v: 198, f: '198' }],\r\n\t\t\t['Champions', { v: 27340, f: '27,340' }, { v: 27271, f: '27,271 (99.75%)' }, { v: 1058, f: '1,058' }, { v: 101, f: '101' }],\r\n\t\t\t['Comercial', { v: 11109, f: '11,109' }, { v: 11014, f: '11,014 (99.14%)' }, { v: 857, f: '857' }, { v: 28, f: '28' }],\r\n\t\t\t['Vencimiento', { v: 208, f: '208' }, { v: 208, f: '208 (100.00%)' }, { v: 53, f: '53' }, { v: 18, f: '18' }]\r\n\t\t\t]);\r\n\t\t\tvar table = new google.visualization.Table(document.getElementById('table_div3'));\r\n\t\t\ttable.draw(data, { showRowNumber: true, width: '100%', height: '100%' });\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['corechart'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart1);\r\n\t\tfunction drawChart1() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Enviados'],\r\n\t\t\t['Club tvgo', 1210894],\r\n\t\t\t['Series', 67919],\r\n\t\t\t['Vencimiento', 208],\r\n\t\t\t['Champions', 27340],\r\n\t\t\t['Comercial', 11109],\r\n\t\t\t['Peliculas', 178245]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'MAILINGS ENVIADOS POR TIPO CAMPAÑA '\r\n\t\t\t};\r\n\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('piechart3'));\r\n\t\t\tchart.draw(data, options);\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['bar'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart2);\r\n\t\tfunction drawChart2() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Suscriptores', 'No Suscriptores 0', 'No Suscriptores 1'],\r\n\t\t\t['Club tvgo', 13.01, 2.54, 7.25],\r\n\t\t\t['Películas', 10.10, 2.02, 0],\r\n\t\t\t['Champions', 11.89, 3.43, 0],\r\n\t\t\t['Series', 15.67, 4.42, 0],\r\n\t\t\t['Comercial', 0, 7.78, 0],\r\n\t\t\t['Vencimiento', 0, 25.48, 0]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'RATIO DE APERTURA POR TIPO CAMPAÑA (%)',\r\n\t\t\tsubtitle:'No Suscriptores 0: Nunca estuvieron suscritos; No Suscriptores 1: Algunas vez estuvieron suscritos pero, actualmente, no lo están.',\r\n\t\t\t};\r\n\t\t\tvar chart = new google.charts.Bar(document.getElementById('columnchart_material3'));\r\n\t\t\tchart.draw(data, google.charts.Bar.convertOptions(options));\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['bar'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart3);\r\n\t\tfunction drawChart3() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Suscriptores', 'No Suscriptores 0', 'No Suscriptores 1'],\r\n\t\t\t['Club tvgo', 8.66, 3.94, 2.70],\r\n\t\t\t['Películas', 3.75, 4.75, 0],\r\n\t\t\t['Champions', 0.58, 11.30, 0],\r\n\t\t\t['Series', 3.27, 5.94, 0],\r\n\t\t\t['Comercial', 0, 3.27, 0],\r\n\t\t\t['Vencimiento', 0, 33.96, 0]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'RATIO DE CLICS POR TIPO CAMPAÑA (%)',\r\n\t\t\tsubtitle:'No Suscriptores 0: Nunca estuvieron suscritos; No Suscriptores 1: Algunas vez estuvieron suscritos pero, actualmente, no lo están.',\r\n\t\t\t};\r\n\t\t\tvar chart = new google.charts.Bar(document.getElementById('columnchart_material7'));\r\n\t\t\tchart.draw(data, google.charts.Bar.convertOptions(options));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "2fbb8e8774ded6976f421efd2077c45b", "score": "0.6187732", "text": "function generarTabla() {\n let numero = 0;\n let tabla = \"\";\n\n let str_numero = localStorage.getItem(\"numero\");\n numero = JSON.parse(str_numero);\n\n let tBody = document.getElementById('multiplicacion')\n tBody.innerHTML = \"\"\n\n for (let index = 1; index <= 10; index++) {\n let row = \"\"\n row += \"<tr>\"\n row += \"<td>\" + numero + \" x \" + index + \" = </td>\"\n row += \"<td>\" + \"<input type='text' id='resultadoIngresado\"+index+\"' placeholder='Resultado'> </input>\"\n row += \"</tr>\"\n tBody.innerHTML += row;\n }\n}", "title": "" }, { "docid": "6a28ad9cbcc958f08da2947d21385972", "score": "0.6181593", "text": "function colorearTabla() {\n for (let i = 0; i < 5 * 5; i++) { //para cada celda\n colorearCasilla(i);\n }\n}", "title": "" }, { "docid": "a31db68570d910d343e51caece8d21f8", "score": "0.615829", "text": "encabezadoDeTabla(titulos) {\n return titulos.map((titulo, ix) => <th key={ix}>{titulo}</th>)\n }", "title": "" }, { "docid": "27dd88f195c287c4a347bd90efd5915f", "score": "0.61484706", "text": "function cargarTablaUnProblema(response) {\n\tvar pos = 0;\n\tfor ( pos = 0; pos < response.datos.length; pos++) {\n\t\tvar row1 = Ti.UI.createTableViewRow({\n\t\t});\n\t\tvar column1 = Ti.UI.createView({\n\t\t\ttitle : '' + response.datos[pos].nom_part,\n\t\t\tfont : {\n\t\t\t\tfontSize : '20%',\n\t\t\t\tcolor : \"#000\",\n\t\t\t\tfontFamily : 'Roboto-Condensed'\n\t\t\t},\n\t\t\tleft : 0,\n\t\t\twidth : \"40%\"\n\t\t});\n\t\tvar label1 = Ti.UI.createLabel({\n\t\t\ttext : '' + response.datos[pos].nom_part,\n\t\t\tfont : {\n\t\t\t\tfontSize : '20%',\n\t\t\t\tcolor : \"#000\",\n\t\t\t\tfontFamily : 'Roboto-Condensed'\n\t\t\t},\n\t\t\tleft : 0\n\t\t});\n\t\tvar column2 = Ti.UI.createView({\n\t\t\ttitle : '' + response.datos[pos].leng,\n\t\t\tfont : {\n\t\t\t\tfontSize : '20%',\n\t\t\t\tcolor : \"#000\",\n\t\t\t\tfontFamily : 'Roboto-Condensed'\n\t\t\t},\n\t\t\tleft : '40%'\n\t\t});\n\t\tvar label2 = Ti.UI.createLabel({\n\t\t\ttext : '' + response.datos[pos].leng,\n\t\t\tfont : {\n\t\t\t\tfontSize : '20%',\n\t\t\t\tcolor : \"#000\",\n\t\t\t\tfontFamily : 'Roboto-Condensed'\n\t\t\t},\n\t\t\tleft : 0,\n\t\t});\n\t\tvar column3 = Ti.UI.createView({\n\t\t\ttitle : '' + response.datos[pos].fechasub,\n\t\t\tfont : {\n\t\t\t\tfontSize : '20%',\n\t\t\t\tcolor : \"#000\",\n\t\t\t\tfontFamily : 'Roboto-Condensed'\n\t\t\t},\n\t\t\tleft : '60%'\n\t\t});\n\t\tvar label3 = Ti.UI.createLabel({\n\t\t\ttext : '' + response.datos[pos].fechasub,\n\t\t\tfont : {\n\t\t\t\tfontSize : '20%',\n\t\t\t\tcolor : \"#000\",\n\t\t\t\tfontFamily : 'Roboto-Condensed'\n\t\t\t},\n\t\t\tleft : 0,\n\t\t});\n\t\tcolumn1.add(label1);\n\t\tcolumn2.add(label2);\n\t\tcolumn3.add(label3);\n\t\trow1.add(column1);\n\t\trow1.add(column2);\n\t\trow1.add(column3);\n\t\ttablaUnProblema.appendRow(row1);\n\t}\n\ttituloProblema.text = response.datos[0].nom_prob;\n}", "title": "" }, { "docid": "68b676fea68295f2c97043679e9e4bf5", "score": "0.6148105", "text": "function bodyTable(data) {\n let table = '';\n let nomor = 1;\n data.forEach(video => {\n table += `<tr>\n <td class=\"text-center\">${nomor++}</td>\n <td class=\"text-left\" style=\"width: 350px\">${video.nama_file}</td>\n <td class=\"text-center\">${video.ukuran_file} Mb</td>\n <td class=\"text-center\">${video.kecepatan_enkripsi}</td>\n <td class=\"text-center\">${video.kecepatan_dekripsi}</td>\n </tr>`;\n });\n document.querySelector('.tabel-video').innerHTML = table;\n}", "title": "" }, { "docid": "0d226e01a74f0ffa097065be563d2199", "score": "0.6139084", "text": "criarTabela() {\n // deleta a tabela\n while (this.tabela.hasChildNodes()) {\n this.tabela.removeChild(this.tabela.firstChild)\n }\n // criação da tabela e dados\n // cria o cabeçalho da tabela\n let tHeader = this.tabela.createTHead()\n let hRow = tHeader.insertRow()\n hRow.insertCell(0).innerHTML = 'Mês'\n hRow.insertCell(1).innerHTML = 'Dinheiro aplicado'\n hRow.insertCell(2).innerHTML = 'Juros'\n hRow.insertCell(3).innerHTML = 'Total'\n // cria e insere os dados na tabela\n let investido = this.investido\n let total = this.investido\n let mes = 0\n for (let index = 0; index < this.periodo; index++) {\n // calcula o valor investido\n investido += this.aporte\n // calcula o valor total\n total += this.aporte\n total *= this.juros\n // aumenta o valor de mês\n mes++\n // insere os dados na tabela\n // .toLocalString = ajusta o valor para a moeda BRL\n let row = this.tabela.insertRow()\n row.insertCell(0).innerHTML = mes\n row.insertCell(1).innerHTML = investido.toLocaleString('pt-BR', {\n style: 'currency',\n currency: 'BRL'\n })\n row.insertCell(2).innerHTML = (total - investido).toLocaleString('pt-BR', {\n style: 'currency',\n currency: 'BRL'\n })\n row.insertCell(3).innerHTML = total.toLocaleString('pt-BR', {\n style: 'currency',\n currency: 'BRL'\n })\n }\n }", "title": "" }, { "docid": "0e72dead141b8038e892f9a83b136a16", "score": "0.613384", "text": "function tabThree(){\r\n\t\tgoogle.charts.load('current', { 'packages': ['table'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawTable);\r\n\t\tfunction drawTable() {\r\n\t\t\tvar data = new google.visualization.DataTable();\r\n\t\t\tdata.addColumn('string', 'Campaña');\r\n\t\t\tdata.addColumn('number', 'Enviados');\r\n\t\t\tdata.addColumn('number', 'Recibidos');\r\n\t\t\tdata.addColumn('number', 'Abiertos');\r\n\t\t\tdata.addColumn('number', 'Clics');\r\n\t\t\tdata.addRows([\r\n\t\t\t['Club tvgo', { v: 748266, f: '748,266' }, { v: 743623, f: '743,623 (99.38%)' }, { v: 20396, f: '20,396' }, { v: 766, f: '766' }],\r\n\t\t\t['Series', { v: 449301, f: '449,301' }, { v: 446855, f: '446,855 (99.46%)' }, { v: 15016, f: '15,016' }, { v: 556, f: '556' }],\r\n\t\t\t['Champions', { v: 159696, f: '159,696' }, { v: 159539, f: '159,539 (99.90%)' }, { v: 5696, f: '5,696' }, { v: 264, f: '264' }],\r\n\t\t\t['Comercial', { v: 59522, f: '59,522' }, { v: 58901, f: '58,901 (98.96%)' }, { v: 2335, f: '2,335' }, { v: 92, f: '92' }],\r\n\t\t\t['Sorteos', { v: 18017, f: '18,017' }, { v: 18007, f: '18,007 (99.94%)' }, { v: 1198, f: '1,198' }, { v: 52, f: '52' }],\r\n\t\t\t['Vencimiento', { v: 262, f: '262' }, { v: 260, f: '260 (99.24%)' }, { v: 41, f: '41' }, { v: 10, f: '10' }]\r\n\t\t\t]);\r\n\t\t\tvar table = new google.visualization.Table(document.getElementById('table_div2'));\r\n\t\t\ttable.draw(data, { showRowNumber: true, width: '100%', height: '100%' });\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['corechart'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart1);\r\n\t\tfunction drawChart1() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Enviados'],\r\n\t\t\t['Club tvgo', 748266],\r\n\t\t\t['Series', 449301],\r\n\t\t\t['Vencimiento', 262],\r\n\t\t\t['Champions', 159696],\r\n\t\t\t['Comercial', 59522],\r\n\t\t\t['Sorteos', 18018]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'MAILINGS ENVIADOS POR TIPO CAMPAÑA '\r\n\t\t\t};\r\n\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('piechart2'));\r\n\t\t\tchart.draw(data, options);\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['bar'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart2);\r\n\t\tfunction drawChart2() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Suscriptores', 'No Suscriptores 0', 'No Suscriptores 1'],\r\n\t\t\t['Club tvgo', 11.33, 2.31, 5.25],\r\n\t\t\t['Series', 9.52, 2.37, 0],\r\n\t\t\t['Champions', 8.44, 3.17, 0],\r\n\t\t\t['Comercial', 0, 3.96, 0],\r\n\t\t\t['Sorteos', 10.31, 5.16, 0],\r\n\t\t\t['Vencimiento', 0, 15.77, 0]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'RATIO DE APERTURA POR TIPO CAMPAÑA (%)',\r\n\t\t\tsubtitle:'No Suscriptores 0: Nunca estuvieron suscritos; No Suscriptores 1: Algunas vez estuvieron suscritos pero, actualmente, no lo están.',\r\n\t\t\t};\r\n\t\t\tvar chart = new google.charts.Bar(document.getElementById('columnchart_material2'));\r\n\t\t\tchart.draw(data, google.charts.Bar.convertOptions(options));\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['bar'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart3);\r\n\t\tfunction drawChart3() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Suscriptores', 'No Suscriptores 0', 'No Suscriptores 1'],\r\n\t\t\t['Club tvgo', 6.64, 3.71, 1.54],\r\n\t\t\t['Series', 3.57, 3.79, 0],\r\n\t\t\t['Champions', 3.59, 4.87, 0],\r\n\t\t\t['Comercial', 0, 3.94, 0],\r\n\t\t\t['Sorteos', 6.32, 2.73, 0],\r\n\t\t\t['Vencimiento', 0, 24.39, 0]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'RATIO DE CLICS POR TIPO CAMPAÑA (%)',\r\n\t\t\tsubtitle:'No Suscriptores 0: Nunca estuvieron suscritos; No Suscriptores 1: Algunas vez estuvieron suscritos pero, actualmente, no lo están.',\r\n\t\t\t};\r\n\t\t\tvar chart = new google.charts.Bar(document.getElementById('columnchart_material6'));\r\n\t\t\tchart.draw(data, google.charts.Bar.convertOptions(options));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "49fc3642d4d0f9a7316fa4f696411d6f", "score": "0.6118342", "text": "function inicializarTablero() {\n console.log( tablero );\n for (i = 0; i < tablero.columnas; i++) { //Recorremos las columnas\n tablero.celdas[i] = [];\n for (j = 0; j < tablero.filas; j++) { //Recorremos las filas\n tablero.celdas[i][j] = '(' + i + ',' + j + ')';//Guardamos la posicion de la columna y la fila dentro del array\n }\n }\n}", "title": "" }, { "docid": "ba86b17445131cfe47628e1038769ef1", "score": "0.611703", "text": "function llenarTabla(){\n\n\t\t$(\"#loader\").show();\n\t\twindow.tablaSolicitudes.clear().draw();\n\n\t\t$.ajax({\n\t\t\turl:\t\t'ws/compras/compraspropuestas',\n\t\t\ttype:\t\t'GET',\n\t\t\tdataType: \t'json'\n\t\t\t}\n\t\t)\n\t\t.done(function(data){\t\n\t\t\tif( data.result ){\n\n\t\t\t\tcontador = 0;\t\t\n\t\t\t\t\n\t\t\t\t$.each(data.records, function(index,value){\n\n\t\t\t\t\tvar tipo = tipoCompras( value.tipo_compra );\n\n\t\t\t\t\tswitch (parseInt(value.estado)) {\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\testado = \"<center><span class=\\\"label label-info\\\">Recibidas</span></center>\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\testado = \"<center><span class=\\\"label label-success\\\">Enviado a aprobación</span></center>\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t};\n\n\t\t\t\t\tcontador++;\n\t\t\t\t\tcounter1 = contador;\n\t\t\t\t\tcounter2 = value.no_correlativo;\n\t\t\t\t\tcounter3 = value.solicitante_nombre;\n\t\t\t\t\tcounter4 = tipo;\n\t\t\t\t\tcounter5 = value.fecha_solicitud;\n\t\t\t\t\tcounter6 = '<center><span class=\"label label-warning\">'+value.cant_propuestas+' / '+value.cant_proveedores+'</span></center>';\n\t\t\t\t\tcounter7 = estado;\n\t\t\t\t\tcounter8 = '<center><a style=\"margin-right:3px;\" class=\"btn-ver btn btn-info btn-xs\" title=\"Detalle de solicitud\" href=\"#modal-detalle\" data-toggle=\"modal\" data-idsolicitud=\"'+value.id+'\"><i class=\"fa fa-eye\"></i></a>'+\n\t\t\t\t\t\t\t '<a style=\"margin-right:3px;\" class=\"btn-proveedores btn btn-warning btn-xs\" title=\"Proveedores\" href=\"#modal-proveedores\" data-toggle=\"modal\" data-idsolicitud=\"'+value.id+'\"><i class=\"fa fa-users\"></i></a>';\n\t\t\t\t\t\t \t \tif( value.estado == 5)\n\t\t\t\t\t\t \t \tcounter8 += '<a class=\"btn-verpropuestas btn btn-success btn-xs\" title=\"Enviar propuestas\" href=\"#modal-propuestas\" data-toggle=\"modal\" data-idsolicitud=\"'+value.id+'\"><i class=\"fa fa-paper-plane-o\"></i></a></center>';\n\t\t\t\t\t\t \t else\n\t\t\t\t\t\t \t \tcounter8 += '<a class=\"btn-verpropuestas btn btn-danger btn-xs\" title=\"Enviar propuestas\" href=\"#modal-propuestas\" data-toggle=\"modal\" data-idsolicitud=\"'+value.id+'\"><i class=\"fa fa-paper-plane-o\"></i></a></center>';\n\n\t\t\t\t\twindow.tablaSolicitudes.row.add([counter1,counter2,counter3,counter4,counter5,counter6,counter7,counter8]).draw(false);\n\n\n\t\t\t\t});\n\t\t\t}\t\t\n\t\t})\n\t\t.fail(function(err){\n\t\t\tconsole.log(err);\n\t\t})\n\t\t.always( function(){\n\t\t\t$(\"#loader\").fadeOut();\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "d1710e06187f4aa88517c03c30951878", "score": "0.6113149", "text": "function tablaMultiplicar(numero){\n //let resultado = \"# Tabla del \" + numero + \" #\";\n let resultado = `# Tabla del ${numero} # \\n`;\n\n for(let multiplicador = 1; multiplicador <= 10; multiplicador++){\n //let multiplicacion = (i*numero);\n\n resultado += `${multiplicador} x ${numero} = ${numero*multiplicador} \\n`\n \n }\n return resultado;\n}", "title": "" }, { "docid": "eb03bfadc68652284138e033a91fa374", "score": "0.6103222", "text": "function dibujarTabla() {\n var zonadibujo = document.getElementById('zonadibujo');\n zonadibujo.appendChild(creandoTabla); //en el div crea TABLA\n\n for (f = 0; f < 30; f++) {\n var creadoTR = document.createElement('TR'); //crea nodo TR\n creadoTR.id = f; // Ponemos las IDs los TRs\n creandoTabla.appendChild(creadoTR); //en TABLE crea TR\n for (c = 0; c < 30; c++) {\n var creandoTD = document.createElement('TD'); //crea nodo TD\n creandoTD.id = c; // Ponemos las IDs los TDs\n creandoTD.addEventListener(\n 'mousedown',\n function() {\n activarPintar(this);\n },\n false\n ); //evento para pintar al hacer clic\n creandoTD.addEventListener(\n 'mouseover',\n function() {\n pintar(this);\n },\n false\n ); //evento para pintar moviendo el raton\n creandoTD.addEventListener(\n 'mouseup',\n function() {\n desactivarPintar();\n },\n false\n ); //evento para parar de pintar\n creadoTR.appendChild(creandoTD); //en TR crea TD\n }\n }\n prepararSelecciones();\n}", "title": "" }, { "docid": "1fcf938d8cf9405b24af025efcf14d0c", "score": "0.60964346", "text": "function prepTable(data) {\n var tableinfo = document.getElementById('info')\n for (var variable in data.results) {\n var tr = document.createElement(\"TR\")\n tr.appendChild(createTd(data.results[variable].fornavn))\n tr.appendChild(createTd(data.results[variable].etternavn))\n tr.appendChild(createTd(data.results[variable].fodested))\n tr.appendChild(createTd(data.results[variable].fodselsaar))\n tableinfo.appendChild(tr)\n }\n}", "title": "" }, { "docid": "057952a168098771766b418599f72743", "score": "0.60948354", "text": "function misHistoriasClinicas() {\n $(\"#pMisHCmedico\").empty();\n //Presenta al medico que consulta la funcion.\n $(\"#pMisHCmedico\").append(\"<h3><i><u>Historias Clínicas de \" + userLogueado.nombre + \"</u></i></h3> \\n\\\n <b>______________________________________________________________________________________________</b> <br>\");\n\n var contador = 0;\n for (var i = 0; i < actuacionesClinicas.length; i++) {\n //Condicion para filtrar las actClinicas especificas al medico \n if (userLogueado.numero === actuacionesClinicas[i].medico) {\n //2do bucle para generar el nombre del paciente especifico y mostrarlo en la tabla\n var nombrePaciente = \"\";\n for (var h = 0; h < pacientes.length; h++) {\n if (pacientes[h].documento === actuacionesClinicas[i].paciente) {\n nombrePaciente = pacientes[h].nombre;\n break;\n }\n }\n // Imprimimos las tablas\n $(\"#pMisHCmedico\").append(\"<table border= '1' ><tbody>\\\n <tr><td><b>Paciente:</b></td> <td>\" + nombrePaciente + \"(C.I.:\" + actuacionesClinicas[i].paciente + \")</td><br> \\n\\\n <tr><td><b>Fecha del hecho:</b></td> <td>\" + FechaATexto(actuacionesClinicas[i].fecha) + \"</td><br> \\n\\\n <tr><td><b>Motivo:</b></td> <td>\" + actuacionesClinicas[i].motivo + \"</td><br> \\n\\\n <tr><td><b>Diagnostico:</b></td> <td>\" + actuacionesClinicas[i].diagnostico + \"</td><br> \\n\\\n <tr><td><b>Prescripción:</b></td> <td>\" + actuacionesClinicas[i].prescripcion + \"</td></tbody></table>\");\n\n } else {\n contador++;\n }\n }\n\n\n if (contador === actuacionesClinicas.length) {\n $(\"#pMisHCmedico\").html(\"<h3>No posees historias clinicas disponibles</h3>\");\n }\n}", "title": "" }, { "docid": "7ef827c3982a02ba9342159b3268ec53", "score": "0.60892797", "text": "function GerarTabela(listaCompleta, pagina) {\n let listaPaginada = listar(listaCompleta, pagina);\n\n $('tbody').html(\"\");\n\n $.each(listaPaginada, (i, paciente) => {\n let regime = DefinirRegime(paciente.Regime);\n\n let numeros = (parseInt(pagina) - 1) * 25 + (i + 1);\n\n let colunas = {\n numeros: numeros,\n Nome: paciente.Nome,\n Ra: paciente.Ra,\n Regime: regime\n };\n\n let actions = {\n detalhes: {\n type: 'a',\n href: `Cadastrar.php?paciente=${paciente.Id}&nome=${paciente.Nome}&ra=${paciente.Ra}`,\n html: \"Adicionar novo atendimento\",\n acesso: 2\n },\n editar: {\n type: 'a',\n href: `FichaMedica.php?ficha=${paciente.FichamedicaId}&nome=${paciente.Nome}&ra=${paciente.Ra}`,\n html: \"Ficha médica\",\n acesso: 2\n }\n };\n\n let linha = CriarLinhaTabela(colunas, actions, $('#nivelAcessoAtivo').val());\n\n $('tbody').append(linha);\n });\n}", "title": "" }, { "docid": "cc1260a7f2cda9a44464c45c0ed56b78", "score": "0.60865974", "text": "function tampil_tabel(data){\n table=document.getElementsByTagName('table');\n for(var i=0;i<data.length;i++){\n $('#tbody').append(`<tr>\n <td>`+data[i].id+`</td>\n <td>`+data[i].sensor_gas+`</td>\n <td>`+data[i].tinggi_air+`</td>\n <td>`+data[i].waktu+`</td>\n </tr>`);\n }\n $('table').DataTable();\n }", "title": "" }, { "docid": "aca99aed6d375ab516bbe14382c64fd6", "score": "0.60865086", "text": "function crear(){\n\t\n\tcrear2();//BORRA TABLA CREADA\n\tprocesos();//GENERA PROCESOS PRINCIPALES\n\nvar col = columnas;\nvar filas = periodostotales;\nvar jj=4;\nvar tabla=\"<table border='1' class='resultado'>\";\n//GENERA EL ENCABEZADO DE LA TABLA\ntabla+=\"<tr><td>\"+\"PERIODO\"+\"</td><td>\"+\"FECHA DE PAGO\"+\"</td><td>\"+\"SALDO CAPITAL\"+\"</td><td>\"+\"AMORTIZACION\"+\"</td><td>\"+\"PAGO INTERESES\"+\"</td><td>\"+\"SEG. DE VIDA\"+\"</td><td>\"+\"FLUJO DE CAJA\"/*+\"</td><td>\"+\"TITULO 7\"+\"</td></tr>\"*/\nfor(i=0;i<=filas;i++){\ntabla+=\"<tr>\";\nfor(j=0;j<col;j++){\n\t//GENERA LA COLUMNA 0 DE LA TABLA\n\t\n\tif(j==0){\n\ttabla+=\"<td> \"+i+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 1 DE LA TABLA\n\tif(j==1){\n\tvar fecha = new Date(fechascredito[i]);\n\ttabla+=\"<td> \"+fecha.toDateString()+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 2 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][0], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t\t}\n\t//GENERA LA COLUMNA 3 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][1], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 4 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][2], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 5 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][3], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 6 DE LA TABLA\n\tif(j==1){\n\ttabla+=\"<td> \"+separarmiles(matriz[i][4], 2, [',', \"'\", '.'])+\" </td>\";\t\n\t}\n\t//GENERA LA COLUMNA 7 DE LA TABLA\n\t/*if(j==1){\n\tvar fecha = new Date(fechascredito[i]);\n\ttabla+=\"<td> \"+7+\" </td>\";\t\n\t}*/\n\t\n}\ntabla+=\"</tr>\";\n}\ntabla+=\"</table>\";\ndocument.getElementById(\"resultado\").innerHTML=tabla;\n}", "title": "" }, { "docid": "05b7b8f43a7e506fd288d0cc79794c45", "score": "0.6081697", "text": "function analyseTableau() {\n compteur = 0;\n // analyse horizontale\n for (i = 0; i < dimension; i++) {\n addition = 0;\n for (j = 0; j < dimension; j++) {\n indice = j + i * dimension;\n if (tdElts[j + 1 + (i + 1) * (dimension + 2)].style.backgroundColor === \"green\") {\n cellules[indice].apparence = 1;\n } else {\n cellules[indice].apparence = 0;\n }\n if (cellules[indice].apparence === 1) {\n addition = addition + cellules[indice].valeur;\n }\n } // fin for j*/\n // Comparaison de l'addition avec le nombre a atteindre\n if (Number(tdElts[(i + 1) * (dimension + 2)].textContent) === addition) {\n tdElts[(i + 1) * (dimension + 2)].style.color = \"green\";\n tdElts[(i + 1) * (dimension + 2) + dimension + 1].style.color = \"green\";\n compteur++;\n } else {\n tdElts[(i + 1) * (dimension + 2)].style.color = \"aqua\";\n tdElts[(i + 1) * (dimension + 2) + dimension + 1].style.color = \"aqua\";\n }\n } // fin for i\n // Analyse verticale\n for (i = 0; i < dimension; i++) {\n addition = 0;\n for (j = 0; j < dimension; j++) {\n indice = i + j * dimension;\n if (cellules[indice].apparence === 1) {\n addition = addition + cellules[indice].valeur;\n }\n } // fin de for j\n // Comparaison de l'adition avec le nombre a atteindre\n if (Number(tdElts[i + 1].textContent) === addition) {\n tdElts[i + 1].style.color = \"green\";\n tdElts[i + 1 + (dimension + 2) * (dimension + 1)].style.color = \"green\";\n compteur++;\n } else {\n tdElts[i + 1].style.color = \"aqua\";\n tdElts[i + 1 + (dimension + 2) * (dimension + 1)].style.color = \"aqua\";\n }\n } // fin de for i\n if (compteur === (dimension * 2)) {\n finPartie();\n }\n} // fin de fonction analyseTableau", "title": "" }, { "docid": "2878c2ab727468e4cc9c5517fbdc892f", "score": "0.6073649", "text": "static getConjugationTable() {\n return {\n Infinitive: '',\n Present: {First: [], Second: [], Third: [], Plural: []},\n Past: {First: [], Second: [], Third: [], Plural: []}\n }\n }", "title": "" }, { "docid": "08883052bd21e94ca43c091c81901eb3", "score": "0.607264", "text": "function tablaQuitaManchasDesengrasantes(productos, cate) {\n let regsob = renglonesPorHoja;\n let renglonesOcupados = 0;\n let filas = '';\n\n filas += `\n <h1 id=\"nombreCategoria\">\n ${cate} \n </h1>\n \n <table class=\"table table-sm\" id=\"listaPrecios\">\n <tr>\n <th></th>\n <th style=\"text-align: center;\"> 5 Litros envasado </th>\n </tr> \n `\n let nameanterior = '';\n for (let i = 0; i < productos.length; i++) {\n if (productos[i].categoria.name == cate) {\n renglonesOcupados++\n filas += `\n <tr>\n <td style=\"font-size: 12px;\"> ${productos[i].name} </td> \n <td style=\"text-align: center; font-size: 12px;\"> ${productos[i].price} </td> \n `\n filas += `</tr>`\n }\n }\n filas += `</table>`\n renglonesOcupados = renglonesOcupados + 5;\n\n if (renglonesOcupados > regsob) {\n var br = '';\n for (let i = 0; i < renglonesSobrantes; i++) {\n br += `<br>`;\n }\n filas = br + filas;\n renglonesPorHoja = 45\n }\n\n renglonesSobrantes = renglonesPorHoja - renglonesOcupados;\n renglonesPorHoja = renglonesSobrantes;\n return filas;\n}", "title": "" }, { "docid": "f4b5dd4c07c4915a5354a84a06f23b4e", "score": "0.6072355", "text": "function mostrar_rankingPF_promedio(){\n\n let tbody = document.querySelector('#tblRankingPF tbody');\n tbody.innerHTML = ''; \n let filtro2 = inputFiltro2.value;\n\n //variables importantes:\n var count = {}; //diccionario de coles y cantidad de papas que rankearon\n var value = [] //solo las personas que rankearon, numero.\n let promedio = 0 ; // promedio de notas x cole. \\\n let centrosList = []; //lista de la info de todos los coles.\n\n\n //obtener primero los repetidos de cada centro\n for(let i = 0; i < lista_rankingPF.length; i++){\n\n //obtener nombre comercial de cada centro\n let centrosInfo = obtener_usuario_por_id(lista_rankingPF[i]['idcentro']);\n centrosList.push(centrosInfo)\n\n \n //crear un diccionario q diga cual cole y cuantos rankings x cole\n let uniqueCount = [centrosInfo.nombrecomercial];\n uniqueCount.forEach(function(i) { count[i] = (count[i]||0) + 1;});\n }\n\n //obtener la cantidad de rankings x cole\n for(var key in count) {\n value = count[key];\n var contadorNotas = 0;\n\n //obtener la suma de las notas de cada cole\n for(let i = 0; i < lista_rankingPF.length; i++){\n\n if (centrosList[i].nombrecomercial == key){\n \n let nota = lista_rankingPF[i]['califnum'];\n contadorNotas += parseInt(nota);\n }\n }\n\n //sacar el promedio con la suma de notas y la cantidad de rankings\n promedio = Math.trunc(contadorNotas / value);\n\n\n //key=nombre del cole. \n //value= cantidad de personas que rankearon el cole.\n //promedio= promedio de nota de ranking basado en los ranking. (truncados)\n \n\n //generar la tabla\n for(let i = 0; i < lista_rankingPF.length; i++){\n\n //el filtro aun no sirve\n if(key.toLowerCase().includes(filtro2.toLowerCase())) { \n if (key == centrosList[i].nombrecomercial){\n\n let fila = tbody.insertRow();\n\n let celdaCentro = fila.insertCell();\n let celdaEscudo = fila.insertCell();\n let celdaPromedio = fila.insertCell();\n\n let imagen = document.createElement('img');\n imagen.classList.add('imagenTabla'); //para definir el tamano de la imagen\n\n if(centrosList[i].escudo){\n imagen.src = centrosList[i].escudo;\n }else{\n if (lista_usuarios[i]['tipo'] == 'CentroEducativo'){\n imagen.src = 'imgs/escudo.png';\n }}\n\n let celdaEstrellas = fila.insertCell(); \n\n //definir la cantidad de estrellas basado en el promedio:\n let promedioStars = '';\n\n if (promedio == 0){\n promedioStars = '<i id=\"star1\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star2\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star3\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star4\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star5\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"></i></i></i></i></i>'; \n }\n\n else if (promedio == 1){\n promedioStars = '<i id=\"star1\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star2\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star3\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star4\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star5\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"></i></i></i></i></i>';\n }\n\n else if (promedio == 2){\n promedioStars = '<i id=\"star1\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star2\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star3\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star4\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star5\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"></i></i></i></i></i>';\n }\n\n else if (promedio == 3){\n promedioStars = '<i id=\"star1\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star2\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star3\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star4\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"><i id=\"star5\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"></i></i></i></i></i>';\n }\n\n else if (promedio == 4){\n promedioStars = '<i id=\"star1\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star2\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star3\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star4\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star5\" class=\"fas fa-star fa-1x\" style=\"color: gray;\"></i></i></i></i></i>';\n }\n\n else if (promedio == 5){\n promedioStars = '<i id=\"star1\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star2\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star3\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star4\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"><i id=\"star5\" class=\"fas fa-star fa-1x\" style=\"color: orange;\"></i></i></i></i></i>';\n }\n \n //llenar la tabla con los datos \n \n celdaCentro.innerHTML = centrosList[i].nombrecomercial;\n celdaEscudo.appendChild(imagen);\n celdaPromedio.innerHTML = promedio;\n celdaEstrellas.innerHTML = promedioStars;\n break;\n }\n \n }\n }}\n}", "title": "" }, { "docid": "2273b6a6406732d85bc773b73bc6ac65", "score": "0.6060782", "text": "function visualizarTabla(valorObtenido){\n \n const tamano = valorObtenido.items.length;\n\n //Creacion de la tabla\n var tablaCabanas= \"<table border='3'>\" + \n \"<tr>\" +\n \"<th>ID</th>\" +\n \"<th>BRAND</th>\" + \n \"<th>ROOMS</th>\" + \n \"<th>CATEGORY_ID</th>\" + \n \"<th>NAME</th>\" +\n \"</tr>\"; \n\n //Llenar datos en la tabla \n for(var i=0;i<tamano;i++){\n tablaCabanas=tablaCabanas + \"<tr>\"+\n \"<td>\" + valorObtenido.items[i].id + \"</td>\" + \n \"<td>\" + valorObtenido.items[i].brand + \"</td>\" + \n \"<td>\" + valorObtenido.items[i].rooms + \"</td>\" +\n \"<td>\" + valorObtenido.items[i].category_id + \"</td>\" +\n \"<td>\" + valorObtenido.items[i].name + \"</td>\" +\n \"</tr>\";\n\n }\n\n tablaCabanas = tablaCabanas +\"</table>\";\n}", "title": "" }, { "docid": "5ee394bfd48f75cf99cb601818b2f230", "score": "0.6059461", "text": "function GerarTabela(listaCompleta, pagina) {\n let listaPaginada = listar(listaCompleta, pagina);\n\n $('tbody').html(\"\");\n\n $.each(listaPaginada, (i, paciente) => {\n let regime = DefinirRegime(paciente.Regime);\n\n let numeros = (parseInt(pagina) - 1) * 25 + (i + 1);\n\n let colunas = {\n numeros: numeros,\n Nome: paciente.Nome,\n Ra: paciente.Ra,\n Regime: regime\n };\n\n let actions = {\n detalhes: {\n type: 'a',\n href: `Detalhes.php?paciente=${paciente.Id}&ficha=${paciente.FichamedicaId}&endereco=${paciente.EnderecoId}`,\n html: \"Detalhes\",\n acesso: 2\n },\n editar: {\n type: 'a',\n href: `Editar.php?paciente=${paciente.Id}&ficha=${paciente.FichamedicaId}&endereco=${paciente.EnderecoId}`,\n html: \"Editar\",\n acesso: 3\n },\n deletar: {\n type: 'button',\n value: `paciente=${paciente.Id}&usuario=${paciente.UsuarioId}&nome=${paciente.Nome}`,\n html: \"Deletar\",\n acesso: 3\n }\n };\n\n let linha = CriarLinhaTabela(colunas, actions, $('#nivelAcessoAtivo').val());\n\n $('tbody').append(linha);\n });\n}", "title": "" }, { "docid": "2e97f1c04a6fff25ce44889d1806c9c9", "score": "0.6043721", "text": "function TabelPeAni(evt) {\n var anSelectat = evt.target.value;\n\n // calculez mediile din anul respectiv\n\n var msv=0, mpop=0, mpib=0, countsv=0, countpop=0, countpib=0;\n var max1=0, max2=0, max3=0;\n var min1=9999999999, min2=9999999999, min3=9999999999;\n\n for (var i = 0; i < data.length; i++) {\n if(data[i][keys[1]] == anSelectat) {\n if(data[i][keys[2]] == \"SV\" && data[i][keys[3]] != null) {\n if(data[i][keys[3]]>max1) max1=data[i][keys[3]];\n if(data[i][keys[3]]<min1) min1=data[i][keys[3]];\n msv = msv + data[i][keys[3]];\n countsv = countsv + 1;\n }\n if(data[i][keys[2]] == \"POP\" && data[i][keys[3]] != null) {\n if(data[i][keys[3]]>max2) max2=data[i][keys[3]];\n if(data[i][keys[3]]<min2) min2=data[i][keys[3]];\n mpop = mpop + data[i][keys[3]];\n countpop = countpop + 1;\n }\n if(data[i][keys[2]] == \"PIB\" && data[i][keys[3]] != null) {\n if(data[i][keys[3]]>max3) max3=data[i][keys[3]];\n if(data[i][keys[3]]<min3) min3=data[i][keys[3]];\n mpib= mpib + data[i][keys[3]];\n countpib = countpib + 1;\n }\n }\n }\n\n msv = (msv / countsv).toFixed(2);\n mpop = (mpop / countpop).toFixed(2);\n mpib = (mpib / countpib).toFixed(2);\n\n // creez capul de tabel\n var table = document.getElementById(\"table\");\n table.innerHTML = \"\";\n\n var tr = table.insertRow(-1);\n var th = document.createElement(\"th\");\n th.innerHTML = \" \";\n tr.appendChild(th);\n\n for (var i = 0; i < indicatori.length; i++) {\n var th = document.createElement(\"th\");\n th.innerHTML = indicatori[i];\n tr.appendChild(th);\n }\n\n for (var i = 0; i < tari.length; i++) {\n\n tr = table.insertRow(-1);\n var tabCell = tr.insertCell(-1);\n tabCell.innerHTML = tari[i];\n\n for (var j = 0; j < data.length; j++) {\n if (data[j][keys[0]] == tari[i] && data[j][keys[1]] == anSelectat) {\n var tabCell = tr.insertCell(-1);\n tabCell.innerHTML = data[j][keys[3]];\n if(data[j][keys[2]] == \"SV\") tabCell.style.backgroundColor = getColorMedie(data[j][keys[3]],min1,max1,msv);\n if(data[j][keys[2]] == \"POP\") tabCell.style.backgroundColor = getColorMedie(data[j][keys[3]],min2,max2,mpop);\n if(data[j][keys[2]] == \"PIB\") tabCell.style.backgroundColor = getColorMedie(data[j][keys[3]],min3,max3,mpib);\n }\n }\n }\n\n tr = table.insertRow(-1);\n var tabCell = tr.insertCell(-1);\n tabCell.innerHTML = \"Media\";\n tabCell = tr.insertCell(-1);\n tabCell.innerHTML = msv;\n tabCell = tr.insertCell(-1);\n tabCell.innerHTML = mpop;\n tabCell = tr.insertCell(-1);\n tabCell.innerHTML = mpib;\n\n}", "title": "" }, { "docid": "1509899a7fda7af096aac24e3b8a5e11", "score": "0.6029921", "text": "function crearTablero (n) {\n var tablero = document.getElementById('tablero');\n var minas = document.getElementById('minas')\n let cantidadMinas = 0;\n\n for (i=0; i<n ; i++) {\n for (j=0; j<n; j++){\n var divGrilla = document.createElement('div');\n divGrilla.setAttribute('fila', i);\n\t\t\tdivGrilla.setAttribute('columna', j);\n divGrilla.classList.add('grilla')\n tablero.appendChild(divGrilla)\n minas.innerText=cantidadMinas;\n\n if(cantidadMinas<= 10 && determinarAgregarMina(divGrilla)){\n cantidadMinas++;\n divGrilla.setAttribute(\"mina\",true);\n grillaConMinas[i][j]=1;\n }\n \n }\n }\n}", "title": "" }, { "docid": "f2387880732740bad54bca6a72b67051", "score": "0.60268044", "text": "function tabla3() {\n \n let multiplicacion =0;\n for(let i = 1; i <=50;i++){\n multiplicacion= 3*i;\n console.log(`3 x ${i} = ${multiplicacion}`);\n }\n \n}", "title": "" }, { "docid": "9caf1c0d39e95e17f24d2f5481d14d68", "score": "0.60210055", "text": "function generarTablero() {\n for (let i = 0; i < 30; i++) {\n arrTablero[i] = undefined;\n }\n for (let i = 0; i < 15; i++) {\n for (let k = 0; k < 2; k++) {\n let explorarIndice = 0;\n let validar = 0;\n while (validar < 1) {\n let indice = Math.floor(Math.random() * 30);\n if (arrTablero[indice] == undefined) {\n validar++;\n arrTablero[indice] = i;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "31690f24f81dd99b25a763d4f4534b42", "score": "0.60183144", "text": "function tabler(data) {\n data.forEach(function(ufo) {\n var row = tbody.append(\"tr\");\n Object.entries(ufo).forEach(function([key,value]) {\n row.append(\"td\").text(value);\n });\n });\n}", "title": "" }, { "docid": "6b2675666d40cd2d396a29b809a46c6e", "score": "0.6015441", "text": "function multiTable(number) {\n return [...new Array(10)].map((_, i) => `${i + 1} * ${number} = ${(i + 1) * number}`).join('\\n');\n}", "title": "" }, { "docid": "8887a28ad00f174819c7788f52e72411", "score": "0.6015097", "text": "function generateTable(data) {\n for (var y = 0; y < data.length; y++) {\n var cell = document.createElement(\"tr\");\n cell.id = tableid++;\n cell.innerHTML = `<td><div class=\"tabimage-wrapper\"><img src=\"${data[y].image}\" /></div></td><td><h5>${data[y].name}</h5></td><td><p>${data[y].description}</p></td>`;\n tbody.appendChild(cell);\n }\n if (tbody.childElementCount > 80) {\n reduceElementTop();\n }\n loader.classList.add(\"hide\");\n}", "title": "" }, { "docid": "076ee295632cbfc7a2411eb63971c205", "score": "0.60079706", "text": "function structure_data() {\n table.clear()\n .draw();\n var j = 0;\n order_list.reverse();\n for (var i in order_list) {\n if (!all_order_data[order_list[i]]) {\n } else {\n all_order_data[order_list[i]] ? all_order_data[order_list[i]].pinfo : '';\n if (all_order_data[order_list[i]].pinfo != null) {\n if (all_order_data[order_list[i]].collecteddata != '') {\n table.row.add([\n j = j + 1,\n all_order_data[order_list[i]].pinfo ? all_order_data[order_list[i]].pinfo.username : \"\",\n all_order_data[order_list[i]].pinfo ? all_order_data[order_list[i]].pinfo.phone : \"\",\n all_order_data[order_list[i]].pinfo ? all_order_data[order_list[i]].pinfo.email : \"\",\n format_time(all_order_data[order_list[i]].scandate),\n // \"<a href = 'fswear://\"+jQuery.parseJSON(all_order_data[order_list[i]].collecteddata).user_path +\"'><button id='alter_news' class='btn_info btn-sm'>启动试戴</button></a>\",\n \"<a target='_blank' href = 'http://127.0.0.1:9100/tryon/\" + all_order_data[order_list[i]].collecteddata.user_path + \"'><button id='alter_news' class='btn_info btn-sm'>启动试戴</button></a>\",\n \"<a href='../cad/glassadjust.html' class='btn_info' id='adjust' data=\" + order_list[i] + \">调整下单</a>\",\n order_list[i],\n ]);\n table.draw(false);\n } else {\n table.row.add([\n j = j + 1,\n all_order_data[order_list[i]].pinfo ? all_order_data[order_list[i]].pinfo.username : \"\",\n all_order_data[order_list[i]].pinfo ? all_order_data[order_list[i]].pinfo.phone : \"\",\n all_order_data[order_list[i]].pinfo ? all_order_data[order_list[i]].pinfo.email : \"\",\n format_time(all_order_data[order_list[i]].scandate),\n '',\n order_list[i],\n ]);\n table.draw(false);\n }\n }\n }\n }\n all_order_data = {};\n }", "title": "" }, { "docid": "6b7d1acb0595f6daa464b66c18c3390b", "score": "0.5989364", "text": "function fillPremiertab()\n{\n\tvar table=document.getElementById(\"lgtable\");\n\twhile (table.childNodes.length>0) {\n\t\ttable.removeChild(table.firstChild);\n\t}\n\tvar tr=document.createElement(\"tr\");\n\tvar th1=document.createElement(\"th\");\n\tth1.className=\"top\";\n\tth1.innerHTML=\"Pos\";\n\tvar th2=document.createElement(\"th\");\n\tth2.className=\"top\";\n\tth2.innerHTML=\"Club\";\n\tvar th3=document.createElement(\"th\");\n\tth3.className=\"top\";\n\tth3.innerHTML=\"Pld\";\n\tvar th4=document.createElement(\"th\");\n\tth4.className=\"top\";\n\tth4.innerHTML=\"Goals\";\n\tvar th5=document.createElement(\"th\");\n\tth5.className=\"top\";\n\tth5.innerHTML=\"GD\";\n\tvar th6=document.createElement(\"th\");\n\tth6.className=\"top\";\n\tth6.innerHTML=\"Pts\";\n\ttr.appendChild(th1);\n\ttr.appendChild(th2);\n\ttr.appendChild(th3);\n\ttr.appendChild(th4);\n\ttr.appendChild(th5);\n\ttr.appendChild(th6);\n\ttable.appendChild(tr);\n\tfor (var i = 0; i < items.length; i++) {\n\t\tvar tr = document.createElement(\"tr\");\n\t\tvar th1 = document.createElement(\"th\");\n\t\tth1.innerHTML=(items[i].position);\n\t\tvar th2 = document.createElement(\"th\");\n\t\tth2.className=\"name1\";\n\t\tth2.innerHTML=items[i].name;\n\t\tvar th3 = document.createElement(\"th\");\n\t\tvar th4 = document.createElement(\"th\");\n\t\tvar th5 = document.createElement(\"th\");\n\t\tvar th6 = document.createElement(\"th\");\n\t\tth3.innerHTML=items[i].played;\n\t\tth4.innerHTML=items[i].goals;\n\t\tth5.innerHTML=items[i].gd;\n\t\tth6.innerHTML=items[i].points;\n\t\t\n\t\ttr.appendChild(th1);\n\t\ttr.appendChild(th2);\n\t\ttr.appendChild(th3);\n\t\ttr.appendChild(th4);\n\t\ttr.appendChild(th5);\n\t\ttr.appendChild(th6);\n\t\ttable.appendChild(tr);\n\t}\n\titems=[];\n}", "title": "" }, { "docid": "b1125afa02b4bf42e3986f110b56aaf1", "score": "0.59867185", "text": "function printTable(){\n\t\tvar tr = '';\n\t\tvar r = 0;\n\t\tvar max = matriz.length;\n\t\tfor(; r < max; r++){\n\t\t\ttr += '<tr><th>'+(r+1)+'</th>';\n\t\t\tfor(var c = 0; c < matriz[r].length; c++){\n\t\t\t\ttr += '<td id=\"' + r + '-' + c + '\">' + matriz[r][c] + '</td>';\n\t\t\t}\n\t\t\ttr += '</tr>';\n\t\t}\n\n\t\ttableb.innerHTML = tr;\n\t\ttableEvents();\n\t}", "title": "" }, { "docid": "edc12b413f9bdb05f5ad64c1071d1144", "score": "0.59826934", "text": "function GerarTabela(listaCompleta, pagina) {\r\n let listaPaginada = listar(listaCompleta, pagina);\r\n\r\n $('tbody').html(\"\");\r\n\r\n $.each(listaPaginada, (i, sintoma) => {\r\n let numeros = (parseInt(pagina) - 1) * 25 + (i + 1);\r\n\r\n let colunas = {\r\n numeros: numeros,\r\n Nome: sintoma.Nome\r\n };\r\n\r\n let actions = {\r\n editar: {\r\n type: 'a',\r\n href: `Editar.php?sintoma=${sintoma.Id}`,\r\n html: \"Editar\",\r\n acesso: 3\r\n },\r\n deletar: {\r\n type: 'button',\r\n value: `sintoma=${sintoma.Id}&nome=${sintoma.Nome}`,\r\n html: \"Deletar\",\r\n acesso: 3\r\n }\r\n };\r\n\r\n let linha = CriarLinhaTabela(colunas, actions, $('#nivelAcessoAtivo').val());\r\n\r\n $('tbody').append(linha);\r\n });\r\n}", "title": "" }, { "docid": "6ee21a8fb70d14db9a4de58d8067f13b", "score": "0.598057", "text": "function buildTable(data) {\n //Vamos a crear un elemento html \"table\" y lo almacenaramos en una funcion table.\n var table = document.createElement(\"table\");\n //Agregamos la tabla de Boostrap.\n table.setAttribute('class', 'table');\n //En la variable fields vamos a almacenar los Keys de data (Tarea, Status, Finalizada, Eliminar).\n var fields = Object.keys(data[0]);\n //Creamos una variable headRow donde le asignaremos un elemento HTML tr\n var headRow = document.createElement(\"tr\");\n //Vamos a recorrer en un ciclo todos los elementos que esten en fields y los almacenaremos en una variable field.\n fields.forEach(function(field) {\n //Vamos a crear una celda TH en la variable headCell\n var headCell = document.createElement(\"th\");\n headCell.setAttribute('scope', 'col');\n //A la celda le asisgnaremos un textNode con la informacion que tenga field (Tarea, Status, Finalizada, Eliminar);\n headCell.appendChild(document.createTextNode(field));\n //A headRow le asignaremos un nodo hijo con la informacion de headCell\n headRow.appendChild(headCell);\n });\n\n //Finalmente a table le asignaremos un nodo hijo que sera headRow y con esto crearemos la primer parte de la tabla.\n //La parte donde vienen los nombres de las variables (Tarea, Status, Finalizada, Eliminar)\n table.appendChild(headRow);\n\n //Recorreremos cada elemento que hay dentro de data que son objetos en este caso y le pondremos un index\n //para saber en que elemento estamos.\n data.forEach(function(object, index) {\n //Crearemos una variable row que sea igual a un elemento HTML tr\n var row = document.createElement(\"tr\");\n //En la variable fields vamos a almacenar los Keys de data (Tarea, Status, Finalizada, Eliminar).\n fields.forEach(function(field) {\n if (field == undefined) {\n field = \"vacio\";\n }\n //Crearemos una variable cell que sea igual a un elemento HTML td\n var cell = document.createElement(\"td\");\n //Vamos a verificar que si el valor de alguna celda es igual a \"En Progreso\" entonces reemplazaremos\n //Ese String y lo convertiremos a un boton\n if (object[field] === \"En Progreso\" && object[field] !== undefined) {\n //Creamos una variable completeButton que sea igual a un nodoHijo de cell que contenga un elemento\n //HTML de tipo Input\n //Con esto sustituimos en cell el texto que tenia por un Input.\n var completeButton = cell.appendChild(document.createElement(\"input\"));\n completeButton.setAttribute('class', 'button2');\n //A completeButton le asiganmos los atributos type = submit para el formato como boton y el value\n //= a Completar.\n completeButton.type = \"submit\", completeButton.value = \"Completar\";\n //Ponemos el boton dentro de la celda.\n row.appendChild(cell);\n //Le agregamos un eventListener que se active al click del boton y que llame a la funcion updateRegister\n //y le envie el nombre de la tarea que tenga ese boton asignado.\n completeButton.addEventListener(\"click\", function() {\n updateRegister(object[fields[0]]);\n });\n //Vamos a verificar que si el valor de alguna celda es igual a \"Eliminar\" entonces reemplazaremos\n //Ese String y lo convertiremos a un boton\n } else if (object[field] === \"Eliminar\" && object[field] != undefined) {\n //Creamos una variable completeButton que sea igual a un nodoHijo de cell que contenga un elemento\n //HTML de tipo Input\n //Con esto sustituimos en cell el texto que tenia por un Input.\n var completeButton = cell.appendChild(document.createElement(\"input\"));\n completeButton.setAttribute('class', 'button2');\n //A completeButton le asiganmos los atributos type = submit para el formato como boton y el value\n //= a Completar.\n completeButton.type = \"submit\", completeButton.value = \"Eliminar\";\n //Ponemos el boton dentro de la celda.\n row.appendChild(cell);\n //Le agregamos un eventListener que se active al click del boton y que llame a la funcion deleteRegister\n //y le envie el nombre de la tarea que tenga ese boton asignado.\n completeButton.addEventListener(\"click\", function() {\n console.log(object[fields[0]]);\n deleteRegister(object[fields[0]], \"Finalizada\");\n });\n } else if (object[field] != undefined) {\n //Si no se cumple ninguna condicion anterior unicamente insertaremos el texto con la informacion.\n //No se crearan ningun boton.\n cell.appendChild(document.createTextNode(object[field]));\n row.appendChild(cell);\n }\n });\n //Finalmente a tabla le asiganeremos otro nodoHijo que contenga toda la informacion de row.\n table.appendChild(row);\n });\n //Retornamos la tabla creada.\n return table;\n}", "title": "" }, { "docid": "5bd85172e19d216bfcea68ff24cd47f2", "score": "0.5968795", "text": "function generarTablero(filas,columnas){\n //mustro el boton para inicira la partida\n var btnIniciar=document.getElementById(\"iniciar\");\n btnIniciar.style.display=\"inherit\";\n\n //selecciono el area del contenedor del tablero\n var contenedor=document.getElementById(\"juego\");\n contenedor.style.paddingTop=\"5%\";\n\n //genero el tablero que contendrá las casillas\n var tablero= document.createElement(\"div\");\n var escala=1/columnas;\n tablero.id=\"tablero\";\n tablero.style.width=(screen.availHeight-100)*escala;\n tablero.style.height=tablero.style.width;\n \n //genero las casillas para jugar\n for(var i=0; i<filas; i++){\n for(var j=0; j<columnas; j++){\n \n //dimension de las casillas\n let dimensionX=100/columnas;\n let dimensionY=dimensionX;\n\n //creacion de las casillas\n var casilla=document.createElement(\"div\");\n casilla.id=\"casilla\"+i+j;\n casilla.className=\"casilla\";\n casilla.style.display=\"flex\";\n casilla.style.float=\"left\";\n casilla.style.width=dimensionX+\"%\";\n casilla.style.height=dimensionY+\"%\";\n casilla.innerText=\" \";\n if ((i+j)%2==0){\n casilla.style.background=\"khaki\";\n }else{\n casilla.style.background=\"lightpink\";\n }\n // vinculo las casillas con el tablero\n tablero.appendChild(casilla);\n };\n \n };\n //vinculo el tablero con el contenedor\n contenedor.appendChild(tablero);\n return;\n}", "title": "" }, { "docid": "8e7d75d773d73c857327cb27004a7920", "score": "0.59628105", "text": "function pintaTablero(){\nfor(var i = 0; i<tablero.length; i++){\n fila = document.createElement(\"div\");\n fila.classList.add(\"fila\");\n for(var j = 0; j<tablero[i].length; j++){\n casilla = document.createElement(\"div\");\n casilla.innerHTML = tablero[i][j];\n casilla.classList.add(\"casilla\")\n fila.appendChild(casilla);\n }\n divTablero.appendChild(fila);\n}\n}", "title": "" }, { "docid": "a299969b57924afccac0cd5a15c1773e", "score": "0.5962501", "text": "function displaySubTable(data, modalLink, lectureLink) {\n data = JSON.parse(data)[0];\n var table = '<table class=\"table table-hover table-condensed\"><thead><tr>' +\n '<th>ID</th>' +\n '<th>Pradžios data</th>' +\n '<th>Pabaigos data</th>' +\n '<th>Dėstytojas</th>' +\n '<th>Dienos</th>' +\n '<th>Paskaitos</th>' +\n '<th>Veiksmai</th>' +\n '</tr></thead><tbody>';\n var length = data.length;\n for (var i = 0; i < length; i++) {\n dayStart = weekdays()[data[i].DateStartWeekday];\n dayEnd = weekdays()[data[i].DateEndWeekday];\n\n table += '<tr><td>' + data[i].id + '</td>';\n table += '<td>' + data[i].DateStart + '&nbsp;<span class=\"label label-default\">' + dayStart + '</span></td>';\n table += '<td><date>' + data[i].DateEnd + '&nbsp;<span class=\"label label-default\">' + dayEnd + '</span></td>';\n table += '<td>' + data[i].Professor + '</td>';\n table += '<td>';\n table += data[i].msg;\n if (data[i].IsMonday == 1)\n table += '&nbsp;<span class=\"label label-default\">Pr</span>';\n if (data[i].IsTuesday == 1)\n table += '&nbsp;<span class=\"label label-default\">An</span>';\n if (data[i].IsWedneday == 1)\n table += '&nbsp;<span class=\"label label-default\">Tr</span>';\n if (data[i].IsThurday == 1)\n table += '&nbsp;<span class=\"label label-default\">Kt</span>';\n if (data[i].IsFriday == 1)\n table += '&nbsp;<span class=\"label label-default\">Pn</span>';\n if (data[i].IsSaturday == 1)\n table += '&nbsp;<span class=\"label label-default\">Št</span>';\n if (data[i].IsSunday == 1)\n table += '&nbsp;<span class=\"label label-default\">Sk</span>';\n if (data[i].IsChosen == 1)\n table += '&nbsp;<span class=\"label label-info\">Pasirenkamasis</span>';\n table += '</td>';\n table += '<td>' + data[i].lecture_count + '</td>';\n table += '<td><a href=\"#\" class=\"btn btn-xs btn-primary modalwin\" data-modal-title=\"Paskaitos\"' +\n ' data-modal-width=\"800px\" data-modal-url=\"' + lectureLink + data[i].id + '\">Peržiūrėti paskaitas</a>';\n table += '&nbsp;<a href=\"#\" class=\"btn btn-xs btn-danger\" role=\"button\">Trinti</a>';\n table += '</td>';\n table += '</tr>';\n }\n\n table += '</tbody>';\n // Bottom heading.\n //table += '<tfoot><tr><th>ID</th><th>Data</th><th>Laikas</th><th>Dėstytojas</th><th>Audiorija</th><th>Komentarai</th><th></th></tr></tfoot>';\n table += '</table>';\n return table;\n }", "title": "" }, { "docid": "73ac75020d76d7cd42ae3ee72e583320", "score": "0.5962028", "text": "function tablaDinamica(checkboxON) {\n //CHEQUEO SI ES LA CARGA INICIAL O SI ENTRA POR EL CHANGE DE CHECKBOX\n if (checkboxON.length != 0) {\n //TABLA DINAMICA, ENTRA POR EVENTO\n //CABECERA DE LA TABLA\n var row_name = checkboxON;\n var cabecera_1 = $(\"#tCabecera\");\n cabecera_1[\"0\"].innerHTML = \"\";\n row_name.forEach(function (element) {\n if (element != \"\") {\n var cabeceraArmada = $('<th>' + element + '</th>');\n cabecera_1.append(cabeceraArmada);\n }\n });\n var tablaTXT = $(\"#tCuerpoTXT\");\n var ciclo;\n if (tablaAux == null) {\n var primeraVez = 1;\n tablaAux = $(\"#tCuerpoAUX\");\n ciclo = $(\"#tCuerpo\")[0].childNodes.length;\n }\n else {\n ciclo = $(\"#tCuerpoAUX\")[0].childNodes.length;\n tablaTXT[0].innerHTML = \"\";\n }\n for (var i = 0; i < ciclo; i++) {\n //AGREGO LAS COLUMNAS SEGUN VAYAN O NO\n tablaTXT.append(\"<tr>\");\n checkboxON.includes(\"ID\") == true ? tablaTXT.append(\"<td id='mascID\" + i + \"'>\" + $('#mascID' + i)[0].innerHTML + \"</td>\") : null;\n checkboxON.includes(\"NOMBRE\") == true ? tablaTXT.append(\"<td id='mascNOM\" + i + \"'>\" + $('#mascNOM' + i)[0].innerHTML + \"</td>\") : null;\n checkboxON.includes(\"EDAD\") == true ? tablaTXT.append(\"<td id='mascEDAD\" + i + \"'>\" + $('#mascEDAD' + i)[0].innerHTML + \"</td>\") : null;\n checkboxON.includes(\"TIPO\") == true ? tablaTXT.append(\"<td id='mascTIPO\" + i + \"'>\" + CambioTipo(Clases.tipoMascota[$(\"#mascTIPO\" + i)[0].innerHTML]) + \"</td>\") : null;\n checkboxON.includes(\"CANTPATAS\") == true ? tablaTXT.append(\"<td id='mascPATAS\" + i + \"'>\" + $('#mascPATAS' + i)[0].innerHTML + \"</td>\") : null;\n tablaTXT.append(\"</tr></table>\");\n }\n var tablaFinal = $(\"#tCuerpo\");\n var innerHtmlAux = tablaFinal[\"0\"].innerHTML;\n tablaFinal[\"0\"].innerHTML = \"\";\n tablaFinal[\"0\"].innerHTML = tablaTXT[\"0\"].innerHTML;\n if (primeraVez == 1) {\n tablaAux[\"0\"].innerHTML = innerHtmlAux;\n }\n }\n else {\n //TABLA ENTERA, VIENE POR EL LOAD DE LA PAGINA\n //CABECERA DE LA TABLA\n var cabecera = $(\"#tCabecera\");\n cabecera[\"0\"].innerHTML = \"\";\n var devuelve = \"<th>ID</th>\" +\n \"<th>NOMBRE</th>\" +\n \"<th>EDAD</th>\" +\n \"<th>TIPO</th>\" +\n \"<th>CANTPATAS</th>\";\n cabecera.append(devuelve);\n //CUERPO DE LA TABLA\n mostrarMascotas();\n }\n}", "title": "" }, { "docid": "aacfcd1a82af2dd222bcd191bf687a55", "score": "0.5955671", "text": "function crearTabla() {\n var cantColumns = 0;\n var cont1 = 0;\n var cont2 = 0;\n var cont3 = 0;\n var IdReporteDiario = $('#idRptD').val();\n\n $.ajax({\n url: \"../listandoCargasPulper/\" + IdReporteDiario,\n async: true,\n success: function(json) {\n var cantColumns=0;\n if (json != 'FALSE') { \n var obj = $.parseJSON(json); var insumos = new Array(); var array = new Array();\n for (var i=0; i< obj.datos.length; i++) {\n insumos = obj.datos[i]['insumos']; \n }\n var html = '<table class=\"striped\" id=\"tblCargasPulper\"><thead>';\n html += '<tr class=\"tblcabecera\"><th>TIPO DE FIBRA (KG)</th>';\n\n var cont = obj.datos[0]['totalFilas'];\n for (var i = 0; i < cont; i++) {\n html += '<th>' + (cantColumns = cantColumns + 1) + '</th>';\n }\n html += '</tr></thead>';\n html += '<tbody>';\n for (var i = 0; i < insumos.length; i++) {\n var nombreTemp=insumos[i]['Descripcion']; \n html += '<tr><td>' + insumos[i]['Descripcion'] + '</td>';\n for (var e = 0; e < obj.datos.length; e++) {\n if (nombreTemp == obj.datos[e]['Descripcion']) { \n html += '<td><input class=\"inputCP numeric\" id=\"cargaN' + obj.datos[e]['IdCargaPulper'] + '\" onchange=\"actualizandoCargasPulper(' + obj.datos[e]['IdCargaPulper'] + ', ' + obj.datos[e]['IdReporteDiario'] + ' ,this.value)\" value=\"' + obj.datos[e]['Cantidad'] + '\"/></td>';\n };\n }\n };\n html += '</tr>';\n html += '</tbody></table>';\n $(\"#btnAgregarf\").after(html);\n $('#ocultar').hide();\n \n }\n }\n });\n}", "title": "" }, { "docid": "8f8ede4196c73972bdbc8fc24a134347", "score": "0.5951746", "text": "function generarTablero( horizontal, vertical ) {\n\n var tablero = new Array();\n for ( var i = 0; i < horizontal; i++ ) {\n\n tablero[ i ] = new Array();\n for ( var j = 0; j < vertical; j++ ) {\n tablero[ i ][ j ] = aleatorio( 0, 1 ); //: Genera aleatoriamente las bombas y las inserta en el tablero.\n \t\t //: 1 = Bomba / 0 = No hay bomba\n }\n }\n\n return tablero;\n}", "title": "" }, { "docid": "7c0f44d3c3bb1ce338729acbf234ff81", "score": "0.5951504", "text": "function makeTable(){\n\tvar table = \"\";\n\tvar rowEnd = \"</tr>\";\n\tvar tableDataStart = \"<td>\";\n\tvar tableDataEnd = \"</td>\";\n\tfor(var i = 1; i < 6; i++){\n\t\tvar rowStart = \"<tr id = 'levelNUM00'><th>level LEL00+</th>\";\n\t\trowStart = rowStart.replace(\"LEL\", i);\n\t\ttable+=rowStart.replace(\"NUM\", i);\n\t\tfor(var key in course_list){\n\t\t\tvar values = course_list[key];\n\t\t\t//console.log(\"values: \", values);\n\t\t\tif(Number(key[0]) === i){\n\t\t\t\ttable+=(tableDataStart.replace(\"courseNum\", key));\n\t\t\t\ttable+=courseBtn(key);\n\t\t\t\ttable+=tableDataEnd;\n\t\t\t}\n\t\t}\n\t\ttable+=rowEnd;\n\n\t}\n\tdocument.write(\"<table>\" + table + \"</table>\");\n}", "title": "" }, { "docid": "75e98c3f6280f0e6d17c4d2a4238a92a", "score": "0.59464663", "text": "function tabAtGlance() {\n var table = document.getElementById(\"tableAtGlance\");\n document.getElementById(\"tableAtGlance\").innerHTML = \"\"\n for (var i = 0; i < 1; i++) {\n var row = document.createElement(\"tr\");\n\n //FIRST TR\n var partyCell = document.createElement(\"td\");\n var numRepre = document.createElement(\"td\");\n var votedCell = document.createElement(\"td\");\n\n var party = \"Democrats\";\n partyCell.append(party);\n\n var repre = statistics.numberOfDemocrats;\n numRepre.append(repre);\n\n var voted = statistics.democratsPartyPercentage.toFixed(2);\n votedCell.append(voted);\n\n row.append(partyCell);\n row.append(numRepre);\n row.append(votedCell);\n\n table.append(row);\n\n //SECOND TR\n var row = document.createElement(\"tr\");\n\n var partyCell = document.createElement(\"td\");\n var numRepre = document.createElement(\"td\");\n var votedCell = document.createElement(\"td\");\n\n var party = \"Republicans\";\n partyCell.append(party);\n\n var repre = statistics.numberOfRepublicans;\n numRepre.append(repre);\n\n var voted = statistics.republicanPartyPercentage.toFixed(2);\n votedCell.append(voted);\n\n row.append(partyCell);\n row.append(numRepre);\n row.append(votedCell);\n\n table.append(row);\n\n //THIRD TR\n var row = document.createElement(\"tr\");\n\n var partyCell = document.createElement(\"td\");\n var numRepre = document.createElement(\"td\");\n var votedCell = document.createElement(\"td\");\n\n var party = \"Independents\";\n partyCell.append(party);\n\n var repre = statistics.numberOfIndependents;\n numRepre.append(repre);\n\n var voted = statistics.independentPartyPercentage.toFixed(2);\n votedCell.append(voted);\n\n row.append(partyCell);\n row.append(numRepre);\n row.append(votedCell);\n\n table.append(row);\n\n //FOURTH TR\n var row = document.createElement(\"tr\");\n\n var partyCell = document.createElement(\"td\");\n var numRepre = document.createElement(\"td\");\n var votedCell = document.createElement(\"td\");\n\n var party = \"Total\";\n partyCell.append(party);\n\n var repre = statistics.numberOfIndependents + statistics.numberOfRepublicans + statistics.numberOfDemocrats;\n numRepre.append(repre);\n\n var voted = (statistics.independentPartyPercentage + statistics.republicanPartyPercentage + statistics.democratsPartyPercentage) / 3;\n votedCell.append(voted.toFixed(2));\n\n row.append(partyCell);\n row.append(numRepre);\n row.append(votedCell);\n\n table.append(row);\n }\n}", "title": "" }, { "docid": "36daba21b56860e94321753fd9444028", "score": "0.5946178", "text": "function create_table(data,tipo){\n var description=(tipo==0)?'Montos':'Plazos';\n var tipo_dato=(tipo==0)?'monto':'plazo';\n\n var html=\"\";\n\t\thtml+=\"<table class='table table-bordered'>\";\n\t\thtml+=\"<thead>\";\n\t\t\thtml+=\"<tr>\";\n\t\t\t\thtml+=\"<th>\"+description+\"</th>\";\n html+=\"<th>Acciones</th>\";\n\t\t\t\thtml+=\"</tr>\";\n\t\t\thtml+=\"</thead>\";\n\t\t\t html+=\"<tbody >\";\n if(data.length == 0){\n html+=\"<tr>\";\n html+=\"<td colspan='2'>No hay \"+description+\" registrados</td>\";\n html+=\"</tr>\";\n }else{\n for(var x=0;x<data.length;x++){\n html+=\"<tr data-id='\"+data[x]['id']+\"' data-\"+tipo_dato+\"='\"+data[x][tipo_dato]+\"' data-tipo='\"+tipo+\"'>\";\n html+=\"<td>\"+data[x][tipo_dato]+\"</td>\";\n html+=\"<td>\";\n html+=\"<div class='dropdown'>\";\n html+=\"<button class='btn btn-secondary dropdown-toggle' type='button' id='dropdownMenuButton1' data-bs-toggle='dropdown' aria-expanded='false'>Selecciona </button>\";\n html+=\"<ul class='dropdown-menu' aria-labelledby='dropdownMenuButton1'>\";\n html+=\"<li class='dropdown-item borrar'>Borrar</li>\";\n html+=\"</ul>\";\n html+=\"</div>\";\n html+=\"</td>\";\n html+=\"</tr>\";\n }\n }\n\t\t\t\n\t\t\thtml+=\"</tbody>\";\n\t\thtml+=\"</table>\";\n $(\"#information_\"+tipo_dato+\"\").html(html);\n }", "title": "" }, { "docid": "a0bf685e0dd597eed19e1682d4a896da", "score": "0.5935468", "text": "function cheatTable(cardsArr) {\n var tabularLog= [];\n var tempArr = [];\n var tempCount;\n var cards = cardsArr;\n\n var cardsTable = cards.forEach(function(card, ind) {\n\n tempCount = ind + 1;\n\n if ( (tempCount % 4) === 0 ) {\n tempArr.push(card);\n tabularLog.push(tempArr);\n tempArr = [];\n } else {\n tempArr.push(card);\n }\n\n });\n\n return tabularLog;\n }", "title": "" }, { "docid": "bf026754491f4f42b127cfdea6941626", "score": "0.591863", "text": "function elaborarTablaErrores(listaErrores) {\n document.write(\"<table>\");\n\n document.write(\"<tr>\");\n document.write(\"<th>CADENA</th>\");\n document.write(\"<th>FILA</th>\");\n document.write(\"<th>COLUMNA</th>\");\n document.write(\"</tr>\");\n\n for (var i = 0; i < listaErrores.length; i++) {\n\n document.write(\"<tr>\");\n document.write(\"<td>\" + listaErrores[i].lexema + \"</td>\");\n document.write(\"<td>\" + listaErrores[i].fila + \"</td>\");\n document.write(\"<td>\" + listaErrores[i].columna + \"</td>\");\n document.write(\"</tr>\");\n\n }\n\n document.write(\"</table>\");\n}", "title": "" }, { "docid": "467df9b0c9077ec55a47c2ef320519f4", "score": "0.59126216", "text": "function setData() {\n\tvar rows = db.execute('SELECT * FROM sermao GROUP BY titulo ');\n\tvar dataArray = [];\n\n\twhile (rows.isValidRow()) {\n\t\tvar vnome = rows.fieldByName('titulo');\n\t\tvar vid = rows.fieldByName('id');\n\t\tdataArray.push({\n\t\t\ttitle : vnome,\n\t\t\thasCheck : false,\n\t\t\tid : vid,\n\t\t\tcolor : '#245553',\n\t\t\tfont : {\n\t\t\t\tfontSize : 16\n\t\t\t}\n\t\t});\n\t\trows.next();\n\t\ttableview.setData(dataArray);\n\t};\n\n}", "title": "" }, { "docid": "c3a799087a56506c9bc7b5d7bcc1cac8", "score": "0.5910758", "text": "function crearTabla(){\n\t\n\t// Creamos la tabla\n\tvar tabla = document.createElement(\"TABLE\");\n\n\tvar numeroUnico=1;\n\t\n\tfor(var i=0;i<100;i++){\n\t\t// Creamos un elemento TR\t\t\n\t\tvar fila=document.createElement(\"TR\");\n\t\tfor(var j=0;j<100;j++){\n\t\t\t// Creamos TD y texto\n\t\t\tvar celda=document.createElement(\"td\");\n\t\t\tvar texto=document.createTextNode(numeroUnico);\n\t\t\t// Anexamos texto al TD\n\t\t\tcelda.appendChild(texto);\n\t\t\t// anexamos el TD al TR\n\t\t\tfila.appendChild(celda);\n\t\t\t\n\t\t\t// Si es casi primo, cambiamos el fondo\n\t\t\tif(esCasiPrimo(numeroUnico)){\n\t\t\t\tcelda.style.backgroundColor=\"Yellow\";\n\t\t\t}\n\t\t\t\n\t\t\t// Incrementamos el numero unico\n\t\t\tnumeroUnico++;\n\t\t\t\n\t\t}\n\t\t// Anexamos el TR a la tabla\n\t\ttabla.appendChild(fila);\n\t}\n\t// Anexamos la tabla al body\n\tdocument.body.appendChild(tabla);\n\t\n}", "title": "" }, { "docid": "74b6c50dd7ca05c704e3feb87e5a4fe1", "score": "0.59057665", "text": "function tableauHTML(lignes, agenda, jours, firstDay) {\n\n // boucle sur tableau html pour avoir trs et th et tds\n let j = 0;\n\n for (let l = 0; l < lignes; l++) {\n\n let nbrTD = agenda.rows[l].cells.length;\n\n for (t = 0; t < nbrTD; t++) {\n\n // entete tableau\n if (l != 0) {\n\n j++;\n if(firstDay === 0){ // dimanche\n\n // 1ere ligne tr\n if (l == 1) {\n\n j++;\n\n\n if(t <= 5 ){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n }\n\n if( t == 6){\n\n j=1;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n\n }\n\n \n }\n\n\n }\n\n if(firstDay === 1){ // lundi\n\n // 1ere ligne tr\n if (l == 1) {\n\n // 1ere colonne td\n ecritureTableau(t, j, agenda.rows[l].cells[t], jours)\n }\n\n }\n\n if(firstDay === 2){ // mardi\n\n // 1ere ligne tr\n if (l == 1) {\n\n if(t == 0 ){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n }\n\n if( t == 1){\n\n j=1;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n\n }\n\n if(t > 1){\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n \n }\n\n }\n\n if(firstDay === 3){ // mercredi\n\n // 1ere ligne tr\n if (l == 1) {\n\n if(t == 0 ){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n }\n\n if( t == 1){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n\n }\n\n if(t == 2){\n j=1;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if(t > 2){\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n \n }\n\n }\n\n\n if(firstDay === 4){ // jeudi\n\n // 1ere ligne tr\n if (l == 1) {\n\n if(t <= 2 ){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n }\n\n if( t == 3){\n j=1;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n\n }\n\n if(t > 3){\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n \n }\n\n }\n\n //\n if(firstDay === 5){ // vendredi\n //console.log(firstDay);\n\n\n // 1ere ligne tr\n if (l == 1) {\n\n if(t <= 3 ){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n }\n\n if( t == 4){\n j=1;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n\n }\n\n \n if( t > 4){\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n \n }\n\n\n } \n\n if(firstDay === 6){ // samedi\n\n // 1ere ligne tr\n if (l == 1) {\n\n if(t <= 4 ){\n ecrireJours(agenda.rows[l].cells[t], j, \"\");\n }\n\n if( t == 5){\n j=1;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n\n }\n\n if(t == 6){\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n \n }\n\n }\n\n\n // 2eme ligne tr\n if (l == 2) {\n \n // 1ere colonne td\n if (t == 0) {\n //agenda.rows[l].cells[t].innerHTML = j;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 1) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 2) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 3) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 4) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 5) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 6) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n\n }\n\n // 3eme ligne tr\n if (l == 3) {\n\n // 1ere colonne td\n if (t == 0) {\n //agenda.rows[l].cells[t].innerHTML = j;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 1) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 2) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 3) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 4) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 5) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 6) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n }\n\n // 4eme ligne tr\n if (l == 4) {\n\n // 1ere colonne td\n if (t == 0) {\n //agenda.rows[l].cells[t].innerHTML = j;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 1) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 2) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 3) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 4) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 5) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 6) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n }\n\n // 5eme ligne tr\n if (l == 5) {\n\n // 1ere colonne td\n if (t == 0) {\n //agenda.rows[l].cells[t].innerHTML = j;\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 1) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 2) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 3) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 4) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 5) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n if (t == 6) {\n ecrireJours(agenda.rows[l].cells[t], j, jours);\n }\n\n }\n\n }\n\n }\n\n }\n\n\n}", "title": "" }, { "docid": "061f5ec79827ff47355203cd1e07f25b", "score": "0.59028363", "text": "encabezadoTabla(titulos){\n return titulos.map((titulo, ix) => <th key={ix}>{titulo}</th>);\n \n }", "title": "" }, { "docid": "c480ec9e92c69d3d178b2f8ce1cebc8e", "score": "0.5897559", "text": "function fillTable(values) {\n for (let row = 1; row <= NPAGES; row++) {\n for (let col = 1; col <= NPAGES; col++) {\n let id = row + \".\" + col;\n let element = document.getElementById(id);\n element.innerHTML = values[row - 1][col - 1];\n if (element.innerHTML == 1) {\n element.classList.add(\"active\");\n }\n }\n }\n }", "title": "" }, { "docid": "de38d3ff5f2ff5f604521a7abefe3024", "score": "0.58955365", "text": "function populateNewton1Table(){\r\n const newton1Table = document.querySelector(\"#newton1Table\")\r\n for(let i =0; i < newton1X.length; i++){\r\n const newton1Row = document.createElement('tr')\r\n\r\n const newton1RowIter = document.createElement('th')\r\n newton1RowIter.appendChild(document.createTextNode(i))\r\n const newton1Rowxk = document.createElement('td')\r\n newton1Rowxk.appendChild(document.createTextNode(newton1X[i].toFixed(9)))\r\n\r\n \r\n newton1Row.appendChild(newton1RowIter)\r\n newton1Row.appendChild(newton1Rowxk)\r\n newton1Table.appendChild(newton1Row)\r\n }\r\n}", "title": "" }, { "docid": "7e73f350472e0780d0564a97e2851661", "score": "0.58899784", "text": "tablaAutos(){\n return (\n <Table dark >\n <thead>\n <tr>\n {this.encabezadoTabla([\n \"Marca\",\n \"Modelo\",\n \"Categoria\",\n \"Ctdad Puertas\",\n \"Precio\"\n ])}\n </tr> \n </thead>\n <tbody>\n {this.state.listaDeAutos.map(auto => this.infoAuto(auto))}\n </tbody>\n </Table> \n );\n }", "title": "" }, { "docid": "362849892da8d3306d17d3dab6ba2294", "score": "0.5887978", "text": "function setTable(top5, probs) {\n for (var i = 0; i < top5.length; i++) {\n let sym = document.getElementById(\"sym\" + (i + 1));\n let prob = document.getElementById(\"prob\" + (i + 1));\n sym.innerHTML = top5[i];\n prob.innerHTML = Math.round(probs[i] * 100);\n }\n createPie(\".pieID.legend\", \".pieID.pie\");\n }", "title": "" }, { "docid": "3615ae42f25041a7b7bb17f0fcc0827d", "score": "0.5885534", "text": "tulostaData2() {\n // split komento state merkkijonolle\n // let elements = this.state.kaikki_viestit.split(\"*\");\n\n const rows = [];\n\n this.state.kaikki_viestit.forEach((tViestit) => {\n const elements = tViestit.split('*');\n\n /*\n rows.push(\n <TableRow>\n <TableCell> Käyttäjä </TableCell>\n <TableCell> Aika </TableCell>\n <TableCell> Viesti </TableCell>\n </TableRow>\n );\n */\n const tempStyle = { fontSize: 18, color: 'blue' };\n /*\n if(elements[0] == \"User1\" ){ temp_style = { fontSize: 18, color: 'blue' } }\n else if(elements[0] == \"User2\"){ temp_style = { fontSize: 18, color: 'red' } }\n else if(elements[0] == \"User3\"){ temp_style = { fontSize: 18, color: 'green' } }\n else { temp_style = { fontSize: 18, color: 'orange' } }\n */\n\n rows.push(\n <TableRow>\n <TableCell style={tempStyle}> { elements[0] } </TableCell>\n <TableCell> { elements[1] } </TableCell>\n <TableCell style={tempStyle}> { elements[2] } </TableCell>\n </TableRow>,\n );\n });\n\n\n return <div> <Table> <TableBody> { rows } </TableBody> </Table> </div>;\n }", "title": "" }, { "docid": "75114e315b403746cede93422a0b3c25", "score": "0.58835703", "text": "function dibujarTabla(_listaPeliculas) {\n //traigo el cuerpo de la tabla como objeto\n let tabla = document.getElementById(\"tablaPeli\");\n\n //limpio los elementos hijos\n tabla.innerHTML = \"\";\n\n //\n let filas;\n\n for (let i in _listaPeliculas) {\n filas = `<tr>\n <td>${_listaPeliculas[i].codigo}</td>\n <td>${_listaPeliculas[i].nombre}</td>\n <td>${_listaPeliculas[i].categoria}</td>\n <td>\n ${_listaPeliculas[i].descripcionPelicula}\n </td>\n <td>${_listaPeliculas[i].imagen}</td>\n <td class=\"text-center\"><input type=\"checkbox\" /></td>\n <td class=\"text-center\">\n <button class=\"btn btn-sm\" onclick=\"eliminarPeli(this)\" id=\"${_listaPeliculas[i].codigo}\">\n <i class=\"fas fa-trash-alt\"></i>\n </button>\n <button class=\"btn btn-sm\" onclick=\"prepararPeli(this)\" id=\"${_listaPeliculas[i].codigo}\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-sm\" onclick=\"\" id=\"${_listaPeliculas[i].codigo}\">\n <i class=\"fas fa-star\"></i>\n </button>\n </td>\n </tr>`;\n\n tabla.innerHTML += filas;\n }\n}", "title": "" }, { "docid": "1f4c196ee8a4231644b73a82dac3dd44", "score": "0.5876204", "text": "function createTable(dp){\n $(\"#tab\").append('<div id=\"tableTitle\"></div>');\n $(\"#tab\").append('<div id=\"tableContent\"></div>');\n var htmlString = '<table>';\n\t\t\t\t//Header\n htmlString = htmlString + '<tr class=\"tableHeading\"><td>' + actTheme.tableSettings.heading + '</td>';\n\t\t\t\tfor (var i = 0; i < dp.length; i++) {\n\t\t\t\t\t//Only for those years that are in timeStop array\n\t\t\t\t\tif(actTheme.timeStops.indexOf(dp[i][\"year\"].toString())!=-1){\n\t\t\t\t\t\thtmlString = htmlString + '<td class=\"' + dp[i][\"year\"] + '\">' + dp[i][\"year\"] + '</td>';\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Rows\n htmlString = htmlString + '</tr>';\n for (var keyTitle in actTheme.tableSettings.fieldMap){\n htmlString = htmlString + '<tr><td class=\"tableRowId\">' + actTheme.tableSettings.fieldMap[keyTitle] + '</td>';\n for (var i = 0; i < dp.length; i++) {\n\t\t\t\t\t\t//Only for those years that are in timeStop array\n\t\t\t\t\t\tif(actTheme.timeStops.indexOf(dp[i][\"year\"].toString())!=-1){\n\t\t\t\t\t\t\tvar cValue = checkRounding(dp[i][keyTitle],actTheme.tableSettings.dataPrecision);\n\t\t\t\t\t\t\thtmlString = htmlString + '<td class=\"' + dp[i][\"year\"] + '\">' + cValue + '</td>';\n\t\t\t\t\t\t\tif(i == dp.length - 1){\n\t\t\t\t\t\t\t\thtmlString = htmlString + '</tr>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n }\n }\n htmlString = htmlString + '</table>';\n $(\"#tableContent\").html(htmlString);\n $(\"#tableTitle\").html(actTheme.tableSettings.title);\n colorTable();\n }", "title": "" }, { "docid": "d7896506ceef4a97d41162219673a2d3", "score": "0.5876044", "text": "function create_tab(){\r\n //everytime a new tab is created, i do the input_and_table() over and over again.\r\n var min_col = parseInt(document.getElementById(\"min_col\").value);\r\n var max_col = parseInt(document.getElementById(\"max_col\").value);\r\n var min_row = parseInt(document.getElementById(\"min_row\").value);\r\n var max_row = parseInt(document.getElementById(\"max_row\").value);\r\n\r\n var temp1, temp2;\r\n var mult_table = \"\";\r\n\r\n //this gets outline of a table for data\r\n mult_table += \"<table class='table_2'>\";\r\n\r\n // first for loop which goes through the rows\r\n for (temp1 = min_row - 1; temp1 <= max_row; temp1++) {\r\n mult_table = mult_table + \"<tr>\"; //for each temp1++, add a space\r\n\r\n //this is to make sure there is a blank space and so the row/col axises show up\r\n if (temp1 == min_row - 1) {\r\n mult_table = mult_table + \"<td>☺️</td>\";// <td></td> creates empty space\r\n\r\n //second for loop which goes through columns if the condiiton above is true\r\n for (temp2 = min_col; temp2 <= max_col; temp2++) {\r\n mult_table = mult_table + \"<td>\" + temp2 + \"</td>\";//adds a space, temp2 value, then goes onto next\r\n }\r\n }\r\n\r\n // if you dont need to check the min_row-1\r\n else {\r\n mult_table = mult_table + \"<td>\" + temp1 + \"</td>\";\r\n //secpmd for loop for min col\r\n for (temp2 = min_col; temp2 <= max_col; temp2++) {\r\n mult_table = mult_table + \"<td>\" + temp1 * temp2 + \"</td>\";//this does the multiplying of the table. this is after the row/col axis has been created\r\n }\r\n }\r\n\r\n mult_table = mult_table + \"</tr>\";//ends the table\r\n }\r\n\r\n //index for the sliders, keeps track of index\r\n var index = $(\"div#tabs ul li\").length + 1;\r\n\r\n //this adds the tabs together, >Tab will do Tab +1 so Tab 2, etc also adds checkboxes to new created tabs\r\n $(\"div#tabs ul\").append(\r\n \"<li><a href='#tab\" + index + \"'>Tab \" + index + \"</a><input type='checkbox' class='tabCheckBox'></li>\"\r\n );\r\n\r\n //this puts info into tab, i call mult table for data from function\r\n $(\"div#tabs\").append(\r\n \"<div id='tab\" + index + \"'>\" + mult_table + \"</div>\"\r\n );\r\n\r\n //resets tab\r\n $(\"div#tabs\").tabs(\"refresh\");\r\n}", "title": "" }, { "docid": "0220ba00ea4ac849a9f2b4d3192ed723", "score": "0.5875261", "text": "function createTabDP(){\n var tabDP = [];\t\t\n var json;\n actFeatureSet.features.forEach(function(entry) {\n json = {};\n json[\"year\"] = entry.attributes[actTheme[\"timeField\"]];\n\n for (var key in entry.attributes){\n for (var keyTitle in actTheme[\"tableSettings\"].fieldMap) {\n if(key == keyTitle){\n json[keyTitle] = entry.attributes[key];\n }\n }\n }\n tabDP.push(json);\t\t\t\t\n });\n\n //Reorder prepared dataset by time\n var tabOrderedDP = orderArrayByAttribute(tabDP, \"year\", actTheme.tableSettings.sorting);\n createTable(tabOrderedDP);\n }", "title": "" }, { "docid": "745e996b624aead4498edbb5746ed5f5", "score": "0.5868765", "text": "function tabla() {\n var value = document.getElementById('ordenTitulo').value;\n console.log(value)\n var totalPrice = []\n var suma = 0;\n let i = 0;\n for (let dato of ordenDetalles) {\n console.log(dato)\n if (dato.number === value) {\n contenido.innerHTML = ''\n for (let valor of dato.items) {\n\n i += 1\n contenido.innerHTML += `\n <tr id=\"${dato.number}tr\">\n <th scope=\"row\"> ${i} </th>\n <td> ${valor.sku} </td>\n <td> ${valor.name} </td>\n <td> ${valor.quantity} </td>\n <td> ${valor.price} </td>\n </tr>\n `\n totalPrice.push(valor.price)\n }\n break\n }\n }\n totalPrice.forEach(element => {\n suma += element;\n });\n total.innerHTML = '$' + suma\n}", "title": "" }, { "docid": "3e70190aa0d8196954a9e3f895b587fc", "score": "0.58652747", "text": "function generateTables(mFileIndex){\r\n\tlet x = 0;\r\n\tfor(let i = 0; i < content.length; i++){\r\n\t\tlet table = document.createElement(\"table\");\r\n\t\ttable.id = \"table\" + i;\r\n\t\ttable.className = \"tables\";\r\n\t\tif(i != 0)table.style.display = \"none\";\r\n\t\t\r\n\t\tlet tr = document.createElement(\"tr\");\r\n\t\tlet td0 = document.createElement(\"td\");\r\n\t\ttd0.className = \"tdh\";\r\n\t\ttd0.innerHTML = \"<div class=\\\"hd0\\\">INDICATOR</div>\";\r\n\t\t\r\n\t\tlet td1 = document.createElement(\"td\");\r\n\t\ttd1.className = \"tdh\";\r\n\t\ttd1.innerHTML = \"<div class=\\\"hd1\\\">AVERAGE SCORE</div>\";\r\n\t\t\r\n\t\tlet td2 = document.createElement(\"td\");\r\n\t\ttd2.className = \"tdh\";\r\n\t\ttd2.innerHTML = \"<div class=\\\"hd1\\\">COMPARATIVE</div>\"; //hd1 is expected, not a mistake\r\n\t\t\r\n\t\ttr.appendChild(td0);\r\n\t\ttr.appendChild(td1);\r\n\t\tif(masterFile)tr.appendChild(td2);\r\n\t\ttable.appendChild(tr);\r\n\t\t\r\n\t\t\r\n\t\tfor(let j = 0; j < content[i].length; j++){\r\n\t\t\tlet tr = document.createElement(\"tr\");\r\n\t\t\tif(j % 2 == 1)tr.style.background = \"#e6e6e6\";\r\n\t\t\tlet critical = Math.abs(data[masterFile ? mFileIndex : 0][x + 1] - averages[x]) >= criticalDifference;\r\n\t\t\tif(critical)tr.style.background = \"#ff8d3b\";\r\n\t\t\t\r\n\t\t\tlet exp = document.createElement(\"td\");\r\n\t\t\texp.className = \"expTd\";\r\n\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\t\t\tdiv.innerHTML = content[i][j];\r\n\t\t\t\r\n\t\t\tlet value = document.createElement(\"td\");\r\n\t\t\tvalue.innerHTML = averages[x] != \"NaN\" ? averages[x] : \"N/A\";\r\n\t\t\tvalue.className = \"valTd\";\r\n\t\t\t\r\n\t\t\tlet compVal = document.createElement(\"td\");\r\n\t\t\t\r\n\t\t\tcompVal.innerHTML = data[masterFile ? mFileIndex : 0][x + 1];\r\n\t\t\tcompVal.className = \"valTd\";\r\n\t\t\t\r\n\t\t\texp.appendChild(div);\r\n\t\t\ttr.appendChild(exp);\r\n\t\t\ttr.appendChild(value);\r\n\t\t\tif(masterFile)tr.appendChild(compVal);\r\n\t\t\ttable.appendChild(tr);\r\n\t\t\tx++;\r\n\t\t}\r\n\t\tdocument.getElementById(\"subBoard\").appendChild(table);\r\n\t}\r\n}", "title": "" }, { "docid": "a9647673352e6af97e269cc1a1448e2b", "score": "0.5860505", "text": "function CreateTableForMesCorriente(gastosMensualesJSON, currenMonth) {\n var rows = \"\";\n\n $.each(gastosMensualesJSON.gastosMensuales.Meses, function(mesIndex, mes) {\n if (mesIndex == currenMonth) {\n\n var pagosPaidForThisMonth = [];\n var pagosNotPaidForThisMonth = [];\n $.each(mes.Pagos, function(pagoIndex, pago) {\n pago.ConceptoObject = GetItemByProperty(gastosMensualesJSON.gastosMensuales.Conceptos, \"Concepto\", pago.Concepto);\n if (pago.Vencimiento !== \"\" && (pago.Pagado || pago.EsPagoAnual)) {\n pagosPaidForThisMonth.push(pago);\n } else if (pago.Vencimiento !== \"\" && !(pago.Pagado || pago.EsPagoAnual)) {\n pagosNotPaidForThisMonth.push(pago);\n }\n });\n Sort(pagosPaidForThisMonth, \"Vencimiento\", true, true);\n Sort(pagosNotPaidForThisMonth, \"Vencimiento\", false, false);\n\n $.each(pagosNotPaidForThisMonth, function(pagoIndex, pago) {\n rows = rows + GeneratePagoRow(pago, mes.Mes);\n });\n $.each(pagosPaidForThisMonth, function(pagoIndex, pago) {\n rows = rows + GeneratePagoRow(pago, mes.Mes);\n });\n\n }\n });\n\n $(\"#tbMesCorriente .gm-MonthName\").html(GastosMensuales.MonthName[currenMonth]);\n $(\"#tbMesCorriente\").find(\"tr:gt(1)\").remove();\n $('#tbMesCorriente').append(rows);\n $(\".gm-btunUploadComprobantePago\").each(function(divIndex, div) {\n var filePath = $(div).attr('data-path');\n UploadComprobantePago(filePath, div);\n });\n\n $(\".btn-EditPago\").each(function(index, button) {\n $(button).button().on(\"click\", function() {\n GastosMensuales.EditPago.Open($(this).attr('data-row'), $(this).attr('data-column'));\n }); \n });\n }", "title": "" }, { "docid": "152174f33607993ba6e4d39fd3f59132", "score": "0.5856014", "text": "function llenarTabla(data) {\n var $tabla = $(\"#tblGrupos\");\n $tabla.find(\"tr\").remove();\n\n var fila;\n var i = 1;\n\n\n // var grupos = [\"A\", \"B\", \"C\",\"D\",\"E\",\"F\",\"G\",\"H\"];\n for (var idx in data)\n {\n fila = data[idx];\n\n var html = \"<tr>\"+\n \"<td>\" + i + \"</td>\"+\n \"<td>\" + fila.alufic+ \"</td>\"+\n \"<td>\" + fila.alunom + \"</td>\"+\n \"<td>\" + fila.aluapp + \"</td>\";\n if(fila.aluapm === null)\n html += \"<td></td>\";\n else\n html += \"<td>\" + fila.aluapm + \"</td>\";\n\n html += \"<td>\" + fila.nombcar + \"</td>\"+\n \"<td>\" + fila.letra + \"</td>\"+\n \"<td>\" + fila.alucve + \"</td>\"+\n \"</tr>\";\n $tabla.append(html);\n i++;\n\n\n }\n\n$(\"#tabla1\").show();\nif($('.pagi').length ) // use this if you are using id to check\n{\n $(\".pagi\").remove();\n}\n\n$(\"#tabla1\").simplePagination({\n containerClass: 'pagi',\n perPage: 40,\n previousButtonClass: \"btn btn-danger\",\n nextButtonClass: \"btn btn-danger\",\n previousButtonText: \"Anterior\",\n nextButtonText: \"Siguiente\"\n\n });\n\n}", "title": "" }, { "docid": "a93cf02278d93db82d04e5966c6a9616", "score": "0.5855478", "text": "function createTableAllPeopleWeight()\n \t{\n \t\tvar table = new Array();\n \t\tvar x;\n \t\tfor ( name in votes )\n \t\t{\n \t\t\ttable[name] = new Array();\n \t\t\tfor ( matiere in votes[name] )\n \t\t\t{\n \t\t\t\ttable[name][matiere] = getPeopleVoteValue(matiere, name);\n \t\t\t}\n \t\t}\n\n \t\treturn table;\n \t}", "title": "" }, { "docid": "f623e795b6b32a3889699beb509c29f0", "score": "0.58490664", "text": "function show(data) { \r\n\tlet tab = \r\n\t\t`<tr> \r\n\t\t<th>Date Range</th> \r\n\t\t<th>Horoscope</th> \r\n\t\t<th>Date - Prediction</th> \r\n\t\t</tr>`; \r\n\t\r\n\t// Loop to access all rows \r\n\tfor (let r of data) { \r\n\t\ttab += `<tr> \r\n\t<td>${r.id}</td> \r\n\t<td>${r.horoscope}</td> \r\n\t<td>${r.prediction}</td> \t \r\n</tr>`; \r\n\t} \r\n\t// Setting innerHTML as tab variable \r\n\tdocument.getElementById(\"horoscope\").innerHTML = tab; \r\n}", "title": "" }, { "docid": "77450ed2b4d2c1e3d11f9a5950f06bc1", "score": "0.58484876", "text": "function createTable() {\n\tvar str = \"<table class='table table-hover'><thead><tr><th>Тип товара</th><th>Наименование</th><th>Модель</th><th>Цена</th><th>Заказчик</th></tr></thead><tbody>\";\n\t\n\t// loop through an array 'tableArr'\n\t\tfor( var i = 0; i < tableArr.length; i++ ) { \n\t\t\tstr+= \"<tr>\";\t\n\t\t\t\n\t\t\tstr+=\"<td>\"+tableArr[i].type+\"</td>\"+\"<td>\"+tableArr[i].name+\"</td>\"+\"<td>\"+tableArr[i].model+\"</td>\"+\"<td>\"+tableArr[i].price+\"</td>\"+\"<td>\"+tableArr[i].customer+\"</td>\";\n\t\t\n\t\t\tstr+=\"</tr>\";\n\t\t}\n\t\t\tstr+= \"</tbody></table>\";\n\t\t\t\t\n\t\t\t$('#table').html(str);\n\t\t\t$('.showTable').show();\n}", "title": "" }, { "docid": "bdc341560fd0ea2be032e0c2bc984bd4", "score": "0.58472705", "text": "function tabularize(list) {\r\n\t\t//get the type of list\r\n\t\tvar listType = list.qInfo.qType;\r\n\r\n\t\t//use list type to create variable to hold the data array\r\n\t\tvar listData = list['q' + listType].qItems;\r\n\r\n\t\t//allows for setting of the header depending on type of list passed in since FieldList is structured differently\r\n\t\tvar firstHeader;\r\n\r\n\t\tvar html = '';\r\n\r\n\t\t//sets the appropriate header for first column since FieldList does not have qInfo.qType\r\n\t\tif(listType !== \"FieldList\") {\r\n\r\n\t\t\t//this if check is necessary to remove the word List from the header if the dataset is empty\r\n\t\t\tif(listData.length === 0) {\r\n\t\t\t\tvar tempHeader = listType.split('');\r\n\t\t\t\ttempHeader = tempHeader.spliced(tempHeader.length - 4, 4);\r\n\t\t\t\tfirstHeader = tempHeader.join('');\r\n\t\t\t}\r\n\t\t\telse firstHeader = listData[0].qInfo.qType;\r\n\t\t}\r\n\t\telse firstHeader = \"Field\";\r\n\r\n\t\thtml += '<table class=\"col-lg-3 col-md-6 col-xs-12 table table-striped\">';\r\n\r\n\t\t//add the header to the html variable with header labels\r\n\t\thtml += \"<thead><tr><th>\" + firstHeader.toUpperCase() + \"</th><th>ID</th></tr></thead>\";\r\n\r\n\t\t//add the table body\r\n\t\thtml += \"<tbody>\";\r\n\r\n\t\t//iterate over array, and populate the table\r\n\t\tif(listData.length === 0){\r\n\t\t\thtml += \"<tr><td>Sorry, no data of this type is present in the application</td></tr>\";\r\n\t\t}\r\n\r\n\t\t//different properties need to be called on the field list object than the others\r\n\t\tif(listType === \"FieldList\"){\r\n\t\t\t$.each(listData, function(index, value) {\r\n\t\t\t\thtml += \"<tr><td>\" + value.qName + \"</td><td>\" + \"N/A\" + \"</td></tr>\";\r\n\t\t\t});\r\n\t\t//Since field list is different, everything else will go down this path to populate the tables\r\n\t\t}else{\r\n\t\t\t$.each(listData, function(index, value) {\r\n\t\t\t\thtml += \"<tr><td>\" + value.qData.title + \"</td><td>\" + value.qInfo.qId + \"</td></tr>\";\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t//close the table body after adding the rows\r\n\t\thtml += \"</tbody></table>\";\r\n\r\n\r\n\t\t$('#tables').append(html);\r\n\r\n\t}", "title": "" }, { "docid": "662e06d44f15fd8bb09dd8ae236319c4", "score": "0.5842602", "text": "function tabFive(){\r\n\t\tgoogle.charts.load('current', { 'packages': ['table'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawTable);\r\n\t\tfunction drawTable() {\r\n\t\t\tvar data = new google.visualization.DataTable();\r\n\t\t\tdata.addColumn('string', 'Campaña');\r\n\t\t\tdata.addColumn('number', 'Enviados');\r\n\t\t\tdata.addColumn('number', 'Recibidos');\r\n\t\t\tdata.addColumn('number', 'Abiertos');\r\n\t\t\tdata.addColumn('number', 'Clics');\r\n\t\t\tdata.addRows([\r\n\t\t\t['Club tvgo', { v: 783879, f: '783,879' }, { v: 763260, f: '763,260 (97.37%)' }, { v: 14295, f: '14,295' }, { v: 724, f: '724' }],\r\n\t\t\t['Cyber tvgo', { v: 451030, f: '451,030' }, { v: 448856, f: '448,856 (99.52%)' }, { v: 13568, f: '13,568' }, { v: 751, f: '751' }],\r\n\t\t\t['Champions', { v: 41344, f: '41,344' }, { v: 41283, f: '41,283 (99.85%)' }, { v: 2733, f: '2,733' }, { v: 129, f: '129' }],\r\n\t\t\t['Sorteos', { v: 29529, f: '29,529' }, { v: 29481, f: '29,481 (99.84%)' }, { v: 1051, f: '1,051' }, { v: 58, f: '58' }],\r\n\t\t\t['Series', { v: 18496, f: '18,496' }, { v: 18480, f: '18,480 (99.91%)' }, { v: 1672, f: '1,672' }, { v: 31, f: '31' }],\r\n\t\t\t['Vencimiento', { v: 332, f: '332' }, { v: 332, f: '332 (100.00%)' }, { v: 60, f: '60' }, { v: 23, f: '23' }]\r\n\t\t\t]);\r\n\t\t\tvar table = new google.visualization.Table(document.getElementById('table_div4'));\r\n\t\t\ttable.draw(data, { showRowNumber: true, width: '100%', height: '100%' });\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['corechart'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart1);\r\n\t\tfunction drawChart1() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Enviados'],\r\n\t\t\t['Club tvgo', 783879],\r\n\t\t\t['Series', 18496],\r\n\t\t\t['Vencimiento', 332],\r\n\t\t\t['Champions', 41344],\r\n\t\t\t['Sorteos', 29529],\r\n\t\t\t['Cyber tvgo', 451030]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'MAILINGS ENVIADOS POR TIPO CAMPAÑA '\r\n\t\t\t};\r\n\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('piechart4'));\r\n\t\t\tchart.draw(data, options);\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['bar'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart2);\r\n\t\tfunction drawChart2() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Suscriptores', 'No Suscriptores 0', 'No Suscriptores 1'],\r\n\t\t\t['Club tvgo', 12.87, 2.68, 6.77],\r\n\t\t\t['Cyber tvgo', 0, 3.02, 0],\r\n\t\t\t['Champions', 11.96, 5.64, 0],\r\n\t\t\t['Sorteos', 9.19, 2.55, 0],\r\n\t\t\t['Series', 13.06, 7.52, 0],\r\n\t\t\t['Vencimiento', 0, 18.07, 0]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'RATIO DE APERTURA POR TIPO CAMPAÑA (%)',\r\n\t\t\tsubtitle:'No Suscriptores 0: Nunca estuvieron suscritos; No Suscriptores 1: Algunas vez estuvieron suscritos pero, actualmente, no lo están.',\r\n\t\t\t};\r\n\t\t\tvar chart = new google.charts.Bar(document.getElementById('columnchart_material4'));\r\n\t\t\tchart.draw(data, google.charts.Bar.convertOptions(options));\r\n\t\t}\r\n\r\n\t\tgoogle.charts.load('current', { 'packages': ['bar'] });\r\n\t\tgoogle.charts.setOnLoadCallback(drawChart3);\r\n\t\tfunction drawChart3() {\r\n\t\t\tvar data = google.visualization.arrayToDataTable([\r\n\t\t\t['Campaña', 'Suscriptores', 'No Suscriptores 0', 'No Suscriptores 1'],\r\n\t\t\t['Club tvgo', 9.14, 4.78, 2.86 ],\r\n\t\t\t['Cyber tvgo', 0, 5.54, 0],\r\n\t\t\t['Champions', 4.70, 4.73, 0],\r\n\t\t\t['Sorteos', 8.7, 3.45, 0],\r\n\t\t\t['Series', 2.26, 1.59, 0],\r\n\t\t\t['Vencimiento', 0, 38.33, 0]\r\n\t\t\t]);\r\n\t\t\tvar options = {\r\n\t\t\ttitle: 'RATIO DE CLICS POR TIPO CAMPAÑA (%)',\r\n\t\t\tsubtitle:'No Suscriptores 0: Nunca estuvieron suscritos; No Suscriptores 1: Algunas vez estuvieron suscritos pero, actualmente, no lo están.',\r\n\t\t\t};\r\n\t\t\tvar chart = new google.charts.Bar(document.getElementById('columnchart_material8'));\r\n\t\t\tchart.draw(data, google.charts.Bar.convertOptions(options));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6e696ce059294ab085d127de4e249bcf", "score": "0.58392084", "text": "function createTable(n){\n var tabela, i;\n tabela = \" Z: \";\n //preenchendo automaticamente com um exemplo\n tabela += \"<input type='text' size=50 id='z' value=' (x1+x2)**2-(x1+x2+2)'></input><br>Ponto inicial: <br>\";\n for(i=1; i<=n; i++){\n tabela += \"x\" + i + \"<input type='text' value='3' size=1 id='xi\" + i + \"'></input>\"; \n }\n return tabela;\n }", "title": "" } ]
528f492e18a1b85ee481c7e1a414bace
Class for parsed ContentDisposition header for v8 optimization
[ { "docid": "9a756c1fe1a3ceb3583c7fc3b3e20f33", "score": "0.738215", "text": "function ContentDisposition (type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" } ]
[ { "docid": "d30700b335a321f4a43f0405a66d373f", "score": "0.73943967", "text": "function ContentDisposition(type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" }, { "docid": "d30700b335a321f4a43f0405a66d373f", "score": "0.73943967", "text": "function ContentDisposition(type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" }, { "docid": "d30700b335a321f4a43f0405a66d373f", "score": "0.73943967", "text": "function ContentDisposition(type, parameters) {\n this.type = type\n this.parameters = parameters\n}", "title": "" }, { "docid": "6786c70128dda789e6c3963d44e4e41c", "score": "0.7349035", "text": "function ContentDisposition(type, parameters) {\n this.type = type;\n this.parameters = parameters;\n}", "title": "" }, { "docid": "748e65071c8d8136d6674fcb31129982", "score": "0.73272413", "text": "get contentDisposition() {\n return this.getStringAttribute('content_disposition');\n }", "title": "" }, { "docid": "898c962eea26603c918cc3fdc1346dce", "score": "0.72214586", "text": "function ContentDisposition(type, parameters) {\n\t this.type = type\n\t this.parameters = parameters\n\t}", "title": "" }, { "docid": "898c962eea26603c918cc3fdc1346dce", "score": "0.72214586", "text": "function ContentDisposition(type, parameters) {\n\t this.type = type\n\t this.parameters = parameters\n\t}", "title": "" }, { "docid": "898c962eea26603c918cc3fdc1346dce", "score": "0.72214586", "text": "function ContentDisposition(type, parameters) {\n\t this.type = type\n\t this.parameters = parameters\n\t}", "title": "" }, { "docid": "898c962eea26603c918cc3fdc1346dce", "score": "0.72214586", "text": "function ContentDisposition(type, parameters) {\n\t this.type = type\n\t this.parameters = parameters\n\t}", "title": "" }, { "docid": "8b5fd50f3b328e175ba3c1314c8e17de", "score": "0.68294644", "text": "validateDisposition () {\n\t\tAssert.equal(this.httpResponse.headers['x-cs-version-disposition'], this.expectedDisposition, `version disposition should be \"${this.expectedDisposition}\", was \"${this.httpResponse.headers['x-cs-version-disposition']}\"`);\n\t}", "title": "" }, { "docid": "6dc3f38fcea626b7c59f64cc78588806", "score": "0.63061666", "text": "get disposition () {\n\t\treturn this._disposition;\n\t}", "title": "" }, { "docid": "3b6e6084875d965c1f90dd1aff860ace", "score": "0.6170418", "text": "get disposition() {\n\t\treturn this.__disposition;\n\t}", "title": "" }, { "docid": "3b6e6084875d965c1f90dd1aff860ace", "score": "0.6170418", "text": "get disposition() {\n\t\treturn this.__disposition;\n\t}", "title": "" }, { "docid": "0d1fae9d01184c42be0c124753ba07de", "score": "0.5893333", "text": "function contentDisposition(filename) {\n var ret = 'attachment';\n if (filename) {\n // filename = basename(filename);\n // if filename contains non-ascii characters, add a utf-8 version ala RFC 5987\n ret = /[^\\040-\\176]/.test(filename)\n ? 'attachment; filename=\"' + encodeURI(filename) + '\"; filename*=UTF-8\\'\\'' + encodeURI(filename)\n : 'attachment; filename=\"' + filename + '\"';\n }\n\n return ret;\n}", "title": "" }, { "docid": "e8f824dd88fe58c7667b0e0aaa4cd36a", "score": "0.5874535", "text": "function extractFilename(headers) {\n try {\n var value = headers['content-disposition']\n // content-disposition header format: 'attachment; filename=\"some-file-name.ext\"'\n value = value.split(';')[1].split('=')[1].replace(/\"/g, '');\n return value;\n } catch (error) {\n return undefined;\n }\n }", "title": "" }, { "docid": "ca60a05536548ec69dce4585c8e36415", "score": "0.5682215", "text": "get headers() {\n return {\n \"Content-Type\": (0, _concat.default)([\"multipart/form-data; \", \"boundary=\", this.boundary])\n };\n }", "title": "" }, { "docid": "f6f4175bacf140b33656df69a2bb6dcc", "score": "0.5632487", "text": "function setHeaders(res, path) {\n res.setHeader('Content-Disposition', contentDisposition(path));\n}", "title": "" }, { "docid": "eb81c097a635356f166792f2d3028dd8", "score": "0.5617245", "text": "get hdr() {}", "title": "" }, { "docid": "8bfee3ccc24562dd5eb2289444fc0059", "score": "0.55464447", "text": "set hdr(value) {}", "title": "" }, { "docid": "e4b5db2133e17b69eedd67b24c28ab6f", "score": "0.5537693", "text": "function responseHandler(details) {\n let { url } = details;\n // eslint-disable-next-line prefer-destructuring\n const ext = (url = url.substr(1 + url.lastIndexOf('/')).split('?')[0])\n .split('#')[0]\n .substr(url.lastIndexOf('.'));\n if (ext === '.csv' || ext === '.CSV') {\n return {\n responseHeaders: [\n { name: 'content-type', value: 'text/plain' },\n { name: 'content-disposition', value: 'inline' },\n ],\n };\n }\n}", "title": "" }, { "docid": "487994d463d725d26d59f0f42a4410b5", "score": "0.52485645", "text": "attachment(filename) {\n // Check for supplied filename/path\n let name =\n typeof filename === 'string' && filename.trim().length > 0\n ? path.parse(filename)\n : undefined;\n this.header(\n 'Content-Disposition',\n 'attachment' + (name ? '; filename=\"' + name.base + '\"' : '')\n );\n\n // If name exits, attempt to set the type\n if (name) {\n this.type(name.ext);\n }\n return this;\n }", "title": "" }, { "docid": "af8058010a8f84601403defa58e35ac7", "score": "0.5236345", "text": "function bkGuessContentType(details) {\n try {\n for (let i = 0; i < details.responseHeaders.length; i++) {\n let header = details.responseHeaders[i];\n // If no content-type was specified BUT a default filename was\n // provided, fallback to a MIME type derived from the extension - YUCK\n // e.g. content-disposition: inline; filename=\"user-guide-nokia-5310-user-guide.pdf\" -> application/pdf\n // Note: we will not try to handle filename* as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition\n // and https://datatracker.ietf.org/doc/html/rfc5987#page-7\n if (header.name.toLowerCase() == \"content-disposition\") {\n let filenameMatches = [...header.value.matchAll(/filename[ ]*=[ ]*\\\"([^\\\"]*)\\\"/g)];\n if(filenameMatches.length > 0) {\n let filename = filenameMatches[0][1]; //First capture group of first match\n let extensionMatch = filename.match(/\\.[^\\.]+$/);\n if(extensionMatch != null && extensionMatch.length > 0) {\n let extension = extensionMatch[0];\n switch(extension) {\n case \".pdf\":\n WJR_DEBUG && console.debug('CHARSET: Guessed content type application/pdf using extension ' + extension + ' for ' + details.url);\n return 'application/pdf';\n default:\n WJR_DEBUG && console.debug('CHARSET: Unhandled file extension \"' + extension + '\" for ' + details.url);\n break;\n }\n }\n }\n break;\n }\n }\n } catch(e) {\n console.error('CHARSET: Exception guessing content type when none supplied for '+details.url+' '+e);\n }\n return 'text/html';\n}", "title": "" }, { "docid": "8cd6d4df383016005017012f93dbca0c", "score": "0.51621205", "text": "static fromHttp2Headers(headers) {\n const result = new Metadata();\n Object.keys(headers).forEach(key => {\n // Reserved headers (beginning with `:`) are not valid keys.\n if (key.charAt(0) === ':') {\n return;\n }\n const values = headers[key];\n try {\n if (isBinaryKey(key)) {\n if (Array.isArray(values)) {\n values.forEach(value => {\n result.add(key, Buffer.from(value, 'base64'));\n });\n }\n else if (values !== undefined) {\n if (isCustomMetadata(key)) {\n values.split(',').forEach(v => {\n result.add(key, Buffer.from(v.trim(), 'base64'));\n });\n }\n else {\n result.add(key, Buffer.from(values, 'base64'));\n }\n }\n }\n else {\n if (Array.isArray(values)) {\n values.forEach(value => {\n result.add(key, value);\n });\n }\n else if (values !== undefined) {\n if (isCustomMetadata(key)) {\n values.split(',').forEach(v => result.add(key, v.trim()));\n }\n else {\n result.add(key, values);\n }\n }\n }\n }\n catch (error) {\n const message = `Failed to add metadata entry ${key}: ${values}. ${error.message}. For more information see https://github.com/grpc/grpc-node/issues/1173`;\n logging_1.log(constants_1.LogVerbosity.ERROR, message);\n }\n });\n return result;\n }", "title": "" }, { "docid": "91ef362a4b7b3a1269ad550663114312", "score": "0.51341367", "text": "static fromHttp2Headers(headers) {\n const result = new Metadata();\n Object.keys(headers).forEach((key) => {\n // Reserved headers (beginning with `:`) are not valid keys.\n if (key.charAt(0) === ':') {\n return;\n }\n const values = headers[key];\n try {\n if (isBinaryKey(key)) {\n if (Array.isArray(values)) {\n values.forEach((value) => {\n result.add(key, Buffer.from(value, 'base64'));\n });\n }\n else if (values !== undefined) {\n if (isCustomMetadata(key)) {\n values.split(',').forEach((v) => {\n result.add(key, Buffer.from(v.trim(), 'base64'));\n });\n }\n else {\n result.add(key, Buffer.from(values, 'base64'));\n }\n }\n }\n else {\n if (Array.isArray(values)) {\n values.forEach((value) => {\n result.add(key, value);\n });\n }\n else if (values !== undefined) {\n result.add(key, values);\n }\n }\n }\n catch (error) {\n const message = `Failed to add metadata entry ${key}: ${values}. ${error.message}. For more information see https://github.com/grpc/grpc-node/issues/1173`;\n logging_1.log(constants_1.LogVerbosity.ERROR, message);\n }\n });\n return result;\n }", "title": "" }, { "docid": "230fb7ff8cf7dab85b1d9ad7f0a7e399", "score": "0.512953", "text": "getContent( type, withDisposition = true ) {\n\n if( !this.isMultipart ) {\n var content = this.header.get( 'content-type' )\n var hasDisposition = withDisposition && this.header.has( 'content-disposition' )\n return content && !hasDisposition && content.type === type ?\n this.body : null\n }\n\n for( var i = 0; i < this.length; i++ ) {\n let content = this[i].header.get( 'content-type' )\n let hasDisposition = withDisposition && this[i].header.has( 'content-disposition' )\n if( content && !hasDisposition && content.type === type ) {\n return this[i].body\n }\n }\n\n return null\n\n }", "title": "" }, { "docid": "9b94b1edc821cfa6ffabe485f9e1eb5b", "score": "0.5064527", "text": "function formatHeaders(str) {\n var headers = {}\n , lines\n ;\n\n lines = str.trim().split(CRLF);\n lines.shift(); // get rid of the boundary marker itself\n lines.forEach(function (header) {\n var pair = reSplitHeaders.exec(header)\n ;\n\n // TODO check for existance before assignment?\n // (headers are technically arrays)\n headers[pair[1].toLowerCase()] = pair[2];\n });\n\n headers.name = (str.match(reName)||eArr)[1];\n headers.filename = (str.match(reFilename)||eArr)[1];\n headers.type = (headers['content-type']||'').replace(/;.*/, '');\n //headers.size = 0;\n\n return headers;\n }", "title": "" }, { "docid": "1200ca0350e6771f436a1a5081395234", "score": "0.4933437", "text": "function headers() {\n// \"The header chunk appears at the beginning of the file, \" +\n// \"and describes the file in three ways. The header chunk always looks like:\"\n// \"4D 54 68 64 00 00 00 06 ff ff nn nn dd dd\"\n\n// ff ff is the file format. There are 3 formats:\n// 0\t-\tsingle-track\n// 1\t-\tmultiple tracks, synchronous\n// 2\t-\tmultiple tracks, asynchronous\n// Single track is fairly self-explanatory - one track only.\n// Synchronous multiple tracks means that the tracks will all be vertically synchronous,\n// or in other words, they all start at the same time,\n// and so can represent different parts in one song.\n// Asynchronous multiple tracks do not necessarily start at the same time,\n// and can be completely asynchronous.\n// nn nn is the number of tracks in the midi file.\n// dd dd is the number of delta-time ticks per quarter note. (More about this later)\n\n}", "title": "" }, { "docid": "625ef969cb78347f06aa1d6dc0f8bd20", "score": "0.48518342", "text": "function checkHeaders(uri, expContentType) {\n return preq.get({ uri: uri })\n .then(function(res) {\n assert.deepEqual(res.status, 200);\n assert.contentType(res, expContentType);\n assert.deepEqual(!!res.headers.etag, true, 'No ETag header present');\n assert.deepEqual(res.headers['access-control-allow-origin'], '*');\n assert.deepEqual(res.headers['access-control-allow-headers'], 'accept, x-requested-with, content-type');\n assert.deepEqual(res.headers['content-security-policy'],\n \"default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'\");\n assert.deepEqual(res.headers['x-content-security-policy'],\n \"default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'\");\n assert.deepEqual(res.headers['x-frame-options'], 'SAMEORIGIN');\n });\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "ae114df068b1fd05280ff8243f596611", "score": "0.4804568", "text": "function parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}", "title": "" }, { "docid": "77c7cf42b4afccf1fa80f9b625f51200", "score": "0.4791542", "text": "function headers(f) {\n if (f.id === defs.BasicProperties) {\n message.properties = f.fields;\n totalSize = remaining = f.size;\n\n // for zero-length messages, content frames aren't required.\n if (totalSize === 0) {\n message.content = Buffer.alloc(0);\n continuation(message);\n return acceptDeliveryOrReturn;\n }\n else {\n return content;\n }\n }\n else {\n throw \"Expected headers frame after delivery\";\n }\n }", "title": "" }, { "docid": "b00e5aa5a0a17c833b1ab1fd6861ffd3", "score": "0.47839212", "text": "function getMimeType() {\n\t\treturn \"application/octet-stream\";\n\t}", "title": "" }, { "docid": "f764f18b78ae63ef656ea6a278bf6cee", "score": "0.47788158", "text": "removeType(){\n if('Content-Type' in this.headers){\n delete this.headers['Content-Type'];\n }\n }", "title": "" }, { "docid": "f5c3b72735c6f17fd20e26057982b5e2", "score": "0.4773491", "text": "extractProtectedHeaders(contentData) {\n // find first MIME delimiter. Anything before that delimiter is the top MIME structure\n let m = contentData.search(/^--/m);\n\n let protectedHdr = [\n \"subject\",\n \"date\",\n \"from\",\n \"to\",\n \"cc\",\n \"reply-to\",\n \"references\",\n \"newsgroups\",\n \"followup-to\",\n \"message-id\",\n ];\n let newHeaders = {};\n\n // read headers of first MIME part and extract the boundary parameter\n let outerHdr = Cc[\"@mozilla.org/messenger/mimeheaders;1\"].createInstance(\n Ci.nsIMimeHeaders\n );\n outerHdr.initialize(contentData.substr(0, m));\n\n let ct = outerHdr.extractHeader(\"content-type\", false) || \"\";\n if (ct === \"\") {\n return null;\n }\n\n let startPos = -1,\n endPos = -1,\n bound = \"\";\n\n if (ct.search(/^multipart\\//i) === 0) {\n // multipart/xyz message type\n if (m < 5) {\n return null;\n }\n\n bound = EnigmailMime.getBoundary(ct);\n if (bound === \"\") {\n return null;\n }\n\n // Escape regex chars in the boundary.\n bound = bound.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n // search for \"outer\" MIME delimiter(s)\n let r = new RegExp(\"^--\" + bound, \"mg\");\n\n startPos = -1;\n endPos = -1;\n\n // 1st match: start of 1st MIME-subpart\n let match = r.exec(contentData);\n if (match && match.index) {\n startPos = match.index;\n }\n\n // 2nd match: end of 1st MIME-subpart\n match = r.exec(contentData);\n if (match && match.index) {\n endPos = match.index;\n }\n\n if (startPos < 0 || endPos < 0) {\n return null;\n }\n } else {\n startPos = contentData.length;\n endPos = 0;\n }\n\n let headers = Cc[\"@mozilla.org/messenger/mimeheaders;1\"].createInstance(\n Ci.nsIMimeHeaders\n );\n headers.initialize(contentData.substring(0, startPos));\n\n // we got a potentially protected header. Let's check ...\n ct = headers.extractHeader(\"content-type\", false) || \"\";\n if (this.getParameter(ct, \"protected-headers\").search(/^v1$/i) !== 0) {\n return null;\n }\n\n for (let i in protectedHdr) {\n if (headers.hasHeader(protectedHdr[i])) {\n let extracted = headers.extractHeader(protectedHdr[i], true);\n newHeaders[protectedHdr[i]] =\n jsmime.headerparser.decodeRFC2047Words(extracted) || undefined;\n }\n }\n\n // contentBody holds the complete 1st MIME part\n let contentBody = contentData.substring(\n startPos + bound.length + 3,\n endPos\n );\n let i = contentBody.search(/^[A-Za-z]/m); // skip empty lines\n if (i > 0) {\n contentBody = contentBody.substr(i);\n }\n\n headers.initialize(contentBody);\n\n let innerCt = headers.extractHeader(\"content-type\", false) || \"\";\n\n if (innerCt.search(/^text\\/rfc822-headers/i) === 0) {\n let charset = EnigmailMime.getCharset(innerCt);\n let ctt = headers.extractHeader(\"content-transfer-encoding\", false) || \"\";\n\n // determine where the headers end and the MIME-subpart body starts\n let bodyStartPos = contentBody.search(/\\r?\\n\\s*\\r?\\n/) + 1;\n\n if (bodyStartPos < 10) {\n return null;\n }\n\n bodyStartPos += contentBody.substr(bodyStartPos).search(/^[A-Za-z]/m);\n\n let ctBodyData = contentBody.substr(bodyStartPos);\n\n if (ctt.search(/^base64/i) === 0) {\n ctBodyData = EnigmailData.decodeBase64(ctBodyData) + \"\\n\";\n } else if (ctt.search(/^quoted-printable/i) === 0) {\n ctBodyData = EnigmailData.decodeQuotedPrintable(ctBodyData) + \"\\n\";\n }\n\n if (charset) {\n ctBodyData = EnigmailData.convertToUnicode(ctBodyData, charset);\n }\n\n // get the headers of the MIME-subpart body --> that's the ones we need\n let bodyHdr = Cc[\"@mozilla.org/messenger/mimeheaders;1\"].createInstance(\n Ci.nsIMimeHeaders\n );\n bodyHdr.initialize(ctBodyData);\n\n for (let i in protectedHdr) {\n let extracted = bodyHdr.extractHeader(protectedHdr[i], true);\n if (bodyHdr.hasHeader(protectedHdr[i])) {\n newHeaders[protectedHdr[i]] =\n jsmime.headerparser.decodeRFC2047Words(extracted) || undefined;\n }\n }\n } else {\n startPos = -1;\n endPos = -1;\n }\n\n return {\n newHeaders,\n startPos,\n endPos,\n securityLevel: 0,\n };\n }", "title": "" }, { "docid": "04f8ab21179604b6293958e946c242f3", "score": "0.47646317", "text": "function createInitMultipart(boundary) {\n return function initMultipart() {\n this.type = 'multipart';\n\n const parser = new MultipartParser(this.options);\n let headerField;\n let headerValue;\n let part;\n\n parser.initWithBoundary(boundary);\n\n // eslint-disable-next-line max-statements, consistent-return\n parser.on('data', ({ name, buffer, start, end }) => {\n if (name === 'partBegin') {\n part = new Stream();\n part.readable = true;\n part.headers = {};\n part.name = null;\n part.originalFilename = null;\n part.mimetype = null;\n\n part.transferEncoding = this.options.encoding;\n part.transferBuffer = '';\n\n headerField = '';\n headerValue = '';\n } else if (name === 'headerField') {\n headerField += buffer.toString(this.options.encoding, start, end);\n } else if (name === 'headerValue') {\n headerValue += buffer.toString(this.options.encoding, start, end);\n } else if (name === 'headerEnd') {\n headerField = headerField.toLowerCase();\n part.headers[headerField] = headerValue;\n\n // matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n const m = headerValue.match(\n // eslint-disable-next-line no-useless-escape\n /\\bname=(\"([^\"]*)\"|([^\\(\\)<>@,;:\\\\\"\\/\\[\\]\\?=\\{\\}\\s\\t/]+))/i,\n );\n if (headerField === 'content-disposition') {\n if (m) {\n part.name = m[2] || m[3] || '';\n }\n\n part.originalFilename = this._getFileName(headerValue);\n } else if (headerField === 'content-type') {\n part.mimetype = headerValue;\n } else if (headerField === 'content-transfer-encoding') {\n part.transferEncoding = headerValue.toLowerCase();\n }\n\n headerField = '';\n headerValue = '';\n } else if (name === 'headersEnd') {\n switch (part.transferEncoding) {\n case 'binary':\n case '7bit':\n case '8bit':\n case 'utf-8': {\n const dataPropagation = (ctx) => {\n if (ctx.name === 'partData') {\n part.emit('data', ctx.buffer.slice(ctx.start, ctx.end));\n }\n };\n const dataStopPropagation = (ctx) => {\n if (ctx.name === 'partEnd') {\n part.emit('end');\n parser.off('data', dataPropagation);\n parser.off('data', dataStopPropagation);\n }\n };\n parser.on('data', dataPropagation);\n parser.on('data', dataStopPropagation);\n break;\n }\n case 'base64': {\n const dataPropagation = (ctx) => {\n if (ctx.name === 'partData') {\n part.transferBuffer += ctx.buffer\n .slice(ctx.start, ctx.end)\n .toString('ascii');\n\n /*\n four bytes (chars) in base64 converts to three bytes in binary\n encoding. So we should always work with a number of bytes that\n can be divided by 4, it will result in a number of buytes that\n can be divided vy 3.\n */\n const offset = parseInt(part.transferBuffer.length / 4, 10) * 4;\n part.emit(\n 'data',\n Buffer.from(\n part.transferBuffer.substring(0, offset),\n 'base64',\n ),\n );\n part.transferBuffer = part.transferBuffer.substring(offset);\n }\n };\n const dataStopPropagation = (ctx) => {\n if (ctx.name === 'partEnd') {\n part.emit('data', Buffer.from(part.transferBuffer, 'base64'));\n part.emit('end');\n parser.off('data', dataPropagation);\n parser.off('data', dataStopPropagation);\n }\n };\n parser.on('data', dataPropagation);\n parser.on('data', dataStopPropagation);\n break;\n }\n default:\n return this._error(\n new FormidableError(\n 'unknown transfer-encoding',\n errors.unknownTransferEncoding,\n 501,\n ),\n );\n }\n\n this.onPart(part);\n } else if (name === 'end') {\n this.ended = true;\n this._maybeEnd();\n }\n });\n\n this._parser = parser;\n };\n}", "title": "" }, { "docid": "548cf1b7cf79440271d1e1f108b96f31", "score": "0.47476792", "text": "function parseResponseHeaders (headerStr) {\n var headers = {}\n\n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function (headerPair) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020')\n\n headers[headerPair.substring(0, index)] =\n headerPair.substring(index + 2)\n })\n\n return headers\n}", "title": "" }, { "docid": "548cf1b7cf79440271d1e1f108b96f31", "score": "0.47476792", "text": "function parseResponseHeaders (headerStr) {\n var headers = {}\n\n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function (headerPair) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020')\n\n headers[headerPair.substring(0, index)] =\n headerPair.substring(index + 2)\n })\n\n return headers\n}", "title": "" }, { "docid": "d51692a555ae5a48a9d5bb9f5f95362e", "score": "0.4733328", "text": "get headers(){\n\t\tvar result={};\n\t\ttry{\n\t\t\tvar headerNames = Myna.JavaUtils.enumToArray($server.request.getHeaderNames());\n\t\t\theaderNames.forEach(function(name){\n\t\t\t\t//try to detect date headers\n\t\t\t\ttry {\n\t\t\t\t\tresult[name] = new Date($server.request.getDateHeader(name));\n\t\t\t\t} catch (e){\n\t\t\t\t\tvar values =Myna.JavaUtils.enumToArray($server.request.getHeaders(name))\n\t\t\t\t\tif (values.length == 1){\n\t\t\t\t\t\tvalues = String(values[0]).split(/,/)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalues = values.map(function(value){return String(value)})\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tresult[name] =values;\n\t\t\t\t\tresult[name.toLowerCase()]=result[name];\n\t\t\t\t\t/* result.hideProperty(name.toLowerCase()); */\n\t\t\t\t}\n\t\t\t});\n\t\t} catch(e){}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "c2eb73e90a81e81c5613f251f128b2ff", "score": "0.4724155", "text": "get headers() {\n return this.#serverRequest.headers;\n }", "title": "" }, { "docid": "3b26dbc738ae71a1b860879f990352aa", "score": "0.46891087", "text": "calculateLength(){\n let _len = this.body? this.body.length: 0;\n if(_len){\n this.headers['Content-Length'] = _len;\n }else{\n if('Content-Length' in this.headers){\n delete this.headers['Content-Length'];\n }\n }\n }", "title": "" }, { "docid": "28647a11d971f7c754be8350069e2ac6", "score": "0.46614644", "text": "get headers() { return this.#headers_; }", "title": "" }, { "docid": "e3069cb7282803b529548d052b2f72ff", "score": "0.4640497", "text": "getMetadata (remotePath) {\n return this.req.get(remotePath).then(({headers, status}) => {\n if (status !== 200) {\n return Promise.resolve(false)\n }\n\n let result = {}\n for (let key in headers) {\n if (isMeta(key)) {\n result[key] = headers[key]\n }\n }\n\n return Promise.resolve(result)\n })\n }", "title": "" }, { "docid": "3d354cf3ec8b88badd7b04ead2d02f97", "score": "0.4606158", "text": "function parseCFFHeader(data, start) {\n\t var header = {};\n\t header.formatMajor = parse.getCard8(data, start);\n\t header.formatMinor = parse.getCard8(data, start + 1);\n\t header.size = parse.getCard8(data, start + 2);\n\t header.offsetSize = parse.getCard8(data, start + 3);\n\t header.startOffset = start;\n\t header.endOffset = start + 4;\n\t return header;\n\t}", "title": "" }, { "docid": "3d354cf3ec8b88badd7b04ead2d02f97", "score": "0.4606158", "text": "function parseCFFHeader(data, start) {\n\t var header = {};\n\t header.formatMajor = parse.getCard8(data, start);\n\t header.formatMinor = parse.getCard8(data, start + 1);\n\t header.size = parse.getCard8(data, start + 2);\n\t header.offsetSize = parse.getCard8(data, start + 3);\n\t header.startOffset = start;\n\t header.endOffset = start + 4;\n\t return header;\n\t}", "title": "" }, { "docid": "cc6f82242eeb161e73ab7cbe5ae8e9bb", "score": "0.45998636", "text": "function parseCFFHeader(data, start) {\n const header = {};\n header.formatMajor = __WEBPACK_IMPORTED_MODULE_2__parse__[\"b\" /* default */].getCard8(data, start);\n header.formatMinor = __WEBPACK_IMPORTED_MODULE_2__parse__[\"b\" /* default */].getCard8(data, start + 1);\n header.size = __WEBPACK_IMPORTED_MODULE_2__parse__[\"b\" /* default */].getCard8(data, start + 2);\n header.offsetSize = __WEBPACK_IMPORTED_MODULE_2__parse__[\"b\" /* default */].getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "fcf6765d1e338aada1d38dc6277ba543", "score": "0.45869884", "text": "_parseResponse(response){var _self=this;if(response){let contentType=this.lastRequest.headers.get(\"content-type\"),responseHandler={\"text/plain\":r=>{r.text().then(function(text){_self.dispatchEvent(new CustomEvent(\"response\",{detail:text,bubbles:!0,composed:!0}))})},\"application/json\":r=>{if(this.xhrFallback){this.dispatchEvent(new CustomEvent(\"response\",{detail:r.response,bubbles:!0,composed:!0}))}else{r.json().then(function(json){_self.dispatchEvent(new CustomEvent(\"response\",{detail:json,bubbles:!0,composed:!0}))})}},\"application/octet-stream\":r=>{if(this.xhrFallback){this.dispatchEvent(new CustomEvent(\"response\",{detail:r.response,bubbles:!0,composed:!0}))}else{r.arrayBuffer().then(function(buffer){_self.dispatchEvent(new CustomEvent(\"response\",{detail:buffer,bubbles:!0,composed:!0}))})}},\"application/pdf\":r=>{if(this.xhrFallback){let blob=new Blob([r.response],{type:\"image/jpeg\"}),fileReader=new FileReader;fileReader.onload=function(evt){var result=evt.target.result;_self.dispatchEvent(new CustomEvent(\"response\",{detail:result,bubbles:!0,composed:!0}))};fileReader.readAsDataURL(blob)}else{r.blob().then(function(blob){_self.dispatchEvent(new CustomEvent(\"response\",{detail:URL.createObjectURL(blob),bubbles:!0,composed:!0}))})}},\"image/jpeg\":r=>{if(this.xhrFallback){let blob=new Blob([r.response],{type:\"image/jpeg\"}),fileReader=new FileReader;fileReader.onload=function(evt){var result=evt.target.result;_self.dispatchEvent(new CustomEvent(\"response\",{detail:result,bubbles:!0,composed:!0}))};fileReader.readAsDataURL(blob)}else{r.blob().then(function(blob){_self.dispatchEvent(new CustomEvent(\"response\",{detail:URL.createObjectURL(blob),bubbles:!0,composed:!0}))})}},default:r=>{if(this.xhrFallback){this.dispatchEvent(new CustomEvent(\"response\",{detail:JSON.parse(r.response),bubbles:!0,composed:!0}))}else{r.json().then(function(json){_self.dispatchEvent(new CustomEvent(\"response\",{detail:json,bubbles:!0,composed:!0}))})}}},typeHandler=responseHandler[contentType]||responseHandler[\"default\"];typeHandler(response)}}", "title": "" }, { "docid": "2fe12e4f0141ed10b3a18b32fe80a601", "score": "0.45750195", "text": "static getDownloadRequest(media_element, session_headers)\n {\n // Download original file if available.\n let url;\n let http_authorization;\n let hostname;\n let path;\n var media_files = media_element.media_files;\n const byRes = (a, b) => {return b.resolution[0] - a.resolution[0];};\n if (media_files)\n {\n if (media_files.layout)\n {\n return null;\n }\n if (media_files.image)\n {\n media_files.image.sort(byRes);\n path = media_files.image[0].path;\n http_authorization = media_files.image[0].http_auth;\n hostname = media_files.image[0].host;\n }\n else if (media_files.archival)\n {\n media_files.archival.sort(byRes);\n path = media_files.archival[0].path;\n http_authorization = media_files.archival[0].http_auth;\n hostname = media_files.archival[0].host;\n }\n else if (media_files.streaming)\n {\n media_files.streaming.sort(byRes);\n path = media_files.streaming[0].path;\n http_authorization = media_files.streaming[0].http_auth;\n hostname = media_files.streaming[0].host;\n }\n else\n {\n let fname = media_element.name;\n console.warn(`Can't find suitable download for ${fname}`);\n }\n } else {\n let fname = media_element.name;\n console.warn(`Can't find suitable download for ${fname}`);\n }\n\n let request = null;\n if (path) {\n if (path.startsWith('http')) {\n url = path;\n request = new Request(url,\n {method: \"GET\",\n credentials: \"omit\",\n });\n }\n }\n\n return request;\n }", "title": "" }, { "docid": "2c993517c9436261c1d10850a7ec0598", "score": "0.4571922", "text": "headers () {\n return this.parseHeaders()\n }", "title": "" }, { "docid": "642510bed9b2708c99eaf4f3869997a8", "score": "0.4553334", "text": "get headers() { return this._headers; }", "title": "" }, { "docid": "a4b2f25235d37c6b7b6b4708ba9bc298", "score": "0.45481074", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "a4b2f25235d37c6b7b6b4708ba9bc298", "score": "0.45481074", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "a4b2f25235d37c6b7b6b4708ba9bc298", "score": "0.45481074", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "a4b2f25235d37c6b7b6b4708ba9bc298", "score": "0.45481074", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n}", "title": "" }, { "docid": "03142f77b3a271785430dca361a658da", "score": "0.45404428", "text": "function Z(e,t,n){\n// Remove auto dataType and get content-type in the process\nfor(var r,i,o,a,s=e.contents,u=e.dataTypes;\"*\"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader(\"Content-Type\"));\n// Check if we're dealing with a known content-type\nif(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}\n// Check to see if we have a response for the expected dataType\nif(u[0]in n)o=u[0];else{\n// Try convertible dataTypes\nfor(i in n){if(!u[0]||e.converters[i+\" \"+u[0]]){o=i;break}a||(a=i)}\n// Or just use first one\no=o||a}\n// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(o)return o!==u[0]&&u.unshift(o),n[o]}", "title": "" }, { "docid": "3a60ca18fa8982ba8f11053c60fe6dd4", "score": "0.45345315", "text": "get dischargeDisposition() {\n\t\treturn this.__dischargeDisposition;\n\t}", "title": "" }, { "docid": "a9618a5b40343a1c4b89406a68a6a807", "score": "0.45307693", "text": "get preflightHeaders() {\n return [this._name];\n }", "title": "" }, { "docid": "d13e99b405b2cb1a07934caf7044b7db", "score": "0.45296127", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n }", "title": "" }, { "docid": "67c48690c9aec64164b7de36eb688b88", "score": "0.45259", "text": "extractHeaders(s){\n\t\tconst req = s.split('\\r\\n\\r\\n')[0].split('\\r\\n').slice(1);\n\t\tconst headers = {};\n\n\t\treq.forEach(function(p){\n\t\t\tconst pair = p.split(': ');\n\t\t\theaders[pair[0]] = pair[1];\n\t\t});\n\t\treturn headers;\n }", "title": "" }, { "docid": "3c442ba1db01fc217b973308dedecdc8", "score": "0.45237327", "text": "getHeaderObject() {\n\n // create headers object\n const headers = {};\n\n for (const [header, value] of this._headers.entries()) {\n headers[header] = value;\n }\n\n return headers;\n }", "title": "" }, { "docid": "8488bdebcaab51f29128696dd075cab8", "score": "0.45182395", "text": "getHeader(key, asArr) {\n if (!key)\n return asArr\n ? this._headers\n : Object.keys(this._headers).reduce(\n (headers, key) =>\n Object.assign(headers, { [key]: this._headers[key].toString() }),\n {}\n ); // return all headers\n return asArr\n ? this._headers[key.toLowerCase()]\n : this._headers[key.toLowerCase()]\n ? this._headers[key.toLowerCase()].toString()\n : undefined;\n }", "title": "" }, { "docid": "ca9609ad0b5a2c3092f62fc7b42681b8", "score": "0.45114782", "text": "function parseContentType(rawValue) {\n var contentTypeText = rawValue.split('\\n')[rawValue.split('\\n').length-1];\n return contentTypeText;\n}", "title": "" }, { "docid": "1db72ecc741505396f751e933913c949", "score": "0.44995895", "text": "function httptoce(headers) {\n return Object.keys(headers).reduce((event, key) => {\n if (key.startsWith('ce-')) {\n event[key.substr(3)] = headers[key]\n }\n return event\n }, {})\n}", "title": "" }, { "docid": "23c99845fca929abcd6c151c57b40194", "score": "0.44940495", "text": "function parseCFFHeader(data, start) {\n var header = {};\n header.formatMajor = parse.getCard8(data, start);\n header.formatMinor = parse.getCard8(data, start + 1);\n header.size = parse.getCard8(data, start + 2);\n header.offsetSize = parse.getCard8(data, start + 3);\n header.startOffset = start;\n header.endOffset = start + 4;\n return header;\n }", "title": "" }, { "docid": "30ab0326cb0ab32d66cfe25a0afbd8c5", "score": "0.44889268", "text": "function headersForOutput(path, contentType) {\n\t// disable caching\n\tvar ret = {\n\t\t'Cache-Control': 'no-cache, no-store, must-revalidate',\n\t\t'Pragma': 'no-cache',\n\t\t'Expires': '0'\n\t}\n\t\n\t// try to auto detect the content type\n\tif (!contentType) {\n\t\tcontentType = contentTypes(path);\n\t\tif (contentType) {\n\t\t\tret['Content-Type'] = contentType;\n\t\t}\n\t}\n\t\n\treturn ret;\n}", "title": "" }, { "docid": "22adbb330ec26af50aa3a68535b363ae", "score": "0.44879764", "text": "parseMultipartFormDataParameters(data, boundary) {\n const sanitizedBoundary = Platform.StringUtilities.escapeForRegExp(boundary);\n const keyValuePattern = new RegExp(\n // Header with an optional file #name.\n '^\\\\r\\\\ncontent-disposition\\\\s*:\\\\s*form-data\\\\s*;\\\\s*name=\"([^\"]*)\"(?:\\\\s*;\\\\s*filename=\"([^\"]*)\")?' +\n // Optional secondary header with the content type.\n '(?:\\\\r\\\\ncontent-type\\\\s*:\\\\s*([^\\\\r\\\\n]*))?' +\n // Padding.\n '\\\\r\\\\n\\\\r\\\\n' +\n // Value\n '(.*)' +\n // Padding.\n '\\\\r\\\\n$', 'is');\n const fields = data.split(new RegExp(`--${sanitizedBoundary}(?:--\\s*$)?`, 'g'));\n return fields.reduce(parseMultipartField, []);\n function parseMultipartField(result, field) {\n const [match, name, filename, contentType, value] = field.match(keyValuePattern) || [];\n if (!match) {\n return result;\n }\n const processedValue = (filename || contentType) ? i18nString(UIStrings.binary) : value;\n result.push({ name, value: processedValue });\n return result;\n }\n }", "title": "" }, { "docid": "934a4a550e4535dfa35a7930b2f04c71", "score": "0.44722295", "text": "function makeOnHeadersReceived(){\n return function onHeadersReceived(details){\n if (details.type !== \"main_frame\") {return}\n\n for (var i=0; i<details.responseHeaders.length; i++) {\n if (details.responseHeaders[i].name.toLowerCase() === \"content-security-policy\" ) {\n details.responseHeaders[i].value = \"\"\n }\n }\n\n return {\n responseHeaders: details.responseHeaders\n }\n }\n }", "title": "" }, { "docid": "d75088fb73759abbeac4c3a9531006fe", "score": "0.44670415", "text": "function MultiPart_parse(body, contentType) {\n // Examples for content types:\n // multipart/form-data; boundary=\"----7dd322351017c\"; ...\n // multipart/form-data; boundary=----7dd322351017c; ...\n var m = contentType.match(/boundary=(?:\"([^\"]+)\"|([^;]+))/i);\n\n if (!m) {\n throw new Error('Bad content-type header, no multipart boundary');\n }\n\n let s, fieldName;\n let boundary = m[1] || m[2];\n\n function Header_parse(header) {\n var headerFields = {};\n var matchResult = header.match(/^.*name=\"([^\"]*)\"$/);\n if (matchResult) headerFields.name = matchResult[1];\n return headerFields;\n }\n\n function rawStringToBuffer(str) {\n var idx, len = str.length,\n arr = new Array(len);\n for (idx = 0; idx < len; ++idx) {\n arr[idx] = str.charCodeAt(idx) & 0xFF;\n }\n return new Uint8Array(arr).buffer;\n }\n\n // \\r\\n is part of the boundary.\n boundary = '\\r\\n--' + boundary;\n\n var isRaw = typeof(body) !== 'string';\n\n if (isRaw) {\n var view = new Uint8Array(body);\n s = String.fromCharCode.apply(null, view);\n } else {\n s = body;\n }\n\n // Prepend what has been stripped by the body parsing mechanism.\n s = '\\r\\n' + s;\n\n var parts = s.split(new RegExp(boundary)),\n partsByName = {};\n\n // First part is a preamble, last part is closing '--'\n for (var i = 1; i < parts.length - 1; i++) {\n var subparts = parts[i].split('\\r\\n\\r\\n');\n var headers = subparts[0].split('\\r\\n');\n for (var j = 1; j < headers.length; j++) {\n var headerFields = Header_parse(headers[j]);\n if (headerFields.name) {\n fieldName = headerFields.name;\n }\n }\n\n partsByName[fieldName] = isRaw ? rawStringToBuffer(subparts[1]) : subparts[1];\n }\n\n return partsByName;\n}", "title": "" }, { "docid": "ff46389919190fbefdede0fc202822cf", "score": "0.44567257", "text": "send(body) {\n const {flag: flag, properties: properties, upload: upload, _ownerDocument: _ownerDocument} = this;\n // Not per spec, but per tests: https://github.com/whatwg/xhr/issues/65\n if (!_ownerDocument) {\n throw webidl2jsWrapper.create(this._globalObject, [ \"The object is in an invalid state.\", \"InvalidStateError\" ]);\n }\n if (this.readyState !== READY_STATES.OPENED || properties.send) {\n throw webidl2jsWrapper.create(this._globalObject, [ \"The object is in an invalid state.\", \"InvalidStateError\" ]);\n }\n properties.beforeSend = true;\n try {\n if (flag.method === \"GET\" || flag.method === \"HEAD\") {\n body = null;\n }\n if (body !== null) {\n let encoding = null;\n let mimeType$1 = null;\n if (Document$1.isImpl(body)) {\n encoding = \"UTF-8\";\n mimeType$1 = (body._parsingMode === \"html\" ? \"text/html\" : \"application/xml\") + \";charset=UTF-8\";\n flag.body = fragmentSerialization$1(body, {\n requireWellFormed: false\n });\n } else {\n if (typeof body === \"string\") {\n encoding = \"UTF-8\";\n }\n const {buffer: buffer, formData: formData, contentType: contentType} = extractBody(body);\n mimeType$1 = contentType;\n flag.body = buffer || formData;\n flag.formData = Boolean(formData);\n }\n const existingContentType = xhrUtils.getRequestHeader(flag.requestHeaders, \"content-type\");\n if (mimeType$1 !== null && existingContentType === null) {\n flag.requestHeaders[\"Content-Type\"] = mimeType$1;\n } else if (existingContentType !== null && encoding !== null) {\n // Waiting for better spec: https://github.com/whatwg/xhr/issues/188. This seems like a good guess at what\n // the spec will be, in the meantime.\n const parsed = mimeType.parse(existingContentType);\n if (parsed) {\n const charset = parsed.parameters.get(\"charset\");\n if (charset && !asciiCaseInsensitiveMatch(charset, encoding) && encoding !== null) {\n parsed.parameters.set(\"charset\", encoding);\n xhrUtils.updateRequestHeader(flag.requestHeaders, \"content-type\", parsed.toString());\n }\n }\n }\n }\n } finally {\n if (properties.beforeSend) {\n properties.beforeSend = false;\n } else {\n throw webidl2jsWrapper.create(this._globalObject, [ \"The object is in an invalid state.\", \"InvalidStateError\" ]);\n }\n }\n if (Object.keys(upload._eventListeners).length > 0) {\n properties.uploadListener = true;\n }\n // request doesn't like zero-length bodies\n if (flag.body && flag.body.byteLength === 0) {\n flag.body = null;\n }\n if (flag.synchronous) {\n const flagStr = JSON.stringify(flag, (function(k, v) {\n if (this === flag && k === \"requestManager\") {\n return null;\n }\n if (this === flag && k === \"pool\" && v) {\n return {\n maxSockets: v.maxSockets\n };\n }\n return v;\n }));\n const res = spawnSync(process__default[\"default\"].execPath, [ syncWorkerFile ], {\n input: flagStr,\n maxBuffer: Infinity\n });\n if (res.status !== 0) {\n throw new Error(res.stderr.toString());\n }\n if (res.error) {\n if (typeof res.error === \"string\") {\n res.error = new Error(res.error);\n }\n throw res.error;\n }\n const response = JSON.parse(res.stdout.toString());\n const resProp = response.properties;\n if (resProp.responseBuffer && resProp.responseBuffer.data) {\n resProp.responseBuffer = buffer.Buffer.from(resProp.responseBuffer.data);\n }\n if (resProp.cookieJar) {\n resProp.cookieJar = cookie_1.CookieJar.deserializeSync(resProp.cookieJar, _ownerDocument._cookieJar.store);\n }\n this.readyState = READY_STATES.LOADING;\n this.status = response.status;\n this.statusText = response.statusText;\n this.responseURL = response.responseURL;\n Object.assign(this.properties, response.properties);\n if (resProp.error) {\n xhrUtils.dispatchError(this);\n throw webidl2jsWrapper.create(this._globalObject, [ resProp.error, \"NetworkError\" ]);\n } else {\n const {responseBuffer: responseBuffer} = properties;\n const contentLength = getResponseHeader(this, \"content-length\") || \"0\";\n const bufferLength = parseInt(contentLength) || responseBuffer.length;\n const progressObj = {\n lengthComputable: false\n };\n if (bufferLength !== 0) {\n progressObj.total = bufferLength;\n progressObj.loaded = bufferLength;\n progressObj.lengthComputable = true;\n }\n fireAnEvent$5(\"progress\", this, ProgressEvent, progressObj);\n readyStateChange(this, READY_STATES.DONE);\n fireAnEvent$5(\"load\", this, ProgressEvent, progressObj);\n fireAnEvent$5(\"loadend\", this, ProgressEvent, progressObj);\n }\n } else {\n properties.send = true;\n fireAnEvent$5(\"loadstart\", this, ProgressEvent);\n const client = xhrUtils.createClient(this);\n properties.client = client;\n // For new client, reset totalReceivedChunkSize and bufferStepSize\n properties.totalReceivedChunkSize = 0;\n properties.bufferStepSize = 1 * 1024 * 1024;\n properties.origin = flag.origin;\n client.on(\"error\", (err => {\n client.removeAllListeners();\n properties.error = err;\n xhrUtils.dispatchError(this);\n }));\n client.on(\"response\", (res => receiveResponse(this, res)));\n client.on(\"redirect\", (() => {\n const {response: response} = client;\n const destUrlObj = new URL$2(response.request.headers.Referer);\n const urlObj = new URL$2(response.request.uri.href);\n if (destUrlObj.origin !== urlObj.origin && destUrlObj.origin !== flag.origin) {\n properties.origin = \"null\";\n }\n response.request.headers.Origin = properties.origin;\n if (flag.origin !== destUrlObj.origin && destUrlObj.protocol !== \"data:\") {\n if (!xhrUtils.validCORSHeaders(this, response, flag, properties, flag.origin)) {\n return;\n }\n if (urlObj.username || urlObj.password) {\n properties.error = \"Userinfo forbidden in cors redirect\";\n xhrUtils.dispatchError(this);\n }\n }\n }));\n if (body !== null && body !== \"\") {\n properties.uploadComplete = false;\n setDispatchProgressEvents(this);\n } else {\n properties.uploadComplete = true;\n }\n if (this.timeout > 0) {\n properties.timeoutStart = (new Date).getTime();\n properties.timeoutFn = () => {\n client.abort();\n if (!(this.readyState === READY_STATES.UNSENT || this.readyState === READY_STATES.OPENED && !properties.send || this.readyState === READY_STATES.DONE)) {\n properties.send = false;\n let stateChanged = false;\n if (!properties.uploadComplete) {\n fireAnEvent$5(\"progress\", upload, ProgressEvent);\n readyStateChange(this, READY_STATES.DONE);\n fireAnEvent$5(\"timeout\", upload, ProgressEvent);\n fireAnEvent$5(\"loadend\", upload, ProgressEvent);\n stateChanged = true;\n }\n fireAnEvent$5(\"progress\", this, ProgressEvent);\n if (!stateChanged) {\n readyStateChange(this, READY_STATES.DONE);\n }\n fireAnEvent$5(\"timeout\", this, ProgressEvent);\n fireAnEvent$5(\"loadend\", this, ProgressEvent);\n }\n this.readyState = READY_STATES.UNSENT;\n };\n properties.timeoutId = setTimeout(properties.timeoutFn, this.timeout);\n }\n }\n }", "title": "" }, { "docid": "a9631c8c3241d9599ae43017f3400130", "score": "0.44415578", "text": "function addContentTypeToHeader() {\n return {\n request: requestInterceptor\n };\n\n function requestInterceptor(config) {\n if (angular.isDefined(config.headers['Content-Type']) && !angular.isDefined(config.data)) config.data = '';\n\n return config;\n }\n }", "title": "" }, { "docid": "c1b3235514da9545dddb084e69fc77b8", "score": "0.44365162", "text": "toHttp2Headers() {\n // NOTE: Node <8.9 formats http2 headers incorrectly.\n const result = {};\n this.internalRepr.forEach((values, key) => {\n // We assume that the user's interaction with this object is limited to\n // through its public API (i.e. keys and values are already validated).\n result[key] = values.map((value) => {\n if (value instanceof Buffer) {\n return value.toString('base64');\n }\n else {\n return value;\n }\n });\n });\n return result;\n }", "title": "" }, { "docid": "4ea5381e798935c8740abd47b2759e4e", "score": "0.4434692", "text": "function handleOnHeadersReceived(details) {\n\n\tvar url = getBaseURL(details.url);\n\t// There could be multiplpe set-cookies\n\tfor (var i = 0; i < details.responseHeaders.length; ++i) {\n\t\tif (details.responseHeaders[i].name.toLowerCase() === 'set-cookie') {\n\t\t\tvar setCookie = details.responseHeaders[i].value;\n\t\t\tsaveSessionCookie(details.tabId,url,setCookie);\n\t\t}\n\t}\n\tvar responseHeaders = removeHeaderFromRequest(details.responseHeaders,'set-cookie');\n\treturn {responseHeaders: responseHeaders};\n}", "title": "" }, { "docid": "a3e2544296891501786a70e833e730f1", "score": "0.44254082", "text": "function jsDAV_File() {}", "title": "" }, { "docid": "f18cb7890927ac067e962c7ba60349d5", "score": "0.44164717", "text": "static getHeaders() {\n return {\n 'Content-Type': 'application/json',\n Accept: 'application/json'\n };\n }", "title": "" }, { "docid": "34ef913bca59734a87a937d7b6614b37", "score": "0.44148183", "text": "toHttp2Headers() {\n // NOTE: Node <8.9 formats http2 headers incorrectly.\n const result = {};\n this.internalRepr.forEach((values, key) => {\n // We assume that the user's interaction with this object is limited to\n // through its public API (i.e. keys and values are already validated).\n result[key] = values.map(value => {\n if (value instanceof Buffer) {\n return value.toString('base64');\n }\n else {\n return value;\n }\n });\n });\n return result;\n }", "title": "" }, { "docid": "d7df69fcf0adbbd3a7d95e9c96dffdb5", "score": "0.44092864", "text": "header(key, value, append) {\n let _key = key.toLowerCase(); // store as lowercase\n let _values = value ? (Array.isArray(value) ? value : [value]) : [''];\n this._headers[_key] = append\n ? this.hasHeader(_key)\n ? this._headers[_key].concat(_values)\n : _values\n : _values;\n return this;\n }", "title": "" }, { "docid": "76b53b271618100ca3d1c8276319101c", "score": "0.4397415", "text": "function EBMLHeader()\n{\n this.id = EBML_HEADER;\n this.Version = 1;\n this.ReadVersion = 1;\n this.MaxIDLength = 4;\n this.MaxSizeLength = 8;\n this.DocType = \"webm\";\n this.DocTypeVersion = 2; /* Not well specified by the WebM guys, but functionally required for Firefox */\n this.DocTypeReadVersion = 2;\n}", "title": "" }, { "docid": "84ba7bcb4bd35e314795047f7fa42ac6", "score": "0.4370524", "text": "function decompressResponsePolicy() {\n return {\n name: decompressResponsePolicyName,\n async sendRequest(request, next) {\n // HEAD requests have no body\n if (request.method !== \"HEAD\") {\n request.headers.set(\"Accept-Encoding\", \"gzip,deflate\");\n }\n return next(request);\n }\n };\n}", "title": "" }, { "docid": "f58192cc88c86ca7cc9ea079ec21bded", "score": "0.43625447", "text": "get header() {\n return this.headers\n }", "title": "" }, { "docid": "d6258aa583819eec7848a172889ca781", "score": "0.43615288", "text": "async parseHeader() {\n //Reads the Header information\n \n try{\n //Check Data is available\n if (this.protoData.rawData.length > 9){\n \n this.protoData.Magic = this.protoData.rawData.slice(this.protoData.fsCurLoc, 4).toString()\n this.protoData.fsCurLoc = this.protoData.fsCurLoc + 4;\n this.protoData.Version = this.protoData.rawData.readInt8(this.protoData.fsCurLoc);\n this.protoData.fsCurLoc++;\n this.protoData.Records = (this.protoData.endian)? this.protoData.rawData.readUInt32BE(this.protoData.fsCurLoc):this.protoData.rawData.readUInt32LE(this.protoData.fsCurLoc);\n this.protoData.fsCurLoc = this.protoData.fsCurLoc + 4;\n return true;\n } else {\n throw new Error('File is empty');\n }\n } catch (error){\n throw new Error(`PARSE HEADER ERROR: ${error}`);\n }\n }", "title": "" }, { "docid": "5420721daea7e97cb787382b04a5f5db", "score": "0.4347392", "text": "function parserOnHeaders(headers, url) {\n // Once we exceeded headers limit - stop collecting them\n if (this.maxHeaderPairs <= 0 ||\n this._headers.length < this.maxHeaderPairs) {\n this._headers = this._headers.concat(headers);\n }\n this._url += url;\n}", "title": "" }, { "docid": "7b9343c96887d24d2a6cc6b887a34a3c", "score": "0.43432382", "text": "function handleOnBeforeSendHeaders(details) {\n\n\t// remove 'cookie' header from the requset, so we dont get to trouble with browser saved cookies\n\tvar requestHeaders = removeHeaderFromRequest(details.requestHeaders,\"cookie\");\n\n\tvar url = getBaseURL(details.url);\n\tvar sessionCookie = getSessionCookie(details.tabId, url);\n\tif (sessionCookie == undefined) {\n\t\treturn {requestHeaders: requestHeaders};\n\t} else {\n\t\t// Add our cookie to the request and forward it\n\t\trequestHeaders.push({name : 'cookie',value : sessionCookie});\n\t\treturn {requestHeaders: requestHeaders};\n\t}\n}", "title": "" }, { "docid": "b71e56f35e8fe23830671b7faa8aa171", "score": "0.43298116", "text": "function headers() {\n return [\n \"Назва\",\n \"Факультет\",\n \"Спеціальність\"\n ];\n }", "title": "" }, { "docid": "bde5c37fa2bc17f8bb256f4cfb883f67", "score": "0.43192932", "text": "blob () {\n let ct = (this.headers && this.headers.get('content-type')) || ''\n return consumeBody.call(this).then(buf => Object.assign(\n // Prevent copying\n new Blob([], {\n type: ct.toLowerCase()\n }),\n {\n [BUFFER]: buf\n }\n ))\n }", "title": "" }, { "docid": "e9a2ffc512d6c960988c39c314a1f95e", "score": "0.43172684", "text": "function httpheaders__deserialize(header, str) {\n\tif (!str || typeof(str) != 'string' || !header) {\n\t\treturn str;\n\t}\n\tvar fn = httpheaders__find(header, 'deserializer');\n\tif (!fn) {\n\t\treturn str;\n\t}\n\ttry {\n\t\treturn fn(str);\n\t} catch (e) {\n\t\tconsole.warn('Failed to deserialize content', header, str);\n\t\treturn str;\n\t}\n}", "title": "" }, { "docid": "cd9a68435d301781f1f09cbb1176f201", "score": "0.43159398", "text": "function F(a, c, d) {\n // Remove auto dataType and get content-type in the process\n for (var e, f, g, h, i = a.contents, j = a.dataTypes; \"*\" === j[0]; ) j.shift(), \n e === b && (e = a.mimeType || c.getResponseHeader(\"Content-Type\"));\n // Check if we're dealing with a known content-type\n if (e) for (f in i) if (i[f] && i[f].test(e)) {\n j.unshift(f);\n break;\n }\n // Check to see if we have a response for the expected dataType\n if (j[0] in d) g = j[0]; else {\n // Try convertible dataTypes\n for (f in d) {\n if (!j[0] || a.converters[f + \" \" + j[0]]) {\n g = f;\n break;\n }\n h || (h = f);\n }\n // Or just use first one\n g = g || h;\n }\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n return g ? (g !== j[0] && j.unshift(g), d[g]) : void 0;\n }", "title": "" }, { "docid": "8310e4c03a49e89d93c55febd874fa5c", "score": "0.43121973", "text": "validateResponse () {\n\t\tthis.validateDisposition();\n\t\tthis.validateVersionHeaders();\n\t\tthis.validateAgentHeaders();\n\t\tthis.validateAssetUrl();\n\t}", "title": "" } ]
47df568a9b73cd88fcaca66fe38d0f71
Crear un constructor de objetos Mercury
[ { "docid": "75bdae3252541f32d1ea8cf2cbe0de07", "score": "0.0", "text": "function java() {\n drawStar.call(this,0,-65,40,157.70,'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjBweCIgeT0iMHB4Igp3aWR0aD0iNDgiIGhlaWdodD0iNDgiCnZpZXdCb3g9IjAgMCAxNzIgMTcyIgpzdHlsZT0iIGZpbGw6IzAwMDAwMDsiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIHN0cm9rZS1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjAiIGZvbnQtZmFtaWx5PSJub25lIiBmb250LXdlaWdodD0ibm9uZSIgZm9udC1zaXplPSJub25lIiB0ZXh0LWFuY2hvcj0ibm9uZSIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBub3JtYWwiPjxwYXRoIGQ9Ik0wLDE3MnYtMTcyaDE3MnYxNzJ6IiBmaWxsPSJub25lIj48L3BhdGg+PHBhdGggZD0iTTg2LDE3MmMtNDcuNDk2NDksMCAtODYsLTM4LjUwMzUxIC04NiwtODZ2MGMwLC00Ny40OTY0OSAzOC41MDM1MSwtODYgODYsLTg2djBjNDcuNDk2NDksMCA4NiwzOC41MDM1MSA4Niw4NnYwYzAsNDcuNDk2NDkgLTM4LjUwMzUxLDg2IC04Niw4NnoiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48Zz48cGF0aCBkPSJNODQuOTk2NjcsODguNTczODdjLTIuODYwOTMsLTQuNjEyNDcgLTQuOTM2NCwtOC40MzY2IC03LjgxMTY3LC0xNS42Mzc2N2MtNC44NjE4NywtMTIuMTYzMjcgMjkuNTY5NjcsLTIzLjE1NDA3IDE1LjYwOSwtNDQuMjcyOGM2LjA1MTUzLDE0LjU4ODQ3IC0yMS43MjA3MywyMy42MDcgLTI0LjMwMDczLDM1Ljc1NTkzYy0yLjM1OTI3LDExLjE3NDI3IDE2LjQ4OTA3LDI0LjE1NDUzIDE2LjUwMzQsMjQuMTU0NTN6IiBmaWxsPSIjZjQ0MzM2Ij48L3BhdGg+PHBhdGggZD0iTTg1LjY1MDI3LDY2LjcwNjk0Yy0wLjU1MDQsNy4yMTI1MyA2LjM4OTgsMTEuMDU2NzMgNi41OTA0NywxNi4zMjU2N2MwLjE2MDUzLDQuMjg4NTMgLTQuMTQ4MDcsNy44NjMyNyAtNC4xNDgwNyw3Ljg2MzI3YzAsMCA3LjgyMDI3LC0xLjUzNjUzIDEwLjI1OTgsLTguMDc4MjdjMi43MDksLTcuMjY0MTMgLTUuMjU3NDcsLTEyLjIzNzggLTQuNDM3NiwtMTguMDU0MjdjMC43NjU0LC01LjU1NTYgMTcuMjg4ODcsLTE1Ljg4OTkzIDE3LjI4ODg3LC0xNS44ODk5M2MwLDAgLTI0LjMxMjIsMS42MTEwNyAtMjUuNTUzNDcsMTcuODMzNTN6IiBmaWxsPSIjZjQ0MzM2Ij48L3BhdGg+PGcgZmlsbD0iIzE1NjVjMCI+PHBhdGggZD0iTTEwOS4xNzQxMyw4OS4wMjM5NGM1LjAyODEzLC0xLjEyOTQ3IDkuMjY3OTMsMi4wNzI2IDkuMjY3OTMsNS43NjJjMCw4LjMxNjIgLTExLjUyNjg3LDE2LjE3NjYgLTExLjUyNjg3LDE2LjE3NjZjMCwwIDE3Ljg0NSwtMi4xMjcwNyAxNy44NDUsLTE1Ljc4MWMwLC05LjAzIC04Ljc2MzQsLTExLjI4NjA3IC0xNS41ODYwNywtNi4xNTc2ek0xMDAuNzAzMTMsOTUuNzMxOTRjMCwwIDUuNTY0MiwtMy45NjQ2IDcuMDQ2MjcsLTUuNDUyNGMtMTMuNjUzOTMsMi44OTgyIC00NC44Mjg5MywzLjI4ODA3IC00NC44Mjg5MywwLjc3MTEzYzAsLTIuMzE5MTMgMTAuMDUzNCwtNC42OTU2IDEwLjA1MzQsLTQuNjk1NmMwLDAgLTIyLjI4MjYsLTAuMzIxMDcgLTIyLjI4MjYsNi4yNTIyYzAsNi44NTEzMyAyOS4xNjgzMyw3LjM0MTUzIDUwLjAxMTg3LDMuMTI0Njd6Ij48L3BhdGg+PHBhdGggZD0iTTk3LjI4MDMzLDEwMS45Njk4Yy0xMi45MjU4LDQuMjk3MTMgLTM2LjczMzQ3LDIuOTI0IC0yOS42ODE0NywtMi44NDY2Yy0zLjQzNDI3LDAgLTguNTI1NDcsMi43NjA2IC04LjUyNTQ3LDUuNDE1MTNjMCw1LjMyMzQgMjUuNzQ4NCw5LjQzNDIgNDQuODA2LDEuNjM5NzN6Ij48L3BhdGg+PHBhdGggZD0iTTcwLjc2NjUzLDExMS4wNTE0Yy00LjY4OTg3LDAgLTcuNzI1NjcsMy4wMjE0NyAtNy43MjU2Nyw1LjIyMzA3YzAsNi44NTQyIDI3Ljk3ODY3LDcuNTQ1MDcgMzkuMDY0MDcsMC41ODc2N2wtNy4wNDYyNywtNC42Nzg0Yy04LjI4MTgsMy42NDA2NyAtMjkuMDg1Miw0LjE0MjMzIC0yNC4yOTIxMywtMS4xMzIzM3oiPjwvcGF0aD48cGF0aCBkPSJNMTIxLjIwNTUzLDEyMi4yMTEzNGMwLC0yLjY4MzIgLTMuMDI0MzMsLTMuOTQ3NCAtNC4xMDc5MywtNC41NTIyN2M2LjM4NjkzLDE1LjQwMjYgLTYzLjk3NTQsMTQuMjA3MiAtNjMuOTc1NCw1LjExNDEzYzAsLTIuMDY2ODcgNS4xODAwNywtNC4wOTA3MyA5Ljk2NzQsLTMuMTMzMjdsLTQuMDcwNjcsLTIuNDA1MTNjLTkuNTQwMjcsLTEuNDk2NCAtMTYuMDE4OTMsMi42OTc1MyAtMTYuMDE4OTMsNi4wODAyYzAsMTUuNzc1MjcgNzguMjA1NTMsMTUuMDE1NiA3OC4yMDU1MywtMS4xMDM2N3oiPjwvcGF0aD48cGF0aCBkPSJNMTI5LDEyNy44NjQ0Yy0xMS44ODUyLDExLjczOSAtNDIuMDIyNDcsMTYuMDE2MDcgLTcyLjMyODg3LDguNzYzNGMzMC4zMDY0LDEyLjkwODYgNzIuMTg1NTMsNS42Mzg3MyA3Mi4zMjg4NywtOC43NjM0eiI+PC9wYXRoPjwvZz48L2c+PC9nPjwvc3ZnPg==');\n }", "title": "" } ]
[ { "docid": "073f8239c41b0ec2e92c1833b6f4aca6", "score": "0.7183456", "text": "function ctor() {}", "title": "" }, { "docid": "3996570f8cae8cc57f7430bf48b0d1a8", "score": "0.7013081", "text": "function constructorObject() {}", "title": "" }, { "docid": "f22cb981733d75c2bc34bdb791b93657", "score": "0.6959038", "text": "Constructor(){}", "title": "" }, { "docid": "6fb9e13dda5cf115d443e0f68dcde828", "score": "0.66834927", "text": "function MyConstructor(args) {\n this.args = args;\n this.staus = 1;\n }", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6658458", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6658458", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6658458", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6658458", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6658458", "text": "function Ctor() {}", "title": "" }, { "docid": "b762ba73dbe0c6e8acc47c8b94fa5559", "score": "0.66461647", "text": "function _ctor() {\n\t}", "title": "" }, { "docid": "027b7093209ca0ebc95892f52b6aa424", "score": "0.6518046", "text": "constructor() {// Nothing to do\n }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.64940614", "text": "function Ctor() {\n }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.64940614", "text": "function Ctor() {\n }", "title": "" }, { "docid": "3eeff0117597e685aa9853fc454a85ca", "score": "0.64351577", "text": "function Ctor() {\n}", "title": "" }, { "docid": "b794fe96368d726d100c2c9208fd732e", "score": "0.6379724", "text": "constructor() {\r\n // Objマネージャーに登録\r\n super();\r\n\r\n this.container = new createjs.Container();\r\n }", "title": "" }, { "docid": "91157aac5faff7ea3c93ba87342d1ea3", "score": "0.63688034", "text": "static create(...args) {\n\t\treturn new this(...args)\n\t}", "title": "" }, { "docid": "91157aac5faff7ea3c93ba87342d1ea3", "score": "0.63688034", "text": "static create(...args) {\n\t\treturn new this(...args)\n\t}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.63346773", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.63346773", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.63346773", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.63346773", "text": "constructor(){}", "title": "" }, { "docid": "a294cadaf3e63086494c9e5d061620dc", "score": "0.63110816", "text": "function _constructor(dom) {\n\t\t\tthis.dom = dom;\n\t\t\t// capture 'this'\n\t\t\tlet thiz = this;\n\t\n\t\t\t_init.call(thiz);\n\t\n\t\t\t_setObserver.call(thiz);\n\t\n\t\t\t_getOptions.call(thiz);\n\t\n\t\t\t_setListeners.call(thiz);\n\t\n\t\t\treturn thiz;\n\t\t}", "title": "" }, { "docid": "f7c13d188176c476de7785db3a5df29e", "score": "0.6281909", "text": "function createCesiumObject () {\n const args = Array.from(arguments)\n const constructor = args[0]\n args.shift()\n const Class = _.get(Cesium, constructor)\n // Can be callable, constructable or constant\n let object\n if (typeof Class === 'function') {\n try { object = Class(...args) } catch (error) { /* Simply avoid raising any error */ }\n try { object = new Class(...args) } catch (error) { /* Simply avoid raising any error */ }\n } else object = Class\n return object\n }", "title": "" }, { "docid": "91779e47354c9bc88a034c87a28eb2e8", "score": "0.62807393", "text": "function makeCtor () {\n function constructor () {\n // Opera has some problems returning from a constructor when Dragonfly isn't running. The || null seems to\n // be sufficient to stop it misbehaving. Known to be required against 10.53, 11.51 and 11.61.\n return this.constructor.apply(this, arguments) || null;\n }\n return constructor;\n }", "title": "" }, { "docid": "d4e19213c4d2453c1c731840a0e36c3c", "score": "0.62666595", "text": "static NewObject() {}", "title": "" }, { "docid": "9867bf7bb9fbfcf1c69837656c7ec870", "score": "0.62586224", "text": "function Construct () {}", "title": "" }, { "docid": "e996927afa9a5299324cf503b6ecb412", "score": "0.6225692", "text": "function makeCtor () {\r\n function constructor () {\r\n // Opera has some problems returning from a constructor when Dragonfly isn't running. The || null seems to\r\n // be sufficient to stop it misbehaving. Known to be required against 10.53, 11.51 and 11.61.\r\n return this.constructor.apply(this, arguments) || null;\r\n }\r\n return constructor;\r\n }", "title": "" }, { "docid": "802fa7c9d67c941c61bead032e96debe", "score": "0.61954886", "text": "constructor(opts) {\n return this.init(opts)\n }", "title": "" }, { "docid": "d73aab166adb89659286d15da8f8a7b2", "score": "0.6194301", "text": "constructor() { // and adds a consructor() method..\n super(); // as well as a super() method..\n }", "title": "" }, { "docid": "a749bb777e91acb65ecb65a69ca653ee", "score": "0.6183725", "text": "constructor(nome, sobrenome){ // metodo: constructor ; atributos: nome, sobrenome\n this.nome = nome;\n this.sobrenome = sobrenome;\n }", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.61778766", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "e000163d5cf4985287eba25cf716ed5c", "score": "0.6177701", "text": "function c(){\n// Call the user constructor\nreturn this.init.apply(this,arguments),this}", "title": "" }, { "docid": "e5381aa500b26fe2e353460ed3e7d030", "score": "0.6167802", "text": "constructor(/* 3 args */) {\n \n }", "title": "" }, { "docid": "a0d8cf5607aaa174293d485d3aa922f1", "score": "0.61533487", "text": "constructor() {\n\n console.debug('constructor')\n\n \n \n\n\n }", "title": "" }, { "docid": "f49d7b3c002b524312e32b989b822042", "score": "0.61430806", "text": "constructor() {\n super();\n this.create();\n }", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6128524", "text": "constructor() {}", "title": "" }, { "docid": "bc5fb76e579f6db27e972c235bb08fe8", "score": "0.6128199", "text": "constructor() {\n // Nothing to do\n }", "title": "" }, { "docid": "7bc60862df3d44d82bbfad4c2d1492c7", "score": "0.6110652", "text": "construct(type, ...parameters) {\n return new type(...parameters);\n }", "title": "" }, { "docid": "3664ba3504ef155297b04945cba468f1", "score": "0.6109315", "text": "constructor() {\n // declare our class properties\n // call init\n this.init();\n }", "title": "" }, { "docid": "4e51ad5707f31184969049a420a95160", "score": "0.6097766", "text": "function Constructor() {\n this.init && this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "c0579746bf340713bd1f19975a29dd6b", "score": "0.6057521", "text": "function __globalConstructor__() {\n}", "title": "" }, { "docid": "c0579746bf340713bd1f19975a29dd6b", "score": "0.6057521", "text": "function __globalConstructor__() {\n}", "title": "" }, { "docid": "119ab7692b792caab2176bd5f3783a6b", "score": "0.60431266", "text": "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xffb6d4ca;\n this.SUBCLASS_OF_ID = 0x9b704a5a;\n\n this.sticker = args.sticker;\n this.position = args.position;\n }", "title": "" }, { "docid": "76694397d202346e29aee3544892de97", "score": "0.6037148", "text": "constructor(\n // never directly created by game developers\n args, required) {\n super(args, required);\n // <<-- Creer-Merge: constructor -->>\n // setup any thing you need here\n // <<-- /Creer-Merge: constructor -->>\n }", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.60221285", "text": "constructor () {}", "title": "" }, { "docid": "5866f61476c7e537d83b1eb514a79a1c", "score": "0.5984012", "text": "function NewObj(){}", "title": "" }, { "docid": "5866f61476c7e537d83b1eb514a79a1c", "score": "0.5984012", "text": "function NewObj(){}", "title": "" }, { "docid": "40b07bb5aab78430ef5aa9f5f337754c", "score": "0.5982804", "text": "constructor() {\n\n\n\t\t// initialize after construction\n\t\tthis.init();\n\t}", "title": "" }, { "docid": "927dccf8bbd29c285daa4dce27da3a1d", "score": "0.59788543", "text": "function NewClass() {\n // All construction is actually done in the \"$constructor$\" method.\n if (!initializing && this.$constructor$) {\n this.$constructor$.apply(this, arguments);\n }\n }", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.5966993", "text": "constructor(){\n\n }", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.5966993", "text": "constructor(){\n\n }", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.5966993", "text": "constructor(){\n\n }", "title": "" }, { "docid": "ece1e3b934113dcf3dd5d67ade2bd276", "score": "0.5959064", "text": "constructor(callee, args, type) {\n Object.assign(this, { callee, args, type })\n }", "title": "" }, { "docid": "ece1e3b934113dcf3dd5d67ade2bd276", "score": "0.5959064", "text": "constructor(callee, args, type) {\n Object.assign(this, { callee, args, type })\n }", "title": "" }, { "docid": "0c24ccf92eb4579d01a423b1a22ade8b", "score": "0.5952054", "text": "constructor(name, readOnly, initializer) {\n Object.assign(this, { name, readOnly, initializer })\n }", "title": "" }, { "docid": "ed5cd92c845a0c9ff69d5dd0162277a7", "score": "0.5947458", "text": "constructor(){ \n }", "title": "" }, { "docid": "1f8951dc8e007d65f8c777090e63e67b", "score": "0.59439504", "text": "constructor( ) {\n }", "title": "" }, { "docid": "e35dcaad55ad8e12fd5a61bcd85d99a4", "score": "0.5938983", "text": "init(){}", "title": "" }, { "docid": "5fdef40243be6802fc0b48f0183918cd", "score": "0.59368914", "text": "constructor(make, model, year, doors) {\n // Call constructor from Parent class (Vehicle class) and pass arguments\n super(make, model, year, doors);\n this.doors = doors;\n }", "title": "" }, { "docid": "ad5ea96df065b5af9c24beb31361c279", "score": "0.59275526", "text": "constructor() {\n super()\n this.init()\n }", "title": "" }, { "docid": "8189a397c5dda582136c3ec82672abba", "score": "0.59237784", "text": "constructor()\n {\n\n }", "title": "" }, { "docid": "8189a397c5dda582136c3ec82672abba", "score": "0.59237784", "text": "constructor()\n {\n\n }", "title": "" }, { "docid": "ed63ff35e296b07de2ce5e1c46f541c7", "score": "0.5914697", "text": "constructor(make, model, year) {\n // Arguments that are being passed to constructor\n this.make = make;\n this.model = model;\n this.year = year;\n }", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" }, { "docid": "46e5e9d32de8ea9848aaccf54c01b757", "score": "0.59111357", "text": "static Instantiate() {}", "title": "" } ]
d079ccca195ef491abb496025d652f1d
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
[ { "docid": "009c253a2d7beef89cd4d81326bbc410", "score": "0.0", "text": "function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}", "title": "" } ]
[ { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.7143652", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.7143652", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.7143652", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "5573c2061f86925688797b35605cd09a", "score": "0.7001643", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;stream.emit('drain');\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "132cab13ce688adcf4c320351ffd43cb", "score": "0.6896476", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "94911f054d95adf5473504fb70356519", "score": "0.68952423", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit(\"drain\");\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6889115", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "653098ac635bcbe189ae88fa4d2e22b7", "score": "0.67665964", "text": "_writeQueued() {\n\t\tthis._isStreamReady = true;\n\n\t\t// Empty the queue.\n\t\twhile( this._writeMsgQueue.length > 0 ) {\n\t\t\tlet item = this._writeMsgQueue.splice( 0, 1 )[0];\n\t\t\tthis._logToFile( item.level, item.msg );\n\n\t\t\t// Stop, stream cannot keep up.\n\t\t\tif( !this._isStreamReady ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "fe15aadaac609cc056ab4b4f64860a9a", "score": "0.64298296", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit(\"drain\")}}", "title": "" }, { "docid": "575f4def0c4f810b8e284e9c52c56579", "score": "0.61733615", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "060be0d35c2bf88a258f4744a3b5289f", "score": "0.6159666", "text": "function onwriteDrain(stream, state) {\n\t\t if (state.length === 0 && state.needDrain) {\n\t\t state.needDrain = false;\n\t\t stream.emit('drain');\n\t\t }\n\t\t}", "title": "" }, { "docid": "060be0d35c2bf88a258f4744a3b5289f", "score": "0.6159666", "text": "function onwriteDrain(stream, state) {\n\t\t if (state.length === 0 && state.needDrain) {\n\t\t state.needDrain = false;\n\t\t stream.emit('drain');\n\t\t }\n\t\t}", "title": "" }, { "docid": "db74070d56803ed6811c83282623ffcf", "score": "0.6145504", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "1078c6bc80c3498aa1f9161a6e12a191", "score": "0.61437875", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "1078c6bc80c3498aa1f9161a6e12a191", "score": "0.61437875", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "1078c6bc80c3498aa1f9161a6e12a191", "score": "0.61437875", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "ee223d6d02598d71242e684b6e0dd908", "score": "0.61354154", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "144fb0e73716265de80e6a094b5f1e13", "score": "0.61300987", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit(\"drain\");\n }\n }", "title": "" }, { "docid": "3c14b232930a9f76cbea9d6ad206b80d", "score": "0.61162263", "text": "function onwriteDrain(stream, state) {\r\n\t if (state.length === 0 && state.needDrain) {\r\n\t state.needDrain = false;\r\n\t stream.emit('drain');\r\n\t }\r\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.6114511", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" } ]
b9acf92916eaab65bec164658cab2a7d
Return with all standard tab information Id are Index are set once in a group (see GroupManager.prepareGroups)
[ { "docid": "9faaa3ba642f7b4d81cc7b85c30ab42e", "score": "0.0", "text": "function getTabFactory(tab) {\n return Object.assign({\n title: \"New Tab\",\n url: TAB_CONSTANTS.NEW_TAB,\n favIconUrl: \"chrome://branding/content/icon32.png\",\n hidden: false,\n lastAccessed: 0,\n pinned: false,\n windowId: browser.windows.WINDOW_ID_NONE,\n discarded: false,\n }, tab);\n}", "title": "" } ]
[ { "docid": "64f3957ec92b16550eb033f36c6bc65f", "score": "0.5987419", "text": "_getTabContentId(i) {\n return `mat-tab-content-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "804e7c16a5ec14ca0afa5c2c067300e7", "score": "0.5894297", "text": "_getTabLabelId(i) {\n return `mat-tab-label-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "f157bd54b0aafc2b4211b40a2f9db9ed", "score": "0.57177705", "text": "function cambiarEstilos(elementId, index, groupHeadersName)\r\n {\r\n \tvar list = document.getElementsByTagName('LI');\r\n \t\r\n \ttab = document.getElementById(elementId);\r\n \t\r\n \tif(tab!=null)\r\n \t{\r\n\t \tfor(i=0; i< list.length; i++){ //ocultamos todos \r\n\t\t\t\t \r\n\t\t\t\t if(list[i].id == 'current' && list[i].getAttribute('group')==groupHeadersName)\r\n\t\t\t\t \tlist[i].id = current[index].id;\r\n\t\t\t\t}\r\n\t \t\r\n\t \tcurrent[index] = tab.cloneNode(false);\r\n\t \t\r\n\t \ttab.id = 'current';\r\n\t \t}\r\n }", "title": "" }, { "docid": "a0b6728a2ecb337c7caca9f440430e16", "score": "0.5635561", "text": "function _refreshTabIndexes(windowId = _currentWindowId) {\n chrome.tabs.query({\n windowId: windowId\n }, function(tabs) {\n for (let i = 0; i < tabs.length; i++) {\n let element = document.querySelector(`[data-main-window-id=\"${windowId}\"] > [data-tab-id=\"${tabs[i].id}\"]`);\n element.setAttribute('data-tab-index', tabs[i].index);\n }\n });\n }", "title": "" }, { "docid": "8af6191c82e21171962679958a65d559", "score": "0.56100565", "text": "refreshTabGroups() {\n this.db.groups.toArray((tabGroups) => {\n this.setState({\n tabGroups: tabGroups.map(g => new TabGroup(g))\n })\n });\n }", "title": "" }, { "docid": "090a31cff5c31862afbae0ad8101a664", "score": "0.5607985", "text": "function addGroup(){\n //ฝั่งซ้าย\n var groupitem = $( \".groupdefault:first\" ).clone(true, true);\n var list = $('.list-itemTab');\n groupitem.removeClass('active');\n groupitem.css({'visibility':'visible','height':'64px'});\n groupitem.attr(\"onclick\", \"openItem(event, 'group\"+idgroup+\"')\");\n groupitem.appendTo(list);\n\n //ฝั่งขวา\n var groupcontent = $(\"#group\").clone(true, true);\n var listcontent = $(\"#RightSideBox-Detail\");\n groupcontent.removeClass('show active');\n groupcontent.css('display','none');\n groupcontent.removeAttr('id');\n groupcontent.attr('id','group' + idgroup);\n groupcontent.appendTo(listcontent);\n //เนื้อหาด้านขวาแก้ไข id แต่ละตัว\n //1.กล่องใหญ่สุด\n $(\"#group\"+idgroup+\" .tab-Header\").removeAttr('id aria-labelledby');\n $(\"#group\"+idgroup+\" .tab-Header\").attr('id','v-pills-Group' + idgroup);\n $(\"#group\"+idgroup+\" .tab-Header\").attr(\"aria-labelledby\",\"v-pills-Group-tab\" + idgroup);\n // Header processdetail\n $(\"#group\"+idgroup+\" .listST\").removeAttr('id href aria-controls');\n $(\"#group\"+idgroup+\" .listST\").attr('id','pills-Groupdetails-tab' + idgroup);\n $(\"#group\"+idgroup+\" .listST\").attr('href','#pills-Groupdetails' + idgroup);\n $(\"#group\"+idgroup+\" .listST\").attr('aria-controls','pills-Groupdetails' + idgroup);\n //Header Condition condition\n $(\"#group\"+idgroup+\" .listTH\").removeAttr('id href aria-controls');\n $(\"#group\"+idgroup+\" .listTH\").attr('id','pills-ConditionGroup-tab' + idgroup);\n $(\"#group\"+idgroup+\" .listTH\").attr('href','#pills-ConditionGroup' + idgroup);\n $(\"#group\"+idgroup+\" .listTH\").attr('aria-controls','pills-ConditionGroup' + idgroup);\n //body detil\n $(\"#group\"+idgroup+' .tab-body .ST').removeAttr('id aria-labelledby');\n $(\"#group\"+idgroup+' .tab-body .ST').attr('id','pills-Groupdetails' + idgroup);\n $(\"#group\"+idgroup+' .tab-body .ST').attr(\"aria-labelledby\",\"pills-Groupdetails-tab\" + idgroup);\n //body condition\n $(\"#group\"+idgroup+' .tab-body .TH').removeAttr('id aria-labelledby');\n $(\"#group\"+idgroup+' .tab-body .TH').attr('id','pills-ConditionGroup' + idgroup);\n $(\"#group\"+idgroup+' .tab-body .TH').attr(\"aria-labelledby\",\"pills-ConditionGroup-tab\" + idgroup);\n \n \n //บวกค่า id เพิ่ม\n idgroup++;\n}", "title": "" }, { "docid": "31a933f6298a6186d53a9170cfd8d96a", "score": "0.5606549", "text": "updateTabIndices() {\n // There are three tabindex states for a group of elements:\n // 1. If any are checked, that element is focusable.\n const siblings = this.getNamedSiblings();\n const checkedSibling = siblings.find(sibling => sibling.checked);\n // 2. If an element is focused, the others are no longer focusable.\n if (checkedSibling || this.focused) {\n const focusable = checkedSibling || this.host;\n focusable.removeAttribute('tabindex');\n for (const sibling of siblings) {\n if (sibling !== focusable) {\n sibling.tabIndex = -1;\n }\n }\n return;\n }\n // 3. If none are checked or focused, all are focusable.\n for (const sibling of siblings) {\n sibling.removeAttribute('tabindex');\n }\n }", "title": "" }, { "docid": "f8f5696a3183feacf4b884cd262affa8", "score": "0.55718845", "text": "function loadTabGroups(){\n $('#displayBody').html('');\n var title = document.querySelector('#Titles').content.querySelector('#titleForTGs').cloneNode(true);\n $('#displayBody').append(title);\n\n $('#optionBar').html('');\n var addAll = document.querySelector('#Buttons').content.querySelector('#addSaveAllTabs').cloneNode(true);\n var addSom = document.querySelector('#Buttons').content.querySelector('#addSaveSomeTabs').cloneNode(true);\n var addGrp = document.querySelector('#Buttons').content.querySelector('#addNewGroup').cloneNode(true);\n var addTab = document.querySelector('#Buttons').content.querySelector('#addView').cloneNode(true);\n\n $('#optionBar').append(addAll);\n $('#optionBar').append(addSom);\n $('#optionBar').append(addGrp);\n $('#optionBar').append(addTab);\n \n $('#tabsList').html('');\n \n var backButton = document.querySelector('#Buttons').content.querySelector('#backUserStuff').cloneNode(true);\n \n //Populates the view with buttons that are the tab groups\n var tGList = JsonTGL;\n for(i=0; i < tGList.length; i++){\n var template = document.querySelector('#Buttons').content.querySelector('#GroupButton').cloneNode(true);\n template.value = tGList[i].title;\n template.dataset.id = tGList[i].id;\n $('#tabsList').append(template);\n $('#tabsList').append(\"<br>\");\n }\n}", "title": "" }, { "docid": "163f236c42baf42fa0dbdb3cdac0c4a1", "score": "0.55493295", "text": "function getAllTabs(){\n\tchrome.tabs.query({}, function(tabs){\n\t\t//each tab add with placeholder image\n\t\ttabs.forEach(tb => {\n\n\t\t\tif (tb.title == extensionWindowName){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//add blank tabs to overview\n\t\t\taddElement(null, tb.title, tb.id, tb.windowId);\n\n\t\t\t//populate current tabs array\n\t\t\tfor (let k in currentTabs) {\n\t\t\t\tif (currentTabs[k].id === tb.id) {\n\t\t\t\t\tcurrentTabs[k].title = tb.title;\n\t\t\t\t\t//currentTabs[k].image = null;\n\t\t\t\t\tcurrentTabs[k].win = tb.window;\n\t\t\t\t\tcurrentTabs[k].index = tb.index;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentTabs.push({win: tb.windowId, id: tb.id, title: tb.title, image: null, index: tb.index});\n \n });\n });\n}", "title": "" }, { "docid": "79ffd66e83748f96f2ee27125797fd19", "score": "0.5540541", "text": "function updateInternalTabs()\n{\n // retrieve all tabs from all windows and push them into the structure\n chrome.windows.getAll(\n {\n 'populate': true\n },\n\n function(windows)\n {\n for (var i = 0; i < windows.length; i++)\n {\n var tabs = windows[i].tabs;\n for (j = 0; j < tabs.length; j++)\n {\n // console.log(tabs[j].id);\n tabsManager.createFromTab(tabs[j]);\n }\n }\n }\n );\n}", "title": "" }, { "docid": "bc57143f894887c792bc2aa832d0b75b", "score": "0.552033", "text": "function getTabGroupInfo(){\n var temp;\n $.ajax({\n async: false,\n type: 'GET',\n url: 'http://crossoverdev.parseapp.com/getTabGroups',\n success: function(data) {\n temp = data;\n JsonTGL = temp.tabGroups;\n for(i=0; i < doge.tabGroups.length; i++){\n dogeID.push(doge.tabGroups[i].title);\n dataID.push(doge.tabGroups[i].id);\n }\n },\n error: function(){\n bkg.console.log(\"failed to load tab groups\");\n }\n });\n}", "title": "" }, { "docid": "c3dba866683b0dc24347b95bc0006fee", "score": "0.5516269", "text": "function createAllTabs(group, i, j)\r\n{\r\n\t// creates all of the tabs of the current window\r\n\tchrome.windows.create({\"url\": group.objectArr[i][\"tabUrls\"][j], \"state\": \"maximized\"}, function(window)\r\n\t{\r\n\t\t/* iterates through the tabs of a window to assign tab names and tab color to the tabs */\r\n\t\tfor (var k = 0; k < group.objectArr[i][\"tabUrls\"][j].length; k++)\r\n\t\t{\r\n\t\t\t/* saves the title of the tab */\r\n\t\t\tvar tabTitle = group.objectArr[i][\"tabNames\"][j][k];\r\n\t\t\ttabIdsToTitles[window.tabs[k].id] = tabTitle;\r\n\r\n\t\t\t/* saves the color of the tab */\r\n\t\t\tvar tabColor = group.objectArr[i][\"tabColor\"][j][k];\r\n\t\t\ttabIdsToColor[window.tabs[k].id] = tabColor;\r\n\t\t}\r\n\t})\r\n}", "title": "" }, { "docid": "e4483dfe902e1394aab40736af9cd3f3", "score": "0.5466825", "text": "function init_group(group)\n{\n\t$(\"#group\").html(\"\");\n\tfor (var i=0; i<group.length; i++) if (typeof group[i] !== \"undefined\")\n\t{\n\t\t$(\"#group\").append(\"<div id='gc\"+i+\"' data-case='\"+i+\"' class='gc alert alert-info' style='width:full'><strong>GROUP \"+i+\" : </strong></div>\");\n\t\tfor (var j in group[i]) $(\"#gc\"+i).append(\" <span id='gt\"+group[i][j]+\"' data-test='\"+group[i][j]+\"' class='gt label label-info'>\"+group[i][j]+\"</span> \");\n\t\t$(\"#gc\"+i).append(\"<span class='pull-right panel' style='display:none'> \\\n\t\t\t\t<form class='form-inline'> \\\n\t\t\t\t<input type='number' class='panel-from' style='width:35px;height:17px'></input> \\\n\t\t\t\t<strong>~</strong>\\\n\t\t\t\t<input type='number' class='panel-to' style='width:35px;height:17px'></input> \\\n\t\t\t\t<span class='btn btn-small panel-add'>Add</span> \\\n\t\t\t\t<button class='close panel-close'>&times;</button> \\\n\t\t\t\t</form> \\\n\t\t\t\t</span>\");\n\t}\n}", "title": "" }, { "docid": "9831d25e6e75a060d1be106ae01d8d36", "score": "0.54316634", "text": "function setActiveTab() {\n var arr = [];\n ctrl.pagesArr.forEach(function(data) {\n if (data.isVisible) {\n arr.push(data.pageKey);\n }\n });\n ctrl.currentTabs = arr;\n return ctrl.currentTabs;\n }", "title": "" }, { "docid": "5f9306ea9dc823f882e9cc787b1e8644", "score": "0.54287785", "text": "onSDMXTabChange(index) {\n this.setState({ activeSDMXTabIndex: index });\n }", "title": "" }, { "docid": "d31a89a389714fbfc5b95386432d7b93", "score": "0.54208523", "text": "_getTabIDs() {\n return Connection.get(TAB_ARRAY_KEY).then(items => {\n // If no tab array exists\n if (!items[TAB_ARRAY_KEY]) {\n // Set to empty array\n return Connection.set(TAB_ARRAY_KEY, []).then(() => []);\n } else {\n return items[TAB_ARRAY_KEY];\n }\n });\n }", "title": "" }, { "docid": "c97348c1557497d840dc75bc8fc46d76", "score": "0.53862214", "text": "function onTabSelectHandler(event) {\n\t\tlet group = GroupItems.getActiveGroupItem();\n\t\tupdateMenubarMenus();\n\t}", "title": "" }, { "docid": "cc31d815a2f7113ca6b2deee21cfc156", "score": "0.538057", "text": "function setTabIndex(tab, index){\n var tabContainer = $find(tab);\n tabContainer.set_activeTabIndex(index);\n /*\n var tabContainer = $find(tab);\n arrtab = tabContainer.get_tabs();\n if (tabContainer == null) return;\n if (index < 0 || index >= arrtab.length) return;\n tabContainer.set_activeTabIndex(index);\n */\n}", "title": "" }, { "docid": "c308451c26e4b3caad69ae46aa1e0d3f", "score": "0.5367275", "text": "function changeGroupTab(){\n\tvar prevSelection = \"liUserGroup-\"+globalUserZoneNames[0];\n $(document).on(\"click\", \"#groupnavbar ul li\",function() {\n\t var newSelection = $(this).children(\"a\").attr(\"data-tab-class\");\n //$(\".\" + prevSelection).addClass(\"ui-screen-hidden\");\n //$(\".\" + newSelection).removeClass(\"ui-screen-hidden\");\n\t\tvar zid = $(this).children(\"a\").attr(\"zid\");\n prevSelection = newSelection;\n\t\tloadBindedGroup();\n });\n\t\n\t\n}", "title": "" }, { "docid": "c4fdb08c3e54c75da39eda53344db391", "score": "0.53602076", "text": "getTabsIndex() {\n\t\tif (this.state.isOverviewFullscreen) {\n\t\t\treturn 0;\n\t\t} else if (this.state.isGalaxyFullscreen) {\n\t\t\treturn 1;\n\t\t} else if (this.state.isProfileFullscreen) {\n\t\t\treturn 2;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "title": "" }, { "docid": "c2df18e30323c0ff9a4d8c8bbdccd60b", "score": "0.535111", "text": "function createGroupDynamicTab(rdid,name,id){\n\t var str = '<div data-role=\"navbar\" id=\"groupnavbar\"><ul id=\"groupTab\">';\n for(var a = 0; a <globalUserZoneNames.length; a++){\n\t\tif (globalDeviceType == 'Mobile'){\n\t str += \"<li><a href='#domZoneGroupDiv' data-tab-class='liUserGroup_\"+name[a]+\"' did='\"+id[a]+\"' onclick='loadBindedGroup(\"+rdid+\",\"+id[a]+\")' data-mini='true'>\";\n\t\t} else {\n\t\t\tstr += \"<li><a href='#domZoneGroupDiv' did='\"+id[a]+\"' onclick='loadBindedGroup(\"+rdid+\",\"+id[a]+\")' data-mini='true'>\";\n\t\t}\n str += name[a]+\"</a></li>\";\n\t}\n\tstr += \"</ul><div id='domZoneGroupDiv'></div></div>\";\n $('#domZoneGroupTab').empty().append(str);\n\t$('#groupnavbar').tabs();\n\t$( \"#domZoneGroupDiv\" ).empty().load('pages/Admin/UserDomainZoneGroup.html',function(){\n\t\tif (id.length != 0){\n\t\t\tloadBindedGroup(rdid,id[0]);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "aa1e7c0a7ab3c4f9c8c31d42ff863931", "score": "0.532148", "text": "static getGroupTabURL(name = null, temporary = undefined, internalId = null) {\n let url = internalId ? 'moz-extension://' + internalId + '/resources/group-tab.html' : 'about:treestyletab-group';\n let firstArg = true;\n let prepareForArg = () => {\n url += firstArg ? '?' : '&';\n firstArg = false;\n };\n if (name && typeof name === 'string') {\n prepareForArg();\n url += 'title=' + encodeURIComponent(name);\n }\n if (temporary !== undefined) {\n prepareForArg();\n url += 'temporary=' + (temporary ? 'true' : 'false');\n }\n return url;\n }", "title": "" }, { "docid": "508cbef4105dfd7f96c6f1dbbdb10892", "score": "0.52945596", "text": "function findIndexSubGroups(groupSelected) {\n\t\tfor (var i=0; i<groupList.length; i++) {\n\t\t\tif(groupList[i].groupname == groupSelected) {\n\t\t\t\tvar indexFinded = groupList[i]._id,\n\t\t\t\t\t\tsubGroupFinded = groupList[i].subgroupitems\n\t\t\t\t// console.log(indexFinded + ' and ' + subGroupFinded)\n\t\t\t\treturn { index:indexFinded , subitems: subGroupFinded }\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b2c0ab7ecff69db618f02d3a64b57aa1", "score": "0.5288057", "text": "function setID(){\n $(\".tabs li\").each(function(n) {\n $(this).attr(\"tab-id\", n);\n });\n $(\".hidden-container div\").each(function(n) {\n $(this).attr(\"data-id\", n);\n });\n $(\".img-container div\").each(function(n) {\n $(this).attr(\"data-id\", n);\n });\n}", "title": "" }, { "docid": "62fcafee452815ebeba99aad2dd20175", "score": "0.5287688", "text": "function initTabData() {\n\ttabs = new Array(0);//array including all catId\n\tselectedTabs = new Array(0);// current array less than 10 catIds\n\tvar data = document.getElementById(\"menudata\");\n\tvar j = 0; //array number\n\tfor (var i = 0; i < data.childNodes.length; i++) {\n\t\tvar field = data.childNodes[i];\n\t\tvar parentCatId = field.getAttribute(\"parentCatId\");\n\t\tvar catId = field.getAttribute(\"id\");\n\t\tvar catTypeId = field.getAttribute(\"catTypeId\");\n\t\tif (entityId == parentCatId && catTypeId == 5) {\n\t\t\ttabs.push(catId);\n\t\t\tif (j < tabCount) {\n\t\t\t\tselectedTabs.push(catId);\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e06320c3e84cec25e63d356e8a3c34dd", "score": "0.52856916", "text": "handleTabChange(index){\n let state = Session.get('userCardTabbedState');\n state[\"index\"] = index;\n Session.set('userCardTabbedState', state);\n }", "title": "" }, { "docid": "abdcfc23336a5e291b7f29b1c4904d22", "score": "0.52842987", "text": "function xTabPanelGroup(id, w, h, th, clsTP, clsTG, clsTD, clsTS, selectedPanel) // object prototype\n{\n // Private Methods\n\n function onClick() //r7\n {\n paint(this);\n return false;\n }\n function onFocus() //r7\n {\n paint(this);\n }\n function paint(tab)\n {\n tab.className = clsTS;\n xZIndex(tab, highZ++);\n xDisplay(panels[tab.xTabIndex], 'block'); //r6\n \n if (selectedIndex != tab.xTabIndex) {\n xDisplay(panels[selectedIndex], 'none'); //r6\n tabs[selectedIndex].className = clsTD;\n \n selectedIndex = tab.xTabIndex;\n }\n }\n\n // Public Methods\n\n this.select = function(n) //r7\n {\n if (n && n <= tabs.length) {\n\t if(n<0)\n\t\tn = 0;\n tabs[n].onclick();\n }\n }\n \n this.SelectedPanel = function() //r7\n {\n return selectedIndex;\n }\n\n this.onUnload = function()\n {\n if (xIE4Up) for (var i = 0; i < tabs.length; ++i) {tabs[i].onclick = null;}\n }\n\n // Constructor Code (note that all these vars are 'private')\n\n var panelGrp = xGetElementById(id);\n if (!panelGrp) { return null; }\n var panels = xGetElementsByClassName(clsTP, panelGrp);\n var tabs = xGetElementsByClassName(clsTD, panelGrp);\n var tabGrp = xGetElementsByClassName(clsTG, panelGrp);\n if (!panels || !tabs || !tabGrp || panels.length != tabs.length || tabGrp.length != 1) { return null; }\n var selectedIndex = 0, highZ, x = 0, i;\n xResizeTo(panelGrp, w, h);\n xResizeTo(tabGrp[0], w, th);\n xMoveTo(tabGrp[0], 0, 0);\n w -= 2; // remove border widths\n var tw = w / tabs.length;\n for (i = 0; i < tabs.length; ++i) {\n xResizeTo(tabs[i], tw, th); \n xMoveTo(tabs[i], x, 0);\n x += tw;\n tabs[i].xTabIndex = i;\n tabs[i].onclick = onClick;\n tabs[i].onfocus = onFocus; //r7\n panels[i].style.overflow ='scroll';\n xDisplay(panels[i], 'none'); //r6\n xResizeTo(panels[i], w, h - th - 2); // -2 removes border widths\n xMoveTo(panels[i], 0, th);\n }\n highZ = i;\n if((selectedPanel) && (selectedPanel > 0))\n\ttabs[selectedPanel].onclick();\n else\n\ttabs[0].onclick();\n}", "title": "" }, { "docid": "70a28c4526ff450108e57162e3aa5883", "score": "0.52589947", "text": "function addTabBunch(){\n var groupId = $(\"#tabGROUP\").val();\n for(var i=0; i<allTabs.length; i++){\n var putTab = [allTabs[i]];\n $.ajax({\n async: false,\n type: 'POST',\n url: 'http://crossoverdev.parseapp.com/newTabs',\n success: function(data) {\n bkg.console.log(\"You made a new tab!\");\n },\n error: function(data){\n alert(data.message);\n },\n data: {\n newTabs: putTab,\n tabGroup: groupId\n }\n });\n }\n \n var text = $(\"#tabGroups\").html();\n dogeID = [];\n dataID = [];\n clearHTML();\n getTabGroupInfo();\n $('#loginInfo').append(text);\n loadTabGroups();\n loadTabGroups();\n}", "title": "" }, { "docid": "d70a2502b16301262da95232ce12431e", "score": "0.52512544", "text": "function createTab(group, i, j)\r\n{\r\n\t/* creates the tabs */\r\n\tchrome.tabs.create({\"url\": group.objectArr[i][\"tabUrls\"][j], \"active\": false}, function(tab)\r\n {\r\n\t\t/* saves the title of the tab */\r\n\t\tvar tabTitle = group.objectArr[i][\"tabNames\"][j];\r\n\t\ttabIdsToTitles[tab.id] = tabTitle;\r\n\r\n\t\t/* saves the color of the tab */\r\n\t\tvar tabColor = group.objectArr[i][\"tabColor\"][j];\r\n\t\ttabIdsToColor[tab.id] = tabColor;\r\n })\r\n}", "title": "" }, { "docid": "3725bcc6dc5f27792cada2a5ec378e01", "score": "0.52463007", "text": "function updateGroups(){function createGroup(groupInfo,itemsContainer){var GroupType=groupInfo.enableCellSpanning?Groups.CellSpanningGroup:Groups.UniformGroup;return new GroupType(that,itemsContainer);}var oldRealizedItemRange=that._groups.length>0?that._getRealizationRange():null,newGroups=[],prepared=[],cleanUpDom={},newGroupMap={},currentIndex=0,len=tree.length,i;for(i=0;i<len;i++){var oldChangedRealizedRangeInGroup=null,groupInfo=that._getGroupInfo(i),groupKey=that._site.groupFromIndex(i).key,oldGroup=that._groupMap[groupKey],wasCellSpanning=oldGroup instanceof Groups.CellSpanningGroup,isCellSpanning=groupInfo.enableCellSpanning;if(oldGroup){if(wasCellSpanning!==isCellSpanning){// The group has changed types so DOM needs to be cleaned up\ncleanUpDom[groupKey]=true;}else{// Compute the range of changed items that is within the group's realized range\nvar firstChangedIndexInGroup=Math.max(0,changedRange.firstIndex-oldGroup.startIndex),oldRealizedItemRangeInGroup=that._rangeForGroup(oldGroup,oldRealizedItemRange);if(oldRealizedItemRangeInGroup&&firstChangedIndexInGroup<=oldRealizedItemRangeInGroup.lastIndex){// The old changed realized range is non-empty\noldChangedRealizedRangeInGroup={firstIndex:Math.max(firstChangedIndexInGroup,oldRealizedItemRangeInGroup.firstIndex),lastIndex:oldRealizedItemRangeInGroup.lastIndex};}}}var group=createGroup(groupInfo,tree[i].itemsContainer.element);var prepareLayoutPromise;if(group.prepareLayoutWithCopyOfTree){prepareLayoutPromise=group.prepareLayoutWithCopyOfTree(copyItemsContainerTree(tree[i].itemsContainer),oldChangedRealizedRangeInGroup,oldGroup,{groupInfo:groupInfo,startIndex:currentIndex});}else{prepareLayoutPromise=group.prepareLayout(getItemsContainerLength(tree[i].itemsContainer),oldChangedRealizedRangeInGroup,oldGroup,{groupInfo:groupInfo,startIndex:currentIndex});}prepared.push(prepareLayoutPromise);currentIndex+=group.count;newGroups.push(group);newGroupMap[groupKey]=group;}return Promise.join(prepared).then(function(){var currentOffset=0;for(var i=0,len=newGroups.length;i<len;i++){var group=newGroups[i];group.offset=currentOffset;currentOffset+=that._getGroupSize(group);}// Clean up deleted groups\nObject.keys(that._groupMap).forEach(function(deletedKey){var skipDomCleanUp=!cleanUpDom[deletedKey];that._groupMap[deletedKey].cleanUp(skipDomCleanUp);});that._groups=newGroups;that._groupMap=newGroupMap;});}// When doRealizedRange is true, this function is synchronous and has no return value.", "title": "" }, { "docid": "0acd64e44bbe0f19136ef149bc9dee57", "score": "0.5241328", "text": "function populateSheetTabs() {\n loadingTabs.style.display = \"none\";\n apiSheetNames.forEach((name) => {\n const node = document.createElement(\"td\");\n const textnode = document.createTextNode(name);\n node.id = name;\n node.appendChild(textnode);\n eventsTableParent.appendChild(node);\n });\n}", "title": "" }, { "docid": "8f366e552280502565336715b4129c11", "score": "0.5233652", "text": "function switchedTab(index){\n main.selectedMainTab = index;\n }", "title": "" }, { "docid": "fdf0ff8febe2c07e1e500b08bab0d6e1", "score": "0.5228796", "text": "function _changeTab(newTabId, groupId) {\n if (checkGroupId(groupId)) {\n self.currentActiveTabIds[_DEFAULT_TAB_GROUP] = newTabId;\n } else {\n self.currentActiveTabIds[groupId] = newTabId;\n }\n\n self.tabChangedCallBacks.forEach(function (callBack) {\n if (angular.isDefined(callBack)) {\n callBack(newTabId, groupId);\n }\n });\n }", "title": "" }, { "docid": "7c100b7c92e925f4b54ed74f4398d3b7", "score": "0.522134", "text": "_getTabIndex(tab, idx) {\n if (tab.disabled) {\n return null;\n }\n return this.selectedIndex === idx ? 0 : -1;\n }", "title": "" }, { "docid": "d05b73ae1db82f9f1a4a7f597d3a59cb", "score": "0.5217304", "text": "function changeDiffSplicingGroup () {\n var diff = \"All events (table)\";\n $(\"a[data-value*='\" + diff + \"']\").tab(\"show\");\n $(\"#analyses-diffSplicing-diffSplicingTable-diffGroups\")[0].selectize\n .focus();\n}", "title": "" }, { "docid": "e429f4d6642345fb7c986668c8a0ee90", "score": "0.5206883", "text": "function selectIndex(_idx) {\n\t\t\tTi.API.info('selecting base tab index: '+_idx);\n\t\t\ttabbedBar.backgroundImage = data[_idx].tabbedBarBackgroundImage;\n\t\t\twin.backgroundImage = data[_idx].winBackgroundImage;\n\t\t\tfilmStripView.fireEvent('changeIndex',{idx:_idx});\n\t\t\tcontainer.currentActive = _idx;\n\t\t}", "title": "" }, { "docid": "78902f6ff4974b5b5017db62cc66fd7c", "score": "0.52035075", "text": "function createTabGroup() {\n let pane = document.querySelector(\".pane\");\n if (pane) {\n let tabGroup = document.createElement(\"div\");\n tabGroup.classList.add(\"tab-group\");\n pane.appendChild(tabGroup);\n }\n return tabGroup; // the now existing tab group to append tab items\n }", "title": "" }, { "docid": "4d0cdee2af3d7e3e9f8ec0695986b814", "score": "0.51943856", "text": "function setGroupInitialState() {\n $(selectors.groupWidget, root).each(function (groupIndex) {\n var $group = $(this);\n\n if (groupIndex === 0 || haveFacetValuesBeenEnteredForGroup($(this))) {\n $(this).show();\n }\n else {\n // no need to show this, reset it\n resetGroup($group);\n $group.hide();\n }\n\n initializeRowsInGroup($group);\n });\n }", "title": "" }, { "docid": "f79fac936f97491a2ef97592ca087f84", "score": "0.518995", "text": "handleTabChange(index){\n Session.set('explanationOfBenefitPageTabIndex', index);\n }", "title": "" }, { "docid": "33b42b7895f69c0e5ca3fdb92a4832c3", "score": "0.5183144", "text": "handleTabChange(index){\n Session.set('observationPageTabIndex', index);\n }", "title": "" }, { "docid": "2f867e0947fa90bc039015424e71a968", "score": "0.5182955", "text": "function loadTabButtons(groupButton){\n $('#tabsList').html('');\n var inputTabs;\n var group = groupButton.value;\n \n $('#displayBody').html('');\n var title = document.querySelector('#Titles').content.querySelector('#TabGroupTitle').cloneNode(true);\n title.innerHTML = \"<i class='fa fa-arrows-alt'></i> \" + group;\n $('#displayBody').append(title);\n \n\n getTabsInfo(groupButton.dataset.id);\n inputTabs = JsonTbL;\n \n $('#optionBar').html('');\n var backButton = document.querySelector('#Buttons').content.querySelector('#backGroupStuff').cloneNode(true);\n $('#optionBar').append(backButton);\n var AddButton = document.querySelector('#Buttons').content.querySelector('#addView').cloneNode(true);\n $('#optionBar').append(AddButton);\n var openAllButton = document.querySelector('#Buttons').content.querySelector('#OpenAll').cloneNode(true);\n openAllButton.dataset.group = group;\n $('#optionBar').append(openAllButton);\n var openSomeButton = document.querySelector('#Buttons').content.querySelector('#OpenSome').cloneNode(true);\n $('#optionBar').append(openSomeButton);\n \n $('#optionBar').append(\"<br>\");\n \n //Populates page with buttons that are the tabs of the group\n for (i=0; i<inputTabs.length; i++){\n var template = document.querySelector('#Buttons').content.querySelector('#TabButton').cloneNode(true);\n \n template.value=inputTabs[i].title;\n template.setAttribute(\"href\",inputTabs[i].url);\n template.dataset.group = group;\n \n $('#tabsList').append(template);\n $('#tabsList').append(\"<br>\");\n }\n}", "title": "" }, { "docid": "50433e44e80cc6c87f448322c4740579", "score": "0.5176259", "text": "function getImbaAdminTabIdFromTabIndex(tabModuleIndex){\n var moduleResult = \"\";\n $.each($(\"#imbaContentNav a\"), function (k, v) {\n if (k == tabModuleIndex){\n var moduleTmp = v.toString().split(\"#\");\n moduleResult = \"#\" + moduleTmp[1];\n }\n });\n\n return moduleResult;\n}", "title": "" }, { "docid": "9f666c254b60e643e5ccf6ea3682e1b6", "score": "0.51686877", "text": "getIndexSet(spriteGroup) {\n let set = new Set();\n spriteGroup.forEach(s => {\n let pos = s.gridpos;\n set.add(getIndex(pos.i, pos.j))\n });\n return set;\n }", "title": "" }, { "docid": "fa93503624e4fd0f3288d5c474597525", "score": "0.51361907", "text": "function _addFieldGroups() {\n var dialog = $('#perc-edit-site-section-dialog');\n var fieldGroups = [\n { groupName : \"perc-site-general-container\", groupLabel : I18N.message(\"perc.ui.editSiteSectionDialog.label@Site\")},\n { groupName : \"perc-site-users-container\", groupLabel : I18N.message(\"perc.ui.editSiteSectionDialog.label@Users\")},\n { groupName : \"perc-site-security-container\", groupLabel : I18N.message(\"perc.ui.editSiteSectionDialog.label@Security\")},\n { groupName : \"perc-site-membership-container\", groupLabel : I18N.message(\"perc.ui.editSiteSectionDialog.label@Membership\")}\n ];\n $.each(fieldGroups, function(index) {\n // Create HTML markup with the groupName minimizer/maximizer and\n // insert it before the 1st field in each group\n var minmaxClass = (index === 0) ? \"perc-items-minimizer\" : \"perc-items-maximizer\";\n var groupHtml =\n \"<div class='perc-section-header'>\" +\n \"<div class='perc-section-label' data-group='\" + this.groupName + \"'>\" +\n \"<span class='perc-min-max \" + minmaxClass + \"' ></span>\" + this.groupLabel +\n \"</div>\" +\n \"</div>\";\n dialog.find('#' + this.groupName).before(groupHtml);\n // The first group will be the only one expanded (hide all others)\n if(index !== 0){\n dialog.find('#' + this.groupName).hide();\n }\n });\n\n // Bind collapsible event\n dialog.find(\".perc-section-label\").off(\"click\").on(\"click\",function() {\n var self = $(this);\n self.find(\".perc-min-max\")\n .toggleClass('perc-items-minimizer')\n .toggleClass('perc-items-maximizer');\n dialog.find('#' + self.attr('data-group')).toggle();\n });\n }", "title": "" }, { "docid": "44ee4996e238e778c99068d8ad65a47e", "score": "0.5119764", "text": "_groupSelectedTabs(tab) {\n let draggedTabPos = tab._tPos;\n let selectedTabs = gBrowser.selectedTabs;\n let animate = gBrowser.animationsEnabled;\n\n tab.groupingTabsData = {\n finished: !animate,\n };\n\n // Animate left selected tabs\n\n let insertAtPos = draggedTabPos - 1;\n for (let i = selectedTabs.indexOf(tab) - 1; i > -1; i--) {\n let movingTab = selectedTabs[i];\n insertAtPos = newIndex(movingTab, insertAtPos);\n\n if (animate) {\n movingTab.groupingTabsData = {};\n addAnimationData(movingTab, insertAtPos, \"left\");\n } else {\n gBrowser.moveTabTo(movingTab, insertAtPos);\n }\n insertAtPos--;\n }\n\n // Animate right selected tabs\n\n insertAtPos = draggedTabPos + 1;\n for (let i = selectedTabs.indexOf(tab) + 1; i < selectedTabs.length; i++) {\n let movingTab = selectedTabs[i];\n insertAtPos = newIndex(movingTab, insertAtPos);\n\n if (animate) {\n movingTab.groupingTabsData = {};\n addAnimationData(movingTab, insertAtPos, \"right\");\n } else {\n gBrowser.moveTabTo(movingTab, insertAtPos);\n }\n insertAtPos++;\n }\n\n // Slide the relevant tabs to their new position.\n for (let t of this._getVisibleTabs()) {\n if (t.groupingTabsData && t.groupingTabsData.translateX) {\n let translateX = (RTL_UI ? -1 : 1) * t.groupingTabsData.translateX;\n t.style.transform = \"translateX(\" + translateX + \"px)\";\n }\n }\n\n function newIndex(aTab, index) {\n // Don't allow mixing pinned and unpinned tabs.\n if (aTab.pinned) {\n return Math.min(index, gBrowser._numPinnedTabs - 1);\n }\n return Math.max(index, gBrowser._numPinnedTabs);\n }\n\n function addAnimationData(movingTab, movingTabNewIndex, side) {\n let movingTabOldIndex = movingTab._tPos;\n\n if (movingTabOldIndex == movingTabNewIndex) {\n // movingTab is already at the right position\n // and thus don't need to be animated.\n return;\n }\n\n let movingTabWidth = movingTab.getBoundingClientRect().width;\n let shift = (movingTabNewIndex - movingTabOldIndex) * movingTabWidth;\n\n movingTab.groupingTabsData.animate = true;\n movingTab.setAttribute(\"tab-grouping\", \"true\");\n\n movingTab.groupingTabsData.translateX = shift;\n\n let onTransitionEnd = transitionendEvent => {\n if (transitionendEvent.propertyName != \"transform\" ||\n transitionendEvent.originalTarget != movingTab) {\n return;\n }\n movingTab.removeEventListener(\"transitionend\", onTransitionEnd);\n movingTab.groupingTabsData.newIndex = movingTabNewIndex;\n movingTab.groupingTabsData.animate = false;\n };\n\n movingTab.addEventListener(\"transitionend\", onTransitionEnd);\n\n // Add animation data for tabs between movingTab (selected\n // tab moving towards the dragged tab) and draggedTab.\n // Those tabs in the middle should move in\n // the opposite direction of movingTab.\n\n let lowerIndex = Math.min(movingTabOldIndex, draggedTabPos);\n let higherIndex = Math.max(movingTabOldIndex, draggedTabPos);\n\n for (let i = lowerIndex + 1; i < higherIndex; i++) {\n let middleTab = gBrowser.visibleTabs[i];\n\n if (middleTab.pinned != movingTab.pinned) {\n // Don't mix pinned and unpinned tabs\n break;\n }\n\n if (middleTab.multiselected) {\n // Skip because this selected tab should\n // be shifted towards the dragged Tab.\n continue;\n }\n\n if (!middleTab.groupingTabsData || !middleTab.groupingTabsData.translateX) {\n middleTab.groupingTabsData = { translateX: 0 };\n }\n if (side == \"left\") {\n middleTab.groupingTabsData.translateX -= movingTabWidth;\n } else {\n middleTab.groupingTabsData.translateX += movingTabWidth;\n }\n\n middleTab.setAttribute(\"tab-grouping\", \"true\");\n }\n }\n }", "title": "" }, { "docid": "98d49ebbc8d374c5569f4fcafc000403", "score": "0.51168334", "text": "function set_tab_visibility() \n{\n\tRMPApplication.debug(\"begin set_tab_visibility : login = \" + login);\n c_debug(dbug.function, \"=> begin set_tab_visibility : login = \" + login);\n\t// Following tab will be opened at start according specific users\n\t// Tab [0]: My tasks\n\t// Tab [1]: To close\n\t// Tab [2]: Requests (draft)\n // Tab [3]: My Tasks (Country)\n // Tab [4]: Country Desk\n\t// Tab [5]: Engineer\n\t// Tab [6]: GDC - All\n // Tab [7]: Designer View\n \n\tif (login.is_gdc == true) {\n id_tabs_my_tasks.setSelectedTabIndex(1); // To close \n }\n \n else if (login.is_country_desk == true) {\n id_tabs_my_tasks.setSelectedTabIndex(3);\t\t// My tasks (Country)\n }\n \n else if (login.is_engineer == true) {\n id_tabs_my_tasks.setSelectedTabIndex(0);\t\t// My tasks\n\t}\n \n RMPApplication.debug(\"end set_tab_visibility\");\n c_debug(dbug.function, \"=> end set_tab_visibility\");\n}", "title": "" }, { "docid": "5912c3ae6e6c0037bb0b4ebdf57763f7", "score": "0.51089036", "text": "function onCreateTabInGroup(event) {\n\t\tlet group = GU.findGroup(event.target.value);\n\t\tGU.createTabInGroup(group, true);\n\t\tlet urlbar = $(\"urlbar\");\n\t\tif (urlbar) urlbar.focus();\n\t}", "title": "" }, { "docid": "0ac22cd1c686db4057aa39f2e9618e4b", "score": "0.5106368", "text": "selectInitialTabs() {\n const selectedElements = [];\n\n this.allElements.filter(item => {\n if (\n item.getAttribute(\"data-tab-id\") === this.initialTab &&\n this.tabGroups.includes(item.getAttribute(\"data-tab-group-id\"))\n ) {\n selectedElements.push(item);\n }\n\n if (\n item.getAttribute(\"data-tab-open-id\") === this.initialTab &&\n this.tabGroups.includes(item.getAttribute(\"data-tab-group-id\"))\n ) {\n selectedElements.push(item);\n }\n });\n\n selectedElements.map(item => item.classList.add(\"is-active\"));\n }", "title": "" }, { "docid": "be74b1680c01056f409043d594fb985e", "score": "0.50994974", "text": "function init() {\n chrome.windows.getCurrent({populate: true}, function(currentWindow) {\n chrome.tabs.query({currentWindow: true, active: true}, function(tabs) {\n var current = currentWindow.tabs.filter(function(tab) {\n return tab.active;\n })[0];\n chrome.processes.getProcessIdForTab(current.id,\n function(pid) {\n var outputDiv = document.getElementById(\"tab-list\");\n var titleDiv = document.getElementById(\"title\");\n titleDiv.innerHTML = \"<b>Tabs in Process \" + pid + \":</b>\";\n displayTabInfo(currentWindow.id, current, outputDiv);\n displaySameProcessTabs(current, pid, outputDiv);\n }\n );\n\n });\n });\n}", "title": "" }, { "docid": "12202aadf9ee0074faf8ba2f83fa48f1", "score": "0.5099043", "text": "_setDefaultTabs() {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n if (this.APP_GLOBAL.isEntities())\n PopEntity.setEntityTabs('default', [EntityGeneralTab, EntityHistoryTab]);\n return resolve(true);\n }));\n }", "title": "" }, { "docid": "b92eb32c5f73a8d4840d9ec355b968cf", "score": "0.50943583", "text": "add_group(groupname, group, active) {\r\n var is_active = active ? \"active\" : \"\"\r\n var selected = active ? \"true\" : \"false\"\r\n var tab = '\\\r\n <a class=\"nav-link '+is_active+'\" id=\"'+this.id+'_groups_'+groupname+'_tab\" data-toggle=\"pill\" href=\"#'+this.id+'_groups_'+groupname+'_tab_content\" role=\"tab\" aria-controls=\"'+this.id+'_groups_'+groupname+'_tab_content\" aria-selected=\"'+selected+'\">'+groupname+'</a>\\\r\n '\r\n $(\"#\"+this.id+\"_groups_tabs\").append(tab)\r\n var is_active = active ? \"show active\" : \"\"\r\n var tab_content = '\\\r\n <div class=\"tab-pane fade '+is_active+'\" id=\"'+this.id+'_groups_'+groupname+'_tab_content\" role=\"tabpanel\" aria-labelledby=\"'+this.id+'_groups_'+groupname+'_tab\">\\\r\n </div>\\\r\n '\r\n $(\"#\"+this.id+\"_groups_tab_content\").append(tab_content)\r\n for (var username of group) {\r\n this.add_user_to_group(groupname, username)\r\n }\r\n }", "title": "" }, { "docid": "9997237308720b7b93803e693664a585", "score": "0.50943047", "text": "function getTabGroup() {\n // Existing or non-existing tab container\n let tabGroup = document.querySelector(\".tab-group\");\n return tabGroup ? tabGroup : createTabGroup();\n\n // Create new tab group if not exists\n function createTabGroup() {\n let pane = document.querySelector(\".pane\");\n if (pane) {\n let tabGroup = document.createElement(\"div\");\n tabGroup.classList.add(\"tab-group\");\n pane.appendChild(tabGroup);\n }\n return tabGroup; // the now existing tab group to append tab items\n }\n }", "title": "" }, { "docid": "b8de30cccb452ae7b3a032e99f781678", "score": "0.50830233", "text": "function initTabArray(tabCount, races, supportsField, supportsSNotation, isMulti, isQuinella, isAllUp, isPreselect, isRacingFormat) {\n tabSelectionsArray = [];\n isMultiRace = isMulti;\n isSNotationAvailable = supportsSNotation;\n isAllUpBetType = isAllUp;\n allUpFormula = \"\";\n defaultFormula = \"\";\n self.isRacingFormat = isRacingFormat;\n for (var i = 0; i < tabCount; i++) {\n tabSelectionsArray.push(new tabSelections(races[i], supportsField, supportsSNotation ? i : 0, jQuery(\"ul.tabs.top a\").eq(i).text(), isQuinella, isRacingFormat));\n }\n\n //if isPreselect is true it means there are some selections in the HTML that we need to maintain.\n //Only coded/tested for FOB pre-selections so far.\n if (isPreselect) {\n saveSelections();\n }\n\n changeToTab(0);\n }", "title": "" }, { "docid": "27f728701661c4ca94aa84f541bd3419", "score": "0.50749964", "text": "createGroup () {\n W.accelerators.Groups[this.group] = []\n W.accelerators.Groups[this.group].members = []\n\n if (this.title && !I18n.translations[I18n.currentLocale()].keyboard_shortcuts.groups[this.group]) {\n I18n.translations[I18n.currentLocale()].keyboard_shortcuts.groups[this.group] = []\n I18n.translations[I18n.currentLocale()].keyboard_shortcuts.groups[this.group].description = this.title\n I18n.translations[I18n.currentLocale()].keyboard_shortcuts.groups[this.group].members = []\n }\n }", "title": "" }, { "docid": "690b958cf38b229a9acbf107582e19d3", "score": "0.5067977", "text": "function allTabs(command)\r\n{\r\n\tchrome.storage.local.get(\"objectArr\", function(group)\r\n\t{\r\n\t\tvar promptUser = prompt(\"Group name: \");\r\n\t\t// limit the text so that the text can fit in the button\r\n\t\tpromptUser = promptUser.substr(0, 26);\r\n\r\n\t\t/* checks if name is invalid */\r\n\t\tif (promptUser == \"\")\r\n\t\t{\r\n\t\t\talert(\"Please enter a name for the group!\");\r\n\t\t\t/* returns so user can re-enter text into text field */\r\n\t\t\t// for context menu\r\n\t\t\tif (command.menuItemId != null)\r\n\t\t\t{\r\n\t\t\t\tallTabs(command.menuItemId);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* stores the group name and the names, urls, and colors of the tabs into an object for storage */\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar groupObject = {};\r\n\r\n\t\t\t/* stores information from all of the tabs into an object and then puts object into storage */\r\n\t\t\tchrome.windows.getAll({populate: true}, function(windows)\r\n\t\t\t{\r\n\t\t\t\t// used to decide storing of a single window or multiple windows\r\n\t\t\t\tvar singleWindow = false;\r\n\r\n\t\t\t\t/* checks if saving single window */\r\n\t\t\t\tif (windows.length < 2)\r\n\t\t\t\t{\r\n\t\t\t\t\tsingleWindow = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* initializing name, url, and color array */\r\n\t\t\t\tvar tabNamesArr = windows.map(w => w.tabs.map(tab => tab.title));\r\n\t\t\t\tvar tabUrlsArr = windows.map(w => w.tabs.map(tab => tab.url));\r\n\t\t\t\tvar tabColorsArr = windows.map(w => w.tabs.map(tab => tab.favIconUrl));\r\n\r\n\t\t\t\t// stores each window's tab count into an array\r\n\t\t\t\tvar tabCount = new Array(windows.length);\r\n\t\t\t\tvar tabCounter = 0;\r\n\t\t\t\tvar windowCounter = 0;\r\n\r\n\t\t\t\t/* fills tabCount with a single window's tab number */\r\n\t\t\t\tif (singleWindow)\r\n\t\t\t\t{\r\n\t\t\t\t\t/* iterates through the tabs in the window */\r\n\t\t\t\t\twindows.forEach(function(tab)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttabCounter++;\r\n\t\t\t\t\t})\r\n\t\t\t\t\ttabCount[windowCounter] = tabCounter;\r\n\t\t\t\t\t\r\n\t\t\t\t\twindowCounter++;\r\n\t\t\t\t\t// tabCount[1] will contain a flag that there is only a single window stored, with 0 as the flag\r\n\t\t\t\t\ttabCount[windowCounter] = 0;\r\n\t\t\t\t}\r\n\t\t\t\t/* fills tabCount with several window tab numbers */\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/* iterates through each window */\r\n\t\t\t\t\twindows.forEach(function(window)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/* iterates through the tabs of the current window */\r\n\t\t\t\t\t\twindow.tabs.forEach(function(tab)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttabCounter++;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\ttabCount[windowCounter] = tabCounter;\r\n\t\t\t\t\t\t// reset tabCounter for next window\r\n\t\t\t\t\t\ttabCounter = 0;\r\n\t\t\t\t\t\t// for storing windows in tabCount\r\n\t\t\t\t\t\twindowCounter++;\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* initialize object content */\r\n\t\t\t\tvar groupName = \"groupName\";\r\n\t\t\t\tgroupObject[groupName] = promptUser;\r\n\r\n\t\t\t\tvar tabNames = \"tabNames\";\r\n\t\t\t\tgroupObject[tabNames] = tabNamesArr;\r\n\r\n\t\t\t\tvar tabUrls = \"tabUrls\";\r\n\t\t\t\tgroupObject[tabUrls] = tabUrlsArr;\r\n\r\n\t\t\t\tvar tabColor = \"tabColor\";\r\n\t\t\t\tgroupObject[tabColor] = tabColorsArr;\r\n\r\n\t\t\t\tvar tabCount2 = \"tabCount\";\r\n\t\t\t\tgroupObject[tabCount2] = tabCount;\r\n\r\n\t\t\t\tgroup.objectArr.push(groupObject);\r\n\t\t\t\tvar objectArr = group.objectArr;\r\n\r\n\t\t\t\t// updates storage with new objectArr with groupObject\r\n\t\t\t\tchrome.storage.local.set({\"objectArr\": objectArr});\r\n\r\n\t\t\t\t/* checks if duplicate name */\r\n\t\t\t\t// specified command to have duplicate checked the same way as the sort colors command\r\n\t\t\t\tcheckDuplicateName(promptUser, objectArr, command);\r\n\t\t\t})\r\n\t\t}\r\n\t})\r\n}", "title": "" }, { "docid": "c663bf8bc6cffdbe19caf39d8388f884", "score": "0.5066518", "text": "changeGroupSelectionFilter(id, previousValue) {\n const nextSelectionFilter = Utils.getCopy(this.state.selectionFilter);\n let tabs = nextSelectionFilter[id].tabs;\n\n if (previousValue < tabs.length) {\n tabs = tabs.map((tab)=>true);\n nextSelectionFilter[id] = {\n selected: tabs.length,\n tabs,\n };\n } else {\n tabs = tabs.map((tab)=>false);\n nextSelectionFilter[id] = {\n selected: 0,\n tabs,\n };\n }\n\n this.setSelectionFilter(nextSelectionFilter);\n }", "title": "" }, { "docid": "ff0e7442d71f460a9ec8306bee195f67", "score": "0.5060458", "text": "function loadPageIndex(){\n\t//console.log(\"inside load page index\");\n\tvar groupIndex = $(\"#indexList\").contents().length != 0;\n\tvar nonGroupIndex = $(\"#nongroupindex\").contents().length != 0;\n\t\n\tconsole.log(\"groupIndex = \" + groupIndex + \" nonGroupIndex = \" + nonGroupIndex);\n\tif(!groupIndex && !nonGroupIndex) {\n\t\tshowIndexPane(false);\n\t\tpositionNoIndexPopup();\n\t}\n\telse {\n\t\tif(nonGroupIndex) {\n\t\t\t$(\"#nongroupindex\").removeClass(\"hideContent\");\n\t\t\t$(\"#nongroupindex\").css(\"display\", \"block\");\n\t\t} else {\n\t\t\t$(\"#nongroupindex\").addClass(\"hideContent\");\n\t\t\t$(\"#nongroupindex\").css(\"display\", \"none\");\n\t\t}\n\t\tshowIndexPane(true);\n\t\tpositionIndexPopup();\n\t\t\n\t\t$(\"#nongroupindex a\").click(function(e){\n\t\t \n\t\t $(\"#indexContainer\").fadeOut();\n\t\t});\n\t\t$(\"#ExpandedContent a\").click(function(e){\n\t\t \n\t\t $(\"#indexContainer\").fadeOut();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "7423ae4fb16ebb526f53b441dd9d5042", "score": "0.5056908", "text": "function updateAllTabs() {\n chrome.tabs.query({}, function(tab) {\n for (var i = 0; i < tab.length; i++) {\n updateTab(tab[i], false);\n }\n });\n\n // Update currentTabId\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n if (tabs.length > 0) {\n currentTabId = tabs[0].id;\n }\n });\n}", "title": "" }, { "docid": "5a60d48421ec694ef552266fc2556e11", "score": "0.50552636", "text": "function handleAllIdSearches(activeTab, pageOffset) {\n if(activeTab && pageOffset){\n switch (activeTab) {\n case 'assays':\n handleSearch('/BARD/bardWebInterface/searchAssaysByIDs?offset=' + pageOffset, 'searchForm', 'assaysTab', 'totalAssays', 'Assay Definitions ', 'assays');\n handleSearch('/BARD/bardWebInterface/searchCompoundsByIDs', 'searchForm', 'compoundsTab', 'totalCompounds', 'Compounds ', 'compounds');\n handleSearch('/BARD/bardWebInterface/searchProjectsByIDs', 'searchForm', 'projectsTab', 'totalProjects', 'Projects ', 'projects');\n handleSearch('/BARD/bardWebInterface/searchExperimentsByIDs', 'searchForm', 'experimentsTab', 'totalExperiments', 'Experiments ', 'experiments');\n break;\n case 'compounds':\n handleSearch('/BARD/bardWebInterface/searchAssaysByIDs', 'searchForm', 'assaysTab', 'totalAssays', 'Assay Definitions ', 'assays');\n handleSearch('/BARD/bardWebInterface/searchCompoundsByIDs?offset=' + pageOffset, 'searchForm', 'compoundsTab', 'totalCompounds', 'Compounds ', 'compounds');\n handleSearch('/BARD/bardWebInterface/searchProjectsByIDs', 'searchForm', 'projectsTab', 'totalProjects', 'Projects ', 'projects');\n handleSearch('/BARD/bardWebInterface/searchExperimentsByIDs', 'searchForm', 'experimentsTab', 'totalExperiments', 'Experiments ', 'experiments');\n break;\n case 'projects':\n handleSearch('/BARD/bardWebInterface/searchAssaysByIDs', 'searchForm', 'assaysTab', 'totalAssays', 'Assay Definitions ', 'assays');\n handleSearch('/BARD/bardWebInterface/searchCompoundsByIDs', 'searchForm', 'compoundsTab', 'totalCompounds', 'Compounds ', 'compounds');\n handleSearch('/BARD/bardWebInterface/searchProjectsByIDs?offset=' + pageOffset, 'searchForm', 'projectsTab', 'totalProjects', 'Projects ', 'projects');\n handleSearch('/BARD/bardWebInterface/searchExperimentsByIDs', 'searchForm', 'experimentsTab', 'totalExperiments', 'Experiments ', 'experiments');\n break;\n case 'experiments':\n handleSearch('/BARD/bardWebInterface/searchAssaysByIDs', 'searchForm', 'assaysTab', 'totalAssays', 'Assay Definitions ', 'assays');\n handleSearch('/BARD/bardWebInterface/searchCompoundsByIDs', 'searchForm', 'compoundsTab', 'totalCompounds', 'Compounds ', 'compounds');\n handleSearch('/BARD/bardWebInterface/searchProjectsByIDs', 'searchForm', 'projectsTab', 'totalProjects', 'Projects ', 'projects');\n handleSearch('/BARD/bardWebInterface/searchExperimentsByIDs?offset=' + pageOffset, 'searchForm', 'experimentsTab', 'totalExperiments', 'Experiments ', 'experiments');\n break;\n }\n }\n else{\n handleSearch(rootURL + 'searchAssaysByIDs', 'searchForm', 'assaysTab', 'totalAssays', 'Assay Definitions ', 'assays');\n handleSearch(rootURL + 'searchCompoundsByIDs', 'searchForm', 'compoundsTab', 'totalCompounds', 'Compounds ', 'compounds');\n handleSearch(rootURL + 'searchProjectsByIDs', 'searchForm', 'projectsTab', 'totalProjects', 'Projects ', 'projects');\n handleSearch(rootURL + 'searchExperimentsByIDs', 'searchForm', 'experimentsTab', 'totalExperiments', 'Experiments ', 'experiments');\n }\n}", "title": "" }, { "docid": "5b8a45855645e846454196c7a6fa6be9", "score": "0.50520086", "text": "getState(noInstances) {\n const that = this,\n autoHideItems = that.getAutoHideItems(),\n undockedItems = that.undockedItems,\n structure = [];\n\n for (let i = 0; i < autoHideItems.length; i++) {\n structure.push(that._createTabsWindowStructure(autoHideItems[i], noInstances));\n }\n\n for (let i = 0; i < undockedItems.length; i++) {\n structure.push(that._createTabsWindowStructure(undockedItems[i], noInstances));\n }\n\n return [{\n type: 'LayoutGroup',\n items: structure.concat(that._createLayoutStructure(that.$.itemsContainer, noInstances)),\n orientation: that.$.itemsContainer.orientation\n }];\n }", "title": "" }, { "docid": "87e10507a9a06240e96bb7ea09eaa1e8", "score": "0.5051648", "text": "function dumpTabs() {\n console.log(\"-start-\");\n console.log(\"#: (window_id) [index]\")\n var count = 1;\n for (var window_id in tabs_all) {\n for (var tab_id in tabs_all[window_id.toString()]) {\n var tab_obj = tabs_all[window_id.toString()][tab_id.toString()];\n console.log(\"#\" + count + \": \" + \"(\" + window_id + \")[\" + tab_obj.tab.index + \"] \" + tab_id + \":\\t created - \" + tab_obj.time_created + \", active - \" + tab_obj.time_last_active);\n count+=1;\n }\n }\n console.log(\"-end-\");\n}", "title": "" }, { "docid": "ef893ba06c7db0fbe9430fca3c92c52d", "score": "0.50369513", "text": "function initWindow(windowId) {\n panorama[windowId] = {\n currentGroup: 0,\n groups: [\n {\n name: 'Default group',\n x: 30,\n y: 30,\n width: 450,\n height: 300,\n tabs: []\n }\n ]\n };\n\n info = getGroupInfoFromWindow(windowId);\n if(firstWndCreated == false) {\n \n firstWndCreated = true;\n // Caricamento dello stato salvato (solo per la prima finestra aperta)\n chrome.storage.local.get(['groups', 'currentGroup'], function(items) {\n \n var loadDefaultGroups = false;\n if(items.groups === undefined || items.currentGroup === undefined) {\n loadDefaultGroups = true;\n } else {\n try {\n items.groups = JSON.parse(decompressString(items.groups));\n } catch (ex) {\n loadDefaultGroups = true;\n };\n }\n \n if(loadDefaultGroups) {\n // Panorama non era mai stato avviato: inseriamo nel gruppo predefinito le tab attive.\n updateGroupWithVisibleTabs(windowId, 0);\n enableChangeListeners();\n } else {\n info.currentGroup = items.currentGroup;\n info.groups = items.groups;\n \n // La funzione si occupa anche di attivare i listener\n loadGroupInWindow(info.currentGroup, windowId);\n }\n \n });\n \n } else {\n // La funzione si occupa anche di attivare i listener\n loadGroupInWindow(info.currentGroup, windowId);\n }\n}", "title": "" }, { "docid": "d88cd006e15e649c5a6c391b1165a6ed", "score": "0.50329775", "text": "getActiveActionGroupIndex( group ){\n\n\t\tlet actions = this.getActionGroup(group);\n\t\tlet label = this.getActiveActionGroupLabel(group);\n\t\tfor( let i = 0; i < actions.length; ++i ){\n\n\t\t\tif( actions[i].label === label )\n\t\t\t\treturn i;\n\n\t\t}\n\t\treturn 0;\n\n\t}", "title": "" }, { "docid": "9957021b73d8089db1837207bc9a7e4b", "score": "0.50322646", "text": "static createDefaultTab(type) {\r\n switch(type) {\r\n case \"user\":\r\n return {\r\n title: \"Users\",\r\n icon: UserIcon,\r\n table: {\r\n name: \"user\",\r\n title: \"name\",\r\n subTitleProp: \"age\",\r\n subtitle: \"Age: \",\r\n avatar: \"picture\",\r\n data: null\r\n },\r\n page: {\r\n length: 10,\r\n id: 0,\r\n data: null,\r\n isSearching: false\r\n },\r\n children: [{\r\n type: \"course\",\r\n title: \"Courses\",\r\n subtitle: \"View User's Courses\",\r\n icon: CourseIcon}],\r\n parent: {},\r\n active: true\r\n }\r\n\r\n case \"chapter\":\r\n return {\r\n title: \"Chapters\",\r\n icon: ChapterIcon,\r\n searchChildren: \"View Chapter's Course\",\r\n table: {\r\n name: \"chapter\",\r\n title: \"name\",\r\n subTitleProp: \"duration_mins\",\r\n subtitle: \"Duration: \",\r\n data: null\r\n },\r\n page: {\r\n length: 10,\r\n id: 0,\r\n data: null,\r\n isSearching: false\r\n },\r\n children: [{\r\n type: \"course\",\r\n title: \"Courses\",\r\n subtitle: \"View Chapter's Courses\",\r\n icon: CourseIcon\r\n }],\r\n parent: {},\r\n active: true\r\n }\r\n\r\n case \"course\":\r\n return {\r\n title: \"Courses\",\r\n icon: CourseIcon,\r\n searchChildren: \"View Course's Chapters\",\r\n table: {\r\n name: \"course\",\r\n title: \"name\",\r\n subTitleProp: \"difficulty\",\r\n subtitle: \"Difficulty: \",\r\n data: null\r\n },\r\n page: {\r\n length: 10,\r\n id: 0,\r\n data: null,\r\n isSearching: false\r\n },\r\n children: [{\r\n type: \"user\",\r\n title: \"User\",\r\n subtitle: \"View Course's User\",\r\n icon: UserIcon\r\n },\r\n {\r\n type: \"chapter\",\r\n title: \"Chapters\",\r\n subtitle: \"View Course's Chapters\",\r\n icon: ChapterIcon\r\n }],\r\n parent: {},\r\n active: true\r\n }\r\n\r\n default:\r\n return null;\r\n }\r\n }", "title": "" }, { "docid": "382af9fad6735a95b2240a7d03628f46", "score": "0.50248724", "text": "function getAllGroups() {\n\n\t// Grab list of all link groups and row info\n\tvar groups = [...document.querySelectorAll(selAllGroups)];\n\n\t// Store the groups array length\n\tgroupsTotal = groups.length;\n\t\n\t// FOREACH GROUP\n\tgroups.forEach(function(el, i, arr) {\n\t\t\t\t\n\t\t// Create empty object to store group data\n\t\tvar group = {};\n\n\t\t// Create empty group title variable\n\t\tvar groupTitle = '';\n\t\t\n\t\t// Which line of group info the groupName is on\n\t\tvar groupNameStartLineIndex = 2;\n\t\t\n\t\t// If group title exists, store in a variable. Else,\n\t\t// build group title from blank title counter. NOTE:\n\t\t//\ttesting for \"&nbsp;\" doesn't work but fromCharCode does.\n\t\tif (el.querySelector(selGroupTitle).innerText && \n\t\t\tel.querySelector(selGroupTitle).innerText !== String.fromCharCode(160)\n\t\t) {\n\t\t\tgroupTitle = el.querySelector(selGroupTitle).innerText;\n\t\t} else {\n\t\t\tgroupTitle = \"blankGroup_\" + blankTitleCount;\n\t\t\t\t\n\t\t\t// increment blank title counter\n\t\t\t++blankTitleCount;\n\t\t\tgroupNameStartLineIndex = 1;\n\t\t}\t\n\t\t\n\t\t// Add group title to group object\n\t\tgroup.groupTitle = groupTitle;\n\n\t\t// Grab group details block\n\t\tvar thisGroupDetails = el.querySelector(\"div > div > div\").innerText\n\t\tconsole.log(\"%cGroup Info (incl. date): \", \"background:orange\");\n\t\tconsole.log(thisGroupDetails);\n\n\t\t// Parse group details block for \n\t\tvar arrGroupDetails = thisGroupDetails.split('\\n');\n\t\t\n\t\tvar tempTimeDate = arrGroupDetails[groupNameStartLineIndex];\n\t\t\n\t\t// Determine what line of group info the date is on:\n\t\tif (tempTimeDate.includes(\"tabs\")) {\n\t\t\t\n\t\t\ttempTimeDate = arrGroupDetails[(groupNameStartLineIndex+1)];\n\t\t\t\n\t\t} else {\n\t\t\ttempTimeDate = arrGroupDetails[groupNameStartLineIndex];\n\t\t}\n\t\t\n\t\t\n\t\tconsole.log(\"%ctempTimeDate: %s \", \"background: lavender; border: solid gold 2px;\", tempTimeDate);\n\t\t// Parse time date with Regex like: \n\t\t// \tCreated 6/21/2016, 1:41:28 PM\n\t\tvar reg = /^Created\\s+(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4}),\\s(\\d{1,2}):(\\d{1,2}):(\\d{1,2})\\s([APM]{2})$/;\n\t\tvar matches = reg.exec(tempTimeDate);\n\t\t\n\t\t// debugging ... \n\t\tconsole.log(\"%c************ MATCHES ************** \", \"background:yellow\");\n\t\tconsole.log(matches);\n\t\t\n\t\tvar monthNum = matches[1] ? matches[1] : 'no-month';\n\t\tvar dayNum = matches[2];\n\t\tvar year4 = matches[3];\n\t\tvar hourNum = matches[4];\n\t\tvar minuteNum = matches[5];\n\t\tvar secondNum = matches[6];\n\t\tvar ampm = matches[7];\n\t\t\n\t\t// var date = matches[1] + \"/\" + matches[2] + \"/\" + matches[3];\n\t\t// var time = matches[4] + \":\" + matches[5] + \":\" + matches[6] + \" \" + matches[7];\n\t\tvar date = monthNum + \"/\" + dayNum + \"/\" + year4;\n\t\tvar time = hourNum + \":\" + minuteNum + \":\" + secondNum + \" \" + ampm;\n\t\t\n\t\t// Grab just date and time\n\t\tconsole.log(\"%cDate: \", \"background:bisque\");\n\t\tconsole.log(date);\n\t\tconsole.log(\"%cTime: \", \"background:bisque\");\n\t\tconsole.log(time);\n\t\t\n\t\t// Add date and time info to group object. This will help with sorting\n\t\tgroup.year = year4;\n\t\tgroup.date = date;\n\t\tgroup.time = time;\n\t\tgroup.monthNum = monthNum;\n\t\tgroup.dayNum = dayNum;\n\t\tgroup.hourNum = hourNum;\n\t\tgroup.minuteNum = minuteNum;\n\t\tgroup.secondNum = secondNum;\n\t\tgroup.ampm = ampm;\n\t\t\n\t\t// Grab list of all rows in this group\n\t\tvar rows = Array.from(el.children[1].children);\n\t\t// debugging ... child rows\n\t\tconsole.log(\"%cChild Rows: \", lemonyellow_dashed);\n\t\tconsole.log(rows);\n\t\t\n\t\t// Create rows array\n\t\tarrGroupRows = [];\n\t\t\n\t\t// Reset row counter to 1\n\t\trowCount = 1;\n\t\t\n\t\t// Foreach Row:\n\t\trows.forEach(function(el, i, arr) {\n\n\t\t\t// Create row object\n\t\t\tvar rowObj = {};\n\t\t\t\n\t\t\t// Grab row link\n\t\t\t// rowLink = el.querySelector('.row_text > a').href;\n\t\t\trowLink = el.children[1].querySelector('a').href;\n\t\t\t\n\t\t\t// Grab row text\n\t\t\trowText = el.children[1].querySelector('a').text;\n\t\t\t\n\t\t\t// Grab icon link\n\t\t\trowIconLink = el.children[1].querySelector('img').src;\n\t\t\t\n\t\t\t// Add all row data to row object\n\t\t\trowObj.rowText = rowText;\n\t\t\trowObj.rowLink = rowLink;\n\t\t\trowObj.rowIconLink = rowIconLink;\n\t\t\t\n\t\t\t// Push this row object onto group rows array\n\t\t\tarrGroupRows.push(rowObj);\n\t\t\t\t\t\t\t\t\t\n\t\t\t// Increment row counter\n\t\t\t++rowCount;\n\t\t\n\t\t});\t\n\t\t// END processing rows in this group\t\t\n\t\t\n\t\t// Add group rows array onto this group as property\n\t\tgroup.rows = arrGroupRows;\n\t\t\n\t// Push this group object onto groups array\n\tobjArrGroups.push(group);\n\t\n\t}); \n\t// END processing groups\n\n\tobjArrGroups.blankTitleCount = blankTitleCount;\n\t\n\treturn objArrGroups;\n\t\n} // END function", "title": "" }, { "docid": "e39f48d4ba2ecc2bd8557ce2343a64ae", "score": "0.5024045", "text": "function setDefaultTabs()\r\n { \t\r\n \tvar list = document.getElementsByTagName('LI');\r\n \t\r\n\t \tfor(i=0; i< headers.length; i++)\r\n \t{ \t \t\t\r\n\t\t\t\t\tvar flag = true\r\n \t \t\t\r\n \t \t\tfor(j=0; j< list.length; j++){\r\n \t \t\t\t\r\n \t \t\t\tvar node = list[j];\r\n \t \t\t\t\r\n \t \t\t\tif(node.id == trim(defaultTabs[i]) && flag)\r\n \t \t\t\t{\r\n \t \t\t\t\tcurrent[i]=node.cloneNode(false);\r\n \t \t\t\t\tnode.id='current';\r\n \t \t\t\t\tflag = false;\r\n \t \t\t\t} \t \t\t\t\t\r\n \t \t\t}\r\n \t}\r\n }", "title": "" }, { "docid": "2966f8826012adc0b66670596265c73e", "score": "0.5019047", "text": "onGetRecordIdName() { return 'idgroup'; }", "title": "" }, { "docid": "62b103dc75a6105278db6f3f57d349fd", "score": "0.501685", "text": "function initInternalTabs()\n{\n updateInternalTabs();\n\n // add listener on created tabs to push them into the internal structure\n chrome.tabs.onCreated.addListener(function(tab)\n {\n // update the internal manager\n // updateInternalTabs();\n tabsManager.createFromTab(tab);\n\n // update parent/children relationship\n chrome.tabs.getSelected(null, function(parentTab)\n {\n if (parentTab.id != tab.id)\n {\n tabsManager.pushChild(parentTab.id, tab.id);\n }\n }\n );\n }\n );\n\n // add listener when tabs are updated to update internal structure\n chrome.tabs.onUpdated.addListener(function(tabId, selectInfo, tab)\n {\n // update the internal manager\n // updateInternalTabs();\n tabsManager.createFromTab(tab);\n }\n );\n\n // add listener update internal tabs when chrome tabs are moved around\n chrome.tabs.onMoved.addListener(function(tabId, moveInfo)\n {\n // update internal manager\n chrome.tabs.get(tabId, function(tab)\n {\n tabsManager.createFromTab(tab);\n }\n );\n\n }\n );\n\n // register listeners to update internal tabs whenever something happens to a tab\n // add code here for detach, move etc.\n // maybe add code for time interval and call the update (Just in case)\n}", "title": "" }, { "docid": "b215484b721202b05e51a01f3cad1513", "score": "0.50153834", "text": "function reIndexage(tab){\n\tvar newTab = new Object();\n\tvar i =0;\n\t\n $.each(tab, function(ind, val){\t\t\n\t\tnewTab[i]=val;\t\n\t\ti++;\n });\n\treturn newTab;\n}", "title": "" }, { "docid": "88c06323e64386b7bf4f912a150f97e8", "score": "0.5003124", "text": "function updateGroups() {\n\t function createGroup(groupInfo, itemsContainer) {\n\t var GroupType = (groupInfo.enableCellSpanning ?\n\t Groups.CellSpanningGroup :\n\t Groups.UniformGroup);\n\t return new GroupType(that, itemsContainer);\n\t }\n\n\t var oldRealizedItemRange = (that._groups.length > 0 ?\n\t that._getRealizationRange() :\n\t null),\n\t newGroups = [],\n\t prepared = [],\n\t cleanUpDom = {},\n\t newGroupMap = {},\n\t currentIndex = 0,\n\t len = tree.length,\n\t i;\n\n\t for (i = 0; i < len; i++) {\n\t var oldChangedRealizedRangeInGroup = null,\n\t groupInfo = that._getGroupInfo(i),\n\t groupKey = that._site.groupFromIndex(i).key,\n\t oldGroup = that._groupMap[groupKey],\n\t wasCellSpanning = oldGroup instanceof Groups.CellSpanningGroup,\n\t isCellSpanning = groupInfo.enableCellSpanning;\n\n\t if (oldGroup) {\n\t if (wasCellSpanning !== isCellSpanning) {\n\t // The group has changed types so DOM needs to be cleaned up\n\t cleanUpDom[groupKey] = true;\n\t } else {\n\t // Compute the range of changed items that is within the group's realized range\n\t var firstChangedIndexInGroup = Math.max(0, changedRange.firstIndex - oldGroup.startIndex),\n\t oldRealizedItemRangeInGroup = that._rangeForGroup(oldGroup, oldRealizedItemRange);\n\t if (oldRealizedItemRangeInGroup && firstChangedIndexInGroup <= oldRealizedItemRangeInGroup.lastIndex) {\n\t // The old changed realized range is non-empty\n\t oldChangedRealizedRangeInGroup = {\n\t firstIndex: Math.max(firstChangedIndexInGroup, oldRealizedItemRangeInGroup.firstIndex),\n\t lastIndex: oldRealizedItemRangeInGroup.lastIndex\n\t };\n\t }\n\t }\n\t }\n\t var group = createGroup(groupInfo, tree[i].itemsContainer.element);\n\t var prepareLayoutPromise;\n\t if (group.prepareLayoutWithCopyOfTree) {\n\t prepareLayoutPromise = group.prepareLayoutWithCopyOfTree(copyItemsContainerTree(tree[i].itemsContainer), oldChangedRealizedRangeInGroup, oldGroup, {\n\t groupInfo: groupInfo,\n\t startIndex: currentIndex,\n\t });\n\t } else {\n\t prepareLayoutPromise = group.prepareLayout(getItemsContainerLength(tree[i].itemsContainer), oldChangedRealizedRangeInGroup, oldGroup, {\n\t groupInfo: groupInfo,\n\t startIndex: currentIndex,\n\t });\n\t }\n\t prepared.push(prepareLayoutPromise);\n\n\t currentIndex += group.count;\n\n\t newGroups.push(group);\n\t newGroupMap[groupKey] = group;\n\t }\n\n\t return Promise.join(prepared).then(function () {\n\t var currentOffset = 0;\n\t for (var i = 0, len = newGroups.length; i < len; i++) {\n\t var group = newGroups[i];\n\t group.offset = currentOffset;\n\t currentOffset += that._getGroupSize(group);\n\t }\n\n\t // Clean up deleted groups\n\t Object.keys(that._groupMap).forEach(function (deletedKey) {\n\t var skipDomCleanUp = !cleanUpDom[deletedKey];\n\t that._groupMap[deletedKey].cleanUp(skipDomCleanUp);\n\t });\n\n\t that._groups = newGroups;\n\t that._groupMap = newGroupMap;\n\t });\n\t }", "title": "" }, { "docid": "a5c16d4b014135053d593b5fda67d5de", "score": "0.4995378", "text": "function checkIndex(){\n\t//Place panels - index, glossary, resources, references, others...\n\tif($(data).find('masterIndex').attr('value') == \"true\"){\n\t\tmasterIndex = true;\n\t\t\n\t\tprogressMode = $(data).find('progressMode').attr('value');\n\t\t\n\t\tif($(data).find('masterIndex').attr('showpagenumbers') == undefined){\n\t\t\t$(data).find('masterIndex').attr('showpagenumbers', false);\n\t\t}\n\t\t\n\t\tif($(data).find('masterIndex').attr('showpagenumbers') != \"false\"){\n\t\t\tshowPageNumbers = true;\n\t\t}\n\t\t\t\t\n\t\tif(progressMode == \"linear\" || progressMode == \"lockStep\"){\n\t\t\tisLinear = true;\n\t\t}\n\t\t$('#panes').append(\"<div id='indexPane' class='pane'><div id='indexTab' class='paneTab' role='button' aria-label='click here to toggle content index currently closed' title='click here to toggle content index'/></div>\");\n\n\t\t//Set index tab action to open and close the index.\n\t\t$('#indexTab').click(toggleIndex).keypress(function(event) {\n\t\t\tvar chCode = ('charCode' in event) ? event.charCode : event.keyCode;\n\t\t if (chCode == 32 || chCode == 13){\n\t\t\t $(this).click();\n\t\t\t}\n\t });\n\t\t\n\t\tif(!isMobile){\n\t\t\t$('#indexTab').tooltip(); // don't attach tooltip on mobile devices\n\t\t}\n\n\t\taddIndex(true);\n\t\tgimmeIndexPos();\n\t}\n}", "title": "" }, { "docid": "d77ae1a5e3b7c024c5c4936fae32637b", "score": "0.4992558", "text": "function setTabHeaders(sheetIndex) {\n duncanHeadersList.textContent = \"\";\n let googleSheet = googleSheetData[sheetIndex];\n let A1 = googleSheet[0].content.$t;\n headersArray = [`All - ${A1}`];\n\n googleSheet.forEach((entry, i) => {\n if (\n entry.gs$cell.col === \"3\" &&\n !headersArray.includes(entry.content.$t) &&\n entry.gs$cell.row !== \"1\"\n ) {\n headersArray.push(entry.content.$t);\n }\n });\n\n headersArray.forEach((element) => {\n const node = document.createElement(\"Li\");\n const textnode = document.createTextNode(element);\n node.appendChild(textnode);\n node.id = sheetIndex;\n duncanHeadersList.appendChild(node);\n });\n}", "title": "" }, { "docid": "33dd80e1da4cae2ce847c3afe0a68908", "score": "0.4987184", "text": "function Project_Tabs_Change()\n{\n\tif( DebugModeProject ) window.alert( \"function Project_Tabs_Change\" );\n\ttry\n\t{\n\t\tvar p = myGetValue( \"cust_partner\" );\n\t\tvar t = myGetValue( \"cust_productinterest\" );\n\t\tif( DebugModeProject ) window.alert( \"function Project_Tabs_Change\\n\\tcust_partner, p = \" + p + \"\\n\\tcust_productinterest, t = \" + t );\n\t\tif(( p == 832092203 || p == 832092204 ) && \n\t\t\t( t == 279640006 || t == 832090006 || t == 279640007 || t == 832090012 || \n\t\t\tt == 279640018 || t == 832090013 || t == 279640005 || t == 832090014 ))\n\t\t{\t\n\t\t\tif( p == 832092203 )\n\t\t\t{\n\t\t\t\tswitch( t )\n\t\t\t\t{\n\t\t\t\t\tcase 279640006: Show16Tab( 11 ); break;\n\t\t\t\t\tcase 832090006: Show16Tab( 12 ); break;\n\t\t\t\t\tcase 279640007: Show16Tab( 13 ); break;\n\t\t\t\t\tcase 832090012: Show16Tab( 14 ); break;\n\t\t\t\t\tcase 279640018: Show16Tab( 15 ); break;\n\t\t\t\t\tcase 832090013: Show16Tab( 16 ); break;\n\t\t\t\t\tcase 279640005: Show16Tab( 17 ); break;\n\t\t\t\t\tcase 832090014: Show16Tab( 18 ); break;\n\t\t\t\t\tdefault: Show16Tab( 0 ); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t/* p equals to 832092204 */\n\t\t\t\tswitch( t )\n\t\t\t\t{\n\t\t\t\t\tcase 279640006: Show16Tab( 19 ); break;\n\t\t\t\t\tcase 832090006: Show16Tab( 20 ); break;\n\t\t\t\t\tcase 279640007: Show16Tab( 21 ); break;\n\t\t\t\t\tcase 832090012: Show16Tab( 22 ); break;\n\t\t\t\t\tcase 279640018: Show16Tab( 23 ); break;\n\t\t\t\t\tcase 832090013: Show16Tab( 24 ); break;\n\t\t\t\t\tcase 279640005: Show16Tab( 25 ); break;\n\t\t\t\t\tcase 832090014: Show16Tab( 26 ); break;\t\n\t\t\t\t\tdefault: Show16Tab( 0 ); break;\t\t\n\t\t\t\t}\t\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\tShow16Tab( 0 ); \n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeProject ) window.alert( \"function Project_Tabs_Change error code \" + err );\n\t}\n}", "title": "" }, { "docid": "0007b681a27fea6587cacd863a882dbc", "score": "0.49862355", "text": "function tabChanged(index) {\n for(let i =0; i < tabCount -1; i++){\n const divContent = document.getElementsByName(i.toString())[0];\n const tabButton = document.getElementsByName(`tab-button-${i}`)[0];\n if(i === index) {\n divContent.style.display = 'block';\n tabButton.classList.remove('tab-button');\n tabButton.classList.add('tab-button-selected');\n }else {\n divContent.style.display = 'none';\n tabButton.classList.add('tab-button');\n tabButton.classList.remove('tab-button-selected');\n }\n }\n}", "title": "" }, { "docid": "b601fa15b0a2aa54e10cfff837ea4f31", "score": "0.49810418", "text": "_resetTabindexToFirstSelectedOrFocusedItem() {\n this._clearTabindexForAllItems();\n // MDC does not expose the method for setting the tabindex to the first selected\n // or previously focused item. We can still access the method as private class\n // members are accessible in the transpiled JavaScript. Tracked upstream with:\n // TODO: https://github.com/material-components/material-components-web/issues/6375\n this._foundation.setTabindexToFirstSelectedOrFocusedItem();\n }", "title": "" }, { "docid": "9c5221d6ed178d1077e9b5dfbcf78ab8", "score": "0.49780697", "text": "function getAllNewTabData(){ \n\tport.postMessage({type: 'clear-data'});\n\tclearTabDOMElements('tab-container');\t\n\tshowLoadingMessage();\n}", "title": "" }, { "docid": "230748fbf559d008c72e318266b2c483", "score": "0.49753463", "text": "function initTabs() {\n\t\tvar localBelowHeader$ = my.data.uiElt$['belowHeader'];\n\n\t\tmy.data.uiElt$['figtab'] = localBelowHeader$.find('#figtab');\t\t\t// About the Figures tab\n\t\tmy.data.uiElt$['housetab'] = localBelowHeader$.find('#housetab');\t\t// About the Houses tab\t\n\t\tmy.data.uiElt$['time'] = localBelowHeader$.find('#time');\t\t\t\t// Time Transits & Rulers tab\n\t\tmy.data.uiElt$['planets'] = localBelowHeader$.find('#planets');\t\t\t// About the Planets tab\t\n\t\tmy.data.uiElt$['questions'] = localBelowHeader$.find('#questions');\t\t// Questions & Houses tab\n\t\tmy.data.uiElt$['interpts'] = localBelowHeader$.find('#interpts');\t\t// Interpretations tab\t\n\t\tmy.data.uiElt$['about'] = localBelowHeader$.find('#about');\t\t\t\t// About tab\t\n\n\t\t// Activate all the tabs\n\t\tlocalBelowHeader$.find('#appTabs a').click(function (e) {\n\t\t\te.preventDefault();\n\t\t\t$(this).tab('show');\n\t\t});\n\n\t\t// Gets & injects the html for the TIME TRANSITS AND RULERS tab\n\t\tvar file = './ajax/geomantic-hours.html';\n\t\tmy.loadRulerTimesTable(file);\n\t\t\tmy.progressBar.increase(5);\n\n\t\t// Questions in their Houses tab\n\t\tfile = './ajax/classicquestions.html';\n\t\tmy.loadQuestions(file);\n\t\t\tmy.progressBar.increase(5);\n\n\t\t// Planets Tab\n\t\tfile = './ajax/planets.html';\n\t\tmy.loadHTMLintoTab(file, my.data.uiElt$['planets'] ); // can add 3rd parameter method to run when done\n\t\t\tmy.progressBar.increase(5);\n\n\t\t// Interpretations tab\n var defaults = { // for slimscroller\n height: '300px',\n distance: '4px',\n railVisible: true,\n wheelStep: 10\n };\n\n\t\t//my.data.uiElt$['home'].find('div').slimScroll( defaults );\n\t\tmy.data.uiElt$['interpts'].find('#interptText').slimScroll( defaults );\n\t\tmy.data.uiElt$['about'].find('div').slimScroll( defaults ); // had trouble with attaching slimscroll to tab div, but it works attached to inner\n\n\t\tmy.initInterpretations();\n\t\t\tmy.progressBar.increase(5);\n\t}", "title": "" }, { "docid": "1c26f4328d0da7aece08022a2d83b4d9", "score": "0.4973929", "text": "function resetTabindex(removeprev){\n \n}", "title": "" }, { "docid": "e0e39b9af141acfa2f293cf0c4996e28", "score": "0.4969313", "text": "function setTabindexOnProperties(para){\n \n var mainBoardContainer = document.querySelectorAll(\".tab-index\");\n \n for (let i = 0; i < mainBoardContainer.length; i++){\n \n mainBoardContainer[i].tabIndex = para\n }\n \n}", "title": "" }, { "docid": "c98a73de480dac946ed57910dc4e5436", "score": "0.49662647", "text": "function initTabIndex() {\n function tabIndexNext() {\n tabIndexCounter += 1;\n return tabIndexCounter;\n }\n $('.legacy-header-top-level-item').each(function() {\n $(this).attr('tabindex', tabIndexNext())\n var name = $(this).attr('data-flyout');\n var $flyout = $('.legacy-header-flyout[data-flyout=\"' + name + '\"]');\n $flyout.find('.legacy-header-flyout-first-level-item').each(function() {\n $(this).attr('tabindex', tabIndexNext())\n var name = $(this).attr('data-second-level');\n var $secondLevel = $('.legacy-header-flyout-second-level[data-second-level=\"' + name + '\"]');\n $secondLevel.find('.legacy-header-flyout-second-level-item').each(function() {\n $(this).attr('tabindex', tabIndexNext())\n })\n })\n });\n}", "title": "" }, { "docid": "1c67996983bb50db2692993107c2c4b4", "score": "0.49637678", "text": "function changeDynamicTabDev(id,level){\n\tfor(var t=0; t<globalDeviceInformationTab.length; t++){\n\t\t$('#'+globalDeviceInformationTab[t]).removeClass('ui-state-active');\n $('#'+globalDeviceInformationTab[t]).removeClass('ui-tabs-active');\n\t}\n\tvar strArr = id.split(\"--\");\n\tvar data1 = strArr[0];\n\tvar flag = false;\n\tfor(var s=1; s<strArr.length; s++){\n\t\tdata1 += \"--\" + strArr[s];\n\t\tif(level == strArr[s] && s == strArr.length-1){\n\t\t\tflag = true;\n\t\t}\n\t\t$('#'+data1).addClass('ui-state-active');\n $('#'+data1).addClass('ui-tabs-active');\n\t}\n\tvar levelArr2 = level.split(\"--\");\n\tvar levelArr = levelArr2[levelArr2.length -1].split(\"_\");\t\n\tif(levelArr[0].match(/slot/gi) != null){\n\t\tcreateNewDisplayDeviceInformation(globaleviceInformationJSON,level,id);\n\t}else if(levelArr[0].match(/rack/gi) != null){\n\t\tcreateNewDisplayDeviceInformation(globaleviceInformationJSON,level,id);\n\t}else if(levelArr[0].match(/module/gi) != null){\n\t\tcreateNewDisplayDeviceInformation(globaleviceInformationJSON,level,id);\n\t}else if(levelArr[0].match(/port/gi) != null){\n\t\tcreateNewDisplayDeviceInformation(globaleviceInformationJSON,level,id);\n\t}else if(levelArr[0].match(/subchannel/gi) != null){\n\t\tcreateNewDisplayDeviceInformation(globaleviceInformationJSON,level,id);\n\t}\n}", "title": "" }, { "docid": "f3279ef724cf4567b99fc34f50b69de3", "score": "0.49633694", "text": "updateTabs_() {\n var numShown = 0;\n var loadedFeature = this.scope['items'][0];\n\n for (var i = 0; i < this['tabs'].length; i++) {\n if (this['tabs'][i].checkIfEnabled(loadedFeature)) {\n numShown++;\n }\n }\n this['numTabsShown'] = numShown;\n\n // If an event happened that hides the active tag reset the active tab\n if (this.scope['activeTab']['isShown'] === false) {\n this.setInitialActiveTab_();\n }\n\n this.scope.$broadcast(FeatureInfoEvent.UPDATE_TABS, loadedFeature);\n }", "title": "" }, { "docid": "fe04c2274f39794b8bb6ec5cdd4c285a", "score": "0.49610457", "text": "onGeoTabChange(index) {\n this.setState({ activeGeoTabIndex: index });\n }", "title": "" }, { "docid": "499618e1cc6db548bf1253baf37192c8", "score": "0.49590757", "text": "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 }", "title": "" }, { "docid": "8d21b2603ef68470ea51c69446543597", "score": "0.4953022", "text": "function tabCreatedEventHandler(tab){\n\t\tconsole.info(\"tabCreatedEventHandler, \");\n//\t\tvar defaultGroup = getDefaultGroup();\n//\t\tvar listElement = createTabListElementContent(tab);\n//\t\tif(defaultGroup != null){\n//\t\t\t\n//\t\t\tdefaultGroup.htmlElement.children(\"ol\").append(listElement.htmlElements.li);\n//\t\t\tdefaultGroup.tabs[tab.id] = tabs;\n//\t\t\t\n//\t\t}else{\n//\t\t\tvar tabsList = addGroup();\n//\t\t\ttabsList.append(listElement.htmlElements.li);\n//\t\t\ttabGroups[tabGroups.length-1].tabs[tab.id] = tab;\n//\t\t\tconsole.info(\"the last \",tabGroups[tabGroups.length-1].tabs);\n//\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "545ef522eaf3abc444eb1795272cfff2", "score": "0.49481183", "text": "async getTabIndex() {\n return Promise.resolve(Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll(\"calcite-tab-title\"), this.el));\n }", "title": "" }, { "docid": "545ef522eaf3abc444eb1795272cfff2", "score": "0.49481183", "text": "async getTabIndex() {\n return Promise.resolve(Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll(\"calcite-tab-title\"), this.el));\n }", "title": "" }, { "docid": "8e0ed696dad1b61f46c30969f21e8cff", "score": "0.49466842", "text": "function createWindowTabs(group, i, j)\r\n{\r\n\t/* creates a window with the first tab */\r\n\tif (j == 0)\r\n\t{\r\n\t\tchrome.windows.create({\"url\": group.objectArr[i][\"tabUrls\"][j], \"state\": \"maximized\"}, function(window)\r\n\t\t{\r\n\t\t\t// accesses the window's array of tabs to access the first tab's id to use to identify the tab for tabIdsToTitles and tabIdsToColor\r\n\t\t\tvar firstTabInWindow = window.tabs[0].id;\r\n\r\n\t\t\t/* saves the title of the tab */\r\n\t\t\tvar tabTitle = group.objectArr[i][\"tabNames\"][j];\r\n\t\t\ttabIdsToTitles[firstTabInWindow] = tabTitle;\r\n\r\n\t\t\t/* saves the color of the tab */\r\n\t\t\tvar tabColor = group.objectArr[i][\"tabColor\"][j];\r\n\t\t\ttabIdsToColor[firstTabInWindow] = tabColor;\r\n\t\t})\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/* creates the remaining tabs of the window */\r\n\t\tchrome.tabs.create({\"url\": group.objectArr[i][\"tabUrls\"][j], \"active\": false}, function(tab)\r\n\t\t{\r\n\t\t\t/* saves the title of the tab */\r\n\t\t\tvar tabTitle = group.objectArr[i][\"tabNames\"][j];\r\n\t\t\ttabIdsToTitles[tab.id] = tabTitle;\r\n\r\n\t\t\t/* saves the color of the tab */\r\n\t\t\tvar tabColor = group.objectArr[i][\"tabColor\"][j];\r\n\t\t\ttabIdsToColor[tab.id] = tabColor;\r\n\t\t})\r\n\t}\r\n}", "title": "" }, { "docid": "cffec0a98977b2aeebe763e025ef8563", "score": "0.49464795", "text": "getListOfGroups() {\n this._actionModeReader(this._actionList);\n this.urlListener = this._server.QueryInterface(Ci.nsIUrlListener);\n }", "title": "" }, { "docid": "1ff6f0132b8398b50ffe5e76adafdcae", "score": "0.49446797", "text": "getTabs() {\n const scenarios = this.getScenarios();\n const scenarioIds = Object.keys(scenarios).map(key => parseInt(key));\n return (\n scenarioIds.map(scenarioId =>\n <Tab key={scenarioId} eventKey={scenarioId} title={scenarios[scenarioId].title}>\n <QueryScenario scenarioId={scenarioId} desc={scenarios[scenarioId].desc}\n applicableFilters={scenarios[scenarioId].applicableFilters} ></QueryScenario>\n </Tab>)\n );\n }", "title": "" }, { "docid": "4c56cb930fe3c5a7198a637e919b9600", "score": "0.49351087", "text": "function KDInitProtectedGroups() {\n\tKDProtectedCosplay = [];\n\t// init protected slots\n\tfor (let a of KinkyDungeonPlayer.Appearance) {\n\t\tif (a.Asset.Group.BodyCosplay){\n\t\t\tKDProtectedCosplay.push(a.Asset.Group.Name);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b56d3e711245abd5103c3e5a5f683837", "score": "0.4914347", "text": "toggleGroupMode() {\n if (!this.isGroupMode) {\n if (this.selectedPlayers.length == 0) {\n this.selectedPlayers = this.group2SelectedPlayers.slice();\n }\n }\n this.refreshTable();\n }", "title": "" }, { "docid": "02ef0899ca2a8fb8b29163cdeba024a4", "score": "0.49123645", "text": "function changeViewByGroup1(chartId) { // for grouped chart\r\n var chartData = JSON.parse(parent.$(\"#chartData\").val());\r\n var chartType = $(\"#chartType\").val();\r\n if (chartType == \"Pie-Dashboard\") {\r\n $(\"#quickTabs\").html(\"\");\r\n } else {\r\n $(\"#viewByChange1\" + chartId).html(\"\");\r\n }\r\n var viewBys = JSON.parse(parent.$(\"#viewby\").val());\r\n var viewIds = JSON.parse(parent.$(\"#viewbyIds\").val());\r\n var viewBys1 = chartData[\"chart1\"][\"dimensions\"];\r\n var html = \"\";\r\n if (chartType !== \"Pie-Dashboard\") {\r\n for (var i = 1 in viewBys) {\r\n if (chartData[chartId][\"viewBys\"][0] != viewBys[i]) {\r\n if (chartData[chartId][\"viewBys\"][1] == viewBys[i]) {\r\n html += \"<li><a class='' id='\" + viewBys[i] + \":\" + viewIds[i] + \"' style=\\\"cursor: pointer;background-color:#808080\\\" onclick='changeViewBys1(this.id,\\\"\" + chartId + \"\\\")'>\" + viewBys[i] + \"</a></li>\";\r\n } else {\r\n html += \"<li><a class='' id='\" + viewBys[i] + \":\" + viewIds[i] + \"' style=\\\"cursor: pointer\\\" onclick='changeViewBys1(this.id,\\\"\" + chartId + \"\\\")'>\" + viewBys[i] + \"</a></li>\";\r\n }\r\n }\r\n }\r\n }\r\n var columns = chartData[\"chart1\"][\"viewBys\"];\r\n var columnId = chartData[\"chart1\"][\"dimensions\"];\r\n var columnName = [];\r\n for (var i = 1 in columnId) {\r\n columnName.push(viewBys[viewIds.indexOf(columnId[i])]);\r\n if (chartType == \"Pie-Dashboard\") {\r\n html += \"<li><a class='' id='\" + columnName[1] + \":\" + columnId[1] + \"' name='tab\" + parseInt(i + 1) + \"' style=\\\"cursor: pointer\\\" onclick='changeViewBys1(this.id,\\\"\" + chartId + \"\\\")'>\" + columnName[1] + \"</a></li>\";\r\n if (i == 1) {\r\n var chartId = \"chart1\";\r\n html += \"<li style='float:right'>\";\r\n html += \"<div class='dropdown' style='cursor:pointer;z-index:11;'><img title = 'Change ViewBy's' style='margin-left:20%;width:24px;height:24px' src='images/changeView.png' alt='Options' onclick='changeMeasByGroup11(\\\"\" + chartId + \"\\\")' ></img>\" +\r\n \"</div>\";\r\n html += \"</li>\";\r\n }\r\n }\r\n }\r\n if (chartType == \"Pie-Dashboard\") {\r\n graphViewFlag = true;\r\n $(\"#quickTabs\").html(html);\r\n $(\"#content\").find(\"[id^='tab']\").hide(); // Hide all content\r\n $(\"#quickTabs li:first\").attr(\"id\", \"current\"); // Activate the first tab\r\n $(\"#content #tab1\").fadeIn(); // Show first tab's content\r\n $('#quickTabs a').click(function(e) {\r\n e.preventDefault();\r\n if ($(this).closest(\"li\").attr(\"id\") == \"current\") { //detection for current tab\r\n return;\r\n } else {\r\n $(\"#content\").find(\"[id^='tab']\").hide(); // Hide all content\r\n $(\"#quickTabs li\").attr(\"id\", \"\"); //Reset id's\r\n $(this).parent().attr(\"id\", \"current\"); // Activate this\r\n $('#' + $(this).attr('name')).fadeIn(); // Show content for the current tab\r\n }\r\n });\r\n } else {\r\n graphViewFlag = false;\r\n $(\"#viewByChange1\" + chartId).html(html);\r\n }\r\n}", "title": "" }, { "docid": "f2869d2394fe4d1a68133e3ebbfa9b8e", "score": "0.49094215", "text": "function scriptChangeSettingsTab(tab) {\n for (let i = 0; i < scriptVariables.settingsTabs.length; i++) {\n if (scriptVariables.settingsTabs[i] === tab) {\n document.getElementById(scriptVariables.settingsTabs[i]).style.display = 'flex';\n document.getElementById(scriptVariables.settingsTabs[i]+\"-headerbutton\").style.backgroundColor = 'darkred';\n } else {\n document.getElementById(scriptVariables.settingsTabs[i]).style.display = 'none';\n document.getElementById(scriptVariables.settingsTabs[i]+\"-headerbutton\").style.backgroundColor = 'black';\n }\n }\n}", "title": "" }, { "docid": "b574d38867cee34ed02ee3bb108eee1c", "score": "0.49093413", "text": "function addGroupToList(group) {\n var groups = $(\".tablink\");\n for (var i = 0; i < groups.length; i++) {\n if ($(groups[i]).html() == group.group_name) return;\n }\n if (group.invite_accepted) $(\"#thelistgroup\").append('<li class=\"list-group-item tablink group\" data-group-id=\"' + group.group_id + '\">' + group.group_name + '</li>');\n //$(\"#groupselection\").append('<div style=\"padding-top: 2px; height: 30px; border-radius: 10px; background-color: white; -moz-box-shadow: inset 0 0 3px grey; -webkit-box-shadow: inset 0 0 3px grey; box-shadow: inset 0 0 3px grey;\" class=\"tablink text-center backvariant group\" data-group-id=\"' + group.group_id + '\">' + group.group_name + '</div><h4></h4>');\n}", "title": "" }, { "docid": "6e5c0bf874b85b19f1424f93c52cca6e", "score": "0.4907189", "text": "function ControlLevelState(iIndex) {\n if ($(\"#lstLevel\" + (iIndex + 1) + \"TblName > option\").length > 1) {\n $(\"#liPane\" + (iIndex + 1)).removeAttr(\"disabled\");\n $(\"#liPane\" + (iIndex + 1) + \" a\").attr(\"data-toggle\", \"tab\");\n $(\"#lstLevel\" + (iIndex + 1) + \"TblName\").removeAttr('disabled');\n $(\"#lstLevel\" + (iIndex + 1) + \"ViewName\").removeAttr('disabled');\n }\n else {\n for (i = (iIndex + 1) ; i <= 3 ; i++) {\n $(\"#liPane\" + i).attr('disabled', 'disabled');\n $(\"#liPane\" + i + \" a\").removeAttr(\"data-toggle\");\n ResetLevel(i);\n }\n }\n}", "title": "" }, { "docid": "4b5fb44ded0725c1d8928d759bf93928", "score": "0.4907081", "text": "function setViewPattern(obj){\n\tvar pattern = obj.id;\n\ttabsFrame.patternRestriction = pattern;\n\ttabsFrame.tablegroupsRestriction = obj.value;\n\tvar view = tabsFrame.newView;\n\t \n\t// if drawing selected and tables don't match, reset tablegroups\n\tif (pattern.match(/paginated-highlight/gi) && view.hasOwnProperty('tableGroups')) {\n\t\tif (tabsFrame.hasOwnProperty('owner2grpRestriction') && tabsFrame.hasOwnProperty('ownergrpRestriction') && tabsFrame.hasOwnProperty('datagrpRestriction')) {\t\t\n\t\t\tif (!((tabsFrame.ownergrpRestriction == tabsFrame.owner2grpRestriction) && (tabsFrame.datagrpRestriction == tabsFrame.owner2grpRestriction))) {\n\t\t\t\tview.tableGroups = new Array();\n\t\t\t\ttabsFrame.ownergrpRestriction = \"\";\n\t\t\t\ttabsFrame.owner2grpRestriction = \"\";\n\t\t\t\ttabsFrame.datagrpRestriction = \"\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// check sortfields for 1D and 2D summary reports and charts\n\t\n\tif(pattern.match(/summary/gi)){\n\t\tif(!hasCorrectSortFields(view, pattern)){\n\t\t\talert(getMessage('tooManyGroupingFields'));\n\t\t}\n\t}\n\t\n view.pattern = tabsFrame.patternRestriction;\n tabsFrame.newView = view;\n}", "title": "" }, { "docid": "2eab0c08dbe14b926c1924c43b39d73c", "score": "0.4904894", "text": "function centreTabs() {\n if ($('[data-tab-group]').length>0) {\n $('[data-tab-group]').each(function() {\n var $this = $( this ),\n head = $this.find(\"[data-tab-head]\"),\n headLinks = head.find(\"a\"),\n activeHead = head.find(\".active\"),\n activeHeadIndex = headLinks.index(activeHead),\n tabContentWrap = $this.find(\"[data-tab-content]\"),\n tabContentBlock = tabContentWrap.find(\".tab-content\"),\n activeContentClass = 'active';\n\n\n function setActive(activeHeadIndex) {\n tabContentBlock.removeClass(activeContentClass);\n tabContentBlock.eq(activeHeadIndex).addClass(activeContentClass);\n return;\n }\n\n setActive(activeHeadIndex);\n\n headLinks.on('click' , function(e) {\n e.preventDefault();\n headLinks.removeClass('active');\n $(this).addClass('active');\n activeHead = head.find(\".active\");\n activeHeadIndex = headLinks.index(activeHead);\n setActive(activeHeadIndex);\n })\n })\n }\n}", "title": "" }, { "docid": "70dfc4c3b29a2c2aec71ec1e32db63ff", "score": "0.49023184", "text": "function resetChildIndex(currentIndex, pName) {\n if (temp.resetObjectIndex[currentIndex] === true) {\n temp.resetObjectIndex[currentIndex] = false;\n temp[pName].newIndex = undefined;\n }\n }", "title": "" }, { "docid": "a18efaa5caac4cbdf304091ff90ed28d", "score": "0.48989466", "text": "constructor() {\n super();\n\n /**\n * List of tab names\n * @protected\n * @type {Array<string>}\n */\n this.tabNames = [];\n\n /**\n * List of tab layers\n * @protected\n * @type {Array<Layer>}\n */\n this.tabLayers = [];\n\n /**\n * Currently tab index\n * @protected\n * @type {number}\n */\n this.currentlyTabIndex = 0;\n\n /**\n * Tab reference x position\n * @protected\n * @type {number}\n */\n this.tabX = 0;\n /**\n * Tab reference y position\n * @protected\n * @type {number}\n */\n this.tabY = -20;\n /**\n * Tab width\n * @protected\n * @type {number}\n */\n this.tabWidth = 70;\n /**\n * Tab height\n * @protected\n * @type {number}\n */\n this.tabHeight = 20;\n /**\n * Tab padding\n * @protected\n * @type {number}\n */\n this.tabPadding = 10;\n }", "title": "" }, { "docid": "b7700c25bfdde7756c016d75bfb453e7", "score": "0.48891354", "text": "_updateTabIndex() {\n this._tabIndex = (this.options.length === 0) ? -1 : 0;\n }", "title": "" } ]
146b1c820b731ae42ece0bfe0c9ce4b9
create the slider specified by some slider[x] object.
[ { "docid": "197ba56307c9d1f2f677799fcf3ec5ca", "score": "0.0", "text": "function slider_render(obj)\n{\nvar i;\nvar span;\n\n with (window.document)\n {\n\tif (old)\n\t{\n\t write(\"<BR>No browser support for sliders<BR>\");\n\t return;\n\t}\n\n\t// now write out all the bits\n\n\tslider_render_scale(obj);\n\tslider_render_pane(obj);\n\n\tif ( obj.tick_tabs == null )\t// calculate tabs between ticks\n\t{\n\t obj.tick_tabs = (obj.scale_width-obj.tick_width) / (obj.ticks-1.0);\n\t}\n\n\tfor (i=0; i<obj.ticks; i++)\t// draw ticks and labels\n\t{\n\t slider_render_tick(i, obj);\n\t slider_render_label(i, obj);\n\t}\n\n\tslider_render_stylus_up(obj);\n\tslider_render_stylus_down(obj);\n\n\t// Install event handlers\n\n\tif (obj.interactive == true)\n\t{\n\t if (moz || dom2)\n\t {\n\t\tspan = getElementById(obj.span_id);\n\t\tspan.addEventListener(\"mousedown\",slider_stylus_mousedown, 0);\n\t\tspan.addEventListener(\"mouseup\",slider_stylus_mouseup, 0);\n\t\tspan.addEventListener(\"mousemove\",slider_stylus_mousemove, 0);\n\t }\n\t if ( ie4 || ie5 || ie6 )\n\t {\n\t\tspan = all(obj.span_id);\n\t\tspan.onmousedown = slider_stylus_mousedown;\n\t\tspan.onmouseup = slider_stylus_mouseup;\n\t\tspan.onmousemove = slider_stylus_mousemove;\n\t }\n\t if ( nn4 )\n\t {\n\t\tspan = layers[obj.span_id];\n\t\tspan.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP|Event.MOUSEMOVE);\n\t\tspan.onMouseDown = slider_stylus_mousedown;\n\t\tspan.onMouseUp = slider_stylus_mouseup;\n\t\tspan.onMouseMove = slider_stylus_mousemove;\n\t\twindow.document.onMouseMove = null;\n\t }\n\t}\n }\n}", "title": "" } ]
[ { "docid": "e47ec8b3c03fd3c79c989ddf759eb153", "score": "0.7116536", "text": "function createSlider() {\n\t// call d3 time slider library\n\td3.select('#slider').call(d3.slider().axis(d3.svg.axis().ticks(13)).min(2000).max(2012).value(2004).step(1)\n\t\t.on(\"slide\", function(evt, value) {\n\t\t\t// on slide event, update all visualizations for selected year\n\t\t\tselectedYear = value - 2000;\n\t\t\t\n\t\t\t// update map using updateChoropleth with smooth transition\n\t\t\td3.transition()\n\t\t\t.duration(500)\n\t\t\t.each(function() {\n\t\t\t\tMap.updateChoropleth(dataset[selectedYear]);\n\t\t\t});\n\t\t\t\n\t\t\tcreateScatterplot(selectedYear);\n\t\t\tcreateBarchart(selectedCountry, selectedYear);\n\t\t}));\n}", "title": "" }, { "docid": "a94cec9665e051e8cc1fb8d5174ee5c6", "score": "0.70243293", "text": "slider(x, y, options) {\n return this.appendChild(new Slider(x, y, options));\n }", "title": "" }, { "docid": "80498f81ed0a82985d8ac8f08100e6ec", "score": "0.69988775", "text": "function createSlider(type) {\n\tlet slider = document.createElement(\"input\");\n\tslider.setAttribute(\"type\", \"range\");\n\tslider.setAttribute(\"id\", type);\n\tslider.setAttribute(\"min\", \"0\");\n\tslider.setAttribute(\"max\", \"4\");\n\tslider.setAttribute(\"value\", \"2\");\n\treturn slider;\n}", "title": "" }, { "docid": "18035d769fe2eaddc4f981cdb4d01540", "score": "0.6870965", "text": "function createNewSlider(element, start, range, values, density, tooltip, postfix, thousand) {\n noUiSlider.create(element, {\n start: start,\n tooltips: tooltip,\n \tconnect: 'lower',\n \trange: range,\n pips: {\n mode: 'values',\n values: values,\n density: density,\n format: wNumb({\n postfix: postfix,\n thousand: thousand\n })\n }\n });\n}", "title": "" }, { "docid": "bcbfeb54f6c6fd691b6c67875855ce5c", "score": "0.6756144", "text": "function genSlider(selector, name, label){\n d3.select(selector).call(d3.slider(name, ws).value(0).min(-5).max(5).orientation(\"vertical\").axis(d3.svg.axis().ticks(3).orient(\"right\")));\n}", "title": "" }, { "docid": "fc9c57e2c5f078d3743900baa7093321", "score": "0.6703833", "text": "function initializeRangeSlider(rangeSliderArray,index,rangeSliderObject,indexToStart){\n\t//var app = new Framework7();\n rangeSliderArray[index]= app.range.create({\n el: '#slider' + index,\n min: 0,\n max: (rangeSliderObject[indexToStart].max - rangeSliderObject[indexToStart].min),\n step: checkStepSize(rangeSliderObject[indexToStart].max,rangeSliderObject[indexToStart].stepSize),\n on: {\n change: function () {\n }\n }\n });\n app.range.setValue('#slider'+index,0);\n}", "title": "" }, { "docid": "0040c037656d380573695fc438039c07", "score": "0.662946", "text": "addSlider(slider) {\n this.slider = slider;\n }", "title": "" }, { "docid": "3895ac1cc67903c949fe053f5440db2b", "score": "0.6626736", "text": "function buildSlider(slider) {\n \n //create outer container element (contains paging)\n var wrappers = '<div id=\"'+slider.settings.namespace+'-slider-'+sliderCount+'\" class=\"'+slider.settings.namespace+'-slider\">';\n wrappers += '<div class=\"hs-inner\">';\n slider.list.wrap(wrappers);\n \n //add container elements to the slider object\n slider.outer = $('#'+slider.settings.namespace+'-slider-'+sliderCount);\n slider.inner = $('#'+slider.settings.namespace+'-slider-'+sliderCount+' .hs-inner');\n \n //set the max width of the slider\n slider.outer.css('max-width', slider.settings.maxWidth);\n \n //set the aspect ratio of the slider\n slider.aspectRatio = slider.outer.width() / slider.items.outerHeight();\n \n //set slider height\n setTheHeight(slider);\n \n //add index value to slide\n slider.items.each(function(i){\n $(this).data('index', i);\n });\n \n //generate paging controls\n if(slider.settings.navPages){\n generatePages(slider);\n if(slider.pages !== null){slider.pages.find('a:first').addClass('active');}\n }\n \n //generate directional nav\n if (slider.settings.navDirectional) {\n generateNav(slider);\n }\n \n //assign events where appropriate\n assignEvents(slider);\n \n //set any styling\n setStyles(slider);\n \n //add 1 to the slider count\n sliderCount = sliderCount+1;\n }", "title": "" }, { "docid": "c8a848ca78e93c6c05b6806aad5396c0", "score": "0.6551744", "text": "createSlider(min, max, value=min, step=1) {\n const element = document.createElement('input')\n this.canvas.parentElement.appendChild(element)\n element.type = 'range'\n element.min = min\n element.max = max\n element.value = value // Browsers truncates decimals!\n element.step = step\n return {\n value(value) {\n if (value != undefined) {\n element.value = value\n }\n return parseFloat(element.value)\n },\n style(name, value) {\n element.style[name] = value\n return this\n }\n }\n }", "title": "" }, { "docid": "f8921a126cc77d6a6766f50dd75cffb7", "score": "0.65238166", "text": "function createSlider() {\n\n //the value that we'll give the slider - if it's a range, we store our value as a comma separated val but this slider expects an array\n var sliderVal = null;\n\n //configure the model value based on if range is enabled or not\n if ($scope.model.config.enableRange == true) {\n //If no value saved yet - then use default value\n //If it contains a single value - then also create a new array value\n if (!$scope.model.value || $scope.model.value.indexOf(\",\") == -1) {\n var i1 = parseFloat($scope.model.config.initVal1);\n var i2 = parseFloat($scope.model.config.initVal2);\n sliderVal = [\n isNaN(i1) ? $scope.model.config.minVal : (i1 >= $scope.model.config.minVal ? i1 : $scope.model.config.minVal),\n isNaN(i2) ? $scope.model.config.maxVal : (i2 > i1 ? (i2 <= $scope.model.config.maxVal ? i2 : $scope.model.config.maxVal) : $scope.model.config.maxVal)\n ];\n }\n else {\n //this will mean it's a delimited value stored in the db, convert it to an array\n sliderVal = _.map($scope.model.value.split(','), function (item) {\n return parseFloat(item);\n });\n }\n }\n else {\n //If no value saved yet - then use default value\n if ($scope.model.value) {\n sliderVal = parseFloat($scope.model.value);\n }\n else {\n sliderVal = $scope.model.config.initVal1;\n }\n }\n\n // Initialise model value if not set\n if (!$scope.model.value) {\n setModelValueFromSlider(sliderVal);\n }\n\n //initiate slider, add event handler and get the instance reference (stored in data)\n var slider = $element.find('.slider-item').bootstrapSlider({\n max: $scope.model.config.maxVal,\n min: $scope.model.config.minVal,\n orientation: $scope.model.config.orientation,\n selection: $scope.model.config.reversed ? \"after\" : \"before\",\n step: $scope.model.config.step,\n precision: $scope.model.config.precision,\n tooltip: $scope.model.config.tooltip,\n tooltip_split: $scope.model.config.tooltipSplit,\n tooltip_position: $scope.model.config.tooltipPosition,\n handle: $scope.model.config.handle,\n reversed: $scope.model.config.reversed,\n ticks: $scope.model.config.ticks,\n ticks_positions: $scope.model.config.ticksPositions,\n ticks_labels: $scope.model.config.ticksLabels,\n ticks_snap_bounds: $scope.model.config.ticksSnapBounds,\n formatter: $scope.model.config.formatter,\n range: $scope.model.config.enableRange,\n //set the slider val - we cannot do this with data- attributes when using ranges\n value: sliderVal\n }).on('slideStop', function (e) {\n var value = e.value;\n angularHelper.safeApply($scope, function () {\n setModelValueFromSlider(value);\n });\n }).data('slider');\n }", "title": "" }, { "docid": "2d34a08dff365ae2e81d57e1e561fb8f", "score": "0.65222716", "text": "function setupSlider() {\n\n // createSlider() gives the slider a range of 0, 255 (for RGB) and sets the default as 100\n rSlider = createSlider(0, 255, 100);\n gSlider = createSlider(0, 255, 100);\n bSlider = createSlider(0, 255, 100);\n sizeSlider = createSlider(5, 100, 30);\n rSlider.position(720, 25);\n gSlider.position(860, 25);\n bSlider.position(1000, 25);\n sizeSlider.position(1300, 25);\n\n}", "title": "" }, { "docid": "764fd40255f1ed8f7a6ff59d5a95cc24", "score": "0.6516847", "text": "function Slider(param){\n this.slider = document.getElementById(param.slider);\n this.sliderCounts = param.sliderCounts;\n }", "title": "" }, { "docid": "70004accf786814e5f3d669e14f5c708", "score": "0.63231057", "text": "function Tslider(index,label,min,max,value){\n const slider_xlen = 80;\n const slider_xlen_s = '80px';\n const x0 = 10; \n const xsep = 10; // separation between sliders in x direction\n const y0 = 10;\n const ysep = 20;\n const nx = 6; // number of sliders in x direction, for grid\n this.label = label;\n var xindex = index%nx;\n this.slider_x = xindex*(slider_xlen + xsep) + x0;\n this.slider_y = y0 + (int)(index/nx)*ysep;\n // this.slider_w = slider_len;\n // let max = value*2; // note that maximum is set to twice value\n let step = (max-min)/50; // number of possible values\n \n // constructor\n this.slider = createSlider(min,max,value,step);\n this.slider.position(this.slider_x, this.slider_y);\n this.slider.style('width', slider_xlen_s);\n // this.slider.style('background-color', 255); mojoy\n \n}", "title": "" }, { "docid": "740ad3eb4703d7b33464759ba7d6728f", "score": "0.6314064", "text": "function addSlider(element, min, max, v1, v2){\n $(element).slider({\n range: true,\n min: min,\n max: max,\n values: [v1, v2],\n slide: function(event, ui){\n slideAnimation();\n } \n });\n\n}", "title": "" }, { "docid": "25389ee60c7660009e9d89eac80daf04", "score": "0.62731826", "text": "function addSlider(slider) {\n\tif (slider.id === \"moodSlider\") {\n\t\tdocument.getElementById(\"sliderQuestion\").innerHTML = \"On a scale from 1 to 5, from anxious/gloomy to elated, what is your current mood?\";\n\t} else if (slider.id === \"activitySlider\") {\n\t\tdocument.getElementById(\"sliderQuestion\").innerHTML = \"On a scale from 1 to 5, from chill to high intensity, what activity level are you looking for?\";\n\t}\n\tlet rangeSlider = document.getElementById(\"rangeSlider\");\n\tif (rangeSlider.childNodes[0] === undefined) {\n\t\trangeSlider.appendChild(slider);\n\t} else {\n\t\trangeSlider.removeChild(document.getElementById(\"rangeSlider\").childNodes[0]);\n\t\trangeSlider.appendChild(slider);\n\t}\n}", "title": "" }, { "docid": "3052d8c8ba4f7c3de9954b550a6e992d", "score": "0.62559617", "text": "function CreateSlider() {\n for (var i=0;i<row;i++) {\n var min = valArr[i][0];\n var max = valArr[i][1];\n var norm = valArr[i][2];\n if (!((min<=norm && norm<=max) || (min>max))) {\n norm=(min+max)/2;\n }\n var num = i+1;\n var tag = 'tk'+num;\n var winid = \"TKSCALE-\"+clientID+\"-\"+num;\n document.getElementById(tag).innerHTML = 0;\n var params = 'min='+min+'&max='+max+'&num='+num+'&tag='+tag+'&norm='+norm+'&clientID='+clientID;\n var url = '/slider.html?'+params;\n winArr[i] = window.open(url,winid,'height=350,width=500');\n // creating a new window using 'slider.html' and some css\n if (winArr[i] == null) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "8f92017f557ac8fdb8f3811dac6d870c", "score": "0.6239528", "text": "function createSliderQuestion() {\n\n $slider.slider({\n value: 50\n });\n\n let $sliderType = $sliders[randomIndex(0, $sliders.length - 1)];\n\n if ($sliderType === 'feeling') {\n $nextSliderTitle = setTitles('SLIDER', 'slider');\n // Set slider image source, prevent caching\n $sliderImage.attr('src','https://loremflickr.com/800/400/silly/?random=' + i);\n i++;\n // Apply a random css filter to the slider image\n let $f = ['grayscale(100%)', 'contrast(200%)', 'hue-rotate(90deg)', 'hue-rotate(180deg)'];\n $sliderImage.css('filter', $f[randomIndex(0, $f.length - 1)]);\n // Set slider titles randomly to emoji or kaomoji\n let $t = ['emoji', 'kaomoji'];\n setSliderLabels($t[randomIndex(0, $t.length - 1)]);\n }\n else if ($sliderType === 'agree') {\n // Get random keyword\n $sliderKeyword = $art[randomIndex(0,$art.length - 1)];\n // Set title according to keyword\n $nextSliderTitle = setTitles('AGREESLIDER', $sliderKeyword);\n // Set slider image source, prevent caching\n $sliderImage.attr('src','https://loremflickr.com/800/400/art/?random=' + i);\n i++;\n setSliderLabels('agree');\n\n }\n\n // console.log('next slider: ' + $nextSliderTitle);\n\n}", "title": "" }, { "docid": "56a59e1098ad60ba234886051ce5f39b", "score": "0.62310433", "text": "function sliderCreate(origCreate, element, initArgs) {\n // This is important, as the contained div als uses inline-block!\n element[0].style.display = 'inline-block';\n var slider = element.children().eq(0);\n origCreate.apply(slider, initArgs);\n }", "title": "" }, { "docid": "7db9f4b574ef5b67b09be6b20189f86c", "score": "0.62251717", "text": "function create(idx,t) {\n\t\tt = $(t);\n\t\tvar slider = t.peVoloSimpleSkin({api:true});\n\t\t\n\t\tif (!$.pixelentity.themeSlider) {\n\t\t\t$.pixelentity.themeSlider = slider;\n\t\t}\n\t}", "title": "" }, { "docid": "c64a9d0e9c1c5d11a3f55683b1b77c80", "score": "0.62088406", "text": "function dhx_init_sliders(){var z=document.getElementsByTagName(\"input\");for (var i=0;i<z.length;i++)if (z[i].className==\"dhtmlxSlider\"){var n=z[i];var pos=n.getAttribute(\"position\")||\"over\";var d=document.createElement(\"DIV\");d.style.width=n.offsetWidth+\"px\";d.style.height=n.offsetHeight+\"px\";n.parentNode.insertBefore(d,n);if (pos==\"over\")n.style.display=\"none\";else{var x=document.createElement(\"DIV\");var w=Math.round(n.offsetWidth/3);if (w>50)w=50\n\n x.style.width=n.offsetWidth-w+\"px\";d.style.position=\"relative\";x.style[(pos==\"left\")?\"right\":\"left\"]=x.style.top=n.style.top=n.style[pos]=\"0px\";x.style.position=n.style.position=\"absolute\";n.style.width=w+\"px\";x.style.height=n.offsetHeight+\"px\";d.appendChild(n);d.appendChild(x);d=x};var l=new dhtmlxSlider(d,d.offsetWidth,(n.getAttribute(\"skin\")||\"\"),false,(n.getAttribute(\"min\")||\"\"),(n.getAttribute(\"max\")||\"\"),(n.value),(n.getAttribute(\"step\")||\"\"));l.linkTo(n);l.init()}}", "title": "" }, { "docid": "089132c59858e39de78973a14eb38789", "score": "0.6188519", "text": "function Slider (obj_name, min_edge, max_edge, touchable) {\n this.name = obj_name;\n this.min_edge = min_edge;\n this.max_edge = max_edge;\n this.touchable = (touchable) ? touchable : false;\n this.visible = true;\n this.triggers = {};\n this.current_seq = 0; \n this.sequence_order = [\"track\", \"scrubber\"];\n this.track = {\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.scrubber = {\n selected : false,\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.me = this;\n this.constructor = Slider;\n}", "title": "" }, { "docid": "a4edbf6de2f453e8931ea17189aec1a6", "score": "0.61163116", "text": "function initSlider(slider)\n{\n var textNode = document.createTextNode(\"\");\n slider.appendChild(textNode);\n displaySlider(slider);\n if (slider.tabIndex <= 0) {\n slider.tabIndex = \"0\";\n }\n addChangeEvent(slider, handleSliderChange);\n addEvent(slider, \"keydown\", handleSliderEvent);\n addEvent(slider, \"click\", handleSliderEvent);\n}", "title": "" }, { "docid": "bfc05770178201d23004d22b1d826c45", "score": "0.60571766", "text": "function makeDOMelements(){\n\t// slider\n\tscaleSlider = createSlider(1, 5, 1)\n\tscaleSliderX = 500;\n\tscaleSliderY = cHeight;\n\tscaleSliderW = cWidth/20;\n\tscaleSlider.position(scaleSliderX, scaleSliderY)\n\tscaleSlider.style('width', 'scaleSliderW')\n\tscaleSlider.parent('tSNEp5')\n\t// mode choice\n}", "title": "" }, { "docid": "3ecb8903618ef62bf4c36e20e9f4a25f", "score": "0.60343474", "text": "function produceItemTest(id) {\n var i1 = '<div class=\"slideContentItem\">hello-i1</div>';\n var i2 = '<div class=\"slideContentItem\">hello-i2</div>';\n var i3 = '<div class=\"slideContentItem\">hello-i3</div>';\n var i4 = '<div class=\"slideContentItem\">hello-i4</div>';\n var i5 = '<div class=\"slideContentItem\">hello-i5</div>';\n var i6 = '<div class=\"slideContentItem\">hello-i6</div>';\n var i7 = '<div class=\"slideContentItem\">hello-i7</div>';\n var i8 = '<div class=\"slideContentItem\">hello-i8</div>';\n Slider.add([i1,i2,i3,i4,i5,i6,i7,i8,i8], id, false);\n}", "title": "" }, { "docid": "ccd939cadde6943320ee978eda00c635", "score": "0.6023756", "text": "getSliderDiv()\n {\n // create div to store slider\n let sliderDiv = document.createElement(\"div\");\n sliderDiv.className = \"slidercontainer\";\n\n // add slider to div\n let slider = document.createElement(\"input\");\n slider.type = \"range\";\n slider.id = \"cardSlider\";\n slider.className = \"slider\";\n slider.min = \"1\";\n slider.max = \"12\";\n slider.value = \"12\";\n slider.step = \"1\";\n slider.addEventListener(\"input\", updateCardFromSlider.bind(this));\n slider.sensorReadings = this.sensorData;\n sliderDiv.appendChild(slider);\n\n this.slider = slider;\n\n return sliderDiv;\n }", "title": "" }, { "docid": "44b0352144a49d2c679f26596046e7da", "score": "0.6001029", "text": "createSlider(years) {\n //create noUISlider\n\n noUiSlider.create(this.timeSlider, {\n //place handler to 0%, 50% and 100%\n start: [years[0], years[0], years[years.length - 1]],\n connect: [false, true, true, false],\n tooltips: true,\n format: wNumb({\n decimals: 0\n }),\n //set range of slider to min and max years\n range: {\n 'min': Number(years[0]),\n 'max': Number(years[years.length - 1])\n },\n animate: true,\n animationDuration: 400\n }).on('update', this.sliderChange.bind(this));\n\n\n //TimeSelect = second handle , design it :\n d3.selectAll('.noUi-handle').filter((d, i) => {\n if (i == 1) {\n return i;\n }\n })\n .style(\"width\", \"2px\")\n .style(\"height\", \"70px\")\n .classed(\" timeSelector \", true)\n .style(\"position\", \"relative\").style(\"left\", \"-1px\").style(\"top\", \"-30px\")\n .style(\"content\", \"none\")\n .style(\"border-color\", \"#F00\");\n\n //Design the Rangle handles\n d3.selectAll('.noUi-handle-upper').classed(\" noUi-extended \", true);\n d3.selectAll('.noUi-handle-lower').classed(\" noUi-extended \", true);\n d3.selectAll('.noUi-extended').style(\"height\", \"24px\").style(\"width\", \"16px\").style(\"position\", \"relative\").style(\"top\", \"-5px\").style(\"left\", \"-8px\");\n\n }", "title": "" }, { "docid": "01d3ce637e4940b2ebb2c2d71da34e6e", "score": "0.59831566", "text": "function setUpClass() {\n slider.classList.add(\"slider\");\n let content = ` \n <div class=\"slider-range\"></div>\n <span class=\"slider-handle\"></span>\n `;\n slider.innerHTML = content;\n return {\n range : slider.querySelector(\".slider-range\"),\n handle : slider.querySelector(\".slider-handle\"),\n leftSlider : parseInt(slider.getBoundingClientRect().left),\n rightSlider : parseInt(slider.getBoundingClientRect().right),\n widthSlider : parseInt(slider.getBoundingClientRect().width),\n }\n }", "title": "" }, { "docid": "9bc5caeb9b27dc0c3dce78d3671a7068", "score": "0.5977593", "text": "function createSliderElement (){\n const div = document.getElementById(\"console\");\n div.style.opacity = \"1\";\n div.style.position = \"fixed\";\n div.style.top = \"0\";\n\n addSliderListener()\n }", "title": "" }, { "docid": "1c4501d5976dd69c4afd68a4c130338c", "score": "0.59740555", "text": "function initialize ( target, originalOptions ) {\r\n\r\n\t\tif ( !target.nodeName ) {\r\n\t\t\tthrow new Error('noUiSlider.create requires a single element.');\r\n\t\t}\r\n\r\n\t\t// Test the options and create the slider environment;\r\n\t\tvar options = testOptions( originalOptions, target ),\r\n\t\t\tslider = closure( target, options, originalOptions );\r\n\r\n\t\t// Use the public value method to set the start values.\r\n\t\tslider.set(options.start);\r\n\r\n\t\ttarget.noUiSlider = slider;\r\n\t\treturn slider;\r\n\t}", "title": "" }, { "docid": "bc7ef610310b31b75dfdc960b8cd51ee", "score": "0.5968645", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target.nodeName ) {\n\t\t\tthrow new Error('noUiSlider.create requires a single element.');\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target ),\n\t\t\tslider = closure( target, options );\n\n\t\t// Use the public value method to set the start values.\n\t\tslider.set(options.start);\n\n\t\ttarget.noUiSlider = slider;\n\t\treturn slider;\n\t}", "title": "" }, { "docid": "bc7ef610310b31b75dfdc960b8cd51ee", "score": "0.5968645", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target.nodeName ) {\n\t\t\tthrow new Error('noUiSlider.create requires a single element.');\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target ),\n\t\t\tslider = closure( target, options );\n\n\t\t// Use the public value method to set the start values.\n\t\tslider.set(options.start);\n\n\t\ttarget.noUiSlider = slider;\n\t\treturn slider;\n\t}", "title": "" }, { "docid": "bc7ef610310b31b75dfdc960b8cd51ee", "score": "0.5968645", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target.nodeName ) {\n\t\t\tthrow new Error('noUiSlider.create requires a single element.');\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target ),\n\t\t\tslider = closure( target, options );\n\n\t\t// Use the public value method to set the start values.\n\t\tslider.set(options.start);\n\n\t\ttarget.noUiSlider = slider;\n\t\treturn slider;\n\t}", "title": "" }, { "docid": "38a7f69298dea7b8f107ac97d3297c09", "score": "0.5966312", "text": "function initialize ( target, originalOptions ) {\n\n if ( !target.nodeName ) {\n throw new Error('noUiSlider.create requires a single element.');\n }\n\n // Test the options and create the slider environment;\n var options = testOptions( originalOptions, target ),\n slider = closure( target, options, originalOptions );\n\n // Use the public value method to set the start values.\n slider.set(options.start);\n\n target.noUiSlider = slider;\n return slider;\n }", "title": "" }, { "docid": "4466b6c9677421cfd4b810dd2fba24d0", "score": "0.5964495", "text": "function createSliders() {\n var button = document.getElementById(\"new-reaction\");\n var clearModelButton = document.getElementById(\"clearModelButton\");\n\n if (pubModel === true) {\n button.style.display = \"none\";\n clearModelButton.style.display = \"none\";\n } else {\n button.setAttribute(\"onclick\", \"redirect(0, xCoorNext, yCoorNext);\");\n button.onclick = function() { redirect(0, xCoorNext, yCoorNext); };\n }\n for (var i = 0; i < db_modules.length; i++) {\n if (db_modules[i].modelID_id === modelNum) {\n var sliderHolder = document.getElementById(\"slider-holder\");\n var varHolder = document.createElement('div');\n varHolder.setAttribute(\"class\", \"variable-holder\");\n var enzLabel = document.createElement('label');\n enzLabel.setAttribute(\"for\", db_modules[i].enzymeAbbr);\n enzLabel.className = \"sliderLabel\";\n enzLabel.innerHTML = convertIdToText(db_modules[i].enzyme);\n varHolder.appendChild(enzLabel);\n var inner = document.createElement('div');\n inner.setAttribute(\"class\", \"inner-flex-horiz\");\n if (db_modules[i].reversible.toLowerCase() === 'irreversible') {\n //Set slider attributes\n var inputItem = document.createElement('input');\n inputItem.setAttribute(\"type\", \"range\");\n inputItem.setAttribute(\"min\", \"0\");\n inputItem.setAttribute(\"max\", \"100\");\n inputItem.setAttribute(\"value\", \"50\");\n inputItem.setAttribute(\"step\", \"10\");\n inputItem.setAttribute(\"class\", \"variables\");\n inputItem.setAttribute(\"id\", db_modules[i].enzymeAbbr);\n inputItem.setAttribute(\"class\", \"slider-appearance\");\n inner.appendChild(inputItem);\n var header = document.createElement('div');\n header.setAttribute(\"id\", db_modules[i].enzymeAbbr + \"Value\");\n header.setAttribute(\"class\", \"variable-value-appearance\");\n header.innerHTML = \"50\";\n inner.appendChild(header);\n }\n var editButton = document.createElement('button');\n if (pubModel === true) {\n editButton.innerHTML = \"View\";\n } else {\n editButton.innerHTML = \"Edit\"\n }\n editButton.setAttribute(\"class\", \"edit-button\");\n // var functionString = \"redirect(\" + (i+1) + \", \" + db_modules[i].xCoor\n // + \", \" + db_modules[i].yCoor + \");\"\n //Dynamically grab module id\n var functionString = \"redirect(\" + db_modules[i].id + \", \" + db_modules[i].xCoor +\n \", \" + db_modules[i].yCoor + \");\"\n editButton.setAttribute(\"onclick\", functionString);\n editButton.setAttribute(\"type\", \"button\");\n inner.appendChild(editButton);\n varHolder.appendChild(inner);\n sliderHolder.append(varHolder);\n }\n }\n}", "title": "" }, { "docid": "6502df758dcdedad46cd02eb2444ba89", "score": "0.59494185", "text": "constructor(parent, label, func, min, max, value, step=1.0, index=0) {\r\n this.box = document.createElement(\"div\");\r\n this.box.className = \"controls\";\r\n this.box.innerHTML = label;\r\n this.slider = document.createElement(\"input\");\r\n this.slider.id = label;\r\n this.slider.type = \"range\";\r\n this.slider.step = step;\r\n this.slider.min = min;\r\n this.slider.max = max;\r\n this.slider.value = value;\r\n this.index = index;\r\n this.func = func;\r\n this.slider.oninput = () => {\r\n this.func(this.slider.value, this.index);\r\n }\r\n this.box.appendChild(this.slider);\r\n parent.appendChild(this.box);\r\n\r\n }", "title": "" }, { "docid": "ab49fb0a55d9a94bf437592b83f2e9e4", "score": "0.59459925", "text": "function initialize(target, originalOptions) {\n\n if (!target.nodeName) {\n throw new Error('noUiSlider.create requires a single element.');\n }\n\n // Test the options and create the slider environment;\n var options = testOptions(originalOptions, target),\n slider = closure(target, options);\n\n // Use the public value method to set the start values.\n slider.set(options.start);\n\n target.noUiSlider = slider;\n return slider;\n }", "title": "" }, { "docid": "81e2b8ad3918fd0913ee4b0c4fdcff46", "score": "0.5881435", "text": "function setSliderValues(sliderComponents) {\n\tpcaSliderComponents = sliderComponents;\n\tfor (i = 1; i <= 10; i++) {\n\t\t$('#slider-' + i).val(sliderComponents[i-1].number);\n\t\t$('#slider-' + i).prop('min', sliderComponents[i-1].bottomLimit);\n\t\t$('#slider-' + i).prop('max', sliderComponents[i-1].topLimit);\n\t\t$('#slider-' + i).prop('step', sliderComponents[i-1].incrementValue);\n\t}\n}", "title": "" }, { "docid": "fdd71e6edb9994bee5ed66fcda8885fb", "score": "0.5876977", "text": "function mkrange(name, min, max, step, value, size)\n{\n if ( size == null || size == undefined ) size = 8;\n // create a range control\n var s = '<input type=\"range\" min=\"' + min + '\" max=\"' + max +\n '\" step=\"' + step + '\" value=\"' + value + '\" id=\"slider_' + name +\n '\" class = \"slider\" onchange=\"mapchange(\\'slider_' + name + '\\', \\'' + name + '\\');change_params()\">';\n // create a corresponding text box\n s += '<input type=\"text\" value=\"' + value + '\" id=\"' + name +\n '\" size = \"' + size + '\" class=\"slider_num\" ' +\n 'onchange=\"mapchange(\\'' + name + '\\', \\'slider_' + name + '\\');change_params()\">';\n return s;\n}", "title": "" }, { "docid": "8de5d5b29f344f14a569c5426883098e", "score": "0.5862152", "text": "function gdSlide() {\n var slide = $('.iSlide_1').bxSlider({\n mode: 'horizontal',\n speed: 1000,\n pause: 5000,\n auto: false,\n pagerCustom: '.year1'\n });\n var slide = $('.iSlide_2').bxSlider({\n mode: 'horizontal',\n speed: 1000,\n pause: 5000,\n auto: false,\n pagerCustom: '.year2'\n });\n var slide = $('.iSlide_3').bxSlider({\n mode: 'horizontal',\n speed: 1000,\n pause: 5000,\n auto: false,\n pagerCustom: '.year3'\n });\n}", "title": "" }, { "docid": "33df1e3337bacbe8d580bfc945cccefa", "score": "0.58557564", "text": "function setupSlider(){\r\n\t\"use strict\";\r\n\t// Variables pour les dimensions des différents éléments\r\n\tslideCount = $('#slider ul li').length;\r\n\tslideWidth = $('#slider ul li').width();\r\n\tslideHeight = $('#slider ul li').height();\r\n\tsliderUlWidth = slideCount * slideWidth;\r\n\r\n\t// Pour régler les dimensions des éléments\r\n\t$('#slider').css({ width: slideWidth, height: slideHeight });\r\n\t$('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth });\r\n}", "title": "" }, { "docid": "c9d576cfe401f0dca8239e497be548f1", "score": "0.58210075", "text": "function addSlider(){\n\n var slider_div = d3.select('footer')\n .append('div')\n .attr('width', 800)\n .attr('class', 'slider');\n\n pageData['slider'] = d3.select('.slider')\n .call(d3.slider()\n .value(2013)\n .axis(true)\n .min(2006)\n .max(2013)\n .step(1)\n .on('slide', function(evt, year) {\n\n d3.selectAll('.svg_cont')\n .remove();\n\n colorMap(pageData['loans'],\n pageData['geo'],\n year.toString());\n })\n );\n }", "title": "" }, { "docid": "611589ab0274925d85210b6cf6c0f662", "score": "0.5766051", "text": "function registerSlider() {\n var interval = barn.get(\"setting_interval\") || 10;\n\n $('.range-slider').empty();\n $('.range-slider').append(`<input class=\"range-slider__range\" type=\"range\" value=\"${interval}\" min=\"5\" max=\"60\"><span class=\"range-slider__value\">0</span>`);\n\n var slider = $('.range-slider'),\n range = $('.range-slider__range'),\n value = $('.range-slider__value');\n\n slider.each(function() {\n value.each(function() {\n var value = $(this).prev().attr('value');\n $(this).html(interval + \" s\");\n });\n\n range.on('input', function() {\n $(this).next(value).html(this.value + \" s\");\n });\n\n range.on('mouseup touchend', function() {\n barn.set(\"setting_interval\", this.value)\n });\n });\n}", "title": "" }, { "docid": "09c4f3b8b2639c2380d4ec815109f897", "score": "0.5751975", "text": "createControl() {\n const control = document.createElement(\"ul\");\n control.dataset.control = \"slide\";\n\n this.slideArray.forEach((item, index) => {\n control.innerHTML += `\n <li>\n <a href=\"#slide${index + 1}\">${index + 1}</a>\n </li>`;\n });\n this.wrapper.appendChild(control);\n return control;\n }", "title": "" }, { "docid": "72812ce2f73cbe42fb18e94bde83cc18", "score": "0.5736228", "text": "function buildSlider(target){ \n\t\tvar opts = $.data(target, 'slider').options; \n\t\tvar slider = $.data(target, 'slider').slider; \n\t\t \n\t\tslider.removeClass('slider-h slider-v slider-disabled'); \n\t\tslider.addClass(opts.mode == 'h' ? 'slider-h' : 'slider-v'); \n\t\tslider.addClass(opts.disabled ? 'slider-disabled' : ''); \n\t\t \n\t\tslider.find('a.slider-handle').draggable({ \n\t\t\taxis:opts.mode, \n\t\t\tcursor:'pointer', \n\t\t\tdisabled: opts.disabled, \n\t\t\tonDrag:function(e){ \n\t\t\t\tvar left = e.data.left; \n\t\t\t\tvar width = slider.width(); \n\t\t\t\tif (opts.mode!='h'){ \n\t\t\t\t\tleft = e.data.top; \n\t\t\t\t\twidth = slider.height(); \n\t\t\t\t} \n\t\t\t\tif (left < 0 || left > width) { \n\t\t\t\t\treturn false; \n\t\t\t\t} else { \n\t\t\t\t\tvar value = pos2value(target, left); \n\t\t\t\t\tadjustValue(value); \n\t\t\t\t\treturn false; \n\t\t\t\t} \n\t\t\t}, \n\t\t\tonStartDrag:function(){ \n\t\t\t\topts.onSlideStart.call(target, opts.value); \n\t\t\t}, \n\t\t\tonStopDrag:function(e){ \n\t\t\t\tvar value = pos2value(target, (opts.mode=='h'?e.data.left:e.data.top)); \n\t\t\t\tadjustValue(value); \n\t\t\t\topts.onSlideEnd.call(target, opts.value); \n\t\t\t} \n\t\t}); \n\t\t \n\t\tfunction adjustValue(value){ \n\t\t\tvar s = Math.abs(value % opts.step); \n\t\t\tif (s < opts.step/2){ \n\t\t\t\tvalue -= s; \n\t\t\t} else { \n\t\t\t\tvalue = value - s + opts.step; \n\t\t\t} \n\t\t\tsetValue(target, value); \n\t\t} \n\t}", "title": "" }, { "docid": "37c9776b0546cf1d9e940efc6147fe00", "score": "0.5724013", "text": "function addSlider ( target ){\n// Apply classes and data to the target.\naddClass(target, options.cssClasses.target);\nif ( options.dir === 0 ){\naddClass(target, options.cssClasses.ltr);\n}else{\naddClass(target, options.cssClasses.rtl);\n}\nif ( options.ort === 0 ){\naddClass(target, options.cssClasses.horizontal);\n}else{\naddClass(target, options.cssClasses.vertical);\n}\nscope_Base = addNodeTo(target, options.cssClasses.base);\n}", "title": "" }, { "docid": "38622c5f98910e67d051287b1e76d159", "score": "0.56997913", "text": "function CreateSimpleVerticleSlider(w, h, evtName, bus) {\n if(!bus) {\n bus = EventBus.ui;\n } if(isString(bus)) {\n bus = EventBus.Get(bus);\n }\n\n var slider = new NodeView();\n slider.setRect(10, h, \"rgb(128,128,128)\");\n slider.pct = 0.0;\n slider.nob = new NodeView();\n slider.nob.setRect(w, 20, \"rgb(255,255,255)\");\n slider.addChild(slider.nob);\n\n slider.setClick(function(e,x,y){\n slider.pct = 1 - ((y / (h-20)) + 0.5);\n slider.pct = Math.min(slider.pct, 1);\n slider.pct = Math.max(slider.pct, 0);\n //slider.nob.pos.y = y;\n bus.dispatch({evtName:evtName, pct:slider.pct});\n }, false);\n\n slider.addCustomDraw(function(gfx, x,y, ct) {\n slider.nob.pos.y = ((1 - slider.pct) * h) - (h/2);\n })\n\n //todo: support dragging\n\n return slider;\n}", "title": "" }, { "docid": "dcaddaa45ce9e6b2e93dd8ba59f1f799", "score": "0.5693414", "text": "function initializeSlider() {\n\tvar sliderElement = document.getElementById('slider');\n\tslider = new goog.ui.Slider;\n\tslider.decorate(sliderElement);\n\tslider.addEventListener(goog.ui.Component.EventType.CHANGE, function () {\n\t\t// Avoid updating the map too often by ignoring slider value changes\n\t\t// that occur within 200mS of eachother.\n\t\tif (sliderTimer) window.clearTimeout(sliderTimer);\n\t\tsliderTimer = window.setTimeout(updateMap, 200);\n\t\tdocument.getElementById(\"slider-value\").innerHTML = sliderValueToYr(slider.getValue());\n\t});\n\tslider.setValue(100);\n}", "title": "" }, { "docid": "b91a6e22dd530b1dad953c0f61a45a8d", "score": "0.5679708", "text": "function createInstance() {\n const api = extendApi(noUiSlider.create(htmlElement, options));\n\n setCreatedWatcher(api);\n setOptionsWatcher(api);\n\n if (ngModel !== null) {\n bindNgModelControls(api);\n }\n }", "title": "" }, { "docid": "414907e460475ca7797bf99bdded6813", "score": "0.56694406", "text": "function slider(min, max, location_x, location_y, name, id){\n\t\t\t// (min, max) is range of data,\n\t\t\t// (x,y) is location,\n\t\t\t// name is chart label\n\t\t\t// id is count from up chart, start at 1\n\n\t\t\t\t\t// Data Domain (min, max)\n\t\t\t\t\tvar domain_min, domain_max, times;\n\t\t\t\t\t// var times is able to justify the range of data to a comfortable zone (0~100)\n\t\t\t\t\tif (max > 100) {\n\t\t\t\t\t\ttimes = 1;\n\t\t\t\t\t} else if (max > 10){\n\t\t\t\t\t\ttimes = 10;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttimes = 100;\n\t\t\t\t\t}\n\t\t\t\t\tdomain_min = min * times;\n\t\t\t\t\tdomain_max = max * times;\n\n\t\t\t\t\t// Data Name and Silder Name\n\t\t\t\t\tvar slider_name = name;\n\n\n\t\t\t\t\t// Slider Range\n\t\t\t\t\tvar range_width = 400, range_height = 95;\n\t\t\t\t\t// Initial Variables\n\t\t\t\t\tvar handle_radius = 25,\t//handle circle radium\n\t\t\t\t\t\thandle_start_val = domain_min, //start position for first pointer\n\t\t\t\t\t\thandle_start_val2 = domain_max, //start position for second pointer\n\t\t\t\t\t\tx1 = 0,\t\t\t\t\t\t\t\t\t\t\t\t\t//initial record mouse position for first pointer\n\t\t\t\t\t\tx2 = range_width,\t\t\t\t\t\t\t\t//initial record mouse position for second pointer\n\t\t\t\t\t\thandle_padding = 10,\t//handle padding\n\t\t\t\t\t\tslider_height = 5,\t\t//slider line height\n\t\t\t\t\t\taxis_height = 20;\t\t\t//slider axis height include label\n\n\t\t\t\t\t// SVG\n\t\t\t\t\tvar range_svg = d3.select(\"#svg\").append(\"g\") //container is svg background\n\t\t\t\t\t\t.attr(\"id\", \"slider\" + id)\n\t\t\t\t\t\t.attr(\"width\", 500) //svg width\n\t\t\t\t\t\t.attr(\"height\", 125)\t\t//svg height\n\t\t\t\t\t\t.attr(\"transform\", \"translate(\"+ location_x +\", \"+ location_y +\")\"); //x,y for svg from left top corner\n\n\t\t\t\t\t// Scale (d3 using d3.scale.linear) (d4 using d3.scaleLinear)\n\t\t\t\t\tvar range_x = d3.scaleLinear() //depend on data alternative using scaleLog\n\t\t\t\t\t\t\t.range([0, range_width])\n\t\t\t\t\t\t\t.domain([domain_min, domain_max]);\n\t\t\t\t\tvar range_x_times = d3.scaleLinear() //depend on data alternative using scaleLog\n\t\t\t\t\t\t\t.range([0, range_width])\n\t\t\t\t\t\t\t.domain([domain_min/times, domain_max/times]);\n\n\n\t\t\t\t\t// Label For Slider\n\t\t\t\t\trange_svg.append(\"text\")\n\t\t\t\t\t\t\t.attr(\"class\", \"slider-label\")\n\t\t\t\t\t\t\t.attr(\"x\", 50)\n\t\t\t\t\t\t\t.attr(\"y\", 0)\n\t\t\t\t\t\t\t.attr(\"dy\", \"1em\")\n\t\t\t\t\t\t\t.text(slider_name);\n\n\t\t\t\t\t// Reset Button For Slider\n\t\t\t\t\trange_svg.append(\"rect\")\n\t\t\t\t\t\t\t.attr(\"x\", range_width)\n\t\t\t\t\t\t\t.attr(\"y\", 5)\n\t\t\t\t\t\t\t.attr(\"width\", 50)\n\t\t\t\t\t\t\t.attr(\"height\", 18)\n\t\t\t\t\t\t\t.on(\"click\", reset)\n\t\t\t\t\t\t\t.attr(\"fill\", \"#4d94ff\");\n\t\t\t\t\trange_svg.append(\"text\")\n\t\t\t\t\t\t\t.attr(\"class\", \"slider-label\")\n\t\t\t\t\t\t\t.attr(\"x\", range_width + 4)\n\t\t\t\t\t\t\t.attr(\"y\", 5)\n\t\t\t\t\t\t\t.attr(\"dy\", \"1em\")\n\t\t\t\t\t\t\t.attr(\"fill\", \"white\")\n\t\t\t\t\t\t\t.attr(\"font-size\", \"0.8em\")\n\t\t\t\t\t\t\t.text(\"RESET\")\n\t\t\t\t\t\t\t.on(\"click\", reset);\n\n\t\t\t\t\t// Axis\n\t\t\t\t\trange_svg.append(\"g\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-axis\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"translate(50, \" + range_height + \")\")\n\t\t\t\t\t\t\t.call(d3.axisBottom(range_x_times));\n\t\t\t\t\trange_svg.append(\"rect\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-body\")\n\t\t\t\t\t\t\t.attr(\"x\", 50)\n\t\t\t\t\t\t\t.attr(\"y\", range_height - slider_height)\n\t\t\t\t\t\t\t.attr(\"width\", range_width)\n\t\t\t\t\t\t\t.attr(\"height\", slider_height);\n\n\t\t\t\t\t// First Handle\n\t\t\t\t\trange_svg.append(\"circle\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-dragger range-handle\")\n\t\t\t\t\t\t\t.attr(\"cx\", range_x(handle_start_val) + 50)\n\t\t\t\t\t\t\t.attr(\"cy\", range_height - slider_height - handle_radius - handle_padding)\n\t\t\t\t\t\t\t.attr(\"r\", handle_radius)\n\t\t\t\t\t\t\t.call(d3.drag()\n\t\t\t\t\t\t\t\t.on(\"drag\", dragged)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t// Label of Selected Down Range\n\t\t\t\t\trange_svg.append(\"text\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-label\")\n\t\t\t\t\t\t\t.attr(\"x\", range_x(handle_start_val) + 50)\n\t\t\t\t\t\t\t.attr(\"y\", range_height - slider_height - handle_radius - handle_padding)\n\t\t\t\t\t\t\t.attr(\"dy\", \".3em\")\n\t\t\t\t\t\t\t.text(handle_start_val/times);\n\n\t\t\t\t\t// First Pointer\n\t\t\t\t\trange_svg.append(\"polygon\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-dragger range-pointer\")\n\t\t\t\t\t\t\t.attr(\"points\", calcPointerPoints(handle_start_val))\n\t\t\t\t\t\t\t.call(d3.drag()\n\t\t\t\t\t\t\t\t.on(\"drag\", dragged)\n\t\t\t\t\t\t\t);\n\n\n\t\t\t\t\t// Second Handle\n\t\t\t\t\trange_svg.append(\"circle\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-dragger2 range-handle2\")\n\t\t\t\t\t\t\t.attr(\"cx\", range_x(handle_start_val2) + 50)\n\t\t\t\t\t\t\t.attr(\"cy\", range_height - slider_height - handle_radius - handle_padding)\n\t\t\t\t\t\t\t.attr(\"r\", handle_radius)\n\t\t\t\t\t\t\t.call(d3.drag()\n\t\t\t\t\t\t\t\t.on(\"drag\", dragged2)\n\t\t\t\t\t\t );\n\n\t\t\t\t\t// Label for Selected Up Range\n\t\t\t\t\trange_svg.append(\"text\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-label2\")\n\t\t\t\t\t\t\t.attr(\"x\", range_x(handle_start_val2) + 50)\n\t\t\t\t\t\t\t.attr(\"y\", range_height - slider_height - handle_radius - handle_padding)\n\t\t\t\t\t\t\t.attr(\"dy\", \".3em\")\n\t\t\t\t\t\t\t.text(handle_start_val2/times);\n\n\t\t\t\t\t// Second Pointer\n\t\t\t\t\trange_svg.append(\"polygon\")\n\t\t\t\t\t\t\t.attr(\"class\", \"range-dragger2 range-pointer2\")\n\t\t\t\t\t\t\t.attr(\"points\", calcPointerPoints(handle_start_val2))\n\t\t\t\t\t\t\t.call(d3.drag()\n\t\t\t\t\t\t\t\t.on(\"drag\", dragged2)\n\t\t\t\t\t\t\t);\n\n\n\t\t\t\t\t// Draw Pointers\n\t\t\t\t\tfunction calcPointerPoints(handle_val){\n\t\t\t\t\t\txp = range_x(handle_val) + 50;\n\t\t\t\t\t\tvar point_c = xp + \",\" + (range_height - slider_height);\n\t\t\t\t\t\tvar point_a = (xp - (handle_radius / 4)) + \",\" + (range_height - slider_height - handle_padding - (handle_radius / 10));\n\t\t\t\t\t\tvar point_b = (xp + (handle_radius / 4)) + \",\" + (range_height - slider_height - handle_padding - (handle_radius / 10));\n\t\t\t\t\t\treturn point_a + \" \" + point_b + \" \" + point_c;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Deal with First Pointer Position Change\n\t\t\t\t\tfunction dragged(){\n\t\t\t\t\t\tvar coordinates = [0, 0];\n\t\t\t coordinates = d3.mouse(this);\n\t\t\t var x = coordinates[0];\n\t\t\t x = x > x2 ? x2 : //not able to go over another pointer\n\t\t\t \tx < 0 ? 0 :\n\t\t\t \tx;\n\t\t\t\t\t\tx1 = x; // store current position\n\n\t\t\t // find the pct represented by the mouse position\n\t\t\t var pct = Math.round(range_x.invert(x));\n\n\t\t\t range_svg.select(\".range-handle\")\n\t\t\t \t\t.attr(\"cx\", range_x(pct) + 50);\n\n\t\t\t range_svg.select(\".range-label\")\n\t\t\t \t\t.attr(\"x\", range_x(pct) + 50)\n\t\t\t \t\t.text(pct/times);\n\n\t\t\t range_svg.select(\".range-pointer\")\n\t\t\t \t\t.attr(\"points\", calcPointerPoints(pct));\n\n\t\t\t\t\t\t// calculate pecentage for selection in real data\n\t\t\t\t\t\t// store range\n\t\t\t\t\t\trange[id-1] = [Math.round(range_x.invert(x1))/times, Math.round(range_x.invert(x2))/times];\n\t\t\t\t\t\tvar percentage_return = percentage(Number(id), Math.round(range_x.invert(x1))/times, Math.round(range_x.invert(x2))/times)\n\t\t\t\t\t\tper[id-1] = [percentage_return.percentage, (percentage_return.count - percentage_return.percentage)];\n\n\t\t\t\t\t\t// reset dataset_selected\n\t\t\t\t\t\tresetDataset(id);\n\n\t\t\t\t\t\t// get changed column values\n\t\t\t\t\t\t//var datacolumn = percentage_return.column;\n\t\t\t\t\t\t// copy column selected into dataset_selected\n\t\t\t\t\t\t/*switch (Number(id)) { // get targeted column\n\t\t\t\t\t\t\tcase 1:\n\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name3 = datacolumn[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name4 = datacolumn[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name7 = datacolumn[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name12 = datacolumn[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name19 = datacolumn[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name23 = datacolumn[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected = dataset; // back to name of row\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Wrong silder id! Please provide the correct number:1 - 6\"); // error message\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\n\t\t\t\t\t// Deal with Second Pointer Position Change\n\t\t\t\t\tfunction dragged2(){\n\t\t\t\t\t\tvar coordinates = [0, 0];\n\t\t\t coordinates = d3.mouse(this);\n\t\t\t var x = coordinates[0];\n\t\t\t x = x > range_width ? range_width :\n\t\t\t \tx < x1 ? x1 : //not able to go over another pointer\n\t\t\t \tx;\n\t\t\t\t\t\tx2 = x;// store current position\n\n\t\t\t // find the pct represented by the mouse position\n\t\t\t var pct = Math.round(range_x.invert(x));\n\n\t\t\t range_svg.select(\".range-handle2\")\n\t\t\t \t\t.attr(\"cx\", range_x(pct) + 50);\n\n\t\t\t range_svg.select(\".range-label2\")\n\t\t\t \t\t.attr(\"x\", range_x(pct) + 50)\n\t\t\t \t\t.text(pct/times);\n\n\t\t\t range_svg.select(\".range-pointer2\")\n\t\t\t \t\t.attr(\"points\", calcPointerPoints(pct));\n\n\t\t\t\t\t\t// calculate pecentage for selection in real data\n\t\t\t\t\t\t// store range\n\t\t\t\t\t\trange[id-1] = [Math.round(range_x.invert(x1))/times, Math.round(range_x.invert(x2))/times];\n\t\t\t\t\t\tvar percentage_return = percentage(Number(id), Math.round(range_x.invert(x1))/times, Math.round(range_x.invert(x2))/times)\n\t\t\t\t\t\tper[id-1] = [percentage_return.percentage, (percentage_return.count - percentage_return.percentage)];\n\n\t\t\t\t\t\t// reset dataset_selected\n\t\t\t\t\t\tresetDataset(id);\n\n\t\t\t\t\t\t// get changed column values\n\t\t\t\t\t\t//var data2column = percentage_return.column;\n\t\t\t\t\t\t// copy column selected into dataset_selected\n\t\t\t\t\t\t/*switch (Number(id)) { // get targeted column\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name3 = data2column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name4 = data2column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name7 = data2column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name12 = data2column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name19 = data2column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name23 = data2column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected = dataset; // back to name of row\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Wrong silder id! Please provide the correct number:1 - 6\"); // error message\n\t\t\t\t\t\t}*/\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reset Position of Pointers\n\t\t\t\t\tfunction reset(){\n\t\t\t\t\t\t//First Pointer\n\t\t\t\t\t\trange_svg.select(\".range-handle\")\n\t\t\t \t\t.attr(\"cx\", range_x(handle_start_val) + 50);\n\n\t\t\t range_svg.select(\".range-label\")\n\t\t\t \t\t.attr(\"x\", range_x(handle_start_val) + 50)\n\t\t\t \t\t.text(handle_start_val/times);\n\n\t\t\t range_svg.select(\".range-pointer\")\n\t\t\t \t\t.attr(\"points\", calcPointerPoints(handle_start_val));\n\n\t\t\t\t\t\t//Second Pointer\n\t\t\t\t\t\trange_svg.select(\".range-handle2\")\n\t\t\t\t\t .attr(\"cx\", range_x(handle_start_val2) + 50);\n\n\t\t\t\t\t range_svg.select(\".range-label2\")\n\t\t\t\t\t .attr(\"x\", range_x(handle_start_val2) + 50)\n\t\t\t\t\t .text(handle_start_val2/times);\n\n\t\t\t\t\t range_svg.select(\".range-pointer2\")\n\t\t\t\t\t .attr(\"points\", calcPointerPoints(handle_start_val2));\n\n\t\t\t\t\t\tx1 = 0;\n\t\t\t\t\t\tx2 = range_width;\n\n\t\t\t\t\t\t// restore range\n\t\t\t\t\t\trange[id-1] = [Math.round(range_x.invert(x1))/times, Math.round(range_x.invert(x2))/times];\n\t\t\t\t\t\tper[id-1] = [0, 3573];\n\n\t\t\t\t\t\t// reset dataset_selected\n\t\t\t\t\t\tresetDataset(id);\n\t\t\t\t\t}\n\n\t\t\t\t\t// reset specific column in dataset_selected\n\t\t\t\t\tfunction resetDataset(id){\n\t\t\t\t\t\t// reset selected array: dataset_selected\n\t\t\t\t\t\tswitch (Number(id)) { // get targeted column\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\tvar data3column = dataset.map(d => d.Name3);\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name3 = data3column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t\tvar data3column = dataset.map(d => d.Name4);\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name4 = data3column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t\tvar data3column = dataset.map(d => d.Name7);\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name7 = data3column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\t\t\tvar data3column = dataset.map(d => d.Name12);\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name12 = data3column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t\t\tvar data3column = dataset.map(d => d.Name19);\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name19 = data3column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\t\t\t\tvar data3column = dataset.map(d => d.Name23);\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected.forEach(function(d, i) { d.Name23 = data3column[i]; });\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tdataset_selected = dataset; // back to name of row\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Wrong silder id! Please provide the correct number:1 - 6\"); // error message\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t}", "title": "" }, { "docid": "fa43ce82d255ed432085dd327103893c", "score": "0.56680596", "text": "function param(name, min, max, default_) {\n var id, labelElem, sliderElem, steps, paramVal;\n\n steps = 500;\n\n // Check if we already made this element\n id = \"userSliders \" + name;\n sliderElem = document.getElementById(id);\n if (sliderElem == null) {\n // If not, create a new one (wrapped in a label)\n labelElem = document.createElement(\"label\");\n labelElem.setAttribute(\"class\", \"userSliders\");\n labelElem.innerHTML = name;\n document.getElementById('userSliders').appendChild(labelElem);\n\n sliderElem = document.createElement(\"input\");\n sliderElem.setAttribute(\"id\", id);\n sliderElem.setAttribute(\"value\", default_);\n sliderElem.setAttribute(\"type\", \"range\");\n sliderElem.setAttribute(\"onChange\", \"render()\");\n //sliderElem.setAttribute(\"class\", \"userSliders\");\n labelElem.appendChild(sliderElem);\n\n // Just return the default value if we're newly creating this slider.\n paramVal = default_;\n } else {\n // If it existed already., get its current value.\n paramVal = parseFloat(sliderElem.value);\n }\n\n // Set the min/max/step (even if it's redundant)\n sliderElem.setAttribute(\"min\", min);\n sliderElem.setAttribute(\"max\", max);\n sliderElem.setAttribute(\"step\", (max-min) / steps);\n\n return paramVal;\n}", "title": "" }, { "docid": "e061ddc98d87176eea00571e16a6e2ae", "score": "0.56659347", "text": "function createElement() {\n // find first slide\n let firstCell = document.getElementsByClassName('slider-cell');\n let currentSlide = firstCell[0];\n let currentSlideId = currentSlide.getAttribute('id');\n let slide = document.getElementById(currentSlideId);\n // create clone\n let slideClone = slide.cloneNode(true);\n // find last slide\n let gallery = document.getElementById('gallery');\n // append clone to last slide\n gallery.insertBefore(slideClone, null);\n}", "title": "" }, { "docid": "53a4b5674634492cb0f3937e2221b292", "score": "0.565687", "text": "function placeSlider(){\n\t\t\n\t\t var sliderHeight = g_gallery.getHeight();\n\t\t var sliderWidth = g_gallery.getWidth();\n\t\t \n\t\t g_objSlider.setSize(sliderWidth, sliderHeight);\n\t\t g_objSlider.setPosition(0, 0);\t\t\n\t}", "title": "" }, { "docid": "f0ec91dce429212339be372ef3752a70", "score": "0.56566346", "text": "function makeYearSlider () {\n\t\tvar select = $( \".select-year\" );\n\t\tvar slider = $( \"<div id='slider'></div>\" ).insertAfter( select ).slider({\n\t\t\tmin: 1,\n\t\t\tmax: 5,\n\t\t\trange: \"min\",\n\t\t\tvalue: select[ 0 ].selectedIndex + 1,\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tselect[ 0 ].selectedIndex = ui.value - 1;\n\t\t\t\tswitch(ui.value) {\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tdisplayYear = \"2012\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tdisplayYear = \"2011\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tdisplayYear = \"2010\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdisplayYear = \"2009\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tdisplayYear = \"2008\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdisplayYear = \"2012\";\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t};\n\t\t\t\tupdateDisplayArray()\n\t\t\t}\n\t\t});\n\t\t$( \".select-year\" ).change(function() {\n\t\t\tslider.slider( \"value\", this.selectedIndex + 1 );\n\t\t});\n\t}", "title": "" }, { "docid": "28391f3e281b4c1bdbdf994b3009813b", "score": "0.56484836", "text": "function JQSliderCreate()\r\n{\r\n\t$(this)\r\n\t\t.removeClass('ui-corner-all ui-widget-content')\r\n\t\t.wrap('<span class=\"ui-slider-wrap\"></span>')\r\n\t\t.find('.ui-slider-handle')\r\n\t\t.removeClass('ui-corner-all ui-state-default');\r\n}", "title": "" }, { "docid": "d9791bee7f67cd3d5a2b970141bf76ac", "score": "0.56294185", "text": "function installSlider(){\n\t\t $(\"#slider\").rangeSlider({\n\t\t \tbounds:{\n\t\t \t\tmin: 1995,\n\t\t \t\tmax: 2014\n\t\t \t\t},\n\t\t \tdefaultValues:{\n\t\t \t\tmin: 1995,\n\t\t \t\tmax: 2014\n\t\t \t\t},\n\t\t \tstep: 1,\t \n\t\t\t\tscales : [\n\t\t\t\t\t// primary scale\n\t\t\t\t\t{\n\t\t\t\t\t\tfirst : function(val) {\n\t\t\t\t\t\t\treturn val;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnext : function(val) {\n\t\t\t\t\t\t\treturn val + 3;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstop : function(val) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlabel : function(val) {\n\t\t\t\t\t\t\treturn val;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tformat : function(tickContainer, tickStart, tickEnd) {\n\t\t\t\t\t\t\ttickContainer.addClass(\"myCustomClass\");\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t// secondary scale\n\t\t\t\t\t{\n\t\t\t\t\t\tfirst: function(val){ return val; },\n\t\t\t\t\t\tnext: function(val){\n\t\t\t\t\t\tif (val % 3 === 2){\n\t\t\t\t\t\treturn val + 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn val + 1;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstop: function(val){ return false; },\n\t\t\t\t\t\tlabel: function(){ return \"\"; }\n\t\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t});\n\t\t \n\t\t var initialSliderBounds = $(\"#slider\").rangeSlider(\"bounds\");\n\t\t dateFilterChanged(initialSliderBounds.min, initialSliderBounds.max);\n\t\t \n\t\t $(\"#slider\").bind(\"valuesChanged\", function(e, data){\n\t\t \t dateFilterChanged(data.values.min, data.values.max);\n\t\t });\n\t}", "title": "" }, { "docid": "ca5349dd977e5b7f9f82077fd743450c", "score": "0.56291217", "text": "function placeSlider(){\n\t\t\n\t\t//g_objPanel\n\t\tvar gallerySize = g_functions.getElementSize(g_objWrapper);\n\t\t\n\t\tvar sliderWidth = gallerySize.width;\n\t\tvar sliderHeight = gallerySize.height;\n\t\tvar sliderTop = 0;\n\t\tvar sliderLeft = 0;\n\t\t\n\t\tif(g_objPanel){\n\t\t\t\n\t\t\tvar panelSize = g_objPanel.getSize();\n\t\t\t\n\t\t\tswitch(g_options.theme_panel_position){\n\t\t\t\tcase \"left\":\n\t\t\t\t\tsliderLeft = panelSize.right;\n\t\t\t\t\tsliderWidth = gallerySize.width - panelSize.right;\t\n\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\t\tsliderWidth = panelSize.left;\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase \"top\":\n\t\t\t\t\tsliderHeight = gallerySize.height - panelSize.bottom;\n\t\t\t\t\tsliderTop = panelSize.bottom;\n\t\t\t\tbreak;\n\t\t\t\tcase \"bottom\":\n\t\t\t\t\tsliderHeight = panelSize.top;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tg_objSlider.setSize(sliderWidth, sliderHeight);\n\t\tg_objSlider.setPosition(sliderLeft, sliderTop);\n\t}", "title": "" }, { "docid": "23a0799992e9cbe597338913c77adf4d", "score": "0.56268555", "text": "function slider() {\n }", "title": "" }, { "docid": "d54dee30ef67adb987aaa533965d55db", "score": "0.56252635", "text": "function generateSliderHandle(slider, value){\n\t//sliders = document.getElementsByClassName(\"round-slider\");\n\tconsole.log(\"Slider:\", slider);\n\t\n\n\t\t// the angle should be fetched here from the popup, and message passing should\n\t\t// also be set up here, so that the param is passed through,\n\t\t// however, wait until actually have frequency stuff properly setup.\n\t\tcomputeStartAngle(slider, value);\n\n\t\tslider.addEventListener(\"click\", round_slider_tune, false);\n\t\tslider.addEventListener(\"mousedown\", function(event) {\n\t\t\tslider.onmousemove = function(event) {\n\t\t\t\tif (event.buttons == 1 || event.buttons == 3) {\n\t\t\t\t\tround_slider_tune(event);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\n}", "title": "" }, { "docid": "8932cf6314a7bc20563c255973a7daca", "score": "0.5606165", "text": "function Slider(parentDiv, SizeType) {\n this.SizeType = SizeType;\n this.ParentDiv = parentDiv;\n this.SliderDiv = \"SliderDiv\" + parentDiv;\n this.Top = 0;\n this.Left = 0;\n this.Position = \"absolute\";\n this.Width = 10;\n this.Height = 10;\n this.Background = \"#000\"//\"url(backcoverdark.png)\";\n this.Delay = 100;\n this.Increment = 100;\n this.MaxHeight = 100;\n this.MaxWidth = 100;\n this.SlideDown = slideFromUpDown;\n this.SlideRight = slideFromRightLeft;\n this.CreateDiv = createDiv;\n this.RightLeft = \"right\";\n this.UpDown = \"down\";\n this.Zindex = 9999;\n}", "title": "" }, { "docid": "c08c3e9627bb7d82052e5150dfd4d068", "score": "0.56029934", "text": "function slideProps(myValue) {\r\n document.getElementById(\"list_3\").innerHTML = \"\";\r\n var linebreak = document.createElement('br');\r\n\r\n //Properties Title\r\n var node = document.createElement(\"LI\");\r\n var x = document.createTextNode(\"Slider\");\r\n var el_span = document.createElement('span');\r\n el_span.setAttribute('class', 'propLabel');\r\n\r\n el_span.appendChild(x);\r\n node.appendChild(el_span);\r\n document.getElementById(\"list_3\").appendChild(node);\r\n\r\n //Textbox for Label change.\r\n var node2 = document.createElement(\"LI\");\r\n var label = document.createTextNode(\"Label: \");\r\n\r\n var y = document.createElement('input');\r\n y.setAttribute('type', 'text');\r\n y.setAttribute('id', 'selector');\r\n\r\n var elem = document.getElementById(myValue).parentNode;\r\n var name = \"\";\r\n\r\n var node = elem.childNodes[3];\r\n\r\n if (typeof node !== 'undefined') {\r\n if(node.nodeType == 3) {\r\n name = String(node.data);\r\n }\r\n }\r\n\r\n if(name != \"\") {\r\n y.setAttribute('value', name);\r\n }\r\n\r\n y.addEventListener(\"change\", function() {\r\n setValues(myValue, y);\r\n });\r\n\r\n function setValues(myVal, y) {\r\n var sturf = document.createTextNode(String(y.value));\r\n var searching = document.getElementById(myVal).parentNode;\r\n if(searching.lastChild.nodeType == 3) {\r\n searching.lastChild.remove();\r\n }\r\n document.getElementById(myVal).parentNode.appendChild(sturf);\r\n }\r\n\r\n node2.appendChild(label);\r\n node2.appendChild(y);\r\n document.getElementById(\"list_3\").appendChild(node2);\r\n}", "title": "" }, { "docid": "a3b4756304b2042459a7294329b6645a", "score": "0.5600484", "text": "function initialize ( target, originalOptions ) {\n\n if ( !target.nodeName ) {\n throw new Error('jungleSlider.create requires a single element.');\n }\n\n // Test the options and create the slider environment;\n var options = testOptions( originalOptions, target ),\n\t\t\tslider = closure( target, options, originalOptions );\n\n // Use the public value method to set the start values.\n slider.set(options.start);\n\n target.jungleSlider = slider;\n return slider;\n }", "title": "" }, { "docid": "e86fb09579817e52e8ac9cf3ab99c8e7", "score": "0.5598369", "text": "function JQSliderCreate()\n\t{\n\t\t$(this)\n\t\t\t.removeClass('ui-corner-all ui-widget-content')\n\t\t\t.wrap('<span class=\"ui-slider-wrap\"></span>')\n\t\t\t.find('.ui-slider-handle')\n\t\t\t.removeClass('ui-corner-all ui-state-default');\n\t}", "title": "" }, { "docid": "86f19378c06704bf7e7c88eaf97cd439", "score": "0.55866796", "text": "addArticleSlider()\n {\n this.articleSliders.push({name: '', id: null, images: []});\n }", "title": "" }, { "docid": "14a76d88dfef7e1c0e668e0a122db45f", "score": "0.55866003", "text": "function slider() {\r\n var node = document.createElement(\"LI\");\r\n node.setAttribute('class', 'base');\r\n\r\n var x = document.createElement(\"DIV\");\r\n x.setAttribute('class', 'slideStuff');\r\n\r\n var slideName = \"slider_\" + String(getSlide());\r\n addSlide();\r\n x.setAttribute('id', slideName);\r\n\r\n var y = document.createElement('button');\r\n y.setAttribute('content', 'test content');\r\n y.setAttribute('class', 'properties');\r\n y.innerHTML = 'Edit';\r\n\r\n var z = document.createElement('button');\r\n z.setAttribute('class', 'delete');\r\n z.innerHTML = 'x';\r\n\r\n node.appendChild(x);\r\n node.appendChild(y);\r\n node.appendChild(z);\r\n\r\n var tabID = String(getSelectedTabId());\r\n\r\n var tabContID = document.getElementById(tabID).children[0].id;\r\n\r\n document.getElementById(tabContID).appendChild(node);\r\n\r\n $(function() {\r\n $( \".slideStuff\" ).slider();\r\n });\r\n\r\n var active = $(\"#tabs .ui-tabs-panel:visible\").attr(\"id\");\r\n\r\n var test = document.getElementById(active).getElementsByClassName(\"fieldClass\");\r\n\r\n if(test.length > 0) {\r\n remake();\r\n }\r\n}", "title": "" }, { "docid": "24692519ffeaa01e84c4568b9840f4a1", "score": "0.55694026", "text": "function initialize ( target, originalOptions ){\nif ( !target || !target.nodeName ){\nthrow new Error(\"noUiSlider (\" + VERSION + \"):create requires a single element, got:\" + target);\n}\n// Test the options and create the slider environment;\nvar options = testOptions( originalOptions, target );\nvar api = closure( target, options, originalOptions );\ntarget.noUiSlider = api;\nreturn api;\n}", "title": "" }, { "docid": "bc7932542ca553f024bd1282a67ee437", "score": "0.55653703", "text": "function create(parentElement, settings) {\n if(!(parentElement && parentElement instanceof HTMLElement)) {\n parentElement = document.getElementsByTagName(\"body\")[0];\n }\n initSettings(settings);\n // Check to see if the slider is inside a form element.\n // If it is, save the original values so that the slider\n // can be reset to those values if the form gets reset.\n const parentForm = findParentForm(parentElement);\n if(parentForm && enableReset) {\n initialFrom = from;\n initialTo = to;\n addResetListener(parentForm);\n }\n mprsSlider = document.createElement(\"div\");\n mprsSlider.classList.add(\"mp-range-slider\");\n if(disabled) mprsSlider.classList.add(\"disabled\");\n if(sliderId) mprsSlider.id = sliderId;\n const labelDiv = document.createElement(\"div\");\n labelDiv.classList.add(\"mprs-label\");\n //labelDiv.textContent = label;\n const title = document.createElement(\"span\");\n title.classList.add(\"mprs-title\");\n title.textContent = label;\n labelDiv.appendChild(title);\n const labelRangeSpan = document.createElement(\"span\");\n labelRangeSpan.classList.add(\"mprs-range\");\n if(!labelRange) labelRangeSpan.classList.add(\"hidden\");\n labelRangeSpan.textContent = createRangeDescription();\n labelDiv.appendChild(labelRangeSpan)\n mprsSlider.appendChild(labelDiv);\n if(fromInputId) {\n const fromInput = document.createElement(\"input\");\n fromInput.setAttribute(\"type\", \"hidden\");\n fromInput.setAttribute(\"id\", fromInputId);\n fromInput.setAttribute(\"name\", fromInputId);\n fromInput.value = from;\n mprsSlider.appendChild(fromInput);\n }\n if(toInputId) {\n const toInput = document.createElement(\"input\");\n toInput.setAttribute(\"type\", \"hidden\");\n toInput.setAttribute(\"id\", toInputId);\n toInput.setAttribute(\"name\", toInputId);\n toInput.value = to;\n mprsSlider.appendChild(toInput);\n }\n const fromValueDiv = document.createElement(\"div\");\n fromValueDiv.classList.add(\"mprs-current-value\", \"from\");\n if(single) fromValueDiv.classList.add(\"single\");\n if(noLabel) fromValueDiv.classList.add(\"no-label\");\n const fromValue = document.createElement(\"span\");\n fromValue.classList.add(\"mprs-value\", \"from\");\n fromValue.textContent = from;\n fromValueDiv.appendChild(fromValue);\n if(!disabled) fromValueDiv.setAttribute(\"tabindex\", \"0\");\n fromValue.style.fontSize = getAdjustedFontSize(topStart, topEnd) + \"%\";\n if(hideValues) {\n fromValueDiv.style.display = \"none\";\n } else {\n fromValueDiv.onfocus = activateTop;\n fromValueDiv.onblur = deactivate();\n fromValueDiv.onkeydown = processKeyPress();\n }\n mprsSlider.appendChild(fromValueDiv);\n\n const toValueDiv = document.createElement(\"div\");\n toValueDiv.classList.add(\"mprs-current-value\", \"to\");\n if(noLabel) toValueDiv.classList.add(\"no-label\");\n const toValue = document.createElement(\"span\");\n toValue.classList.add(\"mprs-value\", \"to\");\n toValue.textContent = to;\n toValueDiv.appendChild(toValue);\n if(!disabled) toValueDiv.setAttribute(\"tabindex\", \"0\");\n toValue.style.fontSize = getAdjustedFontSize(bottomStart, bottomEnd) + \"%\";\n if(hideValues) {\n toValueDiv.style.display = \"none\";\n } else if(single) {\n toValueDiv.style.visibility = \"hidden\";\n } else {\n toValueDiv.onfocus = activateBottom;\n toValueDiv.onblur = deactivate();\n toValueDiv.onkeydown = processKeyPress();\n }\n mprsSlider.appendChild(toValueDiv);\n\n const sliderDiv = document.createElement(\"div\");\n sliderDiv.classList.add(\"mprs-slider\");\n const track = document.createElement(\"div\");\n track.classList.add(\"mprs-track\");\n if(single) track.onclick = clickTrack;\n\n const fromHandle = document.createElement(\"div\");\n fromHandle.classList.add(\"mprs-triangle-target\", \"from\");\n if(single) fromHandle.classList.add(\"single\");\n fromHandle.onmousedown = btnMouseDown;\n fromHandle.ontouchstart = btnTouchStart;\n const fromHandleTriangle = document.createElement(\"div\");\n fromHandleTriangle.classList.add(\"mprs-triangle\", \"from\");\n if(single) fromHandleTriangle.classList.add(\"single\");\n const fromPopup = document.createElement(\"div\");\n fromPopup.classList.add(\"mprs-popup\", \"mprs-hidden\", \"from\");\n fromHandle.appendChild(fromPopup);\n fromHandle.appendChild(fromHandleTriangle)\n track.appendChild(fromHandle);\n const toHandle = document.createElement(\"div\");\n toHandle.classList.add(\"mprs-triangle-target\", \"to\");\n const toHandleTriangle = document.createElement(\"div\");\n toHandleTriangle.classList.add(\"mprs-triangle\", \"to\");\n const toPopup = document.createElement(\"div\");\n toPopup.classList.add(\"mprs-popup\", \"mprs-hidden\", \"to\");\n toHandle.appendChild(toHandleTriangle);\n toHandle.appendChild(toPopup);\n track.appendChild(toHandle);\n if(!single) {\n toHandle.onmousedown = btnMouseDown;\n toHandle.ontouchstart = btnTouchStart;\n } else {\n toHandle.style.visibility = \"hidden\";\n }\n if(!dual) {\n const rangeBlock = document.createElement(\"div\");\n rangeBlock.classList.add(\"mprs-range-block\");\n track.appendChild(rangeBlock);\n }\n sliderDiv.appendChild(track);\n mprsSlider.appendChild(sliderDiv);\n\n parentElement.innerHTML = \"\";\n parentElement.appendChild(mprsSlider);\n\n setButtons();\n sizeSlider();\n // Set the id property of the publicAPI object to the current id and then freeze\n // publicAPI so that all of it's properties are immutable.\n publicAPI.id = sliderId;\n Object.freeze(publicAPI);\n if(sizing === \"variable\") {\n if(resizeObserver) {\n resizeObserver.observe(mprsSlider);\n } else {\n window.addEventListener('resize', sizeSlider);\n }\n }\n if(onCreate) onCreate();\n return publicAPI;\n }", "title": "" }, { "docid": "098eb9bdf1e1b9037233547411f5ade1", "score": "0.5563738", "text": "function Slider() {\n var that;\n that = this;\n\n /** Slider.slider\n *\n * The HTML input slider Element\n */\n this.slider = null;\n\n /** Slider.slider\n *\n * The HTML div Element creating the slider background\n */\n this.rangeFill = null;\n\n /** Slider.scale\n *\n * Scaling factor for the slider (fixed to 1 for now)\n */\n this.scale = 1;\n\n /** Slider.currentValue\n *\n * The current value of the slider\n */\n this.currentValue = 50;\n\n /** Slider.initialValue\n *\n * The initial value of the slider\n */\n this.initialValue = 50;\n\n /**\n * ### Slider.mainText\n *\n * A text preceeding the slider\n */\n this.mainText = null;\n\n /**\n * ### Slider.required\n *\n * If TRUE, the user must move the slider\n */\n this.required = null;\n\n /**\n * ### Slider.requiredChoice\n *\n * Same as Slider.required (backward compatibility)\n */\n this.requiredChoice = null;\n\n /**\n * ### Slider.hint\n *\n * An additional informative text\n *\n * If not specified, it may be auto-filled, e.g. '*'.\n *\n * TODO: autoHint\n * @see Slider.texts.autoHint\n */\n this.hint = null;\n\n /** Slider.min\n *\n * The value of the slider at the leftmost position\n */\n this.min = 0;\n\n /** Slider.max\n *\n * The value of the slider at the rightmost position\n */\n this.max = 100;\n\n /** Slider.correctValue\n *\n * The correct value of the slider, if any\n */\n this.correctValue = null;\n\n /** Slider.displayValue\n *\n * If TRUE, the current value of the slider is displayed\n */\n this.displayValue = true;\n\n /** Slider.valueSpan\n *\n * The SPAN element containing the current value\n *\n * @see Slider.displayValue\n */\n this.valueSpan = null;\n\n /** Slider.displayNoChange\n *\n * If TRUE, a checkbox for marking a no-change is added\n */\n this.displayNoChange = true;\n\n /** Slider.noChangeSpan\n *\n * The checkbox form marking the no-change\n *\n * @see Slider.displayNoChange\n * @see Slider.noChangeCheckbox\n */\n this.noChangeSpan = null;\n\n /** Slider.totalMove\n *\n * The total movement of the slider\n */\n this.totalMove = 0;\n\n /** Slider.volumeSlider\n *\n * If TRUE, only the slider to the left of the pointer is colored\n *\n * Available types: 'volume', 'flat'.\n */\n this.type = 'volume';\n\n /** Slider.hoverColor\n *\n * The color of the slider on mouse over\n */\n this.hoverColor = '#2076ea';\n\n /** Slider.listener\n *\n * The main function listening for slider movement\n *\n * Calls user-defined listener oninput\n *\n * @param {boolean} noChange Optional. The function is invoked\n * by the no-change checkbox. Note: when the function is invoked\n * by the browser, noChange is the change event.\n *\n * @see Slider.onmove\n */\n var timeOut = null;\n this.listener = function(noChange) {\n if (!noChange && timeOut) return;\n\n if (that.isHighlighted()) that.unhighlight();\n\n timeOut = setTimeout(function() {\n var percent, diffPercent;\n\n percent = (that.slider.value - that.min) * that.scale;\n diffPercent = percent - that.currentValue;\n that.currentValue = percent;\n\n // console.log(diffPercent);\n // console.log(that.slider.value, percent);\n\n if (that.type === 'volume') {\n // Otherwise it goes a bit outside.\n if (percent > 99) percent = 99;\n that.rangeFill.style.width = percent + '%';\n }\n else {\n that.rangeFill.style.width = '99%';\n }\n\n if (that.displayValue) {\n that.valueSpan.innerHTML =\n that.getText('currentValue', that.slider.value);\n }\n\n if (that.displayNoChange && noChange !== true) {\n if (that.noChangeCheckbox.checked) {\n that.noChangeCheckbox.checked = false;\n J.removeClass(that.noChangeSpan, 'italic');\n }\n }\n\n that.totalMove += Math.abs(diffPercent);\n\n if (that.onmove) {\n that.onmove.call(that, that.slider.value, diffPercent);\n }\n\n timeOut = null;\n }, 0);\n }\n\n /** Slider.onmove\n *\n * User-defined listener function to slider movement\n *\n * @see Slider.listener\n */\n this.onmove = null;\n\n /**\n * ### Slider.timeFrom\n *\n * Time event from which measuring time\n *\n * Default: 'step'\n *\n * @see node.timer.getTimeSince\n */\n this.timeFrom = 'step';\n\n }", "title": "" }, { "docid": "1214cee3f863a5671d2ade98aad6864d", "score": "0.55612004", "text": "function set_slider_range(param_name, min, max) {\n\tvar slider = $(\"#slider_\" + format_name(param_name));\n\n\tslider.slider(\"option\", \"min\", min*100);\n\tslider.slider(\"option\", \"max\", max*100);\n\n\tslider.slider(\"option\", \"value\", slider.slider(\"option\", \"value\"));\n\n}", "title": "" }, { "docid": "630755deeed8a908cebb18ea4a46e928", "score": "0.55317867", "text": "function createCategoriesSlider() {\n let startPoint = document.querySelector(\".dashboard__categories__slider\");\n\n categories.forEach((cat, i) => {\n let sliderItem = document.createElement(\"div\");\n sliderItem.className = \"categories__slider__item\";\n sliderItem.classList.add(`${cat.classes}`);\n sliderItem.onclick = function () {\n filterCategories(cat, sliderItem, i);\n };\n let SliderItemImg = document.createElement(\"img\"); //create the icon element\n SliderItemImg.src = cat.icon;\n SliderItemImg.alt = `${cat.classes}`;\n let sliderItemSpan = document.createElement(\"span\"); //create the text element\n sliderItemSpan.innerHTML = `${cat.category}`;\n startPoint.appendChild(sliderItem);\n sliderItem.appendChild(SliderItemImg);\n sliderItem.appendChild(sliderItemSpan);\n });\n}", "title": "" }, { "docid": "99409c7372c5515c330c31e7caae3f19", "score": "0.55141014", "text": "function updateSlider() {\n updateDataFromSlider() // update objects related to current date range on slider\n\n yearDates = getDatesByYear()\n\n // consts for slider display\n const firstJanuaryDates = yearDates.map(row => row[0])\n const minDate = firstJanuaryDates[0]\n const maxDate = firstJanuaryDates[firstJanuaryDates.length - 1]\n\n if (alreadyInitZoomed) {\n sliderSvg\n .call(slider\n .domain([minDate, maxDate])\n .tickValues(firstJanuaryDates)\n .marks(firstJanuaryDates)\n .value([minDate, maxDate])\n )\n } else {\n let oldSliderRange\n\n slider = d3\n .sliderBottom()\n .domain([minDate, maxDate])\n .width(650)\n .tickValues(firstJanuaryDates)\n .marks(firstJanuaryDates)\n .tickFormat(d3.timeFormat(\"%Y\"))\n .fill(\"blue\")\n .default([new Date(startYear), new Date(endYear)])\n .on(\"start\", () => {\n oldSliderRange = slider.value().map(value => new Date(value))\n })\n .on(\"end\", (newSliderRange) => {\n const sliderRange = newSliderRange.map(value => new Date(value))\n if (sliderRange[0].getTime() === sliderRange[1].getTime()) {\n sliderSvg\n .call(slider.value(oldSliderRange))\n\n throw \": YOU CAN'T SET SLIDER TICKS WITH SAME VALUES !\"\n }\n\n svg.call(zoom.transform, zoomTransform)\n })\n\n sliderSvg\n .call(slider)\n }\n }", "title": "" }, { "docid": "a6c73c6519b9ea9295cc99f509613778", "score": "0.5508222", "text": "function SliderWidget(hydroinst)\n{\n\tHydroWidget.call(this, hydroinst);\n\tthis.setter = function (val) { };\n}", "title": "" }, { "docid": "6e578bce0d3d3e9bebf451540ded35fc", "score": "0.5504805", "text": "function createMultiRangeSlider(inputRange) {\n\tvar data4Slider = [], maxRange = 0, inputRangeLen = inputRange.length;\n\t// Generate data for slider\n\tfor (var i = 0; i < inputRangeLen; i++) {\n\t\tmaxRange += inputRange[i];\n\t\tdata4Slider.push(maxRange);\n\t}\n\tif (rangeSlider != 0) {\n\t\t// slider already created\n\t\trangeSlider.noUiSlider.updateOptions({\n\t\t\tstart: data4Slider\n\t\t});\n\t} else {\n\t\t// create multi range slider\n\t\trangeSlider = document.getElementById('range-slider');\n\t\tnoUiSlider.create(rangeSlider, {\n\t\t\tstart: data4Slider,\n\t\t\tconnect: [true, true, true, true, true, true, true, true, true, true],\n\t\t\ttooltips: [true, true, true, true, true, true, true, true, true],\n\t\t\trange: {\n\t\t\t\t'min': 0,\n\t\t\t\t'max': maxRange\n\t\t\t}\n\t\t}).on('update', function (values, handle) {\n\t\t\tvar handles = values.length;\n\t\t\tfor (var i = 0; i < handles; i++) {\n\t\t\t\t$('.noUi-handle[data-handle=\"' + i + '\"] .noUi-tooltip').text('').html('<p class=\"noUi-tooltip-text\">' + dataRangeLabel[i] + '</p>');\n\t\t\t\t$('.noUi-handle[data-handle=\"' + i + '\"]').attr('data-before', getHandleValue(values, i, true));\n\t\t\t}\n\t\t\tupdateRangeSlider(values, handle);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "574d9a5a9aaa92b960ee538a3fc93588", "score": "0.55013156", "text": "function createFloodLevelSlider()\n{\t\n// set slider attributes\n\t$('#slider-holder').append('<div id=\"slider-vertical\">')\n\t$( \"#slider-vertical\" ).slider\n\t\t({\n \t \torientation: \"vertical\",\n \t\trange: \"max\",\n \t\tmin: -1,\n \t\tmax: 6,\n \t\tvalue: 0,\n \t\tstep: 1,\n \t\tslide: function( event, ui ) \n\t\t {\n\n\t\t if(ui.value == -1)\n\t\t {\n\t\t \tui.value = 0;\n\t\t \t$('#slider-vertical').remove();\n\t\t \tcreateFloodLevelSlider();\n\n\t\t };\n\t\t prevIndex = currentIndex;\n\t\t\t\tcurrentIndex = ui.value;\n\t\t\t\tupdateFloodLayers();\n\n\t\t\t\t// updateAggregateStatistics();\n\t\t \t}\n\n\t\t});\n\n}", "title": "" }, { "docid": "5ba09a505a09ba8cfe240662c8e48250", "score": "0.5497818", "text": "function sliders() {\n // First Slider \n $(\"#slider_1\").slider({\n min: 1,\n max: 20,\n slide:function(event,ui) {\n $(\"#x_lower\").val(ui.value);\n valid_submit();\n }\n });\n $(\"#x_lower\").change(function(){\n $(\"#slider_1\").slider(\"value\", this.value);\n valid_submit();\n })\n\n // Second Slider\n $(\"#slider_2\").slider({\n min: 1,\n max: 20,\n slide:function(event,ui) {\n $(\"#x_upper\").val(ui.value);\n valid_submit();\n }\n });\n $(\"#x_upper\").change(function(){\n $(\"#slider_2\").slider(\"value\", this.value);\n valid_submit();\n })\n\n // Third Slider\n $(\"#slider_3\").slider({\n min: 1,\n max: 20,\n slide:function(event,ui) {\n $(\"#y_lower\").val(ui.value);\n valid_submit();\n }\n });\n $(\"#y_lower\").change(function(){\n $(\"#slider_3\").slider(\"value\", this.value);\n valid_submit();\n })\n\n // Fourth Slider\n $(\"#slider_4\").slider({\n min: 1,\n max: 20,\n slide:function(event,ui) {\n $(\"#y_upper\").val(ui.value);\n valid_submit();\n }\n });\n $(\"#y_upper\").change(function(){\n $(\"#slider_4\").slider(\"value\", this.value);\n valid_submit();\n })\n}", "title": "" }, { "docid": "ea2eab503c96e6f67868bd15d61d602d", "score": "0.54902303", "text": "function Slider(elemName, selector, labels, allElems, default_val) {\n var self = {};\n self.MIN_STEP_SIZE = 0.01;\n var container;\n var slider;\n\n self.initialize = function(onChangeCallback) {\n container = $(selector);\n\n container.addClass('slider-container');\n\n // container.append(\n // '<div class=\"slider-labels\">' +\n // '<span style=\"text-align: left;\">' + labels[0] + '</span>' +\n // '<span style=\"text-align: center;\">' + labels[1] + '</span>' +\n // '<span style=\"text-align: right;\">' + labels[2] + '</span>' +\n // '</div>');\n\n slider = $('<div/>');\n\n container.append(slider);\n\n slider.slider({\n value: default_val,\n min: 0.0,\n max: 1.0,\n step: self.MIN_STEP_SIZE,\n tooltip: 'hide'\n });\n slider.on(\"change\", function(changeEvent) {\n var questLogger = RuthefjordLogging.activeTaskLogger;\n if (questLogger) {\n questLogger.logDoUiAction(elemName, 'change', changeEvent.value);\n }\n onChangeCallback(changeEvent.value.newValue);\n });\n //slider.on(\"slideStart\", function(slideEvent) {\n // var questLogger = RuthefjordLogging.activeTaskLogger;\n // if (questLogger) {\n // questLogger.logDoUiAction(elemName, 'start', null);\n // }\n //});\n //slider.on(\"slideStop\", function(slideEvent) {\n // var questLogger = RuthefjordLogging.activeTaskLogger;\n // if (questLogger) {\n // questLogger.logDoUiAction(elemName, 'stop', null);\n // }\n //});\n };\n\n self.setStepSize = function(s) {\n slider.slider(\"setAttribute\", \"step\", s);\n };\n\n self.getStepSize = function() {\n return slider.slider(\"getAttribute\", \"step\");\n };\n\n self.setVisible = function(isVisible) {\n $(allElems.join(', ')).css('visibility', isVisible ? 'visible' : 'hidden');\n };\n\n self.setEnabled = function(isEnabled) {\n if (isEnabled) {\n slider.slider(\"enable\");\n $(allElems.join(', ')).removeClass(\"disabled\");\n } else {\n slider.slider(\"disable\");\n $(allElems.join(', ')).addClass(\"disabled\");\n }\n container.attr('title', isEnabled ? '' : \"Can only use time slider in workshop mode.\");\n };\n\n self.isEnabled = function() {\n return slider.slider(\"isEnabled\");\n };\n\n self.value = function(x) {\n if (x === undefined) {\n return slider.slider(\"getValue\");\n } else {\n slider.slider(\"setValue\", x, false, false);\n }\n };\n\n return self;\n}", "title": "" }, { "docid": "8d048efe15a8a0df1d975211bf2e253f", "score": "0.5472603", "text": "function rangeBarToForm (slideAmount) {\n\tdocument.getElementById(\"slider_value\").value = slideAmount;\n}", "title": "" }, { "docid": "a863616b87ce9c9ef1e87c0dcd2d38c6", "score": "0.54687476", "text": "function goToSlide(x){\n //console.log('going to slide '+x);\n if(isInt(x)){\n Carousel.carousel(x);\n }else{\n Carousel.carousel(slides[x]);\n }\n}", "title": "" }, { "docid": "ee8a11d766d56264da3f89c96c886578", "score": "0.54647267", "text": "function Slider(config){\n\n this.__container = config.container;\n this.thumbs= this.__container.find('.thumb');\n this.thumbMin = this.thumbs[0];\n this.thumbMax = this.thumbs[1];\n this.bar = this.__container.find('em');\n\n /* Private variables */\n var __isEditable = config.isEditable || false,\n __isRange = config.isRange || false,\n __orientation = config.orientation || 'horizontal',\n __height = config.height || 100,\n __maxValue = config.maxValue || 100,\n __minValue = config.minValue || 0,\n __value = config.range || [0, config.initValue],\n __capacity = __maxValue - __minValue;\n\n\n /*Private variable getters */\n this.isEditable = function(){\n return __isEditable;\n };\n this.getMaxValue = function(){\n return __maxValue;\n };\n this.getMinValue = function(){\n return __minValue;\n };\n this.isRange = function(){\n return __isRange;\n };\n this.getInnerValue = function(){\n return __value;\n };\n this.updateValue = function(bottom, top){\n if(bottom instanceof Array) {\n _value = bottom;\n } else {\n __value = [\n bottom !== null ? bottom : this.getInnerValue()[0],\n top !== null ? top : this.getInnerValue()[1]\n ];\n }\n this.resizeRange(__value[0], __value[1]);\n };\n this.getCapacity = function(){\n return __capacity;\n }\n this.isVertical = function(){\n return __orientation != 'horizontal';\n };\n this.getHeight = function(){\n return __height;\n };\n this.positionToPercentage = function(val){\n return val / this.__container.find('.bar')[this.getCssPositions().size]() * 100;\n };\n this.percentageToValue = function(percentage) {\n return Math.round(percentage / 100 * this.getCapacity());\n };\n this.valueToPercentage = function(val){\n return val/this.getCapacity()*100;\n };\n\n var _cssPositions = {\n position : 'left',\n uiPosition : 'left',\n size : 'width'\n };\n\n if(this.isVertical()) {\n _cssPositions = {\n position : 'bottom',\n uiPosition : 'top',\n size : 'height'\n }\n };\n this.getCssPositions = function(){\n return _cssPositions;\n };\n\n this.init();\n}", "title": "" }, { "docid": "f6b0903805b7cf5179bf92422c732756", "score": "0.54454374", "text": "function setslider(){\r\n if (crop == \"allag\") {\r\n \tyearmin = 1997;\r\n \tyearmax = 2012;\r\n \tyearinterval = 5;\r\n \tvalue = 2012;\r\n } else {\r\n\t yearmin = cropyears[crop][0];\r\n\t yearmax = cropyears[crop][1];\r\n\t yearinterval = 1;\r\n \t}\r\n\r\n $(\"#year_slider\").attr({\r\n \t\"max\": yearmax,\r\n \t\"min\": yearmin,\r\n \t\"step\": yearinterval,\r\n \t\"value\": yearmax,\r\n });\r\n \r\n }", "title": "" }, { "docid": "7771f55b1124ac40624ec6a0139dfc2b", "score": "0.54434824", "text": "function sliderControlCreate(element, parent_div_id, control_name, control_label, appearance) {\n var col_md = 12;\n var initial = 100;\n var range = \"min\";\n if ('col_md' in appearance)\n col_md = appearance['col_md'];\n if ('initial' in appearance)\n initial = appearance['initial'];\n if ('range' in appearance)\n range = appearance['range'];\n\n var start_wrapper = '<div class =\"col-md-' + col_md + ' controls \" > <div class =\"form-group\" >';\n var end_wrapper = '</div></div>';\n var label = '<label>' + control_label + '</label>';\n var slider_html = start_wrapper + '<p> ' + label + ': <input type = \"text\" id = \"no_' + element + '\"style = \"border:0; color:#b9cd6d; font-weight:bold;\" > <input type=\"hidden\" id=\"' + element + '\" value = \"\" class=\"form_control\" name=\"' + control_name + '\"></p>';\n slider_html += '<div id = \"slider_' + element + '\"></div>' + end_wrapper;\n $(\"#\" + parent_div_id).append(slider_html);\n handleSlider(element, initial, range);\n}", "title": "" }, { "docid": "c1260adde990471bb0da47fa90fff023", "score": "0.544343", "text": "function Slider(min, max, width, height) {\n\t\t\t\t\tthis.Shape_constructor();\n\t\t\t\t\tthis.min = this.value = min || 0;\n\t\t\t\t\tthis.max = max || 100;\n\t\t\t\t\tthis.width = width || 100;\n\t\t\t\t\tthis.height = height || 20;\n\t\t\t\t\tthis.values = {};\n\t\t\t\t\tthis.trackColor = \"#EEE\";\n\t\t\t\t\tthis.thumbColor = \"#666\";\n\t\t\t\t\tthis.cursor = \"pointer\";\n\t\t\t\t\tthis.on(\"mousedown\", this._handleInput, this);\n\t\t\t\t\tthis.on(\"pressmove\", this._handleInput, this);\n\t\t\t\t}", "title": "" }, { "docid": "6fc448aba5d9ebc2d3c047b9bdae8150", "score": "0.543931", "text": "function presetTemp(id,low,high)\n{\n $(id).click(function()\n {\n $(\"#tempSlider\").rangeSlider(\"values\", low, high); \n }); \n}", "title": "" }, { "docid": "7a1e7593cf061fc178bfb3b0bcb1b28a", "score": "0.5436033", "text": "function slider(s00,s01){this.f_setValue=s0R;this.s0F=s0M;this.s0E=s0L;this.f_onButton=s0Q;if(!window.A_SLIDERS)window.A_SLIDERS=[];this.n_id=window.A_SLIDERS.length;window.A_SLIDERS[this.n_id]=this;var s0k;if(s01)for(s0k in s01)this[s0k]=s01[s0k];for(s0k in s00)this[s0k]=s00[s0k];for(s0k in this)if(typeof(this[s0k])=='string'&&s0k.indexOf('s_img')==0){var e_img=new Image();e_img.src=this[s0k];this['cache_'+s0k]=e_img;}this.s0Z=this.n_pathLength/(this.n_maxValue-this.n_minValue);this.n_increments=this.n_step?this.n_step:(this.n_maxValue-this.n_minValue)/10;if(this.n_value==null)this.n_value=this.n_minValue;var s_butMinus=this.s_imgMinus?'<td'+(this.s_imgMinusHover?' onmouseover=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'over\\')\"':'')+' onmouseout=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'out\\')\" onmousedown=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'down\\')\" onmouseup=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'up\\')\"><img src=\"'+this.s_imgMinus+'\" ondrag=\"return false\" name=\"sl'+this.n_id+'minus\" id=\"sl'+this.n_id+'minus\" border=\"0\" style=\"cursor:pointer;\"/></td>':0,s0m='<td background=\"'+this.s_imgControl+'\"><div id=\"sl'+this.n_id+'base\" onmousedown=\"return s0N('+this.n_id+')\" valign=\"top\" style=\"position:relative;width:'+this.n_controlWidth+'px;height:'+this.n_controlHeight+'px;\">'+(this.s_imgBar?'<img src=\"'+this.s_imgBar+'\" border=\"0\" style=\"position:absolute;left:0px;top:0px;visibility:hidden;z-index:'+this.n_zIndex+'\" name=\"sl'+this.n_id+'bar\" id=\"sl'+this.n_id+'bar\" onmousedown=\"return s0N('+this.n_id+')\">':'')+'<img src=\"'+this.s_imgSlider+'\" width=\"'+this.n_sliderWidth+'\" height=\"'+this.n_sliderHeight+'\" border=\"0\" style=\"position:relative;left:'+this.n_pathLeft+'px;top:'+this.n_pathTop+'px;z-index:'+(this.n_zIndex+1)+';cursor:pointer;visibility:hidden;\" name=\"sl'+this.n_id+'slider\" id=\"sl'+this.n_id+'slider\"/></div></td>',s_butPlus=this.s_imgPlus?'<td'+(this.s_imgPlusHover?' onmouseover=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'over\\')\"':'')+' onmouseout=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'out\\')\" onmousedown=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'down\\')\" onmouseup=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'up\\')\"><img src=\"'+this.s_imgPlus+'\" ondrag=\"return false\" name=\"sl'+this.n_id+'plus\" id=\"sl'+this.n_id+'plus\" border=\"0\" style=\"cursor:pointer;\"/></td>':0;if(this.b_reverse){var s0n=s_butMinus;s_butMinus=s_butPlus;s_butPlus=s0n;}document.write('<table cellpadding=\"0\" cellspacing=\"'+this.n_spacing+'\" border=\"0\"><tr>'+(this.b_vertical?(s_butPlus?s_butPlus+'</tr><tr>':''):(s_butMinus?s_butMinus:''))+s0m+(this.b_vertical?(s_butMinus?'</tr><tr>'+s_butMinus:''):(s_butPlus?s_butPlus:''))+'</tr></table>');this.s09=s0S('sl'+this.n_id+'base');this.s0A=s0S('sl'+this.n_id+'slider');if(s_butMinus)this.e_imgMinus=s0S('sl'+this.n_id+'minus');if(s_butPlus)this.e_imgPlus=s0S('sl'+this.n_id+'plus');var s0B=this.s_form==null?s0S(this.s_name):document.forms[this.s_form]?document.forms[this.s_form].elements[this.s_name]:null;this.f_setValue(s0B&&s0B.value!=''?s0B.value:null,1);this.s0A.style.visibility='visible';if(this.s_imgBar){this.s08=s0S('sl'+this.n_id+'bar');this.s08.style.clip=this.s0E();this.s08.style.visibility='visible'}if(document.addEventListener){document.addEventListener('mousemove',s0O,false);document.addEventListener('mouseup',s0P,false);}if(window.attachEvent){document.attachEvent('onmousemove',s0O);document.attachEvent('onmouseup',s0P);}else{document.onmousemove=s0O;document.onmouseup=s0P;}}", "title": "" }, { "docid": "ad5c1da1e0c76da7ddb87fb230109cf4", "score": "0.5435621", "text": "function createSlider(handleId, trackId, sampleSpan, indicator, initialValue, minValue, factorRange, increment, inputElement) {\n var fullSliderId = handleId + '_slider_' + trackId;\n\n // Already exists, nothing to do\n if (!!Ext.fly(fullSliderId)) {\n return;\n }\n\n // Note: we assume that the color store has been initialized. We have to do this because loading the color store is\n // an asynchronous operation and this could cannot successfully be executed until it has fully loaded. For this reason,\n // we leave it up to the page to load the color store and kick off the page loading in a callback. \n // See the bottom of compensantingControlsInclude.xhtml or riskScores.xhtml for an example -- Bernie\n var colorStore = Ext.StoreMgr.lookup('neutralColorStore');\n\n var extSlider = Ext.create('Ext.slider.Single', {\n width: 300,\n value: getInitialValue(initialValue),\n increment: 1,\n minValue: minValue,\n maxValue: factorRange,\n useTips: false,\n animate: false,\n renderTo: handleId,\n id: fullSliderId,\n listeners: {\n change: {\n fn: function(slider, newVal, thumb, eOpts) {\n var newValue = Math.round(1 * newVal) / 1;\n inputElement.value = newValue;\n var updatedSampleValue;\n\n if (inputElement.isReducer == true) {\n // The reducer scale works differently on the back end, so we have to normalize\n // it to obtain a meaningful color\n updatedSampleValue = Math.round(1000.0 - (10.0 * inputElement.value));\n }\n else {\n updatedSampleValue = Math.round(inputElement.value);\n if (updatedSampleValue > 1000) {\n updatedSampleValue = 1000;\n }\n }\n\n indicator.src = colorStore.getImageUrlForScore(updatedSampleValue);\n\n isPageDirty = true;\n }\n }\n }\n });\n\n inputElement.onchange = function() {\n updateSliderWithInput(extSlider, inputElement);\n isPageDirty = true;\n };\n \n // Force IE to react to enter being pressed\n inputElement.onkeyup = function(event) {\n if (!event) {\n event = window.event;\n }\n \n updateSliderWithInput(extSlider, inputElement, event);\n };\n \n return extSlider;\n}", "title": "" }, { "docid": "622b23a6e2c87caaa6477acd3fa3c335", "score": "0.5435402", "text": "init() {\n\n const Slider = this\n console.log(`${this.name} has initialised`)\n this.dom = this.cacheDom()\n\n // Make the slider\n this.makeSlider()\n\n }", "title": "" }, { "docid": "619360f32fe101ff415e4c5602fd79ae", "score": "0.54265845", "text": "function Slider(min, max, width, height) {\n\t\t\t\tthis.Shape_constructor();\n\t\t\t\tthis.min = this.value = min || 0;\n\t\t\t\tthis.max = max || 100;\n\t\t\t\tthis.width = width || 100;\n\t\t\t\tthis.height = height || 20;\n\t\t\t\tthis.values = {};\n\t\t\t\tthis.trackColor = \"#EEE\";\n\t\t\t\tthis.thumbColor = \"#666\";\n\t\t\t\tthis.cursor = \"pointer\";\n\t\t\t\tthis.on(\"mousedown\", this._handleInput, this);\n\t\t\t\tthis.on(\"pressmove\", this._handleInput, this);\n\t\t\t}", "title": "" }, { "docid": "dbd3f6864d5f9898392424a6a6463b69", "score": "0.54264313", "text": "function Slider(element) {\n var data = {\n infinite: element.getAttribute('data-infinite') === 'true' ? 1 : 0,\n navigation: element.getAttribute('data-navigation') === 'true',\n autoplay: element.getAttribute('data-autoplay') === 'true'\n };\n\n var lory = window.lory ? window.lory : (typeof require === 'function' ? require('lory.js').lory : null);\n var slider = lory(element, data);\n\n if (!data.infinite) {\n this.disableNavButtons(element, slider);\n }\n\n if (data.navigation) {\n this.navigationDots(element, slider, data);\n }\n\n this.enableSwipeGesturesOnVideo(element);\n }", "title": "" }, { "docid": "a74afecf8788ff56067e5f814d651ae6", "score": "0.5423019", "text": "function Slider(min, max, width, height) {\n\t\tthis.Shape_constructor();\n\n\t// public properties:\n\t\tthis.min = this.value = min||0;\n\t\tthis.max = max||100;\n\n\t\tthis.width = width||100;\n\t\tthis.height = height||20;\n\n\t\tthis.values = {};\n\n\t\tthis.trackColor = \"#BDBDD2\";\n\t\tthis.thumbColor = \"#646483\";\n\n\t\tthis.cursor = \"pointer\";\n\t\tthis.on(\"mousedown\", this._handleInput, this);\n\t\tthis.on(\"pressmove\", this._handleInput, this);\n\t}", "title": "" }, { "docid": "2836805097bec7baf0413ba96d4ef864", "score": "0.5416731", "text": "function sliderMove()\r\n{\r\n var offset = 0\r\n for (var t = 0; t < sliders.length; t++)\r\n {\r\n var slid = map(sin(angle+offset), -1, 1, 0, 255)\r\n sliders[t].value(slid)\r\n offset += vTest;\r\n } \r\n}", "title": "" }, { "docid": "45c1fa97b8b0fdead00f22b9dc117d0b", "score": "0.5412953", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target || !target.nodeName ) {\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target );\n\t\tvar api = closure( target, options, originalOptions );\n\n\t\ttarget.noUiSlider = api;\n\n\t\treturn api;\n\t}", "title": "" }, { "docid": "45c1fa97b8b0fdead00f22b9dc117d0b", "score": "0.5412953", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target || !target.nodeName ) {\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target );\n\t\tvar api = closure( target, options, originalOptions );\n\n\t\ttarget.noUiSlider = api;\n\n\t\treturn api;\n\t}", "title": "" }, { "docid": "45c1fa97b8b0fdead00f22b9dc117d0b", "score": "0.5412953", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target || !target.nodeName ) {\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target );\n\t\tvar api = closure( target, options, originalOptions );\n\n\t\ttarget.noUiSlider = api;\n\n\t\treturn api;\n\t}", "title": "" }, { "docid": "45c1fa97b8b0fdead00f22b9dc117d0b", "score": "0.5412953", "text": "function initialize ( target, originalOptions ) {\n\n\t\tif ( !target || !target.nodeName ) {\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\n\t\t}\n\n\t\t// Test the options and create the slider environment;\n\t\tvar options = testOptions( originalOptions, target );\n\t\tvar api = closure( target, options, originalOptions );\n\n\t\ttarget.noUiSlider = api;\n\n\t\treturn api;\n\t}", "title": "" }, { "docid": "c11ffdd8b082a744ac787c3ed4121434", "score": "0.54096067", "text": "function changeSlider(){\n video[this.name] = this.value;\n\n}", "title": "" }, { "docid": "aef9ad7cea1b433df0ecfa86fc9f8a6b", "score": "0.54079324", "text": "function Slider(min, max, width, height) {\n\t\t\t\t\tthis.Shape_constructor();\n\t\t\t\t\t// public properties:\n\t\t\t\t\tthis.min = this.value = min || 0;\n\t\t\t\t\tthis.max = max || 100;\n\t\t\t\t\tthis.width = width || 100;\n\t\t\t\t\tthis.height = height || 20;\n\t\t\t\t\tthis.values = {};\n\t\t\t\t\tthis.trackColor = \"#EEE\";\n\t\t\t\t\tthis.thumbColor = \"#666\";\n\t\t\t\t\tthis.cursor = \"pointer\";\n\t\t\t\t\tthis.on(\"mousedown\", this._handleInput, this);\n\t\t\t\t\tthis.on(\"pressmove\", this._handleInput, this);\n\t\t\t\t}", "title": "" }, { "docid": "9f01762deb34c1ef428140ee1bf2be08", "score": "0.54048854", "text": "function Slider(min, max, width, height) {\n\t\t\t\t\t\tthis.Shape_constructor();\n\t\t\t\t\t\t// public properties:\n\t\t\t\t\t\tthis.min = this.value = min || 0;\n\t\t\t\t\t\tthis.max = max || 100;\n\t\t\t\t\t\tthis.width = width || 100;\n\t\t\t\t\t\tthis.height = height || 20;\n\t\t\t\t\t\tthis.values = {};\n\t\t\t\t\t\tthis.trackColor = \"#EEE\";\n\t\t\t\t\t\tthis.thumbColor = \"#666\";\n\t\t\t\t\t\tthis.cursor = \"pointer\";\n\t\t\t\t\t\tthis.on(\"mousedown\", this._handleInput, this);\n\t\t\t\t\t\tthis.on(\"pressmove\", this._handleInput, this);\n\t\t\t\t\t}", "title": "" }, { "docid": "2fb1ea6a32c6df054d5ef43102f5a407", "score": "0.5402512", "text": "function slider(element) {\n\t\tthis.element = element;\n\t\tthis.slides = this.element.querySelector('.slides').getElementsByTagName('li');\n\t\tthis.slidesNumber = this.slides.length;\n\t\tthis.arrowsNavigation = this.element.querySelector('.slider-navigation');\n\t\tthis.dotsNavigation = this.element.querySelector('.slider-dots-navigation');\n\t\tthis.dots = this.dotsNavigation.getElementsByTagName('a');\n\n\t\tthis.selectedSlide = 0;\n\t\tthis.prevSelectedSlide = 0;\n\t\t//check if mouse is over the slide element\n\t\tthis.hovered = false;\n\n\t\tthis.bindEvents();\n\t}", "title": "" }, { "docid": "c0aed74ffb25f0b666f75bca2cf6d234", "score": "0.54007083", "text": "function initialize ( target, originalOptions ) {\r\n\r\n\t\tif ( !target || !target.nodeName ) {\r\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): create requires a single element, got: \" + target);\r\n\t\t}\r\n\r\n\t\t// Throw an error if the slider was already initialized.\r\n\t\tif ( target.noUiSlider ) {\r\n\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): Slider was already initialized.\");\r\n\t\t}\r\n\r\n\t\t// Test the options and create the slider environment;\r\n\t\tvar options = testOptions( originalOptions, target );\r\n\t\tvar api = scope( target, options, originalOptions );\r\n\r\n\t\ttarget.noUiSlider = api;\r\n\r\n\t\treturn api;\r\n\t}", "title": "" }, { "docid": "a4b65b72e132ec3dc209200a95683624", "score": "0.5394743", "text": "function setup() {\n //MAKES SLIDER TO DETERMINE SCALE\n slider = createSlider(200, 800, 200);\n\n}", "title": "" }, { "docid": "b567a870ec6ced8c33dad7acd8961d12", "score": "0.53932166", "text": "function SliderConfig() {\n\n _self = this;\n\n this.data = {\n barsCount: config.bars.count,\n maxDecibels: config.analyser.maxDecibels,\n minDecibels: config.analyser.minDecibels,\n playerWidth: config.player.width,\n rectPadding: config.rect.padding,\n rectVelocity: config.rect.velocity,\n wheelLineWidth: config.wheel.lineWidth,\n wheelRadius: config.wheel.radius\n };\n this.sliders = {};\n}", "title": "" }, { "docid": "a3e410c51604fc57d6e7c087302b1255", "score": "0.5391231", "text": "function PivotSlider(container, min, max, value, leftLabel, rightLabel) {\n var self = this,\n minusButton, // the HTML element for the minus button at the left\n plusButton, // the HTML element for the plus button at the right\n minusDisabled, // whether the minus sign is grayed out and unclickable\n plusDisabled, // whether the plus sign is grayed out and unclickable\n sliderBackground, // the HTML element for the horizontal background line\n sliderHandle, // the HTML element that can be grabbed and moved\n pixelUnits, // how wide each pixel is on the number line\n stepSize = (max - min) / 16, // how far to move for each click on plus or minus\n tracker, // the MouseTracker that deals with slider interaction\n mouseDownX, // the position the mouse was pressed down on the slider bar\n pxPosition, // the position of the slider handle, in pixels from the left end\n sliderWidth, // the width of the background slider bar, in px\n handleWidth; // the width of the slider handle, in px\n\n // inherit from EventManager\n Seadragon2.EventManager.call(self);\n\n // sanitize the arguments\n if (!(min < max)) {\n min = 0;\n max = 1;\n }\n if (typeof value !== \"number\") {\n value = min + (max - min) / 2;\n }\n\n minusButton = makeElement(\"div\", \"pivot_zoomout pivot_hoverable\", container);\n minusButton.innerHTML = \"&minus;\";\n minusButton.title = leftLabel;\n sliderBackground = makeElement(\"div\", \"pivot_zoomline\", container);\n sliderHandle = makeElement(\"div\", \"pivot_zoomhandle\", sliderBackground);\n sliderWidth = sliderBackground.offsetWidth;\n handleWidth = sliderHandle.offsetWidth;\n pixelUnits = (max - min) / (sliderWidth - handleWidth);\n plusButton = makeElement(\"div\", \"pivot_zoomin pivot_hoverable\", container);\n addText(plusButton, \"+\");\n plusButton.title = rightLabel;\n\n // handle a click on the minus button\n minusButton.onclick = function () {\n if (!minusDisabled) {\n self.setValue(value - stepSize, true);\n }\n };\n\n // handle a click on the plus button\n plusButton.onclick = function () {\n if (!plusDisabled) {\n self.setValue(value + stepSize, true);\n }\n };\n\n // set up mouse tracking for the slider handle\n tracker = new Seadragon2.MouseTracker(sliderHandle);\n tracker.addListener(\"press\", function (tracker, id, position) {\n mouseDownX = position.x;\n document.documentElement.className += \" pivot_eresize\";\n });\n tracker.addListener(\"release\", function () {\n var documentElement = document.documentElement;\n mouseDownX = undefined;\n documentElement.className = documentElement.className.replace(\" pivot_eresize\", \"\");\n });\n tracker.addListener(\"drag\", function (tracker, id, position) {\n self.setValue((pxPosition + position.x - mouseDownX) * pixelUnits + min, true);\n });\n tracker.setTracking(true);\n \n // handle a click elsewhere inside the slider\n container.onclick = function (e) {\n var target = e.target;\n // ignore clicks that were on the buttons or slider handle\n if (target === container || target === sliderBackground) {\n // get the mouse position relative to the slider bar\n var position = Seadragon2.Mouse.getPosition(e).minus(Seadragon2.Element.getPosition(sliderBackground)).x;\n if (position >= 0 && position < sliderWidth) {\n // move the slider to the value that was clicked\n self.setValue((position - handleWidth / 2) * pixelUnits + min, true);\n }\n }\n };\n\n // this function checks that the value is in the allowed range, and\n // disables or enables the plus and minus buttons as necessary. It also\n // sets the position of the slider bar. It won't do anything if called\n // while the user is actively interacting with the control, unless the\n // internal parameter is true. Also, if the internal parameter is true,\n // this function raises the change event.\n self.setValue = function (newValue, internal) {\n if (mouseDownX === undefined || internal) {\n\n // set the new value\n var oldValue = value;\n value = newValue;\n\n // check whether buttons should be enabled or disabled\n if (value <= min) {\n value = min;\n if (!minusDisabled) {\n minusDisabled = true;\n minusButton.title = \"\";\n minusButton.className = \"pivot_zoomout pivot_hoverable pivot_disabled\";\n }\n } else if (minusDisabled) {\n minusDisabled = false;\n minusButton.title = leftLabel;\n minusButton.className = \"pivot_zoomout pivot_hoverable\";\n }\n if (value >= max) {\n value = max;\n if (!plusDisabled) {\n plusDisabled = true;\n plusButton.title = \"\";\n plusButton.className = \"pivot_zoomin pivot_hoverable pivot_disabled\";\n }\n } else if (plusDisabled) {\n plusDisabled = false;\n plusButton.title = rightLabel;\n plusButton.className = \"pivot_zoomin pivot_hoverable\";\n }\n\n // move the slider handle\n pxPosition = Math.round((value - min) / pixelUnits);\n sliderHandle.style.left = pxPosition + \"px\";\n\n // raise a change event\n if (internal && oldValue !== value) {\n self.trigger(\"change\", value);\n }\n }\n };\n\n self.setValue(value);\n}", "title": "" } ]
9e81f97d7e14312055234733a3c71333
}); get change color
[ { "docid": "bd28d098e4c27050777656636e5b24ca", "score": "0.0", "text": "function changeColor(target){\n for(let i = 0; i < squares.length; i++)\n squares[i].style.backgroundColor = target;\n}", "title": "" } ]
[ { "docid": "561b6df11c1e39b51245386eec11c20c", "score": "0.7876059", "text": "function changeColor(){\n\n}", "title": "" }, { "docid": "53ea9468e782b9fd14c0d248d463a4c2", "score": "0.76318496", "text": "function getColor() {\n return '#357EC7';\n}", "title": "" }, { "docid": "e03dfaa1705a6421f3b7de9b17e73ded", "score": "0.7518175", "text": "function colorChange(card = cardCursor){\n var hwb = 'hwb(' + colorHue + ',' + colorWhite + ',' + colorBlack + ')';\n var color = w3color(hwb);\n var rgb = color.toRgbString();\n var hex = color.toHexString();\n\n if (card != null) {\n setHexValue(card.attr('id'), hex);\n card.css('background-color', rgb);\n }\n\n // ------------------------------------------------\n // do somthing here\n $('#status').html(rgb)\n $('#box').css('background-color', rgb)\n // ------------------------------------------------\n }", "title": "" }, { "docid": "8f09f87239bf6a98af35f76dcccff54b", "score": "0.74673903", "text": "get color() { return \"#e1b000\" }", "title": "" }, { "docid": "d0cab48cbe2cd93b4ae90a35cc28de9b", "score": "0.74242777", "text": "get color() {}", "title": "" }, { "docid": "c34552ce2e4fcd086222e2e7add050cf", "score": "0.7375", "text": "function changecolor(){\n\t\tconsole.log(\"this is \"+this);\n\t\tvar color = $(this).css('background-color');\n\t\tconsole.log(\"its\"+color);\n\t\tif(color=='rgb(255, 0, 0)'){\n\t\t\t$(this).css('background-color','rgb(0,255,0)');\n\t\t}\n\t\telse if(color=='rgb(0, 255, 0)'){\n\t\t\t$(this).css('background-color','rgb(0,0,255)');\n\t\t}\n\t\telse if(color=='rgb(0, 0, 255)'){\n\t\t\t$(this).css('background-color','rgb(255,0,0)');\n\t\t}\n\t\telse{\n\t\t\t$(this).css('background-color','rgb(255,0,0)');\n\t\t\tpoints+=1000;\n\t\t\t$('#points').text(points);\n\t\t}\n\t}", "title": "" }, { "docid": "2fdf967232d1379770a2a357c8987a3d", "score": "0.72952807", "text": "function colorChange(){\n document.getElementById('rgbCode').textContent = \"Current Color: \"+ \"rgb(\" + redVal + \",\" + greenVal + \",\" + blueVal + \")\";\n colorDiv.style.backgroundColor = \"rgb(\" + redVal + \",\" + greenVal + \",\" + blueVal + \")\"\n }", "title": "" }, { "docid": "1a95c7e1d133c02c0298a955f204dbf8", "score": "0.72834146", "text": "callbackColorChange(){\n this.setTint(this.naturalTint);\n }", "title": "" }, { "docid": "9a15089c6995d7a32f33a9642df3e3ae", "score": "0.7258795", "text": "function colorChange(buttonNum) {\n cc.r = buttonNum.r;\n cc.g = buttonNum.g;\n cc.b = buttonNum.b;\n ccl = buttonNum.name;\n}", "title": "" }, { "docid": "b46be9a724b416d1d693f8ff15f2e4e2", "score": "0.72331923", "text": "function actualizarColorFondo (scolor){\n\n}", "title": "" }, { "docid": "564f87575ec9d40d7093803650ece143", "score": "0.72308713", "text": "static get color() {}", "title": "" }, { "docid": "4d147495c6c3b0a04136b6789e9374be", "score": "0.719247", "text": "function setColor(newColor){\n color = newColor;\n}", "title": "" }, { "docid": "34789d32522659fdfe0b8fe70307a9b0", "score": "0.7169908", "text": "function getColor(color)\n{\n\tcolorCode = color.selectedIndex;\n}", "title": "" }, { "docid": "34789d32522659fdfe0b8fe70307a9b0", "score": "0.7169908", "text": "function getColor(color)\n{\n\tcolorCode = color.selectedIndex;\n}", "title": "" }, { "docid": "34789d32522659fdfe0b8fe70307a9b0", "score": "0.7169908", "text": "function getColor(color)\n{\n\tcolorCode = color.selectedIndex;\n}", "title": "" }, { "docid": "a2b64efefa848c2a11a016db8277fc9a", "score": "0.71608365", "text": "getColor() { // Obtiene\n return this.color;\n }", "title": "" }, { "docid": "71b3ed32158db2c263f018a9c3ba0b7e", "score": "0.7154852", "text": "static set color(value) {}", "title": "" }, { "docid": "09ce8e63408819ba03b9bf8e2814af07", "score": "0.71509844", "text": "function changeColor(){\n rVal = Math.random() * (255 - 1) + 1;\n gVal = Math.random() * (255 - 1) + 1;\n bVal = Math.random() * (255 - 1) + 1;\n }", "title": "" }, { "docid": "26996f44b0923fb157ed0cdf9ff0a621", "score": "0.71421474", "text": "function change() {\n if (changeColor === 1) {\n color = \"#13073A\";\n changeColor = 2;\n } else {\n color = \"#530E53\";\n changeColor = 1;\n } \n \n background(color);\n \n}", "title": "" }, { "docid": "26b37c9bde3e4e79f73d39da6ed612e7", "score": "0.7129036", "text": "function currentColor() {\n\t\t var r = $(\"#red\").val();\n\t\t var g = $(\"#green\").val();\n\t\t var b = $(\"#blue\").val();\n\t\t var color = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n\n\t\t return color;\n\t\t}", "title": "" }, { "docid": "1f751af173f55a390db47d6a6688c9a3", "score": "0.71110785", "text": "function updateColor(event) {\n\tsetColor(event.target.value);\n}", "title": "" }, { "docid": "807190125d80cf6d7a03ea4a07a21f8e", "score": "0.71023554", "text": "function colorChange(review){\n\t\t \n\t\t\tswitch(review){\n\t\t\tcase 1:\n\t\t\tcolor = \"purple\";\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tcolor = \"red\";\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\tcolor = \"blue\";\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\tcolor = \"green\";\n\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\tcolor = \"orange\";\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tcolor = \"white\";\n\t\t\t}\n\t\t\t\treturn color;\n\t\t\t}", "title": "" }, { "docid": "a0a33493cbe10326f4b8c91ff5a683c2", "score": "0.70868313", "text": "function changeColor(newColor) {\n rippleColor = newColor;\n }", "title": "" }, { "docid": "d5439581c8e0e4ee27a2691c4f0fbec2", "score": "0.707936", "text": "function colorChange(event){\n const change = event.currentTarget;\n change.style.color = colorRam();\n \n}", "title": "" }, { "docid": "b1b6932a6a3bb04d3562c1411674f539", "score": "0.7071569", "text": "changeColor(_color){\n this.color = _color ;\n }", "title": "" }, { "docid": "7d69b41c6d39d0c3af86fb4569147523", "score": "0.70660275", "text": "get color() {\n return this.getColor();\n }", "title": "" }, { "docid": "d04ec373f57a61f57015ef4f1c06064e", "score": "0.7050384", "text": "function colorFillChange() {\n colorMode= \"colorValue\";\n}", "title": "" }, { "docid": "5bd970f14a8d1bec1244fdb8b3306e5a", "score": "0.70468616", "text": "function cambiarColorRojo() {\n color = 'red';\n}", "title": "" }, { "docid": "2f915fe60b064521a298c5697e156de0", "score": "0.7018929", "text": "get color() { return this._color; }", "title": "" }, { "docid": "2f915fe60b064521a298c5697e156de0", "score": "0.7018929", "text": "get color() { return this._color; }", "title": "" }, { "docid": "cd88fc3a672c464aa3232ff0250b96a0", "score": "0.700309", "text": "getMyColor() {\n var result = getColorByEventType(this.eventType);\n\n return result;\n }", "title": "" }, { "docid": "69f1d94176dfabeab90c1f3fad825457", "score": "0.6970061", "text": "getColor() {\n return this.options.color;\n }", "title": "" }, { "docid": "7d0c611643823e559a87c958f26baac4", "score": "0.6964094", "text": "function changeColor(event) {\n // find click\n let rect = document.getElementById(\"colorPicker\").getBoundingClientRect();\n let x = event.clientX - rect.left;\n let y = event.clientY - rect.top;\n // get ImageData object\n let gc = document.getElementById(\"colorPicker\").getContext(\"2d\");\n let imageData = gc.getImageData(x,y,1,1);\n penColor=\"rgb(\"+imageData.data[0]+\",\"+imageData.data[1]+\",\"+imageData.data[2]+\")\";\n console.log(\"color changed.\");\n }", "title": "" }, { "docid": "b1ed95db03a62d05705238ffb8b69007", "score": "0.69555616", "text": "rgbColor(e) {\n console.log(\"Change to RGB Color\");\n // Array of all the colors in our model\n var colorArray = MODEL.geometry.getAttribute(\"color\").array;\n\n // Go through array, set colors to their original RGB colors\n for (var i = 0; i < colorArray.length; i += 3) {\n var vI = i / 3;\n colorArray[i] = BASE_GEOMETRY.colors[vI].r;\n colorArray[i + 1] = BASE_GEOMETRY.colors[vI].g;\n colorArray[i + 2] = BASE_GEOMETRY.colors[vI].b;\n }\n }", "title": "" }, { "docid": "f4ccf01730b1cd7394d80a8d8019e3cf", "score": "0.69548285", "text": "function getCurrentColor()\n{\n\treturn(currentColor);\n}", "title": "" }, { "docid": "42110a31eea6f3f3ed9e041f284bc974", "score": "0.6936905", "text": "set color(value) {}", "title": "" }, { "docid": "8d6a9c923aa78492b78fcc04b01b1ef4", "score": "0.6927061", "text": "function cChange() {\n\tt[selected].color = document.getElementById(\"colorSelector\").value;\n\tdocument.getElementById(selected).style.color = t[selected].color;\n}", "title": "" }, { "docid": "eb6d8d37c8fe4500fa2445577e3f93ce", "score": "0.6918039", "text": "function changeColorType (event) {\r\n event.target.style.color = 'red';\r\n }", "title": "" }, { "docid": "1ff30ac6102751e15cd7e1733e90ba44", "score": "0.69106066", "text": "function led_change_color(color){\n tj.changeColorRGBLed(color, function(ret_color){\n if(ret_color) {\n console.log(\"Color is: \" + ret_color);\n } else {\n console.log(\"Color did not set.\");\n }\n });\n}", "title": "" }, { "docid": "474b1ebff7e04ddc1451308a0f02f200", "score": "0.6904841", "text": "function changeColor() {\n this.style.background = $colorPicker.value;\n }", "title": "" }, { "docid": "474b1ebff7e04ddc1451308a0f02f200", "score": "0.6904841", "text": "function changeColor() {\n this.style.background = $colorPicker.value;\n }", "title": "" }, { "docid": "eda8e1320283ce91499ba8f230cddf51", "score": "0.690298", "text": "function changeColor(e) {\n switch (palette) {\n case 0: \n this.style['background-color'] = 'black';\n break;\n case 1:\n this.style['background-color'] = getRandomColor();\n break;\n case 2:\n if (gradLVal > 99 && gradLValInc) {\n gradLValInc = false;\n } else if (gradLVal <= 10 && !gradLValInc) {\n gradLValInc = true;\n }\n this.style['background-color'] = `hsl(${gradHue}, ${100}%, ${gradLVal}%)`;\n gradLVal += (gradLValInc) ? 3 : -3;\n break;\n }\n \n}", "title": "" }, { "docid": "629430fd447359c2ae4213834c86e0b1", "score": "0.6899512", "text": "function changeColor(event) {\n event.target.style.color = 'green';\n }", "title": "" }, { "docid": "b4c1ca3c510deabea18a3c348247aea4", "score": "0.687763", "text": "function changeColor() {\n var r = $(\"#red\").val();\n var g = $(\"#green\").val();\n var b = $(\"#blue\").val();\n\n $(\"#newColor\").css(\"background-color\", \"rgb(\" + r + \",\" + g + \", \" + b + \")\");\n }", "title": "" }, { "docid": "ec90ee3df0f5d73092c1047f1018a560", "score": "0.6856553", "text": "function colorize(){\n\n}", "title": "" }, { "docid": "30658e1885d3533f750c13812c7d5c7b", "score": "0.68437886", "text": "changeColor (newColor) {\n this.mainColor = newColor\n }", "title": "" }, { "docid": "f1d6ee42f8d37f80eccd56cb338eefaa", "score": "0.6842594", "text": "function color(){\n\n var r = $('#red').slider(\"value\"); \n var g = $('#green').slider(\"value\");\n var b = $('#blue').slider(\"value\");\n\n //console.log(\"rgb(\"+r + \",\" + g + \",\" + b+\")\" );\n\n $(\"#swatch\").css('background-color', 'rgb(' +r+','+g+','+b+')');\n\n }", "title": "" }, { "docid": "c8ddf69910508c453fd03960690ec0f5", "score": "0.6838251", "text": "function colored() {\r\n if(color) {\r\n colorimg.setAttribute(\"src\", colornon);\r\n if(tooltip) colorimg.setAttribute(\"title\", titlecolornon);\r\n color = false;\r\n } else {\r\n colorimg.setAttribute(\"src\", coloroui);\r\n if(tooltip) colorimg.setAttribute(\"title\", titlecoloroui);\r\n color = true;\r\n }\r\n GM.setValue(\"color\", color);\r\n if(lasthigh !== null) {\r\n if(color) {\r\n document.getElementById(\"para\" + lastpost).parentElement.parentElement.style.backgroundColor = couleur;\r\n } else {\r\n document.getElementById(\"para\" + lastpost).parentElement.parentElement.style.backgroundColor = lasthigh;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fc211d55376fd198a311fbf13bf9ab72", "score": "0.6835545", "text": "function getColor() {\n\tif (checkNight()) return 'style=\"color:purple\"';\n\treturn 'style=\"color:yellow\"';\n}", "title": "" }, { "docid": "2190cde652c1ae86bed9b9a64c4d7a16", "score": "0.6825549", "text": "function changeColor() {\n const MIN_RGB_VALUE = 0;\n const MAX_RGB_VALUE = 255;\n redSlider.value(random(MIN_RGB_VALUE, MAX_RGB_VALUE));\n greenSlider.value(random(MIN_RGB_VALUE, MAX_RGB_VALUE));\n blueSlider.value(random(MIN_RGB_VALUE, MAX_RGB_VALUE));\n}", "title": "" }, { "docid": "79c8d5eea2b4f0dbbe28c29822c4aa4e", "score": "0.6823329", "text": "function printColor() {\n console.log(color);\n}", "title": "" }, { "docid": "79c8d5eea2b4f0dbbe28c29822c4aa4e", "score": "0.6823329", "text": "function printColor() {\n console.log(color);\n}", "title": "" }, { "docid": "60a28e47e442aed4d3d8bdd0e9913a21", "score": "0.68157613", "text": "colorChange(event) {\n if (this.canvas.getActiveObjects().length === 0) {\n this.setCanvasFill(event.currentValue.hex);\n }\n else {\n this.setFillColor(event.currentValue.hex);\n }\n }", "title": "" }, { "docid": "591bbba30b04fd8eba0a1926da84af2e", "score": "0.6812086", "text": "function curchangeColor(value, metadata, record) {\n var ask = record.get('ask');\n if(ask >= 1.3)\n return \"<div class='updownimg'><img src='images/arrow_up_double.png' align='center' /></div>\"; \n else\n return \"<div class='updownimg'><img src='images/arrow_down.png' align='center' /></div>\"; \n }", "title": "" }, { "docid": "771efb89fe2f45a32c3a93ad028df9c7", "score": "0.68081665", "text": "function setColorValue(obj)\n{\n\n$(\".selected_color\").html(\"(\"+$(obj).data('value')+\")\");\nchangecolorval=$(obj).data('value');\n}", "title": "" }, { "docid": "8a9b070a10d3d71b486d20f3e75b99c8", "score": "0.68016875", "text": "function setColor (){\n color = event.target.value;\n}", "title": "" }, { "docid": "9e011369c5c51a84d595d81764ae5c09", "score": "0.680005", "text": "getColor() {\n return this.color;\n }", "title": "" }, { "docid": "5c96d24e8fa02e4ff609e427934b00e1", "score": "0.6795665", "text": "updateColor() {\n this.color = this.animationcolorpicker.value();\n this.updateRGBColorChannelValues();\n }", "title": "" }, { "docid": "ae70c0d55a330be1ba13564bd2e33870", "score": "0.67955893", "text": "function setColor() {\n\tcurrent_color = window.event;\n\tyellow = document.getElementById(\"yellow\");\n\tblue = document.getElementById(\"blue\");\n\twhite = document.getElementById(\"white\");\n\tred = document.getElementById(\"red\");\n\tif (current_color.target == yellow) {\n\t\tcolor = \"yellow\"\n\t} else if (current_color.target == blue) {\n\t\tcolor = \"blue\"\n\t} else if (current_color.target == white) {\n\t\tcolor = \"white\"\n\t} else if (current_color.target == red) {\n\t\tcolor = \"red\"\n\t}\n}", "title": "" }, { "docid": "a7c7c0fb27f209e05168e6e8471e7078", "score": "0.6782803", "text": "function changeColor() {\n var colours = [\"#3498db\", \"#e74c3c\", \"#f39c12\", \"#9b59b6\", \"black\", \"white\"];\n}", "title": "" }, { "docid": "c3044edda5cee17c265d43cd0eef31bf", "score": "0.67822087", "text": "function changeColor()\r\n{\r\n response=xmlHttpGetColor.responseText;\r\n // server error?\r\n if (response.indexOf(\"ERRNO\") >= 0 \r\n || response.indexOf(\"error:\") >= 0\r\n || response.length == 0)\r\n throw(response.length == 0 ? \"Can't change color!\" : response);\r\n // change color\r\n var oColor = document.getElementById(\"color\");\r\n var oSampleText = document.getElementById(\"sampleText\");\r\n oColor.value = response;\r\n oSampleText.style.color = response;\r\n}", "title": "" }, { "docid": "ad52a0abbcd331fa68648e7b4de46a43", "score": "0.67810065", "text": "_notifyColorChanged() {\n this.colorChanged.call(this.getRGB());\n }", "title": "" }, { "docid": "44465c9b859a358213efb8fc48debd60", "score": "0.6780061", "text": "function refreshColor(slider,newVal){\r\n\t\tvar redVal = Ext.getCmp('rdId').getValue();\r\n\t\tvar greenVal = Ext.getCmp('grId').getValue();\r\n\t\tvar blueVal = Ext.getCmp('blId').getValue();\r\n\t\tvar colorToSet = '#' + getHex(redVal) + getHex(greenVal) + getHex(blueVal);\r\n\t\t//Ext.getBody().dom.style.background=colorToSet;\r\n\t\tdocument.getElementById('demoColorId').style.background=colorToSet;\r\n\t\tExt.getCmp('hexReprezId').setValue(colorToSet);\r\n\t\tExt.getCmp('rgbReprezId').setValue('rgb(' + redVal + ',' + greenVal + ',' + blueVal + ')');\r\n\t\tExt.getCmp('redValId').setText(redVal);\r\n\t\tExt.getCmp('greenValId').setText(greenVal);\r\n\t\tExt.getCmp('blueValId').setText(blueVal);\r\n\t}", "title": "" }, { "docid": "5313e7c21216eb7d2a6c8a1904bd9efd", "score": "0.6777877", "text": "getColor(enable){\n if(enable) return '#3B3938';\n else return '#D3D3D3';\n }", "title": "" }, { "docid": "88f1385e0635f308110a6798e55c196e", "score": "0.6771646", "text": "function color(e, hORb)\n\t{\n\t\tvar col = e.attr(hORb);\n\t\tif(typeof col !== typeof undefined && col !== false)\n\t\t\te.parent().find('.togglebase').css('background-color', col);\n\t}", "title": "" }, { "docid": "eaeb12216846b93805790e8f1ddebd46", "score": "0.6769181", "text": "function getColor(d) {\n\t\t\t\tswitch(selectedetat){\n\t\t\t\t\tcase 'old':\n\t\t\t return d == \"old\" ? '#808080' :\n\t\t 'rgba(51, 51, 51, 0.1)';\t \n\t\t\t break;\n\t\t\t case 'new':\n\t\t\t\t return d == \"new\" ? '#3aaf85' :\n\t\t\t\t\t\t\t\td == \"new2015\" ? '#3aaf85' :\n\t\t\t 'rgba(51, 51, 51, 0.1)';\t\n\t\t\t\t break;\n\t\t\t\t\t\t\n\t\t\t case 'extended':\n\t\t\t\t return d == \"extended\" ? '#21759b' :\n\t\t\t 'rgba(51, 51, 51, 0.1)';\t\n\t\t\t\t break;\n\t\t\t default :\n\t\t\t \treturn d == \"old\" ? '#808080' :\n\t\t\t\t\t d == \"new\" ? '#3aaf85' :\n\t\t\t\t\t\t\t d == \"new2015\" ? '#3aaf85' :\n\t\t\t\t\t d == \"extended\" ? '#21759b' :\n\t\t\t\t\t 'rgba(51, 51, 51, 0.1)';\n\t\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "48f69205c4444f09608a27eff9180001", "score": "0.67670316", "text": "function getColor(e)\r\n{\r\n getMouseXY(e);\r\n // don't do anything if the XMLHttpRequest object is null\r\n if(xmlHttpGetColor)\r\n {\r\n // initialize the offset position with the mouse current position \r\n var offsetX = mouseX;\r\n var offsetY = mouseY;\r\n // get references \r\n var oPalette = document.getElementById(\"palette\");\r\n var oTd = document.getElementById(\"colorpicker\"); \r\n // compute the offset position in our window\r\n if(window.ActiveXObject)\r\n {\r\n offsetX = window.event.offsetX;\r\n offsetY = window.event.offsetY; \r\n } \r\n else \r\n {\r\n offsetX -= oPalette.offsetLeft + oTd.offsetLeft;\r\n offsetY -= oPalette.offsetTop + oTd.offsetTop;\r\n \r\n } \r\n // call server asynchronously to find out the clicked color\r\n try\r\n {\r\n if (xmlHttpGetColor.readyState == 4 || \r\n xmlHttpGetColor.readyState == 0) \r\n {\r\n params = \"?offsetx=\" + offsetX + \"&offsety=\" + offsetY; \r\n xmlHttpGetColor.open(\"GET\", getColorURL+params, true); \r\n xmlHttpGetColor.onreadystatechange = handleGettingColor;\r\n xmlHttpGetColor.send(null); \r\n }\r\n }\r\n catch(e)\r\n {\r\n // display error message\r\n displayError(xmlHttp.statusText);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c6797beaf8e05aee2cd999c581d7d961", "score": "0.6759716", "text": "function setColor(){\n if(props.color===\"#810000\"){\n return \"#0e918c\";\n } if (props.color===\"purple\"){\n return \"#b80d57\"\n } if (props.color ===\"#2a014b\"){\n return \"#4ef037\"\n }if (props.color ===\"white\"){\n return \"#90007f\"\n }\n }", "title": "" }, { "docid": "dd58d1e0d3aba0ee68da340fb5900a55", "score": "0.67569125", "text": "changeColor(e) {\n this.color = e.target.value;\n }", "title": "" }, { "docid": "7690595828d7afdfcc51822bf4582ae8", "score": "0.6755696", "text": "getRed() {\n return(red(this.color));\n }", "title": "" }, { "docid": "bf7eeca59711ef042310c52edd626652", "score": "0.67541814", "text": "get color() {\n return this._color\n }", "title": "" }, { "docid": "85dda7e9aa7c5b34562273641b233913", "score": "0.6752537", "text": "function changeColour(){\n\nvar first = \"#0000e6\";\nvar second = \"#47d147\";\nvar third = \"#e60000\";\n\ndocument.getElementById(\"blue\").style.color=first;\ndocument.getElementById(\"green\").style.color=second;\ndocument.getElementById(\"red\").style.color=third;\n}", "title": "" }, { "docid": "10ac1dacf5ccfe452eec293f147fb34a", "score": "0.6752238", "text": "function colorChange(e) {\n if(brushColor === 'default') {\n e.target.classList.add('default');\n e.target.classList.remove('random');\n e.target.classList.remove('greyScale');\n }\n else if(brushColor === 'random') {\n randomColors(e);\n }\n else if (brushColor === 'greyScale') {\n fadeIn(e);\n }\n}", "title": "" }, { "docid": "fed19831d32dce1effca1c1c207b04c7", "score": "0.6746563", "text": "function changeColor(){\n color=this.style.backgroundColor;\n this.style.backgroundColor=\"rgb(252, 252, 196)\";\n}", "title": "" }, { "docid": "de5aa460574c493ab1499c5bf2f89e87", "score": "0.6716365", "text": "function cbClicked() {\n status = 1;\n changeColor();\n}", "title": "" }, { "docid": "77e32a36fe86844406734cf0f051ce54", "score": "0.6714915", "text": "get color(){return self.color;}", "title": "" }, { "docid": "2af124fac1d828a14480fcd89885222d", "score": "0.67120194", "text": "function changeColor() {\n var r = $(\"#red\").val(); /* getting value of red color*/\n var g = $(\"#green\").val();\n var b = $(\"#blue\").val();\n $(\"#newColor\").css(\"background-color\", \"rgb(\" + r + \",\" + g +\", \" + b + \")\");\n}", "title": "" }, { "docid": "31e68e9af15393aef8450f6373e7ad4d", "score": "0.67033017", "text": "get color() {\n return this._color;\n }", "title": "" }, { "docid": "891ffc1dbcc384f6b835872025cc158a", "score": "0.6699227", "text": "function ChangeColor()\r\n{\r\n obj.style.color = makeColor();\r\n}", "title": "" }, { "docid": "758d2ca35fffa03e90e9c6ea8fed873c", "score": "0.66861844", "text": "function primercolor() {\n console.log(\"color1 seleccionado\");\n scolor2.style.boxShadow = \"0px 0px\";\n scolor3.style.boxShadow = \"0px 0px\";\n scolor4.style.boxShadow = \"0px 0px\";\n scolor1.style.boxShadow = \"2px 2px\";\n color = \"red\";\n console.log(color);\n }", "title": "" }, { "docid": "eeb670e5e5a511852788663331a37d5b", "score": "0.66847694", "text": "function colorChange(e) {\n event.target.style.backgroundColor = '#99CED3';\n}", "title": "" }, { "docid": "7638c04a922e473b22abc12c60305469", "score": "0.66839546", "text": "function colorChange(){\n\tvar color = Math.floor(Math.random() * colors.length);\n $(\"html body\").animate({\n backgroundColor: colors[color],\n color: colors[color]\n }, 1050);\n $(\".button\").animate({\n backgroundColor: colors[color]\n }, 1000);\n $(\".line\").animate({\n backgroundColor: colors[color]\n }, 1000);\n $(\".calcHeadline\").animate({\n color: colors[color]\n }, 950);\n $(\".createdBy\").animate({\n color: colors[color]\n }, 950);\n $(\"#formBpm\").animate({\n borderColor: colors[color]\n }, 950);\n $(\".calcHeadline\").removeClass(\"clearText\");\n}", "title": "" }, { "docid": "a6dc473e023974349a9043e06da673a8", "score": "0.6683837", "text": "function currentColor(r, g, b) {\n\n // Returns as an RGB value\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n}", "title": "" }, { "docid": "8d70effb68be157c5a85b75041e2d21e", "score": "0.6677929", "text": "function changeColor(e) {\n\tif (mode === 'color') {\n\t\te.target.style.backgroundColor = pickedColor;\n\t} else if (mode === 'eraser') {\n\t\te.target.style.backgroundColor = 'white';\n\t} else if (mode === 'rainbow') {\n\t\tlet redRandom = Math.floor(Math.random() * 256);\n\t\tlet greenRandom = Math.floor(Math.random() * 256);\n\t\tlet blueRandom = Math.floor(Math.random() * 256);\n\n\t\te.target.style.backgroundColor = `rgb(${redRandom}, ${greenRandom}, ${blueRandom})`;\n\t}\n}", "title": "" }, { "docid": "aa1c5c29a78ad00da7ef09315634fbbe", "score": "0.6677364", "text": "function changeColor(id, color) {\n return document.getElementById(id).style.fill = color;\n}", "title": "" }, { "docid": "548813ad693ff7d9689bb00e6fa88d1c", "score": "0.667334", "text": "function updateColor (event) {\n console.log(\"Updating color to \" + event.target.value);\n d3.select(\"#candy-path\").attr(\"fill\", event.target.value);\n client.items.choices[\"color\"] = event.target.value;\n client.setTexture(client.items.choices[\"texture\"], client)\n }", "title": "" }, { "docid": "369b498dce481fae5f72c1582c3021ff", "score": "0.6672616", "text": "set color(newColor) {\n this.setColor(newColor);\n }", "title": "" }, { "docid": "e81acd977826a952553a4afc657b2bae", "score": "0.66708624", "text": "function updateColors(event) {\n //Outputs a message to the Web Console\n console.log(event);\n // the first 00 are the Alpha and can be increased to FF\n //returns the element that triggered the event and returns the first to seventh number the capitalizes it\n selectedColor = '00' + event.target.value.substr(1,7).toUpperCase();\n changeBulbColor(selectedColor);\n }", "title": "" }, { "docid": "399d31274a81c6285cdb11ac6a3a5eee", "score": "0.66657543", "text": "function colorchange(color){\n\t//loop through all squares\n\tfor(var i=0;i<squares.length;i++)\n\t{\n\t\t//change each square color to match given color\n\t\tsquares[i].style.backgroundColor=colorpicker;\n\t}\n}", "title": "" }, { "docid": "294b53f956456bad9eb5c4aa42aeb981", "score": "0.66618747", "text": "function Update () {\n setColor();\n}", "title": "" }, { "docid": "d1ba3f3039e06cf303a4746989ed53a1", "score": "0.6661404", "text": "function changeColor() {\n let ctx = this.getContext(\"2d\");\n let x = event.layerX;\n let y = event.layerY;\n let pixel = ctx.getImageData(x, y, 1, 1);\n let data = pixel.data;\n let rgba = 'rgba(' + data[0] + ', ' + data[1] +\n ', ' + data[2] + ', ' + (data[3] / 255) + ')';\n let canvas = document.getElementById(\"canvas\");\n let context = canvas.getContext(\"2d\");\n context.strokeStyle = rgba;\n }", "title": "" }, { "docid": "edd2a7825ca82bab40720a40dbbdf3a2", "score": "0.66596675", "text": "red() {\r\n return this._red;\r\n }", "title": "" }, { "docid": "15af68ad2723c31e50b3bf1d5ecfa65b", "score": "0.6644958", "text": "function colorChange() {\n const currColor = document.getElementById(\"color-select\").value;\n //console.log(\"color change called with \" + currColor);\n color = currColor;\n}", "title": "" }, { "docid": "c72af83d2abc39352b669c027df6d073", "score": "0.6640554", "text": "function changeColor (event) {\n event.target.style.backgroundColor = selectedColor;\n\n }", "title": "" }, { "docid": "8a4bd7af28bd6e31e753a2aec5ed8733", "score": "0.6637531", "text": "function changeBlue () {\n removeColorPreview();\n $(\"#heartPreview\").addClass(\"blue\");\n donationHeartColor = \"blue\";\n}", "title": "" }, { "docid": "20fee47a3b99dda0805fd9d0a48f0970", "score": "0.66279775", "text": "getColore() {\n\tvar colori = [\"#0095DD\",\"#ed1c24\",\"#3cb878\"];\n\treturn colori[this.stato];\n\t}", "title": "" }, { "docid": "14713dd79378b341f74099320fcfcde5", "score": "0.6627822", "text": "function change(c){\n jQuery('.campaign-cycle').css(\"background-color\",\"rgb(0,125,200)\");\n jQuery('#cc' + c).css(\"background-color\",\"rgb(0,170,220)\");\n changeHeadline(c);\n}", "title": "" }, { "docid": "3e646b15249cc094cc5030ed123b3833", "score": "0.6625766", "text": "function colorChanger(){\n event.target.style.backgroundColor = getRandomColor();\n }", "title": "" }, { "docid": "ada508d6f1b7b30595ab5dcc26ac26ad", "score": "0.6612292", "text": "get color() {\r\n\t\t\treturn Color.Black;\r\n\t\t}", "title": "" }, { "docid": "d89a5e77e93233646b0e73cb810c79e5", "score": "0.6607083", "text": "function colorReturn ( obj ) {\n\t\tvar str = obj.full;\n\t\tif( obj.distance === 'up' ) {\n\t\t\tif( obj.now >= obj.max ) {\n\t\t\t\tobj.distance = 'down';\n\t\t\t\tobj.now --;\n\t\t\t} else {\n\t\t\t\tobj.now ++;\n\t\t\t}\n\t\t} else {\n\t\t\tif( obj.now <= obj.min ){\n\t\t\t\tobj.distance = 'up';\n\t\t\t\tobj.now ++;\n\t\t\t} else {\n\t\t\t\tobj.now --;\n\t\t\t}\n\t\t}\n\n\t\treturn str.replace('{{changeColor}}', obj.now);\n\t}", "title": "" }, { "docid": "2ddc6b702d2944e9671bd2615436dbc4", "score": "0.66059273", "text": "function doRainbow()\r\n{\r\n if (Browser && act != 1) {\r\n act = 1;\r\n obj = event.srcElement;\r\n clrOrg = obj.style.color;\r\n TimerID = setInterval(\"ChangeColor()\",100);\r\n }\r\n}", "title": "" } ]
0a6fcfc5aa1ddea48a88a21ba8c434e2
takes url and makes http request to get API JSON object calls render function with object
[ { "docid": "0378dd2119083cbc622c12c96ffd49c8", "score": "0.7102681", "text": "function getAPI(url) {\n const req = new XMLHttpRequest();\n req.addEventListener(\"load\", () => {\n let file = JSON.parse(req.responseText);\n render(file);\n bindEvents();\n });\n req.open(\"GET\", url, true);\n req.send();\n }", "title": "" } ]
[ { "docid": "566a9efe7f735954f51466de64d354fa", "score": "0.6476034", "text": "function getJSON(url) {\r\n fetch(url, {\r\n method: 'GET',\r\n }).then((response) => response.json())\r\n .then((next) => renderAir(next))\r\n .catch(error => console.error('Error:', error));\r\n}", "title": "" }, { "docid": "a0eb243cdc650ece0b51a65416fa065e", "score": "0.6438962", "text": "render() {\n fetch(`https://jsonplaceholder.typicode.com/posts/${this.id}`)\n .then(response => response.json())\n .then(data => {\n let title = data.title;\n let body = data.body;\n this.onDisplay(title, body);\n });\n }", "title": "" }, { "docid": "59616c09ad4f547d7bdc4748e7df7015", "score": "0.6416608", "text": "static get(url) {\n return api.fetch(url)\n }", "title": "" }, { "docid": "4dd18cd4715043bbba7e5e50a351bc88", "score": "0.6304114", "text": "function getData() {\n fetch(url)\n .then(res => res.json())\n .then(data => {\n renderItemList(data)\n })\n}", "title": "" }, { "docid": "6fb0713061750675dd25275287083c25", "score": "0.6283809", "text": "async function getapi(url) {\n\n const resp = await fetch(url);\n\n data = await resp.json();\n\n console.log(data);\n\n //Kutsutaan show-funktioa, joka lisää tiedot html-tiedostoon\n\n show(data);\n\n}", "title": "" }, { "docid": "db321adc623d640ae0636fe50d605422", "score": "0.6273625", "text": "function fetchObjects() {\n const url = `${ BASE_URL }/object?${ 'apikey=cef9253a-aabb-442d-aaf5-6013e9448b59' }`\n\n \n fetch(url)\n .then(function (response) {\n return response.json()\n }).then(function (response) {\n console.log(response);\n }).catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "1a9115441ef3a54725c92bb56dfe24a9", "score": "0.6273164", "text": "function ajaxObj(url) {\n return {\n type: 'GET',\n headers: {Accept: 'application/json'},\n url: url,\n dataType: \"json\",\n }\n }", "title": "" }, { "docid": "026e401285792dbf92cf86a710648769", "score": "0.6270778", "text": "function fetchAPI (url) {\r\n var request = new XMLHttpRequest();\r\n request.open('GET', url, true);\r\n request.responseType = \"json\";\r\n request.send();\r\n request.onload = function() {\r\n var json = request.response;\r\n console.log(json);\r\n displayList(json);\r\n};\r\n}", "title": "" }, { "docid": "9744cc6fee0a48f6b74880487be091f6", "score": "0.6233838", "text": "async function getCom(url, render) {\n const response = await fetch(url);\n switch (response.status) {\n case 200:\n const fetchedData = await response.json();\n render(fetchedData.data.results);\n break;\n default:\n alert('Sentimos comunicarle que ha sufrido un error ' + response.status + '. Compruebe su petición.');\n }\n}", "title": "" }, { "docid": "0378a4c872bb0f3d1cd7be20d020c9a4", "score": "0.6232157", "text": "function getApi(url) {\n fetch(url)\n .then(function (response) {\n \n return response.json();\n })\n .then(function (data) {\n drinkNameVal = data.title\n drinkDescripVal = data.extract\n //error catch\n if(data.title===\"Not found.\"){\n drinkNameVal = backupname\n drinkDescripVal = \"No entry found :(\"\n }\n render()\n });\n \n }", "title": "" }, { "docid": "ae90a246467d35a2dae5a197bfe18946", "score": "0.6211219", "text": "function fetchData(url) {\n console.log(url);\n console.log(\"fetching\" + url);\n fetch(url )\n .then(function (response) {\n return response.json()\n })\n .then(function (myJson) {\n ProcessAndRender(myJson);\n })\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "46fc7a7cd6382ed0faf5cffadf7de0ac", "score": "0.60734886", "text": "function renderHome(req,res) {\n const url ='https://thesimpsonsquoteapi.glitch.me/quotes?count=10'\n superagent.get(url).set('User-Agent', '1.0').then((dataFromApi =>{\n const apiData = dataFromApi.body.map(data =>{\n return new Character(data)\n })\n res.render('index' , {characters : apiData})\n })).catch(error =>(console.log(error)))\n}", "title": "" }, { "docid": "83fe31734d1df9fd7287fd6689d7a7dd", "score": "0.60469025", "text": "async show({ params, request, response }) {}", "title": "" }, { "docid": "a9ba93eeda7621c8114172540f8db4c4", "score": "0.5975969", "text": "componentDidMount() {\n const url = this.state.url;\n const options = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"SECRET-API_TOKEN\",\n },\n method: \"GET\",\n };\n fetch(`${url}`, options)\n .then((res) => res.json())\n .then((res) => this.handleRecipe(res));\n }", "title": "" }, { "docid": "d1ebdcefd688dca424b009e742c6fc51", "score": "0.59751564", "text": "function getApi(url) {\n fetch(url)\n .then(function (httpMetaDataResponse) {\n return httpMetaDataResponse.json();\n })\n .then(function (data) {\n console.log(data);\n if (data) {\n var cityName = document.querySelector(\"#cityNameEl\");\n cityName.textContent = data.name;\n\n var cityTemp = document.querySelector(\"#cityTempEl\");\n cityTemp.textContent = data.main.temp;\n\n var cityWeather = document.querySelector(\"#cityConditionsEl\");\n cityWeather.textContent = data.weather[0].description;\n\n var cityIcon = document.querySelector(\"#iconEl\");\n cityIcon.textContent = data.weather[0].icon;\n\n //sanity check\n console.log(data.name);\n // grab all your data stick it on the screen\n }\n })\n\n}", "title": "" }, { "docid": "f6001c8c31c4b1a5b8cb93b18a3d7809", "score": "0.5969056", "text": "function displayResultFromJSON(url, element) {\n let xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === xhr.DONE && xhr.status === 200) {\n // console.log(`fileLoc: ${url}, element: ${element}`);\n let json = \"\", html = \"\";\n try {\n json = xhr.responseText.replace(/\\n/g, \"\"); // remove new line characters\n json = JSON.parse(json);\n html = transformJSON(json);\n } catch (e) {\n console.error(e);\n }\n\n document.getElementById(element).innerHTML = html;\n }\n };\n xhr.send();\n}", "title": "" }, { "docid": "4c88ebb677f9ca0bf2f88ed7eedc295d", "score": "0.5931914", "text": "render(){\n this._parseUrl()\n const actionMethod = this._determineActionMethod()\n const objectClass = this._determineObjectClass()\n const user = Auth.authorize(this.authInfo, this.objectClassName, actionMethod)\n if(!user){\n this.response.setHeader('WWW-Authenticate', 'Basic realm=\"Secure Area\"')\n this.response.statusCode = 401\n this.response.statusMessage = 'user not authorized'\n return JSON.stringify({error: 'not authorized'})\n }\n try {\n const respondingObject = (new objectClass)\n const renderedResponse = respondingObject[actionMethod](this.content, this.params, this.extraPathInfo) \n this.response.statusCode = respondingObject.statusCode || this.successCode\n return renderedResponse\n } catch (e) {\n if(this.errorCode){\n this.response.statusCode = this.errorCode\n }\n console.error(e.stack || e) // eslint-disable-no-console\n return JSON.stringify({error: e.toString()})\n }\n }", "title": "" }, { "docid": "140b4c76297caee843dd12736a8003f8", "score": "0.5927208", "text": "getJSON() {\n let url = window.location.href || '';\n if (url.indexOf('?format=strings') !== -1) {\n this.view.showJson();\n }\n }", "title": "" }, { "docid": "fa48f3eeaff79a149203e776e686fb1c", "score": "0.59245527", "text": "function apiCall (url,nameFormat,type){\n var originalFormat = 'original_' + nameFormat;\n $.ajax({\n url: url,\n method: 'GET',\n data: {\n api_key: apiKey,\n query: searchInput.val().trim()\n },\n success: function(data){\n var result = data.results;\n for (let i = 0; i < result.length; i++){\n // CHECK ON POSTER\n var poster = '';\n if (!!result[i].poster_path){\n poster = 'https://image.tmdb.org/t/p/w342/' + result[i].poster_path;\n } else{\n poster = 'https://media.giphy.com/media/H7wajFPnZGdRWaQeu0/giphy.gif'\n }\n \n var product = {\n img: poster,\n title : result[i][nameFormat].toUpperCase(),\n original_title : result[i][originalFormat].toUpperCase(),\n original_language: flag(result[i].original_language),\n vote_average: stars(result[i].vote_average),\n type: type,\n overview: result[i].overview.substr(0, 70),\n id: result[i].id\n }\n // APPEND A PRODUCT\n var html = template(product);\n productsBox.append(html);\n }\n },\n error: function(){\n console.log('Api Error');\n }\n })\n }", "title": "" }, { "docid": "a696c1bdc873c2ab855b5d59e9304f2f", "score": "0.59239054", "text": "static show(gameId) {\n // http://localhost:4000/api/games/223423234\n return fetch(`${url}/${gameId}`)\n .then((response) => response.json())\n }", "title": "" }, { "docid": "2aa80723d466b3296d4c43b39df553c0", "score": "0.5918337", "text": "async function getApi(url) {\n galleryDiv.innerHTML = `<h2>Loading Employees</h2>`;\n try {\n const response = await fetch(url);\n const data = await response.json();\n return data.results;\n } catch (error) {\n throw galleryDiv.innerHTML = `<h2>Something Unpleasant Happened: ${error}</h2>`;\n }\n}", "title": "" }, { "docid": "e6317380f12e890dd7fd87ffd72548db", "score": "0.59174466", "text": "static async getJSON (url, headers) {\n return await API.fetchJSON('GET', url);\n }", "title": "" }, { "docid": "c6b4b0cc52d92a0f003804bab3812841", "score": "0.591226", "text": "get(url) {\r\n return fetch(url)\r\n .then(this.handleError)\r\n .then(res => res.json())\r\n // .then(data => data);\r\n }", "title": "" }, { "docid": "6e441545a0009d2ccf63156ac4b9ecb1", "score": "0.59113055", "text": "function fetchToys(){\n return fetch(\"http://localhost:3000/toys\")\n .then(res => res.json())\n .then(json => renderToys(json));\n}", "title": "" }, { "docid": "3dc95a802db190128fc1de469073c4ec", "score": "0.5909995", "text": "function getView(url, selector) {\n const progress = new ProgressBar();\n const end = progress.render();\n return viewService.get(url, selector).then((data) => {\n end();\n return data;\n }).catch((err) => {\n end();\n throw err;\n });\n}", "title": "" }, { "docid": "df978ae376fb8653424d127c5a2268af", "score": "0.590649", "text": "function makeAPICall(url) {\n return $.ajax({\n url: url,\n dataType: \"json\"\n });\n }", "title": "" }, { "docid": "5ae482cd1b81c1a5874609691ade89cf", "score": "0.59043473", "text": "function render(ID) {\n console.log(ID);\n $.getJSON('https://api.themoviedb.org/3/person/' + ID + '?api_key=94a2f36cd4e27626b6a7a07766a76196&language=en-US&append_to_response=credits',\n function(data, status) {\n console.log(data, status);\n\n var source = $(\"#bioTemplate\").html();\n var template = Handlebars.compile(source);\n var html = template(data);\n\n $(\"#castBio\").html(html);\n })\n}", "title": "" }, { "docid": "9dec0356b4963e9d7ce52ad6fb5a12ff", "score": "0.5901009", "text": "async function fetchAPI(data, url, options){\n try {\n response = await loadAPIAsync(url, options);\n data.imageURL = response.assets[0].image_url;\n data.title = response.assets[0].name;\n data.externalLink = response.assets[0].external_link;\n data.description = response.assets[0].description;\n data.id = response.assets[0].id;\n } catch(e) {\n console.error(`Error caught fetching from API: ${e}`);\n }\n\n return data;\n}", "title": "" }, { "docid": "12d3baf369e09cf28249868bf740c118", "score": "0.5899789", "text": "async function fetchMovies(movieSearchKey){\n // fetch(API_URL+movieSearchKey).then(response => response.json()).then(movieData => console.log(movieData))\n const response=await fetch(API_URL+movieSearchKey);\n const movieData=await response.json();;\n\nmovieTemplate(movieData)\n}", "title": "" }, { "docid": "05ff60781b33ef30b21d0cb957706075", "score": "0.58987665", "text": "render(data, request) {}", "title": "" }, { "docid": "9f74a2068b764f5b0b731d98e9cdd481", "score": "0.58964294", "text": "function load(link, location){\n\n // jQuery AJAX request\n $.get(link, function(data){\n render(data, location, true); \n }, \"json\");\n\n }", "title": "" }, { "docid": "6543f2fa5db824aa3d602bfab7dd27a9", "score": "0.5893153", "text": "async get(url) {\n const resp = await fetch(url)\n return this.response(resp)\n }", "title": "" }, { "docid": "6205efa705a589dc706872091edd6042", "score": "0.58809525", "text": "function makeCallAPI(url) {\n fetch(url)\n .then(response => response.json())\n .then(resultado => objRequest.res = resultado)\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "88de076187f1a1f033cc2d4d8adbdb22", "score": "0.5868117", "text": "function View( id ) {\n\n var self = this;\n this.contentId = id;\n this.content = null;\n this.httpR = null;\n\n this.setContent = function () {\n if ( this.content == null ) {\n this.content = dom.get( this.contentId );\n } // end if content undefined\n }; // end if setContent\n\n this.setHttp = function () {\n if ( this.httpR == null ) {\n if ( typeof http != \"undefined\" ) {\n this.httpR = http;\n } else {\n this.httpR = new Http();\n } // end if then else is undefined http\n } // end if httpR undefined\n }; // end setHttp;\n\n this.setContent();\n this.setHttp();\n\n this.loadUrl = function ( url, data ) {\n\n if (\n typeof data == 'object'\n || data === null\n ) {\n data = new RSObject(data);\n }\n\n url = url + \"?\" + String((Math.random() * 10000000000000000) + 1);\n var onSuccess = function ( response ) {\n var template = String(response);\n template = self.populateTemplate( template, data );\n self.content.innerHTML = template;\n dom.bindData();\n //self.content.appendChild(document.createTextNode(template));\n }; // end function fn\n\n this.httpR.get( url, null, onSuccess );\n }; // end function load\n\n this.loadTemplate = function ( id, data ) {\n var html = dom.get( id ).innerHTML;\n self.loadHTML( html, data );\n dom.bindData();\n }; // end function loadTemplate\n\n this.loadHTML = function ( html, data ) {\n html = self.populateTemplate( html, data );\n self.content.innerHTML = html;\n dom.bindData();\n }; // end function load\n\n this.populateTemplate = function (template, data) {\n\n if ( typeof data != 'undefined' ) {\n if ( data !== null ) {\n var jsonString = JSON.stringify(data);\n jsonString = jsonString.encodeUri();\n \ttemplate = template.replaceAll( '$itemJson', jsonString );\n\n var fn = function ( value, key, obj ) {\n var find = \"$\" + key;\n template = template.replaceAll( find, value );\n }; // end function fn (forEach)\n\n data.forEach( fn );\n } // end if data not null\n } // end if data not undefined\n\n return template;\n }; // end function populateTemplate\n}", "title": "" }, { "docid": "f09f2817a389c59e116953f9a03b3c88", "score": "0.58470017", "text": "static getList() {\n let page = arguments[0];\n let url = '';\n // if (Object.getOwnPropertyNames(page).length !== 0) {\n // url = `/api/mixes/page/${page.page}`;\n // } else {\n url = `/api/mixes/`;\n //}\n console.log(\"page\", page);\n console.log(\"url\", url);\n return fetch(url)\n .then(function (response) {\n if (response.status >= 400) {\n throw new Error(\"Bad response from server\");\n }\n return response.json();\n });\n }", "title": "" }, { "docid": "1cb50e3e1da35febe964a2c492734c51", "score": "0.58262146", "text": "function fetchApi(num) {\n fetch(`http://localhost:3000/monsters/?_limit=50&_page=${num}`)\n .then(res => res.json())\n .then(monstersData => {\n //iterate array of objects with forEach method\n monstersData.forEach(turnObjToHtml);\n });\n}", "title": "" }, { "docid": "4abecaf87a87ef6a37063baeb78da393", "score": "0.5808694", "text": "refresh() {\n let url;\n if (this.waiting || !this.url) return;\n if (this._url_is_template()) {\n try {\n const urldata = this._get_urldata();\n url = template(this.url, urldata);\n } catch (err) {\n this.draw(null);\n return;\n }\n } else {\n url = this.url;\n }\n this.fetch_json_data(url);\n }", "title": "" }, { "docid": "cd7d0dc92bad3a66721c7bb1272dd923", "score": "0.58046216", "text": "function boundObjectGetJson(url, parameters, response) {\n boundControllerAsync.getJson(url, parameters, response);\n}", "title": "" }, { "docid": "22c6d1e9646c87dc06cbd6d41d08ad66", "score": "0.57964796", "text": "static get(url, params = {}){\n return Fetch.request('GET', url, params);\n }", "title": "" }, { "docid": "9e1216789f19cf9f2cc07fb4d920da23", "score": "0.5786559", "text": "async show({\n params,\n request,\n response,\n view\n }) {}", "title": "" }, { "docid": "d4da045be24f36f5cffdc608d9d245a4", "score": "0.5786453", "text": "function loadMyData() {\r\n\r\n var myRequest = new XMLHttpRequest();\r\n \r\n myRequest.open(\"GET\", \"https://api.nasa.gov/planetary/apod?api_key=h27SgJssM7Qh0G0xPFPBky4D8HFyfsL0yy9KSsBq\", true);\r\n \r\n myRequest.onload = function() {\r\n \r\n if (myRequest.readyState == 4 && myRequest.status == 200) {\r\n \r\n var myData = JSON.parse(myRequest.responseText);\r\n console.log(myData); // - Test if the API is properly linked. \r\n \r\n \r\n document.getElementById(\"currentAPOD\").innerHTML = '<img\" src=\"' + myData.url.img + '\"width=\"auto\" height=\"auto\" alt=\"Image of the day\">'; \r\n }\r\n \r\n }\r\n myRequest.send();\r\n}", "title": "" }, { "docid": "e91a9414b8b64b0e900c57187704cc4d", "score": "0.5778674", "text": "getBrandInfo(url) {\n fetch(url, {\n\n })\n .then(response => {\n // transformere responsen fra API'et om til json-data\n return response.json();\n })\n .then(data => {\n this.setState({\n brand: data\n });\n }).catch(() => {\n console.log(\"An error occured\");\n });\n }", "title": "" }, { "docid": "c624b09fff5379f59540a205d4c62fc9", "score": "0.5771811", "text": "function getApi() {\n $.ajax({\n dataType: 'json',\n url: getUrl(),\n success: (data) => chooseRecipe(data.recipes),\n error: () => console.log(\"Cannot request data\"),\n });\n}", "title": "" }, { "docid": "b2d5c99bd30303b2e2d96f29b767977c", "score": "0.57612", "text": "function request(url) {\n getJSON(url, function(response) {\n generator.next(response);\n });\n}", "title": "" }, { "docid": "a0ac44f8114cbf219fb0ec9875e811d4", "score": "0.5747846", "text": "function getIt(url) {\n return request(url).then(function(body) {\n return JSON.parse(body).data; \n }); \n }", "title": "" }, { "docid": "f1a16b158b1a5c1139d8e40479a13041", "score": "0.57476324", "text": "function getItemAPI(id){\n return fetch('/api/item/'+id).then(function(response){return response.json()});\n}", "title": "" }, { "docid": "004c0df398fd2a987a17435e82d80a70", "score": "0.5745383", "text": "function getBooks() {\n\n fetch( BOOK_URL )\n .then( data => data.json() )\n .then( renderBooks )\n .catch( console.log );\n\n}", "title": "" }, { "docid": "d6184df29d412170fe4c0103e5d4c54a", "score": "0.57374537", "text": "function gets(){\n const optionsGet = {\n method: 'GET',\n headers: {\n 'authorization': 'Bearer '+ JSON.parse(localStorage.getItem(\"jwt\")).jwt\n }\n };\n\n const urluserTasks = \"http://localhost:8080/odontologos/\";\n fetch(urluserTasks,optionsGet).then(response=>response.json()).then(json=>renderizarOdontologos(json))\n\n }", "title": "" }, { "docid": "3e6963aa4feba5af1b7d25b7f5ae2867", "score": "0.57295907", "text": "function yummlyCall(queryURL) {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .done(function(response) {\n yummlyObject = response;\n showRecipe();\n });\n}", "title": "" }, { "docid": "2677a3945439d89b1a23261c52088367", "score": "0.5729501", "text": "function call_api(rest_url) { // can extend to advanced api in future\nvar xhttp = new XMLHttpRequest(); xhttp.open(\"GET\", rest_url, false);\nxhttp.send(); return xhttp.statusText + ' - ' + xhttp.responseText;}", "title": "" }, { "docid": "11bfaf71201013eae70e9cc1686cb246", "score": "0.5729233", "text": "function getEvent(id) {\n link = \"/query/\";\n $.ajax({\n url: link,\n data: {\n id : id\n },\n dataType: \"json\"\n })\n .done(function(data) {\n renderPage(data);\n })\n .fail(function(data) {\n renderPage(data);\n });\n}", "title": "" }, { "docid": "731f0d9ffa2dbe796e778a46680b55c1", "score": "0.57170683", "text": "function load_fromPlaceHolder() {\n //open the request\n fetch('https://jsonplaceholder.typicode.com/posts')\n .then(function(res) { return res.json(); //return the JSON Promise\n })\n .then(function(posts) {\n //iterate over each post [100 posts]\n let output = '';\n posts.forEach(function(post) {\n output += `\n <div class=\"item\">\n <div class=\"content\">\n <a class=\"header\" href=\"#\" id=\"bTitle\"> ${post.title} </a>\n <div class=\"description\"> <p id=\"bDesc\"> ${post.body} </p> \n </div>\n <div class=\"extra\"> <a class=\"ui floated basic violet button\" href=\"#\">Read More</a> </div>\n </div>\n </div> `; \n });\n postDiv3.innerHTML = output;\n })\n .catch(function(err) { \n console.log(err);\n });\n}", "title": "" }, { "docid": "7caac1cc5162adf675903ae5c374573e", "score": "0.57163864", "text": "fetch_json_data(url) {\n const self = this;\n this.waiting = true;\n this.trigger('start-fetch-data', self);\n\n dk.ajax({\n cache: self.cache,\n dataType: /^https?:\\/\\//.test(url) ? 'jsonp' : 'json',\n url: url,\n statusCode: {\n 404: function () {\n dk.debug(\"Page not found: \" + url);\n },\n 500: function () {\n // display the server error to the user.\n window.open(url);\n //document.location = url;\n }\n },\n error(req, status, err) {\n self.waiting = false;\n dk.warn(\"ERROR\", req, status, err);\n self.trigger('fetch-data-error', req, status, err);\n throw {error: \"fetch-error\", message: status + ' ' + err};\n },\n converters: {\n \"text json\": jason.parse\n },\n success(data) {\n self.data = data;\n self.waiting = false;\n self.trigger(\"fetch-data\", self);\n self.draw(data);\n }\n });\n }", "title": "" }, { "docid": "83b44e3e2d90dc41dff5f54325c31c3c", "score": "0.5708795", "text": "componentDidMount() {\n const url = \"https://hello-swanson.herokuapp.com/api/quote\";\n //const url = \"http://127.0.0.1:5000/api/quote\";\n fetch(url)\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n items: result\n });\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n }", "title": "" }, { "docid": "537c379f0f4f106eb77dfc463d66ff1f", "score": "0.5693056", "text": "get(url, config = {}) {\n return this.api.get(url, config);\n }", "title": "" }, { "docid": "c70dbef447e708f5db2f19120cff5948", "score": "0.5688196", "text": "function getData(url, templateid) {\n $('.loader').show();\n $.getJSON(url, data, function(result) {\n var template = $('#' + templateid).html();\n Mustache.parse(template); // optional, speeds up future uses\n $('.resultbox').html('');\n\n if (templateid == 'publications') {\n $.each(result, function(i, field) {\n //console.log(field);\n var rendered = Mustache.render(template, field);\n $('.resultbox').append(rendered);\n });\n } else if (templateid == 'critics_review') {\n delete result.total_results;\n $.each(result, function(i, field) {\n console.log(field.title);\n var rendered = Mustache.render(template, field);\n $('.resultbox').append(rendered);\n });\n } else {\n $.each(result.books, function(i, field) {\n var rendered = Mustache.render(template, field);\n $('.resultbox').append(rendered);\n });\n }\n\n $('.loader').fadeOut(500);\n\n criticclick();\n data.q = \"\";\n data.slug = \"\";\n\n goToByScroll('resultbox', '200', 160);\n\n TweenMax.staggerFrom($('.resultbox > .column'), 2, { opacity: 0, y: 100, delay: 0, ease: Back.easeInOut }, 0.2);\n });\n }", "title": "" }, { "docid": "14eee2ab83e209243e444ee2a30789f5", "score": "0.56878805", "text": "get(url) {\n return fetch(url)\n .then(statusOk)\n .then(res => res.json())\n .then(data => data)\n .catch(err => err);\n }", "title": "" }, { "docid": "07a05d730240803e2f0017b7af7bfba0", "score": "0.5687079", "text": "apiRequest() {\n const url = \"https://api.themoviedb.org/3/movie/now_playing?api_key=d75d2433d1369590a08680adda987f45&language=en-US&page=1\";\n \n fetch(url)\n .then(response => response.json())\n .then(json => this.setState({ json }))\n .then((populate) => this.populatePage())\n }", "title": "" }, { "docid": "f1306bcf6f5006b63fdfc4c22d39218d", "score": "0.5682477", "text": "function fetch() {\n console.log(\"Fetch called\");\n xhr1.onreadystatechange = function () {\n if (this.status == 200 && this.readyState == 4) {\n locations = JSON.parse(this.responseText);\n render(locations);\n }\n };\n xhr1.open('GET', \"/redApi/locationData/?t=\" + new Date().getTime() + \"&u=\" + me, true);\n xhr1.send();\n\n}", "title": "" }, { "docid": "528d9d353331566f5ad64f492a9b37f6", "score": "0.5679191", "text": "function fetchDetails(p_url) {\n fetch(p_url).then(function (response) {\n return response.json();\n }).then(function (json) {\n //console.log(json);\n //clear view\n clearView();\n\n //capitalize first letter of pokemon name\n let cap = json.name[0].toUpperCase();\n breadcrumb[0].textContent = json.name.replace(json.name[0], cap);\n\n createDetailCard(json);\n\n }).catch(function (err) {\n console.log(err.message);\n });\n }", "title": "" }, { "docid": "bf3548def9e9e1afd08e0a3463dbead3", "score": "0.56788874", "text": "function load_fromPlaceHolder() {\n\n\n //open the request \n fetch('https://jsonplaceholder.typicode.com/posts')\n .then(function(res) {\n return res.json(); //return the JSON Promise\n })\n .then(function(posts) {\n //iterate over each post [100 posts]\n let output = '';\n posts.forEach(function(post) {\n output += `\n \n <div class=\"item\">\n <div class=\"image\">\n <img src=\" https://images.unsplash.com/photo-1499482125586-91609c0b5fd4?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80\">\n </div>\n <div class=\"content\">\n <a class=\"header\" href=\"#\" id=\"bTitle\">\n ${post.title.toUpperCase()}\n </a>\n <div class=\"description\">\n <p id=\"bDesc\">\n ${post.body}\n </p>\n </div>\n <div class=\"extra\">\n <a class=\"ui floated basic violet button\" href=\"#\">Read Mores</a>\n </div>\n </div>\n </div>\n\n\n \n `\n ;\n });\n postDiv3.innerHTML = output;\n })\n .catch(function(err) {\n console.log(err);\n });\n\n\n\n}", "title": "" }, { "docid": "807aa98c958218e1850cd03768b4feb2", "score": "0.5676984", "text": "getProductData() {\n\n var url = \"\";\n // Får fat i search frase i url'en og fjerner første char som er et question mark \n var brand = this.props.location.search.substr(1);\n // Hvis forsider se hent alle produkters info\n if (this.props.location.pathname === this.state.frontPageEndPoint) {\n\n url = WebshopEndpoint + \"/Webshop/GetAllProductInfo\";\n\n }\n // Ellers hent products fra den søgte brand\n else {\n url = WebshopEndpoint + \"/Webshop/GetProductsByBrand/\" + brand;\n // fetcher det andet api her (BrandsAPI). \n this.getBrandInfo(BrandsEndpoint + \"/GetBrandInfo/\" + brand);\n\n }\n\n // Sender et aynkront request til API\n fetch(url, {\n\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n this.setState({\n products: data\n });\n }).catch(() => {\n console.log(\"An error occured\");\n });\n\n\n }", "title": "" }, { "docid": "d5bad3814b48271834b5915529263e52", "score": "0.56750274", "text": "async function hentJson() {\n const url = insightsurl + insight;\n\n //henter data filen\n const myJson = await fetch(url);\n\n //til singleview\n const article = await myJson.json();\n console.log(article);\n visArticle(article);\n}", "title": "" }, { "docid": "2a7b07450854c93c976ed3f95f6a2cdf", "score": "0.5673687", "text": "function ajaxGetObj(url) {\n var fullUrl = makeUrl(url);\n return $.ajax({\n url: fullUrl\n });\n}", "title": "" }, { "docid": "7b148f43d29f5793d86c165b706d8c7f", "score": "0.56721514", "text": "function getData(url) {\n return fetch(url); //fetches data from API url\n}", "title": "" }, { "docid": "829035adc3bd0caba189cde0b5ef5e87", "score": "0.56699824", "text": "function fetchToys() {\n return fetch(\"http://localhost:3000/toys\")\n .then(resp => resp.json())\n .then(json => renderToys(json))\n}", "title": "" }, { "docid": "368aa96eda80619a50f6e6de794199fc", "score": "0.5668621", "text": "function render(uri) {\n if (uri.indexOf(\"http\") !== 0) {\n displayError(\"Addresses must be absolute\");\n return;\n }\n\t$.ajax(uri, {\n\t\t\"method\": \"OPTIONS\",\n\t\t\"dataType\": \"text\"\n\t}).success(function(optionsData, optionsStatus, optionsXhr) {\n\t\t$.getJSON(uri, function(data, status, xhr) {\n\t\t\tvar contentType, representationName, schema, dataUri, fileName, representationSchema;\t\t\t\n\t\t\tcontentType = xhr.getResponseHeader(\"Content-Type\");\n\t\t\trepresentationName = contentType.replace(\"; charset=utf-8\", \"\"); // HACK(jimp): proper parsing.\n\t\t\t$(\"#representationName\").text(representationName);\n\t\t\tschema = crestschema.jsonSchemaFromCrestOptions(optionsData);\n\t\t\trepresentationSchema = schema.GET[representationName];\n\t\t\t$(\"#data\").children().replaceWith(buildElement(data, representationSchema));\n\t\t\tdataUri = \"data:application/json;charset=utf-8,\" +\n\t\t\t encodeURIComponent(JSON.stringify(representationSchema, null, 4));\n\t\t\tfileName = representationName.\n\t\t\t replace('application/vnd.ccp.eve.','').\n\t\t\t replace('+', '.');\n\t\t\t$(\"#schema\").attr(\"href\", dataUri).attr(\"download\", fileName);\n\t\t\tbindLinks();\n\t\t\t$(\"#error\").hide();\n\t\t\t$(\"#content\").show();\n\t\t});\n\t});\n }", "title": "" }, { "docid": "39c270d1750735c9f62b4b2b58c493ab", "score": "0.5667931", "text": "function showSlots(json_url){\n \n // get list of Slots from the API\n $.getJSON(json_url, function(data){\n \n // html for listing Slots\n readSlotsTemplate(data, \"\");\n \n // chage page title\n changePageTitle(\"Read Slots\");\n \n });\n}", "title": "" }, { "docid": "ad6f050dbbbb2653f244be9ea50115f1", "score": "0.5666607", "text": "function renderView(id,url)\n{ \nurl = typeof url==\"undefined\" ? \"/\"+modelClass+\"/view\" : url;\n jQuery.get(url, {id:id}, function(data, textStatus, xhr) {\n \t$(\".admin-form\").slideUp('slow');\n\t$(\".search-form\").slideUp('slow');\n\t$(\".view-content\").html(data);\n\t$(\".view-wrapper\").slideDown();\n });\n}", "title": "" }, { "docid": "17031a059773b2af499d0b775b42a109", "score": "0.5665485", "text": "function display(){\n fetch(CreateURL(inputText.value))\n .then(response=>response.json())\n .then(json=>{result.innerText=json.contents.translated})\n .catch(errorHandler);\n\n}", "title": "" }, { "docid": "078641ecce8ff6546ee65cec0621dcea", "score": "0.56638694", "text": "get(url) { return send('GET', url); }", "title": "" }, { "docid": "435ea203215877156ff67fbc0aa3966d", "score": "0.56629413", "text": "async loadData(url) {\n\n if(this.isLoading) {\n this.controller.abort();\n }\n\n this.isLoading = true;\n this.controller = new AbortController();\n\n const response = await fetch(`/events/?${this.queryString}`, {\n method: 'GET',\n signal: this.controller.signal,\n headers: {\n \"Content-Type\": 'application/x-www-form-urlencoded',\n 'X-Requested-With': 'XMLHttpRequest',\n },\n });\n\n let res = await response.text();\n let html = document.createElement('div');\n html.innerHTML = res;\n\n this.isLoading = false;\n\n try {\n document.body.style.cursor='pointer';\n eventListing.innerHTML = html.querySelector('.js-event-listing .list-section').outerHTML;\n eventListing.classList.remove('loading');\n document.body.classList.add('filters-active');\n\n setTimeout(function() {\n document.body.classList.remove('filters-stuck');\n }, 500);\n } catch {}\n\n }", "title": "" }, { "docid": "02c092bc407e97e6a6774b3d295d14d1", "score": "0.5650756", "text": "function getData() {\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', 'json/posts.json');\n xhr.onload = function(event) {\n var responseData = event.target.response;\n var dataFromJson = JSON.parse(responseData);\n renderData(dataFromJson);\n };\n xhr.send();\n }", "title": "" }, { "docid": "bdc3f9c05a7e6b5dcbfef355a621df6c", "score": "0.5646555", "text": "apiCall(url) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n \n xmlhttp.onreadystatechange = this.handleRequest.bind(this, xmlhttp);\n }", "title": "" }, { "docid": "2ab40c4d2b13338cfd19c389b9f6b5ff", "score": "0.56462145", "text": "async function getObjects(id) {\n let url = 'https://api.harvardartmuseums.org/object?apikey=fc1b68f0-b251-11e8-b0af-a198bfdbf6ce&gallery=' + id;\n\n let res = await fetch(url);\n res = await res.json();\n\n let objects = `<h2>Objects</h2>`;\n\n let totalObjects = res.info.totalrecords;\n if(totalObjects === 0) {\n objects += `\n <div>\n <h3> no objects </h3>\n <div>\n `;\n } else {\n let newUrl = url + '&size=' + totalObjects;\n\n let objectList = await fetch(newUrl);\n objectList = await objectList.json();\n\n let records = objectList.records;\n records.forEach((object) => {\n objects += `\n <div>\n <button id=\"${object.id}\" onClick=\"getObjectDetails(this.id)\">${object.title}</button>\n </div>\n `;\n });\n document.getElementById('objects').innerHTML = objects;\n }\n document.getElementById('objects').innerHTML = objects;\n}", "title": "" }, { "docid": "c6d52b7bad8e600e365e17d070eac213", "score": "0.5645583", "text": "function myList() {\n var ourRequest1 = new XMLHttpRequest();\n ourRequest1.open('GET', 'http://localhost:8080/api/realestate/getByRowAmount?rows=12')\n ourRequest1.onload = function () {\n const ourData1 = JSON.parse(ourRequest1.responseText);\n renderHTML5(ourData1);\n };\n ourRequest1.send();\n}", "title": "" }, { "docid": "8ca4c894e31431a1c3a2684dfab05455", "score": "0.56404227", "text": "function getAPI(trailSearch) {\n fetch(`'https://trailapi-trailapi.p.rapidapi.com/trails/map/12/gpx/'\n \n \n https://www.googleapis.com/books/v1/volumes?q=${trailSearch}`)\n .then(function (response) {\n return response.json()\n })\n .then(function (data) {\n handleData(data);\n });\n}", "title": "" }, { "docid": "b86403715569089a1b1118b5a81645d1", "score": "0.5639837", "text": "function getToys() {\n fetch(URL)\n .then(res => res.json())\n .then(toyArray => toyArray.forEach(toy => renderToy(toy)))\n}", "title": "" }, { "docid": "b59d16d24d0c1eaadd13177e351b467e", "score": "0.56390005", "text": "callApi(size) {\n const url = 'https://hello-swanson.herokuapp.com/api/';\n //const url = \"http://127.0.0.1:5000/api/\";\n fetch(url + size)\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n items: result,\n displayVoteMessage: false\n });\n },\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n }", "title": "" }, { "docid": "eb1e0cff93439d4cab8d713749543e7d", "score": "0.56386435", "text": "function render(res, query) {\n\nvar http = require('http');\n\nvar opts = {\n\n\t\t\tport: '3000',\n\t\t\tpath: '/comic/' + query\n\n\t\t},\n\t\tbody = '';\n\n\n\t\thttp.request(opts, function(result) {\n\t\t\t\n\n\t\t\tresult.on('data', function(chunk) {\n\n\t\t\t\tbody += chunk;\n\n\t\t\t});\n\n\t\t\tresult.on('error', function(error) {\n\n\t\t\t\tconsole.log('err', error.message);\n\n\t\t\t});\n\n\t\t\tresult.on('end', function(){\n\n\t\t\t\tbody = JSON.parse(body);\n\n\t\t\t\tif (body.code === 404) {\n\n\t\t\t\t\tres.render('comicDetail', { title: 'Express', error: '404', copyright: 'none', comics: 'none' });\n\n\t\t\t\t} else {\n\n\t\t\t\t\tres.render('comicDetail', { title: 'Express', copyright: body.copyright, comics: body.data.results });\n\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t}).end();\n\n}", "title": "" }, { "docid": "bb9a736f09ecd6bb06ea28ca65c7d7c8", "score": "0.56379336", "text": "function sendRequest(url) {\n\n request.open('GET', url, true)\n request.onload = function() {\n \n // Begin accessing JSON data here\n var data = JSON.parse(this.response)\n \n if (request.status >= 200 && request.status < 400) {\n data.forEach(article => {\n test = '<div class=\"column\"><a href=\"'+'http://www.pinkvilla.com'+article.path+'\" class=\"title-link\"><img src=\"'+article.imageUrl+'\" class=\"preview-image\"><div class=\"row\"><div class=\"title col-sm-9 col-md-9\"> '+article.title+' </div><div class=\"pull-right col-sm-3 col-md-3\" style=\"padding-top: 8px;\"><i class=\"fas fa fa-ellipsis-h\"></i></div></div></a></div>';\n document.getElementById(\"photos\").innerHTML += test;\n })\n } else {\n console.log('error')\n }\n document.getElementById(\"loader\").style.display = 'none';\n }\n\n request.send();\n\n}", "title": "" }, { "docid": "fee34d6cebe6ce8a0f79d8f86512ea2d", "score": "0.56365794", "text": "loadActivityData() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_activity_by_location/\" + this.props.route.params.locationID, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(obj => this.processActivityData(obj));\n }", "title": "" }, { "docid": "71f8da2b66efd1a79b62db87dae70276", "score": "0.56339544", "text": "function getAPI() {\n let input = $(\"input\").val();\n\n console.log(input);\n\n const URL = `https://api.unsplash.com/search/photos?query=${input}&per_page=30&client_id=QmrcJpawWYemWpTniO6pqBzZDMwa0NAeRYTNzSbTFPE`;\n\n $.get(URL, (request, state) => {\n if (state === \"success\") {\n $(\".bienvenida__container\").empty();\n\n result = [];\n\n // pusheo datos a 'result'\n request.results.forEach((r) => result.push(r));\n\n console.log(result);\n\n // para sacar el loader\n $(\".bienvenida__container\").empty();\n\n render();\n }\n });\n}", "title": "" }, { "docid": "f958d1928b6cc6f6283c5b302f391d65", "score": "0.563164", "text": "function getUsers(){\n\n function render(){\n let response = this.responseText;\n let responseData = JSON.parse(response)\n console.log(responseData);\n\n let ul = document.createElement('ul');\n\n responseData.data.foreach(item =>{\n let li = document.createElement('li')\n li.textContent = item.first_name\n\n ul.appendChild(li);\n })\n document.getElementById('api').appendChild(ul)\n }\n\n let requist = new XMLHttpRequest();\n\n requist.addEventListener('load', render);\n\n requist.open(\"GET\",'https://reqres.in/api/users?page=1')\n requist.send();\n}", "title": "" }, { "docid": "684177c07d7801eff7798ee0255111b9", "score": "0.5629038", "text": "function getImageToDisplay(data){\n var imageUrl = data.query.pages[Object.keys(data.query.pages)[0]].imageinfo[0].url;//Get url\n document.querySelector(\"#images\").innerHTML += \"<img src='\" + imageUrl + \"' alt='Image loaded from page'/>\";//Add img to page\n}", "title": "" }, { "docid": "0996405e0c5710121b2304977980a1bc", "score": "0.56270814", "text": "callApi( url, stateItemName ) {\n\t\tconst api = new Api();\n\t\tconst headers = [];\n\t\treturn (\n\t\t\tapi\n\t\t\t\t.get( url, headers )\n\t\t\t\t.then( ( data ) => {\n\t\t\t\t\t// If status is 200-299.\n\t\t\t\t\tif ( data.ok ) {\n\t\t\t\t\t\treturn data.json().then( ( jsonData ) => \n\t\t\t\t\t\t\tthis.setState({ [stateItemName]: jsonData })\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t);\n\t}", "title": "" }, { "docid": "221f5363401ba9b3aafb2ccb5054cac8", "score": "0.56230956", "text": "componentDidMount() {\r\n fetch(`https://the-social-reloader-server.herokuapp.com/home`)\r\n .then(response => response.json())\r\n .then(data => \r\n this.handleData(data)\r\n );\r\n }", "title": "" }, { "docid": "3a85ce9480afed2e266bf010c40b0199", "score": "0.56183684", "text": "async show({ params, request, response, view }) {\n }", "title": "" }, { "docid": "2999cd44870f59f50950db460f935b55", "score": "0.5612579", "text": "function callAPI(url, options){\n var deferred = $q.defer();\n \n var request = new Request(url, options); \n\n fetch(request).then(function(response){\n deferred.resolve(response.json());\n }).catch(function(err){\n console.error(err);\n deferred.reject(err);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "de858dc8f4aacce40da12f63450a05a3", "score": "0.5610778", "text": "function call_api(rest_url) {\nvar xhttp = new XMLHttpRequest(); xhttp.open(\"GET\", rest_url, false);\nxhttp.send(); return xhttp.statusText + ' - ' + xhttp.responseText;}", "title": "" }, { "docid": "711832832cfa9bc51b892990de3d2b85", "score": "0.56094974", "text": "apiCall(url, consecuencia){\n fetch(url)\n .then( response => response.json() )\n .then( data => consecuencia(data) )\n .catch( error => console.log(error))\n }", "title": "" }, { "docid": "711832832cfa9bc51b892990de3d2b85", "score": "0.56094974", "text": "apiCall(url, consecuencia){\n fetch(url)\n .then( response => response.json() )\n .then( data => consecuencia(data) )\n .catch( error => console.log(error))\n }", "title": "" }, { "docid": "711832832cfa9bc51b892990de3d2b85", "score": "0.56094974", "text": "apiCall(url, consecuencia){\n fetch(url)\n .then( response => response.json() )\n .then( data => consecuencia(data) )\n .catch( error => console.log(error))\n }", "title": "" }, { "docid": "9d35a8625c39b8a6ae65f68a35d4f18b", "score": "0.560219", "text": "function getJSON(url) {\n 'use strict';\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n let brokerList = JSON.parse(xhr.responseText) ;\n\n createCarouselItem(brokerList.data);\n initCarousel();\n\n } else {\n console.log(xhr.responseText);\n }\n }\n };\n xhr.open('GET', url);\n xhr.send();\n}", "title": "" }, { "docid": "49084672bc67831fed5b8bf8afbb855c", "score": "0.56011873", "text": "fetchApi(url){\n return (fetch(url, {\n method: 'get',\n headers: { 'Authorization': 'Token ' + this.state.token }\n }))\n }", "title": "" }, { "docid": "4fb4470a490a87403f67564b6040dcd7", "score": "0.5599734", "text": "function fetchIndex(){\n fetch(route+\"/\", { method: \"GET\",\nheaders:{\"Content-Type\":\"application/json\"}})\n.then((response) => response.json())\n.then((data) => {\n document.getElementById(\"output\").innerHTML = data[\"message\"]\n})\n.catch((err) => console.log(err))\n}", "title": "" }, { "docid": "cc5ab3a5082895035234b10ac40101d4", "score": "0.5597182", "text": "fetch (path, options = {}) {\n const url = PLEX_API + path\n return requestJSON(url, {\n ...options,\n headers: {\n ...options.headers,\n ...this.headers(),\n },\n })\n }", "title": "" }, { "docid": "4595aa079a06742eb401dfa18f778e9e", "score": "0.55918235", "text": "function displayHotel (hotelId) {\n\n get(APIendpoint+\"/hotels/\"+hotelId).then(function(response) {\n var json = JSON.parse(response);\n\n // Creating HTML elements that will be displayed\n generateHotelImage(json);\n generateHotelInfoPanel(json);\n\n }, function(error) {\n throw error;\n }\n )\n}", "title": "" }, { "docid": "26dbda77f67827cfc020492edc0dadef", "score": "0.55874443", "text": "function getAPIdata() {\n // Dit is de standaard input: Zweden. Omdat ik wil dat de voorkeurs-landingsplek Zweden wel blijft bestaan. \n var country = searchCountry ? searchCountry : 'Sweden';\n\t// construct request. Met ${} kan je met de input de link veranderen. Dit is een kortere manier dan te werken met een optelsom van stukjes link code. Gevonden op internet hoe het moet en werkt super chill :)\n\tvar request = `https://restcountries.eu/rest/v2/name/${country}?fullText=true`;\n\n\t// get current country\n\tfetch(request)\t\n\t\n\t// parse response to JSON format\n\t.then(function(response) {\n\t\treturn response.json();\n\t})\n\t\n\t// do something with response\n\t.then(function(response) {\n // Verander de html tekst naar de landnaam\n var country = document.getElementById('country').innerHTML = response[0].name;\n // Verander de html image afhankelijk van het land\n var flag = document.getElementById('flag').style.backgroundImage=`url(${response[0].flag})`;\n // verander de html tekst naar de gesproken taal\n var language = document.getElementById('language').innerHTML = response[0].languages[0].name;\n\t});\n}", "title": "" }, { "docid": "156f30422c49ad69eff81415a3087d89", "score": "0.558252", "text": "function renderHome(req,res) {\n const url='http://hp-api.herokuapp.com/api/characters'\n superagent.get(url).then((dataFormApi)=>{\n // console.log(dataFormApi.body)\n const apiData =dataFormApi.body.map(data =>{\n return new Chrarachter(data)\n })\n res.render('index' , { allData : apiData})\n }).catch(error =>{console.log(error)})\n}", "title": "" } ]
cf14e867385b17f62e8bb8faafe34f8e
A "link" object can be associated to N projects This function loops through projects and update the ".links" property
[ { "docid": "63e52af5f8bab8bf252f7285e20462bc", "score": "0.7407853", "text": "function addLinkIdsToProjects (projects0, links) {\n let projects1 = Object.assign({}, projects0)\n links.forEach(link => {\n const id = link._id\n const projectIds = link.projects // get the array of project ids\n projectIds.forEach(projectId => {\n const project = projects1[projectId]\n if (project) {\n const links0 = project.links\n const links1 = links0 ? (\n addUniqueLink(links0, id)\n ) : [id] // update the link id array or create it if it does not exist\n project.links = links1\n projects1 = Object.assign({}, projects1, { projectId: project })\n } else {\n log('No project with the id', projectId)\n }\n })\n })\n return projects1\n}", "title": "" } ]
[ { "docid": "0ec363e76ce07dd4dd5f249648964528", "score": "0.6372121", "text": "createSymlinksForProjects(force) {\n if (!force) {\n if (node_core_library_1.FileSystem.exists(this._rushConfiguration.rushLinkJsonFilename)) {\n console.log(colors.green(`Skipping linking -- everything is already up to date.`));\n return Promise.resolve();\n }\n }\n console.log('Linking projects together...');\n const stopwatch = Stopwatch_1.Stopwatch.start();\n // Delete the flag file if it exists; if we get interrupted, this will ensure that\n // a full \"rush link\" is required next time\n Utilities_1.Utilities.deleteFile(this._rushConfiguration.rushLinkJsonFilename);\n return this._linkProjects()\n .then(() => {\n stopwatch.stop();\n console.log(os.EOL + colors.green(`Linking finished successfully. (${stopwatch.toString()})`));\n console.log(os.EOL + 'Next you should probably run \"rush build\" or \"rush rebuild\"');\n });\n }", "title": "" }, { "docid": "cce6e7331cfb68f7d3b6b99cc4b62dd4", "score": "0.6313287", "text": "function get_project_links() {\n \n //Cleaning the gui from current links\n remove_all_links();\n \n //Recovering the links from hub\n sakura.common.ws_request('list_link_ids', [], {}, function (ids) {\n var igs = []\n ids.forEach( function (id) {\n sakura.common.ws_request('get_link_info', [id], {}, function(info) {\n //Then aks for the gui\n sakura.common.ws_request('get_link_gui_data', [id], {}, function (gui) {\n \n igs.push({'info': info, 'gui': gui});\n \n if (igs.length == ids.length ) {\n igs.forEach ( function(ig) {\n var info = ig.info;\n var lgui = eval(\"(\"+ig.gui+\")\");\n \n if (! link_exist(info.src_id, info.dst_id)) {\n var src_inst = instance_from_id(info.src_id);\n var dst_inst = instance_from_id(info.dst_id);\n \n //jsPlumb creation\n global_project_jsFlag = false;\n js_link = jsPlumb.connect({ uuids:[src_inst.ep.out.getUuid(),dst_inst.ep.in.getUuid()] });\n global_project_jsFlag = true;\n \n //our creation\n create_link_from_hub(js_link.id, info.link_id, info.src_id, info.dst_id, info.src_out_id, info.dst_in_id, lgui);\n }\n else {\n var link = link_from_instances(info.src_id, info.dst_id);\n var interval_id = null;\n var check_modal = function () {\n if (link.modal) {\n link.params.push({ 'out_id': info.src_out_id, \n 'in_id': info.dst_in_id, \n 'hub_id': info.link_id,\n 'top': lgui.top,\n 'left': lgui.left,\n 'line': lgui.line});\n $(\"#svg_modal_link_\"+link.id+'_out_'+info.src_out_id).html(svg_round_square_crossed(\"\"));\n $(\"#svg_modal_link_\"+link.id+'_in_'+info.dst_in_id).html(svg_round_square_crossed(\"\"));\n copy_link_line(link, info.src_out_id, info.dst_in_id, lgui);\n clearInterval(interval_id);\n }\n }\n interval_id = setInterval(check_modal, 500);\n }\n });\n }\n });\n });\n });\n });\n}", "title": "" }, { "docid": "f3a00f3df5c04c2a0146b26c4b1245c2", "score": "0.60316104", "text": "function updateLinks() {\n var dictNodes = {},\n allLinks = chart.graph.links;\n\n filteredLinks = [];\n\n filteredNodes.forEach(function (d) {\n dictNodes[d.id] = d;\n });\n\n\n filteredLinks = allLinks.filter(function (d) {\n return dictNodes[d.source.id] !== undefined &&\n dictNodes[d.target.id] !== undefined;\n });\n\n\n console.log(\"updating links, all links count: \" + allLinks.length + \" filtered: \" + filteredLinks.length);\n\n if (chart.drawLinks) {\n simulation.force(\"link\")\n .links(filteredLinks);\n\n }\n\n console.log(simulation.links);\n\n }", "title": "" }, { "docid": "c5b915776d5d22b2429f93246b70516b", "score": "0.5871249", "text": "function link() {\n let l;\n for (l = 1; l < nodes.length; l++) {\n // if(nodes[srcData[srcData[nodes[l].id].parent].index])\n // console.log('link ', l, nodes[srcData[srcData[nodes[l].id].parent].index]);\n llinks.push({\n target: nodes[l],\n source: nodes[srcData[srcData[nodes[l].id].parent].index],\n counter: 0\n })\n }\n }", "title": "" }, { "docid": "d2dc47cd17fbfa28c820f0a6475b4a33", "score": "0.5828149", "text": "function updateLinkConnections() {\n //alert(\"Bluejay updating child pointers (step 1/6)\");\n this.updateChildPointers();\n //alert(\"computing discovery dates\");\n this.estimateDiscoveryDates();\n //alert(\"Bluejay adding prediction links (step 2/6)\");\n\t\tthis.addPredictionLinks();\n //alert(\"recommendor updating predictions\");\n\t\t//this.updateLinkValues();\n }", "title": "" }, { "docid": "697fcde9c90d39702a06c917d66b2462", "score": "0.5801023", "text": "function updateLinks() {\n //select all link elements in svg group of nodes\n link = linksG.selectAll(\"line.link\")\n .data(allData.links, function(d) {\n return `${d.source.id}_${d.target.id}`; });\n link.enter()\n .append(\"line\")\n .attr(\"class\", \"link\")\n .attr(\"stroke\", \"#ddd\").attr(\"stroke-opacity\", 0.8)\n .attr(\"x1\", function(d) {\n return d.source.x; })\n .attr(\"y1\", function(d) {\n return d.source.y; })\n .attr(\"x2\", function(d) {\n return d.target.x; })\n .attr(\"y2\", function(d) {\n return d.target.y; });\n }", "title": "" }, { "docid": "06eb35573db3b8c58397956c9a06ee52", "score": "0.5738651", "text": "function loopThroughLinks() {\n arr = [];\n jQuery('.content-links li').each(function () {\n var idName = $(this).attr('id'),\n pageName = idName.slice(0, -3) + '.html';\n arr.push({\n id: idName,\n page: pageName\n })\n });\n //console.log(arr);\n\n updateClickableLinks();\n }", "title": "" }, { "docid": "3f8727fb7caebad4e1ced1aafb8e1213", "score": "0.573406", "text": "function setupLinkDetails() {\n for (var i=0; i<links.length; i++) {\n nodes.forEach(function(d) {\n if (d.url == links[i].source) {\n links[i].source = d;\n }\n \n if (d.url == links[i].target) {\n links[i].target = d;\n }\n });\n }\n }", "title": "" }, { "docid": "440b8a742a4f5f462c3b781f803fe910", "score": "0.57253", "text": "function mergeLinks() {\n var linkGroups = d3.nest()\n .key(function (link) { return link.source.id + \"->\" + link.target.id; })\n .entries(links)\n .map(function (object) { return object.values; });\n\n links = linkGroups.map(function (linkGroup) {\n return linkGroup.reduce(function (previousLink, currentLink) {\n return {\n \"source\": previousLink.source,\n \"target\": previousLink.target,\n \"id\": d3.min([previousLink.id, currentLink.id]),\n \"value\": previousLink.value + currentLink.value\n };\n });\n });\n }", "title": "" }, { "docid": "4dc9420f113eb126cf35cddd5e9b3a11", "score": "0.5718154", "text": "function updateLinks()\n {\n for (var i = 0, max = links.length; i < max; i ++)\n {\n var title = formatFileName(format(localStorage[\"ytd-title-format\"], merge(links[i].stream, VideoInfo)));\n links[i].anchor.setAttribute(\"download\", title + StreamMap.getExtension(links[i].stream));\n links[i].anchor.setAttribute(\"href\", StreamMap.getURL(links[i].stream, title));\n }\n }", "title": "" }, { "docid": "e49bc28298b5212261781b487e44240d", "score": "0.5708417", "text": "async function main() {\n const newLink = await prisma.link.create({\n data: {\n description: \"Prisma is an open source database toolkit\",\n url: \"www.prisma.io\",\n },\n });\n const allLinks = await prisma.link.findMany();\n console.log(allLinks);\n}", "title": "" }, { "docid": "738d6f8c79577382f45a93d9b411cb5d", "score": "0.5679241", "text": "function saveProjectLinks(requestParamsObj) {\n return post('/cview/add/project/json',requestParamsObj,false,true);\n }", "title": "" }, { "docid": "e90d565ada17960a6504beca0d07caca", "score": "0.5626348", "text": "function updateLink(n) {\n\t var predLinks = d3.map();\n\t var succLinks = d3.map();\n\n\t /* Get layer and/or analysis links. */\n\t switch (n.nodeType) {\n\t case 'layer':\n\t n.predLinks.values().forEach(function (pl) {\n\t predLinks.set(pl.autoId, pl);\n\t });\n\t n.succLinks.values().forEach(function (sl) {\n\t succLinks.set(sl.autoId, sl);\n\t });\n\t n.children.values().forEach(function (an) {\n\t an.predLinks.values().forEach(function (pl) {\n\t predLinks.set(pl.autoId, pl);\n\t });\n\t an.succLinks.values().forEach(function (sl) {\n\t succLinks.set(sl.autoId, sl);\n\t });\n\t });\n\t break;\n\t case 'analysis':\n\t n.predLinks.values().forEach(function (pl) {\n\t predLinks.set(pl.autoId, pl);\n\t });\n\t n.succLinks.values().forEach(function (sl) {\n\t succLinks.set(sl.autoId, sl);\n\t });\n\t break;\n\t }\n\n\t /* Get input links and update coordinates for x2 and y2. */\n\t predLinks.values().forEach(function (l) {\n\t d3.selectAll('#linkId-' + l.autoId + ', #hLinkId-' + l.autoId).classed('link-transition', true).transition().duration(draggingActive ? 0 : nodeLinkTransitionTime).attr('d', function (ll) {\n\t var srcCoords = getVisibleNodeCoords(ll.source);\n\t var tarCoords = getVisibleNodeCoords(ll.target);\n\n\t if (linkStyle === 'bezier1') {\n\t return drawBezierLink(ll, srcCoords.x, srcCoords.y, tarCoords.x, tarCoords.y);\n\t }\n\t return drawStraightLink(ll, srcCoords.x, srcCoords.y, tarCoords.x, tarCoords.y);\n\t });\n\n\t setTimeout(function () {\n\t d3.selectAll('#linkId-' + l.autoId + ', #hLinkId-' + l.autoId).classed('link-transition', false);\n\t }, nodeLinkTransitionTime);\n\t });\n\n\t /* Get output links and update coordinates for x1 and y1. */\n\t succLinks.values().forEach(function (l) {\n\t d3.selectAll('#linkId-' + l.autoId + ', #hLinkId-' + l.autoId).classed('link-transition', true).transition().duration(draggingActive ? 0 : nodeLinkTransitionTime).attr('d', function (ll) {\n\t var tarCoords = getVisibleNodeCoords(ll.target);\n\t var srcCoords = getVisibleNodeCoords(ll.source);\n\n\t if (linkStyle === 'bezier1') {\n\t return drawBezierLink(ll, srcCoords.x, srcCoords.y, tarCoords.x, tarCoords.y);\n\t }\n\t return drawStraightLink(ll, srcCoords.x, srcCoords.y, tarCoords.x, tarCoords.y);\n\t });\n\n\t setTimeout(function () {\n\t d3.selectAll('#linkId-' + l.autoId + ', #hLinkId-' + l.autoId).classed('link-transition', false);\n\t }, nodeLinkTransitionTime);\n\t });\n\t}", "title": "" }, { "docid": "4f2875ca6674e36afa6b078d01f22006", "score": "0.56098086", "text": "function Links(){\n\tthis.list = [];\n\tthis.count = 0;\n\tthis.ambiguousIndex = 0;\n\tthis.ambiguousCount = 0;\n\tthis.internalCount = 0;\n\tthis.externalCount = 0;\n}", "title": "" }, { "docid": "613bbd56f5df5dc412e34d10994a9765", "score": "0.56046396", "text": "function processLinks(linksObject) {\n // console.log(linksObject);\n var page, pages = linksObject.pages;\n self.links = [];\n\n angular.forEach(Object.keys(pages), function (pageid) {\n page = pages[pageid];\n if (page.pageid && page.thumbnail)\n self.links.push(page);\n });\n }", "title": "" }, { "docid": "ffe25ef90d2c86dfd5069723eb41d516", "score": "0.5603582", "text": "function refreshNeighborMap(myLinksArray) {\n myLinksArray.forEach(function (d) {\n linkedByIndex[d.source.id + \",\" + d.target.id] = 1;\n });\n}", "title": "" }, { "docid": "7a3d93c36814732e808c5bab3ab5b662", "score": "0.5537551", "text": "function initializeNodeLinks() {\n links.forEach(function (link) {\n link.source.sourceLinks.push(link);\n link.target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "669dedf19172a35cfde1d115c380ba25", "score": "0.5533138", "text": "function populate (sites) {\n var href, n = sharedState.n;\n for (var i = 0; i < n; i++) {\n href = (sites[i] || {}).url;\n for (var j = i, _len = n * 256; j < _len; j += n) {\n if (href || sharedState.DOM.anchors[j].href !== '') {\n sharedState.DOM.anchors[j].href = href;\n }\n }\n }\n }", "title": "" }, { "docid": "ca6a950208f9d15876819d7ec2fc009c", "score": "0.5513453", "text": "_initLinks() {\n this._links = Array.from(this._results)\n .map((result) => this._setLink(result.querySelector('a')))\n .filter((link, index, array) => array.indexOf(link) === index);\n }", "title": "" }, { "docid": "04d06aecdc91aba7f4b24b47aa0aa761", "score": "0.54883355", "text": "function updateLinks(newLinks) {\n return {\n type: actions.UPDATE_LINKS,\n newLinks,\n };\n}", "title": "" }, { "docid": "a95ebef944611e72f6ad564e88c29716", "score": "0.5470977", "text": "function ProjectLinks({ live, source }) {\n // const RGAEventTracker = useRGAEvents('External Links')\n return (\n <Wrapper>\n {live && <Icon github icon={livelogo} alt='github' link={live} />}\n {source && (\n <Icon\n icon={github}\n alt='github'\n link={source}\n // onClick={(e) => RGAEventTracker('Source Link Visit', source)}\n />\n )}\n </Wrapper>\n )\n}", "title": "" }, { "docid": "295d1f7954d02596adcb7dc572c97cfc", "score": "0.54543024", "text": "resetLinks() {\n this.links = [\n { href: ['/news'], name: 'News', active: false, highlight: false, sub: null },\n { href: ['/about'], name: 'About Us', active: false, highlight: false, sub: null },\n {\n href: ['/expertise'], name: 'Expertise', active: false, highlight: false, sub: [\n { href: ['/expertise', '/cyber-security'], name: 'Cyber Security', active: false, highlight: false },\n { href: ['/expertise', '/blockchain'], name: 'Blockchain', active: false, highlight: false },\n ]\n },\n {\n href: ['/people'], name: 'People', active: false, highlight: false, sub: [\n { href: ['/people', '/staff'], name: 'Staff', active: false, highlight: false },\n { href: ['/people', '/students'], name: 'Students', active: false, highlight: false },\n ]\n },\n ];\n }", "title": "" }, { "docid": "899997291c154cfb2036300264ee69e4", "score": "0.5448912", "text": "function updateLinks() {\n var $this = $(this);\n var siblings = $this.closest('div').nextAll('.change-related, .delete-related');\n if (!siblings.length) return;\n var value = $this.val();\n if (value) {\n siblings.each(function(){\n var elm = $(this);\n elm.attr('href', elm.attr('data-href-template').replace('__fk__', value));\n });\n } else siblings.removeAttr('href');\n }", "title": "" }, { "docid": "0d0cc2d73a2d238de4a4e70cb0c5d305", "score": "0.5425564", "text": "function fix_links(jsonml) {\n if (_isArray(jsonml)) {\n if (jsonml[0] === 'a') { // found a link\n var attr = jsonml[1];\n if (typeof attr === \"object\" && 'href' in attr && attr.href in this) {\n attr.href = this[attr.href];\n }\n }\n for (var i = 1, l = jsonml.length; i < l; i++) {\n if (_isArray(jsonml[i])) {\n fix_links.call(this, jsonml[i]);\n }\n }\n }\n return jsonml;\n }", "title": "" }, { "docid": "57793c69b0e160304bced653afa4740b", "score": "0.54077685", "text": "function addLinks (link) {\n if (addLinks.links.indexOf(link) == -1) {\n addLinks.links.push(link);\n } else {\n console.log('no dupes pls')\n }\n \n console.log(addLinks.links);\n }", "title": "" }, { "docid": "7ec1aa3c4a380e5d86b4f984d3155218", "score": "0.53887784", "text": "function updateLinkMap(links) {\n\tlinkMap = {};\n\tlinks.forEach(function (link) {\n\t\tvar srcDPID = link['src-switch'];\n\t\tvar dstDPID = link['dst-switch'];\n\n\t\tvar srcMap = linkMap[srcDPID] || {};\n\n\t\tsrcMap[dstDPID] = link;\n\n\t\tlinkMap[srcDPID] = srcMap;\n\t});\n}", "title": "" }, { "docid": "4a814df9c9c293c0a246ecaf617f1a4b", "score": "0.5378272", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = []; // Links that have this node as source.\n node.targetLinks = []; // Links that have this node as target.\n });\n\n links.forEach(function(link) {\n // Are either of the values just an index? Then convert to nodes:\n if (typeof link.source === \"number\") { link.source = nodes[link.source]; }\n if (typeof link.target === \"number\") { link.target = nodes[link.target]; }\n\n // Add this link to the affected source & target:\n link.source.sourceLinks.push(link);\n link.target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "59ecdb758be095e64830933ed06fb3c7", "score": "0.5364595", "text": "constructor() { \n \n RepositoryAllOfLinks.initialize(this);\n }", "title": "" }, { "docid": "c3983f2e244c3cfcbc7f552644bb150a", "score": "0.53578013", "text": "function updateLinkUrls() {\r\n //get the current map extent\r\n var extent = \"\";\r\n extent = \"&extent=\" + dojo.toJson(map.extent.toJson());\r\n\r\n var appUrl = (document.location.href.split(\"?\"));\r\n var link = appUrl[0] + \"?\" + extent;\r\n if (appUrl[1]) {\r\n link += \"&\" + appUrl[1];\r\n }\r\n\r\n\r\n var mapTitle = \"Web Map\";\r\n if (dojo.byId(\"webmapTitle\")) {\r\n mapTitle = encodeURIComponent(dojo.byId(\"webmapTitle\").innerHTML);\r\n }\r\n\r\n //Get URL to add to email (bitly support removed 3/2013)\r\n var url = encodeURIComponent(link);\r\n createLink(mapTitle, url);\r\n\r\n //enable menu items now that links are working\r\n var menu = dijit.byId('socialMenu');\r\n dojo.forEach(menu.getChildren(), function (item) {\r\n item.set(\"disabled\", false);\r\n });\r\n\r\n dijit.byId(\"shareButton\").focus();\r\n\r\n}", "title": "" }, { "docid": "6722526d23d86edb1d438852235aa9c3", "score": "0.53496623", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = []\n node.targetLinks = []\n })\n links.forEach(function(link) {\n var source = link.source,\n target = link.target\n if (typeof source === 'number') source = link.source = nodes[link.source]\n if (typeof target === 'number') target = link.target = nodes[link.target]\n source.sourceLinks.push(link)\n target.targetLinks.push(link)\n })\n }", "title": "" }, { "docid": "94b0aac04187abbf569e0594c81e91b6", "score": "0.53445864", "text": "function changeSocialMediaLinks() {\r\n for (let li of socialLinks.children) {\r\n const social = li.getAttribute(\"class\");\r\n li.children[0].href = `https://${social}.com/${linksSocialMedia[social]}`;\r\n }\r\n }", "title": "" }, { "docid": "7327984a4fc33d1524ee283446824914", "score": "0.5340916", "text": "static async updateProjects(category, page = 1) {\n runInAction(() => {\n this.state = 'pending'\n })\n\n try {\n const projects = await fetchProjectsFromBehance(category, page);\n\n for (let i = 0; i < projects.length; i++) {\n let project = projects[i];\n\n let projectData = {\n id: project.id,\n category: category,\n published_on: project.published_on,\n name: project.name,\n covers: project.covers,\n fields: project.fields,\n stats: project.stats,\n url: project.url\n };\n\n // Since projects can have multiple categories\n const projectId = `${project.id}_${category.replace(/\\s/g, '')}`;\n\n let projectRef = new Document(`projects/${projectId}`);\n\n projectRef.set(projectData);\n }\n\n runInAction(() => {\n this.state = 'done'\n })\n\n return projects;\n\n } catch (error) {\n runInAction(() => {\n this.state = 'error'\n })\n }\n }", "title": "" }, { "docid": "d6a1e95aba2e6025edf897e844bdc666", "score": "0.5336005", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === 'number') source = link.source = nodes[link.source];\n if (typeof target === 'number') target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "bf8b85a9c0a0f745c2f6f1ab873975ae", "score": "0.53353965", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "aa2c2bc77120e48093a11606baa0e892", "score": "0.5333642", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === 'number') source = link.source = nodes[link.source];\n if (typeof target === 'number') target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "6901db32af3db3887c585b60e52d9ae4", "score": "0.5331481", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "679b65823a2fe17f91fa163e6afa190d", "score": "0.53308535", "text": "function createLinks() {\n // All the nodes should be available for creating links\n $(links).each( function(){\n var source = nodes[$(this)[0].source];\n var target = nodes[$(this)[0].target];\n \n createAndAttachSegment(source, target);\n });\n}", "title": "" }, { "docid": "602e45d6209e517a6d0afb6a1db1d1da", "score": "0.5325266", "text": "addNavigationLinks (posts) {\n posts.forEach((post, i) => {\n const previousPost = posts[i-1]\n const nextPost = posts[i+1]\n post.links = {\n previous: {\n title: previousPost ? previousPost.title : null,\n slug: previousPost ? previousPost.slug : null\n },\n next: {\n title: nextPost ? nextPost.title : null,\n slug: nextPost ? nextPost.slug : null\n }\n }\n })\n }", "title": "" }, { "docid": "425008a6a7829640952275692695c22b", "score": "0.5317599", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "425008a6a7829640952275692695c22b", "score": "0.5317599", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "eee9fdbb29dde0fe014a65ca38bb9c91", "score": "0.5312947", "text": "function getAssignmentLinks(links) {\n return links.map(item => ({\n title: item.title,\n link: item.link,\n fileType: item.fileType,\n dropboxFileId: item.dropboxFileId,\n isUploaded: (item.dropboxFileId !== null),\n }));\n}", "title": "" }, { "docid": "f88bac2b255e16966417ae261cb037d1", "score": "0.5309535", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "a96b1c088af915eaf7b289fd12289751", "score": "0.5297646", "text": "function setProjectResourceLinks(projectID, resourceIDs) {\n var url = baseUrl + 'api/admin/index.cgi?method=set_project_ip_block_links&project_id=' + projectID.toString();\n for (var i = 0; i < resourceIDs.length; i++) {\n url += '&ip_block_id=' + resourceIDs[i];\n }\n\n fetch(url, {\n credentials: 'include',\n method: 'get'\n }).then(function(response) {\n response.json().then(function(json) {\n window.location.href = basePath + 'project/index.html?project_id=' + projectID;\n });\n }).catch(function(err) {\n console.log(\"setProjectResourceLinks Error: \" + err);\n alert(\"Error or permission problem. Could not save.\\nBe sure you are (still) logged in.\");\n });\n}", "title": "" }, { "docid": "f6918985f74ea499295d599aee61a342", "score": "0.52896816", "text": "refreshNodeLinks(nodes) {\n var refreshedLinks = {};\n\n for (var i = 0; i < this.links.length; i++) {\n var link = this.links[i];\n // link already refreshed\n if (refreshedLinks[link.id]) continue;\n\n var sourceNode = link.sourceConnector.node;\n var targetNode = link.targetConnector.node;\n\n // if link node is in provided nodes\n if (nodes.indexOf(sourceNode) != -1 || nodes.indexOf(targetNode) != -1) {\n link.refresh();\n refreshedLinks[link.id] = true;\n }\n }\n }", "title": "" }, { "docid": "b8f398b3343e158d07a117264286525f", "score": "0.52868474", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "29278353fe3bfbd8dbdf9e2a8403e51a", "score": "0.5279152", "text": "setLinksInsideField() {\n let links_array = $(this.$el).find('a');\n\n for (let i = 0; i < links_array.length; i++) {\n let link = links_array[i];\n\n if (!(link.href && link.href.search(window.app.api.getHostUrl()) !== -1)) {\n link.setAttribute('target', '_blank');\n link.setAttribute('rel', 'noreferrer');\n continue;\n }\n\n let match = link.href.match(/#([A-z0-9,-]+)$/);\n\n if (match && link.href.search(window.location.href) === -1 && $('*').is(match[0])) {\n link.onclick = function () {\n $('body,html').animate(\n {\n scrollTop: $(match[0]).offset().top,\n },\n 600,\n );\n return false;\n };\n\n continue;\n }\n\n if (link.href.search(window.location.href) === -1) {\n link.href =\n window.location.href +\n this.link_path +\n link.href.split(window.app.api.getHostUrl())[1];\n }\n }\n }", "title": "" }, { "docid": "ed16cdcef6f967794448865637e65455", "score": "0.52782327", "text": "function mergeAlikeLinks() {\n var links = JSON.parse(JSON.stringify(records.graph.links));\n var newLinks = [];\n\n links.forEach(function (linkFirst, firstIndex) {\n var tempLinks = JSON.parse(JSON.stringify(links));\n\n for (var i = 0; i < tempLinks.length; i++) {\n var linkSecond = tempLinks[i];\n var secondIndex = i;\n if (secondIndex > firstIndex) {\n if (isLinkAlike(linkFirst, linkSecond)) {\n\n linkFirst.value = linkFirst.value + linkSecond.value;\n tempLinks.splice(secondIndex, 1);\n links.splice(secondIndex, 1);\n --i;\n }\n }\n }\n\n newLinks.push(linkFirst);\n\n });\n\n records.graph.links = newLinks;\n}", "title": "" }, { "docid": "18e6c0cde725f3572341a1cb1c4c5d3f", "score": "0.5277868", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "c2a628bdba52550a53195920f3e3d410", "score": "0.52586764", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "3b583cb6f7486b9b318a5f567b9a081e", "score": "0.5240998", "text": "async function fillAllArticleHyperlinks() {\n const articles = await fetchAllDocs('articles');\n let counter = 0;\n for (const { _id, _source } of articles) {\n if (counter % DUMP_DATA_LOADER_COUNT === 0) {\n loader.urlLoader.clearAll();\n loader.searchResultLoader.clearAll();\n }\n\n // eslint-disable-next-line no-console\n console.log(`[${++counter}/${articles.length}] Article ${_id}`);\n\n let scrapResults = [];\n\n try {\n scrapResults = await scrapUrls(_source.text, {\n cacheLoader: loader.urlLoader,\n client,\n });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(_id, e);\n }\n if (scrapResults.length) {\n await updateArticleHyperlinks(\n _id,\n scrapResults.filter(result => !!result) /* filter out errors */\n );\n // eslint-disable-next-line no-console\n console.log(` ...${scrapResults.length} URL(s)`);\n }\n }\n}", "title": "" }, { "docid": "996898cc0742965ae40314ddcaaaa174", "score": "0.5222277", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") {\n if (source == -1) { source = link.source = outside;}\n else {source = link.source = nodes[link.source]};\n }\n if (typeof target === \"number\") {\n if (target == -1) { target = link.target = outside;}\n else {target = link.target = nodes[link.target]};\n }\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "2c88816d666ab50ac2197b24fa6a8d65", "score": "0.52080023", "text": "function updateLinks() {\n linkSelection = linkSelection.data(linksData);\n linkSelection\n .enter()\n .insert(\"line\", \".node\")\n .attr(\"class\", \"link\");\n linkSelection\n .exit()\n .remove();\n forceLayout.start();\n }", "title": "" }, { "docid": "91ae90052ed06eef05936387ee3de2f6", "score": "0.52006525", "text": "function formatEnvGroupLinks($links, id) {\n $.each($links, function(_, a){\n a.href = a.href.replace(/\\d+$/, id || 0);\n });\n $links.toggle(!!id);\n }", "title": "" }, { "docid": "988da08445e7f2ddb2c0db19ce1bf117", "score": "0.51994926", "text": "function setLinks() {\r\n // reset connected links\r\n links.forEach(function(d) {\r\n linkedByIndex[d.source.id + \",\" + d.target.id] = 0;\r\n });\r\n links.splice(0, links.length);\r\n // only get links that are selected\r\n var specificLinks = root.links.filter(function(d) {\r\n for (var i = 0; i < relations.length; i++) {\r\n if (d.type == relations[i]) return d;\r\n }\r\n });\r\n // add links to force layout\r\n specificLinks.forEach(function(d) {\r\n addLink(d);\r\n });\r\n // set linked decisions\r\n links.forEach(function(d) {\r\n linkedByIndex[d.source.id + \",\" + d.target.id] = 1;\r\n });\r\n // update layout\r\n update();\r\n if (toggle !== 0) {\r\n var highlightedDecision = node_lookup[toggle];\r\n toggle = 0;\r\n connectedNodes(highlightedDecision);\r\n }\r\n }", "title": "" }, { "docid": "a3d71eb1404001e28c05569785a8b3bd", "score": "0.51899254", "text": "_refreshLinks(cellModel) {\n const paper = this.get('paper');\n const links = paper.model.getConnectedLinks(cellModel);\n links.forEach((link)=> {\n let linkView = paper.findViewByModel(link);\n linkView.updateBox();\n linkView.update();\n if (linkView.model.get('highlighted')) {\n linkView.unhighlight();\n linkView.highlight();\n }\n });\n }", "title": "" }, { "docid": "36a7806ec2c5a5d6029dff4803003dde", "score": "0.5187407", "text": "function sync(linkFilePath){\n if (typeof linkFilePath === \"undefined\"){\n console.log(\"Error: No link file path provided\");\n return;\n }\n\n fs.readFile(linkFilePath, {encoding: \"utf8\"}, function(err, data){\n if (err){\n console.log(err);\n return;\n }\n\n var links = JSON.parse(data);\n\n for (sourcePath in links){\n links[sourcePath].forEach(function(element){\n link(sourcePath, element);\n }); \n }\n });\n}", "title": "" }, { "docid": "d0102173b573e6709a7cd4400487fcd2", "score": "0.51824534", "text": "async getLinks() {\n if(!this.cached_links) {\n const res = await this.client.get(`spaces/${this.space_id}`)\n const cdn_token = res.data.space.first_token\n const links_res = await this.client.get('cdn/links/', {\n token: cdn_token,\n version: 'draft'\n })\n this.cached_links = {\n folders: [],\n stories: []\n }\n Object.entries(links_res.data.links).forEach(link => {\n if(link[1].is_folder) {\n this.cached_links.folders.push(link[1])\n } else {\n this.cached_links.stories.push(link[1])\n }\n })\n }\n return this.cached_links\n }", "title": "" }, { "docid": "50b4b89f83f2a8a6cf4887a5a4662a43", "score": "0.51724637", "text": "function all_channel_link_update()\n {\n ALL_CHANNEL_LINKS.forEach(function(link){\n link.onclick =function(e){\n\n //prevent link from submitting\n e.preventDefault();\n\n //get the channel name\n let channel = link.innerHTML;\n\n //remember the channel\n localStorage.setItem(\"last-channel\", channel);\n\n ///update the webpage by calling the channel page function\n let route = \"channel/json/\" + channel;\n channel_page(route, channel);\n\n // Push state to URL. and save it in the history\n document.title = \"Flack | \" + channel;\n history.pushState({\"title\":document.title, \"channel\":route}, document.title, \"/channel/\"+channel);\n update_links(this);\n\n };\n })\n\n\n }", "title": "" }, { "docid": "d69abfbf703b417ccab9279379fe31d2", "score": "0.5170572", "text": "updateLinks() {\n this.props.updateLinks(token)\n }", "title": "" }, { "docid": "1717f7dbf4415353ae32ac453d2dd807", "score": "0.51691365", "text": "function _appendLinks() {\n if (_grpLinks != null)\n _grpLinks.remove();\n\n _grpLinks = _grpCluster.append(\"g\")\n .attr(\"class\",\"CV-grpLinks\")\n .attr(\"transform\",\"rotate(90)\");\n\n _links = _grpLinks.selectAll(\"path\")\n .data(_dataLinks.vBundleLinks)\n .enter()\n .append(\"path\")\n .attr(\"d\", _drawLine);\n }", "title": "" }, { "docid": "a6bcce5b62b04af4be6ce03a7f29bd6d", "score": "0.5165249", "text": "function FindLinks(linkObj)\r\n{\r\n var options = {\r\n uri: linkObj.url, //The link for the API that we are looking for.\r\n transform: function (body) { //Cheerio will allow for me to use $ (jquery like queries)\r\n return cheerio.load(body);\r\n }\r\n }\r\n rp(options).then(($) => {\r\n\r\n Links = $('body').find('a').filter(function (i, el) {\r\n return $(this).attr('href') != null;\r\n }).map( function (i, x) {\r\n return $(this).attr('href');\r\n });\r\n\r\n if(Links.length > 0) {\r\n Links.map(function (i, x) {\r\n var reqLink = checkDomain(x);\r\n if(reqLink)\r\n {\r\n if(reqLink != linkObj.url) {\r\n newLinkObj = new CreateLink(reqLink, linkObj.depth + 1, linkObj);\r\n AddToLinkQueue(newLinkObj);\r\n }\r\n }\r\n });\r\n } else {\r\n //console.log(\"No more links found for \" + options.uri);\r\n }\r\n })\r\n .catch((err) => {\r\n console.log(\"Something Went Wrong...\");\r\n console.log(`Check URI: ${options.uri}`);\r\n }).then(($) => {\r\n var nextLinkObj = GetNextInQueue();\r\n if(nextLinkObj && nextLinkObj.depth <= MaxDepth) {\r\n crawl(nextLinkObj);\r\n } else\r\n {\r\n SetRootNode(nextLinkObj);\r\n PrintTree();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "7ce6c28707d878a56e6c6dbc8bd87bc8", "score": "0.5162555", "text": "insertLinkTagObject(compilation, param) {\n const links = [];\n const option = this.option;\n if (option) {\n if ('link' in option) {\n if (!Array.isArray(option.link)) {\n links.push(option.link);\n }\n else {\n links.push(...option.link);\n }\n }\n }\n const entryAndLinkItemsForProcess = this.setupLinkItemForProcess();\n const entryNames = HtmlLinkInjection.getEntryNamesByHtmlWebpackPlugin(compilation, param.plugin);\n const entryNameLinkItems = this.processLinkItems(entryNames, entryAndLinkItemsForProcess);\n HtmlLinkInjection.mergeTags(entryNameLinkItems, param);\n }", "title": "" }, { "docid": "d5a86e95d1daa9642e9d37c9c1acbd27", "score": "0.51568884", "text": "function setProjects(arr) {\n if (arr && arr.length > 0) {\n // Empty element\n $(\"#projects\").empty();\n\n // Append each project\n for (project of arr) {\n // Determine the accomplishments list\n const inner_list = `<ul>\n <li>\n ${project.accomplishments.join(\"</li><li>\")}\n </li>\n </ul>`;\n\n // Set the field\n $(\"#projects\").append(\n `<div class=\"icon-left section\">\n <div class=\"bisect-container\">\n <h4>${project.title}</h4>\n <p class=\"grey-text\"><i class=\"fas fa-calendar-alt\"></i>\n ${project.date}\n </p>\n </div>\n <span class=\"grey-text\">\n <i class=\"fab fa-github\"></i>\n <a href=\"${project.github}\">${project.github.split(\"://\")[1]}</a>\n </span>\n ${inner_list}\n </div>`\n );\n }\n } else {\n $(\"#projects\").parent().remove();\n }\n}", "title": "" }, { "docid": "8e996af159de8c1696e691de516319c1", "score": "0.51537436", "text": "_createLinks(panel){\n var linksDiv = panel.linksDiv\n \n for(var link of panel.links) {\n let x = link.rect.x + (link.isParentFixed?panel.x:0)\n let y = link.rect.y + (link.isParentFixed?panel.y:0)\n\n var a = $(\"<a>\",{ \n lpi: this.index,\n li: link.index,\n lpx: x,\n lpy: y\n })\n\n var eventType = 0 // click\n\n if('page' in link){\n var destPageIndex = viewer.getPageIndex(parseInt(link.page))\n var destPage = story.pages[destPageIndex];\n if('overlay'==destPage.type){\n eventType = destPage.overlayByEvent\n }\n }\n\n \n if(1==eventType){ // for Mouse over event\n a.mouseenter(handleLinkEvent)\n if(10==destPage.overlayAlign){ // for overlay on hotspot top left position\n \n }else{\n // need to pass click event to overlayed layers\n a.click(function(e){\n if(undefined==e.originalEvent) return\n var nextObjects = document.elementsFromPoint(e.originalEvent.x,e.originalEvent.y);\n for(var i = 0; i < nextObjects.length; i++) {\n var obj = nextObjects[i].parentElement\n if(obj.nodeName!='A' || obj==this) continue\n $(obj).trigger('click', e);\n return\n }\n })\n }\n }else{ // for On click event\n a.click(handleLinkEvent)\n }\n \n a.appendTo(linksDiv)\n\n link.a = a\n\n var style=\"left: \"+ link.rect.x+\"px; top:\"+link.rect.y+\"px; width: \"+ link.rect.width+\"px; height:\"+link.rect.height+\"px; \"\n var linkDiv = $(\"<div>\",{\n class:\"linkDiv\"+(story.disableHotspots?\"\":\" linkDivHighlight\"),\n }).attr('style', style)\n linkDiv.appendTo(a)\n\n link.div = linkDiv\n \n } \n }", "title": "" }, { "docid": "57642ee25873b8647fc80c960fb3b93d", "score": "0.514764", "text": "function PullrequestAllOfLinks() {\n _classCallCheck(this, PullrequestAllOfLinks);\n\n PullrequestAllOfLinks.initialize(this);\n }", "title": "" }, { "docid": "e9f99a4bb3e144cee46ebb0cb647e3d5", "score": "0.5139571", "text": "async linkNpmPackages() {\n const settings = this.$.desktop.getSettings();\n const promises = [];\n if ('linkPackages' in this.$.desktop.getSettings()) {\n if (Array.isArray(settings.linkPackages)) {\n settings.linkPackages.forEach(packageName =>\n promises.push(this.runNpm(['link', packageName]))\n );\n }\n }\n await Promise.all(promises);\n }", "title": "" }, { "docid": "a2071328eb132058dd220688ef3ee67d", "score": "0.513226", "text": "function addConnectedLinks(baseObj, linkObjs, linkLabel) {\n // Arrow from first Report to ReportingSystem\n addLink(reports[0], baseObj, linkLabel, TOP);\n // Lines from remaining Reports to ReportingSystem\n if(reports.length > 1) {\n bb1 = baseObj.getBBox();\n x1 = bb1.x + bb1.width;\n y1 = bb1.y + (bb1.height/2);\n xMid = x1 + ((reports[0].getBBox().x - x1) /2);\n for(i = 1; i < reports.length; i++) {\n bb2 = reports[i].getBBox();\n x2 = bb2.x;\n y2 = bb2.y + (bb2.height/2);\n var pStr = \"M \" + x2 + \",\" + y2 + \" L \" + xMid + \",\" + y2 + \" L \" + xMid + \",\" + y1\n var l = paper.path(pStr);\n l.attr({stroke: l, \"stroke-width\": 3, fill: \"none\"})\n }\n }\n}", "title": "" }, { "docid": "ae8c3f2537a9a5a506677688f7574350", "score": "0.5130608", "text": "function generateCurrentDocumentLinksAsLinkCategoryList() {\n var link_category_dict = {};\n\n if (current_document.links) {\n for (var i = 0; i < current_document.links.length; i++) {\n var link = current_document.links[i];\n if (!link_category_dict[link.linkCategoryId]) {\n link_category_dict[link.linkCategoryId] = {id: link.linkCategoryId, links: []};\n }\n link_category_dict[link.linkCategoryId].links.push(link);\n\n }\n } else {\n console.log(\"Current document has no links\");\n }\n\n\n link_category_list.length = 0;\n\n for (var prop in link_category_dict) {\n // skip loop if the property is from prototype\n if (!link_category_dict.hasOwnProperty(prop)) continue;\n\n link_category_list.push(link_category_dict[prop]);\n }\n\n var temp_list = [];\n for (var n = 0; n < link_category_list.length; n++) {\n var temp_field = {};\n temp_field[\"id\"] = LinkCategory.getById(link_category_list[n].id).id;\n temp_field[\"sequence\"] = LinkCategory.getById(link_category_list[n].id).sequence;\n temp_field[\"links\"] = link_category_list[n].links;\n temp_list.push(temp_field);\n }\n temp_list.sort(ServiceFunction.compareSequence);\n link_category_list.length = 0;\n\n for (var x = 0; x < temp_list.length; x++) {\n link_category_list.push({id: temp_list[x].id, links: temp_list[x].links});\n }\n }", "title": "" }, { "docid": "b2d1273672b241113e8acb8443c132c3", "score": "0.5129984", "text": "function addLinksPropertyToObject(obj, linkDataToAdd) {\n let objectToReturn = Object.assign({}, obj);\n\n if (!obj.hasOwnProperty(\"links\")) {\n objectToReturn.links = [];\n }\n\n linkDataToAdd.forEach(linkData => {\n objectToReturn.links.push({\n rel: linkData[0],\n href: linkData[1]\n });\n });\n\n return objectToReturn;\n}", "title": "" }, { "docid": "ec0a4297a929d5b10c849a15e7e8cd95", "score": "0.512853", "text": "function fixLinks() {\n var done = this.async(), count = 0;\n files.forEach(function (f) {\n fs.readFile(f.dest, \"utf-8\", function (_, data) {\n data = data.replace(/\\$\\[[a-z\\s\\/\\+-\\.]+\\]/gi, function (name) {\n var sln = name.replace(/\\$\\[|\\]/g, ''); // stripped link name;\n if (sln in links) {\n return \"<a href=\\\"\" + links[sln] + \"\\\">\" + sln + \"</a>\"\n }\n return name;\n });\n fs.writeFile(f.dest, data, check);\n });\n });\n function check() {\n if (++count === files.length) {\n done();\n }\n }\n}", "title": "" }, { "docid": "19f62e3bc7d05c8fedf48df565bdfc85", "score": "0.5128125", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n // Links that have this node as source.\n node.sourceLinks = [];\n // Links that have this node as target.\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === 'number') source = link.source = nodes[link.source];\n if (typeof target === 'number') target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "2090b6e9b78cc42e359a1026559c6b1b", "score": "0.5120464", "text": "function reconcilePendingLinks(model) {\n\tlinks = [];\n\tmodel.links.forEach(function (link) {\n\t\tlinks.push(link);\n\t\tdelete pendingLinks[makeLinkKey(link)]\n\t})\n\tvar linkId;\n\tfor (linkId in pendingLinks) {\n\t\tlinks.push(pendingLinks[linkId]);\n\t}\n}", "title": "" }, { "docid": "bfa72e66fe1345d8f8c7d8de77ec5dad", "score": "0.51163423", "text": "constructor() {\n this.iterateLinks()\n }", "title": "" }, { "docid": "e2d645b09d6a3a4c8e5e4799f6eba4d7", "score": "0.51127076", "text": "function modifyLinks(data) {\n\t\t// Retrieve the necessary information\n\t\tvar left = $(data).find(\"#goLeft\").attr(\"data-month\"),\n\t\tleftYr = $(data).find(\"#goLeft\").attr(\"data-year\"),\n\t\tright = $(data).find(\"#goRight\").attr(\"data-month\"),\n\t\trightYr = $(data).find(\"#goRight\").attr(\"data-year\"),\n\n\t\tcurrentMon = $(data).find(\"#info\").attr(\"data-month\"),\n\t\tcurrentYr = $(data).find(\"#info\").attr(\"data-year\");\n\n\t\t// change the links\n\t\t$(\"#goLeft\").attr(\"data-month\", left); $(\"#goLeft\").attr(\"data-year\", leftYr);\n\t\t$(\"#goRight\").attr(\"data-month\", right); $(\"#goRight\").attr(\"data-year\", rightYr);\n\n\t\t// change the info field which provides current month and yr\n\t\t$(\"#info\").attr(\"data-month\", currentMon); $(\"#info\").attr(\"data-year\", currentYr);\n\t}", "title": "" }, { "docid": "62f02fc6c0c6d3535d53f299e94b4934", "score": "0.5109253", "text": "function linkify() {\n $('.link.single').each(function() {\n linkify_single(this)\n })\n $('.link.multiple').each(function() {\n linkify_multiple(this)\n })\n}", "title": "" }, { "docid": "ed2b6e1b1345b193b465094d5edadf80", "score": "0.51078415", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n // Links that have this node as source.\n node.sourceLinks = [];\n // Links that have this node as target.\n node.targetLinks = [];\n node.inactive = false;\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n link.inactive = false;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "c6a1c297e23c93ca0080d0d141f8539c", "score": "0.5100483", "text": "linkifyLinks() {\n this.$('.md-url').each(function() {\n Ember.$(this).wrap(`<a href=\"${this.textContent}\">`);\n });\n\n this.$('.md-link').each(function() {\n const href = Ember.$(this).find('.md-href').text();\n Ember.$(this).wrap(`<a href=\"${href}\">`);\n });\n }", "title": "" }, { "docid": "4d8405528ef22f92ab5b9f4ddd3659d3", "score": "0.508715", "text": "_buildDependentGraph() {\n this._dependentList = new Map();\n Object.keys(this._rushLinkJson.localLinks).forEach(project => {\n this._rushLinkJson.localLinks[project].forEach(dep => {\n if (!this._dependentList.has(dep)) {\n this._dependentList.set(dep, new Set());\n }\n this._dependentList.get(dep).add(project);\n });\n });\n }", "title": "" }, { "docid": "4ddc7b8d300107215a6f42a294e915a2", "score": "0.5082957", "text": "function projectLink(project){\n\t\t\t$scope.currentProject = project.url;\n\n\t\t\t// only set project selected when widht is less than the breaking point\n\t\t\tif($window.innerWidth < breakPoint)\n\t\t\t\t{\n\t\t\t\t\tproject.selected = !project.selected; // swap\n\n\t\t\t\t\tif(project.arrowClass == null)\n\t\t\t\t\t\tproject.arrowClass = \"arrowClicked\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tproject.arrowClass = null;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "53e36dc53a2c1102fbf2d5f90952eb45", "score": "0.508104", "text": "function setLinkIndexAndNum()\n {\n for (var i = 0; i < finalResult[1].length; i++)\n {\n if (i != 0 &&\n finalResult[1][i].source == finalResult[1][i - 1].source &&\n finalResult[1][i].target == finalResult[1][i - 1].target)\n {\n finalResult[1][i].linkindex = finalResult[1][i - 1].linkindex + 1;\n }\n else\n {\n finalResult[1][i].linkindex = 1;\n }\n // save the total number of links between two nodes\n if (mLinkNum[finalResult[1][i].target + \",\" + finalResult[1][i].source] !== undefined)\n {\n mLinkNum[finalResult[1][i].target + \",\" + finalResult[1][i].source] = finalResult[1][i].linkindex;\n }\n else\n {\n mLinkNum[finalResult[1][i].source + \",\" + finalResult[1][i].target] = finalResult[1][i].linkindex;\n }\n }\n }", "title": "" }, { "docid": "800aff8e3c86556289b9253f2823fa42", "score": "0.5080325", "text": "function setLinkIndexAndNum()\n { \n for (var i = 0; i < data.links.length; i++) \n {\n if (i != 0 &&\n data.links[i].source == data.links[i-1].source &&\n data.links[i].target == data.links[i-1].target) \n {\n data.links[i].linkindex = data.links[i-1].linkindex + 1;\n }\n else \n {\n data.links[i].linkindex = 1;\n }\n // save the total number of links between two nodes\n if(mLinkNum[data.links[i].target + \",\" + data.links[i].source] !== undefined)\n {\n mLinkNum[data.links[i].target + \",\" + data.links[i].source] = data.links[i].linkindex;\n }\n else\n {\n mLinkNum[data.links[i].source + \",\" + data.links[i].target] = data.links[i].linkindex;\n }\n }\n }", "title": "" }, { "docid": "733edb58633292d09f008dd39320d719", "score": "0.50801677", "text": "function updateFileLinks($group) {\n\t\tvar remove = !config$1.linkFiles || config$1.linkFilesTemplate.length == 0;\n\t\t$group.find(\"li[data-detect-files]\").each(function(){\n\t\t\tcreateFileLinks($(this), $(this).find(\".t_string\"), remove);\n\t\t});\n\t}", "title": "" }, { "docid": "b7cba6b00993e7bb6cd30b78e5df7c6d", "score": "0.50769466", "text": "function correctURLs() {\n $('.product').each(function() {\n var orgLinks = $(this).attr('link'),\n newLinks = orgLinks.split(',');\n\n $(this).attr('link', newLinks[0]);\n });\n}", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.5074413", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "e80a70157c790b8013ec5e2c0e32af70", "score": "0.50731766", "text": "function setLinkIndexAndNum() {\n\n\t// if(links !=undefined){\n\tfor (var i = 0; i < links.length; i++) {\n\t\tif (i != 0 && links[i].source == links[i - 1].source\n\t\t\t\t&& links[i].target == links[i - 1].target) {\n\t\t\tlinks[i].linkindex = links[i - 1].linkindex + 1;\n\t\t} else {\n\t\t\tlinks[i].linkindex = 1;\n\t\t}\n\t\t// save the total number of links between two nodes\n\t\tif (mLinkNum[links[i].target + \",\" + links[i].source] !== undefined) {\n\t\t\tmLinkNum[links[i].target + \",\" + links[i].source] = links[i].linkindex;\n\t\t} else {\n\t\t\tmLinkNum[links[i].source + \",\" + links[i].target] = links[i].linkindex;\n\n\t\t}\n\t}\n\t// }else{\n\t// links = [];\n\t// }\n}", "title": "" } ]
2363e87985aac0caaae2c9d406b54039
7. Write a program that calculates a number of digits of a given number.
[ { "docid": "8bd038cc7a5523742a8536754d3e2c83", "score": "0.7190765", "text": "function numOfDigits (num) {\n var digitCounter = 0;\n\n if (num < 0){\n num *= -1;\n}\n for (var i = num; i >= 1; i /= 10){\n digitCounter++;\n }\n return digitCounter;\n}", "title": "" } ]
[ { "docid": "919793682e222cb99f40877ccb5d5b45", "score": "0.768565", "text": "function ndigits(number) {\n var ndigits = 0;\n while (number != 0) {\n number = Math.trunc(number / 10);\n ndigits++;\n console.log(number);\n }\n return ndigits;\n}", "title": "" }, { "docid": "19981c5aff7898f85a5549ced643ca64", "score": "0.7488793", "text": "function countDigits(n) {\n var count = 0;\n if (n >= 1) ++count;\n \n while (n / 10 >= 1) {\n n /= 10;\n ++count;\n }\n \n return count;\n}", "title": "" }, { "docid": "a7a477a88342d46711c473e65bc799ef", "score": "0.747641", "text": "function numberOfDigits(n) {\n\n var lastDigit;\n\n if (typeof n != \"number\") {\n return 'Not a number';\n }\n\n else {\n var counter = 0;\n while (n > 0) {\n lastDigit = n % 10;\n n = (n - lastDigit) / 10;\n counter += 1;\n }\n\n } return counter;\n}", "title": "" }, { "docid": "2930e98b8e3fe5d15937134f35dc6ea9", "score": "0.7456415", "text": "function digitCount(num) {\n // My way converting to string\n return num.toString().length;\n\n // Instructors way with maths\n // if (num === 0) return 1;\n // return Math.floor(Math.log10(Math.abs(num))) + 1;\n}", "title": "" }, { "docid": "8e27cdf1fc9c9f4cf1003b60880fb4c4", "score": "0.74083656", "text": "function lenNumber(n) {\n let len = 0;\n let temp = n;\n while (temp !== 0) {\n temp = Math.floor(temp / 10);\n len++;\n }\n return len;\n}", "title": "" }, { "docid": "fe57d5c1936a4ce6e0f9cd4fde7648b6", "score": "0.7399067", "text": "function digitCount(num) {\n return Math.abs(num).toString().length;\n}", "title": "" }, { "docid": "ea50c2a3f741b5a07e778c896f1e2f39", "score": "0.73274", "text": "function countDigits(num){\r\n var temp=num;\r\n var result=0;\r\n while(temp>0){\r\n temp=parseInt(temp/10);\r\n result++;\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "452f692c554cafaf58c1f8e6cf468f70", "score": "0.73254085", "text": "function getIntLength(num){\n let count = 0;\n while (num > 9) {\n count++;\n num = Math.floor(num / 10);\n }\n count++;\n return count;\n}", "title": "" }, { "docid": "ecd46767a06f1f23ffa510274b08ed3f", "score": "0.73067874", "text": "function digits_count() {\r\n var n = +document.getElementById(\"num_digits_count\").value;\r\n var count = 0;\r\n if (n > 1) ++count;\r\n\r\n while (n / 10 >= 1) {\r\n n /= 10;\r\n ++count;\r\n }\r\n document.getElementById(\"result_digits_count\").innerHTML = \"The result is : \" + count;\r\n}", "title": "" }, { "docid": "f4002ff67de01ec6b5482db30e142a45", "score": "0.72548175", "text": "function printDigits(num) {\n let count = 0;\n let temp = num;\n while (temp != 0) {\n temp = Math.floor(temp / 10);\n count++;\n }\n while (count != 0) {\n // A number like 3000 will be an edge case if we check for num != 0\n let digit = Math.floor(num / Math.pow(10, count - 1));\n num %= Math.pow(10, count - 1);\n count--;\n console.log(digit);\n }\n}", "title": "" }, { "docid": "caec6669f2bd78f87149b5e23bed59b6", "score": "0.7250656", "text": "function digitDegree(num) {\n let count = 0\n let currentNumber = num\n if(currentNumber < 10){\n return count\n } else {\n while(currentNumber > 9){\n count += 1\n currentNumber = getDigit(currentNumber)\n if(currentNumber < 10){\n break;\n }\n }\n }\n return count\n}", "title": "" }, { "docid": "cf835add9b5ccf8a4ffe42dde6cb31d3", "score": "0.72434473", "text": "function digitCount(num) {\r\n if (num === 0) return 1;\r\n return Math.floor(Math.log10(Math.abs(num))) + 1;\r\n}", "title": "" }, { "docid": "e0702d880bb2d29af0a8c2167b79d611", "score": "0.72221565", "text": "function countDigits(num)\r\n\t{\r\n\t\tvar digits = 0;\r\n\r\n\t\tif (num == 0)\r\n\t\t\treturn 1;\r\n\r\n\t\twhile (num > 0)\r\n\t\t{\r\n\t\t\tdigits++;\r\n\t\t\tnum = Math.floor(num / 10);\r\n\t\t}\r\n\r\n\t\treturn digits;\r\n\t}", "title": "" }, { "docid": "871284533c86dfe56f2134a72dcadad1", "score": "0.7197489", "text": "function digitCount(num) {\n if (num === 0) return 1;\n return Math.floor(Math.log10(Math.abs(num))) + 1;\n}", "title": "" }, { "docid": "871284533c86dfe56f2134a72dcadad1", "score": "0.7197489", "text": "function digitCount(num) {\n if (num === 0) return 1;\n return Math.floor(Math.log10(Math.abs(num))) + 1;\n}", "title": "" }, { "docid": "871284533c86dfe56f2134a72dcadad1", "score": "0.7197489", "text": "function digitCount(num) {\n if (num === 0) return 1;\n return Math.floor(Math.log10(Math.abs(num))) + 1;\n}", "title": "" }, { "docid": "af519d3ba5d6ffa4e6d10feff543e395", "score": "0.7187199", "text": "function numOfDigits(x) {\n var br = 0;\n while (x / 10 > 0) {\n br++;\n x = x / 10;\n }\n return br;\n}", "title": "" }, { "docid": "a998539d5a354d6a4c6f8733eb13e080", "score": "0.7164828", "text": "function digitCount(num) {\n // if (num === 0) {\n // return 1;\n // } else{\n // return Math.floor(Math.log10(Math.abs(num)))+1;\n // }\n\n //Short syntax\n if (num === 0) return 1; // special case if num is 0 then be 1\n return Math.floor(Math.log10(Math.abs(num))) + 1;\n\n}", "title": "" }, { "docid": "057ec19801dcdec68e5bf8b83d302f81", "score": "0.7135035", "text": "function sumOfDigitsAlt(num){\n let sum = 0;\n while(num > 0){\n const digits = num % 10\n console.log(digits)\n sum += digits\n num = Math.floor(num / 10)\n //console.log(num)\n }\n return sum\n}", "title": "" }, { "docid": "267645a77cfd0a9809f0b8e743c1ce29", "score": "0.71091", "text": "function digitCount(num){\n //since Math.log10(0) is -infinity\n if(num === 0) return 1\n return Math.floor(Math.log10(Math.abs(num))) + 1\n }", "title": "" }, { "docid": "46df196efeaee013e8b39502ecdec5b3", "score": "0.7074902", "text": "function getDigits(n) {\n\n /*\n * Input:\n * n -- positive integer number\n * -- index of a digit in the sequence\n * -- must be a power of 10\n *\n * Returns an integer, a single digit at the given position in the sequence.\n *\n * This algorithm is entirely based on:\n * https://www.xarg.org/puzzle/project-euler/problem-40/\n *\n * Notes:\n * - \"sequence\" is created by concatenating consecutive positive integers (A007376 in the OEIS)\n * - \"block\" is a chunk of the sequence based on a number of digits in a number\n * - index of the current block corresponds to the number of digits in each number in the block\n */\n\n let f; // total amount of numbers until and including the first number of the current block\n let r; // index upper bound of the previous block, total amount of digits until the current block\n let k = 0; // index of the current block, number of digits each number has in the current block\n let s = 0; // index upper bound of the current block, total amount of digits until next block\n\n while (s < n) {\n r = s;\n f = 10 ** k++;\n s += 9 * f * k;\n }\n\n const h = n - r - 1;\n const t = f + h / k; // number in the sequence that contains requested digit\n const p = h % k; // position of the digit in the number\n\n return +t.toString()[p];\n}", "title": "" }, { "docid": "d4633752df7aedf8e495ec705ba1aa39", "score": "0.70121497", "text": "function digitCount(num) {\n if (num === 0) return 1;\n return Math.floor(Math.log10(Math.abs(num))) + 1;\n // Math.abs makes it so we can use negative numbers.\n // Math.log10 = 10 to what power gives us this number?\n // \n}", "title": "" }, { "docid": "54bacb7c7e25a18816278b031f3cd2bb", "score": "0.6971972", "text": "function n_digits(x, n) {\n\tlet e = Math.pow(10, n);\n\treturn Math.floor(e * x) / e;\n}", "title": "" }, { "docid": "bcb5a0613dec3249ceccae89db0602d2", "score": "0.6965905", "text": "function digitCount(num) {\n // weird case. Math.log10(0) === -Infinity\n if (num === 0) return 1\n return Math.floor(Math.log10(Math.abs(num))) + 1\n}", "title": "" }, { "docid": "4a4948c78a07405e76220872fe73e4ac", "score": "0.69571537", "text": "function digitCount(num) {\n if (num === 0) return 1; // Math.log10(0) gives negative infinity\n return Math.floor(Math.log10(Math.abs(num))) + 1;\n}", "title": "" }, { "docid": "4180f4a71cb6fa59ec4d34363ff21ae1", "score": "0.6943313", "text": "function digital_root(n) {\n while (n > 9) {\n let sum = n.toString().split('').reduce((acc, val) => acc + Number(val), 0)\n n = sum\n }\n return n\n }", "title": "" }, { "docid": "29442cb7ccb938f1f8265c61eeac7a48", "score": "0.6898486", "text": "function numberOfDigits(number){\n\t//que necesitamos para contar posiciones, con un for \n\tvar counter=0;\n\tvar digits=number.toString();\n\t // \"1986\"\n for(var i=0; i<digits.length; i++){\n \tcounter++;\n \t}\n \treturn counter;\n\t//totring es parse int pero al reves es para convertir un numero a un string\n}", "title": "" }, { "docid": "a7194284eb3c7f30b04f2bff3b8c8f75", "score": "0.6894767", "text": "function countDigitsStrWay(num){\r\n var result=num.toString();\r\n return result.length;\r\n }", "title": "" }, { "docid": "f51c68b98fc7e5e214f1837964da9f9c", "score": "0.6886144", "text": "function count_convert(num) {\n var digitSum = function (num) {\n var digit_sum = 0;\n while (num) {\n digit_sum += num % 10;\n num = Math.floor(num / 10);\n }\n return digit_sum;\n };\n var count=0;\n while(num>10){\n num = digitSum(num);\n count++;\n }\n return count;\n}", "title": "" }, { "docid": "c3e3c734d68fe972040bd748396f9a7a", "score": "0.68812025", "text": "function digital_root(n) {\n // ...\n while(n >= 10){\n let x = 0\n while(n){\n x += n % 10\n n = Math.floor(n / 10)\n }\n n = x\n }\n return n\n}", "title": "" }, { "docid": "d17b2ce7208106156edfa70be7b63601", "score": "0.68204594", "text": "function digital_root(n) {\n while(n > 9) {\n n = n.toString().split('').reduce((a,b) => +a + +b);\n }\n return n;\n}", "title": "" }, { "docid": "7e15f84fe5c21aa64e9e942ceb0ffe08", "score": "0.6816997", "text": "function findDigits(n) {\n // we need to grab the input, which is a random integer, split it into individual integers, then check if each individual integer is a divisor of the initial input integer, \n // we do that by checking if the remainder of them is 0.\n let splitNum = n.toString().split('')\n let counter = 0\n\n for(let i = 0; i < splitNum.length; i++){\n if(n % splitNum[i] === 0){\n counter++\n }\n }\n return counter\n}", "title": "" }, { "docid": "0f9330dd5bfe19791ff4e76566fadde2", "score": "0.67641515", "text": "function sumDigits(num) {\n let sum = 0;\n num = Number(num);\n while (num !== 0) {\n let lastNumber = num % 10;\n sum += lastNumber;\n num = parseInt(num / 10);\n }\n console.log(sum);\n \n}", "title": "" }, { "docid": "a0e6c7dc1428a3544fb3358e389d4ec3", "score": "0.6740879", "text": "function main10(n) {\n let binary = \"\"\n let num = n\n \n while (num > 0) {\n binary = num % 2 + binary\n num = parseInt(num / 2)\n }\n \n const onesArray = binary.split(\"0\")\n \n let count = 0\n for (let i = 0; i < onesArray.length; i++) {\n const length = onesArray[i].length\n if (length > count) {\n count = length\n }\n }\n \n console.log(count)\n\n return \"Day 10: Binary Numbers\"\n }", "title": "" }, { "docid": "69c58e6e1415a9d266722f9cd863db0c", "score": "0.67383176", "text": "function sumOfDigits(num) {\n //Enter Code Here\n}", "title": "" }, { "docid": "47098f029f248e2574b168da8d35762e", "score": "0.67216444", "text": "function numLength(number) {\n return (number === 0) ? 1 : Math.ceil(Math.log10(number + 1));\n}", "title": "" }, { "docid": "3a894561cf12d8727d11eabec0a797f5", "score": "0.67078424", "text": "function main() {\n var t = parseInt(readLine());\n for (var a0 = 0; a0 < t; a0++) {\n var num = readLine();\n var digits = num.split('').map(function (n) {\n return Number(n)\n }).filter(function (n) {\n if (n != 0) {\n if (num % n == 0) {\n return n;\n }\n }\n });\n console.log(digits.length);\n }\n}", "title": "" }, { "docid": "87f2f959bca76288b4bb5207689cd2f1", "score": "0.6696238", "text": "function sumOfDigits(number) {\r\n\tlet sum = 0;\r\n\tlet strNum = String(number);\r\n\r\n\tfor (let elem of strNum) {\r\n\t\tsum += +elem;\r\n\t}\r\n\r\n\tif (sum > 9) {\r\n\t\treturn sumOfDigits(sum);\r\n\t}\r\n\r\n\treturn sum;\r\n}", "title": "" }, { "docid": "f27765168ea5f7598c1b082c29c4d138", "score": "0.66822", "text": "function getDigitCount(number) {\n return Math.max(Math.floor(Math.log10(Math.abs(number))), 0) + 1;\n}", "title": "" }, { "docid": "d76aebba477fa87804f65d4a21af05ef", "score": "0.66801745", "text": "function getNumDigits(num) {\n\t\tvar count = 1;\n\t\tnum = Math.abs(num);\n\t\tnum = parseInt(num/10);\n\t\twhile(num > 0) {\n\t\t\tcount++;\n\t\t\tnum = parseInt(num/10);\n\t\t}\n\t\treturn count;\n\t}", "title": "" }, { "docid": "b597cb003eb440c055763155bcc03ce0", "score": "0.66736245", "text": "function singleSumOfDigits(num) {\n while (num >= 10) {\n let sum = 0;\n for (let i = 0; i < String(num).length; i++) {\n sum += +String(num)[i]\n }\n num = sum;\n }\n return num;\n}", "title": "" }, { "docid": "14e58e775cafeb07d7edd88355ca6416", "score": "0.66707015", "text": "function nDigits(argument1, argument2) {\n //ENTER YOUR CODE HERE\n}", "title": "" }, { "docid": "22b03355ebb33c46612b0d99ea8d1931", "score": "0.66635084", "text": "function sumOfDigits(n) {\n\n var sum = 0;\n var lastDigit;\n var firstDigit = 0;\n\n if (typeof n != \"number\") {\n return -1;\n }\n if (n < 0) {\n n = -n;\n }\n\n lastDigit = n % 10;\n n = (n - lastDigit) / 10;\n\n while (n > 0) {\n firstDigit = n % 10;\n n = (n - firstDigit) / 10;\n }\n sum = (firstDigit + lastDigit);\n return sum;\n}", "title": "" }, { "docid": "354c6e14c1fd66dac5b379dfcf3603e9", "score": "0.6656506", "text": "function sumOfTheDigits(num){\n if(num < 10) return num;\n return sumOfTheDigits(calculateSum(num));\n }", "title": "" }, { "docid": "5f318bebc7427759f514219b6d29de1e", "score": "0.66472787", "text": "function getDigitCount( int ){\n return Math.floor( Math.log10( Math.abs( int ) ) ) + 1\n}", "title": "" }, { "docid": "9b0f19be819107fa22c0a3c95aad82b2", "score": "0.661298", "text": "function finddigit(n){\r\n var kk=n.toString()\r\n var count=0\r\n for(var i=0;i<kk.length;i++){\r\n if(n%kk[i]==0){\r\n count++\r\n }\r\n }\r\n return count\r\n }", "title": "" }, { "docid": "ec52ac365e3331b0a5535a23aa59544d", "score": "0.660156", "text": "function digital_root(n) {\n return ((n - 1) % 9) + 1\n}", "title": "" }, { "docid": "a9998e44b3e2c5451941eda95d21d0e6", "score": "0.6596324", "text": "function digital_root(n) {\n //loops until a single digit number is returned\n while (n >= 10){\n var n = n + ''; //puts the number to a string to split\n var numArr = n.toString().split(''); //splits individual numbers out\n var numArr = numArr.map(Number); //convers array elements back to numbers\n var n = numArr.reduce((a, b) => a + b, 0); //adds each array element together\n }\n return n; //returns the value\n}", "title": "" }, { "docid": "8ed37bd0bad1eeb749c9225583695b76", "score": "0.6577704", "text": "function digital_root(n) {\n let arr = ('' + n).split('');\n let count = arr[0];\n while (arr.length > 1) {\n count = arr.reduce((sum, item) => sum + Number(item), 0);\n arr = ('' + count).split('');\n }\n return Number(count);\n}", "title": "" }, { "docid": "8d6dcc2bc1a7c5fbe7a91ea6f188dd7d", "score": "0.65042996", "text": "function digitnPowers(n) {\n \n var init = parseInt(\"1\".repeat(n));\n var limit = parseInt(\"9\".repeat(n));\n if ( n >= 5 ) {\n init = 4000;\n limit = 199999;\n }\n //var limit = Math.pow(9,n);\n \n var temp;\n var sum = 0;\n var nList = [];\n for ( var i = init; i <= limit; i++ ) {\n \n var numToTest = i;\n temp = 0;\n if ( (\"\"+numToTest).indexOf(5) != -1 || \n (\"\"+numToTest).indexOf(6) != -1 || \n (\"\"+numToTest).indexOf(7) != -1 || \n (\"\"+numToTest).indexOf(8) != -1 || \n (\"\"+numToTest).indexOf(9) != -1 ) {\n\n while ( numToTest > 0 ) {\n temp = temp + Math.pow(numToTest % 10, n);\n numToTest = parseInt(numToTest / 10);\n }\n if ( temp == i ) {\n nList.push(i);\n sum = sum + i;\n }\n\n }\n \n }\n \n return sum;\n}", "title": "" }, { "docid": "bd5ba4b3e9fbb02249a96fc9cae7133f", "score": "0.6499003", "text": "function numberLen(num) {\n return num.toString().length;\n}", "title": "" }, { "docid": "d16b18b5994a2422dfb7976b977a6657", "score": "0.64892125", "text": "function numOfDigits(x) {\n var br = '';\n br += x;\n return br.length;\n\n}", "title": "" }, { "docid": "ce9f5184bf91561101158f35c0f2b2b3", "score": "0.6488412", "text": "function digitalSum(n) {\n var result = 0\n if(n <= 10) {\n return n;\n } else {\n while(n > 10) {\n result = result + n;\n n = digitalSum(n % 10);\n }\n return result;\n }\n}", "title": "" }, { "docid": "b5ce24f61e143c155e8225741bce6163", "score": "0.6475669", "text": "function digital_root(n) {\n return (n - 1) % 9 + 1;\n}", "title": "" }, { "docid": "851aa70cbca4e97dd032967c5e8c3c3d", "score": "0.6471762", "text": "function digital_root(n){\n let result = 0;\n n.toString().split('').map (n => {\n result += Number(n)\n })\n return result > 9 ? digital_root(result) : result;\n }", "title": "" }, { "docid": "cf32693738bf2998fab474b38f471bc5", "score": "0.64374334", "text": "function sumOfDigits(num) {\n let sum = 0;\n for(let digit of String(num)){\n sum += +digit;\n }\n if(sum < 10){\n return sum;\n } else {\n return sumOfDigits(sum);\n }\n}", "title": "" }, { "docid": "b8fa556a4c649c837cc6798d55dcf0b9", "score": "0.64371246", "text": "function findDigits(n) {\r\n // stringify the number so we can extract individual digits\r\n var stringN = n.toString();\r\n // Split the string into an array of individual digits\r\n var arrN = stringN.split(\"\");\r\n var digit = 0;\r\n var divisors = 0;\r\n\r\n // Iterate through the array of individual digits\r\n for (var i = 0; i < arrN.length; i++) {\r\n // Get the digit value from the character\r\n digit = Number(arrN[i]);\r\n // If the digit is not zero (can't mod by 0)\r\n if (digit != 0) {\r\n // get modulus of the number by the digit\r\n if ((n % digit) === 0) {\r\n // increment divisors if modulus is zero\r\n divisors += 1;\r\n }\r\n }\r\n }\r\n\r\n return divisors;\r\n\r\n}", "title": "" }, { "docid": "026d1533074f9aadb0acfc3e50a6aa7f", "score": "0.6425129", "text": "function decimalDigits(num, digits){\n\treturn (Math.floor(num * Math.pow(10, digits)))/Math.pow(10, digits);\n}", "title": "" }, { "docid": "47530f406755318e5853bf590593ef06", "score": "0.6405963", "text": "function digitalRootStep(num){\n let remainder = num % 10; // 2, 4, 7, 1 \n let whole = Math.floor(num / 10); // 4432, 443, 51, 5\n return remainder + whole;\n}", "title": "" }, { "docid": "3d7e961aca934370e4447f1f0a9efc04", "score": "0.6405417", "text": "function digitCount(v){\n var i, x;\n for (i = 1, x = 64; v >= x; i++, x <<= 6){ /* nothing */ }\n return i;\n}", "title": "" }, { "docid": "fa226af1651f5d317f611e76160d1b89", "score": "0.64047474", "text": "function testit(n) {\n return n.toString(2).replace(/0/g, '').length\n}", "title": "" }, { "docid": "461c51bdf9ee539794e2fa4b303dc7f5", "score": "0.6401757", "text": "function finalDigit (input) {\n //input = \"12345\";\n let result = _helper(input);\n //while loop >= 10\n while(result >= 10) {\n result = _helper(result.toString()) // convert number back to a string\n }\n return result;\n }", "title": "" }, { "docid": "2ea04d25e7a726b70e0eeb189b75d19f", "score": "0.63713956", "text": "function returnTensDigit(num) {\n return Number(String(num) [String(num).length - 2]);\n // const l = Math.pow(10, Math.floor(Math.log(num)/Math.log(10)) - 1);\n // const b = Math.floor(num/l);\n // return b - Math.floor(b/10)*10;\n}", "title": "" }, { "docid": "208b8f5ecbb775941b01effae7f8e702", "score": "0.6368878", "text": "function tiempodosdigitos(num){\r\n if(num<10){num = \"0\" + num;}\r\n return num;\r\n}", "title": "" }, { "docid": "ab46a0df45cdca9cd32efd1db3c9b5eb", "score": "0.6338629", "text": "function sumOfDigits(number, sum = 0){\r\n let str = String(number);\r\n for(let i = 0; i < str.length; i++){\r\n let lastDigit = number % 10;\r\n number = (number - lastDigit) / 10;\r\n sum += lastDigit;\r\n }\r\n if(sum > 9){\r\n return sumOfDigits(sum)\r\n }\r\n return sum;\r\n}", "title": "" }, { "docid": "4c5c9c217ec95773c4ae80a18095d236", "score": "0.6332342", "text": "function sumOfDigits(num){\n var num = num.toString();\n var sum = 0;\n for (var i = 0; i < num.length; i++){\n console.log(num[i], ' is num[i]');\n sum += parseInt(num[i]);\n }\n return sum;\n}", "title": "" }, { "docid": "276d8bd0e4c584ce13395b30f5c68a2d", "score": "0.63264376", "text": "function digital_root(n) {\n var sumOfNums = 0;\n var arrOfNums = n.toString().split(\"\").map(function(str) { \n return parseInt(str); \n });\n while (arrOfNums.length > 1) {\n sumOfNums = arrOfNums.reduce(function(a, b) {\n return a + b;\n });\n arrOfNums = sumOfNums.toString().split(\"\").map(function(str) { \n return parseInt(str);\n });\n }\n return sumOfNums;\n}", "title": "" }, { "docid": "56e4d3c0d3cce5df851e25c155f4a946", "score": "0.63237906", "text": "function lengthOfNumber(number) {\n if (isNumber(number)) {\n var length_1 = 0;\n while (number > 0) {\n length_1++;\n number = backIntegerOfNumber(number / 10);\n }\n return length_1;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "d5de8d26c42adc020f0da20f927448c2", "score": "0.62982816", "text": "function sum(number){\r\n function multiplier(number){\r\n let multiplier = 1;\r\n while(number !== 0){\r\n multiplier *= 10;\r\n number = Math.floor(number / 10);\r\n }\r\n return multiplier;\r\n }\r\n let initialNumber = number;\r\n let prod = multiplier(number);\r\n let result = number;\r\n for( i = 0; i < 2; i++){\r\n number = number * prod + initialNumber;\r\n result += number;\r\n }\r\n console.log(result);\r\n}", "title": "" }, { "docid": "a340e8b69b8f46007a96dd2b2af7ba24", "score": "0.6277623", "text": "function nbDig(n, d) {\r\n let str = '';\r\n for (let i = 0; i <= n; i++) {\r\n str += i * i;\r\n }\r\n const re = new RegExp(d,\"g\");\r\n return str.match(re).length;\r\n}", "title": "" }, { "docid": "7875b29d494f5846f70489bc01f6fc27", "score": "0.62731", "text": "function productDigits(num) {\n let values = []; //array to store numbers that multiplied together equal num\n for (let i = num - 1; i >= 0; i-=1) { //for loop decrementing starting at num - 1\n if(num % i === 0){ //enter only if the reminder of num being divided by i equals zero\n let divide = num/i; //find number that when multiplied with i equals num \n values.push(i.toString() + divide.toString())//push i and divide to array after converting to Strings\n }\n }\n let sorted = values.sort((a,b) => a - b); //sort array ascending \n return values[0].length;//return the length of the smallest num in array \n}", "title": "" }, { "docid": "b36366587df7c3edcab7f7b36335ba6e", "score": "0.62725145", "text": "function repdigit (num){\nlet ones = num % 10;\nlet tens = Math.floor(num / 10);\n if (ones === tens) {\n return 'Repdigit!';\n }\n return 'No Repdigit!';\n\n}", "title": "" }, { "docid": "766a42889039d4e7c46daadf5f94b52f", "score": "0.6260921", "text": "function sumDigits(num) {\n let strNum = num.toString();\n let digits = strNum.split(\"\");\n let sumOfDigits = 0;\n for(let i = 0; i < digits.length; i++) {\n sumOfDigits += parseInt(digits[i], 10);\n }\n return sumOfDigits;\n}", "title": "" }, { "docid": "0ae00041f331a8f2a0ae66adb95bd595", "score": "0.6246865", "text": "function timesTen(number) {\n var result = number * 10;\n return result;\n}", "title": "" }, { "docid": "7c13fd5642eff99218da0d0920027eae", "score": "0.6246414", "text": "function sumDigits(number) {\n return Math.abs(number)\n .toString()\n .split(\"\")\n .map(Number)\n .reduce((a, b) => a + b);\n}", "title": "" }, { "docid": "4cfba1c8487146fefd5d5fb6a7df7376", "score": "0.6239879", "text": "function digitSum(num) {\n var numArr = num.toString().split('');\n\n return numArr.reduce((acc, currVal) => {\n acc += parseInt(currVal);\n return acc;\n }, 0);\n}", "title": "" }, { "docid": "09eb925d018e8052e2c787fce28cbfbe", "score": "0.62009114", "text": "function sum(x) {\n let count = 0;\n while(x > 0){\n count += parseInt(x % 10);\n x = parseInt(x / 10);\n }\n return count;\n}", "title": "" }, { "docid": "fdde234c468584d48f75c938ef65f142", "score": "0.619932", "text": "function sum(digits) {\n var sum = 0;\n digits.forEach(function(d){ sum += d; });\n return sum;\n}", "title": "" }, { "docid": "27c07ef4c76f8d537495fea52b4cc785", "score": "0.6196044", "text": "function digitalRoot(num) {\n while (num > 10) {\n num = digitalRootStep(num);\n }\n\n return num;\n}", "title": "" }, { "docid": "75104e1b4c20d8628f1cbafe7f7b999c", "score": "0.61804575", "text": "function firstSum(){\r\n\tlet n = prompt(\"Enter Number\");\r\n\tfunction sumIt(){\r\n\t\tlet sum = 0;\r\n\t\twhile(n){\r\n\t\t\tsum += (n % 10);\r\n\t\t\tn = Math.floor(n/10);\r\n\t\t}\r\n\t\tdocument.write(\"Test Case\" + \" \" + i + \":\" + \" \");\r\n\t\tdocument.write(sum + \"<br>\");\r\n\t}\r\n\tsumIt();\r\n}", "title": "" }, { "docid": "ab383504160b89b339c88529430be59c", "score": "0.61668235", "text": "function lets_Count_To_Ten(numbers){\n\n let n = 1;\n while (n <10) \n console.log(n);\n n++;\n if (n === 10) break;\n \n\n}", "title": "" }, { "docid": "801e87467ad6b472d43071b753be52d4", "score": "0.61547834", "text": "function digitalRoot(num) {\n while (num > 10) {\n num = digital_root_step(num);\n }\n return num;\n}", "title": "" }, { "docid": "5e3f5571fba7fe8606e564637b5cb321", "score": "0.61522985", "text": "function numberOfDigits(number, decimals) {\n if (decimals === undefined) decimals = 3;\n return number.toFixed(decimals).toString().length;\n}", "title": "" }, { "docid": "0d1b2fac30d9c3a2d6eb8822245acf97", "score": "0.61504227", "text": "function sumDigits(number) {\n let results = 0;\n\n number = [...number.toString()]\n .filter(x => Number(x))\n .map(x => (results += Number(x)));\n\n return results;\n}", "title": "" }, { "docid": "508787993a7cb780387eadbdd4f96eca", "score": "0.61491877", "text": "function qfs_determineModulo10RekursivCheckDigit(number) {\n\t// The string number should contain only digits\n\n\tvar table = new Array(0, 9, 4, 6, 8, 2, 7, 1, 3, 5);\n\tvar carry = 0;\n\n\tfor (var i=0; i < number.length; i++) {\n\t\tcarry = table[(carry + parseFloat(number.charAt(i) - '0')) % 10];\n\t}\n \n\treturn (10 - carry) % 10;\n}", "title": "" }, { "docid": "73fa95079599dc433dacf639f613dbac", "score": "0.61357635", "text": "function digitsNumber(x) {\n\t\tvar digits = [];\n\t\tvar xString = x + '';\n\t\tvar digit;\n\t\tfor (var i = 0, length = xString.length; i < length; i++) {\n\t\t\tcounter++;\n\t\t\tdigit = xString.substr(i, 1);\n\t\t\tif (digits.indexOf(digit) === -1) {\n\t\t\t\tdigits.push(digit);\n\t\t\t}\n\t\t}\n\n\t\treturn digits.length;\n\t}", "title": "" }, { "docid": "f2bef270d3e21d87694196671ea363ba", "score": "0.6134664", "text": "function digitalRoot(n) {\n \n let arr = (\"\"+n).split('').reduce((c, currentValue) => c += parseInt(currentValue), 0)\n \n if(arr >= 10){\n return digitalRoot(arr)\n }\n return arr\n}", "title": "" }, { "docid": "949905288634e9efb8964d0538465982", "score": "0.6133485", "text": "function persistence(num) {\n var arr = num ;\n var count = 0;\n while(arr>=9){\n arr= arr.toString().split('').reduce(function a (total, curr) { \n return (total * curr); }, 1);\n count ++;\n }\n return count;\n}", "title": "" }, { "docid": "8b1e29ed7f65de5bf231aa42902fc72b", "score": "0.6126487", "text": "function digital_root(n) {\n let sum = n\n let arr = []\n let reducer = (a,b) => parseInt(a) + parseInt(b) //parse will pull the digits out of the string\n \n while (sum > 9) { // Using a 'while' loop to run code until the sum is less than 9\n arr = sum.toString().split(\"\") // Creating an array of individual digits in our sum \n sum = arr.reduce(reducer) // Adding up our strings to make a new sum\n }\n return sum\n}", "title": "" }, { "docid": "80398097a26eb6024161fe32b18416d5", "score": "0.61164474", "text": "function digitalSum(n) {\n // TODO: your code here\n if (n=== 0){\n \treturn 0;\n }\n return n %10 +(digitalSum(Math.floor(n/10)));\n}", "title": "" }, { "docid": "55145108bc3ab29ecbd2fc1d416d6159", "score": "0.61126375", "text": "function mostDigits(nums){\n let maxDigit = 0\n for(let i = 0; i < nums.length; i++){\n maxDigit = Math.max(maxDigit, digitCount(nums[i]))\n }\n return maxDigit\n }", "title": "" }, { "docid": "cde2aa659c69705901ef69fbc30abc52", "score": "0.610927", "text": "function squareDigits(num){\n var nums = num.toString()\n var result = ''\n\n for(var i = 0; i < nums.length; i++){\n result += Math.pow(Number(nums[i]), 2)\n }\n \n return Number(result)\n}", "title": "" }, { "docid": "a42f83779cc16ee395aab756b302c004", "score": "0.60937774", "text": "function getMaxDigits(nums){\n let max = 0;\n for(let i = 0; i < nums.length; i++) {\n if(nums[i] > max) max = nums[i];\n }\n return getIntLength(max);\n}", "title": "" }, { "docid": "8f90a3ea4346f05fc886cc2d836a9675", "score": "0.6079824", "text": "function digitize(n) {\n return String(n).split('').map(Number);\n}", "title": "" }, { "docid": "ce3df907bdf17fb8e00621a8fa54d51d", "score": "0.6074417", "text": "function sumDigits(){\n var digits = prompt();\n var digitArray = [];\n var digitToString = digits.toString();\n var sum = 0;\n for (var i=0; i<digitToString.length; i++){\n sum += Number(digitToString[i]); \n }\n return sum\n}", "title": "" }, { "docid": "427d9c4004ff17aab79bafbd0b45303a", "score": "0.607224", "text": "function numbers (n){\nvar result = '1'\nvar i = 2\nwhile (i <= n){\n var repete = i\n\tresult = result + repete + i\ni++\n}\nreturn result\n}", "title": "" }, { "docid": "addd7735851b36739222fa13f2b0eca0", "score": "0.60721767", "text": "function factorialSum(number) {\n let result = sumOfDigits(factorial(number));\n console.log(result);\n return result;\n}", "title": "" }, { "docid": "f95d232ffce3af471e0a371b807730f6", "score": "0.6068614", "text": "function sumToOne(num) {\n let res = 0\n while(num) {\n\t let last = num % 10 //1\n \tres+=last // \n\t num = Math.floor(num / 10) //1\n }\n if (res < 10) return res \n return sumToOne(res)\n}", "title": "" }, { "docid": "e8b669727568fa93f5ec10b7336db803", "score": "0.6067729", "text": "function digital_root(n) {\n const sum = (n + \"\").split(\"\").reduce((a, b) => Number(a) + Number(b), 0);\n return sum >= 10 ? digital_root(sum) : sum;\n}", "title": "" }, { "docid": "114d0d02cb9d21d70ba479ee57a65492", "score": "0.60607916", "text": "function digitCubesSum(number) {\n\tlet digitCubesSum = 0;\n\tfor (let i = number; i > 0; i = Math.floor(i / 10)) {\n\t\tdigitCubesSum += Math.pow(i % 10, 3);\n\t}\n\treturn digitCubesSum;\n}", "title": "" } ]
6c7994516373df674db04249ea39bf03
To check whether the entered value is in the given json.
[ { "docid": "42d682c008a4d95e93ea530e8a011cbc", "score": "0.57073194", "text": "function fnCheckValidData(id, jsonData, name, msgStr) {\n var value = $(id).val();\n if (jsonData != null) {\n if (value != \"\") {\n var selectedValue = jsonPath(jsonData, \"$.Data[?(@.\" + name + \"=='\" + value + \"')]\");\n if (!(selectedValue.length > 0)) {\n fnMsgAlert(value + ' is invalid ' + msgStr + '.');\n $(id).val('');\n fnErrorIndicator(id);\n return false;\n }\n else {\n fnRemoveErrorIndicatior(id);\n return true;\n }\n }\n }\n else {\n return true;\n }\n}", "title": "" } ]
[ { "docid": "71ee67612f1e27a93ae9479b57567463", "score": "0.74577457", "text": "function _containsValue(json, value) {\n for (k in json) {\n if (typeof json[k] === 'object') {\n if (_containsValue(json[k], value)) {\n return true;\n }\n } else if (typeof json[k] === 'string' && json[k].toLowerCase().indexOf(value) > -1) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3bf829346c90365e4f0a8f33eff1aa84", "score": "0.68535525", "text": "function jsonIncludes(json, value) {\n if (json == null || value === undefined || ts_types_1.isNumber(json) || ts_types_1.isBoolean(json))\n return false;\n if (ts_types_1.isJsonMap(json))\n return Object.values(json).includes(value);\n if (ts_types_1.isJsonArray(json))\n return json.includes(value);\n if (ts_types_1.isString(value))\n return json.includes(value);\n return false;\n}", "title": "" }, { "docid": "19b12ac003f1819edb0e471f24df9e6d", "score": "0.66327804", "text": "function validateJSONValue( value ){\n try {\n var jsonObj = JSON.parse( value );\n if ($.type( jsonObj ) == 'object')\n return true;\n }\n catch (e) {\n return false;\n }\n return false;\n }", "title": "" }, { "docid": "5c4423358db0da7f6ea95dc8facb09e5", "score": "0.6593303", "text": "function keyCheck(jsonObj,key)\r\n{\r\n for(var i=0;i<jsonObj.students.length;i++)\r\n {\r\n if(jsonObj.students[i].key==key)\r\n {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "5f8643f07d9109dbdd67f137ae1d72a1", "score": "0.6414577", "text": "static verifyJSON(jsonEntry) {\n let isOK = typeof jsonEntry.name === \"string\" &&\n jsonEntry.name.length > 0 &&\n (jsonEntry.altNames === undefined || Array.isArray(jsonEntry.altNames)) &&\n (jsonEntry.stackMode === undefined ||\n jsonEntry.stackMode === \"yes\" ||\n jsonEntry.stackMode === \"no\" ||\n jsonEntry.stackMode === \"parent\") &&\n (jsonEntry.visible === undefined || typeof jsonEntry.visible === \"boolean\") &&\n (jsonEntry.priority === undefined || typeof jsonEntry.priority === \"number\") &&\n (jsonEntry.iconMinLevel === undefined || typeof jsonEntry.iconMinLevel === \"number\") &&\n (jsonEntry.iconMaxLevel === undefined || typeof jsonEntry.iconMaxLevel === \"number\") &&\n (jsonEntry.textMinLevel === undefined || typeof jsonEntry.textMinLevel === \"number\") &&\n (jsonEntry.textMaxLevel === undefined || typeof jsonEntry.textMaxLevel === \"number\");\n if (isOK && jsonEntry.altNames !== undefined) {\n const altNames = jsonEntry.altNames;\n // eslint-disable-next-line @typescript-eslint/no-for-in-array\n for (const str in altNames) {\n if (typeof str !== \"string\") {\n isOK = false;\n break;\n }\n }\n }\n return isOK;\n }", "title": "" }, { "docid": "0769d0f75fa70917e1ad02c7f98caa81", "score": "0.6385293", "text": "static verifyJSON(jsonEntry) {\n let isOK = typeof jsonEntry.name === \"string\" &&\n jsonEntry.name.length > 0 &&\n (jsonEntry.altNames === undefined || Array.isArray(jsonEntry.altNames)) &&\n (jsonEntry.stackMode === undefined ||\n jsonEntry.stackMode === \"yes\" ||\n jsonEntry.stackMode === \"no\" ||\n jsonEntry.stackMode === \"parent\") &&\n (jsonEntry.visible === undefined || typeof jsonEntry.visible === \"boolean\") &&\n (jsonEntry.priority === undefined || typeof jsonEntry.priority === \"number\") &&\n (jsonEntry.iconMinLevel === undefined || typeof jsonEntry.iconMinLevel === \"number\") &&\n (jsonEntry.iconMaxLevel === undefined || typeof jsonEntry.iconMaxLevel === \"number\") &&\n (jsonEntry.textMinLevel === undefined || typeof jsonEntry.textMinLevel === \"number\") &&\n (jsonEntry.textMaxLevel === undefined || typeof jsonEntry.textMaxLevel === \"number\");\n if (isOK && jsonEntry.altNames !== undefined) {\n const altNames = jsonEntry.altNames;\n for (const str in altNames) {\n if (typeof str !== \"string\") {\n isOK = false;\n break;\n }\n }\n }\n return isOK;\n }", "title": "" }, { "docid": "0197ae83117d448d849790deb1e8fb87", "score": "0.62604916", "text": "function _checkInputValue(type, value) {\n var _result = true;\n switch(type) {\n case \"object\":\n var _obj;\n try {\n _obj = JSON.parse(value);\n if( typeof _obj == 'number' || Array.isArray(_obj) ) {\n _result = false;\n }\n }\n catch(err) {\n _result = false;\n }\n\n break;\n default: \n printConsoleWarning(\"_checkInputValue\", \"Type \" + _prefData.type + \" is not managed\");\n }\n return _result;\n }", "title": "" }, { "docid": "eaa4032246cf251dc37e7f707c4cf850", "score": "0.62557966", "text": "function check_text_inside_json_list(search_query, json_list){\n\n let record_found = false\n for(var count=0; count< json_list.length; count++){\n if(json_list[count]['title'].toLowerCase().includes(search_query)){\n record_found = true\n break;\n }\n }\n\n return record_found;\n }", "title": "" }, { "docid": "2ba1f15ad39c68472127377d8c180b21", "score": "0.6215311", "text": "function contains(val,obj){\n let nestedObj = Object.keys(obj);\n while(nestedObj.length === 1 && obj[nestedObj[0]]){\n if(nestedObj[0] == val)return true;\n obj = obj[nestedObj[0]]\n nestedObj = Object.keys(obj)\n }\n for(let key in obj){\n if(obj[key] == val) return true\n }\n return false;\n}", "title": "" }, { "docid": "a1ec69f35f745364bf793b5226e1fc1e", "score": "0.60574466", "text": "function checkJSONExpression(expression, json) {\n if (! (expression && json)) {\n return false;\n }\n\n // array expressions never match non-arrays or arrays of a different length.\n if (_.isArray(expression) && !(_.isArray(json) && expression.length === json.length)) {\n return false;\n }\n\n return _.all(expression, function(v, k) {\n\n // check \"$\" properties\n if (k === \"$not\") return (! checkJSONExpression(v, json));\n if (k === \"$unordered\") {\n return v.length === json.length && arrayContains(json, v);\n }\n if (k === \"$contains\") {\n return arrayContains(json, v);\n }\n if (k === \"$length\" ) return(v === json.length);\n if (k === \"$gt\") return (json > v);\n if (k === \"$gte\") return (json >= v);\n if (k === \"$lt\") return (json < v);\n if (k === \"$lte\") return (json <= v);\n\n // check $not-exists\n if (! _.has(json, k)) return (v === \"$not-exists\");\n\n // check rest of \"$\" values.\n if (v === \"$exists\") return _.has(json, k);\n if (v === \"$string\") return _.isString(json[k]);\n if (_.isRegExp(v)) return v.test(json[k]);\n if (_.isObject(v)) return checkJSONExpression(v, json[k]);\n if (v === \"$date\") {\n try {\n new Date(json[k]);\n return true;\n } catch (e) {\n return false;\n }\n }\n if (v === \"$int\") {\n //http://stackoverflow.com/questions/3885817/how-to-check-if-a-number-is-float-or-integer\n return (typeof json[k] === 'number' && json[k] % 1 === 0);\n }\n\n // check a strict equals\n return (v === json[k]);\n });\n}", "title": "" }, { "docid": "c556ed45ba76e6d0010ac4692b4d64fc", "score": "0.6024142", "text": "function isValueFormAvailable(obj) {\n // check value property object data\n valueIsEmptyDeleted(obj);\n\n // daftar key yang ada di data.\n const keyData = [\"npm\", \"nama\", \"email\", \"universitas\", \"jurusan\", \"ipk\"];\n\n // di cek apakah propertynya lengkap.\n let result = false;\n for (let i = 0; i < keyData.length; i++) {\n result = obj.hasOwnProperty(keyData[i]);\n if (!result) {\n break;\n }\n }\n\n // hasil cek property objek.\n return result;\n}", "title": "" }, { "docid": "717ce629a359311e04e04260423a1b6f", "score": "0.5999026", "text": "function contains (val, search) {\n /* jshint eqeqeq: false */\n if (utils.isObject(val)) {\n for (var key in val) {\n if (contains(val[key], search)) {\n return true\n }\n }\n } else if (val != null) {\n return val.toString().toLowerCase().indexOf(search) > -1\n }\n}", "title": "" }, { "docid": "e6f0e3b7cd124a7c4968f187f4ecf1df", "score": "0.59475034", "text": "_matchJSONPath() {\n const currentPath = this.getJsonPath();\n // console.debug(`Testing JSONPath`, currentPath);\n\n // Backwards compatibility, match any array\n // TODO implement using wildcard once that is supported\n if (this.jsonPaths.length === 0) {\n return true;\n }\n\n for (const jsonPath of this.jsonPaths) {\n if (jsonPath.equals(currentPath)) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "d0f1f2b08d119464f0d19d71cfa0c26c", "score": "0.5945801", "text": "contains(value) {\n \n }", "title": "" }, { "docid": "05b4f59c16d727212850f0a1547d7915", "score": "0.57751137", "text": "function validateJSON(data){\n if(typeof data === 'string'){\n try {\n JSON.parse(data);\n } catch (e) {\n return false;\n }\n return true;\n }else if(typeof data === 'object'){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "0cdfabc4d55623dff5331a7fd8e2ed9a", "score": "0.57373124", "text": "function hasItem(data, key, val) {\n var retVal = false;\n\n _.each(data, function (item) {\n if(item[key] === val) {\n retVal = true;\n }\n });\n\n return retVal;\n }", "title": "" }, { "docid": "15abab0a655a6e0dd6f9647767136fd3", "score": "0.56767803", "text": "function contains(form, field, value)\n {\n // Get value of field that we are checking against\n var field_value = get_value(form, field);\n\n // Will check subscring in string and whole array value in array (for select fields)\n if (field_value !== null && field_value.indexOf(value) > -1) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "aaea646c50b5fcd7b8b2ce8bc09c670e", "score": "0.5671242", "text": "search(value, search)\n\t{\n\t\tif (search.operator === \"equals\")\n\t\t{\n\t\t\tfor (let item of value)\n\t\t\t{\n\t\t\t\tif (item.key === search.value)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "title": "" }, { "docid": "424c91aea218f086cfd07dfd5be12c5d", "score": "0.562633", "text": "function isJSON(json)\r\n{\r\n\tvar str = json.replace(/\\\\./g, '@').replace(/\"[^\"\\\\\\n\\r]*\"/g, '');\r\n\treturn (/^[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]*$/).test(str);\r\n}", "title": "" }, { "docid": "9c0dddb1aac5dda6e190f88749381bdd", "score": "0.5604635", "text": "function isJSON(j) { }", "title": "" }, { "docid": "aea1523b0e0f77535956fa6f29057f46", "score": "0.5557556", "text": "is_value_flag(flag, obj) {\n if (!pl.type.is_flag(flag)) return false;\n for (const value in pl.flag[flag.id].allowed) {\n if (!pl.flag[flag.id].allowed.hasOwnProperty(value)) continue;\n if (pl.flag[flag.id].allowed[value].equals(obj)) return true;\n }\n return false;\n }", "title": "" }, { "docid": "78ec94f563185ef0b8f289b9c85ce096", "score": "0.5516773", "text": "static validateValue(input, expected){ \n return(expected.includes(input));\n }", "title": "" }, { "docid": "4a6264911d7dd4fc180eb167060c50fa", "score": "0.551343", "text": "function includes (data, value) {\n\t var iterator, iteration;\n\n\t if (not.assigned(data)) {\n\t return false;\n\t }\n\n\t try {\n\t if (typeof Symbol !== 'undefined' && data[Symbol.iterator] && isFunction(data.values)) {\n\t iterator = data.values();\n\n\t do {\n\t iteration = iterator.next();\n\n\t if (iteration.value === value) {\n\t return true;\n\t }\n\t } while (! iteration.done);\n\n\t return false;\n\t }\n\n\t Object.keys(data).forEach(function (key) {\n\t if (data[key] === value) {\n\t throw 0;\n\t }\n\t });\n\t } catch (ignore) {\n\t return true;\n\t }\n\n\t return false;\n\t }", "title": "" }, { "docid": "632ebd2de6b7027a88a0a0cc4ec44cee", "score": "0.54629266", "text": "validateInput(data, callback) {\n let value = this.getValueFromData(data);\n let result = false;\n if (value === undefined || value === null || value === '') {\n result = true;\n }\n else {\n if (this.many) {\n if (!Array.isArray(value) && typeof value === 'string' && value.length) {\n value = [value];\n }\n if (Array.isArray(value)) {\n result = true;\n }\n }\n else {\n if (typeof value === 'string' && value.length) {\n result = true;\n }\n if (typeof value === 'object' && value.id) {\n result = true;\n }\n }\n }\n utils.defer(callback, result);\n }", "title": "" }, { "docid": "61e7931c5131d16f71bdd02a7221d4d3", "score": "0.54536694", "text": "function keyExists(value, obj) {\n // Get all the keys from the database object\n let keyList = Object.keys(obj);\n for (let i = 0; i < keyList.length; i++) {\n if (value.toLowerCase() === keyList[i].toLowerCase()) {\n return keyList[i];\n }\n }\n return false;\n }", "title": "" }, { "docid": "83c78b192c827fb8dd92028da20264bd", "score": "0.5451233", "text": "function checkResponse(response, valueEntered) {\n\t\t\treturn response.some(function (n) {\n\t\t\t\treturn n.toLowerCase() === valueEntered.toLowerCase();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "29d290ff30112cc78b7a197f3e38b426", "score": "0.54389626", "text": "validateJson(jsonData) {\n return jsonData.filter(json => json.uid && json.platform);\n }", "title": "" }, { "docid": "22f73e235c3b378d084aaf7b63020ffe", "score": "0.54353213", "text": "function isHit(query, value) {\n if (Array.isArray(query)) {\n return query.includes(value)\n }\n\n return query === value\n}", "title": "" }, { "docid": "222b6e618127421b631b8a5ace7c11fd", "score": "0.54277503", "text": "function contains_key(obj, val) {\n if(obj.hasOwnProperty(val))\n return true;\n return false;\n}", "title": "" }, { "docid": "d9b1e8a06b6576fdef3bef5214bb9275", "score": "0.5424326", "text": "function looksLikeJsonObject(input) {\n return (\n typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(\n input instanceof\n __WEBPACK_IMPORTED_MODULE_14__geo_point__['a' /* GeoPoint */]\n ) &&\n !(\n input instanceof\n __WEBPACK_IMPORTED_MODULE_11__blob__['b' /* Blob */]\n ) &&\n !(input instanceof DocumentKeyReference) &&\n !(\n input instanceof\n __WEBPACK_IMPORTED_MODULE_13__field_value__[\n 'c' /* FieldValueImpl */\n ]\n )\n );\n }", "title": "" }, { "docid": "149344b67deb90369b2cef9270048012", "score": "0.54163647", "text": "function IsuserValid(auth_id_value){\n fs.readFile(\"MainAuth.JSON\", \"utf-8\", (err, data) => { \n const tempdata = JSON.parse(data);\n var temp_allowed = false;\n for(var item in tempdata){\n if(tempdata[item].auth_id == auth_id_value){\n return (true);\n break;\n temp_allowed = true;\n console.log(\"true user\")\n \n }\n }\n if(temp_allowed==false){return (false); console.log(\"wrong user\")};\n });\n \n }", "title": "" }, { "docid": "0f534d98f3707b21f5f62aa957b262f5", "score": "0.5387611", "text": "function _has_value(obj)\n {\n for (var i=1, stop=arguments.length; i<stop; ++i)\n {\n var name = arguments[i];\n if (!(name in obj) || obj[name]===null)\n return false;\n obj = obj[name];\n }\n return true;\n }", "title": "" }, { "docid": "17f57f2d198a09f406912eb32125c062", "score": "0.53747696", "text": "function isFriend(name, object) {\n // if name is included in the friends key the return true\n // else return false\n // edge case: check if there is a friends key\n console.log(object);\n if(Array.isArray(object.friends) && object.friends.includes(name)){\n return true;\n } else {\n return false;\n }\n\n}", "title": "" }, { "docid": "0df88fd88ac3fa5947b670e61cd80511", "score": "0.534137", "text": "async function HasValue(nameVal, optValue)\n{\n\tvar vals = await GM.listValues();\n\n\tif (vals.length === 0)\n\t{\n\t\tif (optValue !== undefined)\n\t\t{\n\t\t\tGM.setValue(nameVal, optValue);\n\t\t\treturn true;\n\t\t} else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (typeof nameVal !== \"string\")\n\t{\n\t\treturn alert(\"name of value: '\" + nameVal + \"' are not string\");\n\t}\n\n\tfor (let i = 0; i < vals.length; i++)\n\t{\n\t\tif (vals[i] === nameVal)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tif (optValue !== undefined)\n\t{\n\t\tGM.setValue(nameVal, optValue);\n\t\treturn true;\n\t} else\n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "035ea612171e4ddbb87cfa4f8f0b782f", "score": "0.53391194", "text": "function IsJsonValid(text) {\n\n\t try { JSON.parse(text); }\n\t catch (e) { return false; }\n\t return true;\n\n\t}", "title": "" }, { "docid": "1c86b1fa9710cf1a3e75be6155cb1621", "score": "0.5314269", "text": "has(val) {\n if(this.values.indexOf(val)!==-1) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "0aef729683c7119bbe5da026b08b3137", "score": "0.53094983", "text": "function isJSON (data) \n{\n try \n {\n JSON.parse(data); \n }catch(e) \n {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "4cb68dfb5132334bcb0e685d7ad78450", "score": "0.5304643", "text": "is(value) {\n return this.values.indexOf(value) !== -1\n }", "title": "" }, { "docid": "ec29d04d8d542a0cc837378f04b5b5bc", "score": "0.5273899", "text": "function contains(a, obj) {\n var l = a.replace(\"[\", \"\").replace(\"]\", \"\").split(\", \");\n var i = l.length;\n while (i--) {\n if (l[i] === obj) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "8457542dd23e53a31a67a722297f7391", "score": "0.52724755", "text": "function looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Blob) &&\r\n !(input instanceof DocumentKeyReference) &&\r\n !(input instanceof FieldValueImpl));\r\n}", "title": "" }, { "docid": "8457542dd23e53a31a67a722297f7391", "score": "0.52724755", "text": "function looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Blob) &&\r\n !(input instanceof DocumentKeyReference) &&\r\n !(input instanceof FieldValueImpl));\r\n}", "title": "" }, { "docid": "bae3de0a9d077b124fca28b90de46ba4", "score": "0.5265009", "text": "search(value, search)\n\t{\n\t\tif (search.operator === \"equals\")\n\t\t{\n\t\t\tif (value === null)\n\t\t\t\treturn search.value === null;\n\t\t\telse\n\t\t\t\treturn value.key === search.value;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "title": "" }, { "docid": "8db2acf5c000213b3acb0bbcd70a2f46", "score": "0.52540064", "text": "function checkKeyValuesByName (mds, keyName, regex) {\n var found = false;\n for (var item in mds) {\n // check if the key has a value or points to an object\n if (typeof (mds[item]) === \"object\") {\n // if value is an object call recursively the function to search this subset of the object\n found = checkKeyValuesByName(mds[item], keyName, regex);\n } else {\n // check if the key match expected regex\n if (item === keyName ) {\n if (! mds[item].match(regex)) {\n return false;\n }\n return true;\n }\n }\n }\n return found;\n}", "title": "" }, { "docid": "b23fba8673e6cc3e0691d15ec9f80008", "score": "0.5250624", "text": "function containsObject(obj, list) {\n var i;\n for (i = 0; i < list.length; i++) {\n if (list[i] === obj) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "37ba12593dc00a82b36513cfd2ad9203", "score": "0.5248558", "text": "function is(value) {\n\t\t\tvar candidate = value;\n\t\t\treturn Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n\t\t}", "title": "" }, { "docid": "3e08ec77a297e12100e1797267c56c89", "score": "0.5248244", "text": "function checkValue(value,arr){\n var status = false; \n for(var i=0; i<arr.length; i++){\n var name = arr[i];\n if(name.categoryId == value.categoryId){\n status = true;\n index=i;\n break;\n }\n }\n return status;\n }", "title": "" }, { "docid": "26e926983ca8a1df3a6c6e1279be545d", "score": "0.52439225", "text": "function searchArrayObject(value, data){\n for (var i=0; i < data.length; i++) {\n if (data[i].value == value) {\n return data[i];\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "d0ea912711dca3690133c26ccffcdc13", "score": "0.5240605", "text": "hasValue(data) {\n return _.has(data || this.data, this.key);\n }", "title": "" }, { "docid": "bca03a16c9866de4638a6445ce9c2015", "score": "0.5240053", "text": "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof Timestamp) &&\n !(input instanceof GeoPoint) &&\n !(input instanceof Blob) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof FieldValueImpl));\n}", "title": "" }, { "docid": "bca03a16c9866de4638a6445ce9c2015", "score": "0.5240053", "text": "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof Timestamp) &&\n !(input instanceof GeoPoint) &&\n !(input instanceof Blob) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof FieldValueImpl));\n}", "title": "" }, { "docid": "f5843cbff086a23d6bbbc8cdd8761544", "score": "0.52395475", "text": "async function isJSON(strURL) {\n try {\n const testJSON = await new Request(strURL).loadJSON();\n if (testJSON.reason == \"Not Found\") {return false;}\n } catch(err) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "5df4320ee8c5bfbd635936c202ae799e", "score": "0.52340966", "text": "function looksLikeJsonObject(input) {\n return typeof input === 'object' && input !== null && !(input instanceof Array) && !(input instanceof Date) && !(input instanceof Timestamp) && !(input instanceof GeoPoint) && !(input instanceof Blob) && !(input instanceof DocumentKeyReference) && !(input instanceof FieldValueImpl);\n}", "title": "" }, { "docid": "4f6ae3818acdef5deaec43e884517205", "score": "0.52243084", "text": "function contains(arrOrObj, num) {\n\tfor(var key in arrOrObj)\n\t\tif (arrOrObj.hasOwnProperty(key)) {\n\t\t\tif (arrOrObj[key] === num)\n\t\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "253d5e47f1bf95b03e4d1b5b55a57e6d", "score": "0.52037877", "text": "function parseResponse(jsonData) {\r\n if((jsonData.results.bindings).length>0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "9ef8328ee177d7f31631618661b08a12", "score": "0.5203012", "text": "function checkValue(value,arr){\n var status = false;\n\n for(var i=0; i<arr.length; i++){\n var name = arr[i];\n if(name == value){\n status = true;\n index=i;\n break;\n }\n }\n return status;\n }", "title": "" }, { "docid": "77f1cd54d5b89a32d8e2455dbf98c410", "score": "0.52014", "text": "function in_array(arg_array, data){\r\n if (arg_array.length > 0){\r\n for(var i=0; i < arg_array.length; ++i){\r\n if (\r\n (typeof arg_array[i] == 'number' ? arg_array[i] : arg_array[i].trim()) == ( typeof data == 'number' ? data: data.trim())\r\n ){return true;}\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "4011dfe0215ffafd38b06b1b42b8f482", "score": "0.5199679", "text": "function canJSON(str) {\n try {\n JSON.parse(str)\n } catch (e) {\n return false\n }\n return true\n }", "title": "" }, { "docid": "e459c186182cf269fb90e03b7c3bbba2", "score": "0.51982176", "text": "function json_check(data) {\n try {\n JSON.parse(data);\n } catch (e) {\n return false;\n }\n Mongo_insert(JSON.parse(data))\n}", "title": "" }, { "docid": "0911f47a7bbd071c18d968d09400f5cc", "score": "0.5198189", "text": "function inArray(input,data){\n var status = false;\n for(var i=0;i<data.length;i++){\n if (input == data[i]){\n status = true;\n break;\n }\n }\n return status;\n}", "title": "" }, { "docid": "1194e53e7a3939c522cff9bdf967e7b5", "score": "0.51979816", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "ae8e76f9091a58c43c775f0ba0324991", "score": "0.5197317", "text": "function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = ((data.version != null) ? parseInt(data.version) : 0);\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}", "title": "" }, { "docid": "59a830517d940f49dd3845f1bf96d387", "score": "0.5196379", "text": "function checkJSON(input) {\n // If the node has the attributes \"name\" and \"img\" returns true\n if (\"name\" in input) {\n\n // If the node has childs check their format\n if (\"children\" in input) {\n for (var child of input.children) {\n\n // If a single child does not have a \"name\" and an \"image\" all\n // the JSON will be discarded\n if (!checkJSON(child)) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "6e10654621c71cb6b717195bd4bd7747", "score": "0.51955116", "text": "function filter_countries(data) {\n if (COUNTRIES.includes(data.properties.admin)){\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "2ac0c8f86018fc1c4bc128445bfc5dd9", "score": "0.5189432", "text": "paramContainsValue(paramValues, requestedValue) {\n\t\t\t\treturn (paramValues instanceof Array) && paramValues.indexOf(requestedValue) > -1;\n\t\t\t}", "title": "" }, { "docid": "a17c6c5c444315839fc7aab1ac5c5257", "score": "0.5189266", "text": "function checkIfExistsAndUpdate(event){\n for (var stand in stands){\n if (event.target.stand.value.toLowerCase() === stands[stand].name.toLowerCase()){\n return true;\n }\n }\n}", "title": "" }, { "docid": "e9594200c668ec391dca8888d23fcd41", "score": "0.5188025", "text": "function contains(a, obj){\n if(a != undefined && a.length>0){\n for (var i = 0; i < a.length; i++){\n if (a[i] === obj){\n return true;\n }\n }\n }\n \n return false;\n\n}", "title": "" }, { "docid": "85f7fd2d9fb665d08d233c4ecd210c69", "score": "0.518321", "text": "function includeInTaskList(json) {\n var bool = false;\n try {\n bool = JSON.parse(json['task-list'].include);\n return bool\n } catch (e) {\n return bool;\n }\n}", "title": "" }, { "docid": "72fa071e5a461ec9f81575269a1ead76", "score": "0.51740855", "text": "function checkAll(thing){\n if($scope.search !== \"\"){\n for(var i in thing){\n if(typeof thing[i] === 'string' && thing[i].indexOf($scope.search)>=0){\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "4d0e33bc48fb1023ee8de2a4bdb315f3", "score": "0.5173111", "text": "contains(key) {\n return this.set[key] === this.val;\n }", "title": "" }, { "docid": "209b41024ac16980ef7197c5a7475f2c", "score": "0.5167362", "text": "valueExists(value) {\n // TODO: implement\n }", "title": "" }, { "docid": "3c2343136ff53794be8e67a958181288", "score": "0.51631397", "text": "function keyInObj(value, key, obj) {\r\n return key in obj;\r\n }", "title": "" }, { "docid": "3c2343136ff53794be8e67a958181288", "score": "0.51631397", "text": "function keyInObj(value, key, obj) {\r\n return key in obj;\r\n }", "title": "" }, { "docid": "1d36b7513f34e99548cfcae78a9c8855", "score": "0.5161682", "text": "function containsObject(obj, list) {\n for (var i = 0; i < list.length; i++) {\n if (list[i].name === obj.name && list[i].size === obj.size) return true;\n }\n return false;\n }", "title": "" }, { "docid": "7ba33ddeac169d13d7121633a1cea967", "score": "0.5161303", "text": "function is(value) {\n\t\t\tvar candidate = value;\n\t\t\treturn Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n\t\t}", "title": "" }, { "docid": "99330216600758219089c7dfac5058a5", "score": "0.5161156", "text": "function isValidJson(string /*: string*/) /*: boolean*/{\n try {\n var json = JSON.parse(string);\n return isObject(json);\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "a5b3c3c0c98f7aa3beb33175bcf8cc06", "score": "0.51596695", "text": "isPresent(firstName) {\n var present = false;\n for (let i = 0; i < this.data.personList.length; i++) {\n //comparing the input from user and the item object\n if (this.data.personList[i].firstName.toLowerCase() == firstName.toLowerCase()) {\n present = true;\n break;\n }\n else {\n present = false;\n }\n }\n if (present === true) {\n return true\n }\n else {\n return false\n }\n }", "title": "" }, { "docid": "d9cd8454f6a6ef6f02aff4c1e2d61bc1", "score": "0.5159396", "text": "function findAny(dsSearchIn, dsSearchAs, obj, str) {\n // Convert the search string to lower case\n str = str.toLowerCase();\n for (var key in obj) {\n if (dsSearchIn.length === 0 || dsSearchIn.indexOf(key) !== -1) {\n var value = String(obj[key]).toLowerCase();\n for (var field in dsSearchAs) {\n if (field === key) {\n // Found key in dsSearchAs so we pass the value and the search string to a search function\n // that returns true/false and we return that if true.\n /* Check if dsSearchAs is a function (passed from the template) */\n if (typeof dsSearchAs[field] === 'function') {\n var res = dsSearchAs[field](value, str);\n if (res === true) {\n return res\n }\n }\n }\n }\n // If it doesn't return from above we perform a simple search\n if (value.indexOf(str) >= 0) {\n return true\n }\n }\n }\n return false\n}", "title": "" }, { "docid": "41cb79567990f35cbb4e79337430446e", "score": "0.51544446", "text": "has(key) {\n\t\tconst data = this[DATA];\n\t\treturn data.values.has(key);\n\t}", "title": "" }, { "docid": "f14f417613902c1f996278c947756072", "score": "0.5153747", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "bbe5819e5d66249ea8c4407943064b9f", "score": "0.514936", "text": "function contains(cell) {\n const stringState = this.map(item => JSON.stringify(item));\n return stringState.includes(JSON.stringify(cell)) ? true : false;\n}", "title": "" }, { "docid": "173086e7bdb53bf9a7c8076b2613490e", "score": "0.5142834", "text": "function within(value, array) {\n return array.indexOf(value.trim()) !== -1;\n }", "title": "" }, { "docid": "0ffbb8126f302bd62260d424462af830", "score": "0.51407", "text": "function isEveryoneHere(obj) {\n let users = ['Ryan', 'Sarah', 'Jeff', 'Alan']\n for (let i = 0; i < users.length; i++){\n if(obj.hasOwnProperty(users[i])){\n return true\n } else {\n return false\n }\n }\n}", "title": "" }, { "docid": "fc28a62389502313a88059d731fff02d", "score": "0.51347643", "text": "search(value, search)\n\t{\n\t\tif (search.operator === \"equals\")\n\t\t{\n\t\t\tif (search.value === null)\n\t\t\t\treturn value.length === 0;\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (let item of value)\n\t\t\t\t{\n\t\t\t\t\tif (item.search(search.value))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.5133198", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.5133198", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.5133198", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.5132042", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.5132042", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.5132042", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.5132042", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "e3f7bce7198cf60f36690303e209872d", "score": "0.51301605", "text": "function containsObject(obj, list) { \n for (let i = 0; i < list.length; i++) { \n if (list[i].itemName === obj.itemName) {\n return i;\n }\n }\n return false;\n}", "title": "" }, { "docid": "5093a5154c6165f67c8c4152c4982c80", "score": "0.5127631", "text": "has(obj, key) {\n var hasValue = obj[key];\n if (hasValue != undefined) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5120375", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5120375", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5120375", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5120375", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5120375", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "46da0e9ca7aaeac8c935e0d3c44f2949", "score": "0.51202214", "text": "importJSON(json) {\n var objectStructure = null;\n\n if (json)\n objectStructure = JSON.parse(json);\n\n if (!this.import(objectStructure))\n return false;\n\n return true;\n }", "title": "" }, { "docid": "766553d8dd7e6f16c116ff361b2f619f", "score": "0.511642", "text": "checkIfItemExists(string) {\n let exists = false;\n this.get('model').forEach((item) => {\n let name = item.get('name');\n if (string.toLowerCase().trim() === name.toLowerCase()) { exists = item; }\n });\n\n return exists;\n }", "title": "" }, { "docid": "f8c8994c2cb21d2681f78676ecee1182", "score": "0.51091415", "text": "checkSignUpValues (aptInput, signInValues) {\n\n if (!this.props.apts.includes(aptInput)) {\n alert (\"Please select an existing apartment complex\");\n return false;\n }\n\n for (let i = 0; i < signInValues.length; i++) {\n\n if (signInValues[i] == \"\") {\n alert (\"Please fill out all values\");\n return false;\n }\n }\n\n return true;\n }", "title": "" } ]
eacc73aa53ed9d8758d107fc14e8b57d
Implementation:2 ends here Using XState, referencing =machine.state= and =machine.state.context= is so common that I like to use shorthand, =interpreter.S= and =interpreter.C= respectively. When the machine has just been instantiated, =machine.initialState= is actually the only state. [[file:../literate/XStateTestInterpreter.org::Implementation][Implementation:3]]
[ { "docid": "77b6f60ed20d88a8b6355e5db71f2c75", "score": "0.64027137", "text": "constructor(machine) {\n this.machine = machine;\n this.state = machine.initialState;\n this.S = this.state;\n this.C = this.state.context;\n }", "title": "" } ]
[ { "docid": "4b2637d988581bfacbd2e287201f5768", "score": "0.73151755", "text": "set_state(intp, x, f, c, s){\n this.interpreter = intp;\n this.x = x;\n this.f = f;\n this.c = c;\n this.s = s;\n }", "title": "" }, { "docid": "f0342de02113123dd574ed4b251d0a37", "score": "0.6706201", "text": "function StateMachine() {\n this.currentState = undefined;\n}", "title": "" }, { "docid": "18d5f07f7338f3838a20c7b25d957437", "score": "0.6663112", "text": "function InstructionState() {}", "title": "" }, { "docid": "18d5f07f7338f3838a20c7b25d957437", "score": "0.6663112", "text": "function InstructionState() {}", "title": "" }, { "docid": "71c62ffeccdc3c88abf1482762fb4ab2", "score": "0.6560057", "text": "function InstructionState() { }", "title": "" }, { "docid": "e7dcfbdefa082d295da09534ea50993b", "score": "0.6500184", "text": "state(s){if (s) this.memory.state = s; return this.memory.state;}", "title": "" }, { "docid": "c7e0c92ade361ae21e3ee75301703426", "score": "0.6483649", "text": "function StateMachine() {\n this.transitionMap = {};\n this.currentState = \"\";\n\n // Statics related to state change\n this._tList = {};\n this._eventStack = [];\n this._deepTransition = false;\n this._stateToTransition = \"\";\n }", "title": "" }, { "docid": "cf524d9c69f4be89b9a80f93f0a9babd", "score": "0.64153045", "text": "function StateMachine (stream, emit, emitError) {\nvar state = { state:'data', context:null, quotation:null, tagName:'', tagType:null }\nvar consume = stream.advance\nvar states = {\n\n// The `content` state doesn't occur in the html5 spec. It functions as\n// an intermediate state for implementing support for rawtext / rcdata\n// elements without requiring a full parser phase. \n\ncontent: function (peek) {\n\tthis.state = (this.tagName in content_map)\n\t\t? content_map[this.tagName]\n\t\t: 'data'\n},\n\ndata: function (peek) {\n\tif (peek === EOF)\n\t\temit('data')\n\telse if (peek === '<') {\n\t\temit('data')\n\t\tconsume()\n\t\tthis.state = 'tagOpen'\n\t}\n\telse if (peek === '&') {\n\t\temit('data')\n\t\tconsume()\n\t\tthis.state = 'charRefIn_'\n\t\t\tthis.context = 'data'\n\t}\n\telse {\n\t\tconsume()\n\t}\n},\n\n// The `tagOpen` state is reached after a `<` symbol in html-data. \ntagOpen: function (peek) {\n\tif (peek === '!') {\n\t\tthis.state = 'markupDeclarationOpen'\n\t\tconsume()\n\t}\n\telse if (peek === '/') {\n\t\tthis.state = 'endTagOpen'\n\t\tconsume()\n\t}\n\telse if (peek === EOF) {\n\t\temitError('unescaped less-than sign')\n\t\temit('lessThanSign')\n\t\tthis.state = 'content'\n\t}\n\telse if (ALPHA.test(peek)) {\n\t\temit('beginStartTag')\n\t\tthis.state = 'tagName'\n\t\t\tthis.tagType = 'startTag'\n\t\t\tthis.tagName = peek.toLowerCase()\n\t\tconsume()\n\t}\n\telse if (peek === '?') {\n\t\temitError('invalid comment opening')\n\t\tthis.state = 'bogusComment'\n\t\tconsume()\n\t}\n\telse {\n\t\temitError('unescaped less-than sign')\n\t\temit('lessThanSign')\n\t\t// Warning: branch does not consume\n\t\tthis.state = 'content'\n\t}\n},\n\n// The `tagName` state is reached after an alphabetic character\n// that trails `<` or `</`. The machine stays in this state until\n// whitespace, `/` or `>` is encountered. \n\ntagName: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'in tag name')\n\t\temit('tagName')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\temit('tagName')\n\t\tthis.state = 'beforeAttributeName'\n\t\tconsume()\n\t}\n\telse if (peek === \"/\") {\n\t\temit('tagName')\n\t\tthis.state = 'selfClosingStartTag'\n\t\tconsume()\n\t}\n\telse if (peek === '>') {\n\t\temit('tagName')\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\tconsume()\n\t\t// The following is a bit of a hack, used in `content`,\n\t\t// for supporting rcdata and rawtext elements\n\t\tif (this.tagType === 'startTag')\n\t\t\tthis.tagName = this.tagName+peek.toLowerCase();\n\t}\n},\n\n// The `selfClosingStartTag` state is reached after the\n// `/` symbol (in the appropriate contexts). \n\nselfClosingStartTag: function (peek) {\n\tif (peek === '>') {\n\t\tconsume()\n\t\temit('finishSelfClosingTag')\n\t\tthis.state = 'content'\n\t}\n\telse if (peek === EOF) {\n\t\t// This is the same as the EOF branch in 'beforeAttributeName'\n\t\temit('space')\n\t\temitError(eof_msg+'before attribute name')\n\t}\n\telse {\n\t\t// Warning: branch does not consume\n\t\tthis.state = 'beforeAttributeName'\n\t\t//states.beforeAttributeName.apply(this, arguments)\n\t}\n},\n\nendTagOpen: function (peek) {\n\tif (ALPHA.test(peek)) {\n\t\temit('beginEndTag')\n\t\tthis.state = 'tagName'\n\t\t\tthis.tagType = 'endTag'\n\t\t\tthis.tagName = ''\n\t\tconsume()\n\t}\n\telse if (peek === '>') {\n\t\temitError('invalid empty comment tag')\n\t\temit('beginBogusComment')\n\t\tconsume()\n\t\temit('finishBogusComment')\n\t\tthis.state = 'content'\n\t}\n\telse if (peek === EOF) {\n\t\temit('beginEndTag')\n\t\temitError(eof_msg+'before endtag name')\n\t}\n\telse {\n\t\temitError('invalid comment tag (may be a malformed end tag)')\n\t\temit('beginBogusComment')\n\t\tthis.state = 'bogusComment'\n\t\tconsume()\n\t}\n},\n\n// Attribute names may start with anything except space, `/`, `>`\n// subsequent characters may be anything except space, `/`, `=`, `>`.\t \n// e.g. ATTRNAME = `/^[^\\t\\n\\f />][^\\t\\n\\f /=>]*$/`\n\nbeforeAttributeName: function (peek) {\n\tif (peek === EOF) {\n\t\temit('space')\n\t\temitError(eof_msg+'before attribute name')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\tconsume()\n\t}\n\telse if (peek === \"/\") {\n\t\temit('space')\n\t\tthis.state = 'selfClosingStartTag'\n\t\tconsume()\n\t}\n\telse if (peek === '>') {\n\t\temit('space')\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\temit('space')\n\t\tthis.state = 'attributeName'\n\t\tconsume()\n\t}\n},\n\nattributeName: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'in attribute name')\n\t\temit('attributeName')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\temit('attributeName')\n\t\tthis.state = 'afterAttributeName'\n\t\tconsume()\n\t}\n\telse if (peek === \"/\") {\n\t\temit('attributeName') // Stand alone attribute\n\t\tthis.state = 'selfClosingStartTag'\n\t\tconsume()\n\t}\n\telse if (peek === \"=\") { // attribute with value\n\t\temit('attributeName')\n\t\tconsume()\n\t\tthis.state = 'beforeAttributeValue'\n\t}\n\telse if (peek === '>') {\n\t\temit('attributeName') // Stand alone attribute\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\tconsume()\n\t}\n},\n\nafterAttributeName: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'after attribute name')\n\t\temit('space')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\tconsume()\n\t}\n\telse if (peek === \"/\") {\n\t\temit('space') // was a stand alone attribute\n\t\tthis.state = 'selfClosingStartTag'\n\t\tconsume()\n\t}\n\telse if (peek === \"=\") { // attribute with value\n\t\tconsume()\n\t\tthis.state = 'beforeAttributeValue'\n\t}\n\telse if (peek === '>') {\n\t\temit('space') // it was a stand alone attribute\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\temit('space') // it was a stand alone attribute\n\t\tthis.state = 'attributeName'\n\t\tconsume()\n\t}\n},\n\nbeforeAttributeValue: function (peek) { // 'after equals'\n\tif (peek === EOF) {\n\t\temit('equals')\n\t\temitError(eof_msg+'before attribute value')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\tconsume()\n\t}\n\telse if (peek === '\"' || peek === \"'\") {\n\t\temit('equals')\n\t\tthis.state = 'attributeValue_Quoted'\n\t\tthis.quotation = peek\n\t\tconsume()\n\t\temit('beginAttributeValue')\n\t}\n\telse if (peek === '>') {\n\t\temit('equals')\n\t\temitError('missing attribute value')\n\t\temit('attributeValueMissing')\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\t// TODO should produce errors on <, =, `\n\t\temit('equals')\n\t\temit('beginAttributeValue')\n\t\tthis.state = 'attributeValueUnquoted'\n\t\tconsume()\n\t}\n},\n\nattributeValue_Quoted: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'in attribute value')\n\t\temit('attributeData')\n\t}\n\telse if (peek === this.quotation) {\n\t\temit('attributeData')\n\t\tconsume()\n\t\temit('finishAttributeValue')\n\t\tthis.state = 'afterAttributeValueQuoted'\n\t}\n\telse if (peek === '&') {\n\t\temit('attributeData')\n\t\tconsume()\n\t\tthis.state = 'charRefIn_'\n\t\t\tthis.context = 'attributeValue_Quoted'\n\t}\n\telse {\n\t\tconsume()\n\t}\n},\n\nattributeValueUnquoted: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'in attribute value')\n\t\temit('attributeData')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\temit('attributeData')\n\t\temit('finishAttributeValue')\n\t\tconsume()\n\t\tthis.state = 'beforeAttributeName'\n\t}\n\telse if (peek === '&') {\n\t\temit('attributeData')\n\t\tconsume()\n\t\tthis.state = 'charRefIn_'\n\t\t\tthis.context = 'attributeValueUnquoted'\n\t}\n\telse if (peek === '>') {\n\t\temit('attributeData')\n\t\temit('finishAttributeValue')\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\tconsume()\n\t}\n},\n\nafterAttributeValueQuoted: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'after attribute value')\n\t}\n\telse if (SPACE.test(peek)) {\n\t\tthis.state = 'beforeAttributeName'\n\t\tconsume()\n\t}\n\telse if (peek === \"/\") {\n\t\tconsume()\n\t\tthis.state = 'selfClosingStartTag'\n\t}\n\telse if (peek === '>') {\n\t\tconsume()\n\t\temit('finishTag')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\temitError('missing space after attribute')\n\t\temit('spaceMissing')\n\t\tthis.state = 'beforeAttributeName'\n\t\t// Warning: branch does not consume\n\t}\n},\n\n// Markup declaration\n\nmarkupDeclarationOpen: function (peek, stream) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'in markup declaration')\n\t\temit('beginBogusComment')\n\t}\n\telse if (stream.unsafePeek(2) === \"--\") {\n\t\tconsume()\n\t\tconsume()\n\t\temit('beginComment')\n\t\tthis.state = 'commentStart'\n\t}\n\t// TWO cases are omitted here: doctype tags and cdata sections\n\t//\tthose will be tokenized as bogus comments instead. \n\telse {\n\t\temit('beginBogusComment')\n\t\tthis.state = 'bogusComment'\n\t\temitError('invalid comment (may be an unhandled markup declaration)')\n\t\t// Warning: branch does not consume\n\t}\n},\n\n\n// Comments\n// This state is reached after an <!--\ncommentStart: function (peek) {\n\tif (peek === EOF) {\n\t\temitError(eof_msg+'in comment')\n\t}\n\telse if (peek === \"-\") {\n\t\tthis.state = 'commentStartDash'\n\t\tconsume()\n\t}\n\telse if (peek === '>') {\n\t\tconsume()\n\t\temit('finishComment')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\tthis.state = 'comment'\n\t\tconsume()\n\t}\n},\n\n// This state is reached after an <!---\ncommentStartDash: function (peek) {\n\tif (peek === EOF) {\n\t\temit('commentData')\n\t\temitError(eof_msg+'in comment')\n\t}\n\telse if (peek === \"-\") {\n\t\tconsume()\n\t\tthis.state = 'commentEnd'\n\t}\n\telse if (peek === '>') {\n\t\tconsume()\n\t\temit('finishComment')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\tthis.state = 'comment'\n\t\tconsume()\n\t}\n},\n\ncomment: function (peek) {\n\tif (peek === EOF) {\n\t\temit('commentData')\n\t\temitError(eof_msg+'in comment')\n\t}\n\telse if (peek === \"-\") {\n\t\temit('commentData')\n\t\tconsume()\n\t\tthis.state = 'commentEndDash'\n\t}\n\telse {\n\t\tconsume()\n\t}\n},\n\n// this state is reached after - in a comment\ncommentEndDash: function (peek) {\n\tif (peek === EOF) {\n\t\temit('commentData')\n\t\temitError(eof_msg+'in comment')\n\t}\n\telse if (peek === \"-\") {\n\t\tthis.state = 'commentEnd'\n\t\tconsume()\n\t}\n\telse {\n\t\tthis.state = 'comment'\n\t\tconsume()\n\t}\n},\n\n// this state is reached after -- in a comment\ncommentEnd: function (peek) {\n\tif (peek === EOF) {\n\t\temit('commentData')\n\t\temitError(eof_msg+'in comment')\n\t}\n\telse if (peek === '>') {\n\t\tconsume()\n\t\temit('finishComment')\n\t\tthis.state = 'content'\n\t}\n\telse if (peek === \"!\") {\n\t\t// This is a parse error, will be reported in the next state\n\t\tconsume()\n\t\tthis.state = 'commentEndBang'\n\t}\n\telse {\n\t\temitError('comment data should not contain --')\n\t\tthis.state = 'comment'\n\t\tconsume()\n\t}\n},\n\ncommentEndBang: function (peek) {\n\tif (peek === EOF) {\n\t\temitError('comment data should not contain --!')\n\t\temitError(eof_msg+'in comment')\n\t\temit('commentData')\n\t}\n\telse if (peek === \"-\") {\n\t\temitError('comment data should not contain --!')\n\t\tthis.state = 'commentEndDash'\n\t\tconsume()\n\t}\n\telse if (peek === '>') {\n\t\tconsume()\n\t\temitError('comment should end with -->')\n\t\temit('finishComment')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\temitError('comment data should not contain --!')\n\t\tthis.state = 'comment'\n\t\tconsume()\n\t}\n},\n\nbogusComment: function (peek) {\n\tif (peek === EOF) {\n\t\temit('bogusCommentData')\n\t\temitError(eof_msg+'in invalid comment')\n\t}\n\telse if (peek === '>') {\n\t\temit('bogusCommentData')\n\t\tconsume()\n\t\temit('finishBogusComment')\n\t\tthis.state = 'content'\n\t}\n\telse {\n\t\tconsume()\n\t}\n},\n\n\n// ### RAWTEXT, RCDATA and PLAINTEXT states\n// Raw text may contain anything except the beginnings of an\n// end tag for the current element. Raw text cannot be escaped. \n// The only rawtext elements in the html5 specification are\n// 'script' and 'style'. \n// Rcdata may contain anyting like rawtext, but can be escaped,\n// that is, it may contain character references. \n// Plaintext may contain anything, nothing can be escaped, and\n// does not have an endtag. \n\nplaintext: function (peek) {\n\tif (peek === EOF)\n\t\temit('plaintext')\n\telse\n\t\tconsume()\n},\n\nrawtext: function (peek) {\n\tif (peek === EOF) {\n\t\temit('rawtext')\n\t\temitError(eof_msg+'in '+this.tagName+' content')\n\t}\n\telse if (peek === '<') {\n\t\temit('rawtext')\n\t\tthis.state = 'lessThanSignIn_'\n\t\t\tthis.context = 'rawtext'\n\t\tconsume()\n\t}\n\telse\n\t\tconsume()\n},\n\nrcdata: function (peek) {\n\tif (peek === EOF) {\n\t\temit('rcdata')\n\t\temitError(eof_msg+'in '+this.tagName+' content')\n\t}\n\telse if (peek === '<') {\n\t\temit('rcdata')\n\t\tconsume()\n\t\tthis.state = 'lessThanSignIn_'\n\t\t\tthis.context = 'rcdata'\n\t}\n\telse if (peek === '&') {\n\t\temit('rcdata')\n\t\tconsume()\n\t\tthis.state = 'charRefIn_'\n\t\t\tthis.context = 'rcdata'\n\t}\n\telse\n\t\tconsume()\n},\n\n// This is different from, but equivalent to the specification, here\n// using a lookahead into the token stream to check if the `<` sign\n// starts an appropriate end tag token. \n\nlessThanSignIn_: function (peek) {\n\tif (peek === \"/\") {\n\t\tconsume()\n\t\tthis.state = 'endTagOpenIn_'\n\t}\n\telse {\n\t\t// Warning: branch does not consume\n\t\tthis.state = this.context\n\t}\n},\n\nendTagOpenIn_: function (peek) {\n\tvar l = this.tagName.length, look = stream.unsafePeek(l+1)\n\tif (peek !== EOF && ALPHA.test(peek) && TAGEND.test(look[l]) && look.substr(0,l).toLowerCase() === this.tagName) {\n\t\temit('beginEndTag')\n\t\tthis.state = 'tagName'\n\t\t\tthis.tagName = ''\n\t\tconsume()\n\t}\n\telse {\n\t\t// Warning: branch does not consume\n\t\tthis.state = this.context\n\t}\n},\n\n//endTagNameIn_:\n\n\n// ### Character References\n//\n// The character reference states as implemented below,\n// are not in the specification and in fact, the following is not\n// completely equivalent to the suggested behaviour (keep reading). \n//\n// The main difference is in the tokenization of named references. \n// A named character reference token with an unknown name **ought** to\n// have been interpreted as data, likewise for named references that aren't\n// terminated by a semicolon and occur in attribute values (IIRC). \n// Named references with an unknown name, a prefix of which **is** a known name,\n// **ought** to have been interpreted as a such named reference\n// followed by the rest of the unknown name as data. \n// Furthermore, numeric character references are not checked for\n// being 'out of range', so no 'out of range' errors are emitted for those. \n// \n// The above isn't needed for correct tokenization of the rest of the document\n// (for as far as I've understood the spec). I kind of feel that the suggested\n// behaviour shouldn't be implemented as part of the lexical analysis, but\n// should be handled higher up. \n// \n// Any sequence starting with an ampersand and which is not a lexically valid\n// character reference, is emitted as a `bogusCharRef` token. \n\ncharRefIn_: function (peek) { // after an &\n\tif (peek === '#') {\n\t\tconsume()\n\t\tthis.state = 'numericCharRef'\n\t}\n\telse if (peek !== EOF && ALPHANUM.test(peek)) {\n\t\tconsume()\n\t\tthis.state = 'namedCharRef'\n\t}\n\telse {\n\t\temit('bogusCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n},\n\nnumericCharRef: function (peek) {\n\tif (peek === 'x' || peek === 'X') {\n\t\tconsume()\n\t\tthis.state = 'hexadecimalCharRef'\n\t}\n\telse if (peek !== EOF && DIGITS.test(peek)) {\n\t\tconsume()\n\t\tthis.state = 'decimalCharRef'\n\t}\n\telse {\n\t\temit('bogusCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n},\n\ndecimalCharRef: function (peek) {\n\tif (peek !== EOF && DIGITS.test(peek)) {\n\t\tconsume()\n\t}\n\telse if (peek === ';') {\n\t\tconsume()\n\t\temit('decimalCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n\telse {\n\t\temitError('unterminated decimal character reference')\n\t\temit('decimalCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n},\n\nhexadecimalCharRef: function (peek) {\n\tif (peek !== EOF && HEXDIGITS.test(peek)) {\n\t\tconsume()\n\t\tthis.state = 'hexDigits'\n\t}\n\telse {\n\t\temit('bogusCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n},\n\nhexDigits: function (peek) {\n\tif (peek !== EOF && HEXDIGITS.test(peek))\n\t\tconsume()\n\telse if (peek === ';') {\n\t\tconsume()\n\t\temit('hexadecimalCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n\telse {\n\t\temitError('unterminated hexadecimal character reference')\n\t\temit('hexadecimalCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n},\n\nnamedCharRef: function (peek) {\n\tif (peek !== EOF && ALPHANUM.test(peek))\n\t\tconsume()\n\telse if (peek === ';') {\n\t\tconsume()\n\t\temit('namedCharRef', this.context)\n\t\tthis.state = this.context\n\t}\n\telse {\n\t\t// passing peek as a hack for further handling of CharRefs\n\t\temit('namedCharRef', this.context, peek)\n\t\tthis.state = this.context\n\t}\n}\n\n} /* end of states */\n\nfunction run () { states[state.state].call(state, stream.peek(), stream) }\nreturn { run:run, state:state, states:states }\n}", "title": "" }, { "docid": "77cdb7976d8d7bade982ed20829162e3", "score": "0.63944894", "text": "function State() { }", "title": "" }, { "docid": "9fe1a9ea1a6fc87f93ed3e03ce57ef7a", "score": "0.6256147", "text": "function StateMachine(initialState) {\n var __arguments = new Array(arguments.length);\n for (var __argumentIndex = 0; __argumentIndex < __arguments.length; ++__argumentIndex) {\n __arguments[__argumentIndex] = arguments[__argumentIndex];\n }\n if (__arguments.length == 1) {\n var initialState_1 = __arguments[0];\n //super();\n this.fmliveswitchStateMachineInit();\n this.__pendingPromises = {};\n this.__transitions = {};\n this.__transitionReachabilityMatrix = {};\n this.__states = new Array();\n this.__transitionsLock = new Object();\n this.setSystemTimestamp(-1);\n this.setLastStateTicks(-1);\n this.setStateValue(this.stateToValue(initialState_1));\n }\n else {\n throw new fm.liveswitch.Exception('Constructor overload does not exist with specified parameter count/type combination.');\n }\n }", "title": "" }, { "docid": "18c61b4d7b1ac29f58324b4c289162bf", "score": "0.62439144", "text": "function State(ops, fct) {\n this.functions = fct;\n this.operations = ops;\n this.pc = 0;\n this.operationsStack = [];\n this.bindings = {};\n this.stack = [];\n // p( 'storeCode with state reset' );\n }", "title": "" }, { "docid": "e74961012ebf4a4852caeb5624b2f6d3", "score": "0.6126737", "text": "function State() {\n\n }", "title": "" }, { "docid": "599a457a8e78f58c8d89752cc996f054", "score": "0.60694283", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n this.regex = undefined;\n this.handlers = undefined;\n this.specificity = undefined;\n}", "title": "" }, { "docid": "6321a191314683698f70e6363c0b0c12", "score": "0.6020132", "text": "function State(env, prog) {\n this.env = env;\n this.stack = [];\n this.prog = prog;\n\n switch (env) {\n case 'glyf' :\n this.zp0 = this.zp1 = this.zp2 = 1;\n this.rp0 = this.rp1 = this.rp2 = 0;\n /* fall through */\n case 'prep' :\n this.fv = this.pv = this.dpv = xUnitVector;\n this.round = roundToGrid;\n }\n}", "title": "" }, { "docid": "6321a191314683698f70e6363c0b0c12", "score": "0.6020132", "text": "function State(env, prog) {\n this.env = env;\n this.stack = [];\n this.prog = prog;\n\n switch (env) {\n case 'glyf' :\n this.zp0 = this.zp1 = this.zp2 = 1;\n this.rp0 = this.rp1 = this.rp2 = 0;\n /* fall through */\n case 'prep' :\n this.fv = this.pv = this.dpv = xUnitVector;\n this.round = roundToGrid;\n }\n}", "title": "" }, { "docid": "fe075b96f944be7ebfa8411515b3f81b", "score": "0.59078974", "text": "defineStates() {\n // Maximum stack calls\n let maxStackCalls = 400;\n\n // Acquisition lambdas\n let queue = i => {\n return this.text.charAt(i);\n };\n let store = c => {\n this.buffer += c;\n };\n let flush = t => {\n if (this.buffer.length > 0) {\n // Special treatment for id tokens that contain only numbers\n let numberToken = t == Token.ID && !isNaN(this.buffer);\n this.list.push(\n new Token(numberToken ? Token.NUMBER : t, this.buffer, line)\n );\n }\n this.buffer = \"\";\n };\n\n // Line number updater\n let line = 0;\n let newline = i => {\n line++;\n };\n\n // State definitions\n let state = {\n // Transference function\n transference: (i, phase) => {\n if (i < this.text.length) {\n // Prevent stack overflow\n if (i % maxStackCalls == 0 && phase != true) {\n this.index = i;\n return;\n }\n\n // Transfer to the identifier state\n state.identifier(i);\n } else {\n flush(Token.ID);\n this.index = i;\n return;\n }\n },\n\n // For IDs\n identifier: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case '\"':\n case \"'\":\n flush(Token.ID);\n state.string(i + 1, c);\n return;\n case \"\\\\\":\n flush(Token.ID);\n state.extension(i);\n return;\n case \" \":\n case \";\":\n flush(Token.ID);\n state.delimiter(i);\n return;\n case \"#\":\n flush(Token.ID);\n state.comment(i + 1);\n return;\n case \"(\":\n case \")\":\n flush(Token.ID);\n state.parenthesis(i, c);\n return;\n default:\n store(c);\n state.transference(i + 1);\n }\n },\n\n // For strings\n string: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case phase:\n flush(Token.STRING);\n state.transference(i + 1, c);\n return;\n case \"\\\\\":\n state.extension(i + 1);\n return;\n default:\n store(c);\n state.string(i + 1, phase);\n }\n },\n\n // For escape characters\n extension: (i, phase) => {\n let c = queue(i);\n\n store(\"\\\\\" + c);\n state.transference(i + 1);\n },\n\n // For comments\n comment: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case \";\":\n newline();\n flush(Token.COMMENT);\n state.transference(i + 1);\n return;\n default:\n store(c);\n state.comment(i + 1);\n }\n },\n\n // For parenthesis\n parenthesis: (i, phase) => {\n let c = queue(i);\n\n store(c);\n if (phase == \"(\") flush(Token.OPEN);\n else if (phase == \")\") flush(Token.CLOSE);\n state.transference(i + 1);\n },\n\n // For whitespaces and linefeeds\n delimiter: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case \";\":\n newline();\n case \" \":\n store(c);\n state.delimiter(i + 1);\n return;\n default:\n flush(Token.SPACE);\n state.transference(i);\n }\n }\n };\n this.state = state;\n }", "title": "" }, { "docid": "2cd7b7f8dd94004d79e95873d647816a", "score": "0.5902754", "text": "function InputState() {\n this.prefixRepeat = [];\n this.motionRepeat = [];\n\n this.operator = null;\n this.operatorArgs = null;\n this.motion = null;\n this.motionArgs = null;\n this.keyBuffer = []; // For matching multi-key commands.\n this.registerName = null; // Defaults to the unnamed register.\n }", "title": "" }, { "docid": "2cd7b7f8dd94004d79e95873d647816a", "score": "0.5902754", "text": "function InputState() {\n this.prefixRepeat = [];\n this.motionRepeat = [];\n\n this.operator = null;\n this.operatorArgs = null;\n this.motion = null;\n this.motionArgs = null;\n this.keyBuffer = []; // For matching multi-key commands.\n this.registerName = null; // Defaults to the unnamed register.\n }", "title": "" }, { "docid": "b3c8ee245b8771cc4a405c14d3edfea1", "score": "0.5880017", "text": "function State(env, prog) {\n this.env = env;\n this.stack = [];\n this.prog = prog;\n\n switch (env) {\n case 'glyf':\n this.zp0 = this.zp1 = this.zp2 = 1;\n this.rp0 = this.rp1 = this.rp2 = 0;\n /* fall through */\n case 'prep':\n this.fv = this.pv = this.dpv = xUnitVector;\n this.round = roundToGrid;\n }\n }", "title": "" }, { "docid": "28199e9c9844645da77c48cc6cc57294", "score": "0.586238", "text": "function State(xx,yy) {\n this.x = xx;\n this.y = yy;\n}", "title": "" }, { "docid": "9f91840f80c64575c6c88f5fec5a197a", "score": "0.5831669", "text": "function State(charSpec) {\n\t this.charSpec = charSpec;\n\t this.nextStates = [];\n\t}", "title": "" }, { "docid": "9f91840f80c64575c6c88f5fec5a197a", "score": "0.5831669", "text": "function State(charSpec) {\n\t this.charSpec = charSpec;\n\t this.nextStates = [];\n\t}", "title": "" }, { "docid": "2fd8ec3248c107471749529879f65c7d", "score": "0.57988906", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }", "title": "" }, { "docid": "2fd8ec3248c107471749529879f65c7d", "score": "0.57988906", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }", "title": "" }, { "docid": "2fd8ec3248c107471749529879f65c7d", "score": "0.57988906", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }", "title": "" }, { "docid": "2fd8ec3248c107471749529879f65c7d", "score": "0.57988906", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }", "title": "" }, { "docid": "2fd8ec3248c107471749529879f65c7d", "score": "0.57988906", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }", "title": "" }, { "docid": "9963f042a1eced8fe7d5e54702abfed3", "score": "0.57839847", "text": "function input( v, state ){ \nvar newState = applsfn(v,state);\nreturn new State( applmfn(v,newState), newState ); \n}", "title": "" }, { "docid": "228c2d0e457bf395299d5f7e54e05b68", "score": "0.5783946", "text": "function State() {\n\n }", "title": "" }, { "docid": "b88a7201287d4ca9cb95c4b7ab216d5b", "score": "0.577744", "text": "enterState(oldState){}", "title": "" }, { "docid": "548855a280628e29c65b89e9004d36ee", "score": "0.5771443", "text": "function FSMTests() {\n\tthis.states = {\n\t\tone: {\n\t\t\tgotoTwo: function() {\n\t\t\t\treturn \"two\";\n\t\t\t},\n\t\t\tgotoThree: function() {\n\t\t\t\treturn \"three\";\n\t\t\t}\n\t\t},\n\t\ttwo: {\n\t\t\tgotoOne: function() {\n\t\t\t\treturn \"one\";\n\t\t\t},\n\t\t\tgotoThree: function() {\n\t\t\t\treturn \"three\";\n\t\t\t}\n\t\t},\n\t\tthree: {\n\t\t\tgotoTwo: function() {\n\t\t\t\treturn \"two\";\n\t\t\t},\n\t\t\tgotoOne: function() {\n\t\t\t\treturn \"one\";\n\t\t\t}\n\t\t}\n\t};\n}", "title": "" }, { "docid": "769f41607e300e8deb191b6bf1487dc2", "score": "0.57461256", "text": "function state(name, norm_fn)\n{\n norm_fn = def(norm_fn, normalizeState);\n\n var value = norm_fn(name);\n require(typeof value !== 'undefined',\n \"Cannot create state from \" + repr(value));\n\n return new State(value);\n}", "title": "" }, { "docid": "79c921e5fea9d152522eaaaf2dcf1800", "score": "0.5736858", "text": "function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }", "title": "" }, { "docid": "2198a510e9f0bfb6d36b1f5fe167ea16", "score": "0.5715831", "text": "stateMachine() {\n // request next frame update\n requestAnimationFrame( () => this.stateMachine() );\n\n // Manages the timers (compute the elapsed time)\n this.timeMsCurr = performance.now();\n this.timeMsDelta = this.timeMsCurr - this.timeMsPrev;\n this.timeMsPrev = this.timeMsCurr;\n\n this.getHtml(\"#debug\")[0].innerText =\n \" left \" + this.inputs.is('left') +\n \" right \" + this.inputs.is('right');\n // this.timeMsAnim + \" / \" + this.stateCurr + \" / \" + this.statePrev;\n\n // Call the state machine\n let init = this.stateCurr !== this.statePrev;\n this.statePrev = this.stateCurr;\n switch (this.stateCurr) {\n case this.states.title : this.stateCurr = this.stateTitle(init); break;\n case this.states.config : this.stateCurr = this.stateConfig(init); break;\n case this.states.play : this.stateCurr = this.statePlay(init); break;\n case this.states.pause : this.stateCurr = this.statePause(init); break;\n case this.states.delete : this.stateCurr = this.stateDelete(init); break;\n case this.states.level : this.stateCurr = this.stateLevel(init); break;\n case this.states.over : this.stateCurr = this.stateOver(init); break;\n default : this.stateCurr = this.states.title; break;\n }\n }", "title": "" }, { "docid": "1723a04860cddd6bd7ae03102fd37d79", "score": "0.5699283", "text": "function getState() {\n return currentState\n }", "title": "" }, { "docid": "38f5692a2b7b006d2fc440da1ae850c4", "score": "0.5698592", "text": "function getState () {\n\t\treturn currentState;\n\t}", "title": "" }, { "docid": "c7ed521dab18c2c904abb2450aedc928", "score": "0.56906015", "text": "async start() {\n const { config, emitter, states } = this;\n\n let curr;\n\n if(config.initial) {\n curr = config.initial;\n } else {\n curr = Object.keys(config.states)[0];\n }\n\n const details = {\n curr : states.get(curr),\n };\n\n await emitter.emit(`enter`, details);\n await emitter.emitSerial(`enter:${curr}`, details);\n\n this.state = curr;\n }", "title": "" }, { "docid": "ddaf425167242a27318680ff1f454932", "score": "0.56844944", "text": "function loadMachine () {\n\n machine_name = 'Untitled'\n var lines = myCodeMirror.getValue().split( /\\r\\n|\\r|\\n|\\n\\r/ );\n new_final_states = \"\";\n new_initial_state = \"\";\n var new_ntapes = -1;\n var transitions_defined = false;\n\n var errmsg;\n var warnings = \"Warnings:\\n\\r\";\n new_transitions = new Array();\n var antecedent;\n var consequent;\n\n var comment_lines = 1;\n error = false;\n for ( i = 0; i < lines.length && !error; i += comment_lines + 1 ) {\n error = false;\n original_line = lines[ i ].replace( /\\s+/g, '' );\n if ( original_line.indexOf( '//' ) == 0 || original_line.length == 0 ) {\n comment_lines = 0;\n }\n else {\n line = original_line.toLowerCase();\n if ( line.indexOf( 'init:' ) == 0 ) {\n if ( line.length <= 5 ) {\n error = true;\n errmsg = \"The <strong>initial state</strong> is not defined\";\n }\n else {\n new_initial_state = original_line.split( ':' )[ 1 ];\n }\n comment_lines = 0;\n }\n\n else if ( line.indexOf( 'accept:' ) == 0 ) {\n if ( line.length <= 7 ) {\n error = true;\n errmsg = \"There are no <strong>final states</strong> defined\";\n }\n else {\n new_final_states = original_line.split( ':' )[ 1 ].split( ',' );\n }\n comment_lines = 0;\n }\n\n else if ( line.indexOf( 'name:' ) == 0 ) {\n machine_name = lines[ i ].split( ':' )[ 1 ].replace( /^\\s+|\\s+$/g, '' );\n comment_lines = 0;\n }\n\n else {\n if ( new_ntapes == -1 ) {\n new_ntapes = line.split( ',' ).length - 1\n if ( new_ntapes < 1 ) {\n error = true;\n errmsg = \"Incorrect instruction in line \" + (i + 1) + \": \" + line;\n }\n }\n if ( !error ) {\n if ( line.indexOf( \"//\" ) > 0 ) {\n line = line.substring( 0, line.indexOf( \"//\" ) );\n original_line = original_line.substring( 0, original_line.indexOf( \"//\" ) );\n }\n transitions_defined = true;\n antecedent = original_line.split( ',' );\n comment_lines = 1;\n\n while ( lines[ i + comment_lines ] && (lines[ i + comment_lines ].indexOf( \"//\" ) == 0) || lines[ i + comment_lines ].length == 0 ) {\n comment_lines++;\n }\n\n if ( lines[ i + comment_lines ] ) {\n consequent_line = lines[ i + comment_lines ].replace( /\\s+/g, '' );\n if ( consequent_line.indexOf( \"//\" ) >= 0 ) {\n consequent_line = consequent_line.substring( 0, consequent_line.indexOf( \"//\" ) );\n }\n consequent = consequent_line.split( ',' );\n }\n\n else {\n error = true;\n errmsg = \"<br/> The second part of the transition in line \" + (i + 1) + \" is not defined\";\n }\n\n if ( !error ) {\n if ( antecedent.length != new_ntapes + 1 ) {\n error = true;\n errmsg = \"Incorrect number of elements in line \" + (i + 1);\n }\n else {\n for ( var j = 1; j < new_ntapes + 1 && !error; j++ ) {\n if ( antecedent[ j ].length != 1 ) {\n error = true;\n errmsg = \"Incorrect element in line \" + (i + 1) + \": symbols must be single characters\";\n if ( antecedent[ j ].length == 0 ) {\n errmsg += \"Use underscore to represent a blank cell\"\n }\n }\n }\n }\n if ( !error ) {\n if ( consequent.length != 2 * new_ntapes + 1 ) {\n error = true;\n errmsg = \"Incorrect number of elements in line \" + (i + comment_lines + 1);\n }\n else {\n for ( var j = 1; j < new_ntapes + 1; j++ ) {\n if ( consequent[ j ].length != 1 ) {\n error = true;\n errmsg =\n \"Incorrect element in line \" + (i + comment_lines + 1) + \": symbols must be single characters\";\n if ( consequent[ j ].length == 0 ) {\n errmsg += \"Use underscore to represent a blank cell\"\n }\n }\n }\n ;\n }\n }\n if ( !error ) {\n for ( var j = 1; j < new_ntapes + 1 && !error; j++ ) {\n if ( consequent[ new_ntapes + j ] != 'l' && consequent[ new_ntapes + j ] != 'r' && consequent[ new_ntapes + j ] != '-' ) {\n error = true;\n errmsg =\n \"Incorrect transition in line \" + (i + comment_lines + 1) + \". Movements must be left (<), right (>) or center (-).\";\n }\n }\n }\n }\n if ( !error ) {\n if ( new_transitions[ original_line ] ) {\n if ( new_transitions[ original_line ] != lines[ i + 1 ].replace( /\\s+/g, '' ) ) {\n error = true;\n errmsg = \"Transition in line \" + (i + 1) + \" is already defined\";\n }\n\n else {\n warnings += \"\\n\\r - Transition in line \" + (i + 1) + \" already defined\";\n }\n\n }\n new_transitions[ original_line ] = lines[ i + comment_lines ].replace( /\\s+/g, '' );\n }\n else {\n comment_lines = 0;\n }\n }\n }\n }\n }\n\n if ( !error ) {\n\n if ( new_initial_state.length == 0 ) {\n error = true;\n errmsg = \"The initial state is not defined\";\n }\n\n else if ( new_final_states.length == 0 ) {\n error = true;\n errmsg = \"No final states defined\";\n }\n\n else if ( !transitions_defined ) {\n error = true;\n errmsg = \"There are no transitions defined\";\n }\n\n else {\n final_states = new_final_states;\n initial_state = new_initial_state;\n ncells = new_ncells;\n n_tapes = new_ntapes;\n state = initial_state;\n transitions = new_transitions;\n machine_loaded = true;\n ready_tapes = 2 * n_tapes;\n return true;\n }\n }\n\n if ( error ) {\n show_messages( '<strong>Error</strong>: ' + errmsg );\n return false;\n }\n}", "title": "" }, { "docid": "3e6e8201442966c021c21098648e9fb2", "score": "0.5682006", "text": "constructor() {\n super()\n this.state = intialState\n }", "title": "" }, { "docid": "627fcb339d612ba594a0233feec7b130", "score": "0.56812865", "text": "prepareState() {\n /* ... */\n }", "title": "" }, { "docid": "ca293206285920b3deb788b40d4ddd11", "score": "0.5680746", "text": "function State(charSpec) {\n\t this.charSpec = charSpec;\n\t this.nextStates = [];\n\t }", "title": "" }, { "docid": "ca293206285920b3deb788b40d4ddd11", "score": "0.5680746", "text": "function State(charSpec) {\n\t this.charSpec = charSpec;\n\t this.nextStates = [];\n\t }", "title": "" }, { "docid": "ca293206285920b3deb788b40d4ddd11", "score": "0.5680746", "text": "function State(charSpec) {\n\t this.charSpec = charSpec;\n\t this.nextStates = [];\n\t }", "title": "" }, { "docid": "ca293206285920b3deb788b40d4ddd11", "score": "0.5680746", "text": "function State(charSpec) {\n\t this.charSpec = charSpec;\n\t this.nextStates = [];\n\t }", "title": "" }, { "docid": "d9fa67d6e060bec181c54e5ba4653003", "score": "0.56807244", "text": "function setState() {\n var stateString = arguments.length === 1 ? arguments[0] : arguments[1];\n state = JSON.parse(stateString);\n editor1.getDoc().setValue(state.default);\n runit(\"example1\");\n }", "title": "" }, { "docid": "4fc59708350de187f47d4d72f51d6b29", "score": "0.5668384", "text": "function GameState(machine, stateName) {\n\tthis.stateMachine = machine;\n\tthis.name = stateName;\n}", "title": "" }, { "docid": "d4c0c6f5e5ca533a2e479a32462516d8", "score": "0.5649073", "text": "function IDataStateManipulator() {}", "title": "" }, { "docid": "2d1daac5757c87ace89de41f651ac3ce", "score": "0.563313", "text": "function State(name) {\n this.stateName = name;\n}", "title": "" }, { "docid": "b103abcd45bbafe2ffba366a29a34e70", "score": "0.56149644", "text": "function Interpreter(machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n this.machine = machine;\n this.scheduler = new Scheduler();\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this._status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray$1(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this._status === InterpreterStatus.Stopped) {\n // do nothing\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\" + _event.name + \"\\\" was sent to stopped service \\\"\" + _this.machine.id + \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \" + JSON.stringify(_event.data));\n }\n\n return _this.state;\n }\n\n if (_this._status === InterpreterStatus.NotStarted && _this.options.deferEvents) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\" + _event.name + \"\\\" was sent to uninitialized service \\\"\" + _this.machine.id + \"\\\" and is deferred. Make sure .start() is called for this service.\\nEvent: \" + JSON.stringify(_event.data));\n }\n } else if (_this._status !== InterpreterStatus.Running) {\n throw new Error(\"Event \\\"\" + _event.name + \"\\\" was sent to uninitialized service \\\"\" + _this.machine.id + \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \" + JSON.stringify(_event.data));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this.nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isActor(to) ? to : _this.children.get(to) || registry.get(to);\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\" + to + \"' from service '\" + _this.id + \"'.\");\n } // tslint:disable-next-line:no-console\n\n\n if (!IS_PRODUCTION) {\n warn(false, \"Service '\" + _this.id + \"' has no parent: unable to send event \" + event.type);\n }\n\n return;\n }\n\n if ('machine' in target) {\n // Send SCXML events to machines\n target.send(__assign(__assign({}, event), {\n name: event.name === error ? \"\" + error$1(_this.id) : event.name,\n origin: _this.sessionId\n }));\n } else {\n // Send normal events to other targets\n target.send(event.data);\n }\n };\n\n var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }", "title": "" }, { "docid": "381166550fc34becf5cc030e58353699", "score": "0.5610264", "text": "enterState (state = this.Data) {\n this.State = state;\n }", "title": "" }, { "docid": "e932e9c607df96394fe2b5822f89aaec", "score": "0.5606624", "text": "function getState() {\n return currentState\n }", "title": "" }, { "docid": "78f23b7a0b3a9e46cb173fc69fad0a7a", "score": "0.56029487", "text": "function constructor(o) {\n const f = main.bind(o)\n o.current = o.states.initial || o.initial()\n o.machine = f\n return f\n}", "title": "" }, { "docid": "2d9bd721c6cd4fbb0f98bd1cdc7872ff", "score": "0.5570773", "text": "act(state){\n\n }", "title": "" }, { "docid": "55b14d09b8067e58771dad143a28da21", "score": "0.5556447", "text": "constructor(config) {\r\n this.initialState = config.initial;\r\n this.states = config.states;\r\n this.statesDone = new Stack();\r\n this.statesDone.push(this.initialState);\r\n this.statesUndone = new Stack();\r\n }", "title": "" }, { "docid": "f19e2efe211d2be92c9f6608a056fd88", "score": "0.5531961", "text": "function TextMachine( options ) {\n\tthis.program = options.program ;\n\tthis.api = options.api || {} ;\n\tthis.stateStack = null ;\n\n\t// TODO\n\t//this.offset = 0 ;\n\t//this.savedStateStack = [] ;\n\n\tthis.reset() ;\n}", "title": "" }, { "docid": "cb394222305ad78e4f25da08edd23980", "score": "0.5521632", "text": "get STATE_IDX() { return 0; }", "title": "" }, { "docid": "6a4c95db672fcbc563481b38ecfca878", "score": "0.5511495", "text": "getExampleInitialState(compiledCode) {\n if (compiledCode.indexOf('initialState') === -1) {\n return {};\n }\n\n return this.props.evalInContext(`\n\t\t\tvar state = {}, initialState = {};\n\t\t\ttry {\n\t\t\t\t${compiledCode};\n\t\t\t} catch (err) {}\n\t\t\treturn initialState;\n\t\t`)();\n }", "title": "" }, { "docid": "b4df8492800aa512f9634d591184378f", "score": "0.54884744", "text": "function Interpreter(machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n this.machine = machine;\n this.scheduler = new Scheduler();\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this.status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this.status === InterpreterStatus.Stopped) {\n // do nothing\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\" + _event.name + \"\\\" was sent to stopped service \\\"\" + _this.machine.id + \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \" + JSON.stringify(_event.data));\n }\n\n return _this.state;\n }\n\n if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n throw new Error(\"Event \\\"\" + _event.name + \"\\\" was sent to uninitialized service \\\"\" + _this.machine.id + \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \" + JSON.stringify(_event.data));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this.nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isString(to) ? _this.children.get(to) || registry.get(to) : isActor(to) ? to : undefined;\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\" + to + \"' from service '\" + _this.id + \"'.\");\n } // tslint:disable-next-line:no-console\n\n\n if (!IS_PRODUCTION) {\n warn(false, \"Service '\" + _this.id + \"' has no parent: unable to send event \" + event.type);\n }\n\n return;\n }\n\n if ('machine' in target) {\n // Send SCXML events to machines\n target.send(__assign(__assign({}, event), {\n name: event.name === error$1 ? \"\" + error(_this.id) : event.name,\n origin: _this.sessionId\n }));\n } else {\n // Send normal events to other targets\n target.send(event.data);\n }\n };\n\n var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }", "title": "" }, { "docid": "46ba6662edfecf92b03d26c76bcaa3db", "score": "0.54861003", "text": "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "title": "" }, { "docid": "8c7dd80c332fe751e5e5d8f7fef3ef29", "score": "0.54809904", "text": "set state (value) {\n this._mem.state = value;\n }", "title": "" }, { "docid": "3134bd147ffa113e44f408492c0c6f24", "score": "0.5471375", "text": "constructor({\n stateFactory, initialState, debug, debugFn,\n}) {\n /* Perform some sanity checking on arguments */\n// /* istanbul ignore if */\n// if (stateClasses == null || stateClasses.length === 0) {\n// throw new InvalidArgumentsError('stateClasses');\n// }\n /* Initialize instance junk that we can't do except through\n this method. */\n this._init();\n if (!debug) {\n debug = false;\n }\n if (debug && !debugFn) {\n // throw new Error(\"unexpected lack of debug function\");\n /* eslint-disable-next-line no-console */\n debugFn = console.log;\n }\n this.stateFactory = stateFactory;\n this.debugFn = debugFn;\n this.inputLines = undefined;\n this.inputOffset = 0;\n this.line = undefined;\n this.lineOffset = -1;\n this.debug = debug;\n this.initialState = initialState;\n this.currentState = initialState;\n this.states = {};\n if (!stateFactory) {\n throw new Error('need statefactory');\n }\n\n const stateClasses = stateFactory.getStateClasses();\n// console.log(typeof stateClasses);\n if (!isIterable(stateClasses)) {\n throw new Error(`expecting iterable, got ${stateClasses}`);\n }\n// console.log(stateClasses);\n this.addStates(stateClasses);\n this.observers = [];\n this._stderr = new ErrorOutput();\n }", "title": "" }, { "docid": "5ab1a01a0112ccd34045c36f2538dee6", "score": "0.5462713", "text": "get state() {return this._p.state;}", "title": "" }, { "docid": "1dcdc3930e6de312d4944908d48d4fc4", "score": "0.5455438", "text": "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "title": "" }, { "docid": "9c397952b937afefce10a12bd582cbb0", "score": "0.5455052", "text": "changeState(state) {\r\n if (!this.states[state]) throw new SyntaxError (\"there is no state\");\r\n\r\n if (!this.history[this.step+1] && this.history[this.step] !== state) {\r\n this.step++;\r\n this.history.push(state);\r\n }\r\n if (this.history[this.step+1] === state) ++this.step;\r\n this.currentState = state;\r\n }", "title": "" }, { "docid": "c8b582a91ba439de61bd1097b6df5e1f", "score": "0.54370517", "text": "during_setup(e) {\n\t\tlet state = e.state;\n\t\tif (state === undefined) state = this.old_state;\n\t\tthis.enter(state);\n\t}", "title": "" }, { "docid": "8417012bdf34c3ca19c3bbb7fe462c27", "score": "0.5427972", "text": "constructor(\n parent,\n stateChart,\n {concurrent, history, params, attrs, enter, exit, events, states, default:defaultState},\n name=nextStateUID++\n ){\n this.params = params;\n this.stateChart = stateChart;\n this.attrs = attrs || EMPTY_OBJ;\n this.enter = enter || NOOP;\n this.exit = exit || NOOP;\n\n var scState = this.scState = statechart.State(name, {\n name : name,\n concurrent : !!concurrent,\n history : !!history\n });\n\n if(params)\n scState.canEnter = (states, params)=>this._canEnter_checkParams(params);\n scState.enter(params=>this._doEnter(params));\n scState.exit(()=>this._doExit());\n\n if(events)\n Object.keys(events).\n forEach(eventName=>scState.event(eventName, events[eventName]))\n\n if(states)\n // Add the defaultState first, so the stateChart defaults to this state\n (defaultState && states[defaultState] ? [defaultState] : []).\n concat(Object.keys(states)).\n forEach(stateName=>\n scState.addSubstate(\n new State(\n this, stateChart, states[stateName], stateName\n ).scState\n )\n );\n }", "title": "" }, { "docid": "17c606e57c781bb6272166666789a56d", "score": "0.54194015", "text": "getState() {\n\n }", "title": "" }, { "docid": "06ccb54ccceb355d5e23a110e8e1f542", "score": "0.5417622", "text": "get defaultState() { return {}; }", "title": "" }, { "docid": "6157f2c6e1dcb9f5a0059ccb643f3ac4", "score": "0.5408464", "text": "constructor() {\n super(`stationary`);\n\n this.namedStates[`stationary`] = new PStationaryState(300, 36000);\n this.namedStates[`walk`] = new PWalkState(300, 18000);\n this.namedStates[`jump`] = new PJumpState(230);\n this.namedStates[`walkjump`] = new PJumpState(300);\n this.namedStates[`jumping`] = new PJumpingState(200, 12000);\n this.namedStates[`attack`] = new PPunchState();\n }", "title": "" }, { "docid": "1d09465ab3032b18a82176e0078c7487", "score": "0.5406938", "text": "function setState(state) { Object.keys(state).forEach(k => { window['state'][k] = state[k] }) }", "title": "" }, { "docid": "5404efa83eaa3cc63f0134b59e7ba8a0", "score": "0.5405758", "text": "function getState() {\n return currentState\n }", "title": "" }, { "docid": "08b7b22a7b9878ac3bfa3dbcc12e41d2", "score": "0.539927", "text": "function State(o) {\n\t/// The state's ID (as per GeNIe)\n\tthis.id = null;\n\t/// The state's index in the node state list\n\tthis.index = null;\n\n\t/// Set options based on constructor args\n\tfor (var i in o) {\n\t\tthis[i] = o[i];\n\t}\n\taddDefaultSetters(this);\n}", "title": "" }, { "docid": "62213ec8fdc2275f64e0c521567a8cf5", "score": "0.5398909", "text": "get state() { return this._state; }", "title": "" }, { "docid": "778c886d0f12c62a9768e2d2a0eab1bc", "score": "0.539805", "text": "function State(board, emitter) {\n var onitamaStringNotation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'abcde.axbxcXdxex.uxvxwXxxyx.1';\n\n _classCallCheck(this, State);\n\n this.emitter = emitter;\n this.board = board;\n this.deserialize(onitamaStringNotation);\n }", "title": "" }, { "docid": "8f8688da619f01af3841cf34659295ff", "score": "0.53875905", "text": "function tm() {\n function State () {\n this.transitions = new Array();\n };\n \n function Transition (inputSymbol, outputSymbol, stateChange, moveDirection) {\n this.input = inputSymbol;\n this.output = outputSymbol;\n this.state = stateChange;\n this.direction = moveDirection;\n };\n \n this.states = new Array();\n this.currentState = 0; //Current state is either positive integer N, -1 for accepting state or -2 for rejecting state\n this.currentChar = 0; //Gives character in input to be examined in nextStep()\n this.tape = new Array(null);\n \n this.setInput = function (chars) {\n var i = 0;\n this.tape = new Array(null);\n for (i = 0; i < chars.length; i++) {\n this.tape.push(chars[i]);\n }\n };\n \n this.resetMachine = function () {\n this.currentState = 0;\n this.currentChar = 0;\n };\n \n this.addState = function () {\n this.states.push(new State());\n return this.states.length - 1;\n };\n \n this.addTransition = function (startState, input, output, endState, move) {\n this.states[startState].transitions.push(new Transition(input, output, endState, move));\n };\n \n this.nextStep = function () {\n var i = 0, moved = false;\n if (this.currentChar == this.tape.length) {\n this.tape.push(null);\n }\n if (this.currentState >= 0 && this.currentChar >= 0) {\n while (moved === false && i < this.states[this.currentState].transitions.length) {\n if (this.states[this.currentState].transitions[i].input === this.tape[this.currentChar]) {\n this.tape[this.currentChar] = this.states[this.currentState].transitions[i].output;\n if (this.states[this.currentState].transitions[i].direction === \"L\") {\n this.currentChar -= 1;\n } else if (this.states[this.currentState].transitions[i].direction === \"R\") {\n this.currentChar += 1;\n }\n this.currentState = this.states[this.currentState].transitions[i].state;\n moved = true;\n }\n i++;\n }\n if (moved == false) {\n this.currentState = -2;\n }\n }\n };\n \n this.runToEnd = function () {\n while(this.currentState >= 0) {\n this.nextStep();\n }\n \n return this.currentState;\n }\n \n this.output = function () {\n if (this.currentState == -1) {\n return this.tape.slice(1);\n } else {\n return null;\n }\n }\n}", "title": "" }, { "docid": "798677386257920e092cbc666d313fb8", "score": "0.5384099", "text": "constructor() {\n super();\n this.state = defaultState;\n }", "title": "" }, { "docid": "e786d21170ded8dc45dff76880b95ed2", "score": "0.53836185", "text": "constructor(config) {\r\n this.initial = config.initial;\r\n this.states = config.states;\r\n this.currentState = this.initial;\r\n this.history = [this.initial];\r\n this.step = 0;\r\n }", "title": "" }, { "docid": "a5da7b593ee4c60f135cc96c2f8caaf5", "score": "0.53729033", "text": "function importState(state) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Load a state object created by exportState().\n\n\t\t\t\t\t}", "title": "" }, { "docid": "2ad41cd247caf390c80a029b393f1668", "score": "0.53681076", "text": "get state() {\n return this._initialState;\n }", "title": "" }, { "docid": "59fe7be4359d9a4a6ba16bbdf70b62da", "score": "0.5355328", "text": "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "title": "" }, { "docid": "a726552d7061e576adc739f556a65eb9", "score": "0.5347051", "text": "function Operand2EnteringState() {\n onStateChange(\"Operand2Entering state entered .. \");\n \n this.equalsIsEntered = false;\n\n this.operandEntered = (operand) => {\n \n if(!this.equalsIsEntered)\n displayBuffer.insertChar(operand);\n else {\n \n state = new ReadyState();\n state.operandEntered(operand);\n } \n };\n\n this.operatorEntered = (operator) => {\n if(!this.equalsIsEntered) {\n tokens.push(displayBuffer.getValueAsFloat());\n doCalculate(tokens, currentOperator);\n }\n displayBuffer.insertString(tokens.first());\n state = new OperatorEnteredState(operator);\n //} else \n // alert(tokens.pop()); \n };\n this.first = 0;\n this.equalsEntered = (operator) => {\n if(!this.equalsIsEntered) {\n this.equalsIsEntered = true;\n this.last = tokens.last();\n \n tokens.push(displayBuffer.getValueAsFloat());\n this.first = tokens.first();\n doCalculate(tokens, currentOperator);\n displayBuffer.clear();\n displayBuffer.insertString(tokens.first());\n } else {\n //alert(this.first + \" \" + tokens.first() + \" \" + tokens.last());\n tokens.push(this.first);\n doCalculate(tokens, currentOperator);\n displayBuffer.clear();\n displayBuffer.insertString(tokens.first());\n }\n tokens.list();\n \n //displayBuffer.clear();\n //state = new ReadyState();\n //state = new Operand1EnteringState();\n }\n }", "title": "" }, { "docid": "2c2757c5bb710e2befe5e2768fb60ba7", "score": "0.53459", "text": "constructor() {\n super(`none`);\n\n this.namedStates[`none`] = new CpmmonJudgeState();\n this.namedStates[`gameover`] = new CommonGameoverState();\n }", "title": "" }, { "docid": "e2f1452afc87ae2846776af8cd0bc27d", "score": "0.5345401", "text": "get_state() {\n return this.state;\n }", "title": "" }, { "docid": "0ff39e2b8b9177e26f8b663f9dddf376", "score": "0.5337309", "text": "_callState(cp) {\n switch (this.state) {\n case State.DATA: {\n this._stateData(cp);\n break;\n }\n case State.RCDATA: {\n this._stateRcdata(cp);\n break;\n }\n case State.RAWTEXT: {\n this._stateRawtext(cp);\n break;\n }\n case State.SCRIPT_DATA: {\n this._stateScriptData(cp);\n break;\n }\n case State.PLAINTEXT: {\n this._statePlaintext(cp);\n break;\n }\n case State.TAG_OPEN: {\n this._stateTagOpen(cp);\n break;\n }\n case State.END_TAG_OPEN: {\n this._stateEndTagOpen(cp);\n break;\n }\n case State.TAG_NAME: {\n this._stateTagName(cp);\n break;\n }\n case State.RCDATA_LESS_THAN_SIGN: {\n this._stateRcdataLessThanSign(cp);\n break;\n }\n case State.RCDATA_END_TAG_OPEN: {\n this._stateRcdataEndTagOpen(cp);\n break;\n }\n case State.RCDATA_END_TAG_NAME: {\n this._stateRcdataEndTagName(cp);\n break;\n }\n case State.RAWTEXT_LESS_THAN_SIGN: {\n this._stateRawtextLessThanSign(cp);\n break;\n }\n case State.RAWTEXT_END_TAG_OPEN: {\n this._stateRawtextEndTagOpen(cp);\n break;\n }\n case State.RAWTEXT_END_TAG_NAME: {\n this._stateRawtextEndTagName(cp);\n break;\n }\n case State.SCRIPT_DATA_LESS_THAN_SIGN: {\n this._stateScriptDataLessThanSign(cp);\n break;\n }\n case State.SCRIPT_DATA_END_TAG_OPEN: {\n this._stateScriptDataEndTagOpen(cp);\n break;\n }\n case State.SCRIPT_DATA_END_TAG_NAME: {\n this._stateScriptDataEndTagName(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPE_START: {\n this._stateScriptDataEscapeStart(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPE_START_DASH: {\n this._stateScriptDataEscapeStartDash(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED: {\n this._stateScriptDataEscaped(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_DASH: {\n this._stateScriptDataEscapedDash(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_DASH_DASH: {\n this._stateScriptDataEscapedDashDash(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {\n this._stateScriptDataEscapedLessThanSign(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {\n this._stateScriptDataEscapedEndTagOpen(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {\n this._stateScriptDataEscapedEndTagName(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPE_START: {\n this._stateScriptDataDoubleEscapeStart(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED: {\n this._stateScriptDataDoubleEscaped(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {\n this._stateScriptDataDoubleEscapedDash(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {\n this._stateScriptDataDoubleEscapedDashDash(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {\n this._stateScriptDataDoubleEscapedLessThanSign(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPE_END: {\n this._stateScriptDataDoubleEscapeEnd(cp);\n break;\n }\n case State.BEFORE_ATTRIBUTE_NAME: {\n this._stateBeforeAttributeName(cp);\n break;\n }\n case State.ATTRIBUTE_NAME: {\n this._stateAttributeName(cp);\n break;\n }\n case State.AFTER_ATTRIBUTE_NAME: {\n this._stateAfterAttributeName(cp);\n break;\n }\n case State.BEFORE_ATTRIBUTE_VALUE: {\n this._stateBeforeAttributeValue(cp);\n break;\n }\n case State.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {\n this._stateAttributeValueDoubleQuoted(cp);\n break;\n }\n case State.ATTRIBUTE_VALUE_SINGLE_QUOTED: {\n this._stateAttributeValueSingleQuoted(cp);\n break;\n }\n case State.ATTRIBUTE_VALUE_UNQUOTED: {\n this._stateAttributeValueUnquoted(cp);\n break;\n }\n case State.AFTER_ATTRIBUTE_VALUE_QUOTED: {\n this._stateAfterAttributeValueQuoted(cp);\n break;\n }\n case State.SELF_CLOSING_START_TAG: {\n this._stateSelfClosingStartTag(cp);\n break;\n }\n case State.BOGUS_COMMENT: {\n this._stateBogusComment(cp);\n break;\n }\n case State.MARKUP_DECLARATION_OPEN: {\n this._stateMarkupDeclarationOpen(cp);\n break;\n }\n case State.COMMENT_START: {\n this._stateCommentStart(cp);\n break;\n }\n case State.COMMENT_START_DASH: {\n this._stateCommentStartDash(cp);\n break;\n }\n case State.COMMENT: {\n this._stateComment(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN: {\n this._stateCommentLessThanSign(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN_BANG: {\n this._stateCommentLessThanSignBang(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN_BANG_DASH: {\n this._stateCommentLessThanSignBangDash(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {\n this._stateCommentLessThanSignBangDashDash(cp);\n break;\n }\n case State.COMMENT_END_DASH: {\n this._stateCommentEndDash(cp);\n break;\n }\n case State.COMMENT_END: {\n this._stateCommentEnd(cp);\n break;\n }\n case State.COMMENT_END_BANG: {\n this._stateCommentEndBang(cp);\n break;\n }\n case State.DOCTYPE: {\n this._stateDoctype(cp);\n break;\n }\n case State.BEFORE_DOCTYPE_NAME: {\n this._stateBeforeDoctypeName(cp);\n break;\n }\n case State.DOCTYPE_NAME: {\n this._stateDoctypeName(cp);\n break;\n }\n case State.AFTER_DOCTYPE_NAME: {\n this._stateAfterDoctypeName(cp);\n break;\n }\n case State.AFTER_DOCTYPE_PUBLIC_KEYWORD: {\n this._stateAfterDoctypePublicKeyword(cp);\n break;\n }\n case State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {\n this._stateBeforeDoctypePublicIdentifier(cp);\n break;\n }\n case State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {\n this._stateDoctypePublicIdentifierDoubleQuoted(cp);\n break;\n }\n case State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {\n this._stateDoctypePublicIdentifierSingleQuoted(cp);\n break;\n }\n case State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {\n this._stateAfterDoctypePublicIdentifier(cp);\n break;\n }\n case State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {\n this._stateBetweenDoctypePublicAndSystemIdentifiers(cp);\n break;\n }\n case State.AFTER_DOCTYPE_SYSTEM_KEYWORD: {\n this._stateAfterDoctypeSystemKeyword(cp);\n break;\n }\n case State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {\n this._stateBeforeDoctypeSystemIdentifier(cp);\n break;\n }\n case State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {\n this._stateDoctypeSystemIdentifierDoubleQuoted(cp);\n break;\n }\n case State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {\n this._stateDoctypeSystemIdentifierSingleQuoted(cp);\n break;\n }\n case State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {\n this._stateAfterDoctypeSystemIdentifier(cp);\n break;\n }\n case State.BOGUS_DOCTYPE: {\n this._stateBogusDoctype(cp);\n break;\n }\n case State.CDATA_SECTION: {\n this._stateCdataSection(cp);\n break;\n }\n case State.CDATA_SECTION_BRACKET: {\n this._stateCdataSectionBracket(cp);\n break;\n }\n case State.CDATA_SECTION_END: {\n this._stateCdataSectionEnd(cp);\n break;\n }\n case State.CHARACTER_REFERENCE: {\n this._stateCharacterReference(cp);\n break;\n }\n case State.NAMED_CHARACTER_REFERENCE: {\n this._stateNamedCharacterReference(cp);\n break;\n }\n case State.AMBIGUOUS_AMPERSAND: {\n this._stateAmbiguousAmpersand(cp);\n break;\n }\n case State.NUMERIC_CHARACTER_REFERENCE: {\n this._stateNumericCharacterReference(cp);\n break;\n }\n case State.HEXADEMICAL_CHARACTER_REFERENCE_START: {\n this._stateHexademicalCharacterReferenceStart(cp);\n break;\n }\n case State.HEXADEMICAL_CHARACTER_REFERENCE: {\n this._stateHexademicalCharacterReference(cp);\n break;\n }\n case State.DECIMAL_CHARACTER_REFERENCE: {\n this._stateDecimalCharacterReference(cp);\n break;\n }\n case State.NUMERIC_CHARACTER_REFERENCE_END: {\n this._stateNumericCharacterReferenceEnd(cp);\n break;\n }\n default: {\n throw new Error('Unknown state');\n }\n }\n }", "title": "" }, { "docid": "2e41fe95508158adcaa7b6d84d1e7c67", "score": "0.5336449", "text": "constructor() {\n super()\n this.state = initialState\n\n this.onImportSeed = this.onImportSeed.bind(this)\n this.onRun = this.onRun.bind(this)\n this.onStep = this.onStep.bind(this)\n this.onStop = this.onStop.bind(this)\n this.onClear = this.onClear.bind(this)\n this.onExportMap = this.onExportMap.bind(this)\n this.onRandomSeed = this.onRandomSeed.bind(this)\n }", "title": "" }, { "docid": "9e08766653b41784f397df64562c48a7", "score": "0.53326845", "text": "event(cntx) {\n// console.log('running from super class. Text: '+this._text);\n// this.call('init')('starting')\n try {\n if (!cntx.keystate)\n throw new fsmError(\"FSM error: missing current state\", e)\n let trans = this.eventListener(cntx)\n if (trans) {\n let nextstate = this.gotoNextstate(trans,cntx.logic)\n if (nextstate) {\n this.exitAction(cntx)\n this.effectAction(trans,cntx)\n cntx.keystate = nextstate.key\n this.entryAction(cntx)\n } else {\n throw new fsmError(\"FSM error: next state missing\", e);\n }\n } else {\n this.stayAction(cntx)\n }\n } catch(e) {\n console.log('Error: ' + e.name + \":\" + e.message + \"\\n\" + e.stack);\n } finally {\n let state = cntx.logic.states[cntx.keystate]\n if (state &&\n (!state.hasOwnProperty(\"transitions\") ||\n state.transitions.length == 0)) {\n cntx.complete = true\n }\n return cntx\n }\n }", "title": "" }, { "docid": "2b7b8d9c1f730ed3c1dcb3d96d25a511", "score": "0.53324616", "text": "init() {\n this.acc = [];\n this.operator = null;\n this.leftOperand = 0;\n this.rightOperand = 0;\n this.state = null;\n this.strategy = null;\n this.transition(STATE_LEFT_OPERAND);\n }", "title": "" }, { "docid": "0a9be9f5ad7a785e3bc5a8d5256a320d", "score": "0.53289664", "text": "get state() {\n return this._state$ || (this.state = this.defaultState);\n }", "title": "" }, { "docid": "e0473568f9f00457e8cb1b466c2affe3", "score": "0.5313118", "text": "constructor(config) {\r\n if(!config) throw new Error(\"Error! Config is empty!\");\r\n this.allStates = config.states;\r\n this.currentState = config.initial;\r\n this.historyStates = [];\r\n this.specialRedoArray = [];\r\n }", "title": "" }, { "docid": "e249cd7bd879d3d0a3cbd8adc4ebb08a", "score": "0.530363", "text": "constructor(config) {\r\n this.initial=config.initial;\r\n this.state=config.initial;\r\n this.states=config.states; \r\n this.statesStack=new LinkedList();\r\n this.undoStack=new LinkedList();\r\n return this;\r\n }", "title": "" }, { "docid": "212a051267f95287def62be5f23fb378", "score": "0.5301288", "text": "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "title": "" }, { "docid": "805bdc95047ff65dcd42645a06d028b0", "score": "0.52997786", "text": "function keyState() {\n this.P = P_ORIG.slice(0);\n this.S = S_ORIG.slice(0);\n this.offp = 0;\n}", "title": "" }, { "docid": "030593bd64bdcf43b9a81ed9bdb5e68c", "score": "0.52968305", "text": "function PseudoState(name, parent, kind) {\n if (kind === void 0) { kind = PseudoStateKind_1.PseudoStateKind.Initial; }\n var _this = this;\n this.name = name;\n this.kind = kind;\n /**\n * The outgoing transitions available from this vertex.\n */\n this.outgoing = [];\n this.parent = parent instanceof State_1.State ? parent.getDefaultRegion() : parent;\n this.qualifiedName = this.parent + \".\" + this.name;\n // if this is a starting state (initial, deep or shallow history), record it against the parent region\n if (this.kind === PseudoStateKind_1.PseudoStateKind.Initial || this.isHistory()) {\n util_1.assert.ok(!this.parent.starting, function () { return \"Only one initial pseudo state is allowed in region \" + _this.parent; });\n this.parent.starting = this;\n }\n this.parent.children.unshift(this);\n util_1.log.info(function () { return \"Created \" + _this; }, util_1.log.Create);\n }", "title": "" }, { "docid": "22c8ca728b5524199e34a1ab8e64439d", "score": "0.52924776", "text": "function getNextState(x) {\n x ^= x << 13;\n x ^= x >> 17;\n x ^= x << 5;\n return x;\n}", "title": "" }, { "docid": "6207fdb86cc1c3b9bddbae3fd58727a8", "score": "0.52921176", "text": "get state(){return this._state;}", "title": "" }, { "docid": "6207fdb86cc1c3b9bddbae3fd58727a8", "score": "0.52921176", "text": "get state(){return this._state;}", "title": "" }, { "docid": "6207fdb86cc1c3b9bddbae3fd58727a8", "score": "0.52921176", "text": "get state(){return this._state;}", "title": "" }, { "docid": "d38b2d1e1fb847ed6773126af528c8f1", "score": "0.5291427", "text": "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "title": "" }, { "docid": "7023c67873540d48bafdc47f98965a10", "score": "0.52913034", "text": "function Interpreter(machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n this.machine = machine;\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this.status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this.status === InterpreterStatus.Stopped) {\n // do nothing\n {\n warn(false, \"Event \\\"\".concat(_event.name, \"\\\" was sent to stopped service \\\"\").concat(_this.machine.id, \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n return _this.state;\n }\n\n if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n throw new Error(\"Event \\\"\".concat(_event.name, \"\\\" was sent to uninitialized service \\\"\").concat(_this.machine.id // tslint:disable-next-line:max-line-length\n , \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this.nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isString$1(to) ? _this.children.get(to) || registry.get(to) : isActor$1(to) ? to : undefined;\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\".concat(to, \"' from service '\").concat(_this.id, \"'.\"));\n } // tslint:disable-next-line:no-console\n\n\n {\n warn(false, \"Service '\".concat(_this.id, \"' has no parent: unable to send event \").concat(event.type));\n }\n\n return;\n }\n\n if ('machine' in target) {\n // Send SCXML events to machines\n target.send(__assign$3(__assign$3({}, event), {\n name: event.name === error$1 ? \"\".concat(error(_this.id)) : event.name,\n origin: _this.sessionId\n }));\n } else {\n // Send normal events to other targets\n target.send(event.data);\n }\n };\n\n var resolvedOptions = __assign$3(__assign$3({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }", "title": "" }, { "docid": "5b22f637e352221a2fbb7228a1a464b7", "score": "0.52830094", "text": "changeState(state) {\r\n if(!state) throw new Error(\"Error! State is empty!\");\r\n if(state in this.allStates) {\r\n this.historyStates.push(this.currentState);\r\n this.currentState = state;\r\n this.specialRedoArray = [];\r\n }\r\n else throw new Error(\"Error! Wrong state!\");\r\n }", "title": "" } ]
889c5e1d06b78009891c7f95ca688761
unitsTravelled() takes in known motion equation values and returns a distance in unspecifed units
[ { "docid": "88b7a1a76e3b382b8d114073f2219d82", "score": "0.68858624", "text": "function unitsTravelled(speed, time, acceleration) {\n return (speed * time) + (acceleration * time * time / 2);\n}", "title": "" } ]
[ { "docid": "058ed3ba7604befa8ac2ed375d227cfe", "score": "0.55778635", "text": "function calculateDistance(calories, weight) {\n\t// multiply by 1.60934 to convert from miles to meters\n\t// divide by two because we assume user will walk both to and from taco bell\n\treturn ((calories / (weight * 0.5)) * 1609.34) / 2;\n}", "title": "" }, { "docid": "4eeb14d8524b9e6bc32a850504a6f8ef", "score": "0.55587244", "text": "function getTravelingDistance (paths) {\n let total = 0\n let lastPt = paths[0][paths[0].length - 1]\n for (let path of paths.slice(1)) {\n const squaredDist = squaredDistance(lastPt, path[0])\n total += Math.sqrt(squaredDist)\n lastPt = path[path.length - 1]\n }\n return total\n}", "title": "" }, { "docid": "8923c5c8c70001efdc9103b737f81598", "score": "0.55001324", "text": "function distance(unit) {\n if (unit === \"celsius\") {\n return \"km\"\n } else {\n return \"miles\"\n }\n}", "title": "" }, { "docid": "5ec41c8f4a231355053798ed8600d838", "score": "0.5469751", "text": "distance() {\n if ( this.inXR() ) {\n return this.distanceXR;\n } else {\n return this.distanceWeb;\n }\n }", "title": "" }, { "docid": "555c2df1b5f35d207dd9af4fc15166b0", "score": "0.5396413", "text": "function time_delta() {\n if( livemap.currentLatlng === null || livemap.destLatlng === null ) {\n return \"--:--\";\n } else {\n var speed = Session.get('speed');\n if( speed < 10 ) { speed=10; }\n var distance = google.maps.geometry.spherical.computeDistanceBetween( livemap.currentLatlng, livemap.destLatlng, 3956.6); // 3956.6 = miles\n return distance / speed * 1000;\n }\n}", "title": "" }, { "docid": "37d136682f7586303313d8c1a6551529", "score": "0.531219", "text": "function timeToWalk(steps, meters, speed) {\r\n\r\n let metersInKm = meters / 1000;\r\n let totalDistanceKM = metersInKm * steps;\r\n let timeInHours = totalDistanceKM / speed;\r\n let timeInMinutes = Number((timeInHours * 60).toFixed(2));\r\n\r\n let hours = getTheHours(timeInHours);\r\n let minutes = getTheMinutes(timeInMinutes);\r\n let seconds = getTheSeconds(timeInMinutes);\r\n\r\n let breaks = Math.floor((totalDistanceKM * 1000) / 500);\r\n\r\n if ((minutes + breaks) > 59) {\r\n minutes = minutes + breaks - 60;\r\n } else {\r\n minutes += breaks;\r\n }\r\n\r\n if (seconds >= 0 && seconds <= 9) {\r\n let newSeconds = `0${seconds}`;\r\n seconds = newSeconds;\r\n }\r\n\r\n if (minutes >= 0 && minutes <= 9) {\r\n let newMinutes = `0${minutes}`;\r\n minutes = newMinutes;\r\n }\r\n\r\n if (hours >= 0 && hours <= 9) {\r\n let newHours = `0${hours}`;\r\n hours = newHours;\r\n }\r\n\r\n console.log(`${hours}:${minutes}:${seconds}`);\r\n\r\n function getTheSeconds(minutes) {\r\n let seconds = Math.ceil(Math.abs(Math.floor(minutes) * 60 - (minutes * 60)));\r\n return seconds;\r\n }\r\n\r\n function getTheMinutes(hours) {\r\n let minutes = Math.floor(hours);\r\n return minutes;\r\n }\r\n\r\n function getTheHours(hours) {\r\n let hour = Number((hours).toFixed(0));\r\n return hour;\r\n }\r\n}", "title": "" }, { "docid": "698867100fe549bef0cf796105a1dee1", "score": "0.5310201", "text": "function getUnits() {\n if (!documents.length) return '';\n var key = activeDocument.rulerUnits.toString().replace('RulerUnits.', '');\n switch (key) {\n case 'Pixels': return 'px';\n case 'Points': return 'pt';\n case 'Picas': return 'pc';\n case 'Inches': return 'in';\n case 'Millimeters': return 'mm';\n case 'Centimeters': return 'cm';\n // Added in CC 2023 v27.1.1\n case 'Meters': return 'm';\n case 'Feet': return 'ft';\n case 'FeetInches': return 'ft';\n case 'Yards': return 'yd';\n // Parse new units in CC 2020-2023 if a document is saved\n case 'Unknown':\n var xmp = activeDocument.XMPString;\n if (/stDim:unit/i.test(xmp)) {\n var units = /<stDim:unit>(.*?)<\\/stDim:unit>/g.exec(xmp)[1];\n if (units == 'Meters') return 'm';\n if (units == 'Feet') return 'ft';\n if (units == 'FeetInches') return 'ft';\n if (units == 'Yards') return 'yd';\n return 'px';\n }\n break;\n default: return 'px';\n }\n}", "title": "" }, { "docid": "698867100fe549bef0cf796105a1dee1", "score": "0.5310201", "text": "function getUnits() {\n if (!documents.length) return '';\n var key = activeDocument.rulerUnits.toString().replace('RulerUnits.', '');\n switch (key) {\n case 'Pixels': return 'px';\n case 'Points': return 'pt';\n case 'Picas': return 'pc';\n case 'Inches': return 'in';\n case 'Millimeters': return 'mm';\n case 'Centimeters': return 'cm';\n // Added in CC 2023 v27.1.1\n case 'Meters': return 'm';\n case 'Feet': return 'ft';\n case 'FeetInches': return 'ft';\n case 'Yards': return 'yd';\n // Parse new units in CC 2020-2023 if a document is saved\n case 'Unknown':\n var xmp = activeDocument.XMPString;\n if (/stDim:unit/i.test(xmp)) {\n var units = /<stDim:unit>(.*?)<\\/stDim:unit>/g.exec(xmp)[1];\n if (units == 'Meters') return 'm';\n if (units == 'Feet') return 'ft';\n if (units == 'FeetInches') return 'ft';\n if (units == 'Yards') return 'yd';\n return 'px';\n }\n break;\n default: return 'px';\n }\n}", "title": "" }, { "docid": "ade0f0a0eb8f7014f24f93e20d41cc8a", "score": "0.528236", "text": "function calculatedistance(lat1, lon1, lat2, lon2, unit) {\n\t\n\tconsole.log(\"function:calculatedistance\");\n\t\n\tvar radlat1 = Math.PI * lat1/180;\n\tvar radlat2 = Math.PI * lat2/180;\n\tvar radlon1 = Math.PI * lon1/180;\n\tvar radlon2 = Math.PI * lon2/180;\n\tvar theta = lon1-lon2;\n\tvar radtheta = Math.PI * theta/180;\n\tvar dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n\tdist = Math.acos(dist);\n\tdist = dist * 180/Math.PI;\n\tdist = dist * 60 * 1.1515;\n\tif (unit==\"K\") { dist = dist * 1.609344 };\n\tif (unit==\"N\") { dist = dist * 0.8684 };\n\treturn dist;\n}", "title": "" }, { "docid": "f9b4cfd7e278abe56d046d9d1cbd80d4", "score": "0.5275963", "text": "getMoveUnit(){return this._moveUnits;}", "title": "" }, { "docid": "44449a1de855d06ce22d4e519cdb2a91", "score": "0.52386445", "text": "static evaluate_tour(tour) {\n var d = 0;\n for (var i = 1; i < tour.length; i++) {\n d += TSP_problem.distance(cities[tour[i-1]], cities[tour[i]]);\n }\n return d;\n }", "title": "" }, { "docid": "c101abc0bf069e7360ca93638a3472e8", "score": "0.52260137", "text": "function computeTotalDistance(result) {\r\n var total = 0;\r\n var totalTime = 0;\r\n var myroute = result.routes[0];\r\n for (var i = 0; i < myroute.legs.length; i++) {\r\n total += myroute.legs[i].distance.value;\r\n totalTime += myroute.legs[i].duration.value;\r\n }\r\n total = total / 1000;\r\n document.getElementById('total').innerHTML = total + ' km <br>' + (totalTime/60) + ' min with ' + 'DRIVING';\r\n }", "title": "" }, { "docid": "324659c719a24628a02d02fc92f2841a", "score": "0.52168995", "text": "function calcSpeedsWGS84(coords) {\n var speeds = []\n for (var i = 0; i < coords.length; i++) {\n var current = coords[i]\n\n var next = {};\n if (i < coords.length - 1) {\n next = coords[i + 1]\n }\n else {\n next = coords[i]\n }\n\n var distanceTravelledKm = distance(current[0], current[1], next[0], next[1], \"K\")\n var distanceTravelledM = distanceTravelledKm / 1000\n\n var timeGapInms = next[2] - current[2]\n var timeInSeconds = timeGapInms / 1000\n\n var speedMetresPerSecond = distanceTravelledM / timeInSeconds\n\n speeds.push(speedMetresPerSecond)\n\n }\n return speeds\n}", "title": "" }, { "docid": "b549a27c693e0cf4d551054f6c4d0ea5", "score": "0.52107346", "text": "function calcDistance(result) {\n var totalDist = 0;\n var myRoute = result.routes[0];\n var legDist = result.routes[0].legs[0].distance.value;\n\n for (var i = 0; i < myRoute.legs.length; i++) {\n totalDist += myRoute.legs[i].distance.value;\n }\n\n totalDist = Number(totalDist * 0.000621371192).toFixed(2);\n firstLegDist = Number(legDist * 0.000621371192).toFixed(2);\n\n document.getElementById(\"results\").innerHTML = totalDist + \" miles\"\n document.getElementById(\"summary\").innerHTML = \"Distance: \" + firstLegDist + \" miles\";\n}", "title": "" }, { "docid": "372065e04712117ce5cd0d9a23f16ff7", "score": "0.51911473", "text": "blocksTravelled(){\n let horizontalDistance = this.avenueToInteger(this.endingLocation.horizontal) - this.avenueToInteger(this.beginningLocation.horizontal)\n let verticalDistance = this.endingLocation.vertical - this.beginningLocation.vertical\n return (Math.abs(horizontalDistance) + Math.abs(verticalDistance))\n}", "title": "" }, { "docid": "6717a5ab2c4e3833cf927da86c6b3a78", "score": "0.518661", "text": "get originalDistanceMeasurement() {\n let distance = this._entity.attributes.units || this._unit_system.length || '';\n\n if (this.isGoogle) {\n distance = this._entity.attributes.distance || 0;\n distance = distance.replace(/[0-9\\. ]/g, '');\n };\n\n return distance;\n }", "title": "" }, { "docid": "724f180cd4e4c6f931b5c90037761c36", "score": "0.5179758", "text": "function DenormUnits(uspec, actval)\n{\n var a = uspec[0], b = uspec[1], f = uspec[2];\n var c = uspec[3], d = uspec[4], m = uspec[5];\n \n if (m > 0 && m < 1 && m != 0.5) {\n\tif (actval < 0.5) {\n\t actval = 2 * actval * m;\n\t} else {\n\t //actval = m + (1 - m) * (2 * actval - 0.5);\n\t //actval = m + (1 - m) * (2 * actval - 1);\n\t actval = (2 * actval - 1) * (1 - m) + m;\n\t}\n }\n \n actval = (actval - d) / c;\n \n if (f == 'x') {}\n else if (f == 'log10') actval = Math.pow(10, actval);\n else if (f == 'pow10') actval = Math.log10(actval);\n else if (f == 'exp') actval = Math.log(actval);\n else if (f == 'log') actval = Math.exp(actval);\n else if (f == 'inv') actval = 1/actval;\n \n actval = (actval - b) / a;\n \n return actval;\n}", "title": "" }, { "docid": "08c2af7abc2bf217deb8dcc8127d7511", "score": "0.5168643", "text": "calculatePinchDistanceInWorldSpace() {\n if (this.m_touchState.touches.length < 2) {\n return 0;\n }\n if (this.mapView.projection.type === geoUtils.ProjectionType.Planar) {\n const previousDistance = this.m_tmpVector3\n .subVectors(this.m_touchState.touches[0].initialWorldPosition, this.m_touchState.touches[1].initialWorldPosition)\n .length();\n const currentDistance = this.m_tmpVector3\n .subVectors(this.m_touchState.touches[0].currentWorldPosition, this.m_touchState.touches[1].currentWorldPosition)\n .length();\n return currentDistance - previousDistance;\n }\n else if (this.mapView.projection.type === geoUtils.ProjectionType.Spherical) {\n const previousDistance = this.m_tmpVector2\n .subVectors(this.m_touchState.touches[0].lastTouchPoint, this.m_touchState.touches[1].lastTouchPoint)\n .length();\n const currentDistance = this.m_tmpVector2\n .subVectors(this.m_touchState.touches[0].currentTouchPoint, this.m_touchState.touches[1].currentTouchPoint)\n .length();\n return currentDistance - previousDistance;\n }\n return 0;\n }", "title": "" }, { "docid": "021f64eead34035a553acfd7d26be48d", "score": "0.5153128", "text": "function getMiles(meters) {\n\t\treturn meters * 0.000621371192;\n\t}", "title": "" }, { "docid": "a64054749d06ab9337dc368d5ea139a9", "score": "0.5142722", "text": "function calculateVelocity() {\n return velocity = (1/n) * ((calculateHydaulicRadius())**(2/3))*(getSlope()**(1/2)); //unit in m/sec\n}", "title": "" }, { "docid": "d7a3b0aa54bc89f8d2e9a6ba99f9541e", "score": "0.51338214", "text": "function getTravelTime(distance) {\n return speed => distance / speed;\n}", "title": "" }, { "docid": "2c43797ed8472461de369de7245ceac6", "score": "0.51205677", "text": "distanceMeasure(observations) {\n return tf.tidy(() => {\n const pertubedPredictions = this.perturbedActor.model.predict(observations);\n const predictions = this.actor.model.predict(observations);\n\n const distance = tf.square(pertubedPredictions.sub(predictions)).mean().sqrt();\n return distance;\n });\n }", "title": "" }, { "docid": "8dc461b947d0d6a582f939fba445f052", "score": "0.5101251", "text": "function calcdistance(lat1, lon1, lat2, lon2, unit) {\n if ((lat1 == lat2) && (lon1 == lon2)) {\n return 0;\n }\n else {\n var radlat1 = Math.PI * lat1/180;\n var radlat2 = Math.PI * lat2/180;\n var theta = lon1-lon2;\n var radtheta = Math.PI * theta/180;\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n if (dist > 1) {\n dist = 1;\n }\n dist = Math.acos(dist);\n dist = dist * 180/Math.PI;\n dist = dist * 60 * 1.1515;\n if (unit==\"K\") { dist = dist * 1.609344 }\n if (unit==\"N\") { dist = dist * 0.8684 }\n return dist;\n }\n}", "title": "" }, { "docid": "12dae55b7a43d8177c1bc90854a0d22c", "score": "0.50974673", "text": "function getEstimatedSteps(l, km) {\n return (km * 1000) / l;\n }", "title": "" }, { "docid": "02cf246d5ce54e823731a251a2f26827", "score": "0.5082142", "text": "function getTravelPath(oLat, oLong, dLat, dLong)\r\n{\r\n var resultsP = service.getDistanceMatrix(\r\n {\r\n origins: [new google.maps.LatLng(oLat, oLong)],\r\n destinations: [new google.maps.LatLng(dLat, dLong)],\r\n travelMode: 'WALKING',\r\n/* transitOptions: TransitOption\r\n drivingOptions:DrivingOptions,\r\n unitSystem: UnitSystem,\r\n avoidHighways: Boolean,\r\n avoidTolls: Boolean,*/\r\n }, callback);\r\n\r\n\r\n if (resultsP != null) {\r\n return resultsP / 60; //minutes\r\n }\r\n\r\n return 100000000; //big number, @TODO: make it a value outside range of totalTime or smnthn\r\n}", "title": "" }, { "docid": "71384b7e4da150a964d10304a6a9649d", "score": "0.50789297", "text": "function conDist(val, from, to) {\n if(from == 'meters' && to == 'miles') {\n var temp = 0.00062137 * val;\n return temp.toFixed(2);\n }\n }", "title": "" }, { "docid": "1448b2a86019bb591f235defef6f97b3", "score": "0.5077964", "text": "function computeTotalDistance(result) {\n var total = 0;\n var myroute = result.routes[0];\n for (var i = 0; i < myroute.legs.length; i++) {\n total += myroute.legs[i].distance.value;\n }\n total = total / 1000;\n document.getElementById('total').innerHTML = total + ' km';\n }", "title": "" }, { "docid": "ac5b86b3ef519fb830c4416377d5e9a8", "score": "0.5077304", "text": "function calculateDistance(lat1,lon1,lat2,lon2,unit){\r\n\tvar radlat1=Math.PI*lat1/180;\r\n\tvar radlat2=Math.PI*lat2/180;\r\n\tvar radlon1=Math.PI*lon1/180;\r\n\tvar radlon2=Math.PI*lon2/180;\r\n\tvar theta = lon1-lon2;\r\n\tvar radtheta = Math.PI * theta/180;\r\n\tvar subAngle = Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta);\r\n\tsubAngle = Math.acos(subAngle);\r\n\tsubAngle = subAngle*180/Math.PI; //convert the degree value returned by acos back to degrees from radians\r\n\tdist = (subAngle/360)*2*Math.PI*3956;// ((subtended angle in degrees)/360)*2*pi*radius)\r\n\t\t\t\t\t\t\t\t\t\t//where radius of the earth is 3956 miles\r\n\tif(unit=='K'){dist=dist*1.609344;}//convert miles to km\r\n\tif(unit=='N'){dist=dist*0.8684;}//convert to nautical miles\r\n\treturn dist;\r\n}", "title": "" }, { "docid": "d9d5f5e742f419a54e4d05032e9a2735", "score": "0.50629056", "text": "function calculateTravelTime(distance, speed) {\n return distance * 3600 / (speed * 1000)\n}", "title": "" }, { "docid": "b1c3b379009fcb258f242145acb177c7", "score": "0.5056441", "text": "function caluculateDistance() {\n return Math.round(Math.sqrt(Math.pow(end.x - start.x, 2) + Math.pow(end.y - start.y, 2)));\n }", "title": "" }, { "docid": "1054a53ab6609f6931a65770faf13314", "score": "0.50550705", "text": "function calculateDistance(lat1, lon1, lat2, lon2, unit) {\r\n\tvar radlat1 = Math.PI * lat1/180;\r\n\tvar radlat2 = Math.PI * lat2/180;\r\n\tvar radlon1 = Math.PI * lon1/180;\r\n\tvar radlon2 = Math.PI * lon2/180;\r\n\tvar theta = lon1-lon2;\r\n\tvar radtheta = Math.PI * theta/180;\r\n\tvar subAngle = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\r\n\tsubAngle = Math.acos(subAngle);\r\n\tsubAngle = subAngle * 180/Math.PI; // convert the degree value returned by acos back to degrees from radians\r\n\tdist = (subAngle/360) * 2 * Math.PI * 3956; // ((subtended angle in degrees)/360) * 2 * pi * radius )\r\n // where radius of the earth is 3956 miles\r\n\tif (unit==\"K\") { dist = dist * 1.609344 ;} // convert miles to km\r\n\tif (unit==\"N\") { dist = dist * 0.8684 ;} // convert miles to nautical miles\r\n\treturn dist;\r\n}", "title": "" }, { "docid": "08915a6e5eafba17e2ce3949c3bdde3e", "score": "0.5050232", "text": "_calcDistance(newCoord) {\n const prevCoord = this.state.prevCoordinate;\n let km = haversine(prevCoord, newCoord) || 0;\n let mi = km * 0.6213711922;\n \n return mi;\n }", "title": "" }, { "docid": "337968e5ec2e665742c015be4264736c", "score": "0.50446326", "text": "function computeTotalDistance(result) {\n var total = 0;\n var myroute = result.routes[0];\n for (i = 0; i < myroute.legs.length; i++) {\n total += myroute.legs[i].distance.value;\n }\n total = total / 1000.\n document.getElementById('total').innerHTML = total + ' km';\n}", "title": "" }, { "docid": "ca7ffa7e3711c79ba22b303fdad83e27", "score": "0.5034972", "text": "function howLong(distance, velocity) {\n\n\tvar travelled = 0;\n\tvar days = 0;\n\n\twhile (travelled < distance) {\n\t\ttravelled += velocity;\n\t\tvelocity *= 1.05;\n\t\tdays++;\n\t}\n\n\treturn days;\n}", "title": "" }, { "docid": "eb8acc53a147c3fdafb1e2623afd4e0d", "score": "0.5014295", "text": "function hv_velocity( data_dist_meters) {\n\t\tif(data_dist_meters == 0) {\n\t\t\tcentripetalAcceleration = '0.0';\n\t\t} else {\n\t\t\tcentripetalAcceleration = Math.pow( speedVal, 2 ) / ( data_dist_meters );\n\t\t\t\n\t\t}\n\t\thVelocity = speedVal * Math.cos( bCarAngle );\n\t\tvVelocity = speedVal * Math.sin( bCarAngle );\n\t\treturn [hVelocity, vVelocity];\n\t}", "title": "" }, { "docid": "9ffb86f2f5dbfc1befe69cc0819229e5", "score": "0.5009393", "text": "get Distance() {}", "title": "" }, { "docid": "21fea6f72ae84d66a46b7e9cbdc74412", "score": "0.5008009", "text": "calculateVelocity(){\n\t\tlet veloc = p5.Vector.sub(this.Pos2, this.Pos1);\n\t\tveloc.div(50);\n\t\treturn veloc;\n\t}", "title": "" }, { "docid": "f9d02230bb5169793042d6ad1bb93fa5", "score": "0.5004165", "text": "function calculateDistance(lat1, lon1, lat2, lon2, unit) {\r\n\tvar radlat1 = Math.PI * lat1/180;\r\n\tvar radlat2 = Math.PI * lat2/180;\r\n\tvar radlon1 = Math.PI * lon1/180;\r\n\tvar radlon2 = Math.PI * lon2/180;\r\n\tvar theta = lon1-lon2;\r\n\tvar radtheta = Math.PI * theta/180;\r\n\tvar subAngle = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\r\n\tsubAngle = Math.acos(subAngle);\r\n\tsubAngle = subAngle * 180/Math.PI; // convert the degree value returned by acos back to degrees from radians\r\n\tdist = (subAngle/360) * 2 * Math.PI * 3956; // ((subtended angle in degrees)/360) * 2 * pi * radius )\r\n\t// where radius of the earth is 3956 miles\r\n\tif (unit==\"K\") { dist = dist * 1.609344 ;} // convert miles to km\r\n\tif (unit==\"N\") { dist = dist * 0.8684 ;} // convert miles to nautical miles\r\n\treturn dist;\r\n\t}", "title": "" }, { "docid": "16db9099f3e82fce904216d19fbf8450", "score": "0.5001294", "text": "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "title": "" }, { "docid": "71c92fd781d378b3b273f13970f9aeda", "score": "0.49834403", "text": "function getVelocity(multiplier = 3.2) {\n let divs = Number(document.getElementById('changeDivs').value)\n if (divs >= 260) {\n return 1 * multiplier\n } else if (divs >= 210) {\n return 2 * multiplier\n } else if (divs >= 166) {\n return 5 * multiplier\n } else if (divs >= 136) {\n return 8 * multiplier\n } else if (divs >= 120) {\n return 10 * multiplier\n } else if (divs >= 79) {\n return 12 * multiplier\n } else if (divs >= 63) {\n return 15 * multiplier\n } else if (divs >= 50) {\n return 20 * multiplier\n } else if (divs >= 45) {\n return 25 * multiplier\n } else if (divs >= 35) {\n return 30 * multiplier\n } else if (divs >= 29) {\n return 40* multiplier\n } else if (divs >= 25) {\n return 50* multiplier\n } else if (divs >= 23) {\n return 60 * multiplier\n } else if (divs >= 18) {\n return 70 * multiplier\n } else if (divs >= 15) {\n return 80 * multiplier\n } else if (divs >= 13) {\n return 90 * multiplier\n } else if (divs >= 5) {\n return 100 * multiplier\n }\n}", "title": "" }, { "docid": "38037f4cbf3b2029e452145e80e3ef2e", "score": "0.49774557", "text": "function dx(n) {\n\t\t\t\t\t\t\t\t\treturn (n * projection.translate()[0]) / width\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "bcb43d3a175a9cfc077be42de928feec", "score": "0.49711388", "text": "function calculateDistances() {\r\n var service = new google.maps.DistanceMatrixService();\r\n service.getDistanceMatrix(\r\n {\r\n origins: [origin],\r\n destinations: [destination],\r\n travelMode: google.maps.TravelMode.WALKING,\r\n unitSystem: google.maps.UnitSystem.IMPERIAL,\r\n avoidHighways: true,\r\n avoidTolls: true\r\n }, callback);\r\n}", "title": "" }, { "docid": "7c9467d162c8252850ad0d80922f96c9", "score": "0.49589214", "text": "function dx(n) {\r\n return (n * projection.translate()[0]) / width\r\n }", "title": "" }, { "docid": "69c145282617d057a7c7e36967e1bd29", "score": "0.49452105", "text": "function kmToMiles (kilometers) {\n let mi = kilometers * 0.6214;\n console.log(mi);\n}", "title": "" }, { "docid": "fd85d916c0262bccf8bfef6c85344574", "score": "0.4936028", "text": "getDistance() {\n if (this.totalDistance === 0) {\n let citiesDistance = 0;\n for (let i = 0; i < this.citiesLength(); i++) {\n let fromCity = this.getCity(i); \n let destCity;\n \n if (i + 1 < this.citiesLength()) {\n destCity = this.getCity(i + 1);\n } else {\n destCity = this.getCity(0);\n }\n\n citiesDistance += fromCity.distanceTo(destCity);\n }\n this.totalDistance = citiesDistance;\n }\n return this.totalDistance;\n }", "title": "" }, { "docid": "8c6a2b099bc5f32c4838b7427273484b", "score": "0.49306485", "text": "function _setDistanceUnits(units) {\n\n // Check argument.\n if (!units) {\n console.log('[Tailwind] Error: Invalid units passed to _setDistanceUnits()');\n return;\n }\n\n // Set unit system.\n switch(units) {\n\n case 'metric':\n DISTANCE_UNITS = google.maps.UnitSystem.METRIC;\n break;\n\n case 'imperial':\n DISTANCE_UNITS = google.maps.UnitSystem.IMPERIAL;\n break;\n\n default:\n console.log('[Tailwind] Error: invalid units.', units);\n\n }\n\n // Recalculate and re-render directions for the route.\n intent = 'direct';\n _getDirections();\n\n // Recalculate and re-render elevation data for all points on the route.\n _requestElevations();\n }", "title": "" }, { "docid": "2fc1ec8ac57fcb77d90f9b39dff9b64e", "score": "0.4924752", "text": "function unitChangeHandler() {\n let distanceUnit = $('#distance-unit');\n let hasChanged = distanceUnit.html() !== $(this).text();\n let distance = document.getElementById(\"camera-distance\");\n distanceUnit.html($(this).text());\n if (hasChanged) {\n if (distanceUnit.html() === \"Inches\") {\n distance.value = metresToInches(distance.value)\n } else {\n distance.value = inchesToMetres(distance.value)\n }\n }\n}", "title": "" }, { "docid": "3921af00f44bea0b2bb0ae400e0f5f6d", "score": "0.49049714", "text": "function updateUnits() {\n\tconst speedUnits = document.querySelectorAll('[data-speed-unit]');\n\tconst tempUnits = document.querySelectorAll('[data-temp-unit]');\n\tspeedUnits.forEach((unit) => {\n\t\tunit.innerText = isMetric() ? 'm/s' : 'km/h';\n\t});\n\ttempUnits.forEach((unit) => {\n\t\tunit.innerText = isMetric() ? 'C' : 'F';\n\t});\n}", "title": "" }, { "docid": "835adb7e4c24366a9be700b60eb35510", "score": "0.4900926", "text": "countEstimatedDistance() {\r\n let estimated = 0;\r\n let x = 0;\r\n let y = 0;\r\n let sideCount = this.sideCount();\r\n\r\n for (let i = 0; i < this.values.length; i++) {\r\n if (this.values[i] !== 0) {\r\n x = Math.abs((this.values[i] % sideCount) - (i % sideCount));\r\n y = Math.abs((Math.floor(this.values[i] / sideCount)) - (Math.floor(i / sideCount)));\r\n\r\n estimated = estimated + x + y;\r\n }\r\n }\r\n\r\n return estimated;\r\n }", "title": "" }, { "docid": "a55f5782f79d7a7f4792f2816bd69133", "score": "0.4898598", "text": "function m(t,n,r){return t.units[n][r]}", "title": "" }, { "docid": "83ce018a0e6da5792411d23d42ba9dab", "score": "0.48868218", "text": "function calculateMoveDistance() {\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n let moveDistance = 0;\n\n if (diceRoll.length !== 0) {\n moveDistance = diceRoll.reduce(reducer);\n if (moveDistance === 0) {\n moveDistance = 6;\n }\n }\n else {\n return null;\n }\n return moveDistance;\n }", "title": "" }, { "docid": "119a653525adb3e6bb8d5502ac4b3c7a", "score": "0.48811603", "text": "function dist() {\n if(layBread){\n setCurrentLocation();\n var R = 20903520; // Earth's radius in feet\n var φ1 = prevLocation.coords.latitude.toRadians();\n var φ2 = currentLocation.coords.latitude.toRadians();\n var Δφ = φ1 - φ2;\n var Δλ = (prevLocation.coords.longitude - currentLocation.coords.longitude).toRadians();\n\n var a = Math.sin(Δφ/2) * Math.sin(Δφ/2) +\n Math.cos(φ1) * Math.cos(φ2) *\n Math.sin(Δλ/2) * Math.sin(Δλ/2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\n var d = R * c;\n if(Math.abs(d) > 5){\n return;\n }\n else{\n crumbs.push(prevLocation);\n prevLocation = currentLocation;\n }\n }\n else{\n recoverCrumbs();\n }\n}", "title": "" }, { "docid": "f94d5a8e7d525acdd14ced2ace9bd40e", "score": "0.48781663", "text": "function distanceInMeter(){\n var lat1, lat2, lng1, lng2, e, f, g, h;\n if (arguments[0] instanceof google.maps.LatLng){\n lat1 = arguments[0].lat();\n lng1 = arguments[0].lng();\n if (arguments[1] instanceof google.maps.LatLng){\n lat2 = arguments[1].lat();\n lng2 = arguments[1].lng();\n } else {\n lat2 = arguments[1];\n lng2 = arguments[2];\n }\n } else {\n lat1 = arguments[0];\n lng1 = arguments[1];\n if (arguments[2] instanceof google.maps.LatLng){\n lat2 = arguments[2].lat();\n lng2 = arguments[2].lng();\n } else {\n lat2 = arguments[2];\n lng2 = arguments[3];\n }\n }\n e = Math.PI*lat1/180;\n f = Math.PI*lng1/180;\n g = Math.PI*lat2/180;\n h = Math.PI*lng2/180;\n return 1000*6371 * Math.acos(Math.min(Math.cos(e)*Math.cos(g)*Math.cos(f)*Math.cos(h)+Math.cos(e)*Math.sin(f)*Math.cos(g)*Math.sin(h)+Math.sin(e)*Math.sin(g),1));\n }", "title": "" }, { "docid": "f94d5a8e7d525acdd14ced2ace9bd40e", "score": "0.48781663", "text": "function distanceInMeter(){\n var lat1, lat2, lng1, lng2, e, f, g, h;\n if (arguments[0] instanceof google.maps.LatLng){\n lat1 = arguments[0].lat();\n lng1 = arguments[0].lng();\n if (arguments[1] instanceof google.maps.LatLng){\n lat2 = arguments[1].lat();\n lng2 = arguments[1].lng();\n } else {\n lat2 = arguments[1];\n lng2 = arguments[2];\n }\n } else {\n lat1 = arguments[0];\n lng1 = arguments[1];\n if (arguments[2] instanceof google.maps.LatLng){\n lat2 = arguments[2].lat();\n lng2 = arguments[2].lng();\n } else {\n lat2 = arguments[2];\n lng2 = arguments[3];\n }\n }\n e = Math.PI*lat1/180;\n f = Math.PI*lng1/180;\n g = Math.PI*lat2/180;\n h = Math.PI*lng2/180;\n return 1000*6371 * Math.acos(Math.min(Math.cos(e)*Math.cos(g)*Math.cos(f)*Math.cos(h)+Math.cos(e)*Math.sin(f)*Math.cos(g)*Math.sin(h)+Math.sin(e)*Math.sin(g),1));\n }", "title": "" }, { "docid": "37ec750f343839639c6fb8ed1ca7008e", "score": "0.4872767", "text": "function calculateDistance(lat1, lon1, lat2, lon2, unit) {\n var radlat1 = Math.PI * lat1 / 180;\n var radlat2 = Math.PI * lat2 / 180;\n var radlon1 = Math.PI * lon1 / 180;\n var radlon2 = Math.PI * lon2 / 180;\n var theta = lon1 - lon2;\n var radtheta = Math.PI * theta / 180;\n var subAngle = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n subAngle = Math.acos(subAngle);\n subAngle = subAngle * 180 / Math.PI; // convert the degree value returned by acos back to degrees from radians\n dist = (subAngle / 360) * 2 * Math.PI * 3956; // ((subtended angle in degrees)/360) * 2 * pi * radius )\n if (unit == \"K\") {\n dist = dist * 1.609344;\n } // convert miles to km\n if (unit == \"N\") {\n dist = dist * 0.8684;\n } // convert miles to nautical miles return dist;\n return dist;\n}", "title": "" }, { "docid": "459764bbc721854a5bbc86ca28a8eb87", "score": "0.48703012", "text": "function createTotalDistanceMi(getMiles,checkFeet){\r\n if(checkFeet == 'ft'){\r\n totalDistanceMi += getMiles / 5280;\r\n }\r\n else{\r\n totalDistanceMi += getMiles * 1;\r\n }\r\n return totalDistanceMi;\r\n}", "title": "" }, { "docid": "f87b2a4230478b2f795e28162d7e8abf", "score": "0.4869855", "text": "function metersToMiles(meters) {\n // calculation for converting mps to mph\n var miles = meters * (25 / 11);\n // add rounded mph to page\n $(\".wind\").text(\"Wind: \" + Math.ceil(miles) + \" mph\");\n }", "title": "" }, { "docid": "0c2341e2f9909d12b2bb92c94471215a", "score": "0.4866827", "text": "getRouteDistance(obj) {\n let result = 0;\n // get all parts of route from object returned from google direction service\n const routes = obj.routes[0].legs;\n routes.forEach((item) => {\n result += item.distance.value;\n });\n return Math.round(result / 10) / 100;\n }", "title": "" }, { "docid": "387ed9432a9f7354eeb0355000f569f6", "score": "0.48513588", "text": "function travel1(dir, dist, lor) {\r\n let xDiff = 0\r\n let yDiff = 0\r\n if (dir == \"U\") {\r\n for (let i=0; i<dist; i++) {\r\n lor++\r\n wire1.push([x, (y+i), lor-1])\r\n }\r\n yDiff = dist\r\n } else if (dir == \"D\") {\r\n for (let i=0; i<dist; i++) {\r\n lor++\r\n wire1.push([x, (y-i), lor-1])\r\n }\r\n yDiff = -dist\r\n } else if (dir == \"R\") {\r\n for (let i=0; i<dist; i++) {\r\n lor++\r\n wire1.push([(x+i), y, lor-1])\r\n }\r\n xDiff = dist\r\n } else {\r\n // left\r\n for (let i=0; i<dist; i++) {\r\n lor++\r\n wire1.push([(x-i), y, lor-1])\r\n }\r\n xDiff = -dist\r\n }\r\n x += xDiff\r\n y += yDiff\r\n lengthOfRoute += dist\r\n}", "title": "" }, { "docid": "449b3b3959af75d0719be951d5f398bc", "score": "0.4850943", "text": "calculateDistance()\n {\n return this.rotationAngle * this.radius;\n }", "title": "" }, { "docid": "4433644eab3bc6b57a995a2a72794e93", "score": "0.484724", "text": "function moveStep(hereCoord, thereCoord, moveDistance) {\r\n\t\t\t\t\tvar distCoord,\r\n\t\t\t\t\tfullDistance,\r\n\t\t\t\t\tratio,\r\n\t\t\t\t\tratioVector,\r\n\t\t\t\t\tresult;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdistCoord = thereCoord.sub(hereCoord);\r\n\t\t\t\t\tfullDistance = distCoord.length;\r\n\t\t\t\t\tif (moveDistance > fullDistance) {\r\n\t\t\t\t\t\t// The move distance will over-shoot the target, so just return the destination.\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tcoord : thereCoord,\r\n\t\t\t\t\t\t\tarrived : true\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t\tratio = moveDistance / fullDistance;\r\n\t\t\t\t\tratioVector = new Vector(ratio, ratio);\r\n\t\t\t\t\tresult = hereCoord.add(distCoord).mul(ratioVector);\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tcoord : result,\r\n\t\t\t\t\t\tarrived : false\r\n\t\t\t\t\t};\r\n\t\t\t\t}", "title": "" }, { "docid": "a479f22895b31ed358e9574914dbc6f5", "score": "0.48383778", "text": "function getUnits(string) {\n\treturn string.match(/\\d\\.\\d(?=$| )/g)[0];\n}", "title": "" }, { "docid": "a0cc60099ea584d8afc34d06f29d2468", "score": "0.48338756", "text": "static get metresToMiles() { return 1/1609.344; }", "title": "" }, { "docid": "a97cdb73e84969c0e8fd28d501226e7f", "score": "0.4825497", "text": "function getSecondsPerMoveFloat() {\r\n if (debug && console && console.log) {\r\n console.log(\"getSecondsPerMoveStr = \" + parseFloat(getSecondsPerMoveStr()));\r\n }\r\n var mpm = $(\"#msPerMove\").val();\r\n if (debug && console && console.log) {\r\n console.log(\"499 mpm = \" + mpm + \"; getSecondsPerMoveStr = \" + getSecondsPerMoveStr() + \"; parseFloat(getSecondsPerMoveStr()) = \" + parseFloat(getSecondsPerMoveStr()));\r\n }\r\n return parseFloat(getSecondsPerMoveStr());\r\n}", "title": "" }, { "docid": "218355b3f5814050d990e7aa760e8cd6", "score": "0.4823394", "text": "function r$2(e){if(null==e)return null;if(\"number\"==typeof e)return e;let r=e.toLowerCase();switch(r=r.replace(/\\s/g,\"\"),r=r.replace(/-/g,\"\"),r){case\"meters\":case\"meter\":case\"m\":case\"squaremeters\":case\"squaremeter\":return 109404;case\"miles\":case\"mile\":case\"squaremile\":case\"squaremiles\":return 109439;case\"kilometers\":case\"kilometer\":case\"squarekilometers\":case\"squarekilometer\":case\"km\":return 109414;case\"acres\":case\"acre\":case\"ac\":return 109402;case\"hectares\":case\"hectare\":case\"ha\":return 109401;case\"yard\":case\"yd\":case\"yards\":case\"squareyards\":case\"squareyard\":return 109442;case\"feet\":case\"ft\":case\"foot\":case\"squarefeet\":case\"squarefoot\":return 109405;case\"nm\":case\"nmi\":case\"nauticalmile\":case\"nauticalmiles\":case\"squarenauticalmile\":case\"squarenauticalmiles\":return 109409}return null}", "title": "" }, { "docid": "321f1fc57d21679fa65dd2694b4aaa53", "score": "0.48225522", "text": "function convertMetersToMiles(meters){\n var miles = (meters * 1609.34);\n return miles;\n}", "title": "" }, { "docid": "c4a5ef9e40a8c09088fce0b87708d347", "score": "0.48213872", "text": "function calculateVariables() {\n torque = Kv * (current - I0);\n acceleration = torque / (mass * radius);\n maxAngularVelocity = (voltage - (current * Rm)) / Kv;\n maxLinearVelocity = maxAngularVelocity * radius;\n\n current = parseFloat(current).toFixed(2);\n voltage = parseFloat(voltage).toFixed(2);\n torque = parseFloat(torque).toFixed(2);\n acceleration = parseFloat(acceleration).toFixed(2);\n maxAngularVelocity = parseFloat(maxAngularVelocity).toFixed(2);\n maxLinearVelocity = parseFloat(maxLinearVelocity).toFixed(2);\n console.log(\"MAX LINEAR VELOCITY: \" + maxLinearVelocity);\n // maxLinearVelocity ranges from 14 -> 165, hence\n actualTime = Math.sqrt(100 * 2 / acceleration);\n pathTime = 8 - (6 * (acceleration - 1.48) / 3.27);\n}", "title": "" }, { "docid": "3f3002373f6a25aae2bfb45dff6210dc", "score": "0.48171398", "text": "function totalDistance(){\r\n var distanceSum = 0;\r\n for (let index = 0; index < distPointToPoint.length; index++) { //iterationg over the underlying distances\r\n distanceSum += distPointToPoint[index]; //add the distance\r\n }\r\n distanceSum = Math.round(distanceSum * 1000) / 1000;\r\n return distanceSum;\r\n}", "title": "" }, { "docid": "00942aa884271a4e503dba3b097854c8", "score": "0.48148507", "text": "get relativeVelocity() {}", "title": "" }, { "docid": "d0a6f50e5d01e9ba39b840c7615a3988", "score": "0.4814462", "text": "function distanceCalculator(destinationLatitude, destinationLongitude) {\n const sourceLatitude = cityCoordinate.latitude;\n const sourceLongitude= cityCoordinate.longitude;\n\tif ((sourceLatitude == destinationLatitude) && (sourceLongitude == destinationLongitude)) {\n\t\treturn 0;\n\t} else {\n\t\tconst distanceLength = Math.sin((Math.PI * (destinationLatitude - sourceLatitude) / 180)/2) * Math.sin((Math.PI * (destinationLatitude - sourceLatitude) / 180)/2) +\n (Math.cos(Math.PI * sourceLatitude / 180)) * (Math.cos(Math.PI * destinationLatitude / 180)) * Math.sin((Math.PI * (destinationLongitude - sourceLongitude) / 180)/2) *\n Math.sin((Math.PI * (destinationLongitude - sourceLongitude) / 180)/2);\n\t\tconst angularDistanceRadius = 2 * Math.atan2(Math.sqrt(distanceLength), Math.sqrt(1-distanceLength)); // Converting angular distance in radians\n const distance = ((6371 * 1000) * angularDistanceRadius)/1000;\n\t\tif (distanceUnit == \"M\") { distance = distance / 1.609344 }\n\t\treturn distance;\n\t}\n}", "title": "" }, { "docid": "bc927bb52a711a841c580701a6476f8b", "score": "0.48113775", "text": "calculateDistanceBetweenPositions(coords) {\n const line = new Openlayers.geom.LineString(coords)\n const sphereLength = Openlayers.Sphere.getLength(line)\n\n return sphereLength\n }", "title": "" }, { "docid": "21a3e23fd516508a7f88f60ee0e3b470", "score": "0.48112184", "text": "function distanceDelta() {\n if (markersArray && markersArray.length === 2) {\n return distanceBetweenMarkers(markersArray[0], markersArray[1]);\n }\n\n return null;\n}", "title": "" }, { "docid": "d5a48dcda6d1719440b3026b69f53208", "score": "0.4802565", "text": "function distance(lat1, lon1, lat2, lon2, unit) {\n var radlat1 = Math.PI * lat1 / 180\n var radlat2 = Math.PI * lat2 / 180\n var radlon1 = Math.PI * lon1 / 180\n var radlon2 = Math.PI * lon2 / 180\n var theta = lon1 - lon2\n var radtheta = Math.PI * theta / 180\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n dist = Math.acos(dist)\n dist = dist * 180 / Math.PI\n dist = dist * 60 * 1.1515\n if (unit == \"K\") { dist = dist * 1.609344 }\n if (unit == \"N\") { dist = dist * 0.8684 }\n return dist\n}", "title": "" }, { "docid": "20a30538069bde90730e90f1240e9f82", "score": "0.47835073", "text": "updateUnits() {\n // only move the next player's units.\n if (this.game.currentPlayer === this.game.players[0]) {\n // iterate over each unit to check the dashing status.\n for (const unit of this.game.players[0].units) {\n // set the protector to undefined as units have moved.\n unit.protector = undefined;\n // make it so the unit can act again\n unit.acted = false;\n // check if the unit is dashing.\n if (unit.isBusy) {\n // update it's location and conditions.\n unit.x = unit.dashX;\n unit.dashX = -1000;\n unit.y = unit.dashY;\n unit.dashY = -1000;\n unit.isBusy = false;\n }\n // resets the units moves.\n unit.moves = unit.job.moves;\n }\n }\n else {\n // iterate over each unit to check the dashing status.\n for (const unit of this.game.players[1].units) {\n // set the protector to undefined as units have moved.\n unit.protector = undefined;\n // make it so the unit can act again\n unit.acted = false;\n // check if the unit is dashing.\n if (unit.isBusy) {\n // update it's location and conditions.\n unit.x = unit.dashX;\n unit.dashX = -1000;\n unit.y = unit.dashY;\n unit.dashY = -1000;\n unit.isBusy = false;\n }\n // resets the units moves.\n unit.moves = unit.job.moves;\n }\n }\n // recharges player 0's home base.\n this.game.players[0].homeBase.amount += this.game.planetRechargeRate;\n // makes sure it stays below the energy cap.\n if (this.game.players[0].homeBase.amount > this.game.planetEnergyCap) {\n this.game.players[0].homeBase.amount = this.game.planetEnergyCap;\n }\n // recharges player 1's home base.\n this.game.players[1].homeBase.amount += this.game.planetRechargeRate;\n // makes sure it stays below the energy cap.\n if (this.game.players[1].homeBase.amount > this.game.planetEnergyCap) {\n this.game.players[1].homeBase.amount = this.game.planetEnergyCap;\n }\n // for each player, update martyr protection.\n this.updateMartyr(0);\n this.updateMartyr(1);\n // safety return.\n return;\n }", "title": "" }, { "docid": "0392ccd7e5e998359ad3025c5df79d8d", "score": "0.47828916", "text": "function getduration(mylatlang, tujuan) {\n service = new google.maps.DistanceMatrixService;\n service.getDistanceMatrix({\n origins: [mylatlang],\n destinations: [tujuan],\n travelMode: 'DRIVING',\n unitSystem: google.maps.UnitSystem.METRIC,\n avoidHighways: false,\n avoidTolls: false\n }, function(response, status) {\n element = response.rows[0].elements[0];\n\n $scope.distance = element.distance.text;\n console.log('distance tenant : ', $scope.distance);\n\n var abc = element.duration.text;\n\n var bcd = \"\" + abc.length;\n\n if (bcd >= 9) {\n $scope.durationH = abc.slice(0, 2);\n $scope.durationM = abc.slice(6, 8);\n } else if (bcd <= 8) {\n $scope.durationM = abc.slice(0, 2);\n $scope.durationH = null;\n } else {\n console.log('it cannnot be done');\n }\n\n });\n }", "title": "" }, { "docid": "d70b00c538261b91098a94753462e976", "score": "0.47809505", "text": "function calculateVelocity() {\n\t\t\t\tcurrentTime = (new Date).getTime();\n\t\t\t\tperiod = currentTime - previousTime;\n\t\t\t\tpreviousTime = currentTime;\n\t\t\t\tif (numSamples++) {\n\t\t\t\t\tvelocityX = (velocityX * (numSamples - 1) + numSamples * (translationX - previousTranslationX) / period) / 2 / numSamples;\n\t\t\t\t\tvelocityY = (velocityY * (numSamples - 1) + numSamples * (translationY - previousTranslationY) / period) / 2 / numSamples;\n\t\t\t\t} else {\n\t\t\t\t\tvelocityX = (translationX - startTranslationX) / period;\n\t\t\t\t\tvelocityY = (translationY - startTranslationY) / period;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d70b00c538261b91098a94753462e976", "score": "0.47809505", "text": "function calculateVelocity() {\n\t\t\t\tcurrentTime = (new Date).getTime();\n\t\t\t\tperiod = currentTime - previousTime;\n\t\t\t\tpreviousTime = currentTime;\n\t\t\t\tif (numSamples++) {\n\t\t\t\t\tvelocityX = (velocityX * (numSamples - 1) + numSamples * (translationX - previousTranslationX) / period) / 2 / numSamples;\n\t\t\t\t\tvelocityY = (velocityY * (numSamples - 1) + numSamples * (translationY - previousTranslationY) / period) / 2 / numSamples;\n\t\t\t\t} else {\n\t\t\t\t\tvelocityX = (translationX - startTranslationX) / period;\n\t\t\t\t\tvelocityY = (translationY - startTranslationY) / period;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "e22b55346aa767c610d33088e6284a15", "score": "0.47717562", "text": "_getMinDistance(msStart, msTarget, msSearch, isGoUp) {\n let result = null;\n let resultDistance = null;\n\n let accumulator = 1;\n let nextApply = 2; // We apply 2, 5 and 10 as multiplier and divider to search for the best suitable tick step size\n\n let prevDistance = null;\n for (let i = 0; i < 10000; i++) { // Watch dog to not suddenly go into an eternal loop\n const current = isGoUp\n ? msStart * accumulator\n : msStart / accumulator;\n const offset = current - msTarget;\n const distance = Math.abs(offset);\n\n // Check maybe we found a good distance\n const isDistanceAllowed = (distance <= msSearch) || (offset > 0);\n if (isDistanceAllowed) {\n if ((resultDistance === null) || (resultDistance > distance)) {\n result = current;\n resultDistance = distance;\n }\n }\n\n // Check maybe it's time to finish search, because we have started to go away from the target\n if ((prevDistance !== null) && (prevDistance < distance)) {\n break;\n }\n prevDistance = distance;\n\n // Increase the accumulator\n switch (nextApply) {\n case 2:\n accumulator *= 2;\n nextApply = 5;\n break;\n case 5:\n accumulator /= 2;\n accumulator *= 5;\n nextApply = 10;\n break;\n case 10:\n accumulator /= 5;\n accumulator *= 10;\n nextApply = 2;\n break;\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "6c0064fd2db87b1c2ba9d269a2d244c8", "score": "0.47643825", "text": "function extruction_value(){\n\tdistance = modules.line_distance( old_x, x, old_y, y);\n\tdistance = distance * extruder_mod;\n\tdistance = Math.round(distance*100)/100;\n\treturn distance; \n}", "title": "" }, { "docid": "9108a399e1990b9df265b253a6be1af0", "score": "0.47641978", "text": "function distance(lat1, lon1, lat2, lon2, unit) {\n if (lat1 == lat2 && lon1 == lon2) {\n return 0;\n } else {\n var radlat1 = (Math.PI * lat1) / 180;\n var radlat2 = (Math.PI * lat2) / 180;\n var theta = lon1 - lon2;\n var radtheta = (Math.PI * theta) / 180;\n var dist =\n Math.sin(radlat1) * Math.sin(radlat2) +\n Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n if (dist > 1) {\n dist = 1;\n }\n dist = Math.acos(dist);\n dist = (dist * 180) / Math.PI;\n dist = dist * 60 * 1.1515;\n if (unit == \"K\") {\n dist = dist * 1.609344;\n }\n if (unit == \"N\") {\n dist = dist * 0.8684;\n }\n return dist;\n }\n }", "title": "" }, { "docid": "9108a399e1990b9df265b253a6be1af0", "score": "0.47641978", "text": "function distance(lat1, lon1, lat2, lon2, unit) {\n if (lat1 == lat2 && lon1 == lon2) {\n return 0;\n } else {\n var radlat1 = (Math.PI * lat1) / 180;\n var radlat2 = (Math.PI * lat2) / 180;\n var theta = lon1 - lon2;\n var radtheta = (Math.PI * theta) / 180;\n var dist =\n Math.sin(radlat1) * Math.sin(radlat2) +\n Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n if (dist > 1) {\n dist = 1;\n }\n dist = Math.acos(dist);\n dist = (dist * 180) / Math.PI;\n dist = dist * 60 * 1.1515;\n if (unit == \"K\") {\n dist = dist * 1.609344;\n }\n if (unit == \"N\") {\n dist = dist * 0.8684;\n }\n return dist;\n }\n }", "title": "" }, { "docid": "7bc1ccc9d9582e5b5a3304b729075b2a", "score": "0.47629187", "text": "function getDistance(Lat1, Long1, Lat2, Long2, Unit) {\n var x, km\n x = Math.acos((Math.sin(degToRads(Lat1)) * Math.sin(degToRads(Lat2)) + Math.cos(degToRads(Lat1)) * Math.cos(degToRads(Lat2)) * Math.cos(Math.abs((degToRads(Long2))-(degToRads(Long1))))));\n km = 1.852 * 60.0 * ((x/Math.PI)*180);\n\n switch(Unit.toLowerCase()) {\n case \"mi\":\n return (km / 1.609344);\n break;\n case \"nmi\":\n return (km / 1.852);\n break;\n default:\n return km;\n } //end of switch\n}", "title": "" }, { "docid": "7c646f243eddbc354daae118e3ed1751", "score": "0.4762553", "text": "calcDistance(newLatLng) {\n const { prevLatLng } = this.state;\n return haversine(prevLatLng, newLatLng) || 0;\n }", "title": "" }, { "docid": "ac972142fe41b244f4311bbabbb281e5", "score": "0.4760386", "text": "function computeTotalDistance(result) {\n var total = 0;\n var time_route = 0;\n var minutes = 0;\n var heures = 0;\n var myroute = result.routes[0];\n var origine = document.getElementById('origin-input').value;\n var dest = document.getElementById('destination-input').value;\n\n for (i = 0; i < myroute.legs.length; i++) {\n total += myroute.legs[i].distance.value;\n time_route += myroute.legs[i].duration.value;\n }\n total = Math.round(total / 1000);\n document.getElementById('distance').textContent = \"Distance : \" + total + \" km \" ;\n\n if (time_route > 3600){\n heures = time_route / 3600;\n minutes = (heures - Math.round(heures))*60;\n heures = Math.round(heures);\n minutes = Math.abs(Math.round(minutes));\n if (minutes==0){\n document.getElementById('duree').textContent = \"Durée : \" + heures + \" H\";\n }else{\n document.getElementById('duree').textContent = \"Durée : \" + heures + \" H et \" + minutes + \" min\";\n }\n }else{\n time_route = Math.round(time_route / 60);\n document.getElementById('duree').textContent = \"Durée : \" + time_route + \" min\";\n }\n\n document.getElementById('mode-transport').textContent = \"Bonne route !\";\n\n}", "title": "" }, { "docid": "8cb161874a57f74f8e571e1f71cf0fda", "score": "0.47594434", "text": "getResult() { return this.distanceTransform; }", "title": "" }, { "docid": "b828016017b1d5831319d83f3a4b2cea", "score": "0.47584304", "text": "function reduceUnits(units) {\n var reducedUnits = [0, 0, 0, 0, 0, 0, 0];\n for (var i = 0; i < units.length; i++) {\n reducedUnits = addBaseUnits(reducedUnits, Units.properties[Math.abs(units[i])].baseUnits, units[i] < 0);\n }\n return reducedUnits;\n}", "title": "" }, { "docid": "3172e0cb6a9a7fc9d66ccaf92527e538", "score": "0.47569963", "text": "function distance(lat1, lon1, lat2, lon2, unit) {\n var radlat1 = Math.PI * lat1/180\n var radlat2 = Math.PI * lat2/180\n var radlon1 = Math.PI * lon1/180\n var radlon2 = Math.PI * lon2/180\n var theta = lon1-lon2\n var radtheta = Math.PI * theta/180\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n dist = Math.acos(dist)\n dist = dist * 180/Math.PI\n dist = dist * 60 * 1.1515\n if (unit==='K') { dist = dist * 1.609344 }\n if (unit==='N') { dist = dist * 0.8684 }\n return dist;\n}", "title": "" }, { "docid": "e9a9eb90e0e3555cce27757625dd4f56", "score": "0.475464", "text": "function math_distance(args){\n args['decimals'] = args['decimals'] !== void 0\n ? args['decimals']\n : math_decimals;\n\n return math_round({\n 'decimals': args['decimals'],\n 'number': Math.sqrt(\n Math.pow(\n args['x0'] - args['x1'],\n 2\n ) + Math.pow(\n args['y0'] - args['y1'],\n 2\n )\n ),\n });\n}", "title": "" }, { "docid": "f2a19a3d8d9aacd48df4061ca2df85f3", "score": "0.4753706", "text": "function getUnits(units)\n{\nif (!units || units === 'fahrenheit') return (config.units)\nreturn(\"metric\")\n}", "title": "" }, { "docid": "27c218a7bab47b79c254828bc9ddd036", "score": "0.47532824", "text": "function convertMetersToMiles(meters) {\n\treturn meters * 0.000621371;\n}", "title": "" }, { "docid": "5d3be942c2950ef59a9d33c9bf7b8fe1", "score": "0.47505835", "text": "function calculateUnitRatios () {\n /* The properties below are used to determine whether the element differs sufficiently from this same call's\n prior element (in the overall element set) to also differ in its unit conversion ratios. If the properties\n match up with those of the prior element, the prior element's conversion ratios are used. Like most optimizations\n in Velocity, this is done to minimize DOM querying. */\n var sameRatioIndicators = {\n parent: element.parentNode, /* GET */\n position: CSS.getPropertyValue(element, \"position\"), /* GET */\n fontSize: CSS.getPropertyValue(element, \"fontSize\") /* GET */\n },\n /* Determine if the same % ratio can be used. % is relative to the element's position value and the parent's width and height dimensions. */\n sameBasePercent = ((sameRatioIndicators.position === unitConversionRatios.lastPosition) && (sameRatioIndicators.parent === unitConversionRatios.lastParent)),\n /* Determine if the same em ratio can be used. em is relative to the element's fontSize, which itself is relative to the parent's fontSize. */\n sameBaseEm = ((sameRatioIndicators.fontSize === unitConversionRatios.lastFontSize) && (sameRatioIndicators.parent === unitConversionRatios.lastParent));\n\n /* Store these ratio indicators call-wide for the next element to compare against. */\n unitConversionRatios.lastParent = sameRatioIndicators.parent;\n unitConversionRatios.lastPosition = sameRatioIndicators.position;\n unitConversionRatios.lastFontSize = sameRatioIndicators.fontSize;\n\n /* Whereas % and em ratios are determined on a per-element basis, the rem unit type only needs to be checked\n once per call since it is exclusively dependant upon document.body's fontSize. If this is the first time\n that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null, so we calculate it now. */\n if (unitConversionRatios.remToPx === null) {\n /* Default to most browsers' default fontSize of 16px in the case of 0. */\n unitConversionRatios.remToPx = parseFloat(CSS.getPropertyValue(document.body, \"fontSize\")) || 16; /* GET */\n }\n\n /* The viewport units are relative to the window's inner dimensions. */\n if (unitConversionRatios.vwToPx === null) {\n unitConversionRatios.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */\n unitConversionRatios.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */\n }\n\n var originalValues = {\n /* To accurately and consistently calculate conversion ratios, the element's overflow and box-sizing are temporarily removed.\n Both properties modify an element's visible dimensions. */\n /* Note: Overflow must be manipulated on a per-axis basis since the plain overflow property overwrites its subproperties' values. */\n overflowX: null,\n overflowY: null,\n boxSizing: null,\n /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios.\n Since they can be artificially constrained by their min-/max- equivalents, those properties are converted as well. */\n width: null,\n minWidth: null,\n maxWidth: null,\n height: null,\n minHeight: null,\n maxHeight: null,\n /* paddingLeft arbitrarily acts as our proxy for the em ratio. */\n paddingLeft: null\n },\n elementUnitRatios = {},\n /* Note: IE<=8 round to the nearest pixel when returning CSS values, thus we perform conversions using a measurement\n of 10 (instead of 1) to give our ratios a precision of at least 1 decimal value. */\n measurement = 10;\n\n /* For organizational purposes, current ratio calculations are consolidated onto the elementUnitRatios object. */\n elementUnitRatios.remToPx = unitConversionRatios.remToPx;\n elementUnitRatios.vwToPx = unitConversionRatios.vwToPx;\n elementUnitRatios.vhToPx = unitConversionRatios.vhToPx;\n\n /* After temporary unit conversion logic runs, width and height properties that were originally set to \"auto\" must be set back\n to \"auto\" instead of to the actual corresponding pixel value. Leaving the values at their hard-coded pixel value equivalents\n would inherently prevent the elements from vertically adjusting as the height of its inner content changes. */\n /* IE tells us whether or not the property is set to \"auto\". Other browsers provide no way of determing \"auto\" values on height/width,\n and thus we have to trigger additional layout thrashing (see below) to solve this. */\n if (IE && !Data(element).isSVG) {\n var isIEWidthAuto = /^auto$/i.test(element.currentStyle.width),\n isIEHeightAuto = /^auto$/i.test(element.currentStyle.height);\n }\n\n /* Note: To minimize layout thrashing, the ensuing unit conversion logic is split into batches to synchronize GETs and SETs. */\n if (!sameBasePercent || !sameBaseEm) {\n /* SVG elements have no concept of document flow, and don't support the full range of CSS properties,\n so we skip the unnecessary stripping of unapplied properties to avoid dirtying their HTML. */\n if (!Data(element).isSVG) {\n originalValues.overflowX = CSS.getPropertyValue(element, \"overflowX\"); /* GET */\n originalValues.overflowY = CSS.getPropertyValue(element, \"overflowY\"); /* GET */\n originalValues.boxSizing = CSS.getPropertyValue(element, \"boxSizing\"); /* GET */\n\n /* Since % values are relative to their respective axes, ratios are calculated for both width and height.\n In contrast, only a single ratio is required for rem and em. */\n /* When calculating % values, we set a flag to indiciate that we want the computed value instead of offsetWidth/Height,\n which incorporate additional dimensions (such as padding and border-width) into their values. */\n originalValues.minWidth = CSS.getPropertyValue(element, \"minWidth\"); /* GET */\n /* Note: max-width/height must default to \"none\" when 0 is returned, otherwise the element cannot have its width/height set. */\n originalValues.maxWidth = CSS.getPropertyValue(element, \"maxWidth\") || \"none\"; /* GET */\n\n originalValues.minHeight = CSS.getPropertyValue(element, \"minHeight\"); /* GET */\n originalValues.maxHeight = CSS.getPropertyValue(element, \"maxHeight\") || \"none\"; /* GET */\n\n originalValues.paddingLeft = CSS.getPropertyValue(element, \"paddingLeft\"); /* GET */\n }\n\n originalValues.width = CSS.getPropertyValue(element, \"width\", null, true); /* GET */\n originalValues.height = CSS.getPropertyValue(element, \"height\", null, true); /* GET */\n }\n\n if (sameBasePercent) {\n elementUnitRatios.percentToPxRatioWidth = unitConversionRatios.lastPercentToPxWidth;\n elementUnitRatios.percentToPxRatioHeight = unitConversionRatios.lastPercentToPxHeight;\n } else {\n if (!Data(element).isSVG) {\n CSS.setPropertyValue(element, \"overflowX\", \"hidden\"); /* SET */\n CSS.setPropertyValue(element, \"overflowY\", \"hidden\"); /* SET */\n CSS.setPropertyValue(element, \"boxSizing\", \"content-box\"); /* SET */\n\n CSS.setPropertyValue(element, \"minWidth\", measurement + \"%\"); /* SET */\n CSS.setPropertyValue(element, \"maxWidth\", measurement + \"%\"); /* SET */\n\n CSS.setPropertyValue(element, \"minHeight\", measurement + \"%\"); /* SET */\n CSS.setPropertyValue(element, \"maxHeight\", measurement + \"%\"); /* SET */\n }\n\n CSS.setPropertyValue(element, \"width\", measurement + \"%\"); /* SET */\n CSS.setPropertyValue(element, \"height\", measurement + \"%\"); /* SET */\n }\n\n if (sameBaseEm) {\n elementUnitRatios.emToPx = unitConversionRatios.lastEmToPx;\n } else if (!Data(element).isSVG) {\n CSS.setPropertyValue(element, \"paddingLeft\", measurement + \"em\"); /* SET */\n }\n\n /* The following pixel-value GETs cannot be batched with the prior GETs since they depend upon the values\n temporarily set immediately above; layout thrashing cannot be avoided here. */\n if (!sameBasePercent) {\n /* Divide the returned value by the measurement value to get the ratio between 1% and 1px.\n Default to 1 since conversion logic using 0 can produce Infinite. */\n elementUnitRatios.percentToPxRatioWidth = unitConversionRatios.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(element, \"width\", null, true)) || 1) / measurement; /* GET */\n elementUnitRatios.percentToPxRatioHeight = unitConversionRatios.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(element, \"height\", null, true)) || 1) / measurement; /* GET */\n }\n\n if (!sameBaseEm) {\n elementUnitRatios.emToPx = unitConversionRatios.lastEmToPx = (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 1) / measurement; /* GET */\n }\n\n /* Revert each used test property to its original value. */\n for (var originalValueProperty in originalValues) {\n if (originalValues[originalValueProperty] !== null) {\n CSS.setPropertyValue(element, originalValueProperty, originalValues[originalValueProperty]); /* SETs */\n }\n }\n\n /* SVG dimensions do not accept an \"auto\" value, so we skip this reset process for them. */\n if (!Data(element).isSVG) {\n /* In IE, revert to \"auto\" for width and height if it was originally set. */\n if (IE) {\n if (isIEWidthAuto) {\n CSS.setPropertyValue(element, \"width\", \"auto\"); /* SET */\n }\n\n if (isIEHeightAuto) {\n CSS.setPropertyValue(element, \"height\", \"auto\"); /* SET */\n }\n /* For other browsers, additional layout thrashing must unfortunately be triggered to determine whether a dimension property was originally \"auto\". */\n } else {\n /* Set height to \"auto\" then compare the returned value against the element's current height value.\n If they're identical, leave height set to \"auto\". If they're different, then \"auto\" wasn't originally\n set on the element prior to our conversions, and we revert it to its actual value. */\n /* Note: The following GETs and SETs cannot be batched together due to the cross-effect setting one axis to \"auto\" has on the other. */\n CSS.setPropertyValue(element, \"height\", \"auto\"); /* SET */\n if (originalValues.height !== CSS.getPropertyValue(element, \"height\", null, true)) { /* GET */\n CSS.setPropertyValue(element, \"height\", originalValues.height); /* SET */\n }\n\n CSS.setPropertyValue(element, \"width\", \"auto\"); /* SET */\n if (originalValues.width !== CSS.getPropertyValue(element, \"width\", null, true)) { /* GET */\n CSS.setPropertyValue(element, \"width\", originalValues.width); /* SET */\n }\n }\n }\n\n if (Velocity.debug >= 1) console.log(\"Unit ratios: \" + JSON.stringify(elementUnitRatios), element);\n\n return elementUnitRatios;\n }", "title": "" }, { "docid": "4c1709e4b114a381730885669824afce", "score": "0.47491953", "text": "function distToGoal() {\r\n //writeLocationToCord(setPos)\r\n return calcDiff(goalPos, curPos)\r\n}", "title": "" }, { "docid": "a67e917bfcb30faf52719dddfc1962d4", "score": "0.4744424", "text": "function getDistance(touches) {\n return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));\n}", "title": "" }, { "docid": "bd44dc1f2df703ef59954f4c8dbcb0f1", "score": "0.47409967", "text": "function totalFuelUsed() {\n let kmPerLitre = mileageConverter();\n return (userInputs[1] / kmPerLitre).toFixed();\n}", "title": "" }, { "docid": "d8c9841705f4dc26b3b956d70689cf8e", "score": "0.47395867", "text": "calcEmissions() {\n let temp = this.props.navigation.getParam('distance', 'distanceTraveled');\n tempD = Math.round(temp);\n tempF = tempD / 1000;\n this.setState({\n footprint: tempF,\n })\n }", "title": "" }, { "docid": "bcb441c9522ab163f89e336f1e46a136", "score": "0.4731701", "text": "function get_total_dis_time() {\n\n var current_route_mode;\n if (route_mode === \"BICYCLING\")\n current_route_mode = \"DRIVING\";\n else\n current_route_mode = route_mode;\n var total_dis_time = [];\n\n var request = {\n origin: calculated_route_points[0],\n destination: dijkstra_current_route_points[dijkstra_current_route_points.length - 1].position,\n provideRouteAlternatives: true,\n travelMode: google.maps.TravelMode[current_route_mode]\n };\n\n var directionsService = new google.maps.DirectionsService();\n directionsService.route(request, function (result, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n\n var routes = result.routes;\n for (var rte in routes) {\n var legs = routes[rte].legs;\n\n for (var leg in legs) {\n var steps = legs[leg].steps;\n total_dis_time.push(legs[0].distance.text);\n total_dis_time.push(legs[0].duration.text);\n }\n break; // Use only the first route\n }\n var time;\n var distance;\n\t\t\tvar timeOffset;\n if(route_mode === \"BICYCLING\"){\n\t\t\t\t//console.log(total_dis_time); //total_dis_time[0] -> km , total_dis_time[1] -> mins\n\t\t\t\t\n\t\t\t\tif(parseInt(total_dis_time[1]) >= 1 && parseInt(total_dis_time[1]) < 3) \n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 2;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 3 && parseInt(total_dis_time[1]) < 4) \n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 4;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 4 && parseInt(total_dis_time[1]) < 7)\n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 7;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 7 && parseInt(total_dis_time[1]) < 10)\n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 10;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 10 && parseInt(total_dis_time[1]) < 13)\n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 14;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 13 && parseInt(total_dis_time[1]) < 16)\n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 18;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 16 && parseInt(total_dis_time[1]) < 19)\n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 20;\n\t\t\t\telse if(parseInt(total_dis_time[1]) >= 19 )\n\t\t\t\t\ttimeOffset = parseInt(total_dis_time[1]) + 25;\n\t\t\t\t\n if(language === \"greek\"){\n\t\t\t\t\t\n\t\t\t\t\tdistance = total_dis_time[0];\n\t\t\t\t\ttime = timeOffset + \" λεπτά\"; \n\n }else{\n \n\t\t\t\t\tdistance = total_dis_time[0];\n time = timeOffset + \" mins\";\n \n }\n console.log(time + \",\" + distance);\n }\n else{\n\n distance = total_dis_time[0];\n time = total_dis_time[1];\n\n }\n\n $(\"#route_total_length\").empty().append(distance + \" - \");\n $(\"#route_total_time\").empty().append(time + \" - \");\n\n var route = $(\"#dijkstra_route_container\").html();\n dijkstra_current_route_directions = route;\n console.log(dijkstra_current_route_directions);\n }\n else {\n console.log(\"ERROR, CALL AGAIN......\");\n\t\t\t// === if we were sending the requests to fast, try this one again and increase the delay\n\t\t if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {\n\t\t\tnextAddress--;\n\t\t\tdelay++;\n\t\t } else {\n\t\t\tvar reason=\"Code \"+status;\n\t\t\tvar msg = 'address=\"' + search + '\" error=' +reason+ '(delay='+delay+'ms)<br>';\n\t\t\tdocument.getElementById(\"messages\").innerHTML += msg;\n\t\t } \n }\n });\n\n}", "title": "" }, { "docid": "c0379e87ce21806a717b1cfd3b9143c0", "score": "0.47251016", "text": "function distance(lat1, lon1, lat2, lon2, unit) {\n var radlat1 = Math.PI * lat1/180\n var radlat2 = Math.PI * lat2/180\n var radlon1 = Math.PI * lon1/180\n var radlon2 = Math.PI * lon2/180\n var theta = lon1-lon2\n var radtheta = Math.PI * theta/180\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n dist = Math.acos(dist)\n dist = dist * 180/Math.PI\n dist = dist * 60 * 1.1515\n if (unit==\"K\") { dist = dist * 1.609344 }\n if (unit==\"N\") { dist = dist * 0.8684 }\n return dist\n}", "title": "" }, { "docid": "d87fe9db1745e924d65e41fbafdae6a0", "score": "0.47240472", "text": "function getUnits(units)\n{\n\tif (!units || units === \"Fahrenheit\") return (config.units);\n\treturn(\"metric\");\n}", "title": "" }, { "docid": "aa40577f7d200205c9e722824b96556d", "score": "0.4723379", "text": "function calculateDistance(latitude1, longitude1, latitude2, longitude2, unitSystem) {\n var dtor = Math.PI / 180;\n var radius = unitSystem === 'metric' ? 6378.14 : 3959;\n var rlat1 = latitude1 * dtor;\n var rlong1 = longitude1 * dtor;\n var rlat2 = latitude2 * dtor;\n var rlong2 = longitude2 * dtor;\n var dlon = rlong1 - rlong2;\n var dlat = rlat1 - rlat2;\n var a = Math.pow(Math.sin(dlat / 2), 2) + Math.cos(rlat1) * Math.cos(rlat2) * Math.pow(Math.sin(dlon / 2), 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return radius * c;\n}", "title": "" }, { "docid": "bbae2d28367b5b71292b2c49288acb0b", "score": "0.47232568", "text": "get_player_delta(direction) {\n\t\treturn (NewGameUtils.getDirectionScore(direction) - Constants.JPN_START_POINTS);\n\t}", "title": "" } ]
8b7d8a389e3b2cf775691aa050db6314
============================================= Funcion para actualizar una fila en la tabla ascensor_valores_maquinas ==============================================
[ { "docid": "2567b35dfa9d225fd7d7b6bade8bb23e", "score": "0.62408847", "text": "function updateItemsAscensorValoresMaquinas(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_maquinas SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\";\n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresMaquinas: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de maquinas...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" } ]
[ { "docid": "34ae046f07d829322a2b75061f5605b0", "score": "0.641064", "text": "function updateItemsAscensorValoresFoso(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_foso SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\";\n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected ascensor_valores_foso: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de foso...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "6f95835b9e1a8e459d8d9cfb604446f4", "score": "0.6199224", "text": "function updateItemsAscensorValoresFinales(k_codusuario,k_codinspeccion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_finales SET o_observacion = ?\"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ?\"; \n tx.executeSql(query, [o_observacion,k_codusuario,k_codinspeccion], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresFinales: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de observación...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "d052755b65fa696fa9edeb74380538aa", "score": "0.61050683", "text": "function updateItemsAscensorValoresInforme(k_codinforme,v_consecutivoinforme,k_codusuario,f_informe) {\n db.transaction(function (tx) {\n var query = \"UPDATE informe SET v_consecutivoinforme = ?,\"+\n \"f_informe = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinforme = ?\";\n tx.executeSql(query, [v_consecutivoinforme,f_informe,k_codusuario,k_codinforme], function(tx, res) {\n console.log(\"rowsAffected informe: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de informes...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "37db10f944bffa61409db3425e0737f3", "score": "0.59555", "text": "function updateItemsAscensorValoresPozo(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_pozo SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\";\n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresPozo: \" + res.rowsAffected);\n $('#texto_carga').text(\"Finalizando...Espere\");\n setTimeout('cerrar_Ventana_Carga()',20000);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "7ad90d6581d3233b1568125d7314e82a", "score": "0.5952738", "text": "function autoactualizar() {\n getDatos();\n }", "title": "" }, { "docid": "e53c1536b4f0dbf1f7d81f2af2756a79", "score": "0.59052366", "text": "function updateItemsAscensorValoresIniciales(n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe, k_codusuario,k_codinspeccion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_iniciales SET n_cliente = ?,\"+\n \"n_equipo = ?,\"+\n \"n_empresamto = ?,\"+\n \"o_tipoaccion = ?,\"+\n \"v_capacperson = ?,\"+\n \"v_capacpeso = ?,\"+\n \"v_paradas = ?,\"+\n \"f_fecha = ?,\"+\n \"v_codigo = ?,\"+\n \"o_consecutivoinsp = ?,\"+\n \"ultimo_mto = ?,\"+\n \"inicio_servicio = ?,\"+\n \"ultima_inspeccion = ?,\"+\n \"h_hora = ?,\"+\n \"o_tipo_informe = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ?\";\n tx.executeSql(query, [n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe, k_codusuario,k_codinspeccion], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresIniciales: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos iniciales...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "0167686f96e8dfccc958e4c5828f3838", "score": "0.5883743", "text": "function updateItemsEscalerasValoresFinales(k_codusuario,k_codinspeccion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE escaleras_valores_finales SET o_observacion = ?\"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ?\"; \n tx.executeSql(query, [o_observacion,k_codusuario,k_codinspeccion], function(tx, res) {\n console.log(\"rowsAffected updateItemsEscalerasValoresFinales: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de observación...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "547b38ff576f949ee3f816cc135bcee8", "score": "0.5864827", "text": "function llenarTablaAscensorValoresFoso(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_foso.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem = item.k_coditem;\n var n_calificacion = item.n_calificacion;\n var v_calificacion = item.v_calificacion;\n var o_observacion = item.o_observacion;\n var cantidad_filas = item.cantidad_filas;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_foso WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresFoso(k_codusuario,codigo_inspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion);\n }else{\n updateItemsAscensorValoresFoso(k_codusuario,codigo_inspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n \n });\n }\n });\n}", "title": "" }, { "docid": "c5dd8b178a104f58fe1bb9d96fc38334", "score": "0.58610547", "text": "function updateItemsEscalerasValoresInforme(k_codinforme,v_consecutivoinforme,k_codusuario,f_informe) {\n db.transaction(function (tx) {\n var query = \"UPDATE informe SET v_consecutivoinforme = ?,\"+\n \"f_informe = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinforme = ?\";\n tx.executeSql(query, [v_consecutivoinforme,f_informe,k_codusuario,k_codinforme], function(tx, res) {\n console.log(\"rowsAffected informe: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de informes...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "3dd3f9c9d1fb6f121355450e94e7c76a", "score": "0.5859759", "text": "function updateItemsAscensorValoresPreliminar(k_codusuario,k_codinspeccion,k_coditem,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_preliminar SET v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem_preli = ?\";\n tx.executeSql(query, [v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresPreliminar: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos preliminares...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "38f0669478b3e282afad21cf61832e26", "score": "0.585915", "text": "function updateItemsAscensorValoresCabina(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_cabina SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresCabina: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de cabina...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "a68986360796a86fe7f15d59e9440f2e", "score": "0.58001983", "text": "function actualizaMemo(data) {\n\t\tif(Math.max.apply(Math,data.map(function(o){return o.numero_memo;}))>0){\n\t\t\t$scope.memo_actual= Math.max.apply(Math,data.map(function(o){return o.numero_memo;})) +1;\n\t\t}\n\t\telse{\n\t\t\t$scope.memo_actual = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "1393a3f42d498c2d3fecae9f47729508", "score": "0.5750036", "text": "function llenarTablaAscensorValoresMaquinas(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_maquinas.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem = item.k_coditem;\n var n_calificacion = item.n_calificacion;\n var v_calificacion = item.v_calificacion;\n var o_observacion = item.o_observacion;\n var cantidad_filas = item.cantidad_filas;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_maquinas WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresMaquinas(k_codusuario,codigo_inspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion);\n }else{\n updateItemsAscensorValoresMaquinas(k_codusuario,codigo_inspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "9e649cb26a7e9e704b062ae5386aa55c", "score": "0.56462187", "text": "function faseUno (matriz)\n {\n var bandera = 1;\n var itera=1;\n\n while ( bandera != 0 )\n {\n var mayor = 0.0;\n var menor = 1000000000.0;\n var entraMax, saleMin, hacerUno;\n bandera = 0;\n\n //Imprimimos el tableau actual\n var s =\"<br><div align = 'center'><br><p>Iteración \"+ itera++ +\"<p></div>\";\n document.getElementById('content').innerHTML += s;\n imprimeTableau(matriz, nRes, total + 1);\n //Seleccionamos la variable de entrada\n for (j = 1; j <= total; j++)\n {\n if (matriz[0][j] > 0 && matriz[0][j] > mayor)\n {\n mayor = matriz[0][j];\n entraMax = j;\n bandera = 1;\n }\n }\n\n //Seleccion de la variable de salida\n for (i = 1;i <= nRes; i++ )\n {\n if ( entraMax > 0 && matriz[i][entraMax] > 0)\n {\n if (matriz[i][total+1] / matriz[i][entraMax] < menor)\n {\n menor = parseFloat(matriz[i][total+1] / matriz[i][entraMax]);\n saleMin = i;\n }\n }\n }\n\n // Calculamos las variables de la siguiente iteracion\n var hacerUnoA = matriz[saleMin][entraMax];\n hacerUno = parseFloat(hacerUnoA);\n //console.log(hacerUno);\n\n s =\"<div align = 'center'><br><p>Entra X\" + entraMax + \"</p>\";\n s +=\"<p>Sale R\" + saleMin + \"</p></div>\";\n document.getElementById('content').innerHTML += s;\n\n for(var j=1; j<=total+1; j++)\n {\n matriz[saleMin][j]/=hacerUno;\n //matriz[saleMin][j] = parseFloat(matriz[saleMin][j]);\n }\n\n //imprimeTableau(matriz, nRes, total+1);\n \n for(var i = 0; i <= nRes; i++)\n {\n var vector = new Array();\n if(matriz[i][entraMax] != 0 && i != saleMin)\n {\n var aux = matriz[i][entraMax];\n for(var j = 0; j <= total+1; j++){\n //vector.push(matriz[saleMin][j]*aux*-1);\n matriz[i][j]+=matriz[saleMin][j]*aux*-1;\n if (matriz[i][j]<=2.220446049250313e-8 && matriz[i][j] >= -4.440892098500626e-8)\n matriz[i][j]=0;\n //matriz[i][j] = parseFloat(matriz[i][j]);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "a32cd8aafba3787485720844c3e0adb2", "score": "0.56312907", "text": "function updateItemsEscalerasValoresDefectos(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE escaleras_valores_defectos SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\";\n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsEscalerasValoresDefectos: \" + res.rowsAffected);\n $('#texto_carga').text(\"Finalizando...Espere\");\n setTimeout('cerrar_Ventana_Carga()',20000);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "0bb463b237083d82c71d6bc39983da51", "score": "0.5628915", "text": "function setDatosFactura(){\n var datos = txtSelected.facturas[txtSelected.indexSelected];\n // datos encabezado\n datos.factura[0].NumeroInterno = $(\"#txtEncNumInter\").val()\n datos.factura[0].NroAprob = $(\"#txtEncNumApro\").val()\n datos.factura[0].AnoAprob = $(\"#txtEncAñoAprobacion\").val()\n datos.factura[0].Tipo = $(\"#txtEncTipo\").val()\n datos.factura[0].Serie = $(\"#txtEncSerie\").val()\n datos.factura[0].Folio = $(\"#txtEncFolio\").val()\n datos.factura[0].FechaEmis = $(\"#txtEncFechaEmision\").val()\n datos.factura[0].FormaPago = $(\"#txtEncFormaPago\").val()\n datos.factura[0].CondPago = $(\"#txtEncCondicionesPago\").val()\n datos.factura[0].TermPagoDias = $(\"#txtEncTerminoPago\").val()\n datos.factura[0].FechaVenc = $(\"#txtEncFechaVencimiento\").val();\n\n // datos emisor col 1\n datos.emisor[0].RFCEmisor = $(\"#txtEmiRFC\").val();\n datos.emisor[0].NmbEmisor = $(\"#txtEmiNombreEmisor\").val();\n datos.emisor[0].TpoCdgIntEmisor1 = $(\"#txtEmiTipoCod\").val();\n datos.emisor[0].CdgIntEmisor1 = $(\"#txtEmiCod\").val();\n datos.emisor[0].Sucursal = $(\"#txtEmiSucursal\").val();\n //CdgVendedor\n // col 2\n datos.emisor[1].Calle = $(\"#txtEmiD1Calle\").val();\n datos.emisor[1].NroExterior = $(\"#txtEmiD1NumExt\").val();\n datos.emisor[1].NroInterior = $(\"#txtEmiD1NumInt\").val();\n datos.emisor[1].Colonia = $(\"#txtEmiD1Colonia\").val();\n datos.emisor[1].Municipio = $(\"#txtEmiD1Municipio\").val();\n datos.emisor[1].Estado = $(\"#txtEmiD1Estado\").val();\n datos.emisor[1].Pais = $(\"#txtEmiD1Pais\").val();\n datos.emisor[1].CodigoPostal = $(\"#txtEmiD1CP\").val();\n // col 3\n datos.emisor[2].Calle = $(\"#txtEmiD2Calle\").val();\n datos.emisor[2].NroExterior = $(\"#txtEmiD2NumExt\").val();\n datos.emisor[2].NroInterior = $(\"#txtEmiD2NumInt\").val();\n datos.emisor[2].Colonia = $(\"#txtEmiD2Colonia\").val();\n datos.emisor[2].Municipio = $(\"#txtEmiD2Municipo\").val();\n datos.emisor[2].Estado = $(\"#txtEmiD2Estado\").val();\n datos.emisor[2].Pais = $(\"#txtEmiD2Pais\").val();\n datos.emisor[2].CodigoPostal = $(\"#txtEmiD2CP\").val();\n\n //datos receptor\n datos.receptor[0].RFCRecep = $(\"#txtRecepRFC\").val();\n datos.receptor[0].NmbRecep = $(\"#txtRecepNombre\").val();\n datos.receptor[0].CdgGLNRecep = $(\"#txtRecepCodGLN\").val();\n datos.receptor[0].TpoCdgIntRecep1 = $(\"#txtRecepTipoCod\").val();\n datos.receptor[0].CdgIntRecep1 = $(\"#txtRecepCodInter\").val();\n datos.receptor[0].CdgCliente = $(\"#txtRecepCodCliente\").val();\n // col 2\n datos.receptor[1].Calle = $(\"#txtRecepD1Calle\").val();\n datos.receptor[1].NroExterior = $(\"#txtRecepD1NumExt\").val();\n datos.receptor[1].NroInterior = $(\"#txtRecepD1NumInt\").val();\n datos.receptor[1].Colonia = $(\"#txtRecepD1Colonia\").val();\n datos.receptor[1].Localidad = $(\"#txtRecepD1Localidad\").val();\n datos.receptor[1].Referencia = $(\"#txtRecepD1Referencia\").val();\n datos.receptor[1].Municipio = $(\"#txtRecepD1Municipio\").val();\n datos.receptor[1].Estado = $(\"#txtRecepD1Estado\").val();\n datos.receptor[1].Pais = $(\"#txtRecepD1Pais\").val();\n datos.receptor[1].CodigoPostal = $(\"#txtRecepD1CP\").val();\n // col 3\n datos.receptor[2].Calle = $(\"#txtRecepD2Calle\").val();\n datos.receptor[2].NroExterior = $(\"#txtRecepD2NumExt\").val();\n datos.receptor[2].NroInterior = $(\"#txtRecepD2NumInt\").val();\n datos.receptor[2].Colonia = $(\"#txtRecepD2Colonia\").val();\n datos.receptor[2].Localidad = $(\"#txtRecepD2Localidad\").val();\n datos.receptor[2].Referencia = $(\"#txtRecepD2Referencia\").val();\n datos.receptor[2].Municipio = $(\"#txtRecepD2Municipio\").val();\n datos.receptor[2].Estado = $(\"#txtRecepD2Estado\").val();\n datos.receptor[2].Pais = $(\"#txtRecepD2Pais\").val();\n datos.receptor[2].CodigoPostal = $(\"#txtRecepD2CP\").val();\n datos.receptor[2].NumCtaPago = $(\"#txtRecepD2NumPago\").val();\n datos.receptor[2].methodoDePago = $(\"#txtRecepD2MetodoPago\").val();\n //$(\"#txtRecepD2NumPago\").val(dato.receptor[2].);\n\n datos.otros[5].Version = $(\"#txt_cceVersion\").val();\n datos.otros[5].TipoOperacion = $(\"#txt_cceTipoOp\").val();\n datos.otros[5].ClavePedimento = $(\"#txt_cceClavePed\").val();\n datos.otros[5].NoExportadorConfiabl = $(\"#txt_cceNExpConfiable\").val();\n datos.otros[5].CertificadoOrigen = $(\"#txt_cceCertOrig\").val();\n datos.otros[5].NumCertificadoOrigen = $(\"#txt_cceNCertOrig\").val();\n datos.otros[5].TipoCambio = $(\"#txt_TipoCambio\").val();\n datos.otros[5].Incoterm = $(\"#txt_Incoterm\").val();\n datos.otros[5].MotivoTraslado = $(\"#selectCceMTraslado\").val();\n datos.otros[5].numRegidTrib = $(\"#id_RFCRec\").val();\n // datos productos\n var bloque = datos.otros.find( item => item.hasOwnProperty(\"productos\"));\n var rows = [];\n if (bloque)\n rows = bloque.productos.rows;\n $(\"#tablaProductos tbody tr\").each(function (index) {\n var p = rows[index];\n //var campo1, campo2, campo3;\n $(this).children(\"td\").each(function (index2) {\n switch (index2) {\n case 0: p.NoIdentificacion = $(this).text();\n break;\n case 1: p.FraccionArancelaria = $(this).text();\n break;\n case 2: p.ValorDolares = $(this).text();\n break;\n case 3: p.Marca = $(this).text();\n break;\n case 4: p.Modelo = $(this).text();\n break;\n case 5: p.NumeroSerie = $(this).text();\n break;\n case 6: p.cceDescEsp = $(this).text();\n break;\n case 7: p.cceDescIng = $(this).text();\n break;\n }\n })\n });\n}", "title": "" }, { "docid": "bd0cef76c5aff093b6cb79d4ad46727d", "score": "0.5619013", "text": "function addItemsAscensorValoresFinales(k_codusuario,k_codinspeccion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_valores_finales (k_codusuario,k_codinspeccion,o_observacion) VALUES (?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de observación...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "579a55dc589d6102ae9241e2a34e3327", "score": "0.56118226", "text": "function Actualizar(){\n // capturando valores\n var cod=txtCod.value;\n var nom=txtNom.value;\n var ape=txtApe.value;\n var cor=txtCor.value;\n // seleccionamos la tabla que vamos actualizar con su codigo correspondiente\n var db=database.ref(\"registro/\"+cod);\n // le pasamos los datos que vamos a actualizar\n db.update({\n nombre: nom,\n apellido: ape,\n correo: cor,\n });\n alert(\"Se actualizo el dato\");\n // llamamos al procedimiento limpiar\n Limpiar();\n // llamamos al procedimiento mostrar\n Mostrar();\n}", "title": "" }, { "docid": "5436ecd77dced35a72b15d5977761564", "score": "0.5533119", "text": "function llenarTablaAscensorValoresPozo(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_pozo.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem = item.k_coditem;\n var n_calificacion = item.n_calificacion;\n var v_calificacion = item.v_calificacion;\n var o_observacion = item.o_observacion;\n var cantidad_filas = item.cantidad_filas;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_pozo WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresPozo(k_codusuario,codigo_inspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion);\n }else{\n updateItemsAscensorValoresPozo(k_codusuario,codigo_inspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "4baa796d35ca9a53cfed0e04fe910670", "score": "0.5527575", "text": "function reestablecerValoresIva(){\n \n var _ivaTotal = 0;\n \n \n $(\".filaArticuloVenta\").each(function(){//va recorriendo cada fila de articulo y sumando el valor del subtotal\n\n var _ivaArticulo = 0; \n _ivaArticulo = $(this).find(\".ivaArticuloVenta\").val();\n\n if (_ivaArticulo != '') {\n _ivaArticulo = parseDouble(_ivaArticulo);\n }\n\n var $ivaTotalArticulo = $(this).find(\".ivaTotalArticuloVenta\");\n\n var _subtotal = $(this).attr(\"subtotal\");\n\n var _ivaFila = _subtotal * (_ivaArticulo / 100);\n\n if(_ivaFila != '') {\n _ivaFila = parseDouble(_ivaFila);\n }\n\n $ivaTotalArticulo.val(_ivaFila);\n\n _ivaTotal += _ivaFila; \n\n }); \n\n \n var _valorFlete = $(\"#campoValorFlete\").val();\n \n var _ivaGeneral = $(\"#porcentajeIvaFleteVentas\").val();\n \n var _ivaFlete = _valorFlete * (_ivaGeneral / 100);\n \n _ivaTotal += _ivaFlete;\n \n _ivaTotal = parseDouble(_ivaTotal);\n \n $(\"#campoIva\").val(_ivaTotal); \n \n}", "title": "" }, { "docid": "a47a15f4316a6e9e606929a558bf8de7", "score": "0.551057", "text": "salvaValores (){\n maskMoney($(\"#campo_valor_bruto_\"+this.num), this.valor_bruto);\n maskMoney($(\"#label_valor_bruto_\"+this.num), this.valor_bruto);\n $(\"#campo_perc_desconto_\"+this.num).val(this.perc_desconto).mask('00,0000%', {reverse: true}).trigger('input');\n maskMoney($(\"#campo_valor_desconto_\"+this.num), this.valor_desconto);\n maskMoney($(\"#campo_valor_ipi_\"+this.num), this.valor_ipi);\n maskMoney($(\"#label_valor_ipi_\"+this.num), this.valor_ipi);\n maskMoney($(\"#campo_valor_bc_ipi_\"+this.num), this.valor_bc_ipi);\n maskMoney($(\"#label_valor_bc_ipi_\"+this.num), this.valor_bc_ipi);\n maskMoney($(\"#campo_valor_total_\"+this.num), this.valor_total);\n maskMoney($(\"#label_valor_total_\"+this.num), this.valor_total);\n maskMoney($(\"#campo_valor_bc_icms_\"+this.num), this.valor_bc_icms);\n maskMoney($(\"#label_valor_bc_icms_\"+this.num), this.valor_bc_icms);\n maskMoney($(\"#campo_valor_icms_\"+this.num), this.valor_icms);\n maskMoney($(\"#label_valor_icms_\"+this.num), this.valor_icms);\n }", "title": "" }, { "docid": "923e69cc943f2ea0c6f45e653fb506d5", "score": "0.55019075", "text": "actualizarCuota () {\n this.interesMensual = this.interes / 1200;\n this.factorFunc();\n this.cuotaFunc();\n }", "title": "" }, { "docid": "31d1339be678c92df00440b3bfc087d8", "score": "0.5498537", "text": "function updateItemsEscalerasValoresPreliminar(k_codusuario,k_codinspeccion,k_coditem,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE escaleras_valores_preliminar SET v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem_preli = ?\";\n tx.executeSql(query, [v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsescalerasValoresPreliminar: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos preliminares...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "fed265ac3322d622047a47f470f01fe7", "score": "0.5486367", "text": "function atualizarVersaoTabela(fef) {\n let sql = \"UPDATE OR INSERT INTO ESTRUTURA_VERSAO \"\n + \"(TABELA, VERSAO) \"\n + \"VALUES ('\" + fef.getNomeTabela() + \"', \" + fef.getVersao() + \") \"\n + \"MATCHING (TABELA);\";\n\n return dao.executarSql(sql);\n}", "title": "" }, { "docid": "a1de0bc4aca0798a8825d2e1e5bb7496", "score": "0.54857874", "text": "function modificar_insumo() {\n var modins_id = document.getElementById(\"modins_id\").value;\n //GUARDAR A MI VECTOR EL ID ISUMOFINANCIAMIENTO\n vec_id_fin.push(modins_id);\n var fecha = document.getElementById(\"modins_fecha\").value;\n var detalle = document.getElementById(\"modins_detalle\").value;\n var objetivo = document.getElementById(\"modins_objetivo\").value;\n var duracion = document.getElementById(\"modins_duracion\").value;\n var fecha_inicio = document.getElementById(\"modins_fecha_inicio\").value;\n var fecha_conclusion = document.getElementById(\"modins_fecha_conclusion\").value;\n var productos = document.getElementById(\"modins_productos\").value;\n var evaluador = document.getElementById(\"modins_evaluador\").value;\n var cargo = document.getElementById(\"modins_cargo\").value;\n var actividades = document.getElementById(\"modins_actividades\").value;\n var perfil = document.getElementById(\"modins_perfil\").value;\n var car_id = document.getElementById(\"modins_car_id\").value;\n var unidad_medida = document.getElementById(\"modins_unidad_medida\").value;\n var cantidad = document.getElementById(\"modins_cantidad\").value;\n var costo_unitario = document.getElementById(\"modins_costo_unitario\").value;\n var ins_costo_total = document.getElementById(\"modins_costo_total\").value;\n var partidas = document.getElementById(\"modins_par_hijos\").value;\n var ins_monto_f = document.getElementById(\"modins_monto_f\").value;\n var ins_ff_of = document.getElementById(\"modins_ff_of\").value;// ffofet_id asignado\n var ins_et = document.getElementById(\"modins_et\").value;\n //==========================================================\n var mes1 = parseFloat(document.getElementById(\"modmes1\").value);\n var mes2 = parseFloat(document.getElementById(\"modmes2\").value);\n var mes3 = parseFloat(document.getElementById(\"modmes3\").value);\n var mes4 = parseFloat(document.getElementById(\"modmes4\").value);\n var mes5 = parseFloat(document.getElementById(\"modmes5\").value);\n var mes6 = parseFloat(document.getElementById(\"modmes6\").value);\n var mes7 = parseFloat(document.getElementById(\"modmes7\").value);\n var mes8 = parseFloat(document.getElementById(\"modmes8\").value);\n var mes9 = parseFloat(document.getElementById(\"modmes9\").value);\n var mes10 = parseFloat(document.getElementById(\"modmes10\").value);\n var mes11 = parseFloat(document.getElementById(\"modmes11\").value);\n var mes12 = parseFloat(document.getElementById(\"modmes12\").value);\n //============= GUARDAR Y RETORNA EL ID DEL INSUMO ===============\n var url = site_url + '/insumos/programacion_insumos/mod_ins';\n $.ajax({\n type: \"post\",\n url: url,\n //dataType: 'json',\n data: {\n ins_id: modins_id,\n fecha: fecha,\n detalle: detalle,\n objetivo: objetivo,\n duracion: duracion,\n fecha_inicio: fecha_inicio,\n fecha_conclusion: fecha_conclusion,\n productos: productos,\n evaluador: evaluador,\n cargo: cargo,\n actividades: actividades,\n perfil: perfil,\n car_id: car_id,\n unidad_medida: unidad_medida,\n cantidad: cantidad,\n costo_unitario: costo_unitario,\n costo_total: ins_costo_total,\n partidas: partidas,\n ins_ff_of: ins_ff_of,\n ins_et: ins_et,\n ins_monto_f: ins_monto_f,\n mes1: mes1,\n mes2: mes2,\n mes3: mes3,\n mes4: mes4,\n mes5: mes5,\n mes6: mes6,\n mes7: mes7,\n mes8: mes8,\n mes9: mes9,\n mes10: mes10,\n mes11: mes11,\n mes12: mes12,\n },\n success: function (data) {\n /* var id = data.trim() + '';\n var str = id;\n var n1 = str.indexOf(\"(\");\n id = (str.substr(n1+1)).trim();\n document.getElementById(\"insumo_id\").value = id;*/\n }\n });\n\n}", "title": "" }, { "docid": "c30499c6932eecae5b4abcf1500822de", "score": "0.5478814", "text": "function addItemsAscensorValoresFoso(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_valores_foso (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de foso...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "5bf9eaf874c490f908e993bfdb1d92e8", "score": "0.5463178", "text": "function llenarTablaAscensorValoresFinales(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_finales.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var o_observacion = item.o_observacion;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_finales WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresFinales(k_codusuario,codigo_inspeccion,o_observacion); \n }else{\n updateItemsAscensorValoresFinales(k_codusuario,codigo_inspeccion,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n \n });\n }\n });\n}", "title": "" }, { "docid": "6dad756c7e37764eb816bc1e615e045a", "score": "0.5440155", "text": "function addItemsAscensorValoresMaquinas(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_valores_maquinas (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de maquinas...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "7669f24081bf921980796e334c70c338", "score": "0.5427262", "text": "function limpiarForInf(){\r\n $indicadores_ob.val('');\r\n $metas_ob.val('');\r\n $iniciativas_ob.val('');\r\n}", "title": "" }, { "docid": "a50a2e4dd1b13975aace906012689ffa", "score": "0.54195267", "text": "function updateItemsEscalerasValoresIniciales(n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe, k_codusuario,k_codinspeccion) {\n db.transaction(function (tx) {\n var query = \"UPDATE escaleras_valores_iniciales SET n_cliente = ?,\"+\n \"n_equipo = ?,\"+\n \"n_empresamto = ?,\"+\n \"v_velocidad = ?,\"+\n \"o_tipo_equipo = ?,\"+\n \"v_inclinacion = ?,\"+\n \"v_ancho_paso = ?,\"+\n \"f_fecha = ?,\"+\n \"ultimo_mto = ?,\"+\n \"inicio_servicio = ?,\"+\n \"ultima_inspeccion = ?,\"+\n \"v_codigo = ?,\"+\n \"o_consecutivoinsp = ?,\"+\n \"h_hora = ?,\"+\n \"o_tipo_informe = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ?\";\n tx.executeSql(query, [n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe, k_codusuario,k_codinspeccion], function(tx, res) {\n console.log(\"rowsAffected updateItemsescalerasValoresIniciales: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos iniciales...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "55d1e82329773db234540ba9be9d4315", "score": "0.5391532", "text": "function modificarDato (puesto,nombre,equipo,nacionalidad,valor) {\n progressBar.classList.add('final');\n \n setTimeout(()=>{\n overlayEl.classList.add('display-none');\n progressBar.classList.remove('final');\n fila.cells[0].innerHTML=puesto.value;\n fila.cells[1].innerHTML=nombre.value;\n fila.cells[2].innerHTML=equipo.value;\n fila.cells[3].innerHTML=nacionalidad.value;\n fila.cells[4].innerHTML=valor.value;\n\n },2000); \n }", "title": "" }, { "docid": "bbaf9af962d86bd45cdd1bde585ae76d", "score": "0.538235", "text": "function calcularProm(filas)\n{\n let promedio = document.getElementById('promedio');\n let max = document.getElementById('precioMaximo');\n let min = document.getElementById('precioMinimo');\n if(filas.length != 0 )\n {\n let celdas = traerColumna(filas,'name','CELDAPRECIO').map((e)=>parseInt(precioDeServer(e.textContent)));\n let precioFinal = celdas.reduce((a,b)=> a + b) / celdas.length;\n let precioMaximo = celdas.reduce((a,b)=> a>=b ? a : b);\n let precioMinimo = celdas.reduce((a,b)=> a>=b ? b : a);\n promedio.value = precioDeForm(precioFinal);\n max.value = precioDeForm(precioMaximo);\n min.value = precioDeForm(precioMinimo);\n }\n else{\n promedio.value = precioDeForm(0);\n max.value = precioDeForm(0);\n min.value = precioDeForm(0);\n }\n porcentajeVacunados(filas);\n}", "title": "" }, { "docid": "e2689bc2147b2efb6a4442cdc54f5626", "score": "0.5377654", "text": "function agregarFila( datos ){\n\t\n\tvar id = datos[ 0 ]; // Obtenemos Id del nuevo registro con el que identificaremos la nueva fila.\n\t\n\tvar editar = \t'<span class=\"edit editar\" title=\"Editar\" id=\"' + id + '\"></span>';\n\tvar eliminar = \t'<span class=\"delete eliminar\" title=\"Eliminar\" id=\"' + id + '\"></span>';\n\tvar acciones = editar + eliminar;\n\t\n\tdatos[ 0 ] = '<span class=\"icon user\"></span>' ;\n\t\n\tdatos[ datos.length - 1 ] = ( datos[ datos.length - 1 ] == true ) ? acciones : \"\"; // Asignamos acciones a la fila nueva.\n\t\n\tvar oTable = $('#tablaProfesores').dataTable(); // Obtenemos referencia de la tabla.\n\toTable.fnAddData( datos, true); // Agregamos la fila con los datos nuevos.\n\t\n\tvar nNodes = oTable.fnGetNodes( ); // Obtenemos todos los nodos de la tabla.\n\t\n\tfor( var i = 0; i < nNodes.length; i++ ){\n\t\tif( $(nNodes[ i ]).attr(\"id\") == \"\" ){\n\t\t\t$(nNodes[ i ]).attr(\"id\", \"PROFESOR\" + id); // Le asignamos un id a la nueva fila. \n\t\t}\n\t}\n\t\n\t//oTable.fnFilter( datos[ 1 ] ); // Filtramos la busqueda sobre el primer campo de la nueva fila, para visualizarlo.\n\t\n}", "title": "" }, { "docid": "f64735044face22f1a2fd38d77629587", "score": "0.5372751", "text": "function changevalue(name){\n \n var str = name.toString().split(\"_\");\n var beitrquartmonatoffen=\"Beitr_\"+str[1]+\"_QuartMonat_offen\";\n var beitrquartmonatgez=\"Beitr_\"+str[1]+\"_QuartMonat_gez\";\n\n\nif(document.forms[\"formSave\"].elements[beitrquartmonatoffen].value === \"\"){\n document.forms[\"formSave\"].elements[beitrquartmonatoffen].value =0;\n document.forms[\"formSave\"].elements[beitrquartmonatgez].value =0;\n}\n \n var zahl= parseFloat(document.forms[\"formSave\"].elements[beitrquartmonatoffen].value.replace(\",\",\".\"));\n if(zahl.toFixed(2) !== Zwischenspeicher){\n var x = parseInt(str[1])-parseInt(1); \n \n \n Speicher[x] = zahl.toFixed(2);\n\n \n \n \n Zwischenspeicher=0;\n compute(name);\n }\n \n}", "title": "" }, { "docid": "a8c3dad03100a793b3711d54b5d34f54", "score": "0.5357095", "text": "function llenarTablaAscensorValoresIniciales(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_iniciales.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var n_cliente = item.n_cliente;\n var n_equipo = item.n_equipo;\n var n_empresamto = item.n_empresamto;\n var o_tipoaccion = item.o_tipoaccion;\n var v_capacperson = item.v_capacperson;\n var v_capacpeso = item.v_capacpeso;\n var f_fecha = item.f_fecha;\n var v_codigo = item.v_codigo;\n var v_paradas = item.v_paradas;\n var o_consecutivoinsp = item.o_consecutivoinsp;\n var ultimo_mto = item.ultimo_mto;\n var inicio_servicio = item.inicio_servicio;\n var ultima_inspeccion = item.ultima_inspeccion;\n var h_hora = item.h_hora;\n var o_tipo_informe = item.o_tipo_informe;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_iniciales WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n //alert(resultSet.rows.length);\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresIniciales(k_codusuario,codigo_inspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe);\n }else{\n updateItemsAscensorValoresIniciales(n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe, k_codusuario,codigo_inspeccion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n \n });\n }\n });\n}", "title": "" }, { "docid": "e51196adec710a4f9091b236195c300d", "score": "0.53389984", "text": "function updateItemsAscensorValoresProteccion(k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_proteccion SET v_sele_inspector = ?,\"+\n \"v_sele_empresa = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [v_sele_inspector,v_sele_empresa,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresProteccion: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de protección...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "47a1cc14cab42fb630497128df48a311", "score": "0.5304901", "text": "function actualizar_lista_vista(){\n\t\tenviarFormulario(\"#form_lista_vista_actualizar\", 'ListaVista/actualizar_lista_vista', '#cuadro4');\n\t}", "title": "" }, { "docid": "53a0e2554afc57a747aff4403215a4bd", "score": "0.52841", "text": "function updateItemsAscensorValoresElementos(k_codusuario,k_codinspeccion,k_coditem, o_descripcion,v_seleccion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_elementos SET o_descripcion = ?,\"+\n \"v_selecion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [o_descripcion,v_seleccion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsAscensorValoresElementos: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos elementos...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "37c75d428e7b5245d7bf4f22611a59e6", "score": "0.5279467", "text": "function User_Update_Ventes_Ventes0(Compo_Maitre)\n{\n var Table=\"vente\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ve_quantite=GetValAt(262);\n if (!ValiderChampsObligatoire(Table,\"ve_quantite\",TAB_GLOBAL_COMPO[262],ve_quantite,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_quantite\",TAB_GLOBAL_COMPO[262],ve_quantite))\n \treturn -1;\n var ve_prix=GetValAt(263);\n if (!ValiderChampsObligatoire(Table,\"ve_prix\",TAB_GLOBAL_COMPO[263],ve_prix,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_prix\",TAB_GLOBAL_COMPO[263],ve_prix))\n \treturn -1;\n var ve_date=GetValAt(264);\n if (!ValiderChampsObligatoire(Table,\"ve_date\",TAB_GLOBAL_COMPO[264],ve_date,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_date\",TAB_GLOBAL_COMPO[264],ve_date))\n \treturn -1;\n var ve_personne=GetValAt(265);\n if (ve_personne==\"-1\")\n ve_personne=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ve_personne\",TAB_GLOBAL_COMPO[265],ve_personne,true))\n \treturn -1;\n var ve_recolte=GetValAt(266);\n if (ve_recolte==\"-1\")\n ve_recolte=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ve_recolte\",TAB_GLOBAL_COMPO[266],ve_recolte,true))\n \treturn -1;\n var note=GetValAt(267);\n if (!ValiderChampsObligatoire(Table,\"note\",TAB_GLOBAL_COMPO[267],note,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"note\",TAB_GLOBAL_COMPO[267],note))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ve_quantite=\"+(ve_quantite==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_quantite)+\"'\" )+\",ve_prix=\"+(ve_prix==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_prix)+\"'\" )+\",ve_date=\"+(ve_date==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_date)+\"'\" )+\",ve_personne=\"+ve_personne+\",ve_recolte=\"+ve_recolte+\",note=\"+(note==\"\" ? \"null\" : \"'\"+ValiderChaine(note)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "a22b0c07a75bc09533d36d378a2235c3", "score": "0.52791643", "text": "function editProduct(indice) {\n //EVENTO ONCLICK DEL BOTON EDITAR\n $(\"#productTable\").on(\"click\", \"#boton\", function () {\n //OBTENER LOS VALORES A UTILIZAR\n var prod = $(this).parents(\"tr\").find(\"td\").eq(0).attr(\"value\");\n var precio = $(this).parents(\"tr\").find(\"td\").eq(1).html();\n var cantidad = $(this).parents(\"tr\").find(\"td\").eq(2).html();\n\n $(\"#producto\").val(prod);\n $('#producto').trigger('change'); // Notify any JS components that the value changed\n\n //RECORTAR VALOR DE LA FILA PARA AGREGARLO AL INPUT\n var str = precio;\n var res = str.split(\"C$ \");\n $(\"#precio\").val(res[1]);\n\n $(\"#cantidad\").val(cantidad);\n\n ////RECALCULAR TOTAL TFOOT\n //var totalF = $(\"#total\").html();\n //var prodPrecio = parseFloat(totalF.split(\"C$ \")[1]).toFixed(2);\n //var resta = parseFloat(parseFloat(prodPrecio).toFixed(2) - (parseFloat(res[1]).toFixed(2) * parseFloat(cantidad)).toFixed(2));\n\n indice.closest(\"tr\").remove();//ELIMINAMOS LA FILA A EDITAR\n\n //var total = parseFloat(CalcularTotal());\n\n CalcularTotal();\n //$(\"#total\").html(\"C$ \" + total);\n tablaVacio();\n });\n}//FIN FUNCTION", "title": "" }, { "docid": "0dd775bfe35dfb8d363ad327209ea44e", "score": "0.52775204", "text": "atualiza(){\n globais.chao.atualiza();\n }", "title": "" }, { "docid": "6174b041b891dec8318c0b2117f778e7", "score": "0.52739114", "text": "function actualizar(id){\r\n\r\n\t\t\t\t\t\t$.get(base_url+\"orden_de_pago/datos_orden\",{'id' : id},function(datos){\r\n\t\t\t\t\t\t\torden_de_pago=datos;\t\r\n\t\t\t\t\t\t\tvar acum_descuentos=0;\r\n\t\t\t\t\t\t\tvar html_orpa=\"<div class='header-titulos'>datos de la orden de pago</div>\";\r\n\t\t\t\t\t\t\thtml_orpa+=\"<b>Nro : </b>\"+datos._id+\"<b> fecha de emicion :</b> \"+datos._fecha_emicion+\"</br>\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\thtml_orpa+=\"<b>DESCUENTOS</b></br>\";\r\n\r\n\r\n\r\n\t\t\t\t\t\t\tfor (var i = 0; i < datos._factura._descuentos.length; i++) {\r\n\t\t\t\t\t\t\t\t\thtml_orpa+=datos._factura._descuentos[i]._tipo +\" : \"+datos._factura._descuentos[i]._cantidad+\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \";\r\n\t\t\t\t\t\t\t\t\tacum_descuentos+= datos._factura._descuentos[i]._cantidad; \r\n\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t\thtml_orpa+=\"<b></br>TOTAL DESCUENTO</b> \"+acum_descuentos+\" </br>\";\r\n\r\n\t\t\t\t\t\t\thtml_orpa+=\"<b>ABONOS</b></br>\";\r\n\r\n\t\t\t\t\t\t\tabonooo=0;\r\n\r\n\t\t\t\t\t\t\tfor (var i = 0; i < datos.abonos.length; i++) {\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t trans=parseFloat(datos.abonos[i]._transferencia._cantidad);\r\n\t\t\t\t\t\t\t\t che=parseFloat(datos.abonos[i]._cheque._cantidad);\r\n\r\n\t\t\t\t\t\t\t\tif (isNaN(trans)) {\r\n\t\t\t\t\t\t\t\t\ttrans=0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (isNaN(che)) {\r\n\t\t\t\t\t\t\t\t\tche=0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tabonoo=parseFloat(trans+che);\r\n\r\n\t\t\t\t\t\t\t\t\thtml_orpa+= \"nro de orden :\" +datos.abonos[i]._id +\" --- cantidad : \"+ abonoo +\"</br>\";\r\n\t\t\t\t\t\t\t\tabonooo+=parseFloat(abonoo);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\t\t\thtml_orpa+=\"<b>TOTAL A CANCELAR </b>\"+( datos._factura._total_a_pagar-acum_descuentos-abonooo)+\" </br>\";\r\n\t\t\t\t\t\t\torden_de_pago.total_cancelar_final=datos._factura._total_a_pagar-acum_descuentos-abonooo;\r\n\t\t\t\t\t\t\t$(\"#datos_orden_de_pago\").html(html_orpa);\r\n\r\n\r\n\r\n\t\t\t\t\t\t\tif (datos._factura._tipo_descuento=='1') {\r\n\t\t\t\t\t\t\t\tvar tipo_descuento=\"%\";\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar tipo_descuento=\"Bs\";\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar html_fac=\"<div class='header-titulos'>datos de la factura <div id='descuento_modal'>aplicar descuentos</div></div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp3'>tipo:\"+datos._factura._tipo+\"</div><div class='camp3'>Nro:\"+datos._factura._id+\"</div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp3'>vencimiento:\"+datos._factura._fecha_vencimiento+\"</div>\";\r\n\r\n\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp1'>cantidad</div> <div class='camp2'><div class='dos_puntos'>:</div><div class='cantdades'>\"+datos._factura._monto+\"</div><div class='tm'>Bs</div></div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp1'>descuento</div> <div class='camp2'><div class='dos_puntos'>:</div><div class='cantdades'>\"+datos._factura._descuento+\"</div><div class='tm'>\"+tipo_descuento+\"</div></div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp1'>sub total</div> <div class='camp2'><div class='dos_puntos'>:</div><div class='cantdades'>\"+datos._factura._sub_total+\"</div><div class='tm'>Bs</div></div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp1'>iva</div> <div class='camp2'><div class='dos_puntos'>:</div><div class='cantdades'>\"+datos._factura._iva+\"</div><div class='tm'>Bs</div></div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp1'>retencion</div> <div class='camp2'><div class='dos_puntos'>:</div><div class='cantdades'>\"+datos._factura._retencion._retencion+\"</div><div class='tm'>Bs</div></div>\";\r\n\t\t\t\t\t\t\thtml_fac+=\"<div class='camp1'>total</div> <div class='camp2'><div class='dos_puntos'>:</div><div class='cantdades'>\"+datos._factura._total_a_pagar+\"</div><div class='tm'>Bs</div></div>\";\r\n\r\n\t\t\t\t\t\t\t$(\"#datos_factura\").html(html_fac);\r\n\t\t\t\t\t\t\t$(\"#saldo_pendiente\").val(datos._factura._total_a_pagar-acum_descuentos);\r\n\t\t\t\t\t\t\tverificar_pagar($('#cantidad_a_pagar')[0]);\r\n\r\n\t\t\t\t\t\t},'json');\r\n\t\t\t\t}", "title": "" }, { "docid": "3e8413b385027a8d8d0e8c8bb36d5d5c", "score": "0.5270973", "text": "function addItemsAscensorValoresInforme(k_codinforme,v_consecutivoinforme,k_codusuario,f_informe) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO informe (k_codinforme,v_consecutivoinforme,k_codusuario,f_informe) VALUES (?,?,?,?)\";\n tx.executeSql(query, [k_codinforme,v_consecutivoinforme,k_codusuario,f_informe], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de informes...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "dcf01b3ef5d0d38628e51b97008ff98c", "score": "0.5265464", "text": "function update_valeur_marchande(cible){\n var nouvelle_valeur = cible.val();\n// console.log(nouvelle_valeur);\n var quotient = cible.parent().data(\"achat-qtt\");\n nouvelle_valeur=parseFloat(nouvelle_valeur)/parseFloat(quotient);\n nouvelle_valeur = Math.round(nouvelle_valeur*100)/100;\n cible.parent().data(\"valeurmarchande\",parseFloat(nouvelle_valeur));\n// console.log(cible.parent().data(\"valeurmarchande\"));\n}", "title": "" }, { "docid": "62ec46a11d5aa1c00fc8216d69e7729c", "score": "0.5261989", "text": "function calcularResumen(){\r\n\t\tvar anticipo = limpiaCantidad($(\"#anticipo\").val());\r\n\t\t\r\n\t\tvar personalComprobado = 0;\r\n\t\tvar amexComprobado = 0; \r\n\t\tvar efectivoComprobado = 0;\r\n\t\tvar amexExternoComprobado = 0;\r\n\t\tvar montoReembolsar = 0;\r\n\t\tvar montoDescontar = 0;\r\n\t\t\r\n\t\tvar tablaLength = obtenTablaLength(\"comprobacion_table\");\r\n\t\t\r\n\t\tfor(var i = 1; i <= tablaLength; i++){\t\t\r\n\t\t\tif($(\"#div_row_conceptoTexto\"+i).text() == \"Personal\")\r\n\t\t\t\tpersonalComprobado+= limpiaCantidad($(\"#row_totalPartida\"+i).val());\r\n\t\t\telse{\r\n\t\t\t\tswitch( $(\"#div_row_tipoComprobacion\"+i).text() ){\r\n\t\t\t\t\tcase \"AMEX\":\r\n\t\t\t\t\t\tamexComprobado+= limpiaCantidad($(\"#row_totalPartida\"+i).val());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"Reembolso\":\r\n\t\t\t\t\t\tefectivoComprobado+= limpiaCantidad($(\"#row_totalPartida\"+i).val());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AMEX externo\":\r\n\t\t\t\t\t\tamexExternoComprobado+= limpiaCantidad($(\"#row_totalPartida\"+i).val());\r\n\t\t\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\tasignaVal(\"personalComprobado\", personalComprobado);\r\n\t\tasignaVal(\"amexComprobado\", amexComprobado);\r\n\t\tasignaVal(\"amexExternoComprobado\", amexExternoComprobado);\r\n\t\tasignaVal(\"efectivoComprobado\", efectivoComprobado);\r\n\t\tasignaVal(\"montoReembolsar\", montoReembolsar);\r\n\t\tasignaVal(\"montoDescontar\", montoDescontar);\r\n\t\t\r\n\t\tasignaText(\"div_personalComprobado\", personalComprobado,\"number\");\r\n\t\tasignaText(\"div_amexComprobado\", amexComprobado,\"number\");\r\n\t\tasignaText(\"div_amexExternoComprobado\", amexExternoComprobado,\"number\");\r\n\t\tasignaText(\"div_efectivoComprobado\", efectivoComprobado,\"number\");\r\n\t\tasignaText(\"div_montoReembolsar\", montoReembolsar,\"number\");\r\n\t\tasignaText(\"div_montoDescontar\", montoDescontar,\"number\");\t\r\n\t}", "title": "" }, { "docid": "2320be4b1ac83422795c58038da729be", "score": "0.5260255", "text": "function obtenerValoresDefectos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion,n_calificacion FROM escaleras_valores_defectos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_defectos\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_lv_valor_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n $('#text_calificacion77').val(resultSet.rows.item(76).n_calificacion); //se obtiene la calificacion de la posicion 76 en este caso 76 ya que se empieza a contar desde cero\n $('#cal_item_defectos77').val(resultSet.rows.item(76).n_calificacion);\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "eac7c75dbb2a76466a97ff3315fd0bba", "score": "0.52403975", "text": "function User_Update_Firmes_Firmes0(Compo_Maitre)\n{\n var Table=\"firme\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var fi_nom=GetValAt(168);\n if (!ValiderChampsObligatoire(Table,\"fi_nom\",TAB_GLOBAL_COMPO[168],fi_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"fi_nom\",TAB_GLOBAL_COMPO[168],fi_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"fi_nom=\"+(fi_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(fi_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "21ba36c6b7b842673b00b1302a2fabbc", "score": "0.523622", "text": "function actualizarDatosFilas() {\n var primer_valor;\n $(document).on('focusin', '.update', function () {\n primer_valor = $(this).text();\n })\n\n $(document).on('focusout', '.update', function (e) {\n\n var id = $(this).data(\"id\");\n var columna_nombre = $(this).data(\"column\");\n var valorcol = $(this).text();\n\n if (primer_valor !== valorcol && valorcol !== \"\") {\n $.confirm({\n icon: 'fa fa-question-circle',\n title: 'Realizar Cambios!',\n content: '<b>¿Está seguro de actualizar esta información?</b>',\n type: 'blue',\n typeAnimated: true,\n buttons: {\n aceptar: {\n icon: 'fa fa-warning',\n text: 'Confirmar',\n btnClass: 'btn-blue',\n keys: ['enter', 'shift'],\n action: function () {\n $.ajax({\n url: \"../ajax/pedido.php?op=editardatos\",\n method: \"POST\",\n data: {\n id: id,\n columna_nombre: columna_nombre,\n valorcol: valorcol\n },\n\n success: function (datos) {\n $.amaran({\n 'theme': 'awesome ok',\n 'content': {\n title: datos,\n message: ' ',\n info: 'satisfactoriamente',\n icon: 'fa fa-check'\n },\n 'position': 'top right',\n 'inEffect': 'slideRight'\n });\n selectTable.ajax.reload(null, false);\n }\n\n });\n\n }\n },\n cancelar: {\n text: 'Cancelar',\n btnClass: 'btn-default',\n keys: ['enter', 'a'],\n isHidden: false,\n isDisabled: false,\n },\n }\n });\n }\n });\n\n}", "title": "" }, { "docid": "9d53892e5900e4f1c1ecceca2a5a451d", "score": "0.52312034", "text": "function recuperar(){\n var ctablero = co;\n var pos = coo.split(\",\");\n var movimientos = cook;\n var met = cookie;\n\n var tablero2 = ctablero.split(\",\");\n cols = Math.floor(cvs.width / w);\n filas = Math.floor(cvs.height / w);\n\n for (var j = 0; j < filas; j++) {\n for (var i = 0; i < cols; i++) {\n var celda = new CeldaN(i,j,tablero2);\n tablero.push(celda);\n }\n }\n //Current es la casilla actual\n current = tablero[parseInt(pos[0])+parseInt(pos[1])*cols];\n\n determineMet(parseInt(met));\n}", "title": "" }, { "docid": "6f6ac695c5f234a5306214cb091bb9b3", "score": "0.5230515", "text": "function updateItemsAuditoriaInspeccionesEscaleras(k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion) {\n db.transaction(function (tx) {\n var query = \"UPDATE auditoria_inspecciones_escaleras SET o_consecutivoinsp = ?,\"+\n \"o_estado_envio = ?,\"+\n \"o_revision = ?,\"+\n \"v_item_nocumple = ?,\"+\n \"k_codcliente = ?,\"+\n \"k_codinforme = ?,\"+\n \"o_actualizar_inspeccion = ?,\"+\n \"k_codusuario_modifica = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ?\";\n tx.executeSql(query, [o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,o_actualizar_inspeccion,k_codusuario_modifica,k_codusuario,k_codinspeccion], function(tx, res) {\n console.log(\"rowsAffected updateItemsAuditoriaInspeccionesEscaleras: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de auditoria...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "0e98f7a44bf3d3f04aabcb57dd6e60f1", "score": "0.5228104", "text": "function llenarTablaAscensorValoresElementos(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_elementos.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem = item.k_coditem;\n var o_descripcion = item.o_descripcion;\n var v_seleccion = item.v_seleccion;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_elementos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresElementos(k_codusuario,codigo_inspeccion,k_coditem,o_descripcion,v_seleccion);\n }else{\n updateItemsAscensorValoresElementos(k_codusuario,codigo_inspeccion,k_coditem, o_descripcion,v_seleccion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n \n });\n }\n });\n}", "title": "" }, { "docid": "8b2108fe57f48ff1ee460c5805a0c5d1", "score": "0.5214392", "text": "function actualizarTabla(){\n var elemento=$('option:selected');\n var precio=elemento.val()*$('#cantidad').val();\n precioTotal=precioTotal+precio;\n $('tr:last').before(`<tr>\n <td>${elemento.text()}</td>\n <td>${$('#cantidad').val()}</td>\n <td>${precio}</td>\n </tr>`);\n $('td:last').text(precioTotal)\n}", "title": "" }, { "docid": "2f8fb87cd72e5dc9377704922dc1d599", "score": "0.52060103", "text": "function InterpolacionLineal()\n{\n getValues();\n FdXAprox = 0;\n FdXAprox = Number(((fieldData[0][1] + ((fieldData[1][1] - fieldData[0][1])/(fieldData[1][0]-fieldData[0][0])) * (X - fieldData[0][0]))).toFixed(5));\n $(\"#soluionY\").val(FdXAprox);\n $(\".fdx\").fadeIn();\n window.scrollBy(0, $(\"#soluionY\").offset().top);\n\n if($(\"#YValor\").val() != \"\")\n {\n \n PorcError();\n }\n }", "title": "" }, { "docid": "a148f8bb5daa5e0e19bae3209a2798e9", "score": "0.5204328", "text": "function llenarTablaAscensorValoresProteccion(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_proteccion.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem = item.k_coditem;\n var v_sele_inspector = item.v_sele_inspector;\n var v_sele_empresa = item.v_sele_empresa;\n var o_observacion = item.o_observacion;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_proteccion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresProteccion(k_codusuario,codigo_inspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion);\n }else{\n updateItemsAscensorValoresProteccion(k_codusuario,codigo_inspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "c15f710dfaed55d51236fc0ca64d36a8", "score": "0.52017665", "text": "function addItemsAscensorValoresPozo(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_valores_pozo (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected addItemsAscensorValoresPozo: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Finalizando...Espere\");\n setTimeout('cerrar_Ventana_Carga()',20000);\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "dfe64eecc76d3d86d95658d89df3c977", "score": "0.5195288", "text": "function addItemsAscensorValoresIniciales(k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos iniciales...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "32a1b9181b3e566792dcde0bd38ca3c9", "score": "0.51940525", "text": "function actualizaDatos(){\n\n\n\ttxt_Num_Control_Modificaciones=$('#txt_Num_Control_Modificaciones').val();\n\ttxt_Nombre_Modificaciones=$('#txt_Nombre_Modificaciones').val();\n\ttxt_Apellido_Paterno_Modificaciones=$('#txt_Apellido_Paterno_Modificaciones').val();\n\ttxt_Apellido_Materno_Modificaciones=$('#txt_Apellido_Materno_Modificaciones').val();\n\ttxt_Edad_Modificaciones=$('#txt_Edad_Modificaciones').val();\n\ttxt_Semestre_Modificaciones=$('#txt_Semestre_Modificaciones').val();\n\ttxt_Carrera_Modificaciones=$('#txt_Carrera_Modificaciones').val();\n\n\tcadena= \"txt_Num_Control_Modificaciones=\" + txt_Num_Control_Modificaciones +\n\t\t\t\"&txt_Nombre_Modificaciones=\" + txt_Nombre_Modificaciones + \n\t\t\t\"&txt_Apellido_Paterno_Modificaciones=\" + txt_Apellido_Paterno_Modificaciones +\n\t\t\t\"&txt_Apellido_Materno_Modificaciones=\" + txt_Apellido_Materno_Modificaciones +\n\t\t\t\"&txt_Edad_Modificaciones=\" + txt_Edad_Modificaciones +\n\t\t\t\"&txt_Semestre_Modificaciones=\" + txt_Semestre_Modificaciones +\n\t\t\t\"&txt_Carrera_Modificaciones=\" + txt_Carrera_Modificaciones;\n\n\t$.ajax({\n\t\ttype:\"POST\",\n\t\turl:\"php/actualizaDatos.php\",\n\t\tdata:cadena,\n\t\tsuccess:function(r){\n\t\t\t\n\t\t\tif(r==1){\n\t\t\t\t$('#tabla').load('componentes/tabla.php');\n\t\t\t\talertify.success(\"EL ALUMANO SE A ACTUALIZADO CON EXITO :)\");\n\t\t\t}else{\n\t\t\t\talertify.error(\"Fallo el servNumeroControlor :(\");\n\t\t\t}\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "dd2e8682ada208d418ee7251ccbfa794", "score": "0.5185784", "text": "function atualizaHoraMes() {\n //selecao dos dados\n var y = idMes.value;\n var inicioMesHors = y.indexOf('Horas pretendidas: ')+19;\n var finalMesHors = y.indexOf('Revisitas');\n var corteMesHors = y.slice(inicioMesHors, finalMesHors);\n //atualizacao hora\n var elemHora = document.getElementById('progressHoraMes');\n \n //Calculo enorme para pegar a porcentagem certa\n if(corteHors > corteMesHors){\n var progresso = Number(corteHors) * 100 / Number(corteMesHors);//calcula a porcentagem 1º do valor da meta, e 2º do valor cumprido!\n var barraHora = Math.round(progresso);//subtrai para achar quanto de 100 foi feito\n if(barraHora >= 100){\n var barraHoraPositivo = 100; \n }else{\n var barraHoraPositivo = barraHora;\n }\n }else if(corteMesHors > corteHors){\n var progresso = Number(corteMesHors) * 100 / Number(corteHors);//calcula a porcentagem 1º do valor da meta, e 2º do valor cumprido!\n var barraHora = 100 - Math.round(progresso);//subtrai para achar quanto de 100 foi feito\n var barraHoraPositivo = Math.abs(barraHora);\n }\n var progressoWidth = 0;\n var barra = setInterval(frame, 65);//seta o intervalo da funcao frame para 65 microsegundos\n function frame() {\n if (progressoWidth >= barraHoraPositivo){\n clearInterval(barra);\n }else{\n progressoWidth++;\n elemHora.style.width = progressoWidth + '%';\n //por o numero horas feitas em cima da barra\n elemHora.innerHTML = progressoWidth * 1 + '%';\n }\n }\n }", "title": "" }, { "docid": "4672c78f2bbbb3fe2345ce08ffd49973", "score": "0.518426", "text": "function ver_foto(ruta,nom_columna_con_foto){\n\tf\t\t\t\t\t\t=\tdocument.form1;\n\timagen\t\t\t\t\t= \tdocument.getElementById(\"img_registro\");\n\timagen.src\t\t\t\t=\truta;\n\tfila\t\t\t\t\t=\tdocument.getElementById('ver_foto');\n\tfila.style.display \t\t= \t'block';\n\tdocument.form1.eliminar_foto.focus();\n\tf.nom_columna_con_foto.value=\tnom_columna_con_foto;\n}", "title": "" }, { "docid": "6c710155d656a2fe08850bbf487e6f69", "score": "0.51756144", "text": "function actualizar(datos) {\n\treturn new Promise((resolve, reject) => {\n\t\tvar query = `UPDATE caracteristica SET denominacion = ? WHERE id = ?;`;\n\n\t\tvar dt = [datos.denominacion, datos.id];\n\n\t\tDatabase.ejecutarQuery(query, dt, (err, result) => {\n\t\t\tif(err) return reject(err);\n\n\t\t\tresolve(true);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "c997e20036afd13fba0264eecca2439d", "score": "0.51723963", "text": "function obtenerValoresPreliminar(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem_preli,v_calificacion,o_observacion FROM escaleras_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=seleval\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $(\"#text_obser_item\"+i+\"_eval_prel\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "86a6f0f5c3a159f2f47fd41e8f75649a", "score": "0.51709", "text": "function agregarFilaOtrosIngresos(obj){ \n \n var col1 = $(\"#af_tipoRelacion\").val(); //ok\n var col2 = $(\"#af_Denominacion_input\").val(); // <- ver selección\n var col3 = $(\"#af_CuitEmpleador\").val(); //ok\n var col4 = $(\"#af_IngresoBruto_input\").val(); // <- ver selección \n var text = $(\"#af_IngresoBruto_text\").val(); // <- no se usa\n if (text == ''){\n text = $(\"#af_IngresoBruto_input\").val();\n }\n\n var col5 = 0;\n if($(\"#fm_check\").is(':checked')){\n col5 = 1;\n }\n firmoMecanizada();\n \n /* ** sacar check para agregar columna */ \n if ((col1 == '') || (col2 == '') || (col3 == '') || (col4 == '')){\n alert (\"Complete todos los campos\");\n return false;\n }\n else{\n obj.value = parseInt(obj.value) + 1;\n var oId = obj.value;\n //función blanquear \n blanquearDeclarante();\n }\n //limpio el campo de ingreso\n $(\"#af_IngresoBruto_text\").val(\"\");\n \n var strHtml1 = \"<td><input type='text' name='af_otros_ingresos_\"+oId+\"_tipo_relacion' value='\"+col1+\"' readonly /></td> \";\n var strHtml2 = \"<td><input type='text' name='af_otros_ingresos_\"+oId+\"_denominacion' value='\"+col2+\"' readonly /></td> \";\n var strHtml3 = \"<td><input type='text' name='af_otros_ingresos_\"+oId+\"_cuit_empleador' value='\"+col3+\"' readonly /></td> \";\n var strHtml4 = \"<td><input type='hidden' name='af_otros_ingresos_\"+oId+\"_ingreso_bruto' value='\"+col4+\"' readonly /><input type='text' readonly value='\"+text+\"' /></td> \"; \n if (col5 == 1){\n var strHtml5 = \"<td><input type='checkbox' checked /><input type='hidden' name='af_otros_ingresos_\"+oId+\"_firmo_mecanizada' value='1' readonly='readonly' /></td> \";\n }else{\n var strHtml5 = \"<td><input type='checkbox' /><input type='hidden' name='af_otros_ingresos_\"+oId+\"_firmo_mecanizada' value='0' readonly='readonly' /></td> \";\n }\n \n var aux = document.getElementById('oi_cant_campos').value;\n var strHtml6 = \"<input type='button' value=' - ' onclick='sacarFilaOtrosIngresos(\"+aux+\")'/>\"; \n\n var objTr = document.createElement(\"tr\");\n objTr.id = \"af_row_otros_ingresos_\" + oId;\n \n var objTd1 = document.createElement(\"td\");\n objTd1.id = \"af_la\" + oId;\n objTd1.innerHTML = strHtml1; \n \n var objTd2 = document.createElement(\"td\");\n objTd2.id = \"af_la\" + oId;\n objTd2.innerHTML = strHtml2; \n \n var objTd3 = document.createElement(\"td\");\n objTd3.id = \"af_la\" + oId;\n objTd3.innerHTML = strHtml3; \n \n var objTd4 = document.createElement(\"td\");\n objTd4.id = \"af_la\" + oId;\n objTd4.innerHTML = strHtml4; \n \n var objTd6 = document.createElement(\"td\");\n objTd6.id = \"af_la\" + oId;\n objTd6.innerHTML = strHtml6; \n \n var objTd5 = document.createElement(\"td\");\n objTd5.id = \"af_la\" + oId;\n objTd5.innerHTML = strHtml5; \n \n objTr.appendChild(objTd6);\n objTr.appendChild(objTd1);\n objTr.appendChild(objTd2);\n objTr.appendChild(objTd3);\n objTr.appendChild(objTd4);\n objTr.appendChild(objTd5);\n \n var objTbody = document.getElementById(\"otrosIngresos\");\n objTbody.appendChild(objTr); \n return false;\n}", "title": "" }, { "docid": "52ce0e7cd7ed6eb320ac5ec6d9f60cd2", "score": "0.5141999", "text": "function llenarTablaAscensorValoresCabina(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_cabina.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem = item.k_coditem_cabina;\n var n_calificacion = item.n_calificacion;\n var v_calificacion = item.v_calificacion;\n var o_observacion = item.o_observacion;\n var cantidad_filas = item.cantidad_filas;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_cabina WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n //alert(\"Agregar -> \"+resultSet.rows.length);\n addItemsAscensorValoresCabina(k_codusuario,codigo_inspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion); \n }else{\n //alert(\"Actualizar -> \"+resultSet.rows.length);\n updateItemsAscensorValoresCabina(k_codusuario,codigo_inspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "af76a0f65eeb1919a183f28b0c33e0a6", "score": "0.51303905", "text": "function resetFactura(){\n $(\".filaArticuloVenta\").remove();\n \n $(\"#cadenaArticulosPrecios\").val(\"\");\n\n $(\"#campoTotal\").html(\"<span class='prefijo_numero'>$</span>\"+\"0\");\n $(\"#totalFactura\").val('');\n\n $(\"#campo_subtotal\").html(\"<span class='prefijo_numero'>$</span>\"+\"0\"); \n $(\"#subtotal\").val('');\n\n $(\"#campoValorFlete\").val(\"\");\n\n $(\"#campoIva\").val(\"\");\n\n $(\"#campoConcepto1\").val(\"\");\n\n $(\"#campoDescuento1\").val(\"\");\n\n $(\"#campoConcepto2\").val(\"\");\n\n $(\"#campoDescuento2\").val(\"\"); \n\n $(\"#campoObservaciones\").val(\"\");\n\n guardarFacturaTemporal(); \n}", "title": "" }, { "docid": "db98d2084538076588a2e7ee81f2885f", "score": "0.51279265", "text": "atualizaMatriz (requestAnimationFrame) {\n this.matriz = this.grafo.matriz(true)\n requestAnimationFrame(() => {\n this.atualizaMatriz(requestAnimationFrame)\n })\n }", "title": "" }, { "docid": "8e1eb2a331b473bd1af3b5d48dfb49b9", "score": "0.5114531", "text": "function exibeCalculoValorFuturo() {\n\n const valPresenteUI = document.getElementById('present-value');\n const txUI = document.getElementById('interest-rate');\n const periodoUI = document.getElementById('periods');\n const valFuturoUI = document.getElementById('futurevalue');\n\n const valPresente = parseFloat(valPresenteUI.value);\n const tx = parseFloat(txUI.value) / 100;\n const periodo = parseInt(periodoUI.value);\n\n console.log(valPresente, tx, periodo);\n \n\n const valFuturo = calculadora.calculate(valPresente, tx, periodo);\n console.log(valFuturo);\n\n if (isFinite(valFuturo)) {\n valFuturoUI.value = valFuturo.toFixed(4);\n\n // Show results and hide loading\n ui.showOrHideResultsOrLoading(calculadora, 'block', 'none');\n } else {\n ui.showError('Parâmetros inválidos ou não informados.');\n }\n\n}", "title": "" }, { "docid": "f3db7b759e65200edee491e4e2746165", "score": "0.51090395", "text": "function addItemsAscensorValoresPreliminar(k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion) VALUES (?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos preliminares...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "20c5a5bd3be4d4cfccede344e409dee4", "score": "0.51016957", "text": "function addItemsEscalerasValoresFinales(k_codusuario,k_codinspeccion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO escaleras_valores_finales (k_codusuario,k_codinspeccion,o_observacion) VALUES (?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de observación...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "d7fde46e6cab08271d07111708a59717", "score": "0.5099115", "text": "function __UD17SetTableValue(m,c,r,v) {\n switch (m) {\n case 0:\n rom.wordAt(rom.addressOf('LOW_FUEL') + (r * 0x0F * 2) + (c * 2)) = Math.round(v * 4);\n break;\n case 1:\n rom.wordAt(rom.addressOf('HIGH_FUEL') + (r * 0x0F * 2) + (c * 2)) = Math.round(v * 4);\n break;\n case 2:\n v = Math.round(v * 4) + 24;\n if (v > 0xFF) v = 0xFF;\n else if (v < 0x00) v = 0x00;\n rom.byteAt(rom.addressOf('LOW_IGNITION') + (r * 0x0F) + c) = v;\n break;\n case 3:\n v = Math.round(v * 4) + 24;\n if (v > 0xFF) v = 0xFF;\n else if (v < 0x00) v = 0x00;\n rom.byteAt(rom.addressOf('HIGH_IGNITION') + (r * 0x0F) + c) = v;\n break;\n }\n}", "title": "" }, { "docid": "f3e088ad346a55a167369fc75236a823", "score": "0.50976384", "text": "function primeraFase(matriz){\n var bandera = 1;\n var iteracion = 1;\n\n while (bandera !== 0) {\n var mayor = 0.0;\n var menor = 1000000000.0;\n var entra_max, sale_min, hacer_uno;\n bandera = 0;\n\n //Imprimimos el tabla actual\n var str_table =\n \"<br><div align = 'left' class='ml-4'><br><h5 class='m-0'>Iteración \" + iteracion++ + \"</h5></div>\";\n document.getElementById(\"content\").innerHTML += str_table;\n imprimeTabla(matriz, resNumber, total + 1);\n //Seleccionamos la variable de entrada\n for (let j = 1; j <= total; j++) {\n if (matriz[0][j] > 0 && matriz[0][j] > mayor) {\n mayor = matriz[0][j];\n entra_max = j;\n bandera = 1;\n }\n }\n\n //Seleccion de la variable de salida\n for (let i = 1; i <= resNumber; i++) {\n if (entra_max > 0 && matriz[i][entra_max] > 0) {\n if (matriz[i][total + 1] / matriz[i][entra_max] < menor) {\n menor = parseFloat(matriz[i][total + 1] / matriz[i][entra_max]);\n sale_min = i;\n }\n }\n }\n\n // Calculamos las variables de la siguiente iteracion\n var hacer_uno_a = matriz[sale_min][entra_max];\n hacer_uno = parseFloat(hacer_uno_a);\n\n //str_table = \"<div class='d-flex flex-row w-50 ml-4 bd-highlight' align = 'left' ><br><p class='bd-highlight'>Entra X\" + entra + \"&nbsp;&nbsp;</p>\";\n //str_table += \"<p>Sale R\" + sale_min + \"</p></div>\";\n document.getElementById(\"content\").innerHTML += str_table;\n\n for (let j = 1; j <= total + 1; j++) {\n matriz[sale_min][j] /= hacer_uno;\n //matriz[sale_min][j] = parseFloat(matriz[sale_min][j]);\n }\n\n //imprimeTabla(matriz, resNumber, total+1);\n for (var i = 0; i <= resNumber; i++) {\n var vector = [];\n if (matriz[i][entra_max] !== 0 && i !== sale_min) {\n var aux = matriz[i][entra_max];\n for (var j = 0; j <= total + 1; j++) {\n matriz[i][j] += matriz[sale_min][j] * aux * -1;\n if (\n matriz[i][j] <= 2.220446049250313e-8 &&\n matriz[i][j] >= -4.440892098500626e-8\n )\n matriz[i][j] = 0;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "9ebc131093b055ae1d3b0354b7ce0323", "score": "0.5093797", "text": "function actualizar_vendedor(){\n\t\t$(\"#form_vendedor_editar\").submit(function(e){\n e.preventDefault(); //previene el comportamiento por defecto del formulario al darle click al input submit\n var id_vendedor = $(\"#id_vendedor_editar\").val();\n var tipo_vendedor = $(\"#tipo_vendedor_editar\").val();\n var rfc = $(\"#rfc_editar\").val();\n\n \tvar objetoInmobiliaria = [];\n \tvar objetoProyectos = [];\n\n \tvar objetoProyectosClientes = [];\n var objetoClientes = [];\n\n\n\n /*$(\"#tableInmobiliariaEditar tbody tr\").each(function() {\n \tvar inmobiliaria = [];\n \tvar id = $(this).find(\".id_inmobiliaria\").val();\n \tinmobiliaria.push(id);\n\t\t\t\tobjetoInmobiliaria.push(inmobiliaria);\n\t\t\t});\n\n\n\t\t\t$(\"#tableInmobiliariaEditar tbody tr\").each(function() {\n \tvar proyectos = [];\n \tvar id_pro = $(this).find(\".id_proyecto\").val();\n \tproyectos.push(id_pro);\n\t\t\t\tobjetoProyectos.push(proyectos);\n\t\t\t});*/\n\n\n\t\t\t/*$(\"#tableClientesEditar tbody tr\").each(function() {\n \tvar proyectos_clientes = [];\n \tvar id_pro = $(this).find(\".id_proyecto_cliente\").val();\n \tproyectos_clientes.push(id_pro);\n\t\t\t\tobjetoProyectosClientes.push(proyectos_clientes);\n\t\t\t});*/\n\n\n\t\t\t$(\"#tableClientesEditar tbody tr\").each(function() {\n \tvar clientes = [];\n \tvar id_cliente = $(this).find(\".id_cliente\").val();\n \tclientes.push(id_cliente);\n\t\t\t\tobjetoClientes.push(clientes);\n\t\t\t});\n\n\n\n\t\t\tvar data = new FormData();\n\t\t\tdata.append('id_vendedor', id_vendedor);\n\t\t\tdata.append('tipo_vendedor', tipo_vendedor);\n\t\t\tdata.append('rfc', rfc);\n\t\t\t/*for (var i = 0; i < objetoInmobiliaria.length; i++) {\n\t\t\t\tdata.append('inmobiliarias[]', objetoInmobiliaria[i]);\n\t\t\t}\n\n\n\t\t\tfor (var i = 0; i < objetoProyectos.length; i++) {\n\t\t\t\tdata.append('proyectos[]', objetoProyectos[i]);\n\t\t\t}\n\n\n\t\t\tfor (var i = 0; i < objetoProyectosClientes.length; i++) {\n\t\t\t\tdata.append('proyectos_clientes[]', objetoProyectosClientes[i]);\n\t\t\t}*/\n\n\t\t\tfor (var i = 0; i < objetoClientes.length; i++) {\n\t\t\t\tdata.append('clientes[]', objetoClientes[i]);\n\t\t\t}\n\t\t\t\n $('input[type=\"submit\"]').attr('disabled','disabled'); //desactiva el input submit\n $.ajax({\n url: document.getElementById('ruta').value + 'vendedores/actualizar_vendedor',\n type: 'POST',\n dataType:'JSON',\n data:data,\n cache: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tcontentType: false,\n beforeSend: function(){\n mensajes('info', '<span>Guardando datos, espere por favor... <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i></span>');\n },\n error: function (repuesta) {\n $('input[type=\"submit\"]').removeAttr('disabled'); //activa el input submit\n var errores=repuesta.responseText;\n if(errores!=\"\")\n mensajes('danger', errores);\n else\n mensajes('danger', \"<span>Ha ocurrido un error, por favor intentelo de nuevo.</span>\"); \n },\n success: function(respuesta){\n $('input[type=\"submit\"]').removeAttr('disabled'); //activa el input submit\n mensajes('success', respuesta);\n listar('#cuadro4');\n }\n });\n });\n\t}", "title": "" }, { "docid": "83a6b288f7990754246f5320370c70c1", "score": "0.5090882", "text": "async function medirEnVivo(){\n let historialesRecolectados = await obtenerHistorialesAtleta(mainApp.datosDePerfilEnSesion.username);\n //buscamos la medición mas reciente o en vivo(la última)\n let medicionActual = historialesRecolectados[historialesRecolectados.length-1];\n /*Puede ser cualquier medicion ya que siempre se envia la misma cantidad para las 3, \n se escogio´temperatura ya que su sensor es más estable:*/\n mainApp.indicadoresDeSaludVariables.cantidadMedicionesActual = medicionActual.temperatura.length-1;\n if(mainApp.indicadoresDeSaludVariables.cantidadMedicionesActual != mainApp.indicadoresDeSaludVariables.cantidadMedicionesPrevia){\n //Ritmo Cardiaco\n mainApp.indicadoresDeSaludVariables.pulsoActual = medicionActual.pulso[medicionActual.pulso.length-1];\n mainApp.indicadoresDeSaludVariables.pulsoPromedio = medicionActual.pulsoPromedio;\n dataRitmoGrafico.push(medicionActual.pulso[medicionActual.pulso.length-1]);\n labelsRitmoGrafico.push(medicionActual.pulso[medicionActual.pulso.length-1]);\n graficoRitmoCardiaco.update();\n //Temperatura\n mainApp.indicadoresDeSaludVariables.temperaturaActual = medicionActual.temperatura[medicionActual.temperatura.length-1];\n mainApp.indicadoresDeSaludVariables.temperaturaMaxima = medicionActual.tempMaxima;\n mainApp.indicadoresDeSaludVariables.temperaturaMinima = medicionActual.tempMinima;\n mainApp.indicadoresDeSaludVariables.temperaturaPromedio = medicionActual.tempPromedio;\n dataTemperaturaGrafico.push(medicionActual.temperatura[medicionActual.temperatura.length-1]);\n labelsTemperaturaGrafico.push(medicionActual.temperatura[medicionActual.temperatura.length-1]);\n graficoTemperatura.update();\n //Oxigeno\n mainApp.indicadoresDeSaludVariables.oxigenoActual = medicionActual.oxigeno[medicionActual.oxigeno.length-1];\n mainApp.indicadoresDeSaludVariables.oxigenoPromedio = medicionActual.oxigenoPromedio;\n dataOxigenoGrafico.push(medicionActual.oxigeno[medicionActual.oxigeno.length-1]);\n labelsOxigenoGrafico.push(medicionActual.oxigeno[medicionActual.oxigeno.length-1]);\n graficoOxigeno.update();\n //actualizamos el estado\n mainApp.indicadoresDeSaludVariables.cantidadMedicionesPrevia = medicionActual.temperatura.length;\n mainApp.indicadoresDeSaludVariables.indicadorSeguimiento = true;\n }else{\n mainApp.indicadoresDeSaludVariables.cantidadMedicionesPrevia = medicionActual.temperatura.length;\n mainApp.indicadoresDeSaludVariables.indicadorSeguimiento = false;\n }\n}", "title": "" }, { "docid": "5bcf76d2a106010f1ec31d7548f9eca0", "score": "0.508653", "text": "function adapt_data(){\n \n //console.log (\"En json_actualizar: \"+step+\"-\"+traj+\"-\"+energy);\n for (var j=0; j<jsonArr.length; j++) {\n var json_aux = jsonArr[j]; \n if ((json_aux[j])[1] == 0) { //Actualizamos ceros de la rtayectoria 1\n (jsonArr[j])[1] = last_energy;\n }\n \n if ((json_aux[j])[2] == 0) { //Actualizamos ceros de la trayectoria 2\n (jsonArr[j])[2] = last_energy;\n }\n \n }\n \n }", "title": "" }, { "docid": "144b2fddf60f2db9066b50afc2684870", "score": "0.50772595", "text": "function actualizaDatos(){\n //Se reciben los valores de los inputs por medio de los id\n iddocente=$('#iddocente').val();\n nombre2=$('#nombre2u').val();\n apellido2=$('#apellido2u').val();\n estado_civil2=$('#estado_civil2u').val();\n ciudad2=$('#ciudad2u').val();\n \n //Se crea una cadena para enviarla por ajax con los valores creados anteriormente\n cadena= \"iddocente=\" + iddocente +\n \"&nombre2=\" + nombre2 +\n \"&apellido2=\" + apellido2 +\n \"&estado_civil2=\" + estado_civil2 +\n \"&ciudad2=\" + ciudad2;\n //Este ajax envia la cadena a un archivo php\n //EN el archivo php se encuentra el proceso de validar y actualizacion de datos\n //En ese archivo php retorna un valor\n $.ajax({\n type:\"POST\",\n url:\"docente/controlador/actualizaDatos.php\",\n data:cadena,\n success:function(r){//Esta funcion recibe el valor retornado\n if(r==1){//Se valida si el valor retornado es igual a 1, pues esto es el resultado de la consulta sql, si se ejecuto sin ningun problema\n $('#tabladoc').load('docente/componentes/tabla.php');//Cargar la tabla donde estan los registros de de docente\n alertify.success(\"Actualizado con exito :)\");\n }else{\n alertify.error(\"Fallo el servidor :(\");//Se muestra una alerta con el valor retornado, que sera el mensaje de la validacion\n }\n }\n });\n\n}", "title": "" }, { "docid": "1427eb93b7801e37e4a07e9f456f9734", "score": "0.50729156", "text": "function montaValorMes () {\r\n // laco de contas\r\n for (var x in $scope.contas) {\r\n // separo a despesa\r\n var conta = $scope.contas[x];\r\n // crio um atributo pres(array) na conta\r\n conta.pres = [];\r\n \r\n // laco de meses até 8\r\n // for (var m=0; m<8; m++) {\r\n for (var m=0; m<$scope.tlmeses; m++) {\r\n var day = moment().add(m, \"M\").date(); // dia atual + 1\r\n var month = moment().add(m, \"M\").month(); // mes atual + 1\r\n var year = moment().add(m, \"M\").year(); // ano atual + 1\r\n var data = ''; // variavel data\r\n \r\n var totalParcela = (conta.parcela<10) ? '0'+conta.parcela : conta.parcela;\r\n var valorParcela = (conta.valor/conta.parcela).toFixed(2);\r\n var contaparcela = conta.parcela;\r\n\r\n // se as parcelas forem indeterminadas\r\n if (+conta.parcela === 0) {\r\n totalParcela = 'IND';\r\n valorParcela = conta.valor;\r\n contaparcela = 12;\r\n }\r\n\r\n \r\n // if (totalParcela === undefined) {\r\n // console.log(conta);\r\n // }\r\n\r\n // laco de parcelas da conta\r\n for (var p=0; p<contaparcela; p++) {\r\n var dia = moment(conta.datavencimento).add(p, \"M\").date(); // dia da data conta + index\r\n var mes = moment(conta.datavencimento).add(p, \"M\").month(); // mes data conta + index\r\n var ano = moment(conta.datavencimento).add(p, \"M\").year(); // ano data conta + index\r\n \r\n // console.log(dia + ' _ ' + mes + ' _ ' + ano);\r\n\r\n // caso o mes e ano da conta seja = ao mes e ano atual \r\n if (mes === month && ano === year) {\r\n if (conta.tipo === 'ARECEBER') {\r\n data = {\"data\": mes+\"/\"+ano, \"valor\":valorParcela, \"icon\":\"fa fa-plus\", \"ngClass\":\"entrada\"};//conta.valor};\r\n }else{\r\n data = {\"data\": mes+\"/\"+ano, \"valor\":valorParcela, \"icon\":\"fa fa-minus\", \"ngClass\":\"saida\"};//conta.valor};\r\n }\r\n // pegando a prestação atual\r\n if (m === 0) { // m = o ( mes atual )\r\n var pa = ((p+1)<10)?'0'+(p+1):(p+1);\r\n // indeterminado\r\n if (+conta.parcela === 0) {\r\n conta.parcelaAtual = totalParcela;\r\n // com parcelas\r\n }else{\r\n conta.parcelaAtual = pa+\"/\"+totalParcela;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!conta.parcelaAtual) {\r\n // se ano = atual mas mes menor ou ano menor\r\n if ( (ano === year && mes < month) || (ano < year) ) {\r\n if (+conta.parcela === 0) {\r\n conta.parcelaAtual = totalParcela;\r\n }else{\r\n conta.parcelaAtual = totalParcela+\"/\"+totalParcela;\r\n }\r\n }else{\r\n // if (+conta.parcela === 0) {\r\n // conta.parcelaAtual = totalParcela;\r\n // }else{\r\n conta.parcelaAtual = \"00/\"+totalParcela;\r\n // }\r\n }\r\n }\r\n \r\n if ( data === '' ) {\r\n conta.pres.push({\"data\": \"00/0000\", \"valor\":\"xxxx\", \"ngClass\":\"neutro\", \"icon\":\"fa-trophyx\"});\r\n }else{\r\n conta.pres.push(data);\r\n // calculando o total mensal\r\n if (conta.tipo === 'APAGAR') {\r\n $scope.totalMesDespesa[m].valor = (+$scope.totalMesDespesa[m].valor + +valorParcela).toFixed(2);\r\n }else{\r\n $scope.totalMesRecebimento[m].valor = (+$scope.totalMesRecebimento[m].valor + +valorParcela).toFixed(2);\r\n }\r\n $scope.totalMesSaldo[m].valor = (+$scope.totalMesRecebimento[m].valor + -$scope.totalMesDespesa[m].valor).toFixed(2);\r\n\r\n }\r\n }\r\n \r\n if (conta.tipo === 'APAGAR') {\r\n $scope.totalDespesa = (+$scope.totalDespesa + +conta.valor).toFixed(2);\r\n }else{\r\n $scope.totalRecebimento = (+$scope.totalRecebimento + +conta.valor).toFixed(2);\r\n }\r\n \r\n $scope.totalSaldo = (+$scope.totalRecebimento - +$scope.totalDespesa).toFixed(2);\r\n }\r\n setUpDownMes();\r\n }", "title": "" }, { "docid": "5b0092f0a05b65dd5fd3090936f627aa", "score": "0.5069769", "text": "function almacenarFecLimite() {\n\tlocalStorage.feclimite = document.getElementById(\"fec_limite\").value;\n}", "title": "" }, { "docid": "a7de56034bc1cefa51195103ae0fa13c", "score": "0.5066543", "text": "function llenarTablaEscalerasValoresIniciales(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_escaleras_valores_iniciales.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var n_cliente = item.n_cliente;\n var n_equipo = item.n_equipo;\n var n_empresamto = item.n_empresamto;\n var v_velocidad = item.v_velocidad;\n var o_tipo_equipo = item.o_tipo_equipo;\n var v_inclinacion = item.v_inclinacion;\n var f_fecha = item.f_fecha;\n var v_ancho_paso = item.v_ancho_paso;\n var v_codigo = item.v_codigo;\n var o_consecutivoinsp = item.o_consecutivoinsp;\n var ultimo_mto = item.ultimo_mto;\n var inicio_servicio = item.inicio_servicio;\n var ultima_inspeccion = item.ultima_inspeccion;\n var h_hora = item.h_hora;\n var o_tipo_informe = item.o_tipo_informe;\n \n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM escaleras_valores_iniciales WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n //alert(resultSet.rows.length);\n if (resultSet.rows.length == 0) {\n addItemsEscalerasValoresIniciales(k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe);\n }else{\n updateItemsEscalerasValoresIniciales(n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe, k_codusuario,codigo_inspeccion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n \n });\n }\n });\n}", "title": "" }, { "docid": "204198b2b7224a3c4e14ff91278230d4", "score": "0.5065281", "text": "function actualizarCarrito() {\n contadorCarrito.innerText = carritoDeCompras.reduce((acc , el)=> acc + el.cantidad, 0);\n precioTotal.innerText = carritoDeCompras.reduce((acc, el) => acc + (el.precio * el.cantidad), 0);\n }", "title": "" }, { "docid": "99b9c5d9894017368a2674a87fbbbbbe", "score": "0.5058487", "text": "function pagarMotoqueiro(valorTotalRecebido, valorTotalRepassado, entrega){\n let data = dataAtual()\n let hora = horaAtual()\n let nome = document.querySelector('#input-name').value\n let semana = [\"Domingo\", \"Segunda-Feira\", \"Terça-Feira\", \"Quarta-Feira\", \"Quinta-Feira\", \"Sexta-Feira\", \"Sábado\"]\n\n firebase.database().ref(`users/${userUid}/motoqueiros/${nome}/${data.ano}/${data.mes}/${data.dia}`)\n .set({\n valorRecebido: valorTotalRecebido,\n valorRepassado: valorTotalRepassado,\n diaDaSemana: semana[data.diaDaSemana],\n entregas: entrega,\n horario: `${hora.hora}:${hora.minuto}` \n })\n }", "title": "" }, { "docid": "a28f13aa93412056860a51c59c1ca754", "score": "0.5057884", "text": "function inicio(){\n\tvar canvas = document.getElementById(\"campo\");\n\ttablero = canvas.getContext(\"2d\"); //contexto\n\tgenerar();\n\t/*\n\t//prueba limites de la fruta\n\tangulos.supDer = vecinos(183);\n\tangulos.supIzq = angulos.supDer - 50;\n\tangulos.infDer = vecinos(215);\n\tangulos.infIzq = angulos.infDer - 50;\n\tdocument.writeln(\n\t\t\"x:183 y:215 <br >\"+\n\t\t\"limite superior I:\"+angulos.supIzq+\" , \"+\n\t\t\"limite inferior I:\"+angulos.infIzq+\" , \"+\"<br />\"+\n\t\t\"limite superior D:\"+angulos.supDer+\" , \"+\t\t\n\t\t\"limite inferior D:\"+angulos.infDer\n\t\t);\n\t*/\n\t//cargar toda imagenes de fondo\n\tfondo.imagen = new Image(); \t\t\t\t//<img> en html\n\t//valida la creacion debajo\n\t//console.log(fondo);\n\tfondo.imagen.src = fondo.imagenURL; \t\t//equivale a fondo.jpg\n\tfondo.imagen.onload = confirmarFondo;\t\t//carga imagen en html\n\n\ttifis.frente = new Image(); \t\t\t\t//<img> en html\n\ttifis.frente.src = tifis.frenteURL; \t\t//equivale a fondo.jpg\n\ttifis.frente.onload = confirmarFrente;\t\t//carga imagen en html\n\t\n\ttifis.atras = new Image(); \t\t\t\t\t//<img> en html\n\ttifis.atras.src = tifis.atrasURL; \t\t\t//equivale a fondo.jpg\n\ttifis.atras.onload = confirmarAtras;\t\t//carga imagen en html\n\t\n\ttifis.der = new Image(); \t\t\t\t\t//<img> en html\n\ttifis.der.src = tifis.derURL; \t\t\t\t//equivale a fondo.jpg\n\ttifis.der.onload = confirmarDer;\t\t\t//carga imagen en html\n\t\n\ttifis.izq = new Image(); \t\t\t\t\t//<img> en html\n\ttifis.izq.src = tifis.izqURL; \t\t\t\t//equivale a fondo.jpg\n\ttifis.izq.onload = confirmarIzq;\t\t\t//carga imagen en html\n\n\tliz.lizy = new Image(); \t\t\t\t\t//<img> en html\n\tliz.lizy.src = liz.lizURL; \t\t\t\t\t//equivale a fondo.jpg\n\tliz.lizy.onload = confirmarLiz;\t\t\t\t//carga imagen en html\n\n\tfresa.ouch = new Image(); \t\t\t\t\t//<img> en html\n\tfresa.ouch.src = fresa.fresaURL; \t\t\t\t\t//equivale a fondo.jpg\n\tfresa.ouch.onload = confirmarFresa;\t\t\t\t//carga imagen en html\n\n\tdocument.addEventListener(\"keydown\", teclado);\n\t//var m = document.getElementById(\"mover\");\n\t//m.addEventListener(\"click\", movimiento);\n}", "title": "" }, { "docid": "f7853ea6d88f3e01d8310a203103e909", "score": "0.50540024", "text": "function obtenerValoresObservacionFinal(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT o_observacion FROM escaleras_valores_finales WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0; x < resultSet.rows.length; x++) {\n $(\"#text_observacion_final\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "f7d3b2a3b494a7e728158564753d4f8c", "score": "0.5050881", "text": "setEstimation(data){\r\n let index;\r\n\r\n this.data.pomodoros.find((pomodoro, i) => {\r\n if(pomodoro.status === \"none\"){\r\n index = i;\r\n return pomodoro;\r\n }\r\n });\r\n\r\n this.data.pomodoros[index].status = data.status;\r\n this.data.estimationUsed++;\r\n\r\n Firebase.updateValue(this.data).catch((err) => {\r\n Notification().showMessage(\"error\", \"Oops! Error was occurred! \" + err.message);\r\n });\r\n }", "title": "" }, { "docid": "bebf1674ce711159a510deeb57636398", "score": "0.50505203", "text": "function User_Update_Application_de_profil_Application__de_profil0(Compo_Maitre)\n{\n var Table=\"applique\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var al_sousilot=GetValAt(8);\n if (al_sousilot==\"-1\")\n al_sousilot=\"null\";\n if (!ValiderChampsObligatoire(Table,\"al_sousilot\",TAB_GLOBAL_COMPO[8],al_sousilot,true))\n \treturn -1;\n var al_profil=GetValAt(9);\n if (al_profil==\"-1\")\n al_profil=\"null\";\n if (!ValiderChampsObligatoire(Table,\"al_profil\",TAB_GLOBAL_COMPO[9],al_profil,true))\n \treturn -1;\n var al_periodedebut=GetValAt(10);\n if (!ValiderChampsObligatoire(Table,\"al_periodedebut\",TAB_GLOBAL_COMPO[10],al_periodedebut,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"al_periodedebut\",TAB_GLOBAL_COMPO[10],al_periodedebut))\n \treturn -1;\n var al_periodefin=GetValAt(11);\n if (!ValiderChampsObligatoire(Table,\"al_periodefin\",TAB_GLOBAL_COMPO[11],al_periodefin,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"al_periodefin\",TAB_GLOBAL_COMPO[11],al_periodefin))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"al_sousilot=\"+al_sousilot+\",al_profil=\"+al_profil+\",al_periodedebut=\"+(al_periodedebut==\"\" ? \"null\" : \"'\"+ValiderChaine(al_periodedebut)+\"'\" )+\",al_periodefin=\"+(al_periodefin==\"\" ? \"null\" : \"'\"+ValiderChaine(al_periodefin)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "0b235206205e8baea88982bbb8ea683e", "score": "0.504495", "text": "function llenarTablaAscensorValoresAuditoriaAscensores(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_auditoria_ascensores.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var o_consecutivoinsp = item.o_consecutivoinsp;\n var o_estado_envio = item.o_estado_envio;\n var o_revision = item.o_revision;\n var v_item_nocumple = item.v_item_nocumple;\n var k_codcliente = item.k_codcliente;\n var k_codinforme = item.k_codinforme;\n var k_codusuario_modifica = item.k_codusuario_modifica;\n var o_actualizar_inspeccion = item.o_actualizar_inspeccion;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM auditoria_inspecciones_ascensores WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n //alert(\"agregar -> \"+resultSet.rows.length);\n addItemsAscensorValoresAuditoriaAscensores(k_codusuario,codigo_inspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion);\n }else{\n //alert(\"actualizar -> \"+resultSet.rows.length);\n /* Se actualizan la tabla de auditoria del servidor */\n actualizarTablaAuditoriaAscensorServidor(k_codusuario,k_codinspeccion);\n updateItemsAuditoriaInspeccionesAscensores(k_codusuario,codigo_inspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "7f8a08f9ec7e793582e782e6e1f3a206", "score": "0.5038684", "text": "function updateItemsEscalerasValoresElementos(k_codusuario,k_codinspeccion,k_coditem, o_descripcion,v_seleccion) {\n db.transaction(function (tx) {\n var query = \"UPDATE escaleras_valores_elementos SET o_descripcion = ?,\"+\n \"v_selecion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [o_descripcion,v_seleccion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsEscalerasValoresElementos: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos elementos...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "e325cf6ad4771b0934dc52b5787507fd", "score": "0.5036458", "text": "function agregarVal() {\n var dolares = $(\"#cambio\").val();//TIPO DE CAMBIO DOLAR\n\n var percentageDescount = $(\"#descuentoPago\").val();//OBTENGO EL % DE DESCUENTO\n var descuento = percentageDescount != \"\" ? parseFloat(percentageDescount.split(\"%\")[0] / 100).toFixed(2) : 0;//DESCUENTO EN DECIMALES\n\n var subtotal = parseFloat($(\"#subDol\").html().split(\"$ \")[1]).toFixed(2);//OBTENGO EL SUBTOTAL DEL PAGO\n var iva = parseFloat($(\"#ivaDol\").html().split(\"$ \")[1]).toFixed(2);//OBTENGO EL PORCENTAJE DE IVA\n\n var descDol = ((parseFloat(subtotal) + parseFloat(iva)) * parseFloat(descuento)).toFixed(2);//CALCULO EL DESCUENTO EN DOLARES\n var propina = $(\"#propinaPago\").val();//OBTENGO LA PROPINA\n\n //SI HAY DESCUENTO\n if (descuento != \"\") {\n $(\"#descDol\").html(\"$ \" + descDol);//PONGO EL DESCUENTO\n $(\"#txtDesc\").html(\"Descuento (\" + percentageDescount + \"):\");//PONGO EL PORCENTAJE A DESCONTAR\n $(\"#txtDesc\").attr(\"val\", percentageDescount.split(\"%\")[0]);//EL PORCENTAJE A DESCONTAR\n } else {//SI NO HAY DESCUENTO PONER 0 (VACIO)\n $(\"#descDol\").html(\"$ 0\");\n $(\"#txtDesc\").html(\"Descuento:\");\n descuento = 0;\n }\n\n var propinaDol = 0;\n var propinaSelected = $(\"#monedaPropina\").find(\"option:selected\").text();\n\n if (propina != \"\") {\n //DOLARES\n if (propinaSelected.toUpperCase() === \"DÓLARES\") {\n $(\"#propDol\").html(\"$ \" + parseFloat(propina).toFixed(2));\n $(\"#propina\").attr(\"name\", \"propDol\");\n //CONVERTIR PROPINA EN CORDOBAS\n propinaDol = parseFloat(propina).toFixed(2);\n var convCord = (propina * dolares).toFixed(2);\n $(\"#propCord\").html(\"C$ \" + parseFloat(convCord).toFixed(2));\n } else {//CORDOBAS\n $(\"#propCord\").html(\"C$ \" + parseFloat(propina).toFixed(2));\n $(\"#propCord\").attr(\"name\", \"propCord\");\n //CONVERTIR PROPINA EN DOLARES\n propinaDol = dolares * propina;\n var convDol = (propina / dolares).toFixed(2);\n $(\"#propDol\").html(\"$ \" + parseFloat(convDol).toFixed(2));\n }\n } else {\n $(\"#propDol\").html(\"$ 0\");\n $(\"#propCord\").html(\"C$ 0\");\n\n propina = 0;\n }\n\n var desc = parseFloat(descDol);\n //var prop = parseFloat(propinaDol);\n\n //var total = ((subtotal + iva) - desc) + prop;\n\n convertirDesc(desc);\n calcularPagos();\n\n //LIMPIAR VALORES\n $(\"#descuentoPago\").val(\"\");\n $(\"#propinaPago\").val(\"\");\n}", "title": "" }, { "docid": "eacfe0cdde8cd5ceab4b5142cd1c7259", "score": "0.5036285", "text": "function llenarTablaAscensorValoresPreliminar(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_ascensor_valores_preliminar.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codusuario = item.k_codusuario;\n var k_codinspeccion = item.k_codinspeccion;\n var k_coditem_preli = item.k_coditem_preli;\n var v_calificacion = item.v_calificacion;\n var o_observacion = item.o_observacion;\n\n var codigo_inspeccion = k_codinspeccion;\n if (codigo_inspeccion < 10) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n if (codigo_inspeccion < 100) {\n codigo_inspeccion = \"0\" + codigo_inspeccion;\n }\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM ascensor_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,codigo_inspeccion], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsAscensorValoresPreliminar(k_codusuario,codigo_inspeccion,k_coditem_preli,v_calificacion,o_observacion);\n }else{\n updateItemsAscensorValoresPreliminar(k_codusuario,codigo_inspeccion,k_coditem_preli,v_calificacion,o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "1b3ce6821aa62d0669cbed951a88ca9c", "score": "0.5035573", "text": "function NroFilaM(matriz1){\n var fila = obtener_valor( 'fil'+matriz1 );\n asignar_valorM( matriz1 , fila , fila, 1);\n return true;\n}", "title": "" }, { "docid": "df5f71a2a6214cb2fa8b24082cfc7e68", "score": "0.50327575", "text": "function updateFoto(soma){\n var db = banco();\n db.transaction(function(tx){\n tx.executeSql('UPDATE TB_FOTOS SET idVisita = ? WHERE idVisita = \"0\"',[soma]);\n //myApp.alert('foi'+soma);\n });\n}", "title": "" }, { "docid": "61cf8bc333b60d7d0aaa354d896c22ba", "score": "0.5030655", "text": "function llenarTabla()\n{\n\tvar nombre = $(\"#nombre\").val();\n\t$('<tr><td><div class=\"border_top\"></div><span class=\"white-text\">-</span></td><td><div class=\"border_top\"></div><span class=\"white-text\">-</span><b>'+nombre+'</b></td><td><div class=\"border_top\"></div><span class=\"white-text\">-</span></td><td><div class=\"border_top\"></div><span class=\"white-text\">-</span></td><td><div class=\"border_top\"></div><span class=\"white-text\">-</span></td><td><div class=\"border_top\"></div><span class=\"white-text\">-</span></td></tr>').insertBefore('#poner_antes');\n\n\tvar acum_precios = 0;\n\n\t$(\"#table_body\").children().each(function() {\n\t\tvar key = $(this).attr(\"name\");\n\t\tllenarFila(key);\n\n\t\tvar precio_insumo = regresarFloat($(\"#modal_cantidad_\"+key).val()) * regresarFloat($(\"#modal_precio_venta_\"+key).val());\n\n\t\tacum_precios = acum_precios + precio_insumo;\n\t});\n\n\t$('<tr id=\"precio_'+cont_pu+'\"><td></td><td></td><td></td><td></td><td></td><td class=\"decimal\"><b>'+$.number(acum_precios, 2)+'</b></td></tr>').insertBefore('#poner_antes');\n\n\t$('<input type=\"hidden\" name=\"data[PU]['+cont_pu+'][nombre]\" value=\"'+nombre+'\">').insertBefore('#poner_antes');\n\n\tactualizarCostoDirecto(acum_precios);\n}", "title": "" }, { "docid": "fe10ac0a58d12b62daf9a43d37df09e8", "score": "0.5027835", "text": "function updateItemsEscalerasValoresProteccion(k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE escaleras_valores_proteccion SET v_sele_inspector = ?,\"+\n \"v_sele_empresa = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [v_sele_inspector,v_sele_empresa,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected updateItemsEscalerasValoresProteccion: \" + res.rowsAffected);\n $('#texto_carga').text(\"Actualizando datos de protección...Espere\");\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "0438fc7aec0767b3cf06d012107d995f", "score": "0.502115", "text": "function atualizarTodasVar(){\n\tfor (var i = 0; i < arrayObjetoTabela.length; i++) {\n\t\tvar objeto = arrayObjetoTabela[i];\n\t\tvar input = document.getElementById(objeto.idinput);\n\t\tif (input !== null) {\n\t\t\tinput.value = s[objeto.posValor];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "46a035d29ded8034b3f2426f2157d025", "score": "0.5017668", "text": "function autov()\n{\n matrix= savematriz(1,matrizTranformacao);\n var values=numeric.eig(matrix._data);\n \n //console.log(values);\n var resu=\"\";\n for( var i=0;i<3;i++)\n {\n resu +=(\"O autovalor : \"+ math.round( values.lambda.x[i],2) +\"\\nPossui o autovetor : [\"+ math.round(values.E.x[0][i],2)+\",\"+ math.round(values.E.x[1][i],2)+\",\"+ math.round(values.E.x[2][i],2)+\"] \\n\");\n }\n alert(resu);\n}", "title": "" }, { "docid": "f8767e8f5564caa68c2d70487d34eb52", "score": "0.5017185", "text": "function guardar_insumo() {\n var tipo_insumo = document.getElementById(\"tipo_insumo\").value;\n var fecha = document.getElementById(\"ins_fecha\").value;\n var detalle = document.getElementById(\"ins_detalle\").value;\n var objetivo = document.getElementById(\"ins_objetivo\").value;\n var duracion = document.getElementById(\"ins_duracion\").value;\n var fecha_inicio = document.getElementById(\"ins_fecha_inicio\").value;\n var fecha_conclusion = document.getElementById(\"ins_fecha_conclusion\").value;\n var productos = document.getElementById(\"ins_productos\").value;\n var evaluador = document.getElementById(\"ins_evaluador\").value;\n var cargo = document.getElementById(\"ins_cargo\").value;\n var actividades = document.getElementById(\"ins_actividades\").value;\n var perfil = document.getElementById(\"ins_perfil\").value;\n var car_id = document.getElementById(\"ins_car_id\").value;\n var unidad_medida = document.getElementById(\"ins_unidad_medida\").value;\n var cantidad = document.getElementById(\"ins_cantidad\").value;\n var costo_unitario = document.getElementById(\"ins_costo_unitario\").value;\n var ins_costo_total = document.getElementById(\"ins_costo_total\").value;\n var partidas = document.getElementById(\"ins_par_hijos\").value;\n var ins_monto_f = document.getElementById(\"ins_monto_f\").value;\n var ins_ff_of = document.getElementById(\"ins_ff_of\").value;// ffofet_id asignado\n var ins_et = document.getElementById(\"ins_et\").value;\n //==========================================================\n var mes1 = parseFloat(document.getElementById(\"mes1\").value);\n var mes2 = parseFloat(document.getElementById(\"mes2\").value);\n var mes3 = parseFloat(document.getElementById(\"mes3\").value);\n var mes4 = parseFloat(document.getElementById(\"mes4\").value);\n var mes5 = parseFloat(document.getElementById(\"mes5\").value);\n var mes6 = parseFloat(document.getElementById(\"mes6\").value);\n var mes7 = parseFloat(document.getElementById(\"mes7\").value);\n var mes8 = parseFloat(document.getElementById(\"mes8\").value);\n var mes9 = parseFloat(document.getElementById(\"mes9\").value);\n var mes10 = parseFloat(document.getElementById(\"mes10\").value);\n var mes11 = parseFloat(document.getElementById(\"mes11\").value);\n var mes12 = parseFloat(document.getElementById(\"mes12\").value);\n //============= GUARDAR Y RETORNA EL ID DEL INSUMO ===============\n var url = site_url + '/insumos/programacion_insumos/add_ins';\n $.ajax({\n type: \"post\",\n url: url,\n //dataType: 'json',\n data: {\n act_id: act_id,\n tipo_insumo: tipo_insumo,\n fecha: fecha,\n detalle: detalle,\n objetivo: objetivo,\n duracion: duracion,\n fecha_inicio: fecha_inicio,\n fecha_conclusion: fecha_conclusion,\n productos: productos,\n evaluador: evaluador,\n cargo: cargo,\n actividades: actividades,\n perfil: perfil,\n car_id: car_id,\n unidad_medida: unidad_medida,\n cantidad: cantidad,\n costo_unitario: costo_unitario,\n costo_total: ins_costo_total,\n partidas: partidas,\n ins_ff_of: ins_ff_of,\n ins_et: ins_et,\n ins_monto_f: ins_monto_f,\n mes1: mes1,\n mes2: mes2,\n mes3: mes3,\n mes4: mes4,\n mes5: mes5,\n mes6: mes6,\n mes7: mes7,\n mes8: mes8,\n mes9: mes9,\n mes10: mes10,\n mes11: mes11,\n mes12: mes12\n },\n success: function (data) {\n var id = data.trim() + '';\n var str = id;\n var n1 = str.indexOf(\"(\");\n id = (str.substr(n1+1)).trim();\n //id = (str.replace(\")\", \" \")).trim();\n document.getElementById(\"insumo_id\").value = id;\n }\n });\n\n}", "title": "" }, { "docid": "b80292c0538956a70119b6954573e6bb", "score": "0.5017093", "text": "function saveValues () {\n ff1 = f1; ff2 = f2; ff3 = f3; // Kraftbeträge\n xxL = xL; yyL = yL; xxR = xR; yyR = yR; // Positionen der Rollen\n }", "title": "" }, { "docid": "fd77459941acf0ce3ead51dfa0c1de16", "score": "0.5012402", "text": "function montaValorMes () {\n\t\t// laco de despesas\n\t\tfor (var x in $scope.despesas) {\n\t\t\t// separo a despesa\n\t\t\tvar despesa = $scope.despesas[x];\n\t\t\t// crio um atributo pres(array) na despesa\n\t\t\tdespesa.pres = [];\n\n\t\t\t// laco de meses até 8\n\t\t\t// for (var m=0; m<8; m++) {\n\t\t\tfor (var m=0; m<$scope.tlmeses; m++) {\n\t\t\t\tvar day = moment().add(m, \"M\").date(); // dia atual + 1\n\t\t\t\tvar month = moment().add(m, \"M\").month(); // mes atual + 1\n\t\t\t\tvar year = moment().add(m, \"M\").year(); // ano atual + 1\n\t\t\t\tvar data = ''; // variavel data\n\n\t\t\t\t// laco de prestacoes da despesa\n\t\t\t\tfor (var p=0; p<despesa.prestacoes; p++) {\n\t\t\t\t\tvar dia = moment(despesa.datavencimento).add(p, \"M\").date(); // dia da data despesa + index\n\t\t\t\t\tvar mes = moment(despesa.datavencimento).add(p, \"M\").month(); // mes data despesa + index\n\t\t\t\t\tvar ano = moment(despesa.datavencimento).add(p, \"M\").year(); // ano data despesa + index\n\t\t\t\t\t\n\t\t\t\t\t// caso o mes e ano da despesa seja = ao mes e ano atual \n\t\t\t\t\tif (mes === month && ano === year) {\n\t\t\t\t\t\tdata = {\"data\": mes+\"/\"+ano, \"valor\":despesa.valor};\n\t\t\t\t\t\t// pegando a prestação atual\n\t\t\t\t\t\tif (m === 0) { // m = o ( mes atual )\n\t\t\t\t\t\t\tdespesa.prestacao = (p+1)+\"/\"+despesa.prestacoes;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!despesa.prestacao) {\n\t\t\t\t\t// se ano = atual mas mes menor ou ano menor\n\t\t\t\t\tif ( (ano === year && mes < month) || (ano < year) ) {\n\t\t\t\t\t\tdespesa.prestacao = despesa.prestacoes+\"/\"+despesa.prestacoes;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdespesa.prestacao = \"0/\"+despesa.prestacoes;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( data === '' ) {\n\t\t\t\t\tdespesa.pres.push({\"data\": \"00/0000\", \"valor\":\"xxxx\", \"color\":\"background:#f0f5f5; color:#ccc;\", \"icon\":\"fa-trophyx\"});\n\t\t\t\t}else{\n\t\t\t\t\tdespesa.pres.push(data);\n\t\t\t\t\t$scope.totais[m].valor = $scope.totais[m].valor + parseInt(despesa.valor);\n\t\t\t\t\t\n\t\t\t\t\tif($scope.totais[m-1] != undefined && $scope.totais[m].valor < $scope.totais[m-1].valor) {\n\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-down\";\n\t\t\t\t\t}else if($scope.totais[m-1] != undefined && $scope.totais[m].valor > $scope.totais[m-1].valor) {\n\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-up\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-right\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$scope.totalgeral = $scope.totalgeral + parseFloat(despesa.valor);\n\t\t}\n\t}", "title": "" }, { "docid": "fd63c2448640c3b5210c540d007d8d50", "score": "0.5010163", "text": "function calcular_calorias() {\n \n /*GUARDAMOS LAS VARIABLES INTRODUCIDAS POR EL USUARIO*/\n\n //NOMBRE COMPLETO\n var nombreCompleto = document.getElementById(\"nombre\").value;\n //EDAD\n var edad = document.getElementById(\"edad\").value;\n //PESO(kgs)\n var peso = document.getElementById(\"peso\").value;\n //ALTURA (cm) \n var altura = document.getElementById(\"altura\").value;\n //GENERO\n var genero = document.getElementById(\"sexo\").value;\n //NIVEL DE ACTIVIDAD FÍSICA\n var nivel_actividad_fisica = document.getElementById(\"actividad_fisica\").value;\n \n \n\n\n //COMPROBAMOS CON EL CONDICIONAL SI ES HOMBRE O MUJER, PARA SABER QUE FORMULA APLICAREMOS\n if (genero == \"hombre\") {\n \n \n \n //HOMBRES -->66,473+(13,751 X PESO )+(5,0033 X ALTURA ) - (6,7550 X EDAD)\n //GUARDAMOS EL RESULTADO EN UNA VARIABLE\n var resultado = 66.473 + (13.751 * peso) + (5.033 * altura) - (6.7550 * edad);\n\n\n //ABRIMOS UNA ESTRUCTURA SWITCH PARA SABER EL NIVEL DE ACTIVIDAD FISICA\n switch (nivel_actividad_fisica) {\n case \"no_activo\":\n resultado=resultado;\n break;\n\n case \"algo_activo\":\n resultado= resultado*1.3;\n break;\n\n case \"activo\":\n resultado=resultado*1.4;\n break;\n\n case \"muy_activo\":\n resultado=resultado*1.55;\n break;\n\n default:\n alert(\"LO SENTIMOS, HA OCURRIDO UN ERROR AL RELLENAR EL CUESTIONARIO\");\n break;\n }//FIN SWITCH\n\n var calorias_bajar_peso = parseInt(resultado) - 500;\n var calorias_mantener_peso = parseInt(resultado);\n var calorias_subir_peso = parseInt(resultado + 500);\n\n\n //CAMBIAMOS LOS VALORES YA QUE HEMOS APLICADO LA FORMULA\n document.getElementById(\"datos_bajar_peso\").innerHTML = \"<p id='datos_bajar_peso'><strong>\" + parseInt(calorias_bajar_peso) + \"-\"+parseInt(calorias_bajar_peso + 500)+ \"</strong> KCAL APROX</p>\";\n\n document.getElementById(\"datos_mantener_peso\").innerHTML = \"<strong>\" + parseInt(calorias_mantener_peso) + \"-\" + parseInt(calorias_mantener_peso + 500) + \"</strong> KCAL APROX\";\n document.getElementById(\"datos_subir_peso\").innerHTML = \"<strong> \" + parseInt(calorias_subir_peso) + \"-\" + parseInt(calorias_subir_peso + 500) + \"</strong> KCAL APROX\";\n \n }//FIN IF\n \n else {\n \n alert(\" ERES UNA MUJER\");\n //MUJERES --> 655,1+(9,463 X PESO)+(1,8 X ALTURA)-(4,6756 X ESTATURA)\n \n //GUARDAMOS EL RESULTADO EN UNA VARIABLE\n var resultado = 655.1 + (9.463 * peso) + (1.8 * altura) - (4.6756 * altura);\n \n //ABRIMOS UNA ESTRUCTURA SWITCH PARA SABER EL NIVEL DE ACTIVIDAD FISICA\n switch (nivel_actividad_fisica) {\n case \"no_activo\":\n resultado=resultado;\n break;\n\n case \"algo_activo\":\n resultado= resultado*1.25;\n break;\n\n case \"activo\":\n resultado=resultado+1.35;\n break;\n\n case \"muy_activo\":\n resultado=resultado*1.5;\n break;\n\n default:\n alert(\"LO SENTIMOS, HA OCURRIDO UN ERROR\");\n break;\n }//FIN SWITCH\n \n var calorias_bajar_peso = parseInt(resultado) - 100;\n var calorias_mantener_peso = parseInt(resultado);\n var calorias_subir_peso = parseInt(resultado + 500);\n \n //CAMBIAMOS LOS VALORES YA QUE HEMOS APLICADO LA FORMULA\n document.getElementById(\"datos_bajar_peso\").innerHTML = \"<p id='datos_bajar_peso'><strong>\" + parseInt(calorias_bajar_peso) + \"-\"+parseInt(calorias_bajar_peso + 250)+ \"</strong> KCAL APROX</p>\";\n\n document.getElementById(\"datos_mantener_peso\").innerHTML = \"<strong>\" + parseInt(calorias_mantener_peso) + \"-\" + parseInt(calorias_mantener_peso + 500) + \"</strong> KCAL APROX\";\n document.getElementById(\"datos_subir_peso\").innerHTML = \"<strong> \" + parseInt(calorias_subir_peso) + \"-\" + parseInt(calorias_subir_peso + 500) + \"</strong> KCAL APROX\";\n \n }//FIN ELSE\n\n} //FIN FUNCION GESTION DE CALORIAS", "title": "" }, { "docid": "6b716d7372494448f9750f98b99842a2", "score": "0.5009712", "text": "function onChangeMarca(){\n if(get('formulario.hMarcaSel')!=\"\" && get('formulario.hMarcaSel')!=get('formulario.cbMarca')) {\n if(GestionarMensaje('1572')) {\n set('formulario.hMarcaSel', [get('formulario.cbMarca')]);\n \n set('formulario.hPeriodoEvaluacionDesde', '');\n set('formulario.hPeriodoEvaluacionHasta', '');\n set('formulario.hPeriodoCalificacion', '');\n set('formulario.hPeriodoPremiacion', ''); \n \n cargarPeriodos(\"S\");\n } else {\n set('formulario.cbMarca', [get('formulario.hMarcaSel')]);\n }\n } else {\n set('formulario.hMarcaSel', [get('formulario.cbMarca')]);\n cargarPeriodos(\"N\");\n }\n}", "title": "" }, { "docid": "9ebd6770496401260160c8714d17c95b", "score": "0.50029355", "text": "function alliberaFitxaJugador(fila, columna) {\n if(tauler[fila][columna] == 'X') {\n saveState(0, fila, columna)\n } \n}", "title": "" }, { "docid": "02c1f90aa3e49058c1fd3d45159fb9a1", "score": "0.50026304", "text": "function actualizarVentanaMesero(){\n\tswitch(navegarMesero){\n\t\tcase 1: //Se en cuentra en la ventana 1\n\t\t\tnavegar(1);\n\t\tbreak;\n\t\tcase 3:\n\t\t\tnavegar(3);\n\t\tbreak;\n\t}\n}", "title": "" } ]
b2f42c1329ebdd4b28abdde45c415c77
A method should always return a promise
[ { "docid": "a27412746f5342f4fb38b0ce3e018dbe", "score": "0.0", "text": "call(verb,endpoint, params , config) {\n\n\t\tlet apiRoot = Settings.get('API',API_BASE_URL);\n\t\tlet url = `${apiRoot}${endpoint}`; \n\n\n\t\tlet caller;\n\t\tif (verb == GET) caller = this.get;\n\t\tif (verb == POST) caller = this.post;\n\t\tif (verb == PUT ) caller = this.put;\n\t\tif (verb == DELETE ) caller = this.delete;\n\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tcaller(url, params, config).then((response) => {\n\t\t\t\tresolve(response.data);\n\t\t\t}).catch((err) => {\n\t\t\t\t//console.log('Error when trying to get backend data')\n\t\t\t\treject(err);\n\t\t\t})\n\t\t})\n\t}", "title": "" } ]
[ { "docid": "79c29d67bc2ef8e4a9f51c2b3fccda0d", "score": "0.7182248", "text": "async method(){}", "title": "" }, { "docid": "e6a8b7a5fc43cdd2f01ee892de29a2e7", "score": "0.70980716", "text": "static async method(){}", "title": "" }, { "docid": "e5379f0ae10fb102dc3e56a7e8a0a4d6", "score": "0.67288035", "text": "function Promise() {}", "title": "" }, { "docid": "a3969fd1ed008436b8b75ce656156297", "score": "0.6437479", "text": "function doAsync() {\r\n // return a promise which resolve or reject the request\r\n \r\n}", "title": "" }, { "docid": "a2601dbb9eb330a45417d6b26377f592", "score": "0.6321575", "text": "function httpPromise(url, method) {\n let promise = new Promise((resolve, reject) => {\n setTimeout(function () {\n let data = 'the answer';\n if (data) {\n resolve(data);\n }\n else {\n reject('No data');\n }\n }, 1000);\n });\n return promise;\n}", "title": "" }, { "docid": "e2d862551ae1d388e6d0eaba99223619", "score": "0.6212074", "text": "function Rn(){this.promise=new Promise((function(e){e()}))}", "title": "" }, { "docid": "6c96b90965b5c8e32c016a5877e19302", "score": "0.6197312", "text": "function challengwalking1(){\n return new Promise(function(resolve,reject) {\n resolve(true)\n })\n }", "title": "" }, { "docid": "10bc6fb37c41a39bc37fddf8be4e14dc", "score": "0.6131226", "text": "function myPromiseFunction() {\n return new Promise(resolve => resolve(\"promise is resolving\"))\n}", "title": "" }, { "docid": "728e7b1e00c95cdd4d81ff7d174ba300", "score": "0.6111615", "text": "function promiseFx() {\r\n return Promise.resolve(\"Promise Resolved\")\r\n}", "title": "" }, { "docid": "0b870cf34598c31abf236660c1fb9f65", "score": "0.6093018", "text": "async function get(){\n \n}", "title": "" }, { "docid": "12ba245b6772b53a7363bfa94638d15d", "score": "0.60760593", "text": "_run(method, data, params) {\n return new Promise((resolve, reject) => {\n const query = this._getQuery(method, data, params);\n if (query.error) reject(query.error);\n\n this._execute(this.endpoint, method, query)\n .then(resolve)\n .catch(reject);\n });\n }", "title": "" }, { "docid": "cab45cb98a966f457ec7bc78b750b6f8", "score": "0.60585505", "text": "function foo(cb) {\n if (cb) {\n return cb();\n }\n return new Promise(function (resolve, reject) {\n\n });\n}", "title": "" }, { "docid": "122c831385e1a7aa1b723fd47c708b3f", "score": "0.6045195", "text": "async function callPromise(methodName, ...args) {\n return new Promise((resolve, reject) => {\n Meteor.apply(methodName, args, {}, (error, result) => {\n if (error) {\n return reject(error);\n }\n return resolve(result);\n });\n });\n}", "title": "" }, { "docid": "8be0604143905db5e3892d34d811ad5f", "score": "0.6032442", "text": "function getPromise(){\n var promise = Album.find({}).exec();\n return promise;\n}", "title": "" }, { "docid": "be7c6b6760aa8af8c03485ee0541c37e", "score": "0.60187465", "text": "function name2() {\n return Promise.resolve(1)\n}", "title": "" }, { "docid": "a166d97a8b41f915b2f90210edcccf74", "score": "0.601772", "text": "getUser() {\n return Promise.resolve({ id: '1', name: 'Banuprakash' });\n }", "title": "" }, { "docid": "0fbe9606a71a545d265d78f091dab5f7", "score": "0.60171294", "text": "function handlePromise (fn) {\n return new Promise((resolve, reject) => {\n var promise, isPromise;\n if (isPromise = (promise = fn((data) => isPromise ? noop() : resolve(data), (err) => isPromise ? noop() : reject(err))) instanceof Promise) resolve(promise);\n });\n}", "title": "" }, { "docid": "d461183fc53fac6e17547f1c21a157dd", "score": "0.6010505", "text": "function i(t){try{return Promise.resolve(t())}catch(t){return Promise.reject(t)}}", "title": "" }, { "docid": "539aaedcd7f3dc7664108b26949072be", "score": "0.6005908", "text": "function i(t){try{return Promise.resolve(t())}catch(e){return Promise.reject(e)}}", "title": "" }, { "docid": "12c58047130dd2d52fa321846b9a3a58", "score": "0.5949322", "text": "function getUserFromAuthToken(authToken)\n{\n var promise = database.User.findById(1); // we will return the method \n return promise; \n \n}", "title": "" }, { "docid": "c65f3ecfb24e81170d1c8e13384b48e9", "score": "0.5946657", "text": "function stub() {\n return Promise.resolve( 'NOT_IMPLEMENTED' );\n}", "title": "" }, { "docid": "78e1efb6c335c0745b22479eb268659e", "score": "0.5945101", "text": "function deferred() {\n let methods;\n const promise = new Promise((resolve, reject) => {\n methods = { resolve, reject };\n });\n return Object.assign(promise, methods);\n }", "title": "" }, { "docid": "9eb77c65d63cedcd181dc4754035a95f", "score": "0.5938545", "text": "Promise() {\n\t\treturn new Promise(resolve => this.onRelease(resolve));\n\t}", "title": "" }, { "docid": "2bb88401e3c30756583c566c4381073f", "score": "0.59300846", "text": "static /* 2.2 L meth */ async /* 2.3 L meth */ * /* 2.4 L id */ method(){}", "title": "" }, { "docid": "8a685c195455abc0315be54c3a3f79bf", "score": "0.592884", "text": "async function myFunction() {\n return Promise.resolve(\"Hello\");\n}", "title": "" }, { "docid": "f6be9e87df65d6200f988de853fbcaeb", "score": "0.59158397", "text": "async return(method, args = [], opts = {}) {\n const result = await this.call(method, args, opts);\n return result.outputs[0];\n }", "title": "" }, { "docid": "0a4ab1ede8dcee2d7815edb9b6be07f0", "score": "0.5914664", "text": "get() {\n return this._promise;\n }", "title": "" }, { "docid": "a442f43c2aa696e59b62216bbc0e5367", "score": "0.59127766", "text": "promise() {\n return this._fetch;\n }", "title": "" }, { "docid": "a3ec877ec2715a33bab3ac2418ddf704", "score": "0.5905376", "text": "getFlatData() { return Promise.resolve(\"not implemented or not needed\"); }", "title": "" }, { "docid": "07b836275c99367af4103dbde983b0ab", "score": "0.5895765", "text": "function hello() {\n return new Promise(function(resolve, reject) {\n // executor function body\n });\n}", "title": "" }, { "docid": "184042277d6cdaa5fb8a17a352f5ddd9", "score": "0.588577", "text": "get() {\n return this._promise;\n }", "title": "" }, { "docid": "2f889f11fd40f15349a4a0281b938d53", "score": "0.5885671", "text": "getAggregataData() { return Promise.resolve(\"not implemented or not needed\"); }", "title": "" }, { "docid": "c1587922b88b2473c784d65a365fa3d6", "score": "0.5869073", "text": "function _returnResolvedPromise() {\n var dfd = $.Deferred();\n dfd.resolve();\n return dfd.promise();\n }", "title": "" }, { "docid": "6bee9385104a3109f742a3a3110c4873", "score": "0.5866908", "text": "returnPromise4() {\n return pk4.promise;\n }", "title": "" }, { "docid": "0470cec547ec8f5fdead8576bca8d5a3", "score": "0.5864757", "text": "stubPromiseFunction(_thisObj, _functionName, _args) {\n return OneSignalStubES5.newPromiseIfDefined((_resolve, _reject) => { });\n }", "title": "" }, { "docid": "dad5e02822f08a03947628ccccd01bd9", "score": "0.58642226", "text": "toPromise() {\n return this.queuePromise\n }", "title": "" }, { "docid": "a4af72b15685a63563d8e4f4d4a91650", "score": "0.5855434", "text": "reserve() {\n return Promise.resolve({ error_type: this.error_, success: this.success_ });\n }", "title": "" }, { "docid": "2610669302ffb424f09c4c2b298fdffc", "score": "0.5844284", "text": "function promiseFunct(data) {\n return new Promise((resolve, reject) => {\n if (data) resolve(data)\n else reject(new Error('no data'))\n })\n}", "title": "" }, { "docid": "dbd4a3af82a7fdb83d3553e61a667c33", "score": "0.5839752", "text": "Promise(path) {\r\n return cache[path].promise;\r\n }", "title": "" }, { "docid": "769a820a5eb178770def8c64d51cbb89", "score": "0.58321106", "text": "getFirstName(personId) { // eslint-disable-line\n Promise.resolve('Cory');\n }", "title": "" }, { "docid": "61d540e8fedb8de31f0853b26c34f5a3", "score": "0.58263713", "text": "async promise() {\n try {\n if (this.initErr) throw this.initErr;\n return await Promise.race([\n this.handleTimeout(),\n this.handleResource(),\n ]);\n } catch (err) {\n return await this.sendFailure({ reason: err, id: err && err.id });\n }\n }", "title": "" }, { "docid": "d527162477412a56d07cb7b24d6bcb81", "score": "0.5808502", "text": "static MakeQuerablePromise(promise) {\n // Don't modify any promise that has been already modified.\n if (promise.isResolved)\n return promise;\n // Set initial state\n var isPending = true;\n var isRejected = false;\n var isFulfilled = false;\n // Observe the promise, saving the fulfillment in a closure scope.\n var result = promise.then(function(v) {\n isFulfilled = true;\n isPending = false;\n return v;\n }, function(e) {\n // console.log(\"Failed\")\n isRejected = true;\n isPending = false;\n throw e;\n });\n result.isFulfilled = function() { return isFulfilled; };\n result.isPending = function() { return isPending; };\n result.isRejected = function() { return isRejected; };\n return result;\n }", "title": "" }, { "docid": "eddcba356e9ffc71a934bdc2ae531b3c", "score": "0.5781116", "text": "function q(e){return e&&\"function\"==typeof e.then}", "title": "" }, { "docid": "972b37c4ebcc60bd997ec600986c3c52", "score": "0.57694495", "text": "function resolvePromise() {\n return rejectPromise();\n}", "title": "" }, { "docid": "ef3735ccb716d186149fd96b87fd1062", "score": "0.575445", "text": "safeParse(methodName) {\n\t\tlet result = this[methodName]()\n\t\t// Ugly IE fix, async functions always return promises, but not when transpiled.\n\t\tif (result.catch !== undefined) result = result.catch(this.handleError)\n\t\treturn result\n\t}", "title": "" }, { "docid": "8cfc6ee4209ba937c948db7b824a7f52", "score": "0.5751287", "text": "function doSomethingElse() {\n myPromise.then(doSomething);\n}", "title": "" }, { "docid": "fa32da5262ba470de3a5eef89b3728e4", "score": "0.57397234", "text": "findListingById(id)\n { \n return new Promise((resolve, reject) => { \n listings.findListingById(id, (res, err) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(res);\n }\n }); \n });\n }", "title": "" }, { "docid": "beb7b76db8bfc4d47e9ef689139099c2", "score": "0.5733364", "text": "async function promiseSpace(spaceId){\n return kintone.api(kintone.api.url('/k/v1/space', true), 'GET', {\"id\": spaceId}, function(resp){\n console.log(resp);\n return resp;\n }).then(async function(){\n console.log(\"then what?\");\n }).catch(function(error){\n console.log(error);\n })\n }", "title": "" }, { "docid": "03f5d06238d7aded5983c8b86d803e4d", "score": "0.57180256", "text": "async function samplePromise(){\n return kintone.api('/k/v1/records', 'GET', {app: 117}).then(async function(resp) {\n console.log(resp);\n return resp;\n }).then(async function(){\n let result = await getSpace(12);\n console.log(result);\n return result;\n }).catch(function(error) {\n var errmsg = 'There was an error when retrieving the data'; \n //If an error is included in the response message, show it\n if (error.message !== undefined){\n errmsg += '\\n' + error.message;\n }\n alert(errmsg);\n });\n }", "title": "" }, { "docid": "75c06088c1d6e9407e868a0ce1b770c9", "score": "0.57088655", "text": "function inheritPromiseMethod(parent, child, method, ...args) {\n if(parent[method]) {\n return Promise.resolve(parent[method](...args))\n .catch(error => {if(error) console.error(error)})\n .then(child[method](...args))\n }\n return child[method](...args)\n}", "title": "" }, { "docid": "3269fdb4295ef1800879fe0bbe096aec", "score": "0.57038844", "text": "load() {\n return this.loadPromise();\n }", "title": "" }, { "docid": "0135e9c4677c0c3efed859a1abbe3f33", "score": "0.5699582", "text": "load() {\n return new Promise(this._load.bind(this));\n }", "title": "" }, { "docid": "82b48aa0c8e3d8f77e9cae4df1bfa36b", "score": "0.56776196", "text": "async function promise() {\n doStuffProm();\n }", "title": "" }, { "docid": "3bde104bd81ada0f40fa115b7720396b", "score": "0.5677524", "text": "function makePizza1() {\n const pizzaPromise = new Promise() // new data type, surprise!\n return pizzaPromise; // I return the promise inmediatly but I am still not resolving it\n // I just created the promise of making a pizza but still don't know\n // how long it's gonna take and if something will come back or not\n // the idea of this being returned inmediatly (the promise) but the\n // resolve taking some time is the mos important thing\n}", "title": "" }, { "docid": "9cc49660e5c8deabaf4501e50d2c1171", "score": "0.567734", "text": "function getPromise(){\n var promise = Band.find({}).exec();\n return promise;\n}", "title": "" }, { "docid": "6ba1e8f4c5483b75e179963ac0d96c4c", "score": "0.56687653", "text": "toPromise() {\n return new Promise((resolve, reject) => {\n // NOTE: should also remove other event listener\n this.once('success', () => resolve(this));\n this.once('error', err => reject(err));\n });\n }", "title": "" }, { "docid": "28ad62e0438c8afff9e30ee973d7c4bb", "score": "0.566757", "text": "function fakePromise(retVal) {\n return {\n $promise: {\n then: function(callback) { \n callback(retVal); return this; \n },\n catch: function(){}\n }\n } \n }", "title": "" }, { "docid": "0f987da964588da19e73fd6e68dfba1d", "score": "0.5666636", "text": "async function callwithPromise(){\n const fullName = await call.withPromise('Isai', 'Reyes')\n console.log(fullName);\n }", "title": "" }, { "docid": "1a2c8f67bf4d4dcdb653d738170d7a22", "score": "0.5662944", "text": "then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }", "title": "" }, { "docid": "76bd744adbff9febfe6dd711682c7c41", "score": "0.56622916", "text": "function returnPromise(item) {\n return (typeof item === \"undefined\" ? \"undefined\" : _typeof(item)) == \"object\" && typeof item.then != \"undefined\" ? item : item === false ? new Promise(function (resolve, reject) {\n return reject(item);\n }) : new Promise(function (resolve) {\n return resolve(item);\n });\n}", "title": "" }, { "docid": "2693bcca5c32e90986cb6452e7c4a648", "score": "0.5661593", "text": "findBookingsByUser(userId, status) {\n return new Promise((resolve, reject) => {\n //console.log(\"SERVICE err: \" + err); \n Booking.findBookingByUserId(userId, status, (err, res) => {\n //console.log(\"SERVICE err: \" + err);\n if (err) {\n reject(err);\n } else {\n resolve(res);\n }\n });\n });\n }", "title": "" }, { "docid": "daa70af5f85f03946c61ef8c583ca4e3", "score": "0.56592023", "text": "toPromise() {\n return () => new Promise((resolve) => {\n if (this.fetchComplete || this.inProgress) {\n if (this.inProgress) {\n this.postpone(resolve);\n } else {\n resolve(this.data);\n }\n } else {\n this.setInProgress(true);\n if (typeof this.beforeRequest === 'function') {\n this.beforeRequest();\n }\n this.fetchData()\n .then((response) => {\n this.setComplete(true);\n this.setData(response);\n resolve(this.data);\n this.fulfill(this.data);\n this.resetWaitList();\n this.setInProgress(false);\n if (typeof this.afterRequest === 'function') {\n this.afterRequest();\n }\n });\n }\n });\n }", "title": "" }, { "docid": "e4744f294f9b2eef3c9acf7111db4eed", "score": "0.56575304", "text": "function getSuger() {\n return new Promise((resolve, reject) => {\n resolve(\"suger\");\n });\n\n}", "title": "" }, { "docid": "4bb021557c18f9e48f8ffbce8a4575aa", "score": "0.56571454", "text": "function doAsync() {\r\n // return a promise which resolve or reject the request\r\n let p = new Promise(function(resolve, reject){\r\n\r\n console.log(`in promise code`);\r\n setTimeout(function(){\r\n console.log(\"Resolving ...\");\r\n resolve(\"successfully !!\");\r\n }, 2000);\r\n });\r\n return p;\r\n \r\n}", "title": "" }, { "docid": "a86774aa9cc0f51b3a887c1b47b58943", "score": "0.5654172", "text": "setup() {\n return Promise.resolve(this)\n }", "title": "" }, { "docid": "92e74092495f3a53fc5ae8f3350caf18", "score": "0.5653214", "text": "async function getSpaceHelper1(spaceId){\n var promiseSpace = new Promise(async function (resolve){\n getSpace(12);\n });\n await promiseSpace.then(async function(value){\n await resolve(getSpace(12));\n console.log(value);\n });\n }", "title": "" }, { "docid": "bf0647fdde9747a544bfc47e046033db", "score": "0.56474924", "text": "async invoke() {\n void this.poll.schedule({ interval: this.limit, phase: 'invoked' });\n return this.payload.promise;\n }", "title": "" }, { "docid": "b6ee44adff3f72896323b5f5993117e0", "score": "0.5642783", "text": "api(endPoint) {\n return new Promise((resolve, reject) => {\n axios.get(endPoint).then((response) => {\n resolve(response.data);\n }).catch((error) => {\n reject(error);\n }); \n }); \n }", "title": "" }, { "docid": "8dc54c0612d9d00bf3e6e352b976c9e4", "score": "0.5642715", "text": "function promised(method, query) {\n\t\treturn function() {\n\t\t\tvar deferred = new Deferred();\n\t\t\ttry {\n\t\t\t\tdeferred.resolve(this[method].apply(this, arguments));\n\t\t\t} catch (error) {\n\t\t\t\tdeferred.reject(error);\n\t\t\t}\n\t\t\tif (query) {\n\t\t\t\t// need to create a QueryResults and ensure the totalLength is\n\t\t\t\t// a promise.\n\t\t\t\tvar queryResults = new QueryResults(deferred.promise);\n\t\t\t\tqueryResults.totalLength = when(queryResults.totalLength);\n\t\t\t\treturn queryResults;\n\t\t\t}\n\t\t\treturn deferred.promise;\n\t\t};\n\t}", "title": "" }, { "docid": "b7bb0009d228cf2503a7f941d3f80b11", "score": "0.564167", "text": "findBookingsByDate(dateStart, dateEnd) {\n return new Promise((resolve, reject) => {\n //console.log(\"SERVICE err: \" + err); \n Booking.findBookingByDate(dateStart, dateEnd, (err, res) => {\n //console.log(\"SERVICE err: \" + err);\n if (err) {\n reject(err);\n } else {\n resolve(res);\n }\n });\n });\n }", "title": "" }, { "docid": "af591438e72d64d19fd00bf345623e16", "score": "0.5633117", "text": "function fakeDownload() {\n\treturn new Promise(function (resolve) {\n\t\tresolve();\n\t});\n}", "title": "" }, { "docid": "09d039af05fc42b2125554257b72930c", "score": "0.5632676", "text": "function getPromise(data) {\n return $.ajax(data);\n}", "title": "" }, { "docid": "418eabdecb7a1825a4933bc70c741401", "score": "0.56281674", "text": "loadData() {\n return new Promise(resolve => {\n return resolve();\n });\n }", "title": "" }, { "docid": "42c5789cbabbaab6d2404139241c414e", "score": "0.5621222", "text": "findUserById(id)\r\n { \r\n return new Promise((resolve, reject) => { \r\n users.findUserById(id, (res, err) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n else {\r\n resolve(res);\r\n }\r\n }); \r\n });\r\n }", "title": "" }, { "docid": "f6848e6d8b41974decb15bae4265dc8a", "score": "0.5618374", "text": "async function foo() {\n return 1\n}", "title": "" }, { "docid": "a1f2cc6906bed4b2995f37540f699cd6", "score": "0.56176853", "text": "function makePromiseCall(methodType,url,async=true,data=null)\n{\n // promise object will have two parameters resolve and reject\n //resolve if state is 4 status in 200 series\n //reject for 400 series\n return new Promise(function(resolve,reject){\n //creating instance of XMLHttpRequest() \n let xhr= new XMLHttpRequest();\n //here we are using the resolve method so the callingback of function is reduces\n xhr.onreadystatechange= function(){\n //checking if readdstate is 4 and httpstatus is 201 or 201 means succesfull\n //for succesful we go to resolve otherwise reject\n if(xhr.readyState===4)\n {\n if(xhr.status===200||xhr.status===201)\n {\n resolve(xhr.responseText);\n }\n //if status is greater than 400, there is error in calling request\n else if(xhr.status>=400)\n {\n reject({\n status:xhr.status,\n statusText:xhr.statusText\n });\n console.log(\"Xhr failed\");\n }\n }\n }\n xhr.open(methodType,url,async);\n //checking if data is present\n //we need to change the file before insering data \n if(data)\n {\n //setting header for request\n xhr.setRequestHeader(\"Content-Type\",\"application/json\");\n //sending data by converting into json string object\n xhr.send(JSON.stringify(data));\n }\n else\n {\n xhr.send();\n }\n console.log(methodType+\" Request sent to the server at: \"+showTime());\n });\n}", "title": "" }, { "docid": "73a631975f735875cd0476af7bb80617", "score": "0.56059927", "text": "async function qux() {\n return Promise.resolve(\"qux\");\n }", "title": "" }, { "docid": "b0c40bc2f84db7675d337691e148d230", "score": "0.5600088", "text": "function n(e){try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}}", "title": "" }, { "docid": "139ef975d7f97a1f970ff8474f96beb2", "score": "0.55975413", "text": "async function getNewAuthToken() {\n\n return new Promise(function(resolve, reject) {\n\n Meteor.call('yelp.getAuthToken', function(err, res) {\n if (err) {\n reject(err);\n } else {\n resolve(res);\n }\n });\n });\n}", "title": "" }, { "docid": "d94dab2a13c9aee6278da5b828ca623e", "score": "0.559593", "text": "async initialize() {\r\n return Promise.resolve();\r\n }", "title": "" }, { "docid": "951989a5f946a509cedb7ef317bb10ff", "score": "0.55907047", "text": "function makePromiseCall(methodType, url, async = true, data = null) {\r\n let xhr = new XMLHttpRequest();\r\n return new Promise(function (resolve, reject) {\r\n xhr.open(methodType, url, async);\r\n xhr.onreadystatechange = function () {\r\n // console.log(methodType + \" State Changed Called at \" + showTime() + \" .Ready State: \" +\r\n // xhr.readyState + \" Status:\" + xhr.status);\r\n\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 200 || xhr.status === 201) {\r\n resolve(xhr.responseText);\r\n } else if (xhr.status >= 400) {\r\n reject({\r\n status:xhr.status,\r\n statusText:xhr.statusText\r\n });\r\n console.log(\"XHR Failed\");\r\n console.log(\"Handle 400 client Error or 500 server error\");\r\n }\r\n\r\n }\r\n\r\n }\r\n if (data) {\r\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\n xhr.send(JSON.stringify(data));\r\n } else\r\n xhr.send();\r\n\r\n\r\n console.log(methodType + \" request sent to the server at \" + showTime());\r\n });\r\n}", "title": "" }, { "docid": "5cdef780bb9b9c64ecc00cd6516d3972", "score": "0.55898964", "text": "function fetchUserPromise() {\n // do network request in 10 secs...\n return new Promise((resolve, reject) => {\n resolve('ellie');\n });\n}", "title": "" }, { "docid": "4525a1ef024270ced8d939b895c7f352", "score": "0.5578984", "text": "checkLife(){\n return dispath => {\n return new Promise((resolve,reject) => {\n dispath({resolve, reject});\n });\n }\n }", "title": "" }, { "docid": "f2d8e927ac810eb86e90b05805d965a5", "score": "0.55781925", "text": "findUserByEmail(email)\r\n { \r\n return new Promise((resolve, reject) => { \r\n users.findUserByEmail(email, (res, err) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n else {\r\n resolve(res);\r\n }\r\n }); \r\n });\r\n }", "title": "" }, { "docid": "df57741c72c18c3ab57ec51880673a17", "score": "0.5575215", "text": "__postOpenImplementation() {\n\n\t \treturn Promise.resolve();\n\t }", "title": "" }, { "docid": "d31de425df4783ed62d677c0220b0771", "score": "0.55747116", "text": "executeRawRequest(route, method, body) {\n return new Promise((resolve, reject) => {\n process.nextTick(() => {\n resolve(\"TEST VALUE\");\n });\n });\n }", "title": "" }, { "docid": "4312d7e8a6ca2774c7286e51cd2bdb7b", "score": "0.55744815", "text": "function x() {\n var promise = new Promise(function(resolve, reject) {\n\n window.setTimeout(function () {\n resolve('done!');\n }, 0);\n });\n\n return promise;\n }", "title": "" }, { "docid": "e42d9e2a41ea4c28c7ad5e8efc2dcc79", "score": "0.5567256", "text": "readAll() {return Promise.resolve([]);}", "title": "" }, { "docid": "c5260170974ce81e6aada34eb391a750", "score": "0.5564467", "text": "getByLanguageAndKey(id_project, language, key) {\n var that = this;\n return new Promise(function (resolve, reject) {\n\n that.getAllByLanguageNoPivot(id_project,language).then(function(returnval) {\n winston.debug(\"getByLanguageAndKey returnval\",returnval);\n if (returnval) {\n var value = returnval.data[key];\n winston.debug(\"getByLanguageAndKey value: \"+value);\n return resolve(value); \n } else {\n winston.debug(\"getByLanguageAndKey return undefined\");\n return resolve();\n }\n });\n });\n}", "title": "" }, { "docid": "eff4752e4bd3199233a42cf97519f59c", "score": "0.55617774", "text": "findBookingsByListing(listingId, status) {\n return new Promise((resolve, reject) => {\n //console.log(\"SERVICE err: \" + err); \n Booking.findBookingByListingId(listingId, status, (err, res) => {\n //console.log(\"SERVICE err: \" + err);\n if (err) {\n reject(err);\n } else {\n resolve(res);\n }\n });\n });\n }", "title": "" }, { "docid": "9e4bca1b48bf31b1ba54b9a36eebd723", "score": "0.55589706", "text": "function i(){var e=this;this.promise=new a.default(function(t,n){e.resolve=t,e.reject=n})}", "title": "" }, { "docid": "bc5532b5c87e420e669ce0e4280607e8", "score": "0.5549452", "text": "getPromise(eventName) {\n const existing = this.promises.get(eventName);\n if (existing !== undefined) {\n return existing;\n }\n\n const created = new Promise((resolve, reject) => {\n const subscription = this.onDid(eventName, payload => {\n subscription.dispose();\n this.promises.delete(eventName);\n resolve(payload);\n });\n });\n this.promises.set(eventName, created);\n return created;\n }", "title": "" }, { "docid": "37bf09fcb8a510a57f0cadcb45ca2d08", "score": "0.5548903", "text": "function _getPromiseObject (method,url,contentType,data){\n\n return $http({\n method: method,\n url: url,\n headers: {'Content-Type': contentType},\n data: data\n });\n }", "title": "" }, { "docid": "55a29a5d0bac79b7cb7bb4227e550057", "score": "0.55463487", "text": "function makePizza2() {\n const pizzaPromise = new Promise(function (resolve, reject) {\n // the promise takes a callback function with 2 arguments, the 1st one is what happens if it resolves and the 2nd what happens if it fails so you can have those 2 options like\n // when you are ready, resolve it\n resolve(\"Pizza is ready!\")\n // if it fails, let me know\n })\n return pizzaPromise;\n}", "title": "" }, { "docid": "2fd399ab1c6c4ed61924ec56edf25616", "score": "0.5545066", "text": "_resolve() {\n deferred.resolve()\n }", "title": "" }, { "docid": "9f5413dd18637681b822bd977d08ea68", "score": "0.5531798", "text": "function r(e){return Promise.resolve({data:e,once:!0,direct:!0})}", "title": "" }, { "docid": "1c61c8b9ce11ebe18d3a86eeb9eedac5", "score": "0.5529902", "text": "function promise(func) {\n if (module.exports.Promise) {\n return new module.exports.Promise(func);\n }\n\n func(noop, noop);\n\n return null;\n }", "title": "" }, { "docid": "1c9a374e9d3226b5775327497a142a90", "score": "0.5527117", "text": "async function myFunc() {\n const result = await fakePromise();\n console.log('result');\n}", "title": "" }, { "docid": "fb3360a1d92267cb6bdfe3a13a0a2042", "score": "0.5524567", "text": "getSignedIn () {\n let self = this\n return new Promise((resolve, reject) => {\n mgr.getUser().then(function (user) {\n if (user == null) {\n // self.signIn()\n return resolve(false)\n } else {\n return resolve(true)\n }\n }).catch(function (err) {\n console.log(err)\n return reject(err)\n })\n })\n }", "title": "" }, { "docid": "bed235655f341e7149b571f052e8119b", "score": "0.5523441", "text": "adder(param) {\n return new Promise((resolve, reject) => {\n if (param === 0) {\n reject(\"param cannot be 0\");\n }\n\n resolve(param);\n });\n }", "title": "" }, { "docid": "b08e5036056f63c7cd71491c89344d84", "score": "0.55219173", "text": "getSignedIn () {\n let self = this\n return new Promise((resolve, reject) => {\n this.mgr.getUser().then(function (user) {\n if (user == null) {\n self.signIn()\n return resolve(false)\n } else{\n return resolve(true)\n }\n }).catch(function (err) {\n console.log(err)\n return reject(err)\n });\n })\n }", "title": "" } ]
99a0c6167e8824f77dbd76ae7ec3bcc4
function handler that get meetupData object from the child component NewMeetupForm and makes http request
[ { "docid": "1a2a973416c8db6acd82f45b9e6a7249", "score": "0.7042236", "text": "function handlerAddMeetup(meetupData) {\n // possible use the 3rd party libraries as e.g. axios instead of the 'fetch()'\n // URL: used FIREBASE real-time database created at https://firebase.google.com/\n // that provides free service to connect and work with the database\n // FIREBASE API: needs to add '.json' to the end of the url\n // URL: .../meetups.json - get collestion of meetups (all meetup records)\n fetch(\n 'https://react-meetup-demo-ef36e-default-rtdb.europe-west1.firebasedatabase.app/meetups.json',\n {\n // specify POST method becouse of storing data in DB\n method: 'POST',\n // specify JSON data object the data will be stored in DB for \n body: JSON.stringify(meetupData),\n // specify header's content type to application/json and make it \n // crystal clear that this request carries json data\n header: {\n 'Content-Type': 'application/json'\n }\n }\n );\n }", "title": "" } ]
[ { "docid": "19a99a0212ef3b3314aad5713b81419e", "score": "0.65059614", "text": "function createMeet(event) {\r\n event.preventDefault();\r\n\r\n var rooms_container = document.getElementById(\"rooms-container\");\r\n rooms_container.innerHTML = \"\";\r\n\r\n var meet_title = document.getElementById(\"meet-title\").value;\r\n var subject = document.getElementById(\"subject\").value;\r\n var avg_duration = document.getElementById(\"avg-duration\").value;\r\n var meet_data = document.getElementById(\"date\").value;\r\n var start_hour = document.getElementById(\"start-hour\").value;\r\n var end_hour = document.getElementById(\"end-hour\").value;\r\n var meet_address_type = document.getElementById(\"meet_address_type\").value;\r\n var meet_address = document.getElementById(\"address\").value;;\r\n\r\n if (meet_address_type == \"Онлайн\") {\r\n meet_address_type = 0;\r\n } else {\r\n meet_address_type = 1;\r\n }\r\n\r\n const meet = {\r\n meet_title,\r\n subject,\r\n avg_duration,\r\n meet_data,\r\n start_hour,\r\n end_hour,\r\n meet_address_type,\r\n meet_address\r\n };\r\n\r\n console.log(meet);\r\n \r\n const settings = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8'\r\n },\r\n body: `data=${JSON.stringify(meet)}`\r\n };\r\n\r\n var url = 'src/api.php/create-meet';\r\n\r\n fetch(url, settings)\r\n // .then(updateView());\r\n\r\n closeForm();\r\n updateView();\r\n\r\n return false;\r\n }", "title": "" }, { "docid": "3096cb2f3338c78701e7ddac984ca494", "score": "0.64761126", "text": "function addMeetupHandler(meetupData) {\n fetch(\n \"\",\n {\n method: \"POST\",\n body: JSON.stringify(meetupData),\n headers: { \"Content-Type\": \"application/json\" },\n }\n ).then(() => {\n history.replace(\"/\");\n });\n }", "title": "" }, { "docid": "d6632df5a8271edf581ff1315a3c27c6", "score": "0.58952546", "text": "static newGoal(userid){\n let newGoal = document.getElementById('myForm')\n newGoal.addEventListener(\"submit\" , function(e){ \n e.preventDefault();\n if (e.target.children[0].value != \"\") {\n fetchCall.createGoal(e, userid)\n .then(newGoal => {\n let goals = new Goal(newGoal);\n goals.renderGoals();\n })\n } \n })\n }", "title": "" }, { "docid": "8680f7874c038a8153b7d6af1d01b35c", "score": "0.5867951", "text": "handleEaterySubmit(name, address, contact){\n /* ---VARIABLE---\n body; contains the name, address, and contact info of the eatery \n */\n let body = {name:name, address:address, contact:contact};\n fetch('http://localhost:5000/eatery/add',{\n method: 'POST',\n body: JSON.stringify(body)\n\n }).then((response)=>{return response.json()})\n .then((eatery)=>{\n this.addNewEatery(eatery)\n })\n \n }", "title": "" }, { "docid": "f636cb8515f532fbfa05499a5209f188", "score": "0.58306116", "text": "async function sentData(e) {\n e.preventDefault();\n const newConference = {\n confName,\n startingDate,\n year,\n endDate,\n description,\n venue,\n RegistrationOpen,\n RegistrationClosed,\n paperSubmitionOpen,\n paperSubmitionClose,\n workshopSubmitionOpen,\n workshopSubmitionClose,\n status\n };\n // axios.post(\"http://localhost:8070/conferenceApi/create\",newConference).then(()=>{\n // alert(\"conference added\")\n // }).catch(error => {\n // console.log(error.message);\n // alert(error.message);\n // })}\n try {\n let result = await _axiosDefault.default.post('http://localhost:8070/conferenceApi/create', newConference);\n alert('Conference Added');\n } catch (err) {\n console.log(err);\n console.log(err.response.data);\n }\n }", "title": "" }, { "docid": "50ea67d39a6bb9f6ae6813886f0676b2", "score": "0.5787708", "text": "function webserv_compete_create_challenger(request_data, form) {\n $.ajax({type: \"POST\", url: \"/webserv/compete/create_challenger\", data: request_data, dataType: \"json\",\n error: function(data) {\n window.location = '/500';\n },\n success: function(data) {\n if (data[0] == 'validation-ko') {\n str = '';\n str += '<ul>';\n for (var k in data[1]) {\n str += '<li>' + messages[data[1][k]] + '</li>';\n }\n str += '</ul>';\n $(form + ' .feedback').show();\n $(form + ' .feedback').html(str);\n \n } else if (data[0] == 'success') {\n if (data[1] == 'ok') {\n window.location = \"/competition/compete\";\n }\n }\n }\n });\n return false;\n}", "title": "" }, { "docid": "af0123ab450d75817829c692a73c658f", "score": "0.57265943", "text": "async handleSubmit(e) {\n e.preventDefault();\n\n const { Name, Email, Phone, Message, Subject } = this.state;\n\n //Muestra PopUp\n this.setState({\n visible: true\n })\n\n await axios.post('https://fcontactusbamboo.azurewebsites.net/api/fcontactusbamboo?code=m0c96bNorsaiobahJ5XPUxRufAbe2vwFuxoT7AnDr9IZD2cpSzeA1w==', {\n Name, Email, Phone, Message, Subject\n }).then(function (response) {\n // handle success\n console.log(response.data);\n })\n\n }", "title": "" }, { "docid": "0bfdbe015dd73f830740da6cf1a17961", "score": "0.5698338", "text": "function createNewPar() {\n participants.post({\n firstName: $scope.params.firstName,\n middleName: $scope.params.middleName,\n lastName: $scope.params.lastName,\n dateOfBirth: utils.parseDateOfBirthBeforePush($scope.params.dateOfBirth),\n ssn: utils.ssnFormatSubmit($scope.params.ssn),\n streetAddress: $scope.params.streetAddress,\n addressLine2: $scope.params.addressLine2,\n city: $scope.params.city,\n postalCode: $scope.params.postalCode,\n state: $scope.params.state,\n //country: $scope.params.country,\n phoneNumber: $scope.params.phoneNumber,\n email: $scope.params.email,\n customerId: $scope.params.customerId,\n gender: $scope.params.gender,\n employerId: $scope.params.employerId,\n healthCoachId: security.isHealthCoach() ? security.currentUser.id : null,\n country: \"USA\",\n status: 0,\n diagnoseType: 0,\n diabetesTreatType: 0,\n prescribedMedicationForHypertension: false,\n recommendationForHighChrolesterol: 0,\n lastPhysicalExamOrCheckup: 0,\n visitHealthcareProviderRoutinely: false,\n edicalCarePlace: 0,\n overallPhysicalHealth: 0,\n coverageLevel: $scope.params.coverageLevel, // Change \"Coverage Level\" to \"Enrollment Level\"\n clientLocation: $scope.params.clientLocation,\n products: {\n beniCompAdvantage: $scope.env.products.beniCompAdvantage ? $scope.params.products.beniCompAdvantage : false,\n beniCompSelect: $scope.env.products.beniCompSelect ? $scope.params.products.beniCompSelect : false,\n },\n incentiveAssignId: $scope.env.currentIncentive ? $scope.env.currentIncentive.id : null,\n // BeniComp Select\n effectiveDate: utils.dateToShort($scope.params.effectiveDate),\n employmentDate: utils.dateToShort($scope.params.employmentDate),\n maritalStatus: $scope.params.maritalStatus,\n numberOfDependents: $scope.params.numberOfDependents,\n indexClassesOfEligibleEmployees: $scope.params.indexClassesOfEligibleEmployees,\n annualClassesOfEligibleEmployees: parseInt($scope.params.annualClassesOfEligibleEmployees),\n benefitYearBcsId: $scope.env.currentBenefitYearBcs ? $scope.env.currentBenefitYearBcs.id : null,\n\n primaryBeneficiaryForAdd: $scope.params.primaryBeneficiaryForAdd,\n primaryBeneficiaryRelationship: $scope.params.primaryBeneficiaryRelationship,\n contingentBeneficiaryForAdd: $scope.params.contingentBeneficiaryForAdd,\n contingentBeneficiaryRelationship: $scope.params.contingentBeneficiaryRelationship,\n\n },{screenName:$translate.instant('auditLogs.screenName.addParticipant')}).then(function (response) {\n $scope.env.showValid = false;\n $scope.env.error = null;\n $scope.goStateList();\n /*$state.go('loggedIn.modules.user-manager.participant');*/\n }, function (err) {\n if (_.isArray(err.errors)) {\n _.forEach(err.errors, function (error) {\n if (error.errorCode === ERRORCODES.conflict.email) {\n $scope.env.emailExist = true;\n $scope.env.error = $translate.instant('server.error.409.email');\n } else if (error.errorCode === ERRORCODES.conflict.username) {\n $scope.env.usernameExist = true;\n $scope.env.error = $translate.instant('server.error.409.username');\n } else if (error.errorCode === ERRORCODES.conflict.password) {\n $scope.env.passwordExist = true;\n $scope.env.error = $translate.instant('server.error.409.password');\n } else if (error.errorCode === ERRORCODES.conflict.customerId) {\n $scope.env.customerIdExist = true;\n $scope.env.error = $translate.instant('server.error.409.customerId');\n }\n });\n }\n });\n }", "title": "" }, { "docid": "baa6ee2b3667350cb4bae337eef9fbb9", "score": "0.56940174", "text": "onSubmit(e) {\n e.preventDefault()\n const token = window.localStorage.token\n const userID = window.localStorage.id\n const headers = { headers: config.headers(token) }\n const propertyID = this.props.propertyID\n const URL = config.dashboardAPI + '/user/' + userID + '/properties/' +\n propertyID + '/roomTypes/new'\n\n // format the data from the form\n this.form.userID = userID\n this.form.propertyID = propertyID\n const data = this.form\n\n axios.post(URL, data, headers).then((response) => {\n\n if (response.data.error === \"noErrors\") {\n Alert.success(response.data.message)\n $('#AddRoomType').modal('hide')\n this.props.getRoomTypes()\n\n } else Alert.error(response.data.message)\n\n }).catch((error) => $.notify(error, \"error\"))\n }", "title": "" }, { "docid": "d918179132adfb5b2d3ed9c941d10e6a", "score": "0.5650601", "text": "createConversation() {\n // Check the Conversation name.\n if(this.refs.conversationName.flag())\n return;\n\n this.refs.conversationName.unflag();\n\n let body = {\n validationKey : this.props.validationKey(),\n name : this.refs.conversationName.value,\n isPublic : (this.state.toggled === \"Public\")\n };\n\n // Submit the request.\n Fetcher.fetchJSON(\"/api/createConversation\", body,\n this.parseResponse.bind(this));\n\n // Reset the Pane.\n this.resetPane();\n }", "title": "" }, { "docid": "b011b6051c1a7442fbe06ad1fd1e0c34", "score": "0.55974936", "text": "openInputForAddTask() {\r\n\r\n //grab all fields values and arrange to send to serve by our controller\r\n const userData = null\r\n\r\n //function options for common ajax\r\n const funcOptions = {\r\n url: '/dashboard/task/add/input',\r\n type: 'post',\r\n dataType: 'html',\r\n beforeSend: false,\r\n contentType: '',\r\n data: false,\r\n responseBack: 'myteam-new-at-task',\r\n selector: '.', // . | #\r\n domElem: '', //span , div, etc\r\n domManipulation: false,\r\n addInput: true,\r\n responseElem: {\r\n domElem: {},\r\n domSelector: {}\r\n },\r\n modelDom: {},\r\n ajaxModel: false,\r\n rmvSelector: {\r\n origClassClicked: 'myteam-advpTask',\r\n origClassSelector: '.'\r\n }\r\n }\r\n\r\n //######## CALL AJAX COMMON FUNCTION TO SEND AND RETREIVE RESPONSES\r\n //params : data\r\n //params : func\r\n sendData(userData, funcOptions)\r\n\r\n }", "title": "" }, { "docid": "d71502b8b506c83c0a39a59fd744c6ab", "score": "0.55854976", "text": "submitForm() {\n const form = this._form;\n\n if (!form) {\n console.error(`No form found.`);\n }\n\n if (this.endpoint) {\n const values = this.constructor.collectFormValues(form);\n // get the form id from hax-form or the child form\n const id = this.formId || form.id;\n\n fetch(this.endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n id,\n values,\n }),\n })\n .then(() => {\n this.loading = true;\n })\n .finally(() => {\n this.loading = false;\n });\n } else {\n console.error(`Endpoint not defined`);\n }\n }", "title": "" }, { "docid": "0832e51315cfcbad4abf57ad991b3cf1", "score": "0.55767363", "text": "handleNew(algorythm) {\r\n algorythm.scenarioID = this.props.scenarioID;\r\n fetch('/api/uavs', {\r\n method: 'POST',\r\n body: JSON.stringify(algorythm),\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n }\r\n })\r\n .then(res => {\r\n if (!res.ok) {\r\n alert(`${res.statusText}`);\r\n } else {\r\n res.json()\r\n .then(data => {\r\n // update request algorythms with the data received\r\n this.setState({scenarioAlgorythms : data});\r\n alert(`${algorythm.name} created`);\r\n })\r\n }\r\n })\r\n .catch(err => console.log(err));\r\n this.setState({ showNew : false }); \r\n }", "title": "" }, { "docid": "f86f3c341d6e338328b26af88232f177", "score": "0.55753356", "text": "addChauffeur() {\n if (this.validationService.isFormValid()) // check the modal form if its data is valid.\n {\n var type = this.state.type;\n // call external api to add a new Chauffeur\n // add a new Chauffeur to table.\n this.ChauffeurService.add( type[\"societe\"], type[\"contact\"], type[\"email\"], type[\"phone\"], type[\"addr\"], type[\"manufacturer\"],\n type[\"model\"], type[\"immatriculation\"], type[\"parent\"], type[\"activated\"] )\n .then(res => {\n var id = res.id;\n var fulladdr = type[\"addr\"];\n var addr = fulladdr.split(',').pop(); \n var data = this.state.data;\n var parent_name = \"\";\n this.state.chauffeurs.map((prop, key) => {\n if (prop.id === type[\"parent\"]) {\n parent_name = prop.contact;\n }\n return prop.contact;\n });\n\n data.push( this.produceChauffeur(id, type[\"societe\"], type[\"contact\"], type[\"email\"], type[\"phone\"], addr, fulladdr,\n type[\"manufacturer\"], type[\"model\"], type[\"immatriculation\"], type[\"parent\"], parent_name, type[\"activated\"] ));\n this.setState({ data });\n var options = {};\n options = {\n place: \"tr\",\n message: \"A new chauffeur is added successfully.\",\n type: \"info\",\n icon: \"now-ui-icons ui-1_bell-53\",\n autoDismiss: 3\n }; \n this.refs.notificationAlert.notificationAlert(options);\n });\n \n this.setState({ // close the modal\n modal: !this.state.modal\n }); \n }\n }", "title": "" }, { "docid": "4cba134107d46fb670c4d93040789bf3", "score": "0.5571637", "text": "onNewRequest(value) {\n const { callBack } = this.props\n if (value.data) {\n callBack(value)\n }\n }", "title": "" }, { "docid": "19ac150cbf8fe1d7052360ad73a3f060", "score": "0.54787356", "text": "submitUserInfo(userInfo) {\n // get all user info from userProfile view\n // deconstruct vals\n const {\n username,\n password,\n address,\n zipcode,\n } = userInfo;\n // send post req to server to add new user to db\n axios.post('/newuser', {\n username,\n password,\n address,\n zipcode,\n })\n .then((res) => {\n console.log(res.data, 'RES DATA');\n // get all plants in new users zipcode\n this.zipCodeSubmit({ zipcode });\n })\n .catch((err) => { console.log(err); });\n }", "title": "" }, { "docid": "4e8ed1e2a2a4230a00b2808894adc599", "score": "0.54765147", "text": "async handleSubmit(event) {\n event.preventDefault();\n const data = new FormData(event.target);\n await axios({\n method: 'post',\n url: 'http://127.0.0.1:8000/places/hotel-info-api/',\n data: data,\n config: { headers: {'Content-Type': 'multipart/form-data'}},\n })\n this.showInfo(this.state.selected, false);\n }", "title": "" }, { "docid": "158f269ce64f6886a7e7e6e6cad50864", "score": "0.54428065", "text": "function gwGetVisitManager(pol_id,id_name,visit_id,info_type,formParameters,formFeatureData,formPagination,formData,deviceTrace,extraData,device,cb){\n\t\ttry{\n\t\t\t_self.emit(\"log\",\"visits.js\",\"gwGetVisitManager(\"+pol_id+\",\"+id_name+\",\"+visit_id+\",\"+info_type+\",\"+device+\")\",\"info\",{formParameters,formFeatureData,formData,deviceTrace,extraData,formPagination});\n\t\t\tlet dataToSend \t\t\t\t\t\t\t= {};\n\t\t\tdataToSend.pol_id \t\t\t\t\t= pol_id;\n\t\t\tdataToSend.id_name \t\t\t\t\t= id_name;\n\t\t\tdataToSend.device \t\t\t\t\t= device;\n\t\t\tdataToSend.info_type \t\t\t\t= info_type;\n\t\t\tdataToSend.formParameters\t\t= JSON.stringify(formParameters);\n\t\t\tdataToSend.formFeatureData \t= JSON.stringify(formFeatureData);\n\t\t\tdataToSend.formPagination \t= JSON.stringify(formPagination);\n\t\t\tdataToSend.deviceTrace\t\t\t= JSON.stringify(deviceTrace);\n\t\t//\tdataToSend.extraData\t\t\t\t= JSON.stringify(extraDataToSend);\n\t\t\tdataToSend.token\t\t\t\t\t\t= _token;\n\t\t\t//dynamic attributes\n\t\t\tfor (var k in formData) {\n\t\t\t\tif (formData.hasOwnProperty(k)) {\n\t\t\t\t\tif(formData[k]!=\"\"){\n\t\t\t\t\t\tdataToSend[k] = \tformData[k];\n\t\t\t\t\t}else if(formData[k]===0){\n\t\t\t\t\t\t\tdataToSend[k] = \t\"0\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdataToSend.what\t\t\t\t\t\t= 'gwGetVisitManager';\n\t\t\tdataToSend.expected_api_version = _expected_api_version;\n\t\t\taxios.post(_baseHref+'/ajax.sewernet.php', dataToSend).then(function (response) {\n\t\t\t\t_processReponse(null,response.data,'gwGetVisitManager',cb);\n\t\t\t})\n\t\t\t.catch( (error) => {\n\t\t\t\t_self.emit(\"log\",\"visits.js\",\"gwGetVisitManager error\",\"error\",error);\n\t\t\t\tcb(error,false);\n\t\t\t});\n\t\t}catch(e){\n\t\t\t_self.emit(\"log\",\"visits.js\",\"gwGetVisitManager error\",\"error\",e);\n\t\t\tcb(e,false);\n\t\t}\n\t}", "title": "" }, { "docid": "f5d13a7d9d0c0dbb64216f6e8de6a9f8", "score": "0.5390692", "text": "function submitNew(e) {\n e.preventDefault();\n fetch(`${USERS_API_URL}`, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n // body: JSON.stringify(user)\n body: JSON.stringify({\n name: name,\n document: document,\n email: email,\n phone: phone\n })\n })\n .then(response => response.json())\n .then(user => {\n props.addUserToState(user);\n props.toggle();\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "cc679e690991569a950efed057ac6354", "score": "0.5387946", "text": "processForm() {\n this.userId = this.shadowRoot.getElementById('user-id').value;\n this.gender = this.shadowRoot.getElementById('gender-list').value;\n this.userAge = this.shadowRoot.getElementById('user-age').value;\n this.deviceType = this.shadowRoot.getElementById('device-type').value;\n\n const userInfo = {\n userId: this.userId,\n gender: this.gender,\n userAge: this.userAge,\n deviceType: this.deviceType,\n };\n\n this.handleFormSubmission(userInfo);\n this.handleExitForm();\n }", "title": "" }, { "docid": "0213eb40b9076be3fbf8a09cdcc65c22", "score": "0.538478", "text": "async create(form) {\n let response = await this.client.post(`${this.baseResource}`, form)\n return response.data\n }", "title": "" }, { "docid": "6827499f86b8163819e8514cafd585dc", "score": "0.5381531", "text": "submitNewUserToAPI(formdata) {\n // console.log(formdata)\n\n // formdata.pharmacyEmail\n // formdata.pharmacyPassword\n\n AuthenticationService.newPharmacyPost(formdata)\n .then(response => {\n\n if (response.data == false) {\n alert('pharmacy with existing details exists')\n } else {\n this.loginPharmacy(formdata.pharmacyEmail, formdata.pharmacyPassword)\n }\n })\n\n }", "title": "" }, { "docid": "6c7a6e51fab586eb27652a3b8cd0f252", "score": "0.53709763", "text": "static onClickAddMeal(event) {\n event.preventDefault();\n const addButton = event.currentTarget;\n const formElements = addButton.form.elements;\n const name = formElements[0].value;\n const date = formElements[1].value;\n if (name == \"\" || date == \"\") {\n alert(\"Please enter values in both fields.\");\n return;\n }\n MealVoterApi.postMeal(name, date, () =>\n MealVoterApi.getMeals(getMealsCallback)\n );\n formElements[0].value = \"\";\n formElements[1].value = \"\";\n }", "title": "" }, { "docid": "d4c95e2379c385f1b4e2ba9a5e349af4", "score": "0.5366709", "text": "addVisit(event) {\n event.preventDefault();\n const form = document.querySelector('.visit-form');\n const date = form.date.value;\n const notes = form.notes.value;\n const vet = form.vet.value;\n const file = form.file.value;\n const petProfile = {\n id: this.props.activePet.id,\n date,\n notes,\n vet,\n file,\n };\n return this.props.savePet(petProfile);\n }", "title": "" }, { "docid": "b752258ab983cb208084b4cc02625a65", "score": "0.53659195", "text": "function getFormData() {\n data.periodType = periodType.value;\n data.timeToElapse = timeToElapse.value;\n data.reportedCases = reportedCases.value;\n data.population = population.value;\n data.totalHospitalBeds = totalHospitalBeds.value;\n}", "title": "" }, { "docid": "cf4596a3a2268bebc205deccea32617d", "score": "0.5364071", "text": "function submitForm(e){\n e.preventDefault();\n\n var data = grabFormElements();\n\n //reference database to check if visitor has an appointment\n console.log(\"should be printing?\");\n //socket.emit(GET_APPOINTMENT,data);\n\n //console.log(data.company_id);\n if(localStorage.getItem(\"slackToken\")&&localStorage.getItem(\"slackChannel\"))\n {\n $.post(\"https://slack.com/api/chat.postMessage\",\n {\n 'token': localStorage.getItem(\"slackToken\"),\n 'channel': localStorage.getItem(\"slackChannel\"), \n 'text': \"Name: \" + data['first_name'] + \" \" + data['last_name'] + \" Phone Number: \" + data['phone_number']\n },\n function(data, status){\n });\n }\n\n socket.emit(ADD_VISITOR, data);\n\n $(this).animate({\n top:'35%',\n opacity:'0'\n },0);\n //$('.check-in').addClass('hide');\n //$('.submit-check-in').style.display = \"none\";\n }", "title": "" }, { "docid": "091fd5f8ac7bccca271dce9b9b4ea3c7", "score": "0.53495955", "text": "function handleNewVisit(){\n let searchParams = new URLSearchParams(window.location.search);\n let id = searchParams.get('id');\n let patient = null;\n $.ajax({\n url: \"http://localhost:8080/api/v1/patients/\"+id,\n dataType: \"text\",\n type: 'GET',\n timeout: 5000,\n success: function(data) {\n var jsonData = jQuery.parseJSON(data);\n if(jsonData != null){\n patient = jsonData;\n let date = $(\"#date\").val().split(\"T\");\n date = date[0]+\" \"+date[1];\n let type = $(\"#type\").find(\":selected\").val();;\n let reason = $(\"#reason\").val();\n let history = $(\"#history\").val();\n let visit = {\n date: date,\n type: type,\n reason: reason,\n history: history,\n patient: patient\n }\n $.ajax({\n headers: { \n 'Accept': 'application/json',\n 'Content-Type': 'application/json' \n },\n url: baseUrl,\n dataType: \"json\",\n data: JSON.stringify(visit),\n type: 'POST',\n cache: false,\n timeout: 5000,\n success: function(data) {\n $(\"#date\").val(\"\");\n $(\"#reason\").val(\"\");\n $(\"#history\").val(\"\");\n },\n error: function(jqXHR, textStatus, errorThrown) {\n alert(\"Error while adding the visit\");\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n }\n });\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n }\n });\n}", "title": "" }, { "docid": "b9db5b3499b37d2549d1745a1dcc3919", "score": "0.5346015", "text": "assignActivitie(event) {\n event.preventDefault();\n\n //Se comprueba primero que todos los campos del formulario sean validos\n if (this.validaFormulario()) {\n const nombre = this.props.match.params.proyecto\n\n fetch(`http://virtual.lab.inf.uva.es:27014/api/informeSemanal`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'x-access-token': window.sessionStorage.getItem('token')\n },\n body: JSON.stringify({\n nombreActividad: this.state.idActividad,\n nombreProyecto: nombre,\n nickUsuario: this.state.idUsuario,\n })\n }).then((response) => {\n //console.log(\"Codigo de estado: \" + response.status);\n switch (response.status) {\n case 201:\n alert(\"Actividad asignada\");\n\n //Una vez creado el proyecto se resetean los campos del formulario\n this.setState({ idUsuario: '' });\n this.setState({ idActividad: '' });\n this.setState({ listaParticipantes: [] });\n\n document.forms[\"formularioProyecto\"][\"idUsuario\"].value = \"\";\n this.getInformes();\n break;\n\n default:\n throw new Error(\"Bad response from server\");\n }\n return response.json();\n }).catch(function (res) { console.log(res) });\n }\n\n }", "title": "" }, { "docid": "abe887be56d9620565a56568cc2c9d61", "score": "0.5341912", "text": "handleFormSubmit(e) {\n e.preventDefault();\n let userData = this.state.newEpisode;\n\n fetch('/list',{\n method: \"POST\",\n body: JSON.stringify(userData),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n }).then(response => {\n response.json().then(data =>{\n console.log(\"Successful\" + data);\n })\n })\n }", "title": "" }, { "docid": "23246fa1c160e6145f7f63a7c4182d53", "score": "0.53252345", "text": "addProject(event) {\n event.preventDefault();\n\n //Se comprueba primero que todos los campos del formulario sean validos\n if (this.validaFormulario()) {\n fetch(`http://virtual.lab.inf.uva.es:27014/api/proyecto`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'x-access-token': window.sessionStorage.getItem('token')\n },\n body: JSON.stringify({\n nombreProyecto: this.state.nombre,\n descripcion: this.state.descripccion,\n nickUsuario: this.state.idJefeProyecto,\n })\n }).then((response) => {\n //console.log(\"Codigo de estado: \" + response.status);\n switch (response.status) {\n case 201:\n alert(\"Proyecto creado\");\n\n //Una vez creado el proyecto se resetean los campos del formulario\n this.setState({ nombre: '' });\n this.setState({ idJefeProyecto: '' });\n this.setState({ descripccion: '' });\n\n //Se actualizan los jefes de proyecto restantes \n //y se cambia la opcion seleccionada en el desplegable\n this.getJefesProyecto();\n document.forms[\"formularioProyecto\"][\"idJefeProyecto\"].value = \"\";\n break;\n\n //TODO Falta ver que codigo de error es\n case 409:\n alert(\"Existe un proyecto con ese nombre\");\n break;\n default:\n throw new Error(\"Bad response from server\");\n }\n return response.json();\n }).catch(function (res) { console.log(res) });\n }\n\n }", "title": "" }, { "docid": "f0bb270e6301dea3ef197f018d7cf23d", "score": "0.53147686", "text": "submitData(event){\n event.preventDefault();\n console.log(lng, lat, 'SubmitData');\n let rest = this.refs.rest.value;\n let time = this.refs.time.value;\n let msg = this.refs.msg.value;\n let conv = this.refs.conv.value;\n let opt = this.refs.opt.value;\n let name = this.refs.name.value;\n let number = this.refs.number.value;\n let form = {\n name: name,\n number: number,\n rest:rest,\n time:time,\n msg:msg,\n conv:conv,\n opt:opt\n }\n //console.log(form);\n this.props.findPeople(lng, lat, form);\n \n this.setState({\n newRec:form\n }) \n }", "title": "" }, { "docid": "d319be2f0d8db7a87d4408e039686d98", "score": "0.5309068", "text": "constructor(props){\n super(props);\n this.state = {\n patientinfo:[]\n };\n // bind \"this\" so it returns a reference to the new patient page component\n this.handlePost = this.handlePost.bind(this);\n this.handleUpload = this.handleUpload.bind(this);\n }", "title": "" }, { "docid": "3c0bb24c385dc6b0afc5f115ed13bf93", "score": "0.5288708", "text": "handleSubmit(e) {\n this.createTestimonial(this.state.testimony);\n }", "title": "" }, { "docid": "c5cb41e3445b184624a74973653db4c3", "score": "0.5287063", "text": "submitForm(ev) {\n ev.preventDefault();\n request.post('/api/project/create')\n .set('token', Auth.getToken())\n .send(this.buildBody())\n .end(this.parseResponse);\n }", "title": "" }, { "docid": "544dbad60ab67eb2e63e895a9fe96412", "score": "0.52840465", "text": "getForm() {\r\n console.log('grabbing form data from child form components')\r\n let address = (typeof this.address !== 'undefined') ? this.address.getForm() : {}\r\n let formData = assign({\r\n address: assign({}, address),\r\n addresses: [\r\n assign({}, address)\r\n ]\r\n }, this.props.getForm())\r\n \r\n console.log(formData)\r\n \r\n // Do something?\r\n return formData\r\n }", "title": "" }, { "docid": "eb4fb0190ce73e17259c032a04520537", "score": "0.52790284", "text": "handleCreateElement(kind) {\r\n // Prepare HTTP API request data\r\n let requestData = {};\r\n requestData.viewsiteId = this.state.viewsiteId;\r\n requestData.viewpageId = this.state.viewpage._id;\r\n requestData.kind = kind;\r\n // Continue HTTP API request data preparation based on Element kind\r\n // and hide create form when done\r\n if(kind === \"text\") {\r\n let createText = this.state.text;\r\n requestData.textValue = createText.textValue;\r\n }\r\n else if(kind === \"form\") {\r\n let createForm = this.state.form;\r\n requestData.formTitle = createForm.formTitle;\r\n }\r\n else if(kind === \"dataView\") {\r\n let createDataView = this.state.dataView;\r\n requestData.formId = createDataView.formId;\r\n }\r\n else if(kind === \"image\") {\r\n let createImage = this.state.image;\r\n requestData.fileUpload = createImage.fileUpload[0];\r\n }\r\n // else if(kind === \"number\"){\r\n // let createNumber = this.state.number;\r\n // requestData.numberValue = createNumber.numberValue;\r\n // }\r\n // Send out API request to create a new Element\r\n this.manageElementService.createElement(requestData)\r\n .then((results) => {\r\n // Afterwards, set Global Viewsite state to reflect changes\r\n this.handleSetGlobalState(results.data, \"viewsite\");\r\n // Follow up by clearing element state\r\n this.handleClearLocalState();\r\n // Hide form\r\n $(\".create\"+kind.charAt(0).toUpperCase()+kind.slice(1)).hide(\"medium\");\r\n },\r\n (error) => {\r\n // Handle errors\r\n this.setState({\r\n elementSuccess: \"\",\r\n elementError: error.response.data\r\n });\r\n });\r\n }", "title": "" }, { "docid": "dc54a6ff9ddc326360202943593d6ee3", "score": "0.527691", "text": "function sendData(e) {\r\n e.preventDefault();\r\n //set data value from inputs;\r\n let form = new FormData(document.querySelector('form'));\r\n\r\n //if inputs are empty, function return false;\r\n if (nameValue.value == '' || numberValue.value == '' || emailValue.value == '') {\r\n error.style.display = 'block';\r\n error.textContent = 'You have just entered incorrect data';\r\n return false;\r\n }\r\n //text which will be send telegram-bot;\r\n let txt = ` <b>name:</b> ${form.get('name')}%0A<b>phone:</b> ${form.get('phone')}%0A<b>email:</b> ${form.get('email')}`\r\n\r\n //send request to telegram;\r\n fetch(`https://api.telegram.org/bot${token}/sendMessage?chat_id=${id}&parse_mode=html&text=${txt}`, {\r\n method: 'POST',\r\n })\r\n //redirect to group telegrams;\r\n window.location.href = 'https://t.me/joinchat/AAAAAEXRYW7T4gN2_uHxJA';\r\n return false;\r\n}", "title": "" }, { "docid": "5f7aefcba18695331911e9e96b009e92", "score": "0.52767164", "text": "onSave(e){\n // data in the form\n var form_data = {\n CveAct: this.state.CveAct,\n CveAlu: this.props.CveA,\n fecha: this.state.fecha,\n comments : this.state.comments,\n evaluacion: this.state.evaluacion\n };\n\n console.log(form_data);\n\n \n // submit form data to api\n $.ajax({ \n url: \"http://localhost/~jesusperea/phpFilesCEDAC/create_boleta.php\",\n type : \"POST\",\n //contentType : 'application/json',\n data : JSON.stringify(form_data),\n success : function(response) {\n \n // api message\n this.setState({successCreation: response['message']});\n \n // empty form\n this.setState({fecha: \"\"});\n this.setState({CveAct: \"\"});\n this.setState({CveAlu: \"\"});\n this.setState({evaluacion: \"\"});\n this.setState({comments: \"\"});\n \n }.bind(this),\n error: function(xhr, resp, text){\n // show error to console\n console.log(xhr, resp, text);\n }\n });\n \n e.preventDefault();\n }", "title": "" }, { "docid": "5a90c858677cb2f01e7639f4a5ca88f7", "score": "0.5274125", "text": "onSubmit(e) {\r\n e.preventDefault();\r\n const obj = {\r\n //input data yang akan dimasukkan ke database\r\n person_name: this.state.person_name,\r\n business_name: this.state.business_name,\r\n business_gst_number: this.state.business_gst_number,\r\n number_phone: this.state.number_phone\r\n };\r\n axios.post('http://localhost:4000/business/add', obj)\r\n //.then(res => console.log(res.data));\r\n .then(res =>{ this.addNotification(); });\r\n \r\n // set data sesudah diinputkan\r\n this.setState({\r\n person_name: '',\r\n business_name: '',\r\n business_gst_number: '',\r\n number_phone:''\r\n })\r\n }", "title": "" }, { "docid": "fa47c8b9cacacf2dd8d49efb977b0cba", "score": "0.5265939", "text": "onResponse() {\n this.patientData = {\n username : this.patientName,\n email: this.email,\n date : this.date,\n phone : this.phonenumber,\n service : this.$.service.selected,\n doctor : this.$.doctor.selected,\n time : this.time\n }\n //patientData values to store the localstorage\n localStorage.setItem('bookingData',JSON.stringify(this.patientData));\n this.openToast();\n // when the form is submitted then route is redirect appoinmentview page\n this.set('route.path', '/appoinmentview');\n\n // after submit the form then reset the form \n this.$.formOne.reset();\n }", "title": "" }, { "docid": "bee3b23bbd296bac3b0eaf6e42876748", "score": "0.5261031", "text": "getData() {\n createLoadingCircle();\n showLoadingCircle();\n\n const url = this.props.formDefinition.Children[0].Form.ApiGetEndpoint;\n const ContractNumber = getCookie('ContractNumber');\n const InvoiceNumber = getCookie('InvoiceNumber');\n\n defaultHeaders['Content-Type'] = 'application/json; charset=utf-8';\n axios(`${url}?contractId=${ContractNumber}&invoiceNumber=${InvoiceNumber}`, {\n method: 'GET',\n headers: defaultHeaders\n }).then(response => {\n const data = response.data;\n\n // TO REMOVE:\n // this.setState({\n // hideGenericError: true,\n // // deep copy hack (avoid keeping references)\n // data: JSON.parse(JSON.stringify(data)),\n // originalData: JSON.parse(JSON.stringify(data))\n // });\n\n // deep copy hack (avoid keeping references) and empty the data got from database:\n const emptyData = JSON.parse(JSON.stringify(data));\n emptyData.map((group) => {\n group.register.map((register) => {\n register.date = '';\n register.reading = '';\n return register;\n });\n return group;\n });\n\n this.setState({\n hideGenericError: true,\n data: emptyData,\n // deep copy hack (avoid keeping references)\n originalData: JSON.parse(JSON.stringify(data))\n });\n\n initSensoryMind(this.props.formDefinition.MultistepFormIdentity);\n\n removeLoadingCircle();\n }).catch(error => {\n // TO REMOVE:\n // switch (error.response.status) {\n // case 500: {\n // const messageResponse = error.response.data.Message || 'We are really sorry,';\n // const exceptionMessageResponse = error.response.data.ExceptionMessage || 'please come back later.';\n // this.setState({\n // genericErrorMsg: `${messageResponse} ${exceptionMessageResponse}`,\n // hideGenericError: false\n // });\n // break;\n // }\n // case 400: {\n // const tempResponse = error.response.data.ModelState;\n\n // Object.keys(tempResponse).map((key) => {\n // if (key === '') {\n // this.setState({\n // genericErrorMsg: tempResponse[key] || 'We are really sorry',\n // hideGenericError: false\n // });\n // }\n // return null;\n // });\n // this.setState({ errorData: error.response.data.ModelState || 'Please come back later.' });\n // break;\n // }\n // default: {\n // this.setState({\n // genericErrorMsg: innogyMultistepForm[this.props.formDefinition.MultistepFormIdentity].Children[0].Form.NoConnectionErrorMessage,\n // hideGenericError: false\n // });\n // }\n // }\n\n const errorResult = errorHandler({ errorResponse: error, noConnectionErrorMessage: innogyMultistepForm[this.props.formDefinition.MultistepFormIdentity].Children[0].Form.NoConnectionErrorMessage });\n\n this.setState({ ...errorResult });\n removeLoadingCircle();\n });\n }", "title": "" }, { "docid": "32d09327336cc07326a5e76f518016e2", "score": "0.52505064", "text": "submitInformation(event) {\n\n event.preventDefault() // Don't refresh the page\n\n let postObject = {} // Create an empty object to place items into\n\n // Only allow the user through if at least one item has been entered.\n if (this.state.discord != '' || this.state.twitter != '' || this.state.twitch != '') {\n\n // Checks the particular field and if it has data, add it into the empty object\n if (this.state.discord != '')\n postObject.discord = this.state.discord\n\n if (this.state.twitter != '')\n postObject.twitter = this.state.twitter\n\n if (this.state.twitch != '')\n postObject.twitch = this.state.twitch \n\n // Call the API to send data and update the user's profile through the database\n editProfile(postObject)\n } else {\n // ... nope\n console.log('Nope!')\n }\n\n this.onFileUpload()\n\n if (this.state.newUsername.trim() != '') {\n changeUsername(this.state.newUsername)\n }\n }", "title": "" }, { "docid": "058f9c0432e857d07201d25d8b15b3d2", "score": "0.5249564", "text": "postNewContact(newContactToSave) {\n // We want to return this fetch request so that at the point it is called, we can take advantage of the asynchronous nature of promises to wait for this to be done before getting the latest data and rerendering the DOM.\n return fetch(\"http://localhost:8088/addressbook\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(newContactToSave)\n });\n }", "title": "" }, { "docid": "9e013c90e9b02fce66e44b05a0f65ae1", "score": "0.5246448", "text": "function newWeatherData(e){\n let zipCodeValue = zipCode.value;\n let userFeelingsValue = userFeelings.value;\n\n weatherReport(`${sourceUrl}${zipCodeValue}${apiKey}`).then(\n function (data){\n postData('http://localhost:3000/add', {temperature:data.main.temp, date:newDate, userResponse:userFeelingsValue})\n }).then(\n function () {\n updateUi()\n }) \n}", "title": "" }, { "docid": "e3cec3cc78ca5b4d0414c96ddeaaacbd", "score": "0.5245246", "text": "async postCommand (formCreatorFunction, args) {\n const options = await this.getAuthHeader()\n let form\n if (args != null) {\n form = formCreatorFunction(...args).form\n } else {\n form = formCreatorFunction().form\n }\n const url = `${this.$store.state.api_endpoints.jobs_api}/newjob?site=${this.active_site}`\n\n form.timestamp = parseInt(Date.now() / 1000)\n form.site = this.active_site\n form.mount = this.active_mount\n\n console.log(form)\n axios.post(url, form, options).then(response => {\n console.log(response.data)\n this.$emit('jobPost', response.data)\n }).catch(e => {\n this.handleNotAuthorizedResponse(e)\n })\n }", "title": "" }, { "docid": "e8c48a60d21a26871f928490ccbd331f", "score": "0.5238114", "text": "sendTestForm(event) {\r\n event.preventDefault();\r\n let token = sessionStorage.getItem(\"token\");\r\n let headers = {\r\n \"x-access-token\": token,\r\n };\r\n \r\n let data = {\r\n gender: this.state.gender,\r\n age: parseInt(event.target.age.value),\r\n musicGender: event.target.musicGender.value,\r\n sport: event.target.sport.value,\r\n hobbie: event.target.hobbie.value,\r\n movieSeries: this.state.seriesMovies,\r\n filmGender: event.target.filmGender.value,\r\n tabaco: this.state.tabaco,\r\n alcohol: this.state.alcohol,\r\n party: this.state.party,\r\n ordenConvivencia: parseInt(this.state.orderC),\r\n ordenPersonal: parseInt(this.state.orderP),\r\n personalidad: this.state.personality\r\n };\r\n console.log({ data });\r\n axios.post(\"/api/test\", data, {\r\n headers\r\n })\r\n .then(response => {\r\n if (!response.err) {\r\n this.setState({formCreated: true}, ()=> this.returnHome());\r\n }\r\n })\r\n .catch(e => {\r\n console.log(e.response.data.err);\r\n //el server fallo al crear el test\r\n this.setState({ defaultErrorMessage: e.response.data.err });\r\n }); \r\n }", "title": "" }, { "docid": "1339f9cda472cefec4f6f62c6cd4a5a6", "score": "0.52362156", "text": "submitForm(e) {\r\n e.preventDefault()\r\n let inputValues = {}\r\n this.setResponseType('Var god vänta..')\r\n\r\n // Get all input fields\r\n for(let input in this.refs) {\r\n inputValues[input] = this.refs[input].value\r\n }\r\n\r\n axios.post('/email/VVSRequest', inputValues)\r\n .then(function (res) {\r\n this.setResponseType('message')\r\n\r\n }.bind(this))\r\n .catch(function (err) {\r\n console.log(\"error\", err)\r\n this.setResponseType('error')\r\n }.bind(this))\r\n\r\n this.setState({\r\n form: {}\r\n })\r\n }", "title": "" }, { "docid": "212cfe29a1f8147564f9429cd2e51235", "score": "0.52352875", "text": "async formSubmit(formData) {\n let data = new FormData(formData)\n await fetch(this.state.api_url, {\n method: \"POST\",\n mode: \"cors\",\n body: data\n }).then(response => response.json()).then(response => this.props.updateMeetingList(response))\n //reset form fields to empty strings\n this.setState ({\n subject: \"\",\n notes: \"\",\n action_items: \"\"\n })\n }", "title": "" }, { "docid": "8e6a9f864143057ce6c3f45dc532788e", "score": "0.52350366", "text": "postBody(data = {}) {\n const dataNew = data || {};\n Object.keys(dataNew).forEach(key => {\n if (dataNew[key] === undefined) {\n delete dataNew[key];\n }\n });\n const headers = this.headers;\n if (headers[\"Content-Type\"] === \"application/json\") {\n return JSON.stringify(dataNew);\n } else {\n return this.getFormData(dataNew);\n }\n }", "title": "" }, { "docid": "7755e1b3efe9b4f897a450d6aca2ce2d", "score": "0.5229429", "text": "function getGoalDetail(e) {\n\n const data = new FormData();\n\n data.append('match', document.querySelector('#match').value);\n data.append('player', document.querySelector('#player').value);\n data.append('team', document.querySelector('#team').value);\n data.append('time', document.querySelector('#time').value);\n data.append('goal_type', document.querySelector('#goal_type').value);\n data.append('stage', document.querySelector('#stage').value);\n data.append('schedule', document.querySelector('#schedule').value);\n data.append('half', document.querySelector('#half').value);\n\n // console.log(match.value, player.value, team.value, time.value, goal_type.value, stage.value, schedule.value, half.value);\n\n insertGoalDetail(data);\n\n}", "title": "" }, { "docid": "5d5dae166b53460a94be1f3ee750840f", "score": "0.52213746", "text": "formatForSubmit(event) {\n event.preventDefault();\n \n let dataObject = {};\n dataObject.housing = this.state.housing;\n dataObject.transportation = this.state.transportation;\n dataObject.food = this.state.food;\n dataObject.utilities = this.state.utilities;\n dataObject.misc = this.state.misc;\n var userId = firebase.auth().currentUser.uid;\n submitExpenseInfo(userId, dataObject, 'expenseInfo').then(() => {\n this.toggleSuccess();\n this.handleClear();\n }).catch((error) => {\n this.setState({ error: error.message });\n });\n }", "title": "" }, { "docid": "93e683a530e704e5672a0f2e12331227", "score": "0.5217208", "text": "fill_form( ) {\n let data = new Information( this.cid ).read();\n console.log( data );\n Object.keys( data ).forEach( (key) => {\n this.handle.elements[ key ].value = data[ key ];\n } ); // end for each key\n }", "title": "" }, { "docid": "d5d73ad2a8f75ea952fb32c26201cc31", "score": "0.5214706", "text": "function sendData(e){//passing the event \"onSubmit\"\n e.preventDefault();/*without redirecting to a new page it will insert\n data from the same page itself. That function will prevent the normal behaviour\n of the even \"onSubmit\"*/\n\n //creat a new object\n const newOrderObj = {\n cardNumber,\n totalPrice,\n cvc,\n cardHolderName\n }\n\n axios.post(\"http://localhost:8070/order/newOrder\" , newOrderObj).then(() => {\n alert( 'Added' );\n //after submitting, make all the fields default by clearing the data typed by the user\n\n /* this.setState({\n cardNumber : '',\n totalPrice : '',\n cvc : '',\n cardHolderName : ''\n });*/\n\n }).catch((err) =>{\n alert(err);\n })\n }", "title": "" }, { "docid": "ed8fa52f35827fa32e8cfdc294986641", "score": "0.5212908", "text": "function AskAboutWheather(e){\n /* Function to GET Web API Data*/\n WheaterTemp()\n .then(function(allwheatherInfo){\n /* Function to POST data */\n posttoserver('/SaveTempData', {date: newDate, temp:allwheatherInfo.temp, content: allwheatherInfo.feelings ,country:allwheatherInfo.country,city:allwheatherInfo.city,whdescription:allwheatherInfo.whdescription});\n })\n .then(function (dataUI){\n \n /* Function to GET Project Data and updata UI */\n updateUI()\n }\n )\n \n }", "title": "" }, { "docid": "48c35f3bdad0f72a351fb3191ca385ff", "score": "0.5206948", "text": "function addDataIntoFields() {\n $(document).on(\"dialog-ready\", function () {\n\n var $multifields = $(WIDGET_SELECTOR);\n\n /*Do nothing when type is not matching*/\n if (_.isEmpty($multifields)) {\n return;\n }\n\n /* Build a map that key is the based name, value is corresponding the widget element */\n var multifieldMap = getMultifieldMap($multifields),\n $form = $(\".cq-dialog\"),\n actionUrl = $form.attr(\"action\") + \".infinity.json\";\n\n $.ajax(actionUrl).done(processData);\n\n function processData(data) {\n\n /* Loop through all MultiCompositeField widgets on the dialog, and build each one*/\n _.each(multifieldMap, function ($multifields, multifieldName) {\n buildMultifield(data[multifieldName], $multifields, multifieldName);\n });\n\n }\n });\n }", "title": "" }, { "docid": "6e5571d42c93445675b39e7d73a79560", "score": "0.51985455", "text": "onSubmit(text){\n //console.log('Text?', text, \"volunteer id\", this.props.volunteer._id);\n this.postRequest(this.props.pickup._id, text);\n this.setState({text:''});\n this.props.getDataForRendering();\n // this.setState({requests:this.props.volunteer.requests})\n }", "title": "" }, { "docid": "ebc7055f5f9f2d685a0b263338eb73af", "score": "0.51966166", "text": "function getSignupForm() {\n\n var signupForm = new ajaxCall();\n signupForm.a.URL = \"/signup\";\n signupForm.setArgs();\n\n // opens up the ajax connection\n signupForm.c.Open();\n}", "title": "" }, { "docid": "099a009b6f827e17ae34699c40447e03", "score": "0.51954293", "text": "async function handleForm(event) {\n event.preventDefault();\n let data;\n\n /* get competencies */\n let compDiv = document.getElementById(\"competencyArray\");\n let comps = compDiv.getElementsByClassName(\"comp\")\n let compCount = compDiv.childElementCount;\n\n let competencyArray = []\n \n for (let compBlock of comps) {\n let competency = compBlock.getElementsByClassName(\"compUrl\")[0].value\n let weight = compBlock.getElementsByClassName(\"compWeight\")[0].value\n \n competencyArray.push({ competency, weight })\n }\n \n let assignedName = document.getElementById(\"name\").value;\n let assignedCode = document.getElementById(\"courseCode\").value;\n let assignedDescription = document.getElementById(\"description\").value;\n\n if (document.getElementById(\"_id\").value == \"\") {\n\n data = {\n name: assignedName ? assignedName : \"Unnamed Entry\",\n courseCode: assignedCode ? assignedCode : \"No Course Code\",\n description: assignedDescription ? assignedDescription : \"No Description\",\n thumbnailUrl: document.getElementById(\"thumbnailUrl\").value,\n url: document.getElementById(\"url\").value,\n educationalAlignment: competencyArray\n }\n\n await fetch('api/v1/experiences', {\n method: 'POST',\n mode: 'cors',\n headers: {\n \"Authorization\": \"SRN1yHHGWAGzKSkTxKcFris71bISI2xX\",\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n \"method\": \"POST\",\n \"credentials\": \"same-origin\"\n },\n body: JSON.stringify(data),\n }).then(resp => resp.json())\n .then(result => {\n console.log(result);\n constructTable();\n form.reset();\n return result;\n });\n\n } else {\n\n data = {\n name: assignedName ? assignedName : \"Unnamed Entry\",\n courseCode: assignedCode ? assignedCode : \"No Course Code\",\n description: assignedDescription ? assignedDescription : \"No Description\",\n thumbnailUrl: document.getElementById(\"thumbnailUrl\").value,\n url: document.getElementById(\"url\").value,\n educationalAlignment: competencyArray,\n _id: document.getElementById(\"_id\").value\n }\n\n await fetch('api/v1/experiences', {\n method: 'PUT',\n mode: 'cors',\n headers: {\n \"Authorization\": \"SRN1yHHGWAGzKSkTxKcFris71bISI2xX\",\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n \"method\": \"PUT\",\n \"credentials\": \"same-origin\"\n },\n body: JSON.stringify(data),\n }).then(resp => resp.json())\n .then(result => {\n\n form.reset();\n constructTable();\n /* Close the form */\n document.getElementById(\"formbutton\").click();\n return result;\n });\n }\n}", "title": "" }, { "docid": "d04949e333b7fa1d087a5cfa132e30bf", "score": "0.51911026", "text": "_submitTaskEvHandler(){\n \n let form = document.querySelector(\".form__add__task\");\n\n const formData = new FormData(form);\n const submitedData ={};\n this._deleteFormMessage(form)\n \n for(var pair of formData.entries()) {\n console.log(pair[0],pair[1])\n if(pair[0]===\"deadline_time\" && pair[1]==\"\") continue;\n submitedData[pair[0]]=pair[1]; \n }\n \n \n fetch(\"http://127.0.0.1:8000/api/task/\", {\n method: 'POST',\n headers:{\n 'Authorization': `Token ${this.#user.token}`,\n 'Content-type':'application/json',\n 'X-CSRFToken': this._getCSRFToken(),\n },\n body :JSON.stringify(submitedData)\n })\n .then(response =>{\n if(!response.ok) throw response;\n this._displayFormMessage({\"message\":[\"Task successfully added.\"]},form ,\"SUCCES\");\n this._emptyFormValues(form);\n }) \n .catch(err =>{\n try{\n err.json()\n .then(body =>this._displayFormMessage(body,form,\"ERROR\"))\n }\n catch(e){\n console.log(\"Something went wrong with parsing\")\n }\n })\n }", "title": "" }, { "docid": "6893a4d1661ec7a6c73f901c4d5cf5ba", "score": "0.51819754", "text": "function AddPlant(props) {\n const [content, setContent] = useState(\"\");\n const [sunlight, setSunlight] = useState(\"\");\n const [water, setWater] = useState(\"\");\n const [birthday, setBirthday] = useState(\"\");\n const [nameP, setName] = useState(\"\");\n const [typeP, setType] = useState(\"\");\n const [alive, setAlive] = useState(\"true\");\n \n function createPlant(plant) {\n console.log(plant);\n return API.post(\"plantjournal\", \"/journal\", {\n body: plant\n });\n }\n\n async function handleSubmit(event) {\n event.preventDefault();\n try {\n await createPlant({ nameP, typeP, birthday, sunlight, water, content, alive });\n props.history.push('/plants');\n } catch (e) {\n alert(e.toString());\n }\n }\n function renderAdd() {\n return (\n <div className=\"AddPage\">\n <Jumbotron className=\"addJumbo\">\n <h1> Add </h1>\n </Jumbotron>\n <div className=\"NewPlant\">\n <Form horizontal=\"true\" onSubmit={ handleSubmit }>\n <Form.Group controlId=\"nameP\">\n <Col sm={2}>Name</Col>\n <Col sm={10}>\n <Form.Control className=\"addBottom\" value={nameP} type=\"text\" placeholder=\"Bob\" onChange={e => setName(e.target.value)}/>\n </Col>\n </Form.Group>\n <Form.Group controlId=\"typeP\">\n <Col sm={2}>Type</Col>\n <Col sm={10}>\n <Form.Control className=\"addBottom\" value={typeP} type=\"text\" placeholder=\"Aloe Vera\" onChange={e => setType(e.target.value)}/>\n </Col>\n </Form.Group>\n <Form.Group controlId=\"birthday\">\n <Col sm={2}>Birthday</Col>\n <Col sm={10}>\n <Form.Control className=\"addBottom\" value={birthday} type=\"date\" onChange={e => setBirthday(e.target.value)}/>\n </Col>\n </Form.Group>\n <Form.Group controlId=\"sunlight\">\n <Col sm={2}>Sunlight</Col>\n <Col sm={10}>\n <Form.Control className=\"addBottom\" value={sunlight} type=\"text\" placeholder=\"Medium\" onChange={e => setSunlight(e.target.value)}/>\n </Col>\n </Form.Group>\n <Form.Group controlId=\"water\">\n <Col sm={2}>Last Watered</Col>\n <Col sm={10}>\n <Form.Control className=\"addBottom\" value={water} type=\"date\" placeholder=\"Low\" onChange={e => setWater(e.target.value)}/>\n </Col>\n </Form.Group>\n <Form.Group controlId=\"content\">\n <Col sm={2}>Other Notes</Col>\n <Col sm={10}>\n <Form.Control className=\"addBottom\" value={content} type=\"text\" placeholder=\"Doesn't like cold\" onChange={e => setContent(e.target.value)}/>\n </Col>\n </Form.Group>\n <Button block className=\"addButton\" size=\"lg\" type=\"submit\">Submit</Button>\n </Form>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"plantAdd\">\n {props.isAuthenticated ? renderAdd() : renderLander()}\n </div>\n );\n}", "title": "" }, { "docid": "60c2b4883d16830353081583b81bb0f2", "score": "0.5181598", "text": "makeGroup() {\n fetch('http://mixtape.fratstar.org/groups', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n\n //edit this to choose what data you want in new group (the name and members are both in state)\n body: JSON.stringify({}),\n });\n }", "title": "" }, { "docid": "c93f123dee4b8cbf6b5a9afebbc88a9a", "score": "0.5180328", "text": "function submitData() {\n\n // add it to a javascript object\n var data = {\n userName: $(\"#nameInput\").val().trim(),\n email: $(\"#destInput\").val().trim(),\n pass: $(\"#timeInput\").val().trim(),\n }\n\n //pushes data obj to firebase node \"newTrain\"\n var ref = db.ref(\"newTrain\");\n ref.push(data);\n ref.on(\"value\", getData);\n }", "title": "" }, { "docid": "7d0467985a02c759b0fe2d303b86c18d", "score": "0.5180315", "text": "async function handleSubmit(e) {\n try {\n e.preventDefault();\n //alert('submitting user data thrugh axios post request to API');\n console.log(userFormvals, ' <<<<<<<<<<<<<<<<<<<<');\n userFormvals.uri = uri;\n userFormvals.did = userIdentity;\n const response = await apiInstance.post('/vp', userFormvals);\n console.log('data posted....', response);\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "e73d65577949b1928e84ad5c96c414e0", "score": "0.517956", "text": "handleSubmit(e) {\n\t\te.preventDefault();\n\t\tthis.setState({\n\t\t\tloading: true\n\t\t})\n\t\tconsole.log(\"This is the user's input: \", this.state.userInput)\n\n\t\tServices.getMood(this.state.userInput)\n\t\t.then(mood => {\n\t\t\tthis.setState({\n\t\t\t\tloading: false,\n\t\t\t\tapiOutput: mood.data.output,\n\t\t\t})\n\t\t\tconsole.log(\"this is mood \", mood.data.output);\n\t\t\tconsole.log('aaaand this is apiOutput ', this.state.apiOutput);\n\t\t\tthis.child.current.emotionPicker();\n\t\t\tlet emotionObject = {};\n\t\t\temotionObject['userInput'] = this.state.userInput;\n\t\t\temotionObject['apiOutput'] = this.state.apiOutput[0];\n\t\t\tconsole.log(\"this is emotionObject \", emotionObject);\n\t\t\tServices.postMoodToDb(emotionObject)\n\t\t\t.then(emotion => {\n\t\t\t\tconsole.log(\"this emotion was posted \", emotion)\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.log(\"this emotion did not post: \", err)\n\t\t\t})\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.log(\"This is the error \", err)\n\t\t})\n\t}", "title": "" }, { "docid": "4d388de764556113f831dd1991eec7a4", "score": "0.51718044", "text": "_create(request, data) {\n return this.$http.post(this._serverUrl + request, data, {withCredentials: true,}).error((exception, status)=>{this._errorCallback(exception, status)}).then(result => result.data);\n }", "title": "" }, { "docid": "0fc80b3495e6b27119855aa5581cbf70", "score": "0.51699966", "text": "function sendUserData() {\r\n let result = getFormData();\r\n document.getElementById(\"name\").value = \"\";\r\n document.getElementById(\"city\").value = \"\";\r\n document.getElementById(\"email\").value = \"\";\r\n document.getElementById(\"message\").value = \"\";\r\n\r\n let p = fetch(\"http://localhost:3000/user\", {\r\n method: \"POST\",\r\n headers: { \"Content-type\": \"application/json\" },\r\n body: JSON.stringify(result),\r\n });\r\n p.then((response) => {\r\n console.log(response.json());\r\n getUserData();\r\n }).catch((errMsg) => {\r\n console.log(errMsg);\r\n });\r\n}", "title": "" }, { "docid": "c05bd6f6705ac6a62426660413dabfee", "score": "0.5159536", "text": "submit() {\n const body = {\n contact: this.contact.value,\n app: this.app.value,\n alert: this.rule.value\n };\n\n fetch(`${this.props.application.host}/api/alert`, {\n credentials: 'same-origin',\n method: 'POST',\n body: JSON.stringify(body),\n headers: {\n 'token': this.props.application.user.token,\n 'Content-Type': 'application/json'\n }\n })\n .then((response) => response.json())\n .then((data) => {\n if (data.success) {\n Router.push('/admin/alerts');\n this.closeModal();\n }\n })\n .catch((error) => {\n console.error('API Error:', error);\n });\n }", "title": "" }, { "docid": "b6e290ded98bb1b9d4006cb4b2f283b4", "score": "0.5154008", "text": "submitCategoryCreation (editPopinManagementContext) {\n return (formData) => {\n this.setState({ error: '', isLoading: true })\n categoriesAPI.createCategory(\n this.context.user.data.key,\n Object.assign({}, formData, { weight: this.context.categories.data.length })\n ).then((newCategory) => {\n this.context.categories.updateCategories(this.context.categories.data.concat([newCategory.body]))\n this.setState({ error: '', isLoading: false })\n editPopinManagementContext.trigger(null)\n }).catch((e) => {\n console.log(e)\n this.setState({ error: 'error to do', isLoading: false })\n })\n }\n }", "title": "" }, { "docid": "a58c1f64bf5202cf2e938aa3d3ed6bea", "score": "0.51500326", "text": "function handleNewCarSubmit(e) {\n var prospectId = $('#newCarModal').data('prospect-id');\n var carMake = $('#carMake').val();\n var carModel = $('#carModel').val();\n var carYear = $('#carYear').val();\n var carColor = $('#carColor').val();\n var carStyle = $('#carStyle').val();\n\n var formData = {\n make: carMake,\n model: carModel,\n year: carYear,\n color: carColor,\n style: carStyle\n };\n\n var postUrl = '/api/prospects/' + prospectId + '/wishlists';\n\n $.post(postUrl, formData)\n .success(function(wishlist) {\n // Re-get full prospect and render on page\n $.get('/api/prospects/' + prospectId).success(function(prospect) {\n // Remove old entry\n $('[data-prospect-id='+ prospectId + ']').remove();\n // Render a replacement\n renderProspect(prospect);\n });\n\n // Clear form\n $('#carMake').val('');\n $('#carModel').val(''); \n $('#carYear').val('');\n $('#carColor').val('');\n $('#carStyle').val('');\n $('#newCarModal').modal('hide');\n\n });\n}", "title": "" }, { "docid": "7448d7a819b68e013b88ad3d80a1d2cf", "score": "0.5147631", "text": "onSubmit(e){\n e.preventDefault();\n const formData = new FormData();\n formData.append('company', this.state.company);\n formData.append('price', this.state.price);\n formData.append('name', this.state.name);\n formData.append('category', this.state.category);\n formData.append('image', this.state.image);\n formData.append('location', this.state.address);\n formData.append('city', this.state.city);\n formData.append('description', this.state.description);\n formData.append('author', this.state.author);\n // this.props.postDeal(formData, this.props.history);\n }", "title": "" }, { "docid": "ace98ecaaabfee3245fa8421a5f8669e", "score": "0.51452774", "text": "createCompany (form_data) {\n return apiCall('post', '', form_data)\n }", "title": "" }, { "docid": "9506484f25b576365ce9dcf6c8bdf122", "score": "0.51423323", "text": "sendData() {\n if (this.validateInput(this.state.newEventText, 'submit') && this.state.newEventText) {\n this.props.callback({\n dateString:\n this.state.newEventDate ?\n this.state.newEventDate.format(df.defaultDate) :\n this.props.defaultDate.format(df.defaultDate),\n\n text: this.state.newEventText.trim(),\n });\n\n this.requestCloseModal();\n\n\n /*\n Got a test that really did not like these refs, so this is not a great solution.\n Tried a lot of testing with createNodeMock, but it didn't help\n */\n try\n {\n this.textInput.clear();\n } catch(e) {\n console.warn('Error clearing textInput:', e);\n }\n\n\n }\n }", "title": "" }, { "docid": "1070a6b11122255a088f0b17c3b18160", "score": "0.5142063", "text": "function handleThis(form){\n let newObj = {};\n for (let element of form.elements) {\n if (element.name) {\n newObj[element.name] = element.value;\n }\n }\n\n currentpoke[\"m1\"] = newObj[\"m1\"];\n currentpoke[\"m2\"] = newObj[\"m2\"];\n currentpoke[\"m3\"] = newObj[\"m3\"];\n currentpoke[\"m4\"] = newObj[\"m4\"];\n\n req.onload = () => {\n window.location = \"/viewPC.html\";\n };\n req.open(\"PUT\", \"http://35.235.50.146:9000/pokemon/\"+currentpoke[\"id\"]);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n req.send(JSON.stringify(currentpoke));\n return false;\n}", "title": "" }, { "docid": "b405e535471bbaed1610e76f92c60abe", "score": "0.5139361", "text": "function performActionGetUserData(e) {\n const cityZip = document.getElementById(\"zip\").value;\n const userFeelings = document.getElementById(\"feelings\").value;\n getWeatherAPI(baseUrl, cityZip, apiKey).then(function(data) {\n console.log(\"performActionGetUserData .then func. : \" + data);\n //add data to post request\n postData(\"http://localhost:3000/add\", {\n date: newDate,\n temp: data.main.temp,\n content: userFeelings,\n });\n // to update ui elements with the new data.\n updateUI();\n });\n}", "title": "" }, { "docid": "ee0150b0b2295956508c03e8945877f0", "score": "0.513566", "text": "handleSubmit() {\r\n var scope = this;\r\n axios.post('/newClient', {\r\n workerUsername: this.props.item.username,\r\n clientName: this.state.name,\r\n phonenumber: this.state.phonenumber,\r\n issue: this.state.issue,\r\n latitude: this.state.latitude,\r\n longtitude: this.state.longtitude\r\n })\r\n .then(function (res) {\r\n scope.handleClose()\r\n })\r\n }", "title": "" }, { "docid": "baa61ba9022cf72de87bdbb97158534d", "score": "0.51334035", "text": "function getMeetup(request, response){\n const url = `https://api.meetup.com/find/upcoming_events?&sign=true&photo-host=public&lon=${request.query.data.longitude}&radius=10&fields=20&lat=${request.query.data.latitude}&key=${process.env.MEETUP_API_KEY}`;\n //console.log('MEETUP URL', url);\n\n return superagent.get(url)\n .then(result => {\n const meetupSummaries = result.body.events.map(info => {\n return new Meetups(info);\n });\n response.send(meetupSummaries);\n })\n .catch(error => handleError(error, response));\n}", "title": "" }, { "docid": "29de16a2faa139c0918e42c63ed6b144", "score": "0.51313597", "text": "function init($childGroupProfile) {\n // selectors\n var $childGroupForm = $childGroupProfile.find(options.selectors.childGroupForm);\n var $btnSave = $childGroupProfile.find(options.selectors.btnSave);\n var $btnCancel = $childGroupProfile.find(options.selectors.btnCancel);\n\n // templates\n //var $staffTableTemplate = $ParentDom.find(Options.templates.staffTableTemplate);\n\n // selector string\n //var staffTable = Options.selectorString.staffTable;\n\n // params\n //var orgId = Options.params.orgId;\n var isEdit = options.params.isEdit;\n var createUrl = options.urls.createUrl;\n var returnUrl = options.urls.returnUrl;\n var updateUrl = options.urls.updateUrl;\n var errorMessage = options.params.errorMessages;\n var CurrentUrl = \"\";\n\n //-------------------Domain Logic-------------------//\n\n $btnCancel.click(function () {\n tuxUtil.submitForm(returnUrl, \"GET\");\n });\n\n $btnSave.click(function () {\n if (isEdit)\n CurrentUrl = updateUrl;\n else\n CurrentUrl = createUrl;\n\n // for testing\n // normally you just need to \n // set up form api \n $childGroupForm\n .form({\n // validate when lose focus\n on: 'blur',\n // show inline validation error\n inline: true,\n // validtion rule\n fields: {\n name: {\n rules: [{\n type: 'empty',\n prompt: 'Please enter a name for the Group'\n }]\n },\n capacity: {\n rules: [{\n type: 'empty',\n prompt: 'Please enter the Capacity of the Group'\n }]\n },\n minAge: {\n rules: [{\n type: 'empty',\n prompt: 'Please enter the minimum Age of the Group'\n }]\n },\n maxAge: {\n rules: [{\n type: 'empty',\n prompt: 'Please enter the maximum Age of the Group'\n }]\n }\n }\n })\n .api({\n // form submission url\n url: CurrentUrl,\n serializeForm: true,\n method: \"POST\",\n beforeSend: function (settings) {\n // logic before sending\n return settings;\n },\n // handle response\n onSuccess(responseResult, element, xhr) {\n console.log(\"success........\");\n if (responseResult.isSuccess) {\n tuxUtil.success(\"Save successfully.\");\n tuxUtil.submitForm(returnUrl, \"GET\");\n // logic goes here\n }\n else {\n // alert responseResult.errorMessage\n // or alert default error message\n tuxUtil.error(responseResult.errorMessage);\n }\n }\n });\n // submit form\n $childGroupForm.form(\"submit\");\n });\n\n\n //show server-side validation errors \n if (errorMessage) {\n $(errorMessageDiv).removeClass(\"hidden\");\n $(errorMessageDiv).addClass(\"visible\");\n $(errorMessageDiv).append(\"<p>\" + errorMessage + \"</p>\");\n }\n\n }", "title": "" }, { "docid": "a3b72159e79016d02cfcccca77684d82", "score": "0.5127653", "text": "updateForm(event) {\n axios.post('http://localhost:8080/api/recipe')\n }", "title": "" }, { "docid": "a1a83d83fc363158a72a62c2e48f91de", "score": "0.51258475", "text": "updatePetDetails(event) {\n event.preventDefault();\n const form = document.querySelector('.pet-profile-details-form');\n const name = form.name.value;\n const type = form.type.value;\n const birthYear = form.birthyear.value;\n const gender = form.gender.value;\n const spayed = form.spayed.value;\n const { ownerID } = this.props;\n const petProfile = {\n name,\n type,\n birthYear,\n gender,\n spayed,\n ownerID,\n };\n\n fetch('/pets/', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ pet: petProfile }),\n })\n .then((response) => response.json())\n .then((petObject) => {\n console.log(petObject);\n this.savePet(petObject);\n })\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "134b097beaa5075a024e87facdf83484", "score": "0.5123019", "text": "postStudentInLabGroups(data){\n return http.post('/student-in-lab-group/', data)\n }", "title": "" }, { "docid": "b3fb18899e71239808bdec26c568d9d7", "score": "0.5122966", "text": "function handleSubmit(event) {\n event.preventDefault();\n\n const data = new FormData(event.target);\n\n // Form fields\n const name = data.get('name')\n const category = data.get('category')\n const quantity = data.get('quantity')\n const price = data.get('price')\n const action = data.get('action')\n\n // Mapping form to JSON\n output = {\n name: name,\n category: category === 'commodity'?'cash':category,\n quantity: quantity,\n price: price,\n action: action\n }\n\n // Calling PUT request with above data\n putNewHolding(USERNAME, output)\n .then((data) => {\n // Check response for success message or error object\n if (typeof(data.message) === 'string')\n alert(data.message)\n else\n alert(data.message.category)\n\n // Close form\n closeForm()\n // Show Overview page and refresh\n callOverview()\n // Generate and refresh table\n generateTable(USERNAME)\n })\n}", "title": "" }, { "docid": "b9cddfacf4c3e732a0ea9d951f31c4ec", "score": "0.5122015", "text": "function submitForm() {\n fetch('/chatRooms', {\n method: \"POST\",\n body: JSON.stringify({\n // remember to put the name of you fields in quotation marks => or else does not recognize\n chatUsername: username,\n // figure out avatar img problem for post request => basically add state to hold img src and store in DB\n // avatarImg: chatUserIcon,\n }),\n headers: {\n \"accept\": \"application/json\",\n \"content-type\": \"application/json\"\n }\n \n });\n history.push('/chatRooms');\n }", "title": "" }, { "docid": "1d675e2a6214bb96d19c8e654e1b579f", "score": "0.51187885", "text": "deliver() {\n let body = {\n validationKey : this.props.validationKey(),\n text : this.refs.message.value,\n conversationKey : this.state.address\n };\n\n // Clear the message field\n this.refs.message.value = \"\";\n\n // Send the request.\n Fetcher.fetchJSON(\"/api/sendToConversation\", body, this.handleResponse.bind(this));\n }", "title": "" }, { "docid": "1a6030555d2e5b01a9228f3045479fbe", "score": "0.5114207", "text": "function postToy(evt){\n let toyName = evt.name.value\n let toyImage = evt.image.value\n fetch(`http://localhost:3000/toys` , {\n method: \"POST\",\n headers: { \n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n }, \n body: JSON.stringify({\n name: toyName,\n image: toyImage,\n likes: 0\n })\n}) \n.then(r => r.json())\n.then(newToy => renderToys(newToy))\n}", "title": "" }, { "docid": "02744c646cb90e8a720662fbcf774b2f", "score": "0.5105102", "text": "btn_submit(e){\n e.preventDefault();\n // grab the form data\n const form_data ={\n userName: this.refs.userName.value,\n userDesignation: this.refs.userDesignation.value,\n userPhone: this.refs.userPhone.value,\n userEmail: this.refs.userEmail.value,\n companyName: this.refs.companyName.value,\n companyWebsite: this.refs.companyWebsite.value,\n companySize: this.refs.companySize.value,\n userIndustry: this.refs.userIndustry.value,\n userState: this.refs.userState.value,\n userDistrict: this.refs.userDistrict.value,\n userTaluk: this.refs.userTaluk.value,\n userPassword: this.refs.userPassword.value\n };\n // make a http request for the backend server\n var request = new Request('http://localhost:5000/signup',{\n method:\"POST\",\n headers:{\"Content-Type\":\"application/json\"},\n body: JSON.stringify(form_data)\n });\n fetch(request)\n .then(res => res.json())\n .then(json =>{\n if(json.success){\n console.log(\"You have successully Registered \")\n // and redirect to the another page\n window.location.href = 'http://localhost:3000/verify';\n }\n else{\n console.log(json.message);\n }\n })\n\n // console.log(form_data);\n\n }", "title": "" }, { "docid": "4f1a6d7bb8ec3323a2dce9ec4172d54e", "score": "0.5102231", "text": "function LoadModalAddHotel(idPaysEtape, idVilleJour, idJour){\n var FormAddHotel = new FormData();\n FormAddHotel.append('action','btn_add_hotel');\n FormAddHotel.append('idPaysEtape', idPaysEtape);\n FormAddHotel.append('idVilleJour', idVilleJour);\n FormAddHotel.append('idJour', idJour);\n var controller = GetUrlControllerAdmin();\n\n $.ajax({\n type : 'POST',\n url : controller,\n data : FormAddHotel,\n dataType : 'json',\n async : false,\n cache : false,\n contentType : false,\n processData : false,\n success : function (reponse){\n Vue(reponse);\n },\n error: function (xhr, error) {\n console.log(error);\n console.log(xhr);\n }\n });\n\n\n}", "title": "" }, { "docid": "021519aceb1fb5f1ef3195a45873a104", "score": "0.5099077", "text": "function tpl_create_partner(modal_body, titleModal, params){\n\n var time = new Date()\n var dia = (\"0\" +time.getDate()).slice(-2);\n var mes = (\"0\" + (time.getMonth() + 1)).slice(-2);\n var año = time.getFullYear() ;\n var time = año +'-'+ mes +'-'+ dia\n\n var dateNow = time\n\n var data = params || JSON.parse(sessionStorage.getItem('CS')) || null\n var content = document.createElement('form')\n content.setAttribute('class', 'ModalForm__content--part')\n content.setAttribute('id', 'ModalForm__content--part')\n content.setAttribute('data-form-part', 'tpl_create_partner')\n var tpl = `<h5 class=\"Title\">${titleModal}</h5>\n <div class=\"row\">\n <div class=\"input-field col s5\">\n <input value=\"${data.nombres || ''}\" name=\"nombres\" id=\"nombres\" type=\"text\" class=\"validate\">\n <label for=\"nombres\">Nombre</label>\n </div>\n <div class=\"input-field col s5\">\n <input value=\"${data.apellidos || ''}\" name=\"apellidos\" id=\"apellidos\" type=\"text\" class=\"validate\">\n <label for=\"apellidos\">Apellido</label>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"input-field col s5\">\n <select name=\"organizacion\" class=\"selectForm\">\n <option ${data.organizacion==='Ejercito' ? 'selected' : ''} value=\"Ejercito\">Ejercito</option>\n <option ${data.organizacion==='F.A.P' ? 'selected' : ''} value=\"F.A.P\">F.A.P</option>\n <option ${data.organizacion==='Marina' ? 'selected' : ''} value=\"Marina\">Marina</option>\n <option ${data.organizacion==='P.N.P' ? 'selected' : ''} value=\"P.N.P\">P.N.P</option>\n <option ${data.organizacion==='Civil' ? 'selected' : ''} value=\"Civil\">Civil</option>\n </select>\n <label>Organización</label>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"input-field col s5\">\n <input value=\"${data.dni || ''}\" name=\"dni\" id=\"dni\" type=\"number\" class=\"validate\">\n <label for=\"dni\">DNI</label>\n </div>\n <div class=\"input-field col s5\">\n <label class=\"date\" for=\"fecha_nacimiento\">Fecha de Nacimiento</label>\n <input value=\"${data.fecha_nacimiento || dateNow}\" name=\"fecha_nacimiento\" id=\"fecha_nacimiento\" type=\"date\" placeholder=\"\" max=\"${dateNow}\">\n </div>\n </div>\n <div class=\"row\">\n <div class=\"input-field col s5\">\n <input value=\"${data.numero_carnet || ''}\" name=\"numero_carnet\" id=\"numero_carnet\" type=\"text\" class=\"validate\">\n <label for=\"numero_carnet\">N° Carnet</label>\n </div>\n </div>`\n\n\n content.innerHTML = tpl\n modal_body.append(content)\n\n $('#dni').on('keypress', function(){\n nombre=$(this).val(); \n //Comprobamos la longitud de caracteres\n if (nombre.length<8){\n return true;\n }\n else {\n return false; \n }\n })\n\n $('.selectForm').material_select()\n Materialize.updateTextFields()\n }", "title": "" }, { "docid": "5a34585e8780e7c7ecf692a4002d71e9", "score": "0.5098792", "text": "manageEntity() {\n fetch(this.url, {\n headers: {\n \"X-CSRF-TOKEN\": this.csrf,\n \"Accept\": \"application/json\"\n },\n body: this.data,\n // Not work with PUT or PATCH methods even in chrome.\n method: 'POST',\n mode: 'same-origin',\n credentials: 'same-origin',\n cache: 'no-cache'\n }).then(response => {\n if (!response.ok) {\n //Instantiate an exception if response not successful.\n throw new RequestException(response);\n }\n }).then(() => {\n this.removeErrors();\n // Create notification and invoke custom callback.\n swal({\n title: 'Выполнено!',\n type: 'success',\n timer: 2000\n }).then(() => {\n this.callback.call();\n }, () => {\n this.callback.call();\n });\n }).catch(exception => {\n // Exception handling and error rendering if we have errors with validation.\n if (exception.hasValidationErrors()) {\n this.renderErrors(exception.getValidationErrors());\n } else {\n swal({\n title: StatusCodes.hasOwnProperty(exception.getStatus()) ? StatusCodes[exception.getStatus()].call() : 'Что-то пошло нет так! Попробуйте позже.',\n type: 'error'\n });\n }\n });\n }", "title": "" }, { "docid": "5dbbb11f08f43c284fd6395925579499", "score": "0.50936884", "text": "function addDataInFields() {\n $(document).on(\"dialog-ready\", function() {\n var $multifields = $(\"[\" + DATA_EAEM_NESTED + \"]\");\n \n if(_.isEmpty($multifields)){\n return;\n }\n \n workaroundFileInputPositioning($multifields);\n \n var mNames = getMultiFieldNames($multifields),\n $form = $(\".cq-dialog\"),\n actionUrl = $form.attr(\"action\") + \".infinity.json\";\n \n $.ajax(actionUrl).done(postProcess);\n \n function postProcess(data){\n _.each(mNames, function($multifield, mName){\n $multifield.on(\"click\", \".js-coral-Multifield-add\", function (event) {\n \n \tbuildImageField($multifield, mName, event.hasOwnProperty('originalEvent'));\n workaroundFileInputPositioning($multifields);\n checkFileRequired();\n });\n \n buildMultiField(data[mName], $multifield, mName);\n });\n }\n });\n }", "title": "" }, { "docid": "7b5a7d524254e38dcf030650d4daf322", "score": "0.5093197", "text": "function createNewToy(btn) {\n const form = btn.parentNode\n const configObj = {\n method: \"POST\",\n headers: \n {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify({\n \"name\": form[0].value,\n \"image\": form[1].value,\n \"likes\": 0\n })\n }\n \n fetch(`http://localhost:3000/toys`, configObj)\n .then(resp => resp.json())\n .then(json => displayNewToy(json))\n .catch(error => console.log(error))\n\n document.getElementsByClassName('add-toy-form')[0].reset()\n alert('Toy succesfully added');\n\n}", "title": "" }, { "docid": "2c9b73646368a469e5956e64647d9691", "score": "0.5090729", "text": "function addPlantHandler(plantData) {\n //firebase require .json\n fetch(\n \"https://plantcoolections-default-rtdb.firebaseio.com/plants.json\",\n //to store data to firebase we must send post request'\n {\n method: 'POST',\n body: JSON.stringify(plantData),\n headers: {\n 'Content-Type': 'application/json'\n } \n }\n ).then(() => {\n history.replace('/Wishlist')\n })\n }", "title": "" }, { "docid": "e9661935cada9ac64c4549520b539e93", "score": "0.5089739", "text": "addTask(e){\r\n var url = \"http://localhost:5000/api/todo/application/addTask\"\r\n fetch(url,{\r\n method:\"POST\",\r\n body: JSON.stringify({\r\n \"taskName\":this.state.taskName,\r\n \"taskDescription\":this.state.taskDescription,\r\n \"deadline\":this.state.deadline\r\n }),\r\n headers:{\r\n \"Content-type\":\"application/json; charset=UTF-8\"\r\n }\r\n }).then(() => this.extra())\r\n \r\n }", "title": "" }, { "docid": "f3639661cb6c025c458fa84bdedd3a59", "score": "0.50894153", "text": "addNewTaskOnClick(ref) {\r\n\r\n //#### INVOKE SEND DATA THROUGH DEFAULT OPTIONS\r\n //grab all fields values and arrange to send to serve by our controller\r\n const taskData = JSON.stringify({\r\n task_name: $.trim(ref.val())\r\n })\r\n\r\n //function options for common ajax\r\n const funcOptions = {\r\n url: '/dashboard/add/new/task',\r\n type: 'post',\r\n dataType: 'json',\r\n beforeSend: false,\r\n contentType: 'application/json',\r\n data: true,\r\n responseBack: 'myteam-new-at-task',\r\n selector: '.', // . | #\r\n domElem: '', //span , div, etc\r\n domManipulation: false,\r\n addInput: false,\r\n responseElem: {\r\n domElem: {},\r\n domSelector: {}\r\n },\r\n modelDom: {},\r\n ajaxModel: false,\r\n rmvSelector: {}\r\n }\r\n\r\n //######## CALL AJAX COMMON FUNCTION TO SEND AND RETREIVE RESPONSES\r\n //params : data\r\n //params : func\r\n var getTaskResponse = sendData(taskData, funcOptions)\r\n\r\n //#### GET THE USER LIST\r\n //#### ADD HTML TYPE TO SET THE DATA AGAIN\r\n const TaskDataList = null\r\n\r\n //function options for common ajax\r\n const funcOptionsUserList = {\r\n url: '/dashboard/tasks/list',\r\n type: 'GET',\r\n dataType: 'html',\r\n beforeSend: false,\r\n contentType: '',\r\n data: false,\r\n responseBack: 'taskList',\r\n selector: '.', // . | #\r\n domElem: 'ul', //span , div, etc\r\n domManipulation: false,\r\n domClick: 'ul.projectsAll li a',\r\n domCloseClass: '.close',\r\n responseElem: {\r\n domElem: {},\r\n domSelector: {}\r\n },\r\n modelDom: {},\r\n ajaxModel: false,\r\n taskList: true\r\n }\r\n\r\n if(parseInt(getTaskResponse) == 200){\r\n\r\n //#### INVOKE AUTO RENDER\r\n this.autoRender()\r\n\r\n //#### INVOKE SEND DATA\r\n sendData(TaskDataList, funcOptionsUserList)\r\n return false\r\n } else {\r\n console.log('error invoked')\r\n return false\r\n }\r\n }", "title": "" }, { "docid": "9035cbe0f6999483cc5a20920f077f89", "score": "0.5088113", "text": "handleSubmit(event) {\n event.preventDefault();\n this.sendData();\n }", "title": "" }, { "docid": "335f4e89053e06a3f7fed8e19a53cc1e", "score": "0.5085738", "text": "async fillReturnForm2(data: Object): Promise<APIResponse> {\n const response = await this.jsonRequest(`api/shopping/secured/return-form`, data);\n return response.json();\n }", "title": "" }, { "docid": "c946c99933dd3db0c308cf78dc82e6af", "score": "0.5080905", "text": "function fillOutForm(){\n\n\tvar dataobj = {\n\t\t\"data\": {\n\t\t \"age\": 10,\n\t\t \"contact\": \"(945)434-343\",\n\t\t \"date\": \"05/1/2018\",\n\t\t \"diagnosis\": \"cancer\",\n\t\t \"dob\": \"4/11/1996\",\n\t\t \"name\": \"sridatt\"\n\t\t},\n\t\t\"test\": false\n\t}\n\n\t$.ajax({\n\t url: \"https://app.formapi.io/api/v1/templates/tpl_YeEne4k2qmxKDsta/submissions\",\n\t type: \"POST\",\n\t data: dataobj,\n\t dataType: \"html\",\n\t success: function(res){\n\t \tvar pdfid = JSON.parse(res)[\"submission\"][\"id\"];\n\t \tconsole.log(\"https://app.formapi.io/api/v1/submissions/\" + pdfid + \"/download/\" + pdfid.split(\"_\")[1] + \".pdf\");\n\t }\n\t});\n}", "title": "" }, { "docid": "96170f3f622f37d98bdea72b45afd810", "score": "0.5065547", "text": "handleSubmit(event) \n {\n event.preventDefault();\n // hole Usereinagbe\n let userInput = this.state.value;\n \n let locationName = this.callAPI_locationID(userInput);\n this.callAPI_departures(locationName);\n }", "title": "" }, { "docid": "597d2c7ac35168e8874c2006ac99b6a5", "score": "0.5063307", "text": "addFormData(evt)\r\n {\r\n evt.preventDefault();\r\n const fd = new FormData();\r\n fd.append('updatecatname', this.state.catname);\r\n fd.append('updatedisplayorder', this.state.displayorder);\r\n fd.append('updatestatus', this.state.status);\r\n fd.append('updateid', this.state.id);\r\n axios.post('http://localhost/api1/crudcat.php', fd).then(res=>\r\n {\r\n this.myFormRef.reset();\r\n $(\"#editmodal\").modal(\"hide\");\r\n //Get all users details in bootstrap table\r\n axios.get('http://localhost/api1/crudcat.php').then(res =>\r\n {\r\n //Storing users detail in state array object\r\n this.setState({data: res.data});\r\n }); \r\n //Success Message in Sweetalert modal\r\n Swal.fire({\r\n title: 'Product id '+this.refs.myID.value+' has been updated.',\r\n text: res.data.data,\r\n type: 'success',\r\n });\r\n }\r\n );\r\n }", "title": "" }, { "docid": "4b289af2741d25615d2da27a438159ac", "score": "0.5062538", "text": "function AddTeacher() {\n\n //goal: send a request which like this:\n //POST: http://localhost:61589/api/TeacherData/AddTeacher\n //with POST data of teacher first and last name\n\n var URL = \"http://localhost:61589/api/TeacherData/AddTeacher/\";\n\n var rq = new XMLHttpRequest();\n\n var TeacherFname = document.getElementById(\"TeacherFname\").value;\n var TeacherLname = document.getElementById(\"TeacherLname\").value;\n var TeacherNumber = document.getElementById(\"TeacherNumber\").value;\n var TeacherSalary = document.getElementById('TeacherSalary').value;\n var HireDate = document.getElementById('HireDate').value;\n\n var TeacherData = {\n \"TeacherFname\": TeacherFname,\n \"TeacherLname\": TeacherLname,\n \"TeacherNumber\": TeacherNumber,\n \"TeacherSalary\": TeacherSalary,\n \"HireDate\" : HireDate\n };\n\n rq.open(\"POST\", URL, true);\n rq.setRequestHeader(\"Content-Type\", \"application/json\");\n rq.onreadystatechange = function () {\n if (rq.readyState == 4 && rq.status == 200) {\n //request is successful and the request is finished\n //nothing to render, the method returns nothing.\n }\n }\n rq.send(JSON.stringify(TeacherData));\n}", "title": "" }, { "docid": "1e01bb59a808db60993cb8ee8c2562fb", "score": "0.5061418", "text": "handleSubmit(){\n //destructring- takes this.state and gets the properties username, password and email\n const {registerUsername, registerFirstname, email, registerPassword} = this.state\n //this posts new user to database from registration form\n makeNewUserApi(registerUsername, registerFirstname, email, registerPassword)\n }", "title": "" } ]
86840eb677e6fbc961e9f66968837a2d
Pasamos el evento y si hay keydown lo convertimos en true.
[ { "docid": "5f8ae29d902267e54d47892f803a9892", "score": "0.0", "text": "onKeyEvent(event){\n const status = event.type ==='keydown'\n \n switch(event.keyCode){\n case KEY_UP:\n this.movement.up = status\n this.vy = -SPEED\n \n break;\n case KEY_DOWN:\n this.movement.down = status\n this.vy = SPEED\n break;\n case KEY_LEFT:\n this.movement.left = status\n this.vx = -SPEED\n break;\n case KEY_RIGHT:\n this.movement.right = status\n this.vx = SPEED\n \n break;\n case KEY_FIRE:\n this.audio.play()\n \n this.addBullets()\n\n \n \n\n \n break;\n \n default:\n break;\n \n }\n }", "title": "" } ]
[ { "docid": "539bb0249e2bb208067a3a4221749284", "score": "0.6857637", "text": "Keydown(event) {\n let keyObj = this.Keyboard[event.keyCode];\n if(keyObj) keyObj.IsPressed = true;\n }", "title": "" }, { "docid": "2c1639c3867b9f1d27ed96af8f94ab77", "score": "0.6701913", "text": "function onKeyDown(e) {\n _isKeydown = true;\n\thandleKeyEvent(\"keydown\", e);\n _isKeydown = false;\n}", "title": "" }, { "docid": "10392d9d751a9ae767bb77dc6f99136b", "score": "0.6696328", "text": "onKeydown(e) {\n let onkeydown = this.get('onkeydown');\n if (onkeydown && onkeydown(this.get('publicAPI'), e) === false) {\n return false;\n }\n return this._routeKeydown(e);\n }", "title": "" }, { "docid": "48119d458ad75ae46ff2a9b2bd77dabb", "score": "0.6535315", "text": "Keyup(event) {\n let keyObj = this.Keyboard[event.keyCode];\n if(keyObj) keyObj.IsPressed = false;\n }", "title": "" }, { "docid": "8d0d7c52b054f95fdc0a1b6c0abc03e2", "score": "0.64079386", "text": "function keyDown(event)\n {\n pressedKey[event.keyCode] = true;\n }", "title": "" }, { "docid": "0c07392fa40dfe84b073d538f9fac3cc", "score": "0.63709164", "text": "function checkKeyDown(e) {\n var keyID = e.keyCode || e.which;\n if (keyID === 38 || keyID === 87) { //up arrow or W key\n game.ss.isUpKey = true;\n e.preventDefault();\n }\n if (keyID === 39 || keyID === 68) { //right arrow or D key\n game.ss.isRightKey = true;\n e.preventDefault();\n }\n if (keyID === 40 || keyID === 83) { //down arrow or S key\n game.ss.isDownKey = true;\n e.preventDefault();\n }\n if (keyID === 37 || keyID === 65) { //left arrow or A key\n game.ss.isLeftKey = true;\n e.preventDefault();\n }\n if (keyID === 32) { //spacebar\n game.ss.isSpacebar = true;\n e.preventDefault();\n }\n}", "title": "" }, { "docid": "4ef4275c7f4b011418422a8eddaf155b", "score": "0.63616693", "text": "[symbols.keydown](event) {\n let handled;\n\n switch (event.key) {\n case ' ':\n this.click();\n handled = true;\n break;\n }\n\n // Prefer mixin result if it's defined, otherwise use base result.\n return handled || (super[symbols.keydown] && super[symbols.keydown](event));\n }", "title": "" }, { "docid": "70b507752983404da8ed1a5029529319", "score": "0.634744", "text": "processKeyDown(event) {\n this.activeKeys[event.code] = true;\n }", "title": "" }, { "docid": "ed9168f2ab5c60be7610ca1592b01843", "score": "0.632905", "text": "function onDocumentKeyDown( event ) {\n\n\t\t// If there's a condition specified and it returns false,\n\t\t// ignore this event\n\t\tif( typeof config.keyboardCondition === 'function' && config.keyboardCondition() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Remember if auto-sliding was paused so we can toggle it\n\t\tvar autoSlideWasPaused = autoSlidePaused;\n\n\t\tonUserInput( event );\n\n\t\t// Check if there's a focused element that could be using\n\t\t// the keyboard\n\t\tvar activeElementIsCE = document.activeElement && document.activeElement.contentEditable !== 'inherit';\n\t\tvar activeElementIsInput = document.activeElement && document.activeElement.tagName && /input|textarea/i.test( document.activeElement.tagName );\n\n\t\t// Disregard the event if there's a focused element or a\n\t\t// keyboard modifier key is present\n\t\tif( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;\n\n\t\t// While paused only allow resume keyboard events; 'b', '.''\n\t\tvar resumeKeyCodes = [66,190,191];\n\t\tvar key;\n\n\t\t// Custom key bindings for togglePause should be able to resume\n\t\tif( typeof config.keyboard === 'object' ) {\n\t\t\tfor( key in config.keyboard ) {\n\t\t\t\tif( config.keyboard[key] === 'togglePause' ) {\n\t\t\t\t\tresumeKeyCodes.push( parseInt( key, 10 ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( isPaused() && resumeKeyCodes.indexOf( event.keyCode ) === -1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar triggered = false;\n\n\t\t// 1. User defined key bindings\n\t\tif( typeof config.keyboard === 'object' ) {\n\n\t\t\tfor( key in config.keyboard ) {\n\n\t\t\t\t// Check if this binding matches the pressed key\n\t\t\t\tif( parseInt( key, 10 ) === event.keyCode ) {\n\n\t\t\t\t\tvar value = config.keyboard[ key ];\n\n\t\t\t\t\t// Callback function\n\t\t\t\t\tif( typeof value === 'function' ) {\n\t\t\t\t\t\tvalue.apply( null, [ event ] );\n\t\t\t\t\t}\n\t\t\t\t\t// String shortcuts to reveal.js API\n\t\t\t\t\telse if( typeof value === 'string' && typeof Reveal[ value ] === 'function' ) {\n\t\t\t\t\t\tReveal[ value ].call();\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggered = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// 2. System defined key bindings\n\t\tif( triggered === false ) {\n\n\t\t\t// Assume true and try to prove false\n\t\t\ttriggered = true;\n\n\t\t\tswitch( event.keyCode ) {\n\t\t\t\t// p, page up\n\t\t\t\tcase 80: case 33: navigatePrev(); break;\n\t\t\t\t// n, page down\n\t\t\t\tcase 78: case 34: navigateNext(); break;\n\t\t\t\t// h, left\n\t\t\t\tcase 72: case 37: navigateLeft(); break;\n\t\t\t\t// l, right\n\t\t\t\tcase 76: case 39: navigateRight(); break;\n\t\t\t\t// k, up\n\t\t\t\tcase 75: case 38: navigateUp(); break;\n\t\t\t\t// j, down\n\t\t\t\tcase 74: case 40: navigateDown(); break;\n\t\t\t\t// home\n\t\t\t\tcase 36: slide( 0 ); break;\n\t\t\t\t// end\n\t\t\t\tcase 35: slide( Number.MAX_VALUE ); break;\n\t\t\t\t// space\n\t\t\t\tcase 32: isOverview() ? deactivateOverview() : event.shiftKey ? navigatePrev() : navigateNext(); break;\n\t\t\t\t// return\n\t\t\t\tcase 13: isOverview() ? deactivateOverview() : triggered = false; break;\n\t\t\t\t// two-spot, semicolon, b, period, Logitech presenter tools \"black screen\" button\n\t\t\t\tcase 58: case 59: case 66: case 190: case 191: togglePause(); break;\n\t\t\t\t// f\n\t\t\t\tcase 70: enterFullscreen(); break;\n\t\t\t\t// a\n\t\t\t\tcase 65: if ( config.autoSlideStoppable ) toggleAutoSlide( autoSlideWasPaused ); break;\n\t\t\t\tdefault:\n\t\t\t\t\ttriggered = false;\n\t\t\t}\n\n\t\t}\n\n\t\t// If the input resulted in a triggered action we should prevent\n\t\t// the browsers default behavior\n\t\tif( triggered ) {\n\t\t\tevent.preventDefault && event.preventDefault();\n\t\t}\n\t\t// ESC or O key\n\t\telse if ( ( event.keyCode === 27 || event.keyCode === 79 ) && features.transforms3d ) {\n\t\t\tif( dom.overlay ) {\n\t\t\t\tcloseOverlay();\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoggleOverview();\n\t\t\t}\n\n\t\t\tevent.preventDefault && event.preventDefault();\n\t\t}\n\n\t\t// If auto-sliding is enabled we need to cue up\n\t\t// another timeout\n\t\tcueAutoSlide();\n\n\t}", "title": "" }, { "docid": "7e4f173d84025b6462c6c0c441096cc6", "score": "0.6324519", "text": "isKeyPressed(keyCode) {\n\n return this.mIsKeyPressed[keyCode];\n }", "title": "" }, { "docid": "eb947206c2248b582590577c0eeb8ebc", "score": "0.6313361", "text": "function onDocumentKeyDown( event ) {\n\n\t\t// If there's a condition specified and it returns false,\n\t\t// ignore this event\n\t\tif( typeof config.keyboardCondition === 'function' && config.keyboardCondition() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Remember if auto-sliding was paused so we can toggle it\n\t\tvar autoSlideWasPaused = autoSlidePaused;\n\n\t\tonUserInput( event );\n\n\t\t// Check if there's a focused element that could be using\n\t\t// the keyboard\n\t\tvar activeElementIsCE = document.activeElement && document.activeElement.contentEditable !== 'inherit';\n\t\tvar activeElementIsInput = document.activeElement && document.activeElement.tagName && /input|textarea/i.test( document.activeElement.tagName );\n\n\t\t// Disregard the event if there's a focused element or a\n\t\t// keyboard modifier key is present\n\t\tif( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;\n\n\t\t// While paused only allow \"unpausing\" keyboard events (b and .)\n\t\tif( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar triggered = false;\n\n\t\t// 1. User defined key bindings\n\t\tif( typeof config.keyboard === 'object' ) {\n\n\t\t\tfor( var key in config.keyboard ) {\n\n\t\t\t\t// Check if this binding matches the pressed key\n\t\t\t\tif( parseInt( key, 10 ) === event.keyCode ) {\n\n\t\t\t\t\tvar value = config.keyboard[ key ];\n\n\t\t\t\t\t// Callback function\n\t\t\t\t\tif( typeof value === 'function' ) {\n\t\t\t\t\t\tvalue.apply( null, [ event ] );\n\t\t\t\t\t}\n\t\t\t\t\t// String shortcuts to reveal.js API\n\t\t\t\t\telse if( typeof value === 'string' && typeof Reveal[ value ] === 'function' ) {\n\t\t\t\t\t\tReveal[ value ].call();\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggered = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// 2. System defined key bindings\n\t\tif( triggered === false ) {\n\n\t\t\t// Assume true and try to prove false\n\t\t\ttriggered = true;\n\n\t\t\tswitch( event.keyCode ) {\n\t\t\t\t// p, page up\n\t\t\t\tcase 80: case 33: navigatePrev(); break;\n\t\t\t\t// n, page down\n\t\t\t\tcase 78: case 34: navigateNext(); break;\n\t\t\t\t// h, left\n\t\t\t\tcase 72: case 37: navigateLeft(); break;\n\t\t\t\t// l, right\n\t\t\t\tcase 76: case 39: navigateRight(); break;\n\t\t\t\t// k, up\n\t\t\t\tcase 75: case 38: navigateUp(); break;\n\t\t\t\t// j, down\n\t\t\t\tcase 74: case 40: navigateDown(); break;\n\t\t\t\t// home\n\t\t\t\tcase 36: slide( 0 ); break;\n\t\t\t\t// end\n\t\t\t\tcase 35: slide( Number.MAX_VALUE ); break;\n\t\t\t\t// space\n\t\t\t\tcase 32: isOverview() ? deactivateOverview() : event.shiftKey ? navigatePrev() : navigateNext(); break;\n\t\t\t\t// return\n\t\t\t\tcase 13: isOverview() ? deactivateOverview() : triggered = false; break;\n\t\t\t\t// two-spot, semicolon, b, period, Logitech presenter tools \"black screen\" button\n\t\t\t\tcase 58: case 59: case 66: case 190: case 191: togglePause(); break;\n\t\t\t\t// f\n\t\t\t\tcase 70: enterFullscreen(); break;\n\t\t\t\t// a\n\t\t\t\tcase 65: if ( config.autoSlideStoppable ) toggleAutoSlide( autoSlideWasPaused ); break;\n\t\t\t\tdefault:\n\t\t\t\t\ttriggered = false;\n\t\t\t}\n\n\t\t}\n\n\t\t// If the input resulted in a triggered action we should prevent\n\t\t// the browsers default behavior\n\t\tif( triggered ) {\n\t\t\tevent.preventDefault && event.preventDefault();\n\t\t}\n\t\t// ESC or O key\n\t\telse if ( ( event.keyCode === 27 || event.keyCode === 79 ) && features.transforms3d ) {\n\t\t\tif( dom.overlay ) {\n\t\t\t\tcloseOverlay();\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoggleOverview();\n\t\t\t}\n\n\t\t\tevent.preventDefault && event.preventDefault();\n\t\t}\n\n\t\t// If auto-sliding is enabled we need to cue up\n\t\t// another timeout\n\t\tcueAutoSlide();\n\n\t}", "title": "" }, { "docid": "0b082d441dca9ecdcf65461d5a1aea4c", "score": "0.63030136", "text": "_keydown(event) {\n switch (event.key) {\n // Toggle for space and enter keys.\n case \" \" /* Space */:\n case \"Enter\" /* Enter */:\n event.preventDefault();\n this._toggle();\n break;\n default:\n return;\n }\n }", "title": "" }, { "docid": "a7d341623e810a042a77d87a8c483dd8", "score": "0.6300263", "text": "function handler(event) {\n if (codes.hasOwnProperty(event.keyCode)) {\n // If the event is keydown, set down to true. Else set to false.\n var down = event.type == \"keydown\";\n pressed[codes[event.keyCode]] = down;\n // We don't want the key press to scroll the browser window,\n // This stops the event from continuing to be processed\n event.preventDefault();\n }\n }", "title": "" }, { "docid": "11ea58073fa9b8fafe2533609cdd1d62", "score": "0.62564695", "text": "function handleKeyboard(event) {\n keysPressed[event.code] = (event.type == \"keydown\");\n }", "title": "" }, { "docid": "55d5a30a688c3f11459f04b3715b00f2", "score": "0.6253353", "text": "function keyUpHandler(e, but) {\r\n if(e.keyCode == 39 || e.keyCode == 68) {\r\n derechaP = false;\r\n }\r\n else if(e.keyCode == 37 || e.keyCode == 65) {\r\n izquierdaP = false;\r\n }\r\n else if(but == \"der\"){\r\n derechaP = false;\r\n } \r\n else if(but == \"iz\"){\r\n izquierdaP = false;\r\n }\r\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62508106", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "4720c71d72055b5a3a3592faca59bf64", "score": "0.6243452", "text": "keyDownHandler(event) {\n switch (event.key) {\n case(\"ArrowDown\"):\n // case(\"KeyS\"):\n this.input.down = true;\n break;\n case(\"ArrowUp\"):\n // case(\"KeyW\"):\n this.input.up = true;\n break;\n case(\"ArrowRight\"):\n // case(\"KeyD\"):\n this.input.right = true;\n break;\n case(\"ArrowLeft\"):\n // case(\"KeyA\"):\n this.input.left = true;\n break;\n }\n }", "title": "" }, { "docid": "3ecbd3bd172205668c01c8513724ccd7", "score": "0.62386185", "text": "[symbols.keydown](event) {\n let handled;\n\n switch (event.keyCode) {\n case 32: /* Space */\n this.click();\n handled = true;\n break;\n }\n\n // Prefer mixin result if it's defined, otherwise use base result.\n return handled || (super[symbols.keydown] && super[symbols.keydown](event));\n }", "title": "" }, { "docid": "ba6071f448e124e84ca53c5dd6a2ccc2", "score": "0.62351745", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n }", "title": "" }, { "docid": "6e3bb09a9d0bb155559e36bd62655405", "score": "0.62076867", "text": "function onkeydown(event) {\n KeysPressed[event.key] = true;\n}", "title": "" }, { "docid": "29114feebe8d31d926bd5e9cdeff1376", "score": "0.619355", "text": "function keyIsDown(code) {\n if (keyPressed.has(code))\n return true;\n}", "title": "" }, { "docid": "34a11a272119ba1edc689d7ac80d3fd0", "score": "0.61744845", "text": "function userInputDown(e) {\n switch (e.keyCode) {\n case KEY_LEFT:\n case KEY_UP:\n case KEY_RIGHT:\n case KEY_DOWN:\n if (inputEnabled) {\n JayWalker.userKeys[e.keyCode] = true;\n }\n break;\n default:\n // no op\n break;\n }\n }", "title": "" }, { "docid": "6ed574c115fbb7b524601c8d5ee67e4b", "score": "0.6170456", "text": "function onKeyDown(event) {\n keys[String.fromCharCode(event.keyCode)] = true;\n}", "title": "" }, { "docid": "7f5b9f951f22041c718c351c45d873d4", "score": "0.6163622", "text": "function isKeyPressed(event){\n if(event.ctrlKey){\n clicked_event = event;\n edit_master(event);\n }\n}", "title": "" }, { "docid": "2462c06098571c5d4f89d22c8e9abe12", "score": "0.6124618", "text": "function event_teclado() {\n agregarEvento(document, \"keydown\", function(e) {\n //Ponemos en true la tecla presionada\n teclado[e.keyCode] = true;\n //console.log(e.keyCode);\n });\n agregarEvento(document, \"keyup\", function(e) {\n //Ponemos en false la tecla que dejo de ser presionado\n teclado[e.keyCode] = false;\n });\n\n\n function agregarEvento(elemento, nombreEvento, funcion) {\n if (elemento.addEventListener) {\n //Navegadores de verdad\n elemento.addEventListener(nombreEvento, funcion, false);\n } else if (elemento.attchEvent) {\n //intenet explorer\n elemento.attchEvent(nombreEvento, funcion);\n }\n\n }\n\n}", "title": "" }, { "docid": "8d152871d8fc6cc186426f81332b011c", "score": "0.6118845", "text": "function areDownKeys(){for(var key in downKeys){if(downKeys.hasOwnProperty(key)&&downKeys[key]===true){return true;}}return false;}", "title": "" }, { "docid": "015ae32b3348e65eda5ac3af464c1d15", "score": "0.6099007", "text": "function onKeyDown(event) {\n if (window.event) {\n event = window.event;\n }\n\n var keyCode = typedCode(event);\n this.ignore = event.altKey || event.ctrlKey || inArray(keyCode, JST_IGNORED_KEY_CODES);\n\n //Check for extra function on keydown\n if (this.mask.keyDownFunction != null) {\n var ret = invokeAsMethod(this, this.mask.keyDownFunction, [event, this.mask]);\n if (ret == false) {\n return preventDefault(event);\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "8147d1d04a1e2e2eadc1781fcff35859", "score": "0.6094056", "text": "function handleKeyDown(event) {\n\t\t\n currentlyPressedKeys[event.keyCode] = true;\n }", "title": "" }, { "docid": "0f968a026ccf4e7ca12ff8ebffae91f8", "score": "0.6077985", "text": "function handlePointerDown(){\nhadKeyboardEvent=false;\n}", "title": "" }, { "docid": "61e8da5905dce8a2e36325b2964603a6", "score": "0.6072892", "text": "[internal.keydown](/** @type {KeyboardEvent} */ event) {\n let handled;\n /** @type {any} */\n const list = this[internal.ids].list;\n\n switch (event.key) {\n case \"ArrowDown\":\n if (this.opened) {\n handled = event.altKey\n ? this[internal.goEnd]()\n : this[internal.goDown]();\n }\n break;\n\n case \"ArrowUp\":\n if (this.opened) {\n handled = event.altKey\n ? this[internal.goStart]()\n : this[internal.goUp]();\n }\n break;\n\n case \"PageDown\":\n if (this.opened) {\n handled = list.pageDown && list.pageDown();\n }\n break;\n\n case \"PageUp\":\n if (this.opened) {\n handled = list.pageUp && list.pageUp();\n }\n break;\n }\n\n // Prefer mixin result if it's defined, otherwise use base result.\n return (\n handled || (super[internal.keydown] && super[internal.keydown](event))\n );\n }", "title": "" }, { "docid": "38522ea4a6764d9366f62eb8147bad14", "score": "0.60726845", "text": "keyDown(event){\n switch (event.keyCode) {\n case this.keys.up:\n this.upPressed = false;\n console.log(this.upPressed);\n break;\n case this.keys.down:\n this.downPressed = false;\n console.log(this.downPressed);\n break;\n default: return;\n }\n }", "title": "" }, { "docid": "926587f4d786da3430b8b08901299af2", "score": "0.6066491", "text": "function isPressed(keyCode) {\r\n if (typeof(keyCode)=='string') {\r\n keyCode = code(keyCode);\r\n }\r\n return index(_downKeys, keyCode) != -1;\r\n }", "title": "" }, { "docid": "ddcf9f4bde8d49dc1e617749ae6bbcfa", "score": "0.6065284", "text": "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "title": "" }, { "docid": "ddcf9f4bde8d49dc1e617749ae6bbcfa", "score": "0.6065284", "text": "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "title": "" }, { "docid": "ddcf9f4bde8d49dc1e617749ae6bbcfa", "score": "0.6065284", "text": "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "title": "" }, { "docid": "26b0ba7076e747ea0e35e11785a7d9de", "score": "0.6053825", "text": "function touchdown(event) {\n var keyCode = event;\n if (KEY_CODES[keyCode]) {\n KEY_STATUS[KEY_CODES[keyCode]] = true;\n }\n }", "title": "" }, { "docid": "82032b9aa962b3cc696d39c6343cddae", "score": "0.6043132", "text": "function keydownhandler(event) {\n if(event.keyCode == 68) {\n //rightpressed = true;\n\t\tcollision.cpm(event.keyCode);\n }\n else if(event.keyCode == 65) {\n //leftpressed = true;\n\t\tcollision.cpm(event.keyCode);\n }\n else if(event.keyCode == 83) {\n \t//downpressed = true;\n\t\tcollision.cpm(event.keyCode);\n }\n else if(event.keyCode == 87) {\n \t//uppressed = true;\n\t\tcollision.cpm(event.keyCode);\n }\n}", "title": "" }, { "docid": "9d68693413bc112f8d36aa55a79d5582", "score": "0.60275686", "text": "function isPressed(keyCode) {\n if (typeof(keyCode) == 'string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "title": "" }, { "docid": "bab847e444a957d0f7c0f19857df6744", "score": "0.6026474", "text": "function checkKeyPress (event){\n\tvar chCode = ('charCode' in event) ? event.charCode : event.keyCode;\n\t\n\tswitch(chCode){\n\t\tcase 100: destra(); break;\n\t\tcase 115: giu(); break;\n\t\tcase 97: sinistra(); break;\n\t\tcase 119: su(); break;\n\t}\n //alert (\"The Unicode character code is (key press): \" + chCode); \n}", "title": "" }, { "docid": "e27161998acff3cff3ec8f29f05342d4", "score": "0.60215455", "text": "function onKeyDown(evt) {\n\tif (!evt)\n\t\tevt = this;\n\n\tif ((evt.target.nodeName === 'INPUT') || (evt.target.nodeName === 'SELECT') || (evt.target.nodeName === 'TEXTAREA'))\n\t\treturn false;\n\n\tvar correct = true,\n\t\thotkey;\n\tfor (var h in hotkeys) {\n\t\thotkey = hotkeys[h];\n\t\tfor (var c in hotkey.codes) {\n\t\t\tif (evt.keyCode === hotkey.codes[c]) {\n\t\t\t\tfor (var m in hotkey.modif) {\n\t\t\t\t\tcorrect = (evt[m] === hotkey.modif[m]) ? correct : false;\n\t\t\t\t}\n\t\t\t\tif (correct) {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\treturn (typeof hotkey.action === 'function') ? hotkey.action.call() : eval(hotkey.action);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d3e0a09642aaca11170008b1a666d697", "score": "0.6019292", "text": "function handleKeyDown(e){\r\n\t\t//if we are checking for a restart\r\n\t\tif(checkRestart){checkRestart = false;Director.publish('okToRestart');return false;}\r\n //cross browser compatibility\t\t\r\n if(!e){ var e = window.event; }\r\n\t\tswitch(e.keyCode) {\r\n\t\t\tcase 17:\r\n\t\t\t\tkeyCtrl = true;\r\n\t\t\t\tbreak;\r\n case 37:\r\n keyLeft = true;\r\n break;\r\n case 38:\r\n keyUp = true;\r\n break;\r\n case 39:\r\n keyRight = true;\r\n break;\r\n case 40:\r\n keyDown = true;\r\n break;\t \r\n }\r\n }", "title": "" }, { "docid": "9e2f0be202859d2d787835cc033e931c", "score": "0.60060215", "text": "function checkKeyPressDown(e)\r\n{\r\n if(!startNewGame && !inDialogue)\r\n {\r\n \te.preventDefault();\r\n if (e.which == 65 || e.keyCode == 65 //|| \r\n// \te.which == 37 || e.keyCode == 37\r\n\t\t\t\t\t\t)\r\n {\r\n PLAYER_ONE.moveLeft();\r\n leftKey = true;\r\n }\r\n else\r\n {\r\n if (e.which == 68 || e.keyCode == 68 //|| \r\n// \te.which == 39 || e.keyCode == 39\r\n\t\t\t\t\t\t)\r\n {\r\n PLAYER_ONE.moveRight();\r\n rightKey = true;\r\n }\r\n }\r\n if (e.which == 32 || e.keyCode == 32)\r\n {\r\n //e.preventDefault();\r\n\t \tattackKey = true;\r\n PLAYER_ONE.attack();\r\n }\r\n if (e.which == 83 || e.keyCode == 83 //|| \r\n// \te.which == 40 || e.keyCode == 40\r\n\t\t\t\t\t\t)\r\n {\r\n PLAYER_ONE.playerblock();\r\n blockKey = true;\r\n }\r\n if (e.which == 87 || e.keyCode == 87 //|| \r\n// \te.which == 38 || e.keyCode == 38\r\n\t\t\t\t\t\t)\r\n {\r\n PLAYER_ONE.jump();\r\n jumpKey = true;\r\n }\r\n \r\n if (e.which == 69 || e.keyCode == 69)\r\n {\r\n\t\t\tplayerInput(ifCollision().charName, determineNPC());\r\n }\r\n }\r\n}", "title": "" }, { "docid": "45652c4442b5252723fd6160e9d61734", "score": "0.6005529", "text": "function keyDownHandler(e)\r\n{\r\n if(e.keyCode == 39 && direction != \"LEFT\" && direction != \"\" && c == false) {//daca nu a mai fost apasata vreo tasta in frame-ul respectiv atunci putem apasa alta tasta\r\n //evitam ca snake-ul sa ia 2 directii diferite in acelasi frame\r\n direction = \"RIGHT\";\r\n c = true;//marcam daca a fost apasata o tasta in frame-ul respectiv\r\n }\r\n else if(e.keyCode == 37 && direction != \"RIGHT\" && c== false) {//left\r\n direction = \"LEFT\";\r\n c = true;\r\n }\r\n else if(e.keyCode == 40 && direction != \"UP\" && c == false){\r\n direction = \"DOWN\";\r\n c = true;\r\n }\r\n else if(e.keyCode == 38 && direction != \"DOWN\" && c == false){\r\n direction = \"UP\";\r\n c = true;\r\n }\r\n}", "title": "" }, { "docid": "4f36de4b3efa92504ae8df1f23cdc13b", "score": "0.6003255", "text": "function handleKeyDown(event) {\n currentlyPressedKeys[event.keyCode] = true;\n}", "title": "" }, { "docid": "d54c2ba284d18fcfb6414519d3073d00", "score": "0.59886354", "text": "function isPressed(yes){ \n if(yes.keyCode == 39){ //if right arrow is pressed, go right\n // console.log(\"true\");\n rightGo = true;\n }else if(yes.keyCode == 37){ // if left arrow is pressed, go left\n // console.log(\"true\");\n leftGo = true;\n }else if(yes.keyCode == 38){ //if up arrow is pressed, go up\n upGo = true;\n }else if(yes.keyCode == 40){ // if down arrow is pressed, go down\n downGo = true;\n }\n}", "title": "" }, { "docid": "3b0019816530991e477ce2aac38e48e2", "score": "0.5987465", "text": "function keyuphandler (event) {\n if (event.keyCode == 37) {\n leftkeydown = false;\n }\n if (event.keyCode == 39) {\n rightkeydown = false;\n } \n if (event.keyCode == 32) {\n spacekeydown = false;\n } \n}", "title": "" }, { "docid": "337934328f19a4ab9d2e30f3be2af821", "score": "0.59677845", "text": "function handleKeyDown(event) {\n\t\tcurrentlyPressedKeys[event.keyCode] = true;\n\t}", "title": "" }, { "docid": "4e1250f811ad6c56a56651579fbee23b", "score": "0.59665704", "text": "onKeyEvent(event) {\n if(this.gameStart === false){\n if(event.keyCode === KEY_UP){\n // Start the game\n this.gameStart = true\n }\n } else {\n // Move Bird\n this.bird.onKeyEvent(event)\n }\n }", "title": "" }, { "docid": "e40586520c992dd90c8710a49f4ce55f", "score": "0.5965721", "text": "function handleKeyDown(event) {\n currentlyPressedKeys[event.keyCode] = true;\n }", "title": "" }, { "docid": "b833587bccb04011c39cc311ff728de8", "score": "0.5958146", "text": "keyPressed(key) {\n\n if (this.keys[key] != State.Down) {\n\n this.anyPressed = true;\n this.keys[key] = State.Pressed;\n }\n \n\n return this.prevent[key];\n }", "title": "" }, { "docid": "901329003490b1d4029aabaaf93dccf9", "score": "0.59571636", "text": "function keyDown (event) {\r\n var key = keyMap[event.keyCode]\r\n state.pressedKeys[key] = true\r\n}", "title": "" }, { "docid": "566c29850ab90dbf26dd81fa81579ecc", "score": "0.5955621", "text": "function movekeydown(event) {\n if (event.keyCode == 37) {\n leftpressed = true;\n }\n if (event.keyCode == 39) {\n rightpressed = true;\n }\n if (event.keyCode == 38) {\n uppressed = true;\n }\n if (event.keyCode == 40) {\n downpressed = true;\n }\n}", "title": "" }, { "docid": "86df780fc9e3dc6da2766676cf1712aa", "score": "0.5941081", "text": "function checkKeyDown(e) {\r\n const evt = e.keyCode || e.charCode;\r\n if ((evt <= 40 && evt >= 37) || evt == 36 || evt == 35)\r\n event.preventDefault();\r\n}", "title": "" }, { "docid": "b11bb2954f9884b93f0b3821026212f7", "score": "0.5933567", "text": "function doKeyDown(event) {\n\n if (m_bGameStatus.started && !m_bGameStatus.isPaused)\n {\n if(m_bGameStatus.single)\n keyBoardDownSingle(event);\n \n else if (m_bGameStatus.multi)\n keyBoardDownMulti(event);\n \n if(event.keyCode == m_iKeyId.o) // 'o' was pressed\n m_iBallMax++;\n \n if(event.keyCode == m_iKeyId.l && --m_iBallMax < 1) // 'l' was pressed\n m_iBallMax = 1;\n \n if(event.keyCode == m_iKeyId.h && m_iBalls.length < m_iBallMax)\n m_iBalls.push(makeNewBall());\n }\n \n event.preventDefault();\n return false;\n}", "title": "" }, { "docid": "63afd520639e4ad431c01256e8568ef3", "score": "0.5933312", "text": "function keyVlidation(char, key) {\n console.log('the text char is = ' + char)\n console.log('the pressed key is = ' + key)\n if ( char == key) {\n console.log('correct')\n return true\n } else { return false}\n}", "title": "" }, { "docid": "e7f17dd673bed2da8087411988f80d98", "score": "0.59310055", "text": "function teclaPress (event) {\n if(event.key==='a') {\n alert('a')\n } else {\n alert ('outra coisa')\n }\n}", "title": "" }, { "docid": "db0ed79a62ad96c013d22097a54fc1a7", "score": "0.5928828", "text": "function checkKey(e) {\n\t\t\te = e || window.event;\n\n\t\t\tif (e.keyCode == '38') {\n\t\t\t\t//up arrorw\n\t\t\t\tconsole.log('up arrow pressed');\n\t\t\t}\n\t\t\telse if (e.keyCode == '40') {\n\t\t\t\t//down arrow \n\t\t\t\tconsole.log('down arrow pressed');\n\t\t\t}\n\t\t\telse if (e.keyCode == '37') {\n\t\t\t\t//left arrow \n\t\t\t\tconsole.log('left arrow pressed');\n\t\t\t}\n\t\t\telse if (e.keyCode == '39') {\n\t\t\t\t//right arrow \n\t\t\t\tconsole.log('right arrow pressed');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "37100f5c929d3fa7b34c6fd17a4f58ed", "score": "0.5925038", "text": "function onDocumentKeyDown( event ) {\n\n\t\tonUserInput( event );\n\n\t\t// Check if there's a focused element that could be using\n\t\t// the keyboard\n\t\tvar activeElement = document.activeElement;\n\t\tvar hasFocus = !!( document.activeElement && ( document.activeElement.type || document.activeElement.href || document.activeElement.contentEditable !== 'inherit' ) );\n\n\t\t// Disregard the event if there's a focused element or a\n\t\t// keyboard modifier key is present\n\t\tif( hasFocus || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;\n\n\t\t// While paused only allow \"unpausing\" keyboard events (b and .)\n\t\tif( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar triggered = false;\n\n\t\t// 1. User defined key bindings\n\t\tif( typeof config.keyboard === 'object' ) {\n\n\t\t\tfor( var key in config.keyboard ) {\n\n\t\t\t\t// Check if this binding matches the pressed key\n\t\t\t\tif( parseInt( key, 10 ) === event.keyCode ) {\n\n\t\t\t\t\tvar value = config.keyboard[ key ];\n\n\t\t\t\t\t// Callback function\n\t\t\t\t\tif( typeof value === 'function' ) {\n\t\t\t\t\t\tvalue.apply( null, [ event ] );\n\t\t\t\t\t}\n\t\t\t\t\t// String shortcuts to reveal.js API\n\t\t\t\t\telse if( typeof value === 'string' && typeof Reveal[ value ] === 'function' ) {\n\t\t\t\t\t\tReveal[ value ].call();\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggered = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// 2. System defined key bindings\n\t\tif( triggered === false ) {\n\n\t\t\t// Assume true and try to prove false\n\t\t\ttriggered = true;\n\n\t\t\tswitch( event.keyCode ) {\n\t\t\t\t// p, page up\n\t\t\t\tcase 80: case 33: navigatePrev(); break;\n\t\t\t\t// n, page down\n\t\t\t\tcase 78: case 34: navigateNext(); break;\n\t\t\t\t// h, left\n\t\t\t\tcase 72: case 37: navigateLeft(); break;\n\t\t\t\t// l, right\n\t\t\t\tcase 76: case 39: navigateRight(); break;\n\t\t\t\t// k, up\n\t\t\t\tcase 75: case 38: navigateUp(); break;\n\t\t\t\t// j, down\n\t\t\t\tcase 74: case 40: navigateDown(); break;\n\t\t\t\t// home\n\t\t\t\tcase 36: slide( 0 ); break;\n\t\t\t\t// end\n\t\t\t\tcase 35: slide( Number.MAX_VALUE ); break;\n\t\t\t\t// space\n\t\t\t\tcase 32: isOverview() ? deactivateOverview() : event.shiftKey ? navigatePrev() : navigateNext(); break;\n\t\t\t\t// return\n\t\t\t\tcase 13: isOverview() ? deactivateOverview() : triggered = false; break;\n\t\t\t\t// b, period, Logitech presenter tools \"black screen\" button\n\t\t\t\tcase 66: case 190: case 191: togglePause(); break;\n\t\t\t\t// f\n\t\t\t\tcase 70: enterFullscreen(); break;\n\t\t\t\tdefault:\n\t\t\t\t\ttriggered = false;\n\t\t\t}\n\n\t\t}\n\n\t\t// If the input resulted in a triggered action we should prevent\n\t\t// the browsers default behavior\n\t\tif( triggered ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// ESC or O key\n\t\telse if ( ( event.keyCode === 27 || event.keyCode === 79 ) && features.transforms3d ) {\n\t\t\tif( dom.preview ) {\n\t\t\t\tclosePreview();\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoggleOverview();\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// If auto-sliding is enabled we need to cue up\n\t\t// another timeout\n\t\tcueAutoSlide();\n\n\t}", "title": "" }, { "docid": "d942ffe0779f09787c5fdb30f295e606", "score": "0.59224683", "text": "function onKeyDown(evt) {\n if (evt.keyCode == 39)\nrightDown = true;\n else if (evt.keyCode == 37) leftDown = true;\n else if(evt.keyCode == 80){ //če pritisnemo P se igra vstavi\nif(start){\n pause_game();\n }\n }\n\n}", "title": "" }, { "docid": "f437bd129279e27d3c4f2c593483273b", "score": "0.5920898", "text": "function checkKey(e) {\n switch (e.keyCode) {\n case 83: pressedKey = 'S'; break;\n case 77: pressedKey = 'M'; break;\n case 76: pressedKey = 'L'; break;\n case 82: pressedKey = 'R'; break;\n case 84: pressedKey = 'T'; break;\n case 79: pressedKey = 'O'; break;\n case 80: pressedKey = 'P'; break;\n }\n}", "title": "" }, { "docid": "049898fd7704c91700598d2e3950dfd7", "score": "0.5912458", "text": "function keypressSingle(key){\r\n if(keypress(key)){\r\n let evt = currentKeys[charCodeOf(key)];\r\n return !(evt.shiftKey || evt.ctrlKey || evt.altKey);\r\n }else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "947f3c3a5feac51548569b816b2800e5", "score": "0.5911643", "text": "function catena_OnKeyDown(evt)\n{\n\treturn oCatenaApp.onkeydown(evt);\n}", "title": "" }, { "docid": "7421c265c69d55c10847b7461ba83a80", "score": "0.5907292", "text": "function areDownKeys() {\n for (var key in downKeys) {\n if (downKeys[key] === true ) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "478f0559f83f210a4bcd51e4ceafb689", "score": "0.590667", "text": "onTriggerKeydown(_, e) {\n let onkeydown = this.get('onkeydown');\n if (onkeydown && onkeydown(this.get('publicAPI'), e) === false) {\n return false;\n }\n if (e.ctrlKey || e.metaKey) {\n return false;\n }\n if ((e.keyCode >= 48 && e.keyCode <= 90) // Keys 0-9, a-z\n || this._isNumpadKeyEvent(e)) {\n this.get('triggerTypingTask').perform(e);\n } else if (e.keyCode === 32) { // Space\n return this._handleKeySpace(e);\n } else {\n return this._routeKeydown(e);\n }\n }", "title": "" }, { "docid": "60c36f30994a8124442531d0da933d06", "score": "0.59044", "text": "handleOnKeyDown(event) {}", "title": "" }, { "docid": "4da03d6fc1c7e61f9d2adc7e2fce97a5", "score": "0.5898149", "text": "keyUpHandler(event) {\n switch (event.key) {\n case(\"ArrowDown\"):\n this.input.down = false;\n break;\n case(\"ArrowUp\"):\n this.input.up = false;\n break;\n case(\"ArrowRight\"):\n this.input.right = false;\n break;\n case(\"ArrowLeft\"):\n this.input.left = false;\n break;\n }\n }", "title": "" }, { "docid": "699da16a0fe81dff270f2db0e5962a61", "score": "0.5895564", "text": "function checkHotkey(e) {\n var key = (window.event) ? event : e;\n //alert(key.keyCode);\n switch(key.keyCode) {\n case 32:\n flip();\n break;\n case 37:\n prev();\n break;\n case 39:\n next();\n break;\n case 40:\n case 38:\n flip();\n break;\n }\n}", "title": "" }, { "docid": "916c095f0ac16ef45a66e6427d260c54", "score": "0.58912146", "text": "function inputButtonDown(e)\n{\n\tvar code = e.keyCode\n\n\tswitch (code) \n\t{\n\t\tcase 37: // left arrow\n\t\tcase 65: // A\n\t\t\tmoveLeft = true\n\t\t\tbreak\n\t\tcase 38: // up arrow\n\t\tcase 87: // W\n\t\t\tjump = true\n\t\t\tbreak\n\t\tcase 39: // right arrow\n\t\tcase 68: // D\n\t\t\tmoveRight = true\n\t\t\tbreak\n\t\tcase 40: // down arrow\n\t\tcase 83: // S\n\t\t\tbreak\n\t\tdefault: \n\t\t\tconsole.info(\"Unhandled key: \" + code)\n\t\t\tbreak\n\t}\n}", "title": "" }, { "docid": "1b72224c8c80f9c925d219a814ff57cb", "score": "0.58819723", "text": "function keyDown(e) {\n // If left arrow key or a is pressed set left to true\n if (e.keyCode == 37 || e.keyCode == 65) {\n left = true;\n }\n // If the right arrow key or d is pressed set right to true\n else if (e.keyCode == 39 || e.keyCode == 68) {\n right = true;\n }\n // If the up arrow key or w is pressed set up to true\n if (e.keyCode == 38 || e.keyCode == 87) {\n up = true;\n }\n // If the down arrow key or s is pressed set down to true\n else if (e.keyCode == 40 || e.keyCode == 83) {\n down = true\n }\n }", "title": "" }, { "docid": "91506b79b3c21927e63e23818bc34785", "score": "0.5880438", "text": "function keyUp(event)\n {\n pressedKey[event.keyCode] = false;\n }", "title": "" }, { "docid": "dc753d57df228e95642bbc6a57160df9", "score": "0.5876422", "text": "function keyListener(number){\n number.onkeydown = function(e) {\n if(!((e.keyCode > 95 && e.keyCode < 106)\n || (e.keyCode > 47 && e.keyCode < 58) \n || e.keyCode == 8)) {\n return false;\n }\n }\n}", "title": "" }, { "docid": "eae8111fe5608dff44dce447c11b4255", "score": "0.58683246", "text": "function onkey(event) {\n\n\t\t\t\t\tif (!(event.metaKey || event.altKey || event.ctrlKey)) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\n\t\t\t if (event.charCode == 'z'.charCodeAt(0)) { // z\n\t\t\t \tcontrols.zeroSensor();\n\t\t\t } else if (event.charCode == 'f'.charCodeAt(0)) { // f\n\t\t\t \teffect.setFullScreen( true );\n\t\t\t } else if (event.charCode == 'm'.charCodeAt(0)) { // f\n\t\t\t \tmovable = !movable;\n\t\t\t \tif(!movable){\n\t\t\t \t\thitSymbol = false;\n\t\t\t \t}\n\t\t\t \tconsole.log(\"movable is \" + movable);\n\t\t\t }\n\t\t\t}", "title": "" }, { "docid": "efb02c447451293d5ee00e4b7a0744c1", "score": "0.5867171", "text": "keyDownListener(e) { \n e.preventDefault(); \n if (!this.gameOver) { \n if (e.code === 'Space') this.dino.toggleDirection(`${e.code}`);\n }\n }", "title": "" }, { "docid": "0f6fd1d1c552ddc876fe0c751d66580d", "score": "0.58612376", "text": "function isEventHandled(value){return value==='handled'||value===true;}", "title": "" }, { "docid": "544acbeb903c6911276af68aa8551d3b", "score": "0.58575517", "text": "function isKeyEvent(event) {\n return (/^key/.test(event.type)\n );\n}", "title": "" }, { "docid": "34d6251aa0365662c3640275c2161af2", "score": "0.58569956", "text": "function checkReturn(event) {\n\t console.log(event.charCode);\n}", "title": "" }, { "docid": "63902abd0003a55266a1c76c888105ec", "score": "0.5853704", "text": "function keyDownHandler(e) {\n if(e.key == \"Right\" || e.key == \"ArrowRight\") {\n rightPressed = true;\n console.log('right')\n }\n else if(e.key == \"Left\" || e.key == \"ArrowLeft\") {\n leftPressed = true;\n console.log('right n left')\n }\n}", "title": "" }, { "docid": "00d0dee918305961f178c8ff40fb2db9", "score": "0.58530563", "text": "_keydown(event) {\n switch (event.keyCode) {\n // Toggle for space and enter keys.\n case SPACE:\n case ENTER:\n if (!hasModifierKey(event)) {\n event.preventDefault();\n this._toggle();\n }\n break;\n default:\n if (this.panel.accordion) {\n this.panel.accordion._handleHeaderKeydown(event);\n }\n return;\n }\n }", "title": "" }, { "docid": "8a40cce445ddd3cf6292cf76ed4b4e59", "score": "0.58494514", "text": "function isKeyboardClick(keyCode) {\n return keyCode === ENTER || keyCode === SPACE;\n}", "title": "" }, { "docid": "8a40cce445ddd3cf6292cf76ed4b4e59", "score": "0.58494514", "text": "function isKeyboardClick(keyCode) {\n return keyCode === ENTER || keyCode === SPACE;\n}", "title": "" }, { "docid": "61bbf0e1865d77324aedb5cfd2e83a7e", "score": "0.58481175", "text": "function onKeyDown(event) {\n if (window.event) {\n event = window.event;\n }\n\n this.keyCode = typedCode(event);\n\n //Check for extra function on keydown\n if (this.mask.keyDownFunction != null) {\n var ret = invokeAsMethod(this, this.mask.keyDownFunction, [event, this.mask]);\n if (ret == false) {\n return preventDefault(event);\n }\n }\n }", "title": "" }, { "docid": "163c90032de7cfd8e8fa2f4c15424b40", "score": "0.58472204", "text": "function keyuphandler(event) {\n if(event.keyCode == 68) {\n //rightpressed = true;\n\t\t//collision.cpm(event.keyCode);\n }\n else if(event.keyCode == 65) {\n //leftpressed = true;\n\t\t//collision.cpm(event.keyCode);\n }\n else if(event.keyCode == 83) {\n \t//downpressed = true;\n\t\t//collision.cpm(event.keyCode);\n }\n else if(event.keyCode == 87) {\n \t//uppressed = true;\n\t\t//collision.cpm(event.keyCode);\n }\n}", "title": "" }, { "docid": "922f833e9af9ac08a9a4cc237a205bca", "score": "0.5843373", "text": "get isEvent() {\n return true;\n }", "title": "" } ]
182a1ad3203c89022fc9b5aaac4aaa6f
Find out state of hands
[ { "docid": "f69b6e0257e148f0250842ff84587a69", "score": "0.5909634", "text": "function updateHandState(handState, hand) {\n switch (handState) {\n case 'closed':\n drawHand(hand, 1, 255);\n break;\n\n case 'open':\n drawHand(hand, 0, 255);\n break;\n\n case 'lasso':\n drawHand(hand, 0, 255);\n break;\n\n // Created new state for clapping\n case 'clapping':\n drawHand(hand, 1, 'red');\n }\n}", "title": "" } ]
[ { "docid": "7d85a8bb5082aa1aa939356fe3f14e97", "score": "0.6680085", "text": "getStates() {\n /**\n * Handles extra calculations for weboji morphs\n */\n const morphs = this.data.morphs\n const state = this.data.state || {}\n\n // Smiles\n state.smileRight =\n morphs[0] > this.handsfree.config.weboji.morphs.threshold.smileRight\n state.smileLeft =\n morphs[1] > this.handsfree.config.weboji.morphs.threshold.smileLeft\n state.smile = state.smileRight && state.smileLeft\n state.smirk =\n (state.smileRight && !state.smileLeft) ||\n (!state.smileRight && state.smileLeft)\n state.pursed =\n morphs[7] > this.handsfree.config.weboji.morphs.threshold.mouthRound\n\n // Eyebrows\n state.browLeftUp =\n morphs[4] > this.handsfree.config.weboji.morphs.threshold.browLeftUp\n state.browRightUp =\n morphs[5] > this.handsfree.config.weboji.morphs.threshold.browRightUp\n state.browsUp =\n morphs[4] > this.handsfree.config.weboji.morphs.threshold.browLeftUp &&\n morphs[5] > this.handsfree.config.weboji.morphs.threshold.browLeftUp\n\n state.browLeftDown =\n morphs[2] > this.handsfree.config.weboji.morphs.threshold.browLeftDown\n state.browRightDown =\n morphs[3] > this.handsfree.config.weboji.morphs.threshold.browRightDown\n state.browsDown =\n morphs[2] > this.handsfree.config.weboji.morphs.threshold.browLeftDown &&\n morphs[3] > this.handsfree.config.weboji.morphs.threshold.browLeftDown\n\n state.browsUpDown =\n (state.browLeftDown && state.browRightUp) ||\n (state.browRightDown && state.browLeftUp)\n\n // Eyes\n state.eyeLeftClosed =\n morphs[8] > this.handsfree.config.weboji.morphs.threshold.eyeLeftClosed\n state.eyeRightClosed =\n morphs[9] > this.handsfree.config.weboji.morphs.threshold.eyeRightClosed\n state.eyesClosed = state.eyeLeftClosed && state.eyeRightClosed\n\n // Mouth\n state.mouthClosed = morphs[6] === 0\n state.mouthOpen =\n morphs[6] > this.handsfree.config.weboji.morphs.threshold.mouthOpen\n\n return state\n }", "title": "" }, { "docid": "0c88cceca50edf4bd12692287d028c33", "score": "0.6266799", "text": "function handAssessor(handOf5) {\n\tvar hasAnyHand = false; // Used to track if there is a winning hand or not.\n\n\t/*\n\t * Helper function for sorting properly.\n\t */\n\tfunction sortNumber(a,b) {\n\t return a - b;\n\t}\n\n\t/*\n\t * Sort a hand with given key.\n\t */\n\tfunction getSortedArray(suitOrRank) {\n\t\tvar array = [];\n\n\t\tfor (var i = 0; i < handOf5.length; i++) {\n\t\t\tif (suitOrRank == \"rank\") array.push(parseInt(handOf5[i].numericRank()));\n\t\t\telse if (suitOrRank == \"suit\") array.push(handOf5[i].suit);\n\t\t}\n\t\tarray.sort(sortNumber);\n\n\t\tconsole.log(array);\n\t\treturn array;\n\t}\n\n\tvar sortedRanks = getSortedArray(\"rank\"); // Sorted ranks\n\tvar sortedSuits = getSortedArray(\"suit\"); // Sorted suits.\n\n\t/*\n\t * Calculate how many duplicates of a value there are.\n\t */\n\tfunction hasDuplicates(array, value) {\n\t\tvar dupCount = 0;\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tif (array[i] == value) dupCount++; \n\t\t}\n\t\treturn dupCount;\n\t}\n\n\t/*\n\t * Check if a pair exists based on desired count.\n\t */\n\tfunction hasPair(value) {\n\t\tfor (var i = 0; i < sortedRanks.length; i++) {\n\t\t\tif (hasDuplicates(sortedRanks, sortedRanks[i]) == value) {\n\t\t\t\thasAnyHand = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/*\n\t * Check for pair of 2\n\t */\n\tfunction isTwoPair() {\n\t\treturn hasPair(2);\n\t}\n\n\t/*\n\t * Check for pair of 3\n\t */\n\tfunction isThreePair() {\n\t\treturn hasPair(3);\n\t}\n\n\t/*\n\t * Check for pair of 4\n\t */\n\tfunction isFourPair() {\n\t\treturn hasPair(4);\n\t}\n\n\t/*\n\t * Check for a flush\n\t */\n\tfunction isFlush() {\n\t\tif (hasDuplicates(sortedSuits, sortedSuits[0]) == 5) {\n\t\t\thasAnyHand = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/*\n\t * Check for a full house\n\t */\n\tfunction isFullHouse() {\n\t\tif (isTwoPair() && isThreePair()) {\n\t\t\thasAnyHand = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/*\n\t * Check for a straight\n\t */\n\tfunction isStraight() {\n\t\tvar newRanks = sortedRanks; // Make a copy to retain the original values.\n\n\t\t// This block manually sets a new array to factor start and ends\n\t\tif (newRanks[4] == 13 && newRanks[0] == 1) newRanks[4] = 0;\n\t\tif (newRanks[3] == 12 && newRanks[4] == 0) newRanks[3] = -1;\n\t\tif (newRanks[2] == 11 && newRanks[3] == -1) newRanks[2] = -2;\n\t\tif (newRanks[1] == 10 && newRanks[2] == -2) newRanks[1] = -3;\n\t\tnewRanks.sort(sortNumber); // Resort\n\n\t\t// Check if addition of one equals the next card value\n\t\tfor (var i = 0; i < 4; i++) {\n\t\t\tif (newRanks[i] + 1 != newRanks[i + 1]) return false; // Return false indefinitely.\n\t\t}\n\n\t\thasAnyHand = true;\n\t\treturn true;\n\t}\n\n\t/*\n\t * Check for a straight flush\n\t */\n\tfunction isStraightFlush() {\n\t\tif (isFlush() && isStraight()) {\n\t\t\thasAnyHand = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/*\n\t * Check for a royal flush\n\t */\n\tfunction isRoyalFlush() {\n\t\tif (isFlush()) { // Check if it's even a flush first.\n\t\t\t// Loop through to check each Card object to determine if it's a royal card.\n\t\t\tfor (var i = 0; i < handOf5.length; i++) {\n\t\t\t\tif (!handOf5[i].isRoyal()) return false; // Return false indefinitely.\n\t\t\t}\n\n\t\t\thasAnyHand = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (handOf5.length == 5) { // Check if the hand is 5\n\t\tvar isValidHand = false; // Valid hand checker\n\n\t\tfor (var i = 0; i < handOf5.length; i++) {\n\t\t\t// Check if each card is an instance of \"Card\" to prove the objects are correct.\n\t\t\t// Also check if it has a rank and suit.\n\t\t\tif (handOf5[i] instanceof Card && handOf5[i].isValid()) isValidHand = true;\n\t\t\telse console.error(\"Object(\" + (i + 1) + \") isn't a Card\");\n\t\t}\n\n\t\tif (isValidHand) {\n\t\t\tconsole.log(\"Hand: \" + handOf5.toString());\n\n\t\t\tif (isTwoPair()) console.log(\"Two of a Kind!!\");\n\t\t\tif (isThreePair()) console.log(\"Three of a Kind!!!\");\n\t\t\tif (isFourPair()) console.log(\"Four of a Kind!!!!\");\n\t\t\tif (isFlush()) console.log(\"Flush!\");\n\t\t\tif (isFullHouse()) console.log(\"Full House!\");\n\t\t\tif (isStraight()) console.log(\"Straight!\");\n\t\t\tif (isStraightFlush()) console.log(\"Straight Flush!\");\n\t\t\tif (isRoyalFlush()) console.log(\"Royal Flush!\");\n\t\t\tif (!hasAnyHand) console.log(\"Bust\");\n\t\t}\n\t} else console.error(\"5 cards are required for a hand\");\n}", "title": "" }, { "docid": "901c8c21b815776b99136d4bef433072", "score": "0.6169059", "text": "function turns() {\n\treturn state.length;\n}", "title": "" }, { "docid": "dbad6d928b4dbaa1c9eaba87370701bd", "score": "0.6147313", "text": "getAllStates() {\n\n var states = [];\n for (var i=-this.xThresh; i < this.xThresh + 0.01; i=i+this.xThresh / this.divs) {\n for (var j=-1; j < 2; j = j + 2) {\n for (var k=-this.thetaThresh; k < this.thetaThresh; k=k+this.thetaThresh/this.divs) {\n for (var l=-1; l < 2; l = l + 2) {\n states.push([i, j, k, l]);\n }\n }\n }\n }\n return states;\n }", "title": "" }, { "docid": "d876ad976b535287278f918946f2354c", "score": "0.6147126", "text": "function winYet () {\n\tfor (i = 0; i < hiddenArray.length; i++) {\n\t\tif (hiddenArray[i].guess === true) {\n\t\t\twinstate = true;\n\t\t} else {\n\t\t\treturn winstate = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b93b7fcbedb956d1f288c5c6cb35d2e8", "score": "0.6118359", "text": "function winningHands(community,hands){\n var counter = 0;\n hands.forEach(function(element) {\n var fullhand = element.concat(community);\n var bestHand = handChecker(fullhand);\n ALLHANDS.push(bestHand);\n counter++;\n });\n}", "title": "" }, { "docid": "9cec901deeed5334b130ea019e4f2f7e", "score": "0.61010635", "text": "playerDoneWithCurrentHand() {\n this.setState(prevState => {\n const {\n activePlayerHandIndex,\n playerHands,\n } = prevState\n const playerHasMoreHands = activePlayerHandIndex !== playerHands.length - 1\n\n return {\n activePlayerHandIndex: playerHasMoreHands ? prevState.activePlayerHandIndex + 1 : prevState.activePlayerHandIndex,\n playerDecision: playerHasMoreHands,\n }\n })\n }", "title": "" }, { "docid": "05f5acd013bb03103299c6c360a9d559", "score": "0.59762865", "text": "evaluateHand(){\n this.setState(() => {\n let tempRank = ``\n let tempAlterableHand = this.state.evaluableHand\n let straightFlushedHand = []\n // Sorts the collection of player's hand and the board from least to greatest in accordance to the rank defined in state\n tempAlterableHand.sort((a, b) => this.state.cardRank.indexOf(a[0]) - this.state.cardRank.indexOf(b[0]))\n // Checks for straight flush\n if(this.checkForFlush(tempAlterableHand) !== false){\n let flushedHand = this.checkForFlush(tempAlterableHand)\n if(this.checkForStraight(flushedHand) !== false){\n straightFlushedHand = this.checkForStraight(flushedHand)\n if(straightFlushedHand[straightFlushedHand.length - 1][0] === `A`){\n tempRank = `Royal Flush`\n return{\n finalPlayerHand: straightFlushedHand,\n playerHandRank: this.state.handRanks[9],\n handMessage: tempRank\n }\n }\n tempRank = `${straightFlushedHand[straightFlushedHand.length - 1][0]} high Straight ${flushedHand[0][1]} Flush`\n return{\n finalPlayerHand: straightFlushedHand,\n playerHandRank: this.state.handRanks[8],\n handMessage: tempRank\n }\n }\n }\n // Checks for four of a kind\n if(this.highestPairedSetOf(tempAlterableHand).length === 4){\n let fourOfAKindHand = []\n fourOfAKindHand.push(...this.highestPairedSetOf(tempAlterableHand))\n for(let i = tempAlterableHand.length - 1; i >= 0; i--){\n if(fourOfAKindHand.includes(tempAlterableHand[i]) === false){\n fourOfAKindHand.push(tempAlterableHand[i])\n tempRank = `Four of a Kind of ${fourOfAKindHand[0][0]}s with ${fourOfAKindHand[fourOfAKindHand.length - 1][0]} high`\n return{\n finalPlayerHand: fourOfAKindHand,\n playerHandRank: this.state.handRanks[7],\n handMessage: tempRank\n }\n }\n }\n }\n // Checks for a full house\n if(this.highestPairedSetOf(tempAlterableHand).length === 3){\n let fullHouseHand = []\n fullHouseHand.push(...this.highestPairedSetOf(tempAlterableHand))\n let insidePair = []\n insidePair.push(...this.secondHighestSetOf(tempAlterableHand))\n while(insidePair.length > 2){\n insidePair.shift()\n }\n if(insidePair.length === 2){\n fullHouseHand.push(...insidePair)\n tempRank = `Full House ${fullHouseHand[0][0]}s full of ${fullHouseHand[fullHouseHand.length - 1][0]}s`\n return{\n finalPlayerHand: fullHouseHand,\n playerHandRank: this.state.handRanks[6],\n handMessage: tempRank\n }\n }\n }\n // Checks for Flush\n if(this.checkForFlush(tempAlterableHand) !== false){\n let flushHand = this.checkForFlush(tempAlterableHand)\n tempRank = `${flushHand[flushHand.length - 1][0]} high ${flushHand[0][1]} Flush`\n return{\n finalPlayerHand: flushHand,\n playerHandRank: this.state.handRanks[5],\n handMessage: tempRank\n }\n }\n // Checks for Straight\n if(this.checkForStraight(tempAlterableHand) !== false){\n let straightHand = this.checkForStraight(tempAlterableHand)\n tempRank = `${straightHand[straightHand.length - 1][0]} high Straight`\n return{\n finalPlayerHand: straightHand,\n playerHandRank: this.state.handRanks[4],\n handMessage: tempRank\n }\n }\n // Checks for three of a kind\n if(this.highestPairedSetOf(tempAlterableHand).length === 3){\n let tripsHand = []\n tripsHand.push(...this.highestPairedSetOf(tempAlterableHand))\n for(let i = tempAlterableHand.length - 1; tripsHand.length < 5; i--){\n if(tripsHand.includes(tempAlterableHand[i]) === false){\n tripsHand.push(tempAlterableHand[i])\n }\n }\n tempRank = `Three of a kind of ${tripsHand[0][0]} with ${tripsHand[tripsHand.length - 2][0]} ${tripsHand[tripsHand.length - 1][0]} high`\n return{\n finalPlayerHand: tripsHand,\n playerHandRank: this.state.handRanks[3],\n handMessage: tempRank\n }\n }\n // Checks for two pair as well as one\n if(this.highestPairedSetOf(tempAlterableHand).length === 2 ){\n let highestPair = this.highestPairedSetOf(tempAlterableHand)\n if(this.secondHighestSetOf(tempAlterableHand).length === 2){\n let secondPair = this.secondHighestSetOf(tempAlterableHand)\n let twoPairHand = []\n twoPairHand.push(...highestPair,...secondPair)\n for(let i = tempAlterableHand.length - 1; twoPairHand.length < 5; i--){\n if(twoPairHand.includes(tempAlterableHand[i]) === false){\n twoPairHand.push(tempAlterableHand[i])\n }\n }\n tempRank = `Two Pair ${twoPairHand[0][0]}s and ${twoPairHand[twoPairHand.length - 2][0]}s ${twoPairHand[twoPairHand.length - 1][0]} high`\n return{\n finalPlayerHand: twoPairHand,\n playerHandRank: this.state.handRanks[2],\n handMessage: tempRank\n }\n }else{\n let onePairHand = []\n onePairHand.push(...highestPair)\n tempRank = `Pair of ${onePairHand[0][0]}s`\n if(tempAlterableHand.length > 4){\n for(let i = tempAlterableHand.length - 1; onePairHand.length < 5; i--){\n if(onePairHand.includes(tempAlterableHand[i]) === false){\n onePairHand.push(tempAlterableHand[i])\n }\n }\n tempRank = `Pair of ${onePairHand[0][0]}s ${onePairHand[onePairHand.length - 3][0]} ${onePairHand[onePairHand.length - 2][0]} ${onePairHand[onePairHand.length - 1][0]} high`\n }\n // If none of the above return, returns current hand with High Card rank\n return{\n finalPlayerHand: onePairHand,\n playerHandRank: this.state.handRanks[1],\n handMessage: tempRank\n }\n }\n }\n if(this.highestPairedSetOf(tempAlterableHand).length === 0){\n let highCardHand = []\n if(tempAlterableHand.length > 4){\n for(let i = tempAlterableHand.length - 1; highCardHand.length < 5; i--){\n if(highCardHand.includes(tempAlterableHand[i]) === false){\n highCardHand.push(tempAlterableHand[i])\n }\n }\n }else{\n highCardHand.push(...tempAlterableHand)\n }\n tempRank = `High card of ${highCardHand[0][0]}, ${highCardHand[1][0]}`\n return{\n finalPlayerHand: highCardHand,\n playerHandRank: this.state.handRanks[0],\n handMessage: tempRank\n }\n }\n })\n }", "title": "" }, { "docid": "0d10c2da372dccff513e8a9b22b4cb7d", "score": "0.5972234", "text": "function isFullHouse(hand){\n let handCount = {};\n for (let i of hand) {\n handCount[i] = (handCount[i] || 0) + 1;\n }\n let countValues = Object.values(handCount);\n if ((countValues[0] === 2 && countValues[1] === 3) || (countValues[0] === 3 && countValues[1] === 2)){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "15c84ea107b933fecff6fbc273980f61", "score": "0.58494496", "text": "function hand(crdarr) {\n this.cards = crdarr;\n this.hiCrdPts = function () {\n var hipt = 0;\n for (var cardind = 0; cardind < crdarr.length; cardind++) {\n var crdval = crdarr[cardind].valu;\n if (crdval in pointlist) hipt += pointlist[crdval];\n }\n return hipt;\n }\n this.lenPts = function () {\n var lenpts = 0;\n for (var jsuit = 0; jsuit < suitlist.length; jsuit++) {\n var suitsub = crdarr.filter(function (crds) {\n return crds.suit == suitlist[jsuit]\n });\n if (suitsub.length > 4) lenpts += (suitsub.length - 4);\n }\n return lenpts;\n }\n this.dist = function () {\n var suitdist = {};\n for (var jsuit = 0; jsuit < suitlist.length; jsuit++) {\n var suitsub = crdarr.filter(function (crds) {\n return crds.suit == suitlist[jsuit]\n });\n suitdist[suitlist[jsuit]] = suitsub.length;\n }\n return suitdist;\n }\n this.isBalanced = function () {\n var mult = 0;\n for (item in this.dist()) {\n if (this.dist()[item] < 2) return false;\n if (this.dist()[item] == 2) mult += 1;\n }\n if (mult > 1) return false;\n return true;\n }\n this.bidToOpen = function () {\n var totpts = this.hiCrdPts() + this.lenPts();\n if (totpts > 21) return \"2 clubs\";\n if (this.isBalanced() && this.hiCrdPts() > 19 && this.hiCrdPts() < 22) return \"2 NT\";\n if (this.isBalanced() && this.hiCrdPts() > 14 && this.hiCrdPts() < 18) return \"1 NT\";\n if (totpts >= 13 && this.dist().spades > 4) return \"1 spade\";\n if (totpts >= 13 && this.dist().hearts > 4) return \"1 heart\";\n if (totpts >= 13 && this.dist().diams > this.dist().clubs) return \"1 diamond\";\n if (totpts >= 13 && this.dist().clubs >= this.dist().diams) return \"1 club\";\n return \"pass\";\n }\n}", "title": "" }, { "docid": "7e640785c1629b2c6c7d6a3af0fc5ae4", "score": "0.58455473", "text": "winner(state, player) {\n // if 3 passes, return 0\n if (state.playHistory.length == state.numberOfPlayers &&\n state.playHistory.map(p => p.value)\n .every(v => v == bids.PASSE)) {\n return 0\n }\n // if it's a slam and the declarer (or his partner) has lost a trick,\n // it's loss\n if (state.bid == bids.CHELEM && state.playerTricks\n .filter((_, i) => i != state.declarer && i !== state.partner)\n .some(tricks => tricks.size > 1)) {\n if (state.partner != null && state.partner != state.declarer) {\n if (state.declarer == player) return -200 * (state.numberOfPlayers - 3)\n else if (state.partner === player) return -200\n else return 200\n } else {\n return state.declarer == player ? (-200 * (state.numberOfPlayers - 1)) : 200\n }\n }\n // if the cards aren't played out, there's no winner yet;\n if (state.playerHands.some(hand => hand.size > 0)) {\n return null\n }\n // if the cards are played out, and it's a slam, bid or not:\n let declarerTrickSize = state.playerTricks[state.declarer].size + ((state.partner != null && state.partner != state.declarer) ? state.playerTricks[state.partner].size : 0)\n if (declarerTrickSize > 70) {\n if (state.partner != null && state.partner != state.declarer) {\n if (state.declarer == player) return 200 * (state.numberOfPlayers - 3)\n else if (state.partner === player) return 200\n else return -200\n } else {\n return state.declarer == player ? (200 * (state.numberOfPlayers - 1)) : -200\n }\n }\n if (declarerTrickSize <=1) {\n if (state.partner != null && state.partner != state.declarer) {\n if (state.declarer == player) return -200 * (state.numberOfPlayers - 3)\n else if (state.partner == player) return -200\n else return 200\n } else {\n return state.declarer == player ? (-200 * (state.numberOfPlayers- 1)) : 200\n }\n }\n\n // win can be figured as win/loss, 0-1,\n // or as a larger range.\n \n const { cardpoints, partnerPoints, talonPoints, oudlers, pagatUltimo, target } = this.winnerStats(state)\n\n let totalPoints = cardpoints + partnerPoints + talonPoints\n // difference.\n // const declarerWon = cardpoints > target ? 1 : 0\n const bidVal = {\n [bids.PRIS]: 0,\n [bids.SANSACHAT]: 10,\n [bids.SANSECART]: 20\n }[state.bid] || 0\n let score = Math.floor(Math.abs(totalPoints - target)) + bidVal \n if (target > totalPoints) score = -score\n\n // Should return \"won\" or not: \n // but need to move this from 0-1 to actual score.\n // return state.declarer == player ? declarerWon : 1 - declarerWon\n if (state.partner != null && state.partner != state.declarer) {\n if (state.declarer == player) return score * (state.numberOfPlayers - 3)\n else if (state.partner == player) return score\n else return -score\n } else {\n return state.declarer == player ? (score * (state.numberOfPlayers - 1)) : -score\n }\n }", "title": "" }, { "docid": "894761ad0b52bc785a7194c67d0d6f16", "score": "0.58321875", "text": "checkForStraight(tempAlterableHand){\n let bottomOfStraight = ``\n let downStraightedCount = 1\n let upStraightedCount = 1\n let straightedCards = []\n let wheeledStraight = []\n let isStraighted = false\n let isStraightedWithWheel = false\n for(let i = 0; i < tempAlterableHand.length - 1; i++){\n if((this.state.cardRank.indexOf(tempAlterableHand[i][0]) === this.state.cardRank.indexOf(tempAlterableHand[i+1][0]))\n ||this.state.cardRank.indexOf(tempAlterableHand[i][0]) === this.state.cardRank.indexOf(tempAlterableHand[i+1][0])-1){\n if(straightedCards.includes(tempAlterableHand[i]) === false){\n straightedCards.push(tempAlterableHand[i])\n }\n if(straightedCards.includes(tempAlterableHand[i+1]) === false){\n straightedCards.push(tempAlterableHand[i+1])\n }\n }\n }\n for(let i = straightedCards.length - 1 ; i > 0; i--){\n if(this.state.cardRank.indexOf(straightedCards[i][0]) === this.state.cardRank.indexOf(straightedCards[i - 1][0]) + 1){\n downStraightedCount++\n if(downStraightedCount === 4 && straightedCards[i-1][0] === `2` && tempAlterableHand[tempAlterableHand.length - 1][0] === `A`){\n wheeledStraight.push(...straightedCards)\n isStraightedWithWheel = true\n }\n if(downStraightedCount === 5){\n bottomOfStraight = straightedCards.indexOf(straightedCards[i-1])\n for(let i = bottomOfStraight; i < straightedCards.length - 1; i++){\n if(this.state.cardRank.indexOf(straightedCards[i][0]) === this.state.cardRank.indexOf(straightedCards[i + 1][0]) - 1){\n upStraightedCount++\n if(upStraightedCount === 5){\n isStraighted = true\n }\n }\n }\n }\n }else if((this.state.cardRank.indexOf(straightedCards[i][0]) !== this.state.cardRank.indexOf(straightedCards[i - 1][0]) + 1) \n && (this.state.cardRank.indexOf(straightedCards[i][0]) !== this.state.cardRank.indexOf(straightedCards[i - 1][0]))){\n downStraightedCount = 1\n }\n }\n if(isStraightedWithWheel){\n return wheeledStraight\n }else if(isStraighted){\n return straightedCards\n }else{\n return false\n }\n }", "title": "" }, { "docid": "9ca19d6d7d68b90703bd2345bb51b1bb", "score": "0.5801793", "text": "function getCurrentHand(allCards) {\n if (isStraightFlush(allCards))\n return \"StraightFlush\";\n else if (isFourOfAKind(allCards))\n return \"FourOfAKind\";\n else if (isFullHouse(allCards))\n return \"FullHouse\";\n else if (isFlush(allCards))\n return \"Flush\";\n else if (isStraight(allCards))\n return \"Straight\";\n else if (isThreeOfAKind(allCards))\n return \"ThreeOfAKind\";\n else if (isTwoPair(allCards))\n return \"TwoPair\";\n else if (isOnePair(allCards))\n return \"OnePair\";\n else return \"HighCard\";\n}", "title": "" }, { "docid": "31f2867ea360c830cfdd699c3cdd2ddd", "score": "0.5798006", "text": "function Hand(){\n this.cards = [];\n this.handName = null;\n this.handScore = 0;\n /* Evaluate Hand */ \n this.evaluateHand = function(){\n var i;\n var j;\n var playerCards = this.cards;\n /* Sort cards into ascending order */ \n playerCards.sort(function(a, b){\n return (a.value - b.value);\n });\n\n /* If Ace is necessary for low straight, change value from 14 to 1 */ \n if ((playerCards[0].value == 2) && (playerCards[1].value == 3) && (playerCards[2].value == 4) && (playerCards[3].value == 5) && (playerCards[4].value == 14)){ \n playerCards[4].value = 1;\n /* Re-sort cards */ \n playerCards.sort(function(a, b){\n return (a.value - b.value);\n }); \n }\n\n /* Check for flush */\n var flush;\n for (i=1; i<5; i++){\n if (playerCards[i].suit != playerCards[0].suit){\n flush = false;\n break\n } else{\n flush = true;\n } \n }\n console.log('flush = ' + flush);\n if (flush == true){\n this.handScore += 500;\n this.handScore += playerCards[4].value;\n this.handName = 'Flush';\n }\n\n /* Check for straight */\n var straight;\n for (i=1; i<5; i++){\n j = i - 1;\n if ((playerCards[i].value - playerCards[j].value) != 1){\n straight = false;\n break;\n } else{\n straight = true;\n }\n } \n console.log('straight = ' + straight);\n if (straight == true){\n this.handScore += 400;\n this.handScore += playerCards[4].value;\n this.handName = 'Straight';\n }\n\n /* Check for pairs, trips, quads */ \n if ((flush == false) && (straight == false)){\n console.log('No straight or flush');\n\n var pairValue;\n var pairsArray = [];\n /* Check for matching card values */\n for (i=1; i<5; i++){\n j = i - 1;\n if ((playerCards[i].value - playerCards[j].value) == 0){\n pairsArray[j] = 1;\n pairValue = playerCards[i].value;\n } else{\n pairsArray[j] = 0;\n }\n }\n /* Check total no. of pairs */\n var pairsTotal = 0;\n for (i=0; i<4; i++){\n pairsTotal = pairsTotal + pairsArray[i];\n }\n if(pairsTotal == 1){ /* Single pair */\n this.handScore += (100 + pairValue);\n this.handName = 'Pair';\n } else if (pairsTotal == 0){ /* High card */\n this.handScore += (playerCards[4].value); \n this.handName = 'High Card';\n }\n /* \n Full house - There's effectively 3 pairs due to 3 of kind \n Either 2nd & 3rd or 3rd & 4th won't be matched\n */ \n else if ((pairsTotal == 3) && ((pairsArray[1] == 0) || (pairsArray[2] == 0))){\n this.handScore += (600 + playerCards[2].value);\n this.handName = 'Full House';\n }\n /* \n Four of a kind - There's effectively 3 pairs again\n Either 1st & 2nd or 4th & 5th won't be matched\n */ \n else if ((pairsTotal == 3) && ((pairsArray[0] == 0) || (pairsArray[3] == 0))){\n this.handScore += (700 + playerCards[3].value);\n this.handName = 'Quads'; \n }\n /* 3-of-a-kind 2 pairs will be made up of 3 cards */ \n else if (pairsTotal == 2){\n if (((pairsArray[0] == 1) && (pairsArray[1] == 1)) || ((pairsArray[1] == 1) && (pairsArray[2] == 1)) || ((pairsArray[2] == 1) && (pairsArray[3] == 1))){\n this.handScore += (300 + playerCards[2].value);\n this.handName = 'Trips'; \n } else{\n /* Two Pairs - only remaining combination*/ \n this.handScore += (200 + playerCards[3].value);\n this.handName = 'Two Pairs'; \n }\n } \n }/* End pairs, trips, quads check */\n\n\n console.log(this.handName + ' ' + this.handScore);\n console.log(this.handScore); \n return (this.handScore); \n } \n }", "title": "" }, { "docid": "45dab8aa3ceaa98f10cb2ae5a3af7ed5", "score": "0.5769509", "text": "determineNextState() {\n // Check birth\n if (!this.isAlive) {\n this.willBeAlive = this.grid.data.rule.birth[this.countAliveNeighbors()];\n if (this.willBeAlive)\n this.grid.cellsToChange.push(this);\n return;\n }\n // Check survival\n this.willBeAlive = this.grid.data.rule.survival[this.countAliveNeighbors()];\n if (!this.willBeAlive)\n this.grid.cellsToChange.push(this);\n }", "title": "" }, { "docid": "ed9db00dba7cbc358dedb11ee2d0c0eb", "score": "0.57672757", "text": "function gameState() {\n\n // Can't be in check mate if not in check\n // But can draw\n if (kingPos == \"\") {\n for (let piece of Array.from(piecePos)) {\n if (piece[1].color == turnPlayer[turn] && getMovementOptions(piece[1], piece[0]).length > 0)\n return \"\";\n }\n return \"draw\";\n }\n // Check each piece for the turn player at the start of turn if in check state.\n for (let piece of Array.from(piecePos)) {\n if (piece[1].color == turnPlayer[turn] && getMovementOptions(piece[1], piece[0]).length > 0)\n return \"check\";\n }\n return \"mate\";\n}", "title": "" }, { "docid": "672451467acc65f4d862900cab44f750", "score": "0.57549214", "text": "function HoleState() {\n\t\t//this has a few options\n\t\t//on hit it remains in hole state\n\t\t//on high random chance it goes to diglet state\n\t\t//on low random chance it goes to drilbur state\n\t\t//on medium random chance it goes to peak state\n\t\tthis.changeState = function() {\n\t\t\tvar randomNum = Math.floor(Math.random() * maxProb);\n\t\t\tif (randomNum <= lowProp) {\n\t\t\t\tupdateHole(drilburImg, drilbur);\n\t\t\t} else if (randomNum <= medProp) {\n\t\t\t\tupdateHole(peakImg, peak);\n\t\t\t} else if (randomNum <= highProp) {\n\t\t\t\tupdateHole(diglettImg, diglett);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f2bce8dcf561e97720a7b9c2414fb262", "score": "0.5705314", "text": "function determineState(box) {\n if (box.clicked && box.isMine) {\n gameEnd = true;\n\n timer.stop();\n\n box.state = faces.loss;\n document.querySelector(\".face\").id = \"dead\";\n\n exposeField();\n } else {\n gridSpread(box);\n }\n}", "title": "" }, { "docid": "1874bba0a6a07fc8e9f0b5a55dae2160", "score": "0.56878805", "text": "getPublicState() {\n const { id, name, hand } = this;\n\n return {\n id,\n name,\n hand: hand.length,\n };\n }", "title": "" }, { "docid": "dd91725310318568e779cb691218415b", "score": "0.56655383", "text": "function getIndexStateOfGame(x, y) {\n\tvar xTemp = getIndexStateX(x);\n\tif(y <= -0.38 && y >= -1) {\n\t\treturn xTemp;\n\t} else if(y >= -0.32 && y <= 0.32) {\n\t\treturn xTemp + 3;\n\t} else {\n\t\treturn xTemp + 6;\n\t}\n}", "title": "" }, { "docid": "5f9871967e2acd62bc5f637f04569dbe", "score": "0.56549424", "text": "function getGameState() {\n for(var key in state) {\n var value = state[key];\n if (value) {return key}; \n }\n} // End current game state //", "title": "" }, { "docid": "1dc272d2585cb8e7d99bf985879e8866", "score": "0.565465", "text": "function testHandHasFullHouse() {\n writeln('sorted hand:');\n var hand = [];\n\n // set up a positive case.\n hand.push(new Card(12, SUIT.HEART, 0));\n hand.push(new Card(12, SUIT.CLUB, 0));\n hand.push(new Card(7, SUIT.HEART, 0));\n hand.push(new Card(12, SUIT.SPADE, 0));\n hand.push(new Card(7, SUIT.DIAMOND, 0));\n\n var sortedHand = new Hand(hand);\n sortedHand.sortHand();\n\n for (var i = 0; i < 5; i++) {\n writeln(hand[i].suit + '|' + hand[i].rank);\n }\n\n var hasFullHouse = sortedHand.hasFullHouse();\n writeln('has full house? ' + hasFullHouse);\n}", "title": "" }, { "docid": "22cf663b0f27d410c5347bc44a820ee2", "score": "0.56406325", "text": "function check_Winning_State(board){\n check_Left_Diagonal_Win(board);\n check_Right_Diagonal_Win(board);\n check_Vertical_Win1(board);\n check_Vertical_Win2(board);\n check_Vertical_Win3(board);\n check_Horizontal_Win1(board);\n check_Horizontal_Win2(board);\n check_Horizontal_Win3(board);\n}", "title": "" }, { "docid": "437195c537d4d9c5c31796f0c049da40", "score": "0.5606718", "text": "function winDetect(thiss, platform) {\n winblock = false;\n if (thiss.x < platform.x + platform.width &&\n thiss.y < platform.y + platform.height &&\n thiss.height + thiss.y > platform.y &&\n thiss.x + thiss.width > platform.x &&\n coinscollected > 149) {\n winning = true;\n winblock = true;\n }\n}", "title": "" }, { "docid": "fc7d38492625634d84aee9eedb699bce", "score": "0.5598729", "text": "function checkGameState() {\n if ($('#physical').progressbar('value') <= 0) {\n return 'lost';\n }\n if ($('#mental').progressbar('value') <= 0) {\n return 'lost';\n }\n if ($('#wealth').progressbar('value') <= 0) {\n return 'lost';\n }\n if ($('#supplies').progressbar('value') <= 0) {\n return 'lost';\n }\n if (day + 1 === lastDay) {\n return 'won';\n }\n return 'none';\n}", "title": "" }, { "docid": "806080e753aa1878cc909d742e547ce9", "score": "0.55943906", "text": "function checkHealth(){\n // based on the difference between actual and goal values\n let diff = ((Math.abs(actualMoistness - goalMoistness))\n + (Math.abs(actualHeat - goalHeat)))\n console.log(diff)\n // return a value which will correspond to a certain frame\n // TODO: adjust values so this works better\n if (diff > 8){\n // this for the worst state\n return 0\n }\n else if (8 > diff && diff > 4){\n // this for medium\n return 1\n }\n else if (4 > diff){\n // this for doing well\n return 2\n }\n }", "title": "" }, { "docid": "bbe7176aac3b8b57864e9aa823b3e5e5", "score": "0.5593511", "text": "evaluate(hand) {\n\t\t// Get card values in descending order\n\t\tthis.cardVals = [];\n\t\tthis.high = 0;\n\t\t// Store a hand type variable that is set while evaluating for quick comparisons\n\t\tthis.handType = 0;\n\t\tfor (let i = 0; i < hand.cards.length; i++) {\n\t\t\tthis.cardVals.push(hand.cards[i].getNumericalValue());\n\t\t}\n\t\t// Sort card vals in descending order (highest first)\n\t\tthis.cardVals.sort((a, b) => b - a);\n\t\t[this.high] = [this.cardVals[0]];\n\n\t\t// Count occurances of each card\n\t\tconst counter = {};\n\t\tfor (let i = 0; i < this.cardVals.length; i++) {\n\t\t\tif (this.cardVals[i] in counter) {\n\t\t\t\t// Increment counter for card val\n\t\t\t\tcounter[this.cardVals[i]]++;\n\t\t\t} else {\n\t\t\t\t// Set card count for val to 1\n\t\t\t\tcounter[this.cardVals[i]] = 1;\n\t\t\t}\n\t\t}\n\n\t\t// Get pairs of cards\n\t\t// Store a \"pair\" as the value of the card that is in a pair. otherPairVal is for 2 pairs\n\t\tthis.otherPairVal = 0;\n\t\tlet numPairs = 0;\n\t\t// Find counter values of exactly 2\n\t\tfor (let i = 0; i < Object.keys(counter).length; i++) {\n\t\t\t// If the property of the counter at this value is exactly 2, add this counter value to pairs\n\t\t\tif (counter[Object.keys(counter)[i]] === 2) {\n\t\t\t\tif (numPairs > 1) {\n\t\t\t\t\t// One pair becomes 2 pairs\n\t\t\t\t\tconst newHigh = Object.keys(counter)[i];\n\t\t\t\t\t// Make sure this.high is always the higher of the two pairs\n\t\t\t\t\t// and this.otherPairVal is the lower\n\t\t\t\t\tif (newHigh > this.high) {\n\t\t\t\t\t\tthis.otherPairVal = this.high;\n\t\t\t\t\t\tthis.high = newHigh;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.otherPairVal = newHigh;\n\t\t\t\t\t}\n\t\t\t\t\tnumPairs++;\n\t\t\t\t\tthis.handType = 2;\n\t\t\t\t} else {\n\t\t\t\t\t// No pairs becomes 1 pair\n\t\t\t\t\tthis.high = Object.keys(counter)[i];\n\t\t\t\t\tnumPairs++;\n\t\t\t\t\tthis.handType = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get 3 of a kind\n\t\t// Store a 3OAK as the value of the card that is in a 3OAK. If 0, no 3OAK\n\t\tlet threeOAK = false;\n\t\t// Find counter values of exactly 3\n\t\tfor (let i = 0; i < Object.keys(counter).length; i++) {\n\t\t\t// If the property of the counter at this value is exactly 3, add this counter value to 3OAK\n\t\t\tif (counter[Object.keys(counter)[i]] === 3) {\n\t\t\t\tthis.high = Object.keys(counter)[i];\n\t\t\t\tthreeOAK = true;\n\t\t\t\t// Set handType to 3 (above 2 pairs)\n\t\t\t\tthis.handType = 3;\n\t\t\t\t// No more than one 3OAK can exist, so break\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Get straight\n\t\t// Store a straight as the highest value in the straight. If 0, no straight\n\t\tlet straight = false;\n\t\t// Make sure there are no pairs or 3OAKs, otherwise it is impossible to have a straight\n\t\tif (numPairs === 0 && !threeOAK) {\n\t\t\t// Check for ace as a low card. Highest val is an ace (14) but next highest is a 5\n\t\t\tif (this.cardVals[0] === 14 && this.cardVals[1] === 5) {\n\t\t\t\t// Make sure the 2nd highest minus the lowest is 3\n\t\t\t\t// (5 - 2, which would mean cards are A, 5, 4, 3, 2)\n\t\t\t\tif (5 - this.cardVals[4] === 3) {\n\t\t\t\t\t// Cards are contiguous with ace as a low card, straight has 5 as high\n\t\t\t\t\tthis.high = 5;\n\t\t\t\t\tstraight = true;\n\t\t\t\t\t// Set hand type to 4 (above 3OAK)\n\t\t\t\t\tthis.handType = 4;\n\t\t\t\t}\n\t\t\t} else if (this.cardVals[0] - this.cardVals[4] === 4) {\n\t\t\t\t// Ace is a high card or not in the hand\n\t\t\t\t// Like before, subtract lowest card from the highest card\n\t\t\t\t// and see if the value is 4 (ex. 10, 9, 8, 7, 6 and 10 - 6 = 4)\n\n\t\t\t\t[this.high] = [this.cardVals];\n\t\t\t\tstraight = true;\n\t\t\t\t// Set hand type to 4 (above 3OAK)\n\t\t\t\tthis.handType = 4;\n\t\t\t}\n\t\t}\n\n\t\t// Get flush\n\t\tlet flush = false;\n\t\t// Make sure there are no pairs or 3OAKs, otherwise it is impossible to\n\t\t// have a flush (must have multiple suits to have more of one value)\n\t\tif (numPairs === 0 && !threeOAK) {\n\t\t\tlet allSameSuit = true;\n\t\t\t// Loop and check suits of all cards in hand\n\t\t\tfor (let i = 1; i < hand.cards.length; i++) {\n\t\t\t\tif (hand.cards[i].s !== hand.cards[i - 1].s) {\n\t\t\t\t\tallSameSuit = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If all are the same suit, get the highest card\n\t\t\tif (allSameSuit) {\n\t\t\t\t[this.high] = [this.cardVals];\n\t\t\t\tflush = true;\n\t\t\t\t// Set handType to 4 (above straight)\n\t\t\t\tthis.handType = 5;\n\t\t\t}\n\t\t}\n\n\t\t// Get full house (1 pair and 3 of a kind)\n\t\t// If there is one pair and a 3OAK was found\n\t\tif (numPairs === 1 && threeOAK) {\n\t\t\t[this.high] = [this.cardVals];\n\t\t\t// Set handType to 5 (above flush)\n\t\t\tthis.handType = 5;\n\t\t}\n\n\t\t// Get 4 of a kind\n\t\t// Find counter values of exactly 4\n\t\tfor (let i = 0; i < Object.keys(counter).length; i++) {\n\t\t\t// If the property of the counter at this value is exactly 4 4OAK was found\n\t\t\tif (counter[Object.keys(counter)[i]] === 4) {\n\t\t\t\tthis.high = Object.keys(counter)[i];\n\t\t\t\t// Set handType to 6 (above full house)\n\t\t\t\tthis.handType = 6;\n\t\t\t\t// No more than one 4OAK can exist, so exit\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Get straight flush\n\t\tlet straightFlush = false;\n\t\tif (straight > 0 && flush) {\n\t\t\t// High will have already been set\n\t\t\tstraightFlush = true;\n\t\t\t// Set handType to 7 (above 4OAK)\n\t\t\tthis.handType = 7;\n\t\t}\n\n\t\t// Get royal flush\n\t\t// If the hand is a straight flush and the highest card is an ace (14),\n\t\t// then the hand must be a royal flush\n\t\tif (straightFlush && this.cardVals[0] === 14) {\n\t\t\tthis.high = 14;\n\t\t\t// set handType to 8 (above straight flush)\n\t\t\tthis.handType = 8;\n\t\t}\n\t}", "title": "" }, { "docid": "f4e40e39d6a4f3edf5980b0df5f1418d", "score": "0.55846214", "text": "function Hand() {\n var cards = [];\n cards.push(deck.shift());\n cards.push(deck.shift());\n this.getHand = function() {\n return cards;\n };\n this.score = function() {\n var length = cards.length,\n handscore = 0,\n nrOfAces = 0;\n for (var i = 0; i < length; i++) {\n handscore += cards[i].getValue();\n if (cards[i].getValue() === 11) {\n nrOfAces++;\n }\n }\n while (handscore > 21 && nrOfAces > 0) {\n handscore -= 10;\n nrOfAces--;\n }\n return handscore;\n };\n this.printHand = function() {\n var length = cards.length,\n suitName = \"\",\n handList = \"\";\n for (var i = 0; i < length; i++) {\n handList += cards[i].getNumber() + \" of \" + cards[i].getSuit() + \", \";\n }\n return handList; // TODO fix todo\n };\n this.hitMe = function() {\n cards.push(deck.shift());\n\n };\n this.getCards = function() {\n return cards;\n };\n this.splitHand = function () {\n \n } \n //FIXME vær kjapp\n /*\n TODO: skrive mer\n Splitting Pairs\n -check for pair\n -spilt pair into new hands\n -play hands\n -compare to dealer\n TODO:\n Doubling Down - double bet, only one more card\n TODO: add bets\n */\n}", "title": "" }, { "docid": "a4c5f791e5919dfcde79c9fa3527a12a", "score": "0.55653477", "text": "get isWinningStage() {\r\n\t\treturn this.h==0;\r\n\t}", "title": "" }, { "docid": "0f4f82cb07092cd8b6ddd111b0c1b054", "score": "0.5565186", "text": "function calculateHand(hand) {\n let total,\n aces = 0;\n\n total = hand.reduce((acc, curr) => {\n if (curr !== \"A\") {\n return acc + CARD_VALUE_MAP[curr];\n } else {\n aces++;\n return acc;\n }\n }, 0);\n\n for (let i = 0; i < aces; i++) {\n if (total + 11 > 21) total += 1;\n else total += 11;\n }\n\n return total;\n}", "title": "" }, { "docid": "4b047870d1dabfd4f261921fb26164ef", "score": "0.5550701", "text": "deal() {\n\t\tlet h = Math.floor(this.tiles.length / 2);\n\t\tlet wallTop = this.tiles.slice(0, h);\n\t\tlet wallBot = this.tiles.slice(h, this.tiles.length);\n\t\tthis.hands = {\n\t\t\t'E':[],\n\t\t\t'S':[],\n\t\t\t'W':[],\n\t\t\t'N':[]\n\t\t};\n\t\tfor (let i = 0; i < 3; i ++) {\n\t\t\tObject.keys(this.hands).forEach((hand) => {\n\t\t\t\tthis.hands[hand].push(wallTop.shift());\n\t\t\t\tthis.hands[hand].push(wallTop.shift());\n\t\t\t\tthis.hands[hand].push(wallBot.shift());\n\t\t\t\tthis.hands[hand].push(wallBot.shift());\n\t\t\t});\n\t\t}\n\t//From then, East takes the first and third tile from the top stack\n\t//while the other players take one\n\t\tArray.prototype.push.apply(this.hands.E, wallTop.splice(2, 1));\n\t\tthis.hands.E.push(wallTop.shift());\n\t\tthis.hands.S.push(wallBot.shift());\n\t\tthis.hands.W.push(wallTop.shift());\n\t\tthis.hands.N.push(wallBot.shift());\n\t\tthis.wall = {\n\t\t\t'top':wallTop,\n\t\t\t'bot':wallBot\n\t\t};\n\t\treturn this.hands;\n\t}", "title": "" }, { "docid": "c6f0055b16cfc99984ecb3c9795c59fa", "score": "0.5541367", "text": "houses(state) {\n return state.houses;\n }", "title": "" }, { "docid": "78605f580373a1920148d095921ee6de", "score": "0.5525125", "text": "function hoverHand() {\n const hoveredHand = playerHands.indexOf(this);\n\n for (let i = 0; i < playerHands.length; i++) {\n if (i === hoveredHand) {\n this.classList.remove(\"unselected-hand\");\n this.classList.add(\"selected-hand\");\n } else {\n playerHands[i].classList.remove(\"selected-hand\");\n playerHands[i].classList.add(\"unselected-hand\");\n }\n }\n}", "title": "" }, { "docid": "1422632b4af663eef2b2aeab5e5e52b4", "score": "0.5523216", "text": "function humanWin() {\n var countRow = [0, 0, 0]; //Create count arrays\n var countCol = [0, 0, 0];\n \n for (var b = 0; b < 3; b++) { // Check rows and columns\n for (var a = 0; a < 3; a++) {\n if (board.state[a][b] === \"1\") {\n countRow[a]++;\n countCol[b]++;\n }\n if (countRow[a] === 3)\n won = 1;\n if (countCol[b] === 3)\n won = 1;\n }\n }\n \n // Check both diagonals\n if (board.state[0][0] === \"1\" &&\n board.state[1][1] === \"1\" &&\n board.state[2][2] === \"1\")\n won = 1;\n \n if (board.state[0][2] === \"1\" &&\n board.state[1][1] === \"1\" &&\n board.state[2][0] === \"1\")\n won = 1;\n \n return won;\n }", "title": "" }, { "docid": "7a9ba1571e99de464b7740fc56de0298", "score": "0.55165815", "text": "function GameState() {\r\n this.SideToPlay = 1; //0 == Tigers, 1 == Goats same as AgentIndex\r\n this.OutsideGoats = 15;\r\n //array of 23 elements corresponding to 23 squares of the board. Each square is either empty or has a goat or a tiger in it.\r\n this.CurrentPosition = ['T', 'E', 'E', 'T', 'T', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E'];\r\n this.Hash = 0; // A compact representation of the game state. Hash is a 51 bit binary number.\r\n this.Result = -1; // 0 == Tigers win, 1 == Goats Win, 2 == Draw, -1 == no result\r\n}", "title": "" }, { "docid": "e568e86d3276a95132cce9f9fbd1afea", "score": "0.5480154", "text": "function getState () {\n const L = getSideState('L')\n const R = getSideState('R')\n\n if (!L && !R) {\n return\n }\n\n const result = {}\n\n if (L) {\n result.L = L\n }\n if (R) {\n result.R = R\n }\n\n return result\n\n function getSideState (side) {\n const gamepad = joyCons[side]\n if (gamepad) {\n const result = {}\n const { axes, buttons } = gamepad\n const axesResult = axesMap[gamepad.axes[9].toString().slice(0, 5)]\n const buttonsResult = gamepad.buttons\n .map((btn, index) => ({\n key: buttonMap[side][index],\n pressed: btn.pressed\n }))\n .filter(({ pressed }) => pressed)\n .map(info => info.key)\n if (axesResult === undefined && buttonsResult.length === 0) {\n return\n }\n if (axesResult !== undefined) {\n result.axes = axesResult\n }\n if (buttonsResult.length > 0) {\n result.buttons = buttonsResult\n }\n return result\n }\n }\n}", "title": "" }, { "docid": "082d6d620f4a3a8cda8315a8d57d2a96", "score": "0.5475696", "text": "allCellsHaveBeenPlayed() {\n\t\treturn (this.currentState.filter((val) => val !== undefined).length === this.numCells);\n\t}", "title": "" }, { "docid": "7adb1c2f8e4eadd47eceb6b40b2abf16", "score": "0.54687864", "text": "function Poker() {\n this.POSSIBLE_SUITS = ['C', 'D', 'S', 'H'];\n this.POSSIBLE_FACES = ['2','3','4','5','6','7','8','9','10','J','Q','K','A'];\n // ordered in increasing high card value\n this.POSSIBLE_HIGH_CARDS = ['7','8','9','10','J','Q','K','A'];\n this.suitCounter = { 'C': 0, 'D': 0, 'S': 0, 'H': 0 };\n this.faceCounter = { '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0, '10': 0, 'J': 0, 'Q': 0, 'K': 0, 'A': 0 };\n this.isFlush = false;\n this.isStraight = false;\n this.availableHands = [] // current hands\n\n /*\n Takes a hand of cards as string encoded inputs and determines possible hands\n @method hands\n @param cards String\n @return Array\n */\n this.hands = (cards) => {\n // transform string into array of suit/face string pairs\n let cardArray = parseCards(cards);\n if (findDuplicates(cardArray).length !== 0) {\n console.log('Non-unique cards, cheater cheater pumpking eater');\n return;\n }\n cardArray = countCards(cardArray);\n if (isHandInvalid(cardArray)) {\n console.log('Invalid poker hand');\n return;\n }\n checkPossibleHands(cardArray);\n console.log(this.availableHands);\n }\n\n /*\n Determine whether the poker hand is valid or not\n @method isHandInvalid\n @param cards Array\n @return Boolean\n */\n let isHandInvalid = (cardArray) => {\n return cardArray.length !== 5;\n }\n\n /*\n Takes a string input of cards and sanitize it for reading\n @method parseCards\n @param cards String\n @return Undefined\n */\n let parseCards = (cards) => {\n let cardStr = cards.toUpperCase();\n let cardArray = cardStr.split(' ');\n return cardArray;\n }\n\n /*\n Count faces and suits for card array and return valid cards\n @method countCards\n @param cards Array\n @return Array\n */\n let countCards = (cards) => {\n let validCardArray = [];\n for (let ii=0; ii < cards.length; ii++) {\n let face = decodeCard(this.POSSIBLE_FACES, cards[ii], 0);\n let suit = decodeCard(this.POSSIBLE_SUITS, cards[ii], 1);\n\n if (!face || !suit) {\n console.log(`invalid card ${cards[ii]}`);\n continue;\n }\n\n validCardArray.push(cards[ii]);\n\n this.faceCounter[face] += 1; \n this.suitCounter[suit] += 1;\n }\n\n return validCardArray;\n }\n\n /*\n Takes a hand of cards as string encoded inputs and determines possible hands\n If invalid return nothing\n @method decodeCard\n @param list Array possible values to compare\n @param card Array string values\n @param idx Number desired index pos of card to get val\n\n @return val\n */\n let decodeCard = (list, card, idx) => {\n if (card.length < 2) {\n return;\n }\n\n let isValid = false;\n\n let val = card[idx];\n\n for (let ii=0; ii < list.length; ii++) {\n if (list[ii] == val) {\n isValid = true;\n }\n }\n\n if (isValid) {\n return val;\n }\n\n return;\n }\n\n /*\n Mutates the availableHands class property by checking types of hands\n the order of these checks sets precedent for what is the \"highest\" rated hand\n\n @method checkPossibleHands\n @param cardArray Array string values\n @return undefined\n */\n let checkPossibleHands = (cardArray) => {\n checkFlush(cardArray);\n checkStraight(cardArray);\n\n if (this.isFlush && this.isStraight) {\n addHands('Straight flush');\n return;\n } else if (this.isFlush) {\n addHands('Flush');\n return;\n } else if (this.isStraight) {\n addHands('Straight');\n return;\n }\n\n addHands(checkOfAKind(cardArray, 4));\n addHands(checkOfAKind(cardArray, 3));\n addHands(checkOfAKind(cardArray, 2));\n addHands(checkHighCard(cardArray));\n }\n\n /*\n Mutates the availableHands class property by concatenating handsToAdd (if applicable)\n\n @method addHands\n @param cardArray Array string values\n @return undefined\n */\n let addHands = (handsToAdd) => {\n if (handsToAdd) {\n this.availableHands = this.availableHands.concat(handsToAdd);\n }\n }\n\n let getMax = (arr) => {\n let max = 0;\n for (let ii=0; ii<arr.length; ii++ ) {\n if (max < arr[ii]) {\n max = arr[ii];\n }\n }\n\n return max;\n }\n\n let getMin = (arr) => {\n let min = arr[0]; // arbitrary min \n for (let ii=0; ii<arr.length; ii++ ) {\n if (arr[ii] < min) {\n min = arr[ii];\n }\n }\n\n return min;\n }\n\n /*\n Determines how many of a kind are in an array of card strings\n @method findDuplicates\n @param arr Array string values\n @return Array\n */\n let findDuplicates = (arr) => {\n let len = arr.length,\n out = [],\n counts = {};\n\n for (let ii=0; ii<len; ii++) {\n let item = arr[ii];\n counts[item] = counts[item] >= 1 ? counts[item] + 1 : 1;\n }\n\n for (let item in counts) {\n if(counts[item] > 1)\n out.push(item);\n }\n\n return out;\n }\n\n /*\n Determines how many of a kind are in an array of card strings\n @method checkOfAKind\n @param cardArray Array string values\n @param numOfAKind Number how many of a kind\n @return Array\n */\n let checkOfAKind = (cardArray, numOfAKind) => {\n if (cardArray.length === 0) {\n return;\n }\n let hand, suit, usedCards = [];\n let faces = Object.keys(this.faceCounter);\n let ofAKindCounter = 0;\n for (let ii=0; ii < faces.length; ii++) {\n let key = faces[ii];\n if (this.faceCounter[key] === numOfAKind) {\n ofAKindCounter += 1;\n suit = findMatching('suit', key, cardArray);\n usedCards.push(`${this.faceCounter[key]}${suit}`);\n }\n }\n\n if (numOfAKind === 2) {\n if (ofAKindCounter == 2) {\n hand ='two pair';\n } else if (ofAKindCounter == 1) {\n hand = 'one pair';\n }\n } else if (numOfAKind === 3 && ofAKindCounter) {\n hand = 'three of a kind';\n } else if (numOfAKind === 4 && ofAKindCounter) {\n hand = 'four of a kind';\n }\n\n clearUsed(usedCards);\n\n if (hand) {\n return [hand];\n }\n }\n\n /*\n Determines whether the hand is a straight by checking indexes\n Mutates isStraight flag if true\n @method checkStraight\n @param cardArray Array string values\n @return undefined\n */\n let checkStraight = (cardArray) => {\n let hand;\n let faces = Object.keys(this.faceCounter);\n let indexArray = [];\n for (let ii=0;ii<faces.length;ii++) {\n if (this.faceCounter[faces[ii]] > 0) {\n indexArray.push(ii);\n }\n }\n\n let max = getMax(indexArray);\n let min = getMin(indexArray);\n\n if (max - min === 4) {\n this.isStraight = true;\n }\n }\n\n /*\n Determines whether the hand is a flush\n Mutates isFlush flag if true\n @method checkFlush\n @param cardArray Array string values\n @return undefined\n */\n let checkFlush = (cardArray) => {\n let hand;\n let suits = Object.keys(this.suitCounter);\n for (let ii=0;ii<suits.length;ii++) {\n if (this.suitCounter[suits[ii]] === 5) {\n this.isFlush = true;\n }\n }\n }\n\n let checkHighCard = (cardArray) => {\n let face, suit;\n for (let ii=0;ii<this.POSSIBLE_HIGH_CARDS.length;ii++) {\n if (this.faceCounter[this.POSSIBLE_HIGH_CARDS[ii]] === 1) {\n face = this.POSSIBLE_HIGH_CARDS[ii];\n suit = findMatching('suit', face, cardArray);\n }\n }\n\n if (face && suit) {\n return `high card: ${face}${suit}`;\n }\n }\n\n /*\n matching val toFind [suit||face] for a given [suit||face]\n should match only one\n */\n let findMatching = (toFind, given, cardArray) => {\n let match;\n if (toFind === 'face') {\n for (let ii=0; ii<cardArray.length; ii++) {\n if (cardArray[ii][1] === given) {\n match = cardArray[ii][0];\n }\n }\n } else if (toFind === 'suit') {\n for (let ii=0; ii<cardArray.length; ii++) {\n if (cardArray[ii][0] === given) {\n match = cardArray[ii][1];\n }\n }\n }\n\n return match;\n }\n\n let clearUsed = (usedCards) => {\n for(let ii=0; ii<usedCards.length;ii++) {\n let card = usedCards[ii];\n this.suitCounter[card[1]] -= 1;\n this.faceCounter[card[0]] -= 1;\n }\n }\n}", "title": "" }, { "docid": "dcfe967b42e3ca4422657c7ab7f49634", "score": "0.54573506", "text": "function evaluateHand(data){\n let hand = sortHand(data), result = {type: 1, hand: [], originalHand: hand};\n let flushes = getFlushes(hand);\n let straights = getStraights(hand);\n let matches = evaluateMatchHands(findMatches(hand));\n\n if(getStraights(flushes).length > 0){\n result.type = 9;\n result.hand = getStraights(flushes);\n }else if(matches.type === 8){\n result.type = 8;\n result.hand = matches.cards; //TODO: add kicker\n let kickers = findKickers({hand: result.hand, cards: hand});\n result.hand.push(kickers[kickers.length-1]);\n }else if(matches.type === 7){\n result = matches;\n }else if(flushes.length > 0){\n while(flushes.length != 5){\n flushes.splice(0,1);\n }\n result.hand = flushes;\n result.type = 6;\n }else if(straights.length > 0){\n result.type = 5;\n result.cards = straights[straights.length - 1];\n }else{\n result.type = matches.type;\n if(matches.length > 0) {\n result.hand = [matches.cards[0][0], matches.cards[0][1]];\n }\n let kickers = findKickers({hand: result.hand, cards: hand});\n while(result.hand.length < 5){\n if(kickers[0].value == 1){\n result.hand.push(kickers[0]);\n kickers.splice(0, 1);\n }else{\n result.hand.push(kickers.pop());\n }\n }\n\n }\n return result;\n}", "title": "" }, { "docid": "f118b85731f048fca044b450dcdb0544", "score": "0.54551244", "text": "function new_state(life_array, i, j) {\n var n_rows = life_array.length;\n var n_cols = life_array[0].length; \n var nbr_idxs = neighbor_idxs(i, j, n_rows, n_cols);\n var nbrs = nbr_idxs.map(k => life_array[k[0]][k[1]]);\n var n_nbrs_alive = nbrs.reduce((a, b) => { return a + b;});\n \n if (life_array[i][j] == true) {\t\n\treturn (n_nbrs_alive == 2) || (n_nbrs_alive == 3);\n }\n else {\n\treturn n_nbrs_alive == 3;\n }\n}", "title": "" }, { "docid": "5be940f80a84f615c11d0a8634051f01", "score": "0.54530495", "text": "function getLeftHand(hands) {\n var left = null;\n\n for(i = 0; i < hands.length; i++) {\n var hand = hands[i]\n if(left == null || hand.palmPosition[0] < left.palmPosition[0]) {\n left = hand;\n }\n }\n\n return left;\n}", "title": "" }, { "docid": "30e7e39ef2f265a68aff0cb3f21ec8d2", "score": "0.54418725", "text": "function evalu(state, count) {\n\tfor (var i = 0; i < state.length; i++) {\n\t\tif (state[i][0] == state[i][1] && state[i][1] == state[i][2]) {\n\t\t\tif (state[i][0] == 0) {// O won\n\t\t\t\treturn -1;\n\t\t\t} else if (state[i][0] == 1) { // X won\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\tfor (var j = 0; j < 3; j++) {\n\t\tif (state[0][j] == state[1][j] && state[1][j] == state[2][j]) {\n\t\t\tif (state[0][j] == 0) { // O won\n\t\t\t\treturn -1;\n\t\t\t} else if (state[0][j] == 1) { // X won\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\tif (state[0][0] == state[1][1] && state[0][0] == state[2][2]) {\n\t\tif (state[0][0] == 0) { // O won\n\t\t\treturn -1;\n\t\t} else if (state[0][0] == 1) { // X won\n\t\t\treturn 1;\n\t\t}\n\t}\n\tif (state[0][2] == state[1][1] && state[1][1] == state[2][0]) {\n\t\tif (state[0][2] == 0) { // O won\n\t\t\treturn -1;\n\t\t} else if (state[0][2] == 1) { // X won\n\t\t\treturn 1;\n\t\t}\n\t}\n\tif (count == 9)\n\t\treturn 0;\n\treturn NaN;\n}", "title": "" }, { "docid": "b243e53e703480a3ace3973dab0b4892", "score": "0.5440824", "text": "function determineNextState() {\n\n\tlet stateChanged = false;\n\n\tfor (let column = 0; column < cellArray.length; column++) {\n\n\t\tfor (let row = 0; row < cellArray[column].length; row++) {\n\n\t\t\tfor (let layer = 0; layer < cellArray[column][row].length; layer++) {\n\n\t\t\t\tconst cell = cellArray[column][row][layer];\n\n\t\t\t\tlet nextState = null;\n\t\t\t\tlet aliveNeighbors = countAliveNeighbors(column, row, layer);\n\n\t\t\t\t// This logic is detailed in the comments on settings.rules\n\t\t\t\tif (cell.currentState === cellStates.dead) {\n\n\t\t\t\t\tconst aboveMin = aliveNeighbors > settings.rules.birthMin;\n\t\t\t\t\tconst belowMax = aliveNeighbors < settings.rules.birthMax;\n\n\t\t\t\t\tif (aboveMin && belowMax) {\n\n\t\t\t\t\t\tcell.nextState = cellStates.alive;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tcell.nextState = cellStates.dead;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst starved = aliveNeighbors < settings.rules.starvation;\n\t\t\t\t\tconst crowded = aliveNeighbors > settings.rules.overcrowding;\n\n\t\t\t\t\tif (starved || crowded) {\n\n\t\t\t\t\t\tcell.nextState = cellStates.dead;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tcell.nextState = cellStates.alive;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (!stateChanged && cell.nextState !== cell.currentState) {\n\n\t\t\t\t\tstateChanged = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tstats.isStalled = !stateChanged;\n\n}", "title": "" }, { "docid": "15438f076556564c50bb58d1fda6d24a", "score": "0.54295206", "text": "findGuessed(card) {\n let i;\n for(i = 0; i != 16; i++) {\n if (this.state.cards[i].guessed == true &&\n !(_.isEqual(this.state.cards[i].id, card.id))) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "a8aa8d67a24efef5573942c6b39d4784", "score": "0.5415567", "text": "heuristic(state, turn) {\n\n let state_value = check_final_state(state);\n // pareggio o partita in corso\n if (state_value == 0 || state_value == 1) {\n return 0;\n }\n // vittoria player\n else if (state_value == player_id(turn)) {\n return 1;\n }\n // vittoria player\n else {\n return -1;\n }\n\n }", "title": "" }, { "docid": "3511a1b02273103990ced532a025359d", "score": "0.5408598", "text": "function getPieceCount(boardState) {\r\n var numWhite = 0;\r\n var numBlack = 0;\r\n var pieces = boardState.pieces;\r\n for (var i=0;i<pieces.length;i++) {\r\n var piece = pieces[i];\r\n if (piece.col >=0 && piece.row >=0){\r\n if (piece.state === white || piece.state === whiteKing) {\r\n numWhite += 1;\r\n }\r\n else if (piece.state === black || piece.state === blackKing) {\r\n numBlack += 1;\r\n }\r\n }\r\n }\r\n\r\n return {white: numWhite, black: numBlack};\r\n}", "title": "" }, { "docid": "e7ab01d52698457bf6ceea068f684bde", "score": "0.5407689", "text": "calculateGameState() {\n if (this.getAllPieceMoves(this.currentPlayerColor).length == 0) {\n if (this.isChecked(this.currentPlayerColor)) return this.getOppositePlayerColor();\n return 'stalemate';\n }\n return 'unresolved';\n }", "title": "" }, { "docid": "9eec269de3aee411fa247b4fc4e51c9a", "score": "0.5404595", "text": "function next_states(board, color){\n\tvar next_states = [];\n\tfor(let i = 0; i < 7; i++){\n\t\tconst next_board = drop_piece(board, i, color);\n\t\tnext_states.push(next_board);\n\t}\n\tconsole.log(next_states);\n\treturn next_states;\n}", "title": "" }, { "docid": "1b05222f8986c0b3945efa29da62a46d", "score": "0.53999066", "text": "function get_current_state(grid){\n for(var row = 0; row < n; row++){\n for(var coloumn = 0; coloumn <n; coloumn++){\n if(grid[row][coloumn] == target){\n return 1;\n\n }\n }\n }\n for(var row = 0; row < n; row++){\n for(var coloumn = 0; coloumn <n; coloumn++){\n if(grid[row][coloumn]== 0){\n return 0;\n }\n }\n }\n for(var row = 0; row < n-1; row++){\n for(var coloumn = 0; coloumn <n-1; coloumn++){\n if(grid[row][coloumn] == grid[row + 1][coloumn] || grid[row][coloumn] == grid[row][coloumn + 1]){\n return 0;\n }\n }\n }\n for(var coloumn = 0; coloumn < n-1; coloumn++){\n if(grid[n-1][coloumn] == grid[n-1][coloumn + 1])\n return 0;\n }\n for(var row = 0; row < n-1; row++){\n if(grid[row][n-1]== grid[row + 1][n-1])\n return 0;\n \n }\n return -1;\n}", "title": "" }, { "docid": "3f0dfa120fb39f95ede54d8682152399", "score": "0.5393489", "text": "function getHands() {\n getShuffledDeck();\n playerHand = shuffledDeck.splice(0, 26);\n enemyHand = shuffledDeck.splice(0, 26);\n}", "title": "" }, { "docid": "a35042dbeb11d8abcc32c853fc0cb5f2", "score": "0.53895855", "text": "function drawHand(hand, handState, color) {\n\n if (handState === 1) {\n state = 'ascending';\n }\n\n if (handState === 0) {\n state = 'descending';\n }\n\n if (state == 'ascending') {\n diameter = lerp(diameter, target, lerpAmt);\n hueValue = lerp(hueValue, dark, lerpAmt);\n }\n\n if (state == 'descending') {\n diameter = lerp(diameter, start, lerpAmt);\n hueValue = lerp(hueValue, light, lerpAmt);\n }\n\n fill(color);\n\n // Kinect location needs to be normalized to canvas size\n ellipse(hand.depthX * myCanvas.width, hand.depthY * myCanvas.height, diameter, diameter);\n}", "title": "" }, { "docid": "247f2030cf5797eba0da73ca24e2e158", "score": "0.5388017", "text": "getAllPossibleStates() {\n let possibleStates = [];\n let availablePositions = this.board.getEmptyPositions();\n\n availablePositions.forEach(p => {\n let newState = new State(this.board);\n newState.playerNo = 3 - this.playerNo;\n newState.board.performMove(newState.playerNo, p);\n possibleStates.push(newState);\n })\n\n return possibleStates;\n }", "title": "" }, { "docid": "dce3313100d98d515d2dc736a49aec82", "score": "0.5381477", "text": "get playHasEnded(): boolean {\n\t\treturn (this.boardState.cards.length === Seat.all().reduce((total, seat) => total + this.hands[seat].length, 0));\n\t}", "title": "" }, { "docid": "8bc6cf9a68941148a66bcd81918a9f75", "score": "0.5375499", "text": "function isHandFlush(hand, options) {\n const result = {};\n\n if ((Math.max.apply(null, hand.suits) + hand.wildCards) >= options.cardsToEvaluate) {\n // Return the cards that make the flush if requested\n result.isFlush = true;\n if (options.getDetails) {\n // Return value needs to be the matching cards\n const cards = [];\n\n // We would suggest starting with wild cards\n getWildCards(cards, hand, options);\n getLikeSuit(cards, hand, options, Math.max.apply(null, hand.suits));\n result.cards = cards;\n }\n } else {\n // Not a flush\n result.isFlush = false;\n }\n\n return result;\n}", "title": "" }, { "docid": "2b201a16bc9e5d70327b2c44bdb881c8", "score": "0.5370641", "text": "function selectedCards(){\n return game.currentPlayer.hand.filter( v=>v.selected )\n}", "title": "" }, { "docid": "84a4aa7b0d55db06eb2c6b1988c5cb4d", "score": "0.5365959", "text": "getSuccessors(state, stepSize){\n stepSize = stepSize || 1;\n let states = [];\n let x = state.coords[0] - stepSize; // get start index\n x = x < 0 ? 0 : x;\n while(x <= state.coords[0] + stepSize){\n if(x != state.coords[0] && state.coords[0] < this.scores.length){\n states.push(new State([x], this.scores[x]));\n }\n x++;\n }\n return states;\n }", "title": "" }, { "docid": "bd687f76168372b41fac629ef1414572", "score": "0.5355554", "text": "function handIsOpen() {\n if (handDistance > threshold) { // modify distance for testing\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "2f3bd11c68c2a5c41ae9c52a2c0d9927", "score": "0.53529817", "text": "function canSummon() {\n var sets = 0;\n var i;\n var length;\n var j;\n\n for (i = 0, length = yourHand.length; i < length; i++) {\n var card = yourHand[i];\n var count = 1;\n for (j = i + 1; j < length; j++) {\n var otherCard = yourHand[j];\n if (card.element === otherCard.element &&\n card.level === otherCard.level) {\n count++;\n if (count === 3) {\n sets++;\n }\n }\n }\n }\n\n return sets === 2;\n }", "title": "" }, { "docid": "6b31653e7fc7c04264b1b9796b1df889", "score": "0.5344721", "text": "get declarerTricks(): number {\n\t\tlet trickCount = Math.floor(this.boardState.cards.length / 4);\n\t\tlet result = 0;\n\n\t\tlet sortTrick = (trick) => {\n\t\t\tlet leadSuit = trick[0].card.suit;\n\t\t\treturn trick.sort((played1, played2) => Card.compare(played1.card, played2.card, this.trumpSuit, leadSuit));\n\t\t};\n\n\t\tfor (let i = 0; i < trickCount; i ++) {\n\t\t\tlet trick = this.boardState.cards.slice(i * 4, (i * 4) + 4);\n\n\t\t\tlet winner = sortTrick(trick)[3].seat;\n\n\t\t\tif ((winner === this.declarer) || Seat.isPartner(this.declarer, winner))\n\t\t\t\tresult ++;\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "597ff361b45683e723b9c4e116097af6", "score": "0.53401166", "text": "function startHand() {\n reset();\n initState();\n middleBlanks();\n initPlayed();\n initHand();\n start = 0;\n blinds();\n showing = 0;\n turn = !dealer;\n nextAction();\n}", "title": "" }, { "docid": "6c68dd81bdb5fa31cb664528bda104fb", "score": "0.53382134", "text": "function getInput()\n{\n\thasPerception = true;\n\tattackCycle = 3.0;\n\theroStates = [19.0, 18.0, 17.0, 2.0, 1.0, 0.0, 2.0, 1.0, 0.0, 2.0];\n\tadversaryStates = [19.0, 18.0, 17.0, 2.0, 1.0, 0.0, 2.0, -1.0, 0.0, 2.0];\n}", "title": "" }, { "docid": "911509bc6e0eb2a304b7a1c0c0f0114f", "score": "0.5332716", "text": "function getState() {\n \tvar state = {\n \t\tgrid: clone(grid),\n \t\tcurrentShape: clone(currentShape),\n \t\tupcomingShape: clone(upcomingShape),\n \t\tbag: clone(bag),\n \t\tbagIndex: clone(bagIndex),\n \t\trndSeed: clone(rndSeed),\n \t\tscore: clone(score)\n \t};\n \treturn state;\n }", "title": "" }, { "docid": "1d779e11c5cf0b7165e1035ac37cd846", "score": "0.53294605", "text": "checkForFlush(tempAlterableHand){\n let flushedCards = []\n let spades = []\n let hearts = []\n let diamonds = []\n let clubs = []\n let isFlushed = false\n for(let i = 0; i < tempAlterableHand.length; i++){\n if(tempAlterableHand[i][1] === `S` && spades.includes(tempAlterableHand[i]) === false){\n spades.push(tempAlterableHand[i])\n }else if(tempAlterableHand[i][1] === `H` && hearts.includes(tempAlterableHand[i]) === false){\n hearts.push(tempAlterableHand[i])\n }else if(tempAlterableHand[i][1] === `D` && diamonds.includes(tempAlterableHand[i]) === false){\n diamonds.push(tempAlterableHand[i])\n }else if(tempAlterableHand[i][1] === `C` && clubs.includes(tempAlterableHand[i]) === false){\n clubs.push(tempAlterableHand[i])\n }\n }\n if(spades.length >= 5){\n flushedCards = spades\n isFlushed = true\n }else if(hearts.length >= 5){\n flushedCards = hearts\n isFlushed = true\n }else if(diamonds.length >= 5){\n flushedCards = diamonds\n isFlushed = true\n }else if(clubs.length >= 5){\n flushedCards = clubs\n isFlushed = true\n }\n if(isFlushed){\n return flushedCards\n }else{\n return false\n }\n }", "title": "" }, { "docid": "ee692e150e6b3efed7e232b4840dcb4f", "score": "0.53076375", "text": "get inCheckmate() {\n return Object.keys(this.checked_moves).length == 0;\n }", "title": "" }, { "docid": "96ffd26e0f92110167cb34a4dc0bccbc", "score": "0.5282907", "text": "function findHandValue(hand) {\n\t\tvar handValue;\n\n\t\tif (validateStraight(hand) && validateFlush(hand)) {\n\t\t\thandValue = 250;\n\t\t} else if (validate3Kind(hand)) {\n\t\t\thandValue = 200;\n\t\t} else if (validateStraight(hand)) {\n\t\t\thandValue = 150;\n\t\t} else if (validateFlush(hand)) {\n\t\t\thandValue = 100;\n\t\t} else if (validatePair(hand)) {\n\t\t\thandValue = 50;\n\t\t} else {\n\t\t\thandValue = hand[2].rank;\n\t\t}\n\n\t\treturn handValue;\n\t}", "title": "" }, { "docid": "83d0f952c1145a9e265d822abf087c32", "score": "0.52782506", "text": "function getRightHand(hands) {\n var right = null;\n\n for(i = 0; i < hands.length; i++) {\n var hand = hands[i]\n if(right == null || hand.palmPosition[0] > right.palmPosition[0]) {\n right = hand;\n }\n }\n\n return right;\n}", "title": "" }, { "docid": "e0a48b470f0be44babdd74ac9019e05b", "score": "0.52759874", "text": "checkPreWinCondition() {\n const { currentPlayer } = this.state\n const check = (index) => {\n if (currentPlayer === 'player1')\n return (\n this.state[currentPlayer].stoneMoves[index].includes(\n 'ML'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'MM'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'MR'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'BL'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'BM'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes('BR')\n )\n else\n return (\n this.state[currentPlayer].stoneMoves[index].includes(\n 'ML'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'MM'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'MR'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'TL'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes(\n 'TM'\n ) ||\n this.state[currentPlayer].stoneMoves[index].includes('TR')\n )\n }\n if (check(0) && check(1) && check(2))\n this.state[currentPlayer].movedAllStones = true\n }", "title": "" }, { "docid": "1de29f6432c3701f075b9fe69c940763", "score": "0.5270497", "text": "function figureOutState() {\n var ashleysStates = ['Michigan', 'Washington'];\n for(var guesses = 0; guesses < 6; guesses++) {\n var stateGuess = prompt('Ashley has lived in ' + ashleysStates.length + ' states. Try to guess one!');\n console.log(userName + '\\'s state guess: ' + stateGuess);\n // TODO: adjust need for correct capitalization\n // TODO: remove the hard coding references in the array\n var theyWereRight = false;\n for (var stateIndex = 0; stateIndex < ashleysStates.length; stateIndex++) {\n if(stateGuess === ashleysStates[stateIndex]) {\n theyWereRight = true;\n }\n }\n if(theyWereRight) {\n alert('Correct! The ' + ashleysStates.length + ' states Ashley has lived in are: ' + ashleysStates[0] + ' and ' + ashleysStates[1]);\n correctAnswers++;\n break;\n } else if (guesses === 5) {\n alert('That\\'s enough guessing for today. The two states Ashley has lived in are: ' + ashleysStates[0] + ' and ' + ashleysStates[1]);\n } else {\n alert('Cool state! But Ashley hasn\\'t lived there. Try again.');\n }\n }\n}", "title": "" }, { "docid": "8912b24072ed4b19ce634f0084598132", "score": "0.5270246", "text": "getState() {\n\t \treturn this.state;\n\t }", "title": "" }, { "docid": "a3db9468e5c8f3707a289b9ad1c6431d", "score": "0.52702016", "text": "function HCP(hand) {\n var hipt = 0;\n for (var cardind = 0; cardind < hand.length; cardind++) {\n var crdval = hand[cardind].valu;\n if (crdval in pointlist) hipt += pointlist[crdval];\n }\n return hipt;\n}", "title": "" }, { "docid": "1950e47ea96ba988929fb6f6d4acbf5f", "score": "0.5269347", "text": "getLetterStates(x, y) {\n if (!([x,y] in this.state.tiles)) {\n console.log(\"INVALID letter state query\");\n return null;\n }\n let letters = new Set();\n this.getWord(x, y, true).forEach(pos => letters.add(pos))\n this.getWord(x, y, false).forEach(pos => letters.add(pos))\n letters.delete([x, y]);\n\n let res_set = {};\n var self = this;\n letters.forEach(pos => {\n var ts = self.state.tiles[pos];\n ts.guesses.forEach(guess => {\n\n var l = guess.letter;\n\n if (guess.state == TILE_STATE_WRONG) {\n res_set[l] = LETTER_STATE_NO;\n }\n else if ((guess.state == TILE_STATE_ELSEWHERE\n || guess.state == TILE_STATE_ELSEWHERE_MAYBE) && !(pos in res_set))\n {\n // Maybe! (and we haven't previously marked this tile)\n res_set[l] = LETTER_STATE_MAYBE;\n }\n });\n });\n\n // Guesses we know aren't correct from the current tile.\n self.state.tiles[[x, y]].guesses.forEach(guess => {\n if (guess.state == TILE_STATE_ELSEWHERE || guess.state == TILE_STATE_ELSEWHERE_MAYBE || TILE_STATE_WRONG) {\n res_set[guess.letter] = LETTER_STATE_NO;\n }\n });\n\n // let res = [];\n // for (const [letter, state] of Object.entries(res_set)) {\n // res.push({\n // \"letter\": letter,\n // \"state\": state,\n // });\n // }\n\n return res_set;\n }", "title": "" }, { "docid": "1c276a4c129ec24859cb5e042b875212", "score": "0.5264212", "text": "function WetHands(wash) {\n WashState.call(this, wash);\n}", "title": "" }, { "docid": "38d3e3380d48ae309e2687dc94e33d86", "score": "0.52634263", "text": "setupPlayerHand(){\n\t\tlet initialPlayerHand = [];\n\n\t\tfor(let i = 0; i <= 3; i++){\n\t\t\tinitialPlayerHand.push(this.state.gameCards.money[0]);\n\t\t\t//console.log(initialPlayerHand);\n\t\t}\n\n\t\tfor(let i = 0; i <= 2; i++){\n\t\t\tinitialPlayerHand.push(this.state.gameCards.victory[0]);\n\t\t}\n\n\t\treturn initialPlayerHand;\n\t\t\n\t}", "title": "" }, { "docid": "3c0e399d877defb8dea783510df206bd", "score": "0.5259385", "text": "async getHand(x, xs, os) { // bool(x) whether its X's turn\n // Present the buttons to the user so that they can actually select their move\n // hand is a box ID number relative to numeric keypad\n let valid = 1; // occupied\n let hand = null;\n \n\n while (valid > 0) { // while occupied\n hand = await new Promise((resolveHandP) => {\n this.setState({\n view: \"GetHand\",\n resolveHandP,\n xs, // 1d array of 1's 0's; 1 = occupied by X\n os // 1d array of 1's 0's; 1 = occupied by O\n });\n\n for (let i = 1; i < 10; i++) {\n if (dev) {\n console.log(`${i} ${intToHand[i]} xs[i-1]=${parseInt(xs[i-1])} os[i-1]=${parseInt(os[i-1])}`);\n }\n if (parseInt(xs[i-1]) === 1) {\n document.getElementById(intToHand[i]).src = X_image; \n }\n if (parseInt(os[i-1]) === 1) {\n document.getElementById(intToHand[i]).src = O_image;\n }\n }\n });\n var blinger = document.getElementById(\"bling\");\n blinger.play();\n\n valid = (\n parseInt(os[handToInt[hand]])\n + parseInt(xs[handToInt[hand]])\n ); // should return 1=occupied / 0=vacant\n if (dev) {\n console.log(`${valid}`);\n }\n\n };\n \n sleep(4000);\n\n if (dev) {\n console.log(`${os}`);\n console.log(`${xs}`);\n }\n \n // Display that a move as been accepted\n this.setState({\n view: \"GetHandb\",\n playable: true\n });\n\n document.getElementById(hand).src = {\n x: X_image, \n o: O_image,\n }[x ? \"x\" : \"o\"];\n\n if (dev) {\n console.log(`${hand}`);\n }\n for (let i = 1; i < 10; i++) {\n if (dev) {\n console.log(`${i} ${intToHand[i]} xs[i-1]=${parseInt(xs[i-1])} os[i-1]=${parseInt(os[i-1])}`);\n }\n if (parseInt(xs[i-1]) === 1) {\n document.getElementById(intToHand[i]).src = X_image; \n }\n if (parseInt(os[i-1]) === 1) {\n document.getElementById(intToHand[i]).src = O_image;\n }\n }\n\n // return the move\n return handToInt[hand];\n }", "title": "" }, { "docid": "e03df048a869c138277e49ce724c83df", "score": "0.5258734", "text": "isFull(state) {\n return state.find((current) => current === 0) === undefined;\n }", "title": "" }, { "docid": "e03df048a869c138277e49ce724c83df", "score": "0.5258734", "text": "isFull(state) {\n return state.find((current) => current === 0) === undefined;\n }", "title": "" }, { "docid": "822e63e972a8dc0dd1bed01446a63e9e", "score": "0.52583504", "text": "nextStates(state) {\n let result = [];\n\n for (let i = this.stateSlot(state, 1\n /* Actions */\n );; i += 3) {\n if (this.data[i] == 65535\n /* End */\n ) {\n if (this.data[i + 1] == 1\n /* Next */\n ) i = pair(this.data, i + 2);else break;\n }\n\n if ((this.data[i + 2] & 65536\n /* ReduceFlag */\n >> 16) == 0) {\n let value = this.data[i + 1];\n if (!result.some((v, i) => i & 1 && v == value)) result.push(this.data[i], value);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "446dcee8a253aea345349ba39b906551", "score": "0.5251873", "text": "function get_state_code(){\n var code = \"\";\n code += \"window.rock_state=\";\n code += JSON.stringify(rock_state);\n code += \";\";\n return code;\n }", "title": "" }, { "docid": "050b44e8a8c37ef86d50f0f67d55be81", "score": "0.52479196", "text": "getState() { return [this._s0, this._s1, this._s2, this._c]; }", "title": "" }, { "docid": "bc9b89ea7a9acd18e2c0d25ca4f2f3cd", "score": "0.52477163", "text": "function testHandHasStraightFlush() {\n writeln('sorted hand:');\n var hand = [];\n\n // set up a positive case.\n hand.push(new Card(4, SUIT.SPADE, 0));\n hand.push(new Card(5, SUIT.SPADE, 0));\n hand.push(new Card(6, SUIT.SPADE, 0));\n hand.push(new Card(7, SUIT.SPADE, 0));\n hand.push(new Card(8, SUIT.SPADE, 0));\n\n var sortedHand = new Hand(hand);\n sortedHand.sortHand();\n\n for (var i = 0; i < 5; i++) {\n writeln(hand[i].suit + '|' + hand[i].rank);\n }\n\n var hasFlush = sortedHand.hasFlush();\n writeln('has straight flush? ' + hasFlush);\n}", "title": "" }, { "docid": "7cc943a692595e3aca8c9f5d2285bc78", "score": "0.52466613", "text": "function evaluateHand() {\n\tvar i, j;\n\tvar myPoints = 0;\n\tvar yourPoints = 0;\n\t//sort cards by value\n\tyourCards.sort(function(a, b) {\n\t\tif (a.value < b.value) return -1;\n\t\tif (a.value > b.value) return 1;\t\t\n\t\treturn 0;\n\t});\n\tmyCards.sort(function(a, b) {\n\t\tif (a.value < b.value) return -1;\n\t\tif (a.value > b.value) return 1;\t\t\n\t\treturn 0;\n\t});\n\t//\n\t//Make aces high if not needed for a low run - first for myCards\n\t//\n\tif ((myCards[0].value !== 1) || (myCards[1].value !== 2) || (myCards[2].value !== 3) || (myCards[3].value !== 4) || (myCards[4].value !== 5)) { //if not a low run...\n\t\tfor (i = 0; i <=4; i++) {\t\t\t//loop through the hand\n\t\t\tif (myCards[i].value === 1) { \t//if a card is an ace\n\t\t\t\tmyCards[i].value = 14;\t\t//then make it one above a king\n\t\t\t}\n\t\t}\n\t\tmyCards.sort(function(a, b) {\t\t//now we need to sort the cards again\n\t\t\tif (a.value < b.value) return -1;\n\t\t\tif (a.value > b.value) return 1;\t\t\n\t\t\treturn 0;\n\t\t});\n\t}\n\t//\n\t//Now make aces high if not needed for a low run - now for yourCards\n\t//\n\tif ((yourCards[0].value !== 1) || (yourCards[1].value !== 2) || (yourCards[2].value !== 3) || (yourCards[3].value !== 4) || (yourCards[4].value !== 5)) { //if not a low run...\n\t\tfor (i = 0; i <=4; i++) {\t\t\t\t\t\t\t//loop through the hand\n\t\t\tif (yourCards[i].value === 1) { \t\t\t\t//if a card is an ace\n\t\t\t\tyourCards[i].value = 14;\t\t\t\t\t//then make it one above a king\n\t\t\t}\n\t\t}\n\t\tyourCards.sort(function(a, b) {\t\t\t\t\t\t//now we need to sort the cards again\n\t\t\tif (a.value < b.value) return -1;\n\t\t\tif (a.value > b.value) return 1;\t\t\n\t\t\treturn 0;\n\t\t});\n\t}\n\tfor (i = 0; i <=4; i++) {\n\t}\n\t//\n\t//Check for a flush\n\t//\n\tfor (i = 1; i <=4; i++) {\t\t\t\t\t\t\t\t\t//Go through loop and see if each suit matches the first one\n\t\tj = i - 1;\n\t\tif (myCards[i].suit !== myCards[j].suit) break;\n\t\tvar myFlushCounter = i;\n\t}\n\tif (myFlushCounter === 4) {\n\t\tmyPoints = myPoints + 500 + myCards[4].value;\t\t\t//500 points for a flush, add high card value to points\n\t\tdocument.getElementById('my-hand-2').innerHTML = \"Flush \";\n\t\tdocument.getElementById('my-suit').innerHTML = myCards[4].suit;\t\t\t\n\t\tdocument.getElementById('my-rank').innerHTML = '- ' + singularName(myCards[4].value) + \" high, \";\n\t}\n\tfor (i = 1; i <=4; i++) {\t\t\t\t\t\t\t\t\t//Go through loop and see if each suit matches the first one\n\t\tj = i - 1;\n\t\tif (yourCards[i].suit !== yourCards[j].suit) break;\n\t\tvar yourFlushCounter = i;\n\t}\n\tif (yourFlushCounter === 4) {\n\t\tyourPoints = yourPoints + 500 + yourCards[4].value;\t\t//500 points for a flush, add high card value to points\n\t\tdocument.getElementById('your-hand-2').innerHTML = \"Flush \";\n\t\tdocument.getElementById('your-suit').innerHTML = yourCards[4].suit;\t\t\n\t\tdocument.getElementById('your-rank').innerHTML = '- ' + singularName(yourCards[4].value) + \" high, \";\n\t}\n\t//\n\t//Check for a straight\n\t//\n\tfor (i = 1; i <=4; i++) {\t\t\t\t\t\t\t\t\t//Go through loop and subtract values\n\t\tj = i - 1;\n\t\tvar difference = myCards[i].value - myCards[j].value;\n\t\tif (difference !== 1) break;\n\t\tvar myStraightCounter = i;\n\t}\n\tif (myStraightCounter === 4) {\n\t\tmyPoints = myPoints + 400 + myCards[4].value;\t\t\t//400 points for a straight, add high card value to points\n\t\tdocument.getElementById('my-hand').innerHTML = \"Straight \";\n\t\tif (myPoints < 500) {\n\t\t\tdocument.getElementById('my-rank').innerHTML = '- ' + singularName(myCards[4].value) + \" high\";\n\t\t}\n\t}\n\tfor (i = 1; i <=4; i++) {\t\t\t\t\t\t\t\t\t//Go through loop and subtract values\n\t\tj = i - 1;\n\t\tdifference = yourCards[i].value - yourCards[j].value;\n\t\tif (difference !== 1) break;\n\t\tvar yourStraightCounter = i;\n\t}\n\tif (yourStraightCounter === 4) {\n\t\tyourPoints = yourPoints + 400 + yourCards[4].value;\t\t//400 points for a straight, add high card value to points\n\t\tdocument.getElementById('your-hand').innerHTML = \"Straight \";\n\t\tif (yourPoints < 500) {\n\t\t\tdocument.getElementById('your-rank').innerHTML = '- ' + singularName(yourCards[4].value) + \" high\";\n\t\t}\n\t}\n\t//\n\t//Check for two, three, and four-of-a-kind\n\t//\n\tif (myPoints < 400) {\t\t\t\t\t\t\t\t\t\t\t//don't try this if there is already a flush or straight\n\t\tvar myHiCard;\n\t\tvar myPairsArray = [];\n\t\tfor (i = 1; i <=4; i++) {\t\t\t\t\t\t\t\t\t//Go through loop and subtract values\n\t\t\tj = i - 1;\n\t\t\tdifference = myCards[i].value - myCards[j].value;\n\t\t\tif (difference === 0) {\n\t\t\t\tmyPairsArray[j] = 1;\n\t\t\t\tmyHiCard = myCards[i].value;\n\t\t\t} else {\n\t\t\t\tmyPairsArray[j] = 0;\n\t\t\t}\n\t\t}\n\t\tvar myPairsTotal = 0;\t\t\t\t\t\t\t\t\t\t\t//total up the points for the pairs\n\t\tfor (i = 0; i <= 3; i++) {\n\t\t\tmyPairsTotal = myPairsTotal + myPairsArray[i];\n\t\t}\n\t\tif (myPairsTotal === 1) {\t\t\t\t\t\t\t\t\t\t//Check for pairs\n\t\t\tmyPoints = myPoints + 100 + myHiCard;\n\t\t\tdocument.getElementById('my-hand').innerHTML = \"A pair \";\n\t\t\tdocument.getElementById('my-rank').innerHTML = \"of \" + pluralName(myHiCard) + \" \";\n\t\t}\n\t\tif (myPairsTotal === 0) {\t\t\t\t\t\t\t\t\t\t//If nothing else, high card is used\n\t\t\tmyPoints = myPoints + myCards[4].value;\n\t\t\tdocument.getElementById('my-rank').innerHTML = \"A single \" + singularName(myCards[4].value) + \" \";\n\t\t\tdocument.getElementById('my-suit').innerHTML = 'of ' + myCards[4].suit + \" \";\n\t\t}\n\t\tif ((myPairsTotal === 3) && (myPairsArray[1] === 0 || myPairsArray[2] === 0)) {\t//full house\n\t\t\tmyPoints = myPoints + 600 + myCards[4].value;\n\t\t\tdocument.getElementById('my-hand').innerHTML = \"Full-house, \";\n\t\t\tdocument.getElementById('my-rank').innerHTML = pluralName(myCards[4].value) + \" high\";\n\t\t}\n\t\tif ((myPairsTotal === 3) && (myPairsArray[0] === 0 || myPairsArray[3] === 0)) {\t\n\t\t\tmyPoints = myPoints + 700 + myCards[3].value;\t\t\t\t\t\t\t\t//four-of-a-kind\n\t\t\tdocument.getElementById('my-hand').innerHTML = \"Four-of-a-kind, \";\n\t\t\tdocument.getElementById('my-rank').innerHTML = pluralName(myCards[3].value);\n\t\t}\n\t\tif (myPairsTotal === 2) {\t\t\t\t\t\t\t\t\t\t//Check for two pairs or 3 of a kind\n\t\t\tif ((myPairsArray[0] === 1 && myPairsArray[1] === 1) || (myPairsArray[1] === 1 && myPairsArray[2] ===1) || (myPairsArray[2] === 1 && myPairsArray[3] ===1)) {\n\t\t\t\tmyPoints = myPoints + 300 + myCards[2].value;\n\t\t\t\tdocument.getElementById('my-hand').innerHTML = \"Three-of-a-kind, \";\n\t\t\t\tdocument.getElementById('my-rank').innerHTML = pluralName(myCards[2].value);\n\t\t\t} else {\n\t\t\t\tmyPoints = myPoints + 200 + myCards[3].value;\n\t\t\t\tdocument.getElementById('my-hand').innerHTML = \"Two pairs, \";\n\t\t\t\tdocument.getElementById('my-rank').innerHTML = pluralName(myCards[3].value) + \" high\";\n\t\t\t}\n\t\t}\n\t}\n\tif (yourPoints < 400) {\t\t\t\t\t\t\t\t\t\t\t\t//don't try this if there is already a flush or straight\n\t\tvar yourHiCard;\n\t\tvar yourPairsArray = [];\n\t\tfor (i = 1; i <=4; i++) {\t\t\t\t\t\t\t\t\t\t//Go through loop and subtract values\n\t\t\tj = i - 1;\n\t\t\tdifference = yourCards[i].value - yourCards[j].value;\n\t\t\tif (difference === 0) {\n\t\t\t\tyourPairsArray[j] = 1;\n\t\t\t\tyourHiCard = yourCards[i].value;\n\t\t\t} else {\n\t\t\t\tyourPairsArray[j] = 0;\n\t\t\t}\n\t\t}\n\t\tvar yourPairsTotal = 0;\t\t\t\t\t\t\t\t\t\t\t//total up the points for the pairs\n\t\tfor (i = 0; i <= 3; i++) {\n\t\t\tyourPairsTotal = yourPairsTotal + yourPairsArray[i];\n\t\t}\n\t\t\tif (yourPairsTotal === 1) {\t\t\t\t\t\t\t\t\t//Check for pairs\n\t\t\tyourPoints = yourPoints + 100 + yourHiCard;\n\t\t\tdocument.getElementById('your-hand').innerHTML = \"A pair \";\n\t\t\tdocument.getElementById('your-rank').innerHTML = \"of \" + pluralName(yourHiCard) + \" \";\n\t\t}\n\t\t\tif (yourPairsTotal === 0) {\t\t\t\t\t\t\t\t\t//if nothing else, high card is used\n\t\t\tyourPoints = yourPoints + yourCards[4].value;\n\t\t\tdocument.getElementById('your-rank').innerHTML = \"A single \" + singularName(yourCards[4].value) + \" \";\n\t\t\tdocument.getElementById('your-suit').innerHTML = 'of ' + yourCards[4].suit + \" \";\n\t\t}\n\t\tif ((yourPairsTotal === 3) && (yourPairsArray[1] === 0 || yourPairsArray[2] === 0)) {\t//full house\n\t\t\tyourPoints = yourPoints + 600 + yourCards[4].value;\n\t\t\tdocument.getElementById('your-hand').innerHTML = \"Full-house, \";\n\t\t\tdocument.getElementById('your-rank').innerHTML = pluralName(yourCards[4].value) + \" high\";\n\t\t}\n\t\tif ((yourPairsTotal === 3) && (yourPairsArray[0] === 0 || yourPairsArray[3] === 0)) {\n\t\t\tyourPoints = yourPoints + 700 + yourCards[3].value;\t\t\t\t\t\t\t\t\t//four-of-a-kind\n\t\t\tdocument.getElementById('your-hand').innerHTML = \"Four-of-a-kind, \";\n\t\t\tdocument.getElementById('your-rank').innerHTML = pluralName(yourCards[3].value);\n\t\t}\n\t\tif (yourPairsTotal === 2) {\t\t\t\t\t\t\t\t\t\t//Check for two pairs or 3 of a kind\n\t\t\tif ((yourPairsArray[0] === 1 && yourPairsArray[1] === 1) || (yourPairsArray[1] === 1 && yourPairsArray[2] ===1) || (yourPairsArray[2] === 1 && yourPairsArray[3] ===1)) {\n\t\t\t\tyourPoints = yourPoints + 300 + yourCards[2].value;\n\t\t\t\tdocument.getElementById('your-hand').innerHTML = \"Three-of-a-kind, \";\n\t\t\t\tdocument.getElementById('your-rank').innerHTML = pluralName(yourCards[2].value);\n\t\t\t} else {\n\t\t\t\tyourPoints = yourPoints + 200 + yourCards[3].value;\n\t\t\t\tdocument.getElementById('your-hand').innerHTML = \"Two pairs, \";\n\t\t\t\tdocument.getElementById('your-rank').innerHTML = pluralName(yourCards[3].value) + \" high\";\n\t\t\t}\n\t\t}\n\t}\n\tif ((myPairsTotal === 0) && (yourPairsTotal === 0) && (myPoints === yourPoints)) {\t//break a single card tie with next ranking high cards\n\t\tfor (i = 3; i >= 0; i--) {\n\t\t\tmyPoints = myPoints + myCards[i].value;\n\t\t\tyourPoints = yourPoints + yourCards[i].value;\n\t\t\tif (myPoints !== yourPoints) break;\n\t\t}\n\t}\n\tif ((myPairsTotal === 1) && (yourPairsTotal === 1) && (myPoints === yourPoints)) {\t//break a pairs tie with next ranking high cards\n\t\tfor (i = 4; i >= 0; i--) {\n\t\t\tmyPoints = myPoints + myCards[i].value;\n\t\t\tyourPoints = yourPoints + yourCards[i].value;\n\t\t\tif (myPoints !== yourPoints) break;\n\t\t}\n\t}\t\t\n\tif (myPoints > yourPoints) {\n\t\tmyResult = ' - Win!';\n\t\tyourResult = ' - Lose';\n\t\tmyUpdate = myCounter();\n\t}\n\tif (myPoints < yourPoints) {\n\t\tyourResult = ' - Win!';\n\t\tmyResult = ' - Lose';\n\t\tyourUpdate = yourCounter();\n\t\t}\n\tif (myPoints === yourPoints) {\n\t\tyourResult = ' - Tie';\n\t\tmyResult = ' - Tie';\n\t}\n\tif (yourPoints === 928) {\n\t\tdocument.getElementById('your-hand').innerHTML = \"Royal \";\n\t\tdocument.getElementById('your-rank').innerHTML = \"\";\n\t}\t\n\tif (myPoints === 928) {\n\t\tdocument.getElementById('my-hand').innerHTML = \"Royal \";\n\t\tdocument.getElementById('my-rank').innerHTML = \"\";\n\t}\t\n\tdocument.getElementById('my-win').innerHTML = ' ' + myPoints + myResult;\n\tdocument.getElementById('my-total').innerHTML = ' (' + myUpdate + ' total wins)';\n\tdocument.getElementById('your-win').innerHTML = ' ' + yourPoints + yourResult;\n\tdocument.getElementById('your-total').innerHTML = ' (' + yourUpdate + ' total wins)';\n}", "title": "" }, { "docid": "faaef6775ebc62a2f1ec635eee8f117c", "score": "0.5243621", "text": "function hand()\n{\n this.player = 'none';\n this.cards = [];\n this.value = 0;\n}", "title": "" }, { "docid": "c96cb4b5144dbf84ce2f7d20a892accc", "score": "0.5242536", "text": "function filterByState(sighting) {\n return sighting.state === inputState;\n }", "title": "" }, { "docid": "8a4eebb9ff3fa68bc815a0e02ecfb2c0", "score": "0.5237825", "text": "function State() {\n\tthis.jthing = 1\n\tthis.things = {}\n\tthis.viewstate = new ViewState()\n\n\tvar core = {\n\t\tpH: [0, 0],\n\t\tpG: [0, 0],\n\t\tshape: \"sphere\",\n\t\tr: 0,\n\t\tf: 1,\n\t\tparent: null,\n\t\tchildren: {},\n\t}\n\tthis.parts = [core]\n\tthis.stalks = []\n\tthis.organs = [core]\n\tthis.stumps = []\n\tthis.partsbyedgeN = {} // map pN -> part\n\tthis.organsbyhexN = {} // map pN -> organ\n\tthis.objsbyedgeN = {} // for determining whether the space is claimed\n\tthis.objsbyhexN = {}\n\tthis.organsbyhexN[NconvertH(core.pH)] = core\n\tthis.objsbyhexN[NconvertH(core.pH)] = core\n\tvar that = this\n\t;[0, 1, 2, 0, 1, 2].forEach(function (jsystem, jedge) {\n\t\tthat.addstump(core, jedge, jsystem)\n\t})\n\n\n\tspec = {\"branches\":[[[0,96],[0,90],[0,84],[0,78],[0,72],[0,66],[0,60],[0,54],[0,48],[0,42],[0,36],[0,30],[0,24],[6,18],[12,12],[18,6],[24,0],[30,-6],[36,-12],[42,-18],[48,-24]],[[48,-24],[54,-30],[60,-36],[66,-42],[72,-48],[78,-54],[84,-60],[90,-66],[96,-66],[96,-60],[96,-54],[96,-48],[96,-42],[96,-36],[96,-30],[96,-24],[96,-18],[96,-12],[96,-6],[90,0],[84,0],[78,0],[72,0],[66,0],[60,0],[54,0],[48,0]],[[48,-24],[48,-30],[48,-36],[48,-42],[48,-48],[48,-54],[48,-60],[48,-66],[48,-72],[42,-72],[36,-72],[30,-72],[24,-72],[18,-66],[12,-60],[6,-54],[0,-48]],[[0,-48],[0,-42],[0,-36],[0,-30],[0,-24],[0,-18]],[[-96,0],[-90,0],[-84,0],[-78,0],[-72,0],[-66,0],[-60,0],[-54,0],[-48,0],[-42,0],[-36,0],[-30,0],[-24,0],[-24,6],[-24,12],[-24,18],[-24,24],[-24,30],[-24,36],[-24,42],[-24,48]],[[-24,48],[-24,54],[-24,60],[-24,66],[-24,72],[-24,78],[-24,84],[-24,90],[-30,96],[-36,96],[-42,96],[-48,96],[-54,96],[-60,96],[-66,96],[-72,96],[-78,96],[-84,96],[-90,96],[-90,90],[-84,84],[-78,78],[-72,72],[-66,66],[-60,60],[-54,54],[-48,48]],[[-24,48],[-18,48],[-12,48],[-6,48],[0,48],[6,48],[12,48],[18,48],[24,48],[30,42],[36,36],[42,30],[48,24],[48,18],[48,12],[48,6],[48,0]],[[48,0],[42,0],[36,0],[30,0],[24,0],[18,0]],[[96,-96],[90,-90],[84,-84],[78,-78],[72,-72],[66,-66],[60,-60],[54,-54],[48,-48],[42,-42],[36,-36],[30,-30],[24,-24],[18,-24],[12,-24],[6,-24],[0,-24],[-6,-24],[-12,-24],[-18,-24],[-24,-24]],[[-24,-24],[-30,-24],[-36,-24],[-42,-24],[-48,-24],[-54,-24],[-60,-24],[-66,-24],[-66,-30],[-60,-36],[-54,-42],[-48,-48],[-42,-54],[-36,-60],[-30,-66],[-24,-72],[-18,-78],[-12,-84],[-6,-90],[0,-90],[0,-84],[0,-78],[0,-72],[0,-66],[0,-60],[0,-54],[0,-48]],[[-24,-24],[-30,-18],[-36,-12],[-42,-6],[-48,0],[-54,6],[-60,12],[-66,18],[-72,24],[-72,30],[-72,36],[-72,42],[-72,48],[-66,48],[-60,48],[-54,48],[-48,48]],[[-48,48],[-42,42],[-36,36],[-30,30],[-24,24],[-18,18]]],\"connections\":[]}\n\tthis.lanes = [\n\t\tSpacelane(spec),\n\t]\n\tfor (var j = 0 ; j < this.lanes.length ; ++j) {\n\t\tthis.lanes[j].claimspace(this.objsbyedgeN, this.objsbyhexN)\n\t}\n\n\tthis.attackers = []\n/*\tthis.attackers.push(Attacker({\n\t\tpG: [0, 0],\n\t\tvG: 1.4,\n\t\tlane: this.lanes[0],\n\t\tr: 0,\n\t\tshape: \"square\",\n\t}))*/\n\t\n}", "title": "" }, { "docid": "8c905008b2a6276034e2edcfb0f1ecdb", "score": "0.52359504", "text": "get phase() {\n // Loop trough teams and check wether they have at least one unused piece (Phase 1)\n for (var team of this.teams) {\n // Returns the index of first piece object that's 'point' property is null of current team\n // If this index is not -1, such a piece object exists and phause 1 is still active because there is a team that is allowed to 'set()'\n if (team.pieces.indexOfKey(null, \"point\") > -1) {\n // Return 0 to represent phase 1\n return 0;\n }\n }\n // No piece found that's \"point\" property is null\n // Phase 1 is completed, looking for phase 2 or 3 ...\n\n // Loop trough teams to check wether they have three or less active (unremoved) pieces on board\n for (var team of this.teams) {\n // Filter the pieces array for a false in \"removed\" property\n // If the returning array's length is three or less, phase 2 is completed and phase 3 is the current one\n if (team.activePieces.length <= 3) {\n // Return 2 to represent phase 3\n return 2;\n }\n }\n\n // There exist no unused pieces but no team has three or less active pieces\n // Return 1 to represent phase 2\n return 1;\n }", "title": "" }, { "docid": "925e2255c211d11fa6110e8f9174c609", "score": "0.5234753", "text": "stickSim(stateArray) {\n let curx = this.x;\n let cury = this.y;\n let curw = this.w;\n let curh = this.h;\n let curStick = null;\n let walker = this;\n if(stateArray[curx][cury] != 1) {\n /*\n let neighbors = [[curx-1,cury], [curx+1, cury], \n [curx, cury-1], [curx, cury+1]];\n */\n let neighbors = [[curx-1,cury], [curx+1, cury], \n [curx, cury-1], [curx, cury+1],\n [curx-1, cury-1],[curx-1, cury+1],\n [curx+1, cury-1], [curx+1, cury+1]];\n neighbors.forEach(\n function([x,y]) {\n if( x >= 0 && x < curw && y >=0 && y < curh) {\n if(stateArray[x][y] == 1) {\n let willStick = walker.willStick();\n if(willStick) {\n curStick = [x,y];\n };\n };\n };\n });\n };\n //console.log(curStick);\n return curStick;\n }", "title": "" }, { "docid": "b4bb93c480652efa8ee86826b91c21e0", "score": "0.52339906", "text": "function getBoardState() {\n // An object consisting of all the Xs and circles on the board.\n var obj = {};\n\n // For each button on the board, pull out what is displayed on it and insert it into the object.\n $(\".board button\").each(function() {\n obj[$(this).attr(\"id\")] = $(this).text() || \"\";\n });\n return obj;\n}", "title": "" }, { "docid": "f5840b2487a22f16b89127b97842806e", "score": "0.523359", "text": "winner () {\n let tanksB = 0\n let tanksW = 0\n\n for (let piece of this.pieces) {\n if (piece.type === Piece.TANK) {\n (piece.color === Piece.BLACK) ? tanksB++ : tanksW++\n continue\n }\n\n if (piece.type === Piece.GINT) {\n if (piece.color === Piece.BLACK) {\n if (piece.y === this.rows - 2) return Piece.BLACK\n } else {\n if (piece.y === 0) return Piece.WHITE\n }\n }\n }\n\n if (tanksB === 0) return Piece.WHITE\n if (tanksW === 0) return Piece.BLACK\n\n return null\n }", "title": "" }, { "docid": "8ecce0dac9f459f7baa07d15b333898d", "score": "0.52317417", "text": "roundOver() {\n const {\n playerLost,\n playerWon,\n } = this.props\n const {\n dealerCards,\n playerHands,\n } = this.state\n const dealerTotal = sumCards(dealerCards).high\n const newPlayerHands = [...playerHands]\n let playerWinnings = 0\n\n playerHands.forEach(({ bet, cards }, i) => {\n const handTotal = sumCards(cards).high\n let handResult = HAND_RESULTS.LOST\n\n // Check to see if player got blackjack.\n if (handTotal === 21 && cards.length === 2) {\n playerWinnings += Math.round(bet + (bet * 3 / 2))\n handResult = HAND_RESULTS.WON\n } else if ((handTotal <= 21 && handTotal > dealerTotal) || dealerTotal > 21) { // Straight win or dealer bust.\n playerWinnings += bet * 2\n handResult = HAND_RESULTS.WON\n } else if (handTotal === dealerTotal) { // A push.\n playerWinnings += bet\n handResult = HAND_RESULTS.PUSH\n }\n\n newPlayerHands[i].result = handResult\n })\n\n if (playerWinnings) {\n playerWon(playerWinnings)\n } else {\n playerLost()\n }\n\n this.setState({\n countGuess: null,\n playerDecision: false,\n playerHands: newPlayerHands,\n roundOver: true,\n })\n }", "title": "" }, { "docid": "20e67e76496ff8b3911414967f13ec97", "score": "0.5231587", "text": "randomState(){\n let x = Math.round(Math.random()*(this.scores.length - 1));\n let state = new State([x],this.scores[x]);\n return state;\n }", "title": "" }, { "docid": "1263135e76ceb974c8fe8f5217a03e65", "score": "0.5222145", "text": "function stateCheck() {\n\n\t\tif(--duty > 0) {\n\n\t\t\treturn false;\n\t\t}\n\t\tduty = 255;\n\t\tif(++state == 3) {\n\n\t\t\t// done with scan\n\t\t\tstate = 0;\n\t\t\tconsole.log(\">>> %s\", rgbToHex(maxHue));\n\t\t\tgoIdle();\n\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "96cac3aff262d3ded8d5a872982732c0", "score": "0.5213493", "text": "function State(old) {\n var _this = this;\n\n // eslint-disable-line\n // public: the player whose turn it is\n this.turn = '';\n\n // public: The number of moves of the AI player\n this.turn = '';\n\n // public: the number of moves the AI player has made\n this.oMovesCount = 0;\n\n // public: the result of the game in this state\n this.result = 'still running';\n\n // public: the board configuration in this state\n this.board = [];\n\n // Begin Object Construction\n if (typeof old !== 'undefined') {\n // if the state is constructed using a copy of another state\n var len = old.board.length;\n this.board = new Array(len);\n for (var i = 0; i < len; i++) {\n this.board[i] = old.board[i];\n }\n\n this.oMovesCount = old.oMovesCount;\n this.result = old.result;\n this.turn = old.turn;\n }\n // End Object Construction\n\n // Public: advances the turn in the state\n this.advanceTurn = function () {\n _this.turn = _this.turn === 'X' ? 'O' : 'X';\n };\n\n // public function that enumberates the empty cells in state\n // @return [Array] indices of all empty cells\"\n this.emptyCells = function () {\n var indexes = [];\n for (var _i = 0; _i < numberOfSquares; _i++) {\n if (_this.board[_i] === 'E') {\n indexes.push(_i);\n }\n }\n return indexes;\n };\n\n // public function that checks if the state is a terminal state or not\n // The state result is updated to reflect the result of the game\n // @returns [Boolean]: True if it's terminal, false otherwise\n this.isTerminal = function () {\n var B = _this.board;\n\n // check rows\n for (var _i2 = 0; _i2 <= 6; _i2 += 3) {\n if (B[_i2] !== 'E' && B[_i2] === B[_i2 + 1] && B[_i2 + 1] === B[_i2 + 2]) {\n _this.result = B[_i2] + '-won';\n return true;\n }\n }\n\n // check columns\n for (var _i3 = 0; _i3 <= 2; _i3++) {\n if (B[_i3] !== 'E' && B[_i3] === B[_i3 + 3] && B[_i3 + 3] === B[_i3 + 6]) {\n _this.result = B[_i3] + '-won'; // update the state result\n return true;\n }\n }\n\n // check diagonals\n for (var _i4 = 0, j = 4; _i4 <= 2; _i4 = _i4 + 2, j = j - 2) {\n if (B[_i4] !== 'E' && B[_i4] === B[_i4 + j] && B[_i4 + j] === B[_i4 + 2 * j]) {\n _this.result = B[_i4] + '-won'; // update the state result\n return true;\n }\n }\n\n var available = _this.emptyCells();\n if (available.length === 0) {\n // the game is draw\n _this.result = 'draw'; // update the state result\n return true;\n }\n return false;\n };\n}", "title": "" }, { "docid": "f5525b972b8a4d57b1cf76f9c1c56567", "score": "0.5213104", "text": "function getWinner() {\n let pCard = playerHand[0];\n let eCard = enemyHand[0];\n if (pCard.value > eCard.value) {\n winStatus = true;\n playerHand.push(pCard, eCard);\n playerHand.shift();\n enemyHand.shift();\n }\n if (pCard.value < eCard.value) {\n winStatus = false;\n enemyHand.push(pCard, eCard);\n playerHand.shift();\n enemyHand.shift();\n }\n if (pCard.value === eCard.value) {\n firstTie(pCard, eCard);\n }\n gameStatus();\n viewCardChange(pCard, eCard);\n}", "title": "" }, { "docid": "4d59dd3c4f7795112e5b398adb9e7ce1", "score": "0.52095467", "text": "function step(volume) {\n return funcs.apply(volume, neighborhood, function(phases, distances, retval) {\n retval[1] = 1.0;\n //Count neighbors\n var neighbors = 0;\n for(var i=0; i<27; ++i) {\n if(i !== CENTER_INDEX && phases[i]) {\n ++neighbors;\n }\n }\n //Compute next state\n if(phases[CENTER_INDEX]) {\n if(SURVIVE_LO <= neighbors && neighbors <= SURVIVE_HI) {\n retval[0] = 1;\n return;\n }\n } else if(BIRTH_LO <= neighbors && neighbors <= BIRTH_HI) {\n retval[0] = 1;\n return;\n }\n retval[0] = 0;\n return;\n });\n}", "title": "" }, { "docid": "03e6cd068da43e5f3a0c542eefa76a77", "score": "0.52042156", "text": "async estimateHandBounds(input, config) {\n // const inputHeight = input.shape[2];\n // const inputWidth = input.shape[1];\n this.iouThreshold = config.iouThreshold;\n this.scoreThreshold = config.scoreThreshold;\n this.maxHands = config.maxHands;\n const resized = input.resizeBilinear([this.width, this.height]);\n const divided = resized.div(255);\n const normalized = divided.sub(0.5);\n const image = normalized.mul(2.0);\n resized.dispose();\n divided.dispose();\n normalized.dispose();\n const predictions = await this.getBoundingBoxes(image);\n image.dispose();\n if (!predictions || (predictions.length === 0)) return null;\n const hands = [];\n for (const i in predictions) {\n const prediction = predictions[i];\n const boundingBoxes = await prediction.boxes.array();\n const startPoint = boundingBoxes[0].slice(0, 2);\n const endPoint = boundingBoxes[0].slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n prediction.boxes.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(bounding.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks }, [input.shape[2] / this.width, input.shape[1] / this.height]));\n }\n return hands;\n }", "title": "" }, { "docid": "a1a1869a0619698bf0252d0ecb8c9c3e", "score": "0.5201368", "text": "_isGameWin() {\n return _.find(this.state.squares, val => 2048) ? true : false;\n }", "title": "" }, { "docid": "3d4106debe1c066e48878eb379b7c57b", "score": "0.5200471", "text": "function stateSwitcher(s, w) {\n if(s===\"attack\") {\n for (var key in state){\n state[key] = false};\n state.attack = true; \n setArena();\n transTo(\"arenaScreen\");\n } else if (s===\"chooseOpp\") {\n for (var key in state){\n state[key] = false};\n state.chooseOpp = true; \n transTo(\"selectionScreen\");\n } else if (s===\"gameOver\") {\n renderGameOver(w);\n for (var key in state){\n state[key] = false};\n state.gameOver = true; \n transTo(\"endGameScreen\");\n }\n console.log(\"Current state: \" + getGameState());\n} // End State Switcher //", "title": "" }, { "docid": "9663bcecdaa533fdcfb1d7a2afeca3c1", "score": "0.51988995", "text": "function getDoorState (state) {\r\n return !state;\r\n}", "title": "" }, { "docid": "95768f89b9a91ca9792641c5f06c9d8c", "score": "0.51928765", "text": "function buildBoardState() {\r\n \t\tif (whichPlayer === 1) {\r\n \t\t\tfor (var i = 0; i < 40; i++) {\r\n \t\t\t\tvar tempPiece = $(\"#t\" + i).html();\r\n\r\n \t\t\t\t//use charCodeAt to work with the unicode values for bomb/flag/spy\r\n \t\t\t\tif (tempPiece.charCodeAt(0) == \"55357\") {\r\n \t\t\t\t\tboardState[i] = \"B\";\r\n\t\t \t\t\t} else if (tempPiece.charCodeAt(0) == \"9873\") {\r\n \t\t\t\t\tboardState[i] = \"F\";\r\n\t\t \t\t\t} else if (tempPiece.charCodeAt(0) == \"55356\") {\r\n \t\t\t\t\tboardState[i] = \"S\";\r\n\t\t \t\t\t} else {\r\n \t\t\t\t\tboardState[i] = tempPiece;\r\n\t\t \t\t\t}\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tfor (var i = 60; i < 100; i++) {\r\n \t\t\t\tvar tempPiece = $(\"#t\" + i).html();\r\n \t\t\t\tif (tempPiece.charCodeAt(0) == \"55357\") {\r\n \t\t\t\t\tboardState[i] = \"B\";\r\n\t\t \t\t\t} else if (tempPiece.charCodeAt(0) == \"9873\") {\r\n \t\t\t\t\tboardState[i] = \"F\";\r\n\t\t \t\t\t} else if (tempPiece.charCodeAt(0) == \"55356\") {\r\n \t\t\t\t\tboardState[i] = \"S\";\r\n\t\t \t\t\t} else {\r\n \t\t\t\t\tboardState[i] = tempPiece;\r\n\t\t \t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "title": "" }, { "docid": "7365f56941e2df0ca46b3005056f9669", "score": "0.5191386", "text": "function calcBlockState(n) {\r var ol = xDoc.getElementsByTagName(\"body\")[0];\r var outlineLen = ol.getElementsByTagName(\"outline\").length;\r // get OPML expansionState data\r var expandElem = xDoc.getElementsByTagName(\"expansionState\")[0];\r var expandedData = (expandElem.childNodes.length) ? expandElem.firstChild.nodeValue.split(\",\") : null;\r if (expandedData) {\r for (var j = 0; j < expandedData.length; j++) {\r if (n == expandedData[j] - 1) {\r return \"1\";\r }\r }\r }\r return \"0\";\r}", "title": "" } ]
2ac79dd2cbe97667370faac7d31417dd
ensures that an exploration is selected by selecting the first in the list
[ { "docid": "5a36db222d81194364ff1137c098b4ff", "score": "0.6405469", "text": "function ensureExplorationSelected(){\n\tif (!selectedExploration && userLoggedOn() && currentUser.explorations.length > 0){\n\n\t\tvar explTimeStamp = explChooser.options[0].id;\n\t\tvar userExpl = currentUser.getExploration(explTimeStamp);\n\t\tselectExploration(userExpl);\n\t}\n}", "title": "" } ]
[ { "docid": "4d73e4529ab29f01d8aa6e180379a83e", "score": "0.68566203", "text": "function selectFirst() { \n steps.some(function (step, i) {\n if (step.visible) {\n step.activate();\n return true;\n }\n });\n }", "title": "" }, { "docid": "bd20af47f367079040df6a2285b01054", "score": "0.6801013", "text": "function selectExploration(exploration){\n\tel(\"has-audio\").style.visibility = \"hidden\";\n\tif (selectedExploration){\n\t\tdeselectExploration();\n\t\t}\n\n\tselectedExploration = exploration;\n\tsetupAudio(exploration);\n\n\t// update gui/views\n\tprogressBar.load(exploration);\n\tif(exploration.hasCityEvents()){\n\t\tpathView.load(exploration);\n\n\n\t}else{\n\t\tshowPathButton.style.visibility = \"hidden\";\n\t}\n\t//$(\"#share-file\").show();\n\tupdateExplorationControls();\n\n\t// transitions to the first location in the exploration\n\tgoToFirstLocation(exploration);\n}", "title": "" }, { "docid": "ca4b7a9fdb7acd8074deba826165add1", "score": "0.67689294", "text": "function selectFirst() {\n steps.some(function(step, i) {\n if (step.visible) {\n step.activate();\n return true;\n }\n });\n }", "title": "" }, { "docid": "ac9975d4b2a163c35a3335786656c6f6", "score": "0.67018783", "text": "function selectFirst() {\n if (items.length > 0) {\n items[0].select();\n }\n }", "title": "" }, { "docid": "cabb82a8f91e5397954ffcf267176e1e", "score": "0.6531681", "text": "function selectFirstItem() {\n updateObject(getFirstItem(), ohsItems, false);\n }", "title": "" }, { "docid": "7c5e692c4cf8ef98f1b5f476b8925d90", "score": "0.6376564", "text": "function selectSingle(index,event) {\n\n\t\t\t\t\t// assign selected item and collapse dropdown\n\n\t\t\t\t\tscope.model = scope.list[index];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tscope.selectionDisplay = (_field) ? scope.list[index][_field] : scope.list[index];\n\t\t\t\t\tcollapse();\n\t\t\t\t\tdisplaySingle(index);\n\t\t\t\t}", "title": "" }, { "docid": "f51f2f116fee5487fa7601dbcdae3e28", "score": "0.6074142", "text": "checkOneSelected() {\n if (this.get(\"selectedItems.length\") === 1) {\n this.set(\"oneSelected\", true);\n } else {\n this.set(\"oneSelected\", false);\n }\n }", "title": "" }, { "docid": "97852b8c6af1bf81c98d3188718ae660", "score": "0.60611945", "text": "function LazyChoice()\n {\n if(selectedIndex === 0)\n {\n return Participiants()\n } \n return PeoplesInQueue();\n }", "title": "" }, { "docid": "0b35c52cf6977af215217159c880f7ab", "score": "0.6042813", "text": "function select_first_on_screen() { \n var selected = document.getElementById(PREFIX + 'selected');\n if (selected) {\n if (is_viewable(selected)) return;\n else selected.id = '';\n }\n\n var highlights = document.querySelectorAll('font.' + PREFIX + 'found');\n var i = 0, hl;\n while (hl = highlights[i++]) {\n if (is_viewable(hl)) {\n hl.id = PREFIX + 'selected';\n break;\n }\n }\n}", "title": "" }, { "docid": "fcebf03282eb908a77c05c735f13b694", "score": "0.60243183", "text": "function somethingSelected() {\n return nSel();\n }", "title": "" }, { "docid": "5b629a6609005a8d7d14838e7e272575", "score": "0.59971124", "text": "function selectTool(index) {\n currToolIndex = index;\n console.log(\"???\")\n }", "title": "" }, { "docid": "c459113e2e6d40d1ef09710fb906721a", "score": "0.5977279", "text": "select() {\n this.listElement.updateSelected(this.value);\n }", "title": "" }, { "docid": "0455ea1ba48196c0d802a21169ef9612", "score": "0.5942254", "text": "selectItem(){\n \n }", "title": "" }, { "docid": "235d1f9ac0aed92bf5430fae63f857c6", "score": "0.5941495", "text": "startSelectComponent() {\n this.toggleSelectComponent(1);\n this.em.getSelected() && this.onSelect();\n }", "title": "" }, { "docid": "eb8615487ea70c59ec4768cdf0106a6e", "score": "0.5919047", "text": "_selectItem(index, keepExisting) {\n // Selected the given row(s)\n let items = this._sortedItems;\n if (!keepExisting) {\n this.clearSelectedItems();\n }\n let name = items[index].name;\n this._selection[name] = true;\n this.update();\n }", "title": "" }, { "docid": "35e27fe5cba25079f4fa820bbb8c5227", "score": "0.5894987", "text": "function trackSelectedItem(element) {\n\n const items = element.items;\n const itemCount = items ? items.length : 0;\n\n const previousSelectedItem = element.selectedItem;\n if (!previousSelectedItem) {\n // No item was previously selected.\n if (element.selectionRequired) {\n // Select the first item by default.\n element.selectedIndex = 0;\n }\n } else if (itemCount === 0) {\n // We've lost the selection, and there's nothing left to select.\n element.selectedItem = null;\n } else {\n // Try to find the previously-selected item in the current set of items.\n const indexInCurrentItems = Array.prototype.indexOf.call(items, previousSelectedItem);\n const previousSelectedIndex = element.selectedIndex;\n if (indexInCurrentItems < 0) {\n // Previously-selected item was removed from the items.\n // Select the item at the same index (if it exists) or as close as possible.\n const newSelectedIndex = Math.min(previousSelectedIndex, itemCount - 1);\n // Select by item, since index may be the same, and we want to raise the\n // selected-item-changed event.\n element.selectedItem = items[newSelectedIndex];\n } else if (indexInCurrentItems !== previousSelectedIndex) {\n // Previously-selected item still there, but changed position.\n element.selectedIndex = indexInCurrentItems;\n }\n }\n}", "title": "" }, { "docid": "3e75c62d6f1e272dc3c39fdb4102021f", "score": "0.5893816", "text": "function selectedIndex(x) {\n return x==selectedID;\n }", "title": "" }, { "docid": "02d0ef1bed3be0dd043e1f9f8e3c2525", "score": "0.58889395", "text": "function getSelected(){\n\t\treturn getSelecteds()[0]; \n\t}", "title": "" }, { "docid": "3b62432b61ab5c1558fd1351d56c8c66", "score": "0.58847797", "text": "function get_selection()\n{\n var cur_sel;\n var active_flickity;\n // something already marked\n var select = document.querySelectorAll('[tabindex=\"1\"]');\n if(select.length > 0)\n {\n cur_sel = select[0];\n cur_sel.tabIndex=0\n return cur_sel;\n }\n // something already marked\n var select = document.querySelectorAll('[tabindex=\"2\"]');\n if(select.length > 0)\n {\n cur_sel = select[0];\n cur_sel.removeAttribute('tabIndex');\n return cur_sel;\n }\n // Look for a selected flickity\n active_flickity = document.activeElement;\n var select = document.querySelectorAll('[tabindex=\"3\"]');\n if(select.length > 0)\n {\n active_flickity = select[0];\n active_flickity.removeAttribute('tabIndex');\n }\n // no titles to choose from\n cur_sel = get_enabled_shows(active_flickity)[0];\n\n return cur_sel;\n}", "title": "" }, { "docid": "2b63bedf17f78b78b1d1f40fe4a6de49", "score": "0.587977", "text": "function do_ctrl_meta_click_selected_test(e){\n\t\texpect(2)\n\t\t\n\t\tvar list = getMultiselectableList()\n\t\tvar items = list.find('li')\n\t\tvar first = items.first().trigger(getMouseDownEvent())\n\t\tvar last = items.last().trigger(e).trigger(e)\n\t\t\n\t\tok(isSelected(first), 'first item is selected')\n\t\tok(!isSelected(last), 'last item is not selected')\n\t}", "title": "" }, { "docid": "46682e0fcb6c5936e5d5e558c10ceb15", "score": "0.5871944", "text": "function selectFirst() {\n tabs.some(function(tab) {\n if (tab.visible()) {\n tab.focus();\n return true;\n }\n });\n }", "title": "" }, { "docid": "b9c943cdfc4879a7a55cd041d7eb4e17", "score": "0.58637565", "text": "function selectFirst() {\n $(\".pw-slide:first\").click();\n }", "title": "" }, { "docid": "4910804f7871adedc17d423452f0dbbf", "score": "0.58199203", "text": "function selectItem(item) {\n var found = findItem(getIdentity(item));\n if (found && found != item) {\n vm.selectedItem = found;\n // console.log('found');\n } else {\n vm.selectedItem = item;\n }\n }", "title": "" }, { "docid": "1295bf4a53aebdac9567e16f5fbebf0b", "score": "0.580523", "text": "function softSelect(el) {\n if($current.is(':hidden')) $(el).trigger('click');\n else $(el).addClass('selected').trigger('click', true);\n }", "title": "" }, { "docid": "f168f6bc8bbf1e51837e2a92bb1451f3", "score": "0.580248", "text": "function reselectFirstCategory() {\n list.selectFirst();\n }", "title": "" }, { "docid": "060789403e0c4a3499ece217457e66d5", "score": "0.5799191", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8c6b8ec397fe74e37f07daeb71d307a0", "score": "0.5790889", "text": "function reselect() {\n if (selectedItem) {\n selectedItem.select();\n }\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5788128", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5788128", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5788128", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5788128", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "58b3ca7a4532418e78bbd0c32a57ae6d", "score": "0.577174", "text": "function handleSelection(item,list,lastClick,myEvent) {\n\tvar last = lastClick;\n\tvar evt = getEvent(myEvent);\n\tvar source = getSource(evt);\n\t//Handle alt-clicks\n\tif (evt.altKey) {\n\t\tvar filename = item.getAttribute(\"title\");\n\t\tif ((filename.toLowerCase().lastIndexOf(\".dcm\") == filename.length - 4) ||\n\t\t\t(filename.replace(/[\\.\\d]/g,\"\").length == 0)) {\n\t\t\tvar path = \"/files/\"+source.xml.getAttribute(\"fileURL\")+\"?list\";\n\t\t\twindow.open(path,\"_blank\");\n\t\t\tdeselectAll();\n\t\t\tlast = -1;\n\t\t}\n\t}\n\t//Handle ctrl-clicks\n\telse if (evt.ctrlKey) {\n\t\tif (isSelected(item)) deselect(item);\n\t\telse select(item);\n\t}\n\t//Handle shift-clicks\n\telse if (evt.shiftKey && (lastClick != -1)) {\n\t\tvar sel = false;\n\t\tvar clicked;\n\t\tfor (var i=0; i<list.length; i++) {\n\t\t\tclicked = (list.item(i) === item);\n\t\t\tif (clicked) last = i;\n\t\t\tif (!sel) {\n\t\t\t\tif ((i == lastClick) || clicked) sel = true;\n\t\t\t\tif (sel) select(list.item(i));\n\t\t\t\telse deselect(list.item(i));\n\t\t\t\tif ((i == lastClick) && clicked) sel = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (sel) select(list.item(i));\n\t\t\t\telse deselect(list.item(i));\n\t\t\t\tif ((i == lastClick) || clicked) sel = false;\n\t\t\t}\n\t\t}\n\t}\n\t//Handle single clicks\n\telse {\n\t\tfor (var i=0; i<list.length; i++) {\n\t\t\tif (list.item(i) === item) {\n\t\t\t\tselect(list.item(i));\n\t\t\t\tlast = i;\n\t\t\t}\n\t\t\telse deselect(list.item(i));\n\t\t}\n\t}\n\treturn last;\n}", "title": "" }, { "docid": "fb7e27273d34464d879a024747e26e02", "score": "0.57716924", "text": "getSelection() {\n return this.getSelections()[0];\n }", "title": "" }, { "docid": "e20f90fc7fb7e7c6b53d6431143b5f17", "score": "0.57490724", "text": "onSelect(index) {\n // console.log(\"onSelectCalled\", this.indexer)\n let selectArray = (this.indexer[index]);\n for (let i = 0; i < selectArray.length; i++) {\n const displaycell = selectArray[i];\n let element = displaycell.getComponent(\"Element_\");\n if (element)\n element.setAsSelected();\n if (this.onselect)\n this.onselect(index, displaycell);\n }\n }", "title": "" }, { "docid": "38adaa40220c42401a8ffb0d8f0785c8", "score": "0.57464564", "text": "select() {\n this.selected = true;\n this.renderSelected();\n }", "title": "" }, { "docid": "a07361cb8430d14275494b6c121aed22", "score": "0.5745875", "text": "get selection() { return this._selection; }", "title": "" }, { "docid": "13aabcdb3851b8b62f864ebb84f0f5ee", "score": "0.57387", "text": "__selectFirstMatch() {\n var value = this.getValue();\n var dropdown = this.getChildControl(\"dropdown\");\n var selection = dropdown.getSelection();\n var selected = selection.getItem(0);\n\n // try to preselect the matching item even if there is no current selection\n if (selected === undefined || this.__convertValue(selected) !== value) {\n // only reset the old selection if there is one\n if (selected !== undefined) {\n // reset the old selection\n this.__ignoreChangeSelection = true;\n selection.removeAll();\n this.__ignoreChangeSelection = false;\n }\n\n // No calculation is needed when the value is empty\n if (value == null || value == \"\") {\n return;\n }\n\n var model = this.getModel();\n var lookupTable = dropdown.getChildControl(\"list\")._getLookupTable();\n for (var i = 0, l = lookupTable.length; i < l; i++) {\n var modelItem = model.getItem(lookupTable[i]);\n var itemLabel = this.__convertValue(modelItem);\n\n if (itemLabel && itemLabel.indexOf(value) == 0) {\n dropdown.setPreselected(modelItem);\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "6c8bf3d7d6e7edfa87af64bf076b3273", "score": "0.5720828", "text": "function select(event){\n\tgetPosition(event);\n\tfor (line of lines){\n\t\tif(ctx.isPointInStroke(line.path, mouse_coord.x, mouse_coord.y)){\n\n\t\t\tselected = 1;\n\t\t\tselected_line = line;\n\t\t\tpressed_button = event.button;\n\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "1ec27d4667031baa10f705df874cb719", "score": "0.57040775", "text": "function selectE() {\r\n var sE = Draw.extractE('mousedown')\r\n .filterE(modeFilter)\r\n .mapE(function(m) {\r\n var shapes = Draw.getShapes()\r\n // Find out if a shape has been selected. From top layer to bottom.\r\n for(var i = shapes.length - 1; i >= 0; i--) {\r\n var possible = shapes[i];\r\n var x = m.layerX, y = m.layerY;\r\n if(possible.isOn(x,y)) {\r\n shape = possible;\r\n return { x:x, y:y };\r\n }\r\n }\r\n // if no shape was detected, report this\r\n return false;\r\n });\r\n // filter out all false selections\r\n return sE.filterE(function(e){return e});\r\n }", "title": "" }, { "docid": "655b0f598c450407de06db84447fb414", "score": "0.56832105", "text": "function selectAnswer(event) {\r\n console.log(lastSelection);\r\n if (lastSelection) {\r\n lastSelection.element.classList.remove('selected');\r\n }\r\n\r\n if (!lastSelection || lastSelection.col === this.col) {\r\n lastSelection = this;\r\n this.element.classList.add('selected');\r\n } else {\r\n drawLine(getPoint(this.element), getPoint(lastSelection.element));\r\n lastSelection = null;\r\n }\r\n}", "title": "" }, { "docid": "4437f8771f496f3edcf925add3f20496", "score": "0.56829", "text": "_getFirstSelectedChip() {\n if (Array.isArray(this.selected)) {\n return this.selected.length ? this.selected[0] : undefined;\n }\n else {\n return this.selected;\n }\n }", "title": "" }, { "docid": "4437f8771f496f3edcf925add3f20496", "score": "0.56829", "text": "_getFirstSelectedChip() {\n if (Array.isArray(this.selected)) {\n return this.selected.length ? this.selected[0] : undefined;\n }\n else {\n return this.selected;\n }\n }", "title": "" }, { "docid": "11787e389305d6e7e9d6d69cc2141a9d", "score": "0.56767577", "text": "function handleSelect(selection) {\n switch(selection){\n case 'first': {\n handleStarSelect(1);\n return;\n }\n case 'second': {\n handleStarSelect(2);\n return;\n }\n case 'third': {\n handleStarSelect(3);\n return;\n }\n case 'fourth': {\n handleStarSelect(4);\n return;\n }\n case 'fifth': {\n handleStarSelect(5);\n return;\n }\n default: {\n handleStarSelect(0);\n }\n }\n}", "title": "" }, { "docid": "97e274724b1b4009d6dbcaa0a55a7af6", "score": "0.5674229", "text": "saveSelectStart() {\n chrome.automation.getFocus((focusedNode) => {\n this.selectionStartObject_ = focusedNode;\n this.selectionStartIndex_ = this.getSelectionIndexFromNode_(\n this.selectionStartObject_, true /*We are getting the start index.*/);\n });\n }", "title": "" }, { "docid": "a5a093104de373378f79a88591751ac3", "score": "0.56677336", "text": "function myExploreFunction() {\n document.getElementById('d3-dropdown-scenario').value = 'none';\n select(\"explore\")\n}", "title": "" }, { "docid": "d2f537d19a47d685affd40a01ec52136", "score": "0.5664825", "text": "function LaunchViewSelection(e){\r\n\t\tvar e = e || window.event;\r\n var target = e.target || e.srcElement;\r\n\t\tvar targetId = target.id;\r\n\t\tvar viewCatMean = targetId.replace(\"list\",\"\");\r\n\t\tvar newTabName = getViewName(viewCatMean);\r\n\t\tvar insertIndx = null;\r\n\t\tvar viewLen = viewpoint.VIEWS.length;\r\n\t\tvar extraTabLeft = null;\r\n\t\tvar extraTabRight = null;\r\n\t\tvar extraTabContainer = null;\r\n\t\tvar extraTab = null;\r\n\t\tvar initialExtraTabLoad = false;\r\n\t\tvar parent;\r\n\t\tvar prevView;\r\n\t\tvar nextView;\r\n\t\tvar x;\r\n\t\tvar viewIndx;\r\n\t\tvar viewObj = getViewObject(viewCatMean);\r\n\t\t\r\n\t\t//If the menu body was clicked instead of a menu item\t\t\r\n\t\tif(targetId === \"mnuContent\"){ return; }\r\n\t\t\r\n\t\t//Determine if there is already an extra tab showing\r\n\t\tfor(x = viewLen; x--; ){\r\n\t\t\t//If the tab is selectable in the drop down and it is currently showing in the extra tab\r\n\t\t\tif(viewpoint.VIEWS[x].MENU_ITEM && viewpoint.VIEWS[x].SHOWN_IND){\r\n\t\t\t\tinsertIndx = viewpoint.VIEWS[x].VIEW_SEQUENCE;\r\n\t\t\t\tviewIndx = x;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Determine if the view selected is already showing, if so dont do anything\r\n\t\tvar tabCont = _g('vwpTabCont');\r\n\t\tvar curViewContIndx = tabCont.className.match(/vwp-tabview[0-9]+/)[0];\r\n\t\tcurViewContIndx = curViewContIndx.replace(/vwp-tabview/, \"\");\r\n\t\tcurViewContIndx = parseInt(curViewContIndx, 10);\r\n\t\tif(curViewContIndx === viewObj.VIEW_SEQUENCE){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//This is a specific check for null DO NOT CHANGE\r\n\t\tif(insertIndx !== null){ //Previously selected drop down item showing. Replace it and mark it as not showing\r\n\t\t\tviewpoint.VIEWS[viewIndx].SHOWN_IND = 0;\r\n\t\t\tviewpoint.VIEWS[viewIndx].VIEW_SEQUENCE = 99;\r\n\t\t\textraTabLeft = _g('TabLeft' + insertIndx);\r\n\t\t\textraTabContainer = Util.gp(extraTabLeft);\r\n\t\t}\r\n\t\telse{//Populate the extra tab since it isnt already shown\r\n\t\t\textraTabLeft = _g('TabLeftExtra');\r\n\t\t\textraTabContainer = Util.gp(extraTabLeft);\r\n\t\t\tinsertIndx = 5;\r\n\t\t\tinitialExtraTabLoad = true;\r\n\t\t}\r\n\t\t\r\n\t\t//Mark the newly selected tab as showing and note its view sequence\r\n\t\tif(viewObj){\r\n\t\t\tviewObj.SHOWN_IND = 1;\r\n\t\t\tviewObj.VIEW_SEQUENCE = insertIndx;\r\n\t\t}\r\n\t\t\r\n\t\t//Delete the existing tab\r\n\t\tUtil.de(extraTabContainer);\r\n\t\t\r\n\t\tvar extraTabSpan = Util.ce('span');\r\n\t\tvar extraTabInnerHTML = [];\r\n\t\textraTabInnerHTML.push(\"<span class='vwp-tab-container'><span class='vwp-inactive-left vwp-left-item' id='TabLeft\",insertIndx,\"'></span><span class='vwp-tab-item vwp-tab\",insertIndx,\"' id='Tab\",insertIndx,viewCatMean,\"' title='\", newTabName,\"'>\", newTabName, \"</span><span class='vwp-inactive-right vwp-right-item' id='TabRight\",insertIndx,\"'></span></span>\");\r\n\t\textraTabSpan.innerHTML = extraTabInnerHTML.join('');\r\n\t\tif(insertIndx === 0){ //Tab to replace is at the beginning of the viewPoint\r\n\t\t\tparent = _g('vwpTabList');\r\n\t\t\tnextView = _g('TabLeft1');\r\n\t\t\tnextView = Util.gp(nextView);\r\n\t\t\tparent.insertBefore(extraTabSpan, nextView);\r\n\t\t}\r\n\t\telse{ //Tab is not at the beginning\r\n\t\t\tprevView = _g('TabRight' + ( insertIndx - 1 ));\r\n\t\t\tprevView = Util.gp(prevView);\r\n\t\t\tUtil.ia(extraTabSpan, prevView);\r\n\t\t}\r\n\t\t//Add click events to the extra tab\r\n\t\textraTab = _g(\"Tab\" + insertIndx + viewCatMean);\r\n\t\tif(extraTab){\r\n\t\t\textraTab.onclick = function(){\r\n\t\t\t\tMP_Util.AddCookieProperty(\"viewpoint\", \"viewName\", newTabName);\r\n\t\t\t\tMP_Util.AddCookieProperty(\"viewpoint\", \"viewCatMean\", viewCatMean);\r\n\t\t\t\tMP_Util.WriteCookie();\r\n\t\t\t\tchangeTab(insertIndx, viewCatMean);\r\n\t\t\t};\r\n\t\t}\r\n\t\t\r\n\t\tvar extraTabContentDiv = null;\r\n\t\tvar tabCont = _g('vwpTabCont');\r\n\t\tvar tabPrior = null;\r\n\t\tvar tempTabContentDiv = null;\r\n\t\tvar viewPointTabsDiv = null;\r\n\t\t\r\n\t\t//Load the tab content\r\n\t\tif(initialExtraTabLoad){ //If the extra tab isnt shown already\r\n\t\t\textraTabContentDiv = _g('TabExtraContent');\r\n\t\t\tUtil.de(extraTabContentDiv);\r\n\t\t\t//Create the replacement tab content with the proper class names and id\r\n\t\t\textraTabContentDiv = Util.ce('div');\r\n\t\t\textraTabContentDiv.id = viewCatMean;\r\n\t\t\textraTabContentDiv.className = \"vwp-tab-data vwp-data\"+insertIndx;\r\n\t\t\ttabPrior = \"vwp-data\" + (insertIndx - 1);\r\n\t\t\ttempTabContentDiv = Util.Style.g(tabPrior, tabCont, 'div')[0];\r\n\t\t\tUtil.ia(extraTabContentDiv, tempTabContentDiv);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tviewPointTabsDiv = _g('vwpTabCont');\r\n\t\t\textraTabContentDiv = Util.Style.g('vwp-data'+insertIndx, viewPointTabsDiv, 'div')[0];\r\n\t\t\tUtil.de(extraTabContentDiv);\r\n\t\t\t\r\n\t\t\t//Create the replacement tab content with the proper class names and id\r\n\t\t\tvar extraTabContentDiv = Util.ce('div');\r\n\t\t\textraTabContentDiv.id = viewCatMean;\r\n\t\t\textraTabContentDiv.className = \"vwp-tab-data vwp-data\"+insertIndx;\r\n\r\n\t\t\t//Insert extra tab content div\r\n\t\t\tvar parent = _g('vwpContentBody');\r\n\t\t\tif(insertIndx === 0) {\r\n\t\t\t\ttempTabContentDiv = Util.Style.g(\"vwp-data1\", tabCont, 'div')[0];\r\n\t\t\t\tparent.insertBefore(extraTabContentDiv, tempTabContentDiv);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttabPrior = \"vwp-data\" + (insertIndx - 1);\r\n\t\t\t\ttempTabContentDiv = Util.Style.g(tabPrior, tabCont, 'div')[0];\r\n\t\t\t\tUtil.ia(extraTabContentDiv, tempTabContentDiv);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Save the canges to the user preferences and the cookie if the insertIndx is not the last tab\r\n\t\tif(insertIndx < 5){\r\n\t\t\tMP_Core.AppUserPreferenceManager.SaveViewpointPreferences(viewpoint.VIEWPOINT_NAME_KEY, viewpoint);\r\n\t\t}\t\r\n\t\t//Update the cookie with the new information\r\n\t\tMP_Util.AddCookieProperty(\"viewpoint\", \"viewName\", newTabName);\r\n\t\tMP_Util.AddCookieProperty(\"viewpoint\", \"viewCatMean\", viewCatMean);\r\n\t\tMP_Util.WriteCookie();\r\n\t\tchangeTab(insertIndx, viewCatMean);\r\n\t}", "title": "" }, { "docid": "ab1fd9a7056f373fb01215068dcfc066", "score": "0.565677", "text": "select() {\n const input = this.getInput();\n if (input) {\n input.select();\n }\n }", "title": "" }, { "docid": "8f3e6eb1fdf734021436a217c1bf21b5", "score": "0.5649832", "text": "function getSelected() {\n return selected;\n }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5638499", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "a52e9fbe2c0a6776a32ff8122871147d", "score": "0.56211555", "text": "function SetSelectorAndAddOne(Name, index){\n var opts = SelectorLinesArray[index].children[0].options;\n var mathcFound = false;\n\n //Searches for identical name and selects it\n for (var i = 0; i < opts.length; i++) {\n if (opts[i].innerText == Name) {\n\n //Found in existing array\n SelectorLinesArray[index].children[0].selectedIndex = i;\n mathcFound = true;\n break;\n }\n }\n\n //If search was unsuccessful, creates additional option for that selector and selects it to be displayable\n if(!mathcFound){\n var selector = SelectorLinesArray[index].children[0];\n CreateOption(selector, Name);\n\n //Adds new event for this Selector\n //Then selection changes will remove that option to reselect\n //We will not be able to reselect it since we don't save coordinates of that point\n //then it is reselected coordinates disapier as well therefore program would crash if\n //user would be able to select point which does not exist\n selector.onchange = function(){\n selector.removeChild(selector.children[opts.length - 1]);\n }\n\n //Selects last selection which was added as new, since it did not exist before\n SelectorLinesArray[index].children[0].selectedIndex = opts.length - 1;\n }\n\n AddSelector();\n}", "title": "" }, { "docid": "1f1918d632571668467f9b31d8fa2fa2", "score": "0.56206787", "text": "function selectListItem() {\r\n var abs = [],\r\n first;\r\n\r\n // Collect selected rows indexes\r\n for (var i = 0, len = listbox.children.length; i < len; i++) {\r\n if (listbox.children[i].selected) {\r\n abs.push(resAbs[i].ab);\r\n if (isNaN(first)) first = resAbs[i].idx;\r\n }\r\n }\r\n\r\n activeDocument.artboards.setActiveArtboardIndex(first);\r\n\r\n var ratio = strToAbsNum(zoomInp.text, CFG.defZoom);\r\n zoom(abs, ratio, isZoom.value);\r\n }", "title": "" }, { "docid": "1e258d024b8f98aaa6a8c787ee794691", "score": "0.5620002", "text": "function selectSingle(idx) {\r\n var elem = $(this.target().children()[idx]);\r\n var sel = elem.attr('selected');\r\n\r\n //clear all selected items\r\n fn_clearSelected(this.target());\r\n\r\n if (!sel) {\r\n elem.attr('selected', 1);\r\n elem.addClass('metroui-list-selected');\r\n }\r\n\r\n return this;\r\n }", "title": "" }, { "docid": "0e8d6562d4464e8686361e8ff350dd67", "score": "0.5616955", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "7c0fd9506710182edf150759319e4cf3", "score": "0.5609459", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "7c0fd9506710182edf150759319e4cf3", "score": "0.5609459", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "7c0fd9506710182edf150759319e4cf3", "score": "0.5609459", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "7c0fd9506710182edf150759319e4cf3", "score": "0.5609459", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "8a6664354e7241b8322c12d4242c9301", "score": "0.5598983", "text": "function do_click_on_ctrl_meta_shift_click__selected_test(e){\n\t\tvar list = getMultiselectableList()\n\t\tvar items = list.find('li')\n\t\tvar first = items.first().trigger(getMouseDownEvent())\n\t\tvar last = items.last().trigger(getShiftMouseDownEvent())\n\t\tvar first = items.first().click()\n\n\t\texpect(items.length)\n\t\tok(isSelected(first), 'first item is selected')\n\t\titems.not(first).each(function(){\n\t\t\tok(!isSelected($(this)), 'all other items are not selected')\n\t\t})\n\t}", "title": "" }, { "docid": "ca684ea0b79895a125eee092db482af3", "score": "0.55964893", "text": "_setSelectionByValue(value) {\n if (this.multiple && value) {\n if (!Array.isArray(value)) {\n throw getMatSelectNonArrayValueError();\n }\n this._selectionModel.clear();\n value.forEach((currentValue) => this._selectValue(currentValue));\n this._sortValues();\n }\n else {\n this._selectionModel.clear();\n const correspondingOption = this._selectValue(value);\n // Shift focus to the active item. Note that we shouldn't do this in multiple\n // mode, because we don't know what option the user interacted with last.\n if (correspondingOption) {\n this._keyManager.setActiveItem(correspondingOption);\n }\n else if (!this.panelOpen) {\n // Otherwise reset the highlighted option. Note that we only want to do this while\n // closed, because doing it while open can shift the user's focus unnecessarily.\n this._keyManager.setActiveItem(-1);\n }\n }\n this._changeDetectorRef.markForCheck();\n }", "title": "" }, { "docid": "360af3c7fe91e805c78a8b645a2b771a", "score": "0.5593004", "text": "get selection() {\n if (this.curSelectionAt < this.steps.length) {\n this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionAt))\n this.curSelectionAt = this.steps.length\n }\n return this.curSelection\n }", "title": "" }, { "docid": "f3fa216cb2c41514b1b5cb7b9d871895", "score": "0.5590013", "text": "_onSingleSelect (selection) {\n this.setState({singleSelected: selection});\n }", "title": "" }, { "docid": "2f11f14503f440f487fdbd21e2313fa9", "score": "0.5568716", "text": "selectItem (i) { this.toggSel(true, i); }", "title": "" }, { "docid": "78c17fc7ed1938eb6a5d345cecebccfb", "score": "0.55612606", "text": "function canvas_mouseselect(mcoord, limit, change_did_only)\n{\n var ccoord = canvas_m2c(mcoord);\n var ncoord = canvas_c2n(ccoord);\n\n var did = canvas_selectobject(ccoord, limit);\n if (did < 0) {\n canvas_clearselection();\n return;\n }\n\n did_selected = did;\n\n if (!change_did_only) {\n local_log(\"[draw] select object (id = \" + did_selected + \")\");\n\n console.log(drawlist[did]);\n \n canvas_redrawselected();\n\n select_color(get_color_id(drawlist[did_selected].color), false);\n select_thickness(get_thickness_id(drawlist[did_selected].thickness), false);\n \n $(\"#viewfile_dtoolbox\").show();\n $(\"#viewfile_deditbox\").show();\n }\n}", "title": "" }, { "docid": "e5d2fe2bcc1b66dc9331cd4a63eaf576", "score": "0.5560568", "text": "function Select(prevSelected) {\n var random = -1;\n var probability = 0;\n var randomProb = 0;\n if(prevSelected !== undefined) {\n do {\n random = RandomRange(0, population.length - 1);\n probability = (population.length - random) / population.length;\n randomProb = RandomRange(0, 1);\n } while(population[random] === prevSelected && probability > randomProb);\n }\n else {\n do {\n random = RandomRange(0, population.length - 1);\n probability = (population.length - random) / population.length;\n randomProb = RandomRange(0, 1);\n } while(probability > randomProb);\n }\n return population[random];\n }", "title": "" }, { "docid": "97f524872d24f1e0d5903ec9efce03c8", "score": "0.55569506", "text": "function selectMock(mock, selection) {\n mockService.update({'identifier': mock.identifier, 'scenario': selection || 'passThrough'}, function () {\n vm.selections[mock.identifier] = selection;\n });\n }", "title": "" }, { "docid": "fb8b9ebd7f04a95c4692d5dfd52d2b59", "score": "0.55562365", "text": "function selectNext() {\n if (items.length < 1) {\n selected = undefined;\n }\n if (!selected || selected === items[items.length - 1]) {\n selected = items[0];\n return;\n }\n for (var i = 0; i < (items.length - 1); i++) {\n if (selected === items[i]) {\n selected = items[i + 1];\n break;\n }\n }\n }", "title": "" }, { "docid": "fb8b9ebd7f04a95c4692d5dfd52d2b59", "score": "0.55562365", "text": "function selectNext() {\n if (items.length < 1) {\n selected = undefined;\n }\n if (!selected || selected === items[items.length - 1]) {\n selected = items[0];\n return;\n }\n for (var i = 0; i < (items.length - 1); i++) {\n if (selected === items[i]) {\n selected = items[i + 1];\n break;\n }\n }\n }", "title": "" }, { "docid": "39585014221546360e160dbefb7017ab", "score": "0.55533403", "text": "function setSelection(newSelection) {\n if (newSelection!='Same'){\n selectBy = newSelection;\n }\n updateNetwork();\n}", "title": "" }, { "docid": "cf858834e596e242ea85fec98f675d14", "score": "0.5550886", "text": "function selectList ( list ) {\n self.selected = angular.isNumber(list) ? $scope.lists[list] : list;\n self.toggleList();\n }", "title": "" }, { "docid": "aee86c98aaba636d3c28cf0766ce02c6", "score": "0.5546808", "text": "function handleSelections(selections) {\r\n\t// selection may (currently) be sketch or element (with sketchId) or thing from selection history\r\n\t// add to selection history\r\n\tvar newSelectionRecordIds = new Array();\r\n\tfor (var si=0; si<selections.length; si++) {\r\n\t\tvar selection = selections[si];\r\n\t\tif (selection.selectionRecordId) {\r\n\t\t\tconsole.log('Selection from selection history '+selection.selectionRecordId);\r\n\t\t\tnewSelectionRecordIds.push(selection.selectionRecordId);\r\n\t\t\tcanDeleteSelection = false;\r\n\t\t} else {\r\n\t\t\tmoveHistory();\r\n\t\t\t// either sketch or elements\r\n\t\t\tvar group = undefined;\t\t\r\n\t\t\tif (selection.sketch) {\r\n\t\t\t\tgroup = createIndexItemFromElements(selection.sketch, selection.sketch.elements, selectionProject);\r\n\t\t\t} else if (selection.elements) {\r\n\t\t\t\tgroup = createIndexItemFromElements(undefined, selection.elements, selectionProject);\r\n\t\t\t} else if (selection.sequence) {\r\n\t\t\t\tgroup = createIndexItemFromSequenceItems(selection.sequence.id, selection.sequence.description, selection.sequence.items, selectionProject);\r\n\t\t\t}\r\n\t\t\tvar selectionRecord = { id : nextSelectionRecordId++, selection : selection };\r\n\t\t\tgroup.selectionRecordId = selectionRecord.id;\r\n\t\t\tselectionRecords[selectionRecord.id] = selectionRecord;\r\n\t\t\tnewSelectionRecordIds.push(selectionRecord.id);\r\n\t\t\tgroup.translate(new paper.Point(INDEX_CELL_SIZE/2-group.bounds.center.x, (INDEX_CELL_SIZE-INDEX_LABEL_HEIGHT)/2-group.bounds.center.y));\r\n\t\t\tselectionRecord.item = group;\r\n\t\t}\r\n\t}\r\n\t//selectionProject.view.zoom = 1;\r\n\t//selectionProject.view.center = new paper.Point($(selectionProject.view._element).width()/2, INDEX_CELL_SIZE/2);\r\n\t// remove old selection(s)\r\n\tclearCurrentSelection();\r\n\t// update current selection\r\n\tvar showFrame = showingSequences;\r\n\tfor (var si=0; si<newSelectionRecordIds.length; si++) {\r\n\t\tvar id = newSelectionRecordIds[si];\r\n\t\tvar selectionRecord = selectionRecords[id];\r\n\t\tif (!selectionRecord) {\r\n\t\t\tconsole.log('cannot find selection '+id);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar currentSelection = { id: id, record: selectionRecord };\r\n\t\tcurrentSelections.push(currentSelection);\r\n\t\t// highlight current selection in selection history\r\n\t\t// addHighlight is from sketchertools.js\r\n\t\tcurrentSelection.items = [];\r\n\t\tvar item = addHighlight(selectionProject, selectionRecord.item);\r\n\t\titem.strokeWidth = 3;\r\n\t\titem.strokeColor = '#808080';\r\n\t\tcurrentSelection.items.push(item);\r\n\t\tconsole.log('added history selection for '+currentSelection.id);\r\n\t\t// TODO highlght current selection in object projects and/or index projects??\r\n\t\t// if sequences view, first frame selection, show/zoom to...\r\n\t\tif (showFrame && selectionRecord.selection.sequence && selectionRecord.selection.sequence.items) {\r\n\t\t\tfor (var ii=0; ii<selectionRecord.selection.sequence.items.length; ii++) {\r\n\t\t\t\tvar sitem = selectionRecord.selection.sequence.items[ii];\r\n\t\t\t\tvar sketchId = null;\r\n\t\t\t\tif (sitem.frameRef && sitem.frameRef.sketchId)\r\n\t\t\t\t\tsketchId = sitem.frameRef.sketchId;\r\n\t\t\t\telse if (sitem.sketchRef)\r\n\t\t\t\t\tsketchId = sitem.sketchRef.sketchId;\r\n\t\t\t\tif (showFrame && sketchId) {\r\n\t\t\t\t\tvar sketch = sketchbook.sketches[sketchId];\r\n\t\t\t\t\tif (sketch) {\r\n\t\t\t\t\t\tsequencesViewProject.activate();\r\n\t\t\t\t\t\tshowFrame = false; // only once\r\n\t\t\t\t\t\tvar animateToAll = true;\r\n\t\t\t\t\t\tif (sketch!=currentSequencesSketch) {\r\n\t\t\t\t\t\t\tclearProject(sequencesViewProject);\r\n\t\t\t\t\t\t\tsequencesViewProject.layers[0].activate();\r\n\t\t\t\t\t\t\trefreshBackground(sketch);\r\n\t\t\t\t\t\t\tsequencesViewProject.layers[1].activate();\r\n\t\t\t\t\t\t\tcurrentSequencesSketch = sketch;\r\n\t\t\t\t\t\t\tcurrentSequencesSketch.toPaperjs(sketchbook, images);\r\n\t\t\t\t\t\t\tshowAll(sequencesViewProject);\r\n\t\t\t\t\t\t\tanimateToAll = false;\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\t// frame\r\n\t\t\t\t\t\tif (sitem.frameRef && sitem.frameRef.elementId) {\r\n\t\t\t\t\t\t\tvar el = sketch.getElementById(sitem.frameRef.elementId);\r\n\t\t\t\t\t\t\tif (el && el.frame) { \r\n\t\t\t\t\t\t\t\tvar bounds = new paper.Rectangle(el.frame.x, el.frame.y, el.frame.width, el.frame.height);\r\n\t\t\t\t\t\t\t\tvar w = $(sequencesViewProject.view._element).width();\r\n\t\t\t\t\t\t\t\tvar h = $(sequencesViewProject.view._element).height();\r\n\t\t\t\t\t\t\t\tvar zoom = Math.min(MAX_ZOOM, w/bounds.width, h/bounds.height);\r\n\t\t\t\t\t\t\t\t//console.log('showAll: bounds='+bw+','+bh+', canvas='+w+','+h+', zoom='+zoom+', bounds.center='+bounds.center);\r\n\t\t\t\t\t\t\t\tanimateTo(sequencesViewProject, zoom, bounds.center);\r\n\t\t\t\t\t\t\t\tanimateToAll = false;\r\n\t\t\t\t\t\t\t\t//sequencesViewProject.view.zoom = zoom;\r\n\t\t\t\t\t\t\t\t//sequencesViewProject.view.center = bounds.center;\r\n\t\t\t\t\t\t\t\t// zoom \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (animateToAll) {\r\n\t\t\t\t\t\t\tvar all = getZoomAll(sequencesViewProject);\r\n\t\t\t\t\t\t\tanimateTo(sequencesViewProject, all.zoom, all.center);\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\tupdateActionsForCurrentSelection();\r\n\tif (currentSelections.length==0) {\r\n\t\t$('#propertiesShowSelection').addClass('propertiesShowDisabled');\r\n\t\thandlePropertiesShowSelected('propertiesShowNew');\r\n\t}\r\n\telse {\r\n\t\t$('#propertiesShowSelection').removeClass('propertiesShowDisabled');\r\n\t\thandlePropertiesShowSelected('propertiesShowSelection');\t\t\r\n\t}\r\n\tupdatePropertiesForCurrentSelection();\r\n\tredraw(paper);\r\n}", "title": "" }, { "docid": "e95b60804f8358564cff879a714c4730", "score": "0.5546165", "text": "_onSelectionChanged() {\n Object(algorithm_lib[\"each\"])(this._toolChildren(), widget => {\n messaging_lib[\"MessageLoop\"].sendMessage(widget, notebooktools_NotebookTools.SelectionMessage);\n });\n }", "title": "" }, { "docid": "a3ccb7ed2e40f73106cf5779be6f4b94", "score": "0.55457795", "text": "function selectSelectTool() {\n resetSelectorState();\n selectTool = true;\n resetButtonSelected();\n selectButton(selectionButton);\n}", "title": "" }, { "docid": "813766cc9428f019f3311d0065f8eb00", "score": "0.55455315", "text": "selectTop() {\r\n\t\tif (this.myPile.length > 0)\r\n\t\t\tthis.getTop().setSelected(true);\t\t\r\n\t}", "title": "" }, { "docid": "81e20f37b8b7495a9a4e9441e636922a", "score": "0.5544416", "text": "function setSelected(index) {\n _selected = _currentList.variants[index];\n}", "title": "" }, { "docid": "317b18a5df9a36fa8e58da5caa65d71a", "score": "0.55423534", "text": "function getSelected()\n{\n return selected;\n}", "title": "" }, { "docid": "8ff620485839a7c8fd127470834b6fe8", "score": "0.5541878", "text": "function selection(sel){\t\n\n\t\n\tvar nbhd = sel.closedNeighborhood();\n\tvar others = cy.elements().not( nbhd );\n\tlayout.stop();\n\treset();\n others.addClass('semitransp');\n\tnbhd.addClass('highlight');\n\n\n// return Promise.resolve()\n// .then( reset )\n// .then( pullNbhd )\n// .then( fit(nbhd) )\n// .then( showOthersFaded )\n// ;\n\tpullNbhd(nbhd,sel);\n // fit(nbhd);\n}", "title": "" }, { "docid": "d46f75d7cf4e25b937fbcbcf1053e8ef", "score": "0.5527472", "text": "function customSelect() {\n\tvar firstItem = $('.js-choiseItem > li:nth-child(1) > a').text();\n\t$('.js-currentItem').text(firstItem);\n\tjQuery('body').on('click', '.js-choiseItem a', function(e) {\n\t\te.preventDefault();\n\t\t$('.js-currentItem').text($(this).text());\n\t});\n}", "title": "" }, { "docid": "da149fe4a640cccc916c7862a1a14a9e", "score": "0.5527363", "text": "function selectItemOnMatch () {\n var searchText = $scope.searchText,\n matches = ctrl.matches,\n item = matches[ 0 ];\n if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n if (searchText == displayValue) select(0);\n });\n }", "title": "" }, { "docid": "8efa993df18f89164bb492aa7a42f01b", "score": "0.5524106", "text": "toggleSelection(item) {\n if (this.disabled) return;\n\n let index = this._inSelectedItems(item);\n\n if (index > -1) {\n this.selectedItems.splice(index, 1);\n } else {\n if (!_.isObject(item) || !item[\"__fixed__\"] || this.includeList.indexOf(item) < 0) {\n this.selectedItems.push(item);\n }\n }\n\n this.$element[0].querySelector('.dnd-panel').focus();\n }", "title": "" }, { "docid": "219d776352261faa41d8dcf72e9026e3", "score": "0.5522339", "text": "select(uuid) {\n const selected = this.entityMap.get(uuid);\n\n if (selected) {\n this.devtoolsScene.selectObject(selected);\n this.selected = window.$t = selected;\n }\n }", "title": "" }, { "docid": "27901023137460c37f562135bc60cfc8", "score": "0.55123204", "text": "function Select(index) {\n if (index > m_anchors.length) {\n throw new Error(\"index is greater than total anchor number.\");\n }\n if ((index = Math.max(-1, index)) == m_selectedIndex) {\n return;\n }\n\n m_anchors.ForEach(function (item) {\n item.IsSelected = false;\n });\n if (index >= 0) {\n m_anchors[index].IsSelected = true;\n }\n\n var unselectedIndex = m_selectedIndex;\n m_selectedIndex = index;\n m_selectedAnchorChanged.Raise({\n SelectedIndex: index,\n UnselectedIndex: unselectedIndex,\n SelectedAnchor: index >= 0 ? m_anchors[index].Anchor : null,\n UnselectedAnchor: unselectedIndex >= 0 && unselectedIndex < m_anchors.length ? m_anchors[unselectedIndex].Anchor : null\n });\n }", "title": "" }, { "docid": "bfdab6366fbab33760e9b7d13629bfd9", "score": "0.55101025", "text": "select() {\n this._stepper.selected = this;\n }", "title": "" }, { "docid": "8b6c99e0b63a3cb4a67fde1016896025", "score": "0.54971665", "text": "select() {\n if (this.inRange()) {\n this._selection = true;\n }\n }", "title": "" }, { "docid": "c312aaaa412ef43e2becc65269399bff", "score": "0.54960877", "text": "select() {\n this.props.setActiveStep(this.props.step);\n }", "title": "" }, { "docid": "8e65e4747d08b04b4c53a33b8b613f1a", "score": "0.5494091", "text": "function clickSelectedItem() {\n\twhichButton = getSelectedItem();\n\tif (whichButton != null) {\n\t\t$(whichButton).click();\n\t}\n}", "title": "" }, { "docid": "850c139ec80af996cd4e8b765101716b", "score": "0.54938513", "text": "_select_one(object) {\n return event => {\n if (this.state.selected_objects.contains(object)) {\n this.state.selected_objects.remove(object);\n\n this.setState({ selected_objects: this.state.selected_objects });\n } else {\n this.state.selected_objects.add(object);\n this.setState({ selected_objects: this.state.selected_objects });\n }\n };\n }", "title": "" }, { "docid": "4b237e500cdf521e4a79c2b23463c9cc", "score": "0.5492621", "text": "function tocSelectLogic() {\n if (this.value !== \"placeholder\") {\n window.location = this.value;\n getById(\"firstOption\").selected = \"true\";\n }\n }", "title": "" }, { "docid": "9aadde8f05f50ed84c6bb756900bf241", "score": "0.5491182", "text": "clickSelect() {\n if (status === 'initial') {\n n = this.id * 1;\n // console.log((n) + typeof(n));\n build.selectPlayers(n);\n // selectPlayersKey(n);\n }\n }", "title": "" }, { "docid": "81a64d942994cfe6554a93009b53ddc9", "score": "0.5483786", "text": "function doSelection() {\n\n init();\n\n // updateselection recursively called to call nextSelection at growing intervals\n var updateSelection = function() {\n clearInterval(interval);\n elapsedTime += counter;\n if (elapsedTime >= selectionDuration) {\n findWinner();\n return;\n }\n counter *= counterIncrementer;\n nextSelection();\n interval = setInterval(updateSelection, counter);\n };\n\n var interval = setInterval(updateSelection, counter);\n }", "title": "" }, { "docid": "fd3b0322f2e8851cec6cb257655244d7", "score": "0.54789716", "text": "function selectObjectFromList( element )\n{\n let type = element.innerText.split(\"(\")[0];\n let number = parseInt(element.innerText.split(\"(\")[1].split(\")\")[0]);\n let aux = 0;\n\n for(var i = 0; i < objects.length; i++)\n {\n if(type === objects[i].type)\n {\n aux++;\n }\n\n if(aux === number)\n {\n objectSelected = retrieveObjectFromScene(objects[i].id);\n setInspectorValues();\n break;\n }\n }\n}", "title": "" }, { "docid": "ccc0749c3d81da8c8d880401f3eeb362", "score": "0.5477393", "text": "function showSelected() {\n \n}", "title": "" } ]
0e0e02c1d1336b6befbb7f91c05e607c
Escapes a json pointer path
[ { "docid": "e864bcdadf93c68fc6c6548b803a11cc", "score": "0.5573519", "text": "function escapePathComponent(path) {\r\n\t if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n\t return path;\r\n\t return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n\t}", "title": "" } ]
[ { "docid": "55cb4b0265c7f561a5199c9163cfa728", "score": "0.76757246", "text": "function escapeJsonPointerToken(token) {\n return external_querystring_browser_default.a.escape(token.replace(/~/g, '~0').replace(/\\//g, '~1'));\n}", "title": "" }, { "docid": "cb9a86fa9e6dbe55308e0beddbf1d8c9", "score": "0.66574764", "text": "function escapeJSON (str) {\n//\tconsole.log(\"Removing \\\" from \" + str);\n return str.replace(/\\\\/gi,'');\n}", "title": "" }, { "docid": "c012241824ef745bce17543c01355824", "score": "0.6476949", "text": "function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n return external_querystring_browser_default.a.unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));\n}", "title": "" }, { "docid": "71a3b377d1b165cea813b1cf98fc37f0", "score": "0.63599706", "text": "function jsonEscape(str) {\n return str.replace(/\\\\n/g, \"\\\\\\\\n\").replace(/\\r/g, \"\\\\\\\\r\").replace(/\\t/g, \"\\\\\\\\t\");\n}", "title": "" }, { "docid": "e9f496ad4df3c372761a0bc28324f216", "score": "0.62185097", "text": "function jsonEscape(json, wrap)\n\t{\n\t\tif (wrap)\t\t\t\t\t\t\t//wrap with escape codes to discard...\n\t\t\tjson = PREFIX + json + SUFFIX;\t//...outer quotes wrapped upon return\n\n\t\tif (typeof(json) != 'string')\n\t\t\treturn json;\n\n\t\tjson = json.replace(/\"/g, QUOTE);\n\t\tjson = json.replace(/\\n/g, NEWLINE);\n\t\tjson = json.replace(/\\\\/g, BACKSLASH);\n\t\treturn json;\n\t}", "title": "" }, { "docid": "e9f496ad4df3c372761a0bc28324f216", "score": "0.62185097", "text": "function jsonEscape(json, wrap)\n\t{\n\t\tif (wrap)\t\t\t\t\t\t\t//wrap with escape codes to discard...\n\t\t\tjson = PREFIX + json + SUFFIX;\t//...outer quotes wrapped upon return\n\n\t\tif (typeof(json) != 'string')\n\t\t\treturn json;\n\n\t\tjson = json.replace(/\"/g, QUOTE);\n\t\tjson = json.replace(/\\n/g, NEWLINE);\n\t\tjson = json.replace(/\\\\/g, BACKSLASH);\n\t\treturn json;\n\t}", "title": "" }, { "docid": "9c1592faf001e93ee3c981cc1e83652c", "score": "0.6132683", "text": "static jsonToEscapedString(json) {\n return JSON.stringify(json)\n .replace(/\"/g, \"&quot;\")\n .replace(/:/g, \"&#58;\")\n .replace(/{/g, \"&#123;\")\n .replace(/}/g, \"&#125;\")\n .replace(/\\[/g, \"\\[\")\n .replace(/\\]/g, \"\\]\")\n .replace(/\\*/g, \"\\*\")\n .replace(/\\$/g, \"\\$\")\n .replace(/\\./g, \"\\.\");\n }", "title": "" }, { "docid": "15ac584ef050589463b119f4daa2cf3a", "score": "0.6084129", "text": "function jsonPath(obj, expr, arg) {\n\tvar P = {\n\t\t//Possible resultType values:\n\t\t\t//VALUE - returns the actual value of the requested object\n\t\t\t//PATH - returns a string of the JSONPath(s) matched by the expression expr\n\t\t\t//PATH_DOTTED - JSONPath strings, except all key names are written in dot notation when possible\n\t\t\t//PATH_JSONPOINTER - returns a string in JSON Pointer format of the path(s) matched by the expression expr\n\t\tresultType: arg && arg.resultType || \"VALUE\",\n\t\t//singleQuoteKeys use with PATH and PATH_DOTTED to use single quotes for any quoted key names\n\t\tsingleQuoteKeys: arg && arg.singleQuoteKeys || false,\n\t\t//escapeUnicode use with PATH and PATH_DOTTED to replace char codes \\u0080-\\uffff with \\u Unicode escape sequences (\\u001f and below are already escaped by default) \n\t\tescapeUnicode: arg && arg.escapeUnicode || false,\n\t\tresult: [],\n\t\tnormalize: function(expr) {\n\n\t\t\t//work on strings only, pass through all others (like a pre-objectified path array)\n\t\t\tif (expr.constructor === null || expr.constructor !== String) { return expr }\n\n\t\t\tvar pathStack=[]\n\t\t\tvar baldRecursion=false\n\t\t\tvar lastLastIndex=0;\n\n\t\t\t//trim any leading/trailing whitespace, reverse the string\n\t\t\tvar revExpr=expr.replace(/^\\s*/,\"\").replace(/\\s*$/,\"\").split('').reverse().join('')\n\n\t\t\t//regex in reverse, to later be able to use negative lookahead assertions to quickly parse quotes strings containing escaped quotes\n\t\t\t//L1 structures: dotted keys, dotted star, opening bracket and $\n\t\t\tvar Level1Regex = /([\\w\\d$]*[A-Za-z_$])(\\.{1,2})|(\\*?)(\\.{1,2})|(\\])|(\\$)/g\n\n\t\t\tdo {\n\t\t\t\t//run regex, get a match\n\t\t\t\tvar L1Match = Level1Regex.exec(revExpr); \n\t\t\t\tif(L1Match === null) { break }\n\n\t\t\t\t//check if there is a difference from the length of the L1Match , if not we are stuck\n\t\t\t\tif((lastLastIndex+L1Match[0].length) !== Level1Regex.lastIndex || L1Match[0] === \"\" ){\n\t\t\t\t\tthrow new SyntaxError(\"Malformed path expression: \" + expr)\n\t\t\t\t}\n\n\t\t\t\t//.key1 or ..key2 - ([\\w\\d$]*[A-Za-z_$])(\\.{1,2})\n\t\t\t\t//.* or ..* - (\\*?)(\\.{1,2})\n\t\t\t\tif(L1Match[1] || L1Match[3]) {\n\t\t\t\t\tif(baldRecursion){throw new SyntaxError(\"Additional operators (./..) disallowed after recursive descent: \" + expr)}\n\t\t\t\t\t//filter out nulls\n\t\t\t\t\tL1Match=L1Match.filter(function(p) { return p != null })\n\n\t\t\t\t\tif(L1Match[1] === '*') { pathStack.unshift({\"expression\":\"*\"}) }\n\t\t\t\t\telse if(L1Match[1]) { pathStack.unshift(L1Match[1].split('').reverse().join('')) }\n\n\t\t\t\t\tif (L1Match[2] === '..') { pathStack.unshift({\"expression\":\"..\"}) }\n\t\t\t\t\telse if(L1Match[1] === '') { Level1Regex.lastIndex=lastLastIndex; break }\n\t\t\t\t}\n\t\t\t\t//(\\*?)(\\.{1,2}) - just the dots ..\n\t\t\t\telse if(L1Match[4]) {\n\t\t\t\t\tif(L1Match[4] === '.'){ break }\n\t\t\t\t\telse if(!pathStack.length){ baldRecursion=true; break }\n\t\t\t\t\telse if (pathStack[0].expression === \"..\") {\n\t\t\t\t\t\tthrow new SyntaxError(\"Additional operators (./..) disallowed after recursive descent: \" + expr)\n\t\t\t\t\t}\n\t\t\t\t\tpathStack.unshift({\"expression\":\"..\"})\n\t\t\t\t}\n\t\t\t\t// (\\]) - begin intra-bracket processing\n\t\t\t\telse if(L1Match[5]) {\n\t\t\t\t\tbaldRecursion = false\n\n\t\t\t\t\t//L2 intra-bracket regex: quoted keys, star, number, dash, commas, colons, closed parens (begin), open bracket (end) and space\n\t\t\t\t\tvar Level2Regex=/\\s*([\"'])(.*?)\\1(?!\\\\)|(\\*(?!:\\*))|(\\d+\\-?)|(-)|(,)|(:)|(\\))|(\\[)|\\s/g\n\t\t\t\t\tvar subArray=[], L2Match=[], subLastLastIndex=Level1Regex.lastIndex, pendingData=[], intraSlice=false, needsDelimiter=false, isSlice=false;\n\t\t\t\t\tvar openBracket=0, closedBracket=1;\n\n\t\t\t\t\t//set L2Regex to where we are in L1regex\n\t\t\t\t\tLevel2Regex.lastIndex = Level1Regex.lastIndex\n\t\t\t\t\tdo {\n\t\t\t\t\t\t//get a L2Match match to the exec on revExpr\n\t\t\t\t\t\tL2Match=Level2Regex.exec(revExpr)\n\t\t\t\t\t\t//catch loops with lastIndex not advancing\n\t\t\t\t\t\tif (L2Match === null || subLastLastIndex === Level2Regex.lastIndex || subLastLastIndex + L2Match[0].length !== Level2Regex.lastIndex ) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\"Malformed path expression : \" + expr)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//reverse things back\n\t\t\t\t\t\tL2Match = L2Match.map(function(s){return (!s ? s : s.split('').reverse().join(''))})\n\n\t\t\t\t\t\t//'key' or \"key\" - ([\"'])(.*?)\\1(?!\\\\)\n\t\t\t\t\t\tif(L2Match[2] === ''){ subArray.unshift(L2Match[2]) }\n\t\t\t\t\t\telse if(L2Match[2]){\n\t\t\t\t\t\t\tif (needsDelimiter) { Level2Regex.lastIndex=subLastLastIndex; break; } else { needsDelimiter=true }\n\t\t\t\t\t\t\tif (intraSlice) { break }\n\t\t\t\t\t\t\t//un-reverse, unescape and put in array\n\t\t\t\t\t\t\tpendingData.unshift(L2Match[2].replace(/\\\\'/g,\"'\").replace(/\\\\\"/g,'\"').replace(/\\\\n/g,'\\n').replace(/\\\\b/g,'\\b').replace(/\\\\f/g,'\\f').replace(/\\\\r/g,'\\r').replace(/\\\\t/g,'\\t').replace(/\\\\u([0-9a-fA-F]{4})/g,function($0,$1){return String.fromCharCode(parseInt($1,16))}))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//* - (\\*)\n\t\t\t\t\t\telse if(L2Match[3]){\n\t\t\t\t\t\t\tif (needsDelimiter) { Level2Regex.lastIndex=subLastLastIndex; break; } else { needsDelimiter=true }\n\t\t\t\t\t\t\tif (intraSlice) { break }\n\t\t\t\t\t\t\telse { pendingData.unshift({\"expression\":\"*\"}) }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//(\\d+\\-?) - integers positive or negative \n\t\t\t\t\t\telse if(L2Match[4]){\n\t\t\t\t\t\t\tif (needsDelimiter && !isSlice) { Level2Regex.lastIndex=subLastLastIndex; break; } else { needsDelimiter=true }\n\t\t\t\t\t\t\tif (isSlice && intraSlice) { intraSlice=false }\n\n\t\t\t\t\t\t\t//catch octal indices regardless of strict mode\n\t\t\t\t\t\t\tif (L2Match[4] !== \"0\" && (L2Match[4][0] === \"0\" || (L2Match[4][0] === \"-\" && L2Match[4][1] === \"0\"))){\n\t\t\t\t\t\t\t\tthrow new Error(\"Octal indices are disallowed: \" + L2Match[4])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tpendingData.unshift(Number(L2Match[4]))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//(-) - from JSON Pointer, represents the index AFTER the last one, always non-existent\n\t\t\t\t\t\telse if(L2Match[5]){\n\t\t\t\t\t\t\tif (needsDelimiter) { Level2Regex.lastIndex=subLastLastIndex; break; } else { needsDelimiter=true }\n\t\t\t\t\t\t\tpendingData.unshift({\"expression\":\"-\"})\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//(,) - time to write what we have and move on\n\t\t\t\t\t\telse if(L2Match[6]){\n\n\t\t\t\t\t\t\t//write any pending data we have\n\t\t\t\t\t\t\tif (pendingData.length && !isSlice){\n\t\t\t\t\t\t\t\t//pending is simply a number\n\t\t\t\t\t\t\t\tsubArray.unshift(pendingData[0])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//tidy up slice array if we are moving on\n\t\t\t\t\t\t\telse if (pendingData.length){\n\t\t\t\t\t\t\t\tif(isSlice && intraSlice){ pendingData.unshift(null) }\n\t\t\t\t\t\t\t\t//slice expression (numbers and/or filter expression)\n\t\t\t\t\t\t\t\tsubArray.unshift({\"expression\":pendingData})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//reset\n\t\t\t\t\t\t\tpendingData=[], needsDelimiter=false\n\t\t\t\t\t\t\tif (isSlice) { intraSlice=false; isSlice=false }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//(:) - colon (:)\n\t\t\t\t\t\telse if(L2Match[7]){\n\t\t\t\t\t\t\tisSlice=true\n\n\t\t\t\t\t\t\t// if we have something pending already, examine it\n\t\t\t\t\t\t\t// break if we have a ?() expression or a string or some other garbage...\n\t\t\t\t\t\t\tif (pendingData.length === 1 && pendingData[0] !== null && (pendingData[0].constructor === String || !(pendingData[0].constructor === Number || pendingData[0].expression[0] === \"(\" ))){\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//if nothing pending or we had previous colon, insert a colon to represent an empty slice slot ::\n\t\t\t\t\t\t\tif(!pendingData.length || intraSlice) { pendingData.unshift(null) } \n\n\t\t\t\t\t\t\t//change state\n\t\t\t\t\t\t\tif (!intraSlice) { intraSlice=true }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//(\\)) - closing parens, the beginning of our reverse regex\n\t\t\t\t\t\telse if(L2Match[8]){\n\t\t\t\t\t\t\tvar openParens=0, closeParens=1, L3Match=[]\n\n\t\t\t\t\t\t\t//we will collect the entire ?()/() statement and then push in subArray\n\t\t\t\t\t\t\tvar filterText=L2Match[8]\n\n\t\t\t\t\t\t\t//L3 regex: quoted strings, open parens, closed parens, ruby style regex (L), ruby style regex (R), equals sign, and arbitrary characters\n\t\t\t\t\t\t\tvar Level3Regex=/([\"'])(.*?)\\1(?!\\\\)|(\\()|(\\))|(\\/.*?\\/(?!\\\\)\\s*~=)|(~=\\s*\\/.*?\\/(?!\\\\))|(==?((?:=|!)))|(.)/g\n\n\t\t\t\t\t\t\tif (isSlice) { intraSlice = false }\n\t\t\t\t\t\t\telse if (needsDelimiter) { break }\n\n\t\t\t\t\t\t\t//set our start point to be the same as where we are\n\t\t\t\t\t\t\tLevel3Regex.lastIndex = Level2Regex.lastIndex\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t//keep working on revExpr\n\t\t\t\t\t\t\t\tL3Match = Level3Regex.exec(revExpr)\n\n\t\t\t\t\t\t\t\t//([\"'])(.*?)\\1(?!\\\\) - quoted string\n\t\t\t\t\t\t\t\t//escape @ for substitution in P.eval\n\t\t\t\t\t\t\t\tif(L3Match[1]) { \n\t\t\t\t\t\t\t\t\tfilterText+=L3Match[0].replace(/@/g, \"@\\\\\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//(\\() - open parens\n\t\t\t\t\t\t\t\telse if(L3Match[3]) {\n\t\t\t\t\t\t\t\t\tfilterText+=L3Match[3]\n\t\t\t\t\t\t\t\t\topenParens += 1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//(\\)) - close parens\n\t\t\t\t\t\t\t\telse if(L3Match[4]) {\n\t\t\t\t\t\t\t\t\tfilterText+=L3Match[4]\n\t\t\t\t\t\t\t\t\tcloseParens += 1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//(\\/.*?\\/(?!\\\\)\\s*~=) - characters inside =~ /.../\n\t\t\t\t\t\t\t\t//(~=\\s*\\/.*?\\/(?!\\\\)) - characters inside /.../ =~\n\t\t\t\t\t\t\t\telse if(L3Match[5]||L3Match[6]) { \n\t\t\t\t\t\t\t\t\t//escape @ for escaping substitution in P.eval\n\t\t\t\t\t\t\t\t\tfilterText+=L3Match[0].replace(/@/g, \"@\\\\\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//(==?((?:=|!))) - normalizes == and != to their strict equality equivalents\n\t\t\t\t\t\t\t\telse if(L3Match[7]) { \n\t\t\t\t\t\t\t\t\t//rewrite to === or !== (reversed)\n\t\t\t\t\t\t\t\t\tfilterText+=\"==\" + L3Match[8]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//(.) - any other character\n\t\t\t\t\t\t\t\telse if(L3Match[9]) { \n\t\t\t\t\t\t\t\t\t//if this is a = assignment (not != <= >=) break, =~ regex is matched earlier\n\t\t\t\t\t\t\t\t\tif(L3Match[9] === \"=\" && !/[<>!]/.test(revExpr[Level3Regex.lastIndex])) { \n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfilterText+=L3Match[9]\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (closeParens === openParens){\n\t\t\t\t\t\t\t\t\tneedsDelimiter=true\n\n\t\t\t\t\t\t\t\t\t//before we break check if the next char is a question mark and if so include that\n\t\t\t\t\t\t\t\t\tif(revExpr[Level3Regex.lastIndex] === '?'){\n\t\t\t\t\t\t\t\t\t\tif(isSlice){\n\t\t\t\t\t\t\t\t\t\t\tLevel3Regex.lastIndex=0\n\t\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tfilterText+=\"?\"\n\t\t\t\t\t\t\t\t\t\tLevel3Regex.lastIndex = Level3Regex.lastIndex+1\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t//set our Level2Regex index to where we were in this\n\t\t\t\t\t\t\t\t\tLevel2Regex.lastIndex = Level3Regex.lastIndex\n\t\t\t\t\t\t\t\t\t//reverse back to normal and store this in the array of items\n\t\t\t\t\t\t\t\t\tvar filterTextFinal = filterText.split('').reverse().join('')\n\t\t\t\t\t\t\t\t\tpendingData.unshift({\"expression\":filterTextFinal})\n\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} while (Level3Regex.lastIndex !== 0 && Level3Regex.lastIndex !== revExpr.length)\n\n\t\t\t\t\t\t\tif (closeParens !== openParens) { break }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// (\\[) - open bracket, the end of L2 for now\n\t\t\t\t\t\telse if(L2Match[9]){\n\n\t\t\t\t\t\t\t//empty brackets\n\t\t\t\t\t\t\tif(Level2Regex.lastIndex - Level1Regex.lastIndex === 1) {\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tLevel1Regex.lastIndex = Level2Regex.lastIndex\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\\s* - spaces just advance on...\n\n\t\t\t\t\t\t//catch if we skip ahead or are stuck next match\n\t\t\t\t\t\tsubLastLastIndex=Level2Regex.lastIndex\n\t\t\t\t\t} while(Level2Regex.lastIndex !== 0 && Level2Regex.lastIndex !== revExpr.length )\n\n\t\t\t\t\t//if there is a pending number, write it\n\t\t\t\t\tif(pendingData.length === 1 && !isSlice) { subArray.unshift(pendingData[0]) }\n\t\t\t\t\telse if (pendingData.length){\n\t\t\t\t\t\t//for leading : insert a null\n\t\t\t\t\t\tif(isSlice && intraSlice){ pendingData.unshift(null) }\n\t\t\t\t\t\t//for cases with only one : make the last entry null\n\t\t\t\t\t\tif(pendingData[2] === undefined){ pendingData[2] = null }\n\t\t\t\t\t\tsubArray.unshift({\"expression\":pendingData})\n\t\t\t\t\t}\n\n\t\t\t\t\t//put the whole array in the pathStack array, trace will handle unbundling\n\t\t\t\t\tif(subArray.length > 1){ pathStack.unshift(subArray) }\n\t\t\t\t\t//save trace some work with just a single non-array entry\n\t\t\t\t\telse { pathStack.unshift(subArray[0]) }\n\t\t\t\t}\n\t\t\t\t// (\\$) - only valid at the beginning\n\t\t\t\telse if(L1Match[6]){\n\t\t\t\t\t//if it's at the end (beginning) it is the root designator\n\t\t\t\t\tif(Level1Regex.lastIndex === revExpr.length){ var hasRoot=true }\n\t\t\t\t\telse { break }\n\t\t\t\t}\n\t\t\t\t//to catch later if we skip ahead from a bad match or not...\n\t\t\t\tlastLastIndex=Level1Regex.lastIndex\n\t\t\t} while(Level1Regex.lastIndex !== 0 && Level1Regex.lastIndex !== revExpr.length )\n\n\t\t\tif (!hasRoot || baldRecursion || Level1Regex.lastIndex !== revExpr.length) { throw new SyntaxError(\"Malformed path expression: \" + expr) }\n\n\t\t\treturn pathStack\n\t\t},\n\t\tasPath: function(path) {\n\t\t\tif(P.resultType === \"PATH_OBJECT\"){ return {\"path\":path} }\n\n\t\t\tvar qt = P.singleQuoteKeys ? \"'\" : '\"';\n\t\t\tvar p=(P.resultType === \"PATH_JSONPOINTER\" ? \"\" : \"$\");\n\t\t\tvar x = path.slice()\n\n\t\t\t//create p, the path string representation\n\t\t\tfor (var i=0,n=x.length; i<n; i++){\n\n\t\t\t\tif(P.resultType === \"PATH_JSONPOINTER\") {\n\t\t\t\t\tp += \"/\" + (x[i].constructor === Number ? x[i] : x[i].replace(/~/g,\"~0\").replace(/\\//g,\"~1\"))\n\t\t\t\t}\n\t\t\t\t//else JSONPath string\n\t\t\t\telse {\n\t\t\t\t\tvar pathString = x[i].constructor === Number ? \"[\"+x[i]+\"]\" : (P.resultType === \"PATH_DOTTED\" && /^[A-Za-z_$][\\w\\d$]*$/.test(x[i]) ? \".\" + x[i] : (\"[\"+ qt + (P.singleQuoteKeys ? x[i].replace(/'/g,\"\\\\'\") : x[i].replace(/\"/g,'\\\\\"')) + qt + \"]\").replace(/\\n/g,'\\\\n').replace(/[\\b]/g,'\\\\b').replace(/\\f/g,'\\\\f').replace(/\\r/g,'\\\\r').replace(/\\t/g,'\\\\t').replace(/[\\u0000-\\u001f\\u007f]/g, function(chr) {return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).slice(-4)}));\n\n\t\t\t\t\t//escape Unicode characters \\u style\n\t\t\t\t\tif (P.escapeUnicode){\n\t\t\t\t\t\tpathString = pathString.replace(/[\\u007F-\\uFFFF]/g, function(chr) { return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).slice(-4) })\n\t\t\t\t\t}\n\t\t\t\t\tp += pathString\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn p;\n\t\t},\n\t\tstore: function(p, v) {\n\t\t\t//if we are escaping unicode and a string\n\t\t\tif (P.escapeUnicode && v !== null && v.constructor === String){\n\t\t\t\tv = v.replace(/[\\u007F-\\uFFFF]/g, function(chr) { return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).slice(-4) })\n\t\t\t}\n\n\t\t\tif (p) { P.result[P.result.length] = /^PATH/.test(P.resultType) ? P.asPath(p) : v }\n\t\t\treturn !!p;\n\t\t},\n\t\ttrace: function(expr, val, path) {\n\n\t\t\tif(expr === false) return expr\n\n\t\t\t//if we have an expression\n\t\t\tif (expr.length) {\n\n\t\t\t\tvar x = expr.slice()\n\t\t\t\tvar loc = x.shift();\n\n\t\t\t\tif(val !== null && Array.isArray(val) && loc.constructor === String && loc.match(/^0/) && loc !== \"0\"){\n\t\t\t\t\tthrow new Error(\"Property name '\"+ loc +\"' is a string with leading zeros and target is an array!\")\n\t\t\t\t}\n\t\t\t\telse if(val !== null && val.constructor === Object && loc.constructor === Number){\n\t\t\t\t\tthrow new Error(\"Property '\"+ loc +\"' is a number and target is an object!\")\n\t\t\t\t}\n\n\t\t\t\t//if loc is negative and val is an array or string, resolve the negative index\n\t\t\t\tif(loc.constructor === Number && Math.sign(loc) === -1 && (val instanceof Array || val.constructor === String)) { \n\t\t\t\t\tloc = (val.length+loc) \n\t\t\t\t}\n\n\t\t\t\t//an array represents a union, it can store: strings (key names), numbers (array indices or numeric property names), and objects (expressions)\n\t\t\t\t//example: [\"key\",0,{\"expression\":\"*\"},{\"expression\":\"?(@name =~ /key.*/)\"}]\n\t\t\t\tif(Array.isArray(loc)){\n\t\t\t\t\tfor (i=0; i<loc.length; i++) {\n\t\t\t\t\t\tvar tx = x.slice()\n\t\t\t\t\t\ttx.unshift(loc[i])\n\t\t\t\t\t\tP.trace(tx, val, path)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//{\"expression\":\"...\"} - an singular object containing an expression key\n\t\t\t\telse if(loc.constructor === Object) {\n\t\t\t\t\t//[0,1,null] - an array in an expression is a slice\n\t\t\t\t\tif(Array.isArray(loc.expression)){\n\t\t\t\t\t\tP.slice(loc.expression, x, val, path);\n\t\t\t\t\t}\n\t\t\t\t\t//* - star wildcard character\n\t\t\t\t\telse if (loc.expression === \"*\") {\n\t\t\t\t\t\tP.walk(loc.expression, x, val, path, function(m,l,x,v,p) { var tx = x.slice(); tx.unshift(m); P.trace(tx,v,p); });\n\t\t\t\t\t}\n\t\t\t\t\t//.. recursive descent\n\t\t\t\t\telse if (loc.expression === \"..\") {\n\t\t\t\t\t\tP.trace(x, val, path);\n\t\t\t\t\t\tP.walk(loc, x, val, path, function(m,l,x,v,p) { var tx = x.slice(); tx.unshift({\"expression\":\"..\"}); var tp = p.slice(); tp.push(m); typeof v[m] === \"object\" && P.trace(tx,v[m],tp); });\n\t\t\t\t\t}\n\t\t\t\t\t//(expr) - a script expression, the actual result is used as the key name\n\t\t\t\t\telse if (/^\\(.*?\\)$/.test(loc.expression))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tx = x.slice();\n\t\t\t\t\t\ttx.unshift(P.eval(loc.expression, val, path[path.length-1]))\n\t\t\t\t\t\tP.trace(tx, val, path);\n\t\t\t\t\t}\n\t\t\t\t\t//- - dash operator, borrowed from JSON Pointer, represents the point AFTER the last array element\n\t\t\t\t\t//this is NOT needed for search but it is how the [-] expression would be resolved for a JSON Patch operation\n\t\t\t\t\telse if (/^-$/.test(loc.expression))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(val !== null && Array.isArray(val)) {\n\t\t\t\t\t\t\tvar tx = x.slice();\n\t\t\t\t\t\t\ttx.unshift(P.eval(\"(@.length)\", val, path[path.length-1]))\n\t\t\t\t\t\t\tP.trace(tx, val, path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//?(expr) - a filter expression, this tests an expression and if true will descend into that key or return it's value\n\t\t\t\t\telse if (/^\\?\\(.*?\\)$/.test(loc.expression)){\n\t\t\t\t\t\tP.walk(loc.expression, x, val, path, function(m,l,x,v,p) {\n\t\t\t\t\t\t\tif (P.eval(l.replace(/^\\?\\((.*?)\\)$/,\"$1\"), v instanceof Array ? v[m] : v, m)) {\n\t\t\t\t\t\t\t\tvar tx = x.slice(); tx.unshift(m); P.trace(tx,v,p);\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\t//else we are either a string or a number\n\t\t\t\telse if (val && val[loc] !== undefined) {\n\t\t\t\t\tvar tpath = path.slice()\n\t\t\t\t\t//if this is an array, store loc as Number so it is NOT quoted in PATH or PATH_DOTTED output\n\t\t\t\t\ttpath.push(Array.isArray(val) ? Number(loc) : loc)\n\t\t\t\t\tP.trace(x, val[loc], tpath);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//else no expr left, just store the results along with it's path\n\t\t\telse {\n\t\t\t\tP.store(path, val);\n\t\t\t}\n\t\t},\n\t\t//walk - used by * .. and ?() to interrogate the object\n\t\twalk: function(loc, expr, val, path, f) {\n\t\t\tif (val instanceof Array) {\n\t\t\t\tfor (var i=0,n=val.length; i<n; i++) {\n\t\t\t\t\tif (i in val) {\n\t\t\t\t\t\tf(i,loc,expr,val,path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (typeof val === \"object\") {\n\t\t\t\tfor (var m in val) {\n\t\t\t\t\tif (val.hasOwnProperty(m)) {\n \t\t\t\t\t\tf(m,loc,expr,val,path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t//slice - same behavior as Python\n\t\tslice: function(loc, expr, val, path) {\n\n\t\t\t//now allows for string slicing\n\t\t\tif (val !== null && val.constructor === String) {\n\t\t\t\tval = val.split('')\n\t\t\t\tvar isString=true\n\t\t\t} else { var isString=false }\n\n\t\t\tif (val instanceof Array) {\n\t\t\t\tvar str=\"\", len, start, end, step=1;\n\n\t\t\t\t//if the loc array has any undefined holes set them to null\n\t\t\t\tloc[0]=loc[0] !== undefined ? loc[0] : null; loc[1]=loc[1] !== undefined ? loc[1] : null; loc[2]=loc[2] !== undefined ? loc[2] : null\n\n\t\t\t\tif ((loc[2] === null || loc[2].constructor === Number ? loc[2] : P.eval(loc[2].expression,val,path[path.length-1])) === 0) { \n\t\t\t\t\tthrow new RangeError(\"Slice step cannot be zero: [\" + loc.join(\":\") + \"]\") \n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\tstep=parseInt((loc[2] === null || loc[2].constructor === Number ? loc[2] : P.eval(loc[2].expression,val,path[path.length-1]))||step)\n\t\t\t\t}\n\n\t\t\t\tif(Math.sign(step) === -1){\n\t\t\t\t\tlen=val.length, start=len-1, end=(len+(loc[1] === null ? 1 : 0))*(-1)\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlen=val.length, start=0, end=len\n\t\t\t\t}\n\n\t\t\t\tstart=parseInt((loc[0] === null || loc[0].constructor === Number ? loc[0] : P.eval(loc[0].expression,val,path[path.length-1]))||((loc[0] === null || loc[0].constructor === Number ? loc[0] : P.eval(loc[0].expression,val,path[path.length-1])) === 0 ? 0 : start));\n\t\t\t\tend = (loc[1] === 0) ? 0 : parseInt((loc[1] === null || loc[1].constructor === Number ? loc[1] : P.eval(loc[1].expression,val,path[path.length-1]))||end)\n\n\t\t\t\t//adjust the bounds of the default depending on the value and the type of step in cases of negative values\n\t\t\t\tstart = (start < 0) ? Math.max(Math.sign(step) === -1 ? -1 : 0,start+len) : Math.min(len,start);\n\t\t\t\tend = (end < 0) ? Math.max(Math.sign(step) === -1 ? -1 : 0,end+len) : Math.min(len,end);\n\n\t\t\t\t//if step is negative go the other way\n\t\t\t\tif(Math.sign(step) === -1){ var op=\">\" } else { var op=\"<\" }\n\n\t\t\t\t//use eval to resolve op \n\t\t\t\tfor (var i=start; eval(i+op+end); i+=step){\n\t\t\t\t\t//strore arrays proper\n\t\t\t\t\tif(!isString){ \n\t\t\t\t\t\tvar texpr = expr.slice()\n\t\t\t\t\t\ttexpr.unshift(i)\n\t\t\t\t\t\tP.trace(texpr, val, path);\n\t\t\t\t\t}\n\t\t\t\t\t//collect characters into a string\n\t\t\t\t\telse{\n\t\t\t\t\t\tstr += val[i] \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//store combined sliced string along with this single path\n\t\t\t\tif(isString){ \n\t\t\t\t\tP.store(path, str);\n\t\t\t\t}\n \t\t}\n\t\t},\n\t\teval: function(x, _v, _vname) {\n\n\t\t\tvar tx = x.slice()\n\n\t\t\t//if this is a () expression, strip the outer parens\n\t\t\tif ((/^\\(.*?\\)$/).test(x)) { tx = tx.replace((/^\\((.*?)\\)$/),\"$1\") }\n\n\t\t\t//remove all all data between \"\" '' and //, split by semi-colon\n\t\t\t//remove all spaces before ( and collapse multiple spaces down to a single space\n\t\t\tvar forbiddenInvocations=tx.split('').reverse().join('')\n\t\t\t\t.replace(/([\"'])(.*?)\\1(?!\\\\)/g, \"\")\n\t\t\t\t.replace(/(\\/.*?\\/(?!\\\\)\\s*~=)|(=~*\\s\\/.*?\\/(?!\\\\))/g, \"\")\n\t\t\t\t.replace(/\\(\\s*/g,\"(\").replace(/([;\\.\\+\\-~\\!\\*\\/\\%\\>\\<\\&\\^\\|\\:\\?\\,])/g, \" \")\n\t\t\t\t.replace(/\\s+/g,\" \")\n\t\t\t\t//turn things back around and split on the space\n\t\t\t\t.split('').reverse().join('').split(' ')\n\t\t\t\t//anything that remains with ( that not at the beginning of a line and has character before it\n\t\t\t\t.filter(function(f){return (/\\(/).test(f)})\n\t\t\t\t.filter(function(f){return (/[!^]\\(|[\\w\\d_$]\\(/).test(f)})\n\t\t\t\t//only allow three functions tolerated\n\t\t\t\t.filter(function(f){return !((/test\\(|exec\\(|match\\(/).test(f))})\n\n\t\t\tif(forbiddenInvocations.length){ throw new Error(\"Invocation violation: \" + forbiddenInvocations) };\n\n\t\t\ttry {\n\t\t\t\tvar evalResult = eval(x.replace(/(^|[^\\\\])@/g, \"$1_v\")\n\t\t\t\t\t.replace(/\\\\@/g, \"@\")\n\t\t\t\t\t//ruby regex handling from jpaquit\n\t\t\t\t\t//_v substitution on the left side\n\t\t\t\t\t.replace(/(_v(?:(?!(\\|\\||&&)).)*)=~((?:(?!\\)* *(\\|\\||&&)).)*)/g, \n\t\t\t\t\t\tfunction(match, p1, p2, p3, offset, currentString) {\n\t\t\t\t\t\t\treturn match ? p3.trim()+'.test('+p1.trim()+')' : match\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\t//ruby regex with the _v substitution on the right side\n\t\t\t\t\t.replace(/((?:(?!\\)* *(\\|\\||&&)).)*)\\s+=~\\s+(_v(?:(?!(\\|\\||&&)).)*)/g, \n\t\t\t\t\t\tfunction(match, p1, p2, p3, offset, currentString) {\n\t\t\t\t\t\t\treturn match ? p1.trim()+'.test('+p3.trim()+')' : match\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t//return false if falsey\n\t\t\t\tif(evalResult === undefined || evalResult === null || (evalResult.constructor === Number && Math.sign(evalResult) === -1) ) { \n\t\t\t\t\treturn false \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//we use floor in case of division, to ensure result is an integer\n\t\t\t\t\treturn evalResult.constructor === Number ? Math.floor(evalResult) : evalResult\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(e) { \n\t\t\t\tthrow new SyntaxError(\"eval: \" + e.message + \": \" + x.replace(/(^|[^\\\\])@/g, \"$1_v\")\n\t\t\t\t\t.replace(/\\\\@/g, \"@\") /* issue 7 : resolved .. */\n\t\t\t\t\t/* 2020/01/09 - manage regexp syntax \"=~\" */\n\t\t\t\t\t.replace(/(_v(?:(?!(\\|\\||&&)).)*)=~((?:(?!\\)* *(\\|\\||&&)).)*)/g, \n\t\t\t\t\t\tfunction(match, p1, p2, p3, offset, currentString) { \n\t\t\t\t\t\t\treturn match ? p3.trim()+'.test('+p1.trim()+')' : match\n\t\t\t\t\t\t}\n\t\t\t\t\t) \n\t\t\t\t\t.replace(/((?:(?!\\)* *(\\|\\||&&)).)*)\\s+=~\\s+(_v(?:(?!(\\|\\||&&)).)*)/g, \n\t\t\t\t\t\tfunction(match, p1, p2, p3, offset, currentString) { \n\t\t\t\t\t\t\treturn match ? p3.trim()+'.test('+p1.trim()+')' : match\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t};\n\n\t//allows $ to be used in filter expressions\n\tvar $ = obj;\n\n\tif (expr && obj !== undefined && (P.resultType == \"VALUE\" || /^PATH/.test(P.resultType))) {\n\t\t//normalize the JSONPath expression and send to trace along with the obj data and the beginning of the -p path output [\"$\"]\n\t\tP.trace(P.normalize(expr), obj, []);\n\n\t\t//return P.result or an empty array\n\t\treturn P.result.length ? P.result : [];\n\t}\n}", "title": "" }, { "docid": "2b3e37a438a57c0fe8df11846a239478", "score": "0.6075948", "text": "function JSONquote(/**string*/ string) /**string*/ {\r\nvar cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\r\n\tescapeable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\r\n\tgap,\r\n\tindent,\r\n\tmeta = { // table of character substitutions\r\n\t\t'\\b': '\\\\b',\r\n\t\t'\\t': '\\\\t',\r\n\t\t'\\n': '\\\\n',\r\n\t\t'\\f': '\\\\f',\r\n\t\t'\\r': '\\\\r',\r\n\t\t'\"' : '\\\\\"',\r\n\t\t'\\\\': '\\\\\\\\'\r\n\t},\r\n\trep;\r\n\r\n\t// If the string contains no control characters, no quote characters, and no\r\n\t// backslash characters, then we can safely slap some quotes around it.\r\n\t// Otherwise we must also replace the offending characters with safe escape\r\n\t// sequences.\r\n\tescapeable.lastIndex = 0;\r\n\treturn escapeable.test(string) ?\r\n\t\t'\"' + string.replace(escapeable, function (a) {\r\n\t\t\tvar c = meta[a];\r\n\t\t\tif (typeof c === 'string') {\r\n\t\t\t\treturn c;\r\n\t\t\t}\r\n\t\t\treturn '\\\\u' + ('0000' +\r\n\t\t\t\t\t(+(a.charCodeAt(0))).toString(16)).slice(-4);\r\n\t\t}) + '\"' :\r\n\t\t'\"' + string + '\"';\r\n}", "title": "" }, { "docid": "e479426a6d34edf76c5993ec18af44f1", "score": "0.5926115", "text": "function escapeJsonQuotes(json) {\n return JSON.stringify(json)\n .replace(/'/g, \"&amp;apos;\")\n .replace(/\"/g, \"&amp;quot;\");\n }", "title": "" }, { "docid": "65da29465b854835bc42a4f458cad14d", "score": "0.5608354", "text": "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n}", "title": "" }, { "docid": "5f2031d325a37bea76f4d4aa99ac2b94", "score": "0.55411375", "text": "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n }", "title": "" }, { "docid": "5f2031d325a37bea76f4d4aa99ac2b94", "score": "0.55411375", "text": "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n }", "title": "" }, { "docid": "51878caaa9d0403e0af04d15aa842a59", "score": "0.5535318", "text": "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}", "title": "" }, { "docid": "51878caaa9d0403e0af04d15aa842a59", "score": "0.5535318", "text": "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}", "title": "" }, { "docid": "b87121868bd7734cf5b7534b1ba4877a", "score": "0.5532481", "text": "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n { return path; }\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}", "title": "" }, { "docid": "4fea3d4d7b50cbb784940cb389a18f60", "score": "0.5499069", "text": "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, function (_char) {\n return encodeURIComponent(_char);\n });\n}", "title": "" }, { "docid": "4fea3d4d7b50cbb784940cb389a18f60", "score": "0.5499069", "text": "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, function (_char) {\n return encodeURIComponent(_char);\n });\n}", "title": "" }, { "docid": "4fea3d4d7b50cbb784940cb389a18f60", "score": "0.5499069", "text": "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, function (_char) {\n return encodeURIComponent(_char);\n });\n}", "title": "" }, { "docid": "b2cfae6f44257e4427691b3e3a789ada", "score": "0.54336774", "text": "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, (char) => encodeURIComponent(char));\n }", "title": "" }, { "docid": "99f05e1f95bca3d7d07c2927e0776cb9", "score": "0.54265743", "text": "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "title": "" }, { "docid": "91b4d4f7cd44813ac9cfb488f69ce6d8", "score": "0.5325712", "text": "function test(){ /** JSON.stringify() must use short escape forms for backslash, backspace, line feed, carriage return, tab */\r\n\t/*\r\n\t* Spec: 15.12.3 under \"Abstract operation: quote\"\r\n\t*/\r\n\tvar passed=true;\r\n\tvar obj={ 'special_characters' : '\"\\b\\f\\n\\r\\t\\\\' };\r\n\ttry{\r\n\t\tvar str = JSON.stringify(\r\n\t\t\tobj\r\n\t\t);\r\n\t}catch(e){\r\n\t\tpassed = false;\r\n\t}\r\n\tpassed=passed && /\"special_characters\"\\s*:\\s*\"\\\\\"\\\\b\\\\f\\\\n\\\\r\\\\t\\\\\\\\\"/.test(str);\r\n\tif(!passed)test.failures=str;\r\n\treturn passed;\r\n}", "title": "" }, { "docid": "97354005a47084c43d920f178a1e26fd", "score": "0.5315052", "text": "function fix_slashes(pathname) {\n if (pathname.slice(-1) != '/') {\n return pathname + '/';\n }\n return pathname;\n}", "title": "" }, { "docid": "7b990cb0e6c4f05d3abb8b7c36c47d5b", "score": "0.53129977", "text": "function doubleBackwardSlashes(path) {\r\n\treturn path.replace(/\\\\/g, \"\\\\\\\\\");\r\n}", "title": "" }, { "docid": "e4f105667f16eb31ecc1f8b39489e177", "score": "0.52942485", "text": "function escapeForJS (s) {\n return JSON.stringify(s).\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\n replace(/\\u2028/g, '\\\\u2028').\n replace(/\\u2029/g, '\\\\u2029');\n}", "title": "" }, { "docid": "92422a0352a1b7bee909ad9184a19a4a", "score": "0.5279721", "text": "function formatJSAssignment(\n objectName: string,\n path: Array<string | number>,\n value: mixed,\n): string {\n const assignmentPath = path\n .map(p => (typeof p === 'string' ? `.${p}` : `[${p}]`))\n .join('');\n const jsValue = value === undefined ? 'undefined' : JSON.stringify(value);\n return `${objectName}${assignmentPath} = ${jsValue};`;\n}", "title": "" }, { "docid": "74d4ff8c95f3a82dc2610e91c2c5fa3e", "score": "0.5265108", "text": "escapeLiteral(str) {\n var hasBackslash = false\n var escaped = \"'\"\n\n for (var i = 0; i < str.length; i++) {\n var c = str[i]\n if (c === \"'\") {\n escaped += c + c\n } else if (c === '\\\\') {\n escaped += c + c\n hasBackslash = true\n } else {\n escaped += c\n }\n }\n\n escaped += \"'\"\n\n if (hasBackslash === true) {\n escaped = ' E' + escaped\n }\n\n return escaped\n }", "title": "" }, { "docid": "dc89db2e14dd753a1f9df11678ad6f7d", "score": "0.5236741", "text": "function parsePointer(pointer: string): string[] {\n if (pointer === '') {\n return []\n }\n if (pointer.charAt(0) !== '/') {\n throw new Error('Invalid JSON pointer: ' + pointer)\n}\n return pointer.substring(1).split(/\\//).map(unescape)\n}", "title": "" }, { "docid": "7fd7da7d728dcc8187512116e15ef02a", "score": "0.5211447", "text": "function makeJsonString(object) {\r\n return(escape(JSON.stringify(object)));\r\n}", "title": "" }, { "docid": "c86b04cf9fbe17317d9a8a5089c0140d", "score": "0.5193342", "text": "function jpunescape(s) {\n return s.replace(/\\~1/g, '/').replace(/~0/g, '~');\n}", "title": "" }, { "docid": "c86b04cf9fbe17317d9a8a5089c0140d", "score": "0.5193342", "text": "function jpunescape(s) {\n return s.replace(/\\~1/g, '/').replace(/~0/g, '~');\n}", "title": "" }, { "docid": "c86b04cf9fbe17317d9a8a5089c0140d", "score": "0.5193342", "text": "function jpunescape(s) {\n return s.replace(/\\~1/g, '/').replace(/~0/g, '~');\n}", "title": "" }, { "docid": "5a91d0eefd2e9abfc256b095971c584d", "score": "0.5181832", "text": "function reverseEscape(data) {\n data = data\n .replace(/\\\\\\\\/g, '\\\\')\n .replace(/\\\\\\\"/g, '\\\"')\n .replace(/\\\\\\//g, '\\/')\n .replace(/\\\\\\b/g, '\\b')\n .replace(/\\\\\\f/g, '\\f')\n .replace(/\\\\\\n/g, '\\n')\n .replace(/\\\\\\r/g, '\\r')\n .replace(/\\\\\\t/g, '\\t');\n return data;\n }", "title": "" }, { "docid": "38b4769c2a7ec15091c259d6e7552084", "score": "0.51720643", "text": "function convertDoubleSingleQuotetoChar(value) {\n if (typeof value != 'undefined' && value.length > 0) {\n value = JSON.stringify(value.replace(/\\\"/g, '&@%!~').replace(/\\'/g, '#%&%#'));\n } else {\n value = JSON.stringify(value);\n }\n return value;\n }", "title": "" }, { "docid": "27cb35dc2e1ff76c0d77de70fbcea18c", "score": "0.5158435", "text": "function unesc(name) {\n console.log(unescape(name.replace(/&amp;|&lt;|&gt;/g, '').replace('/', '\\\\/')));\n return unescape(name.replace(/&amp;|&lt;|&gt;/g, '').replace('/', '\\\\/'));\n\n function jq(myid) { \n return myid.replace(/(:|\\.)/g,'\\\\$1');\n } \n }", "title": "" }, { "docid": "5b6b46d2682f83ad77d44ecca5f38965", "score": "0.5154156", "text": "function encode(path) { return encodeURIComponent(path) }", "title": "" }, { "docid": "5b6b46d2682f83ad77d44ecca5f38965", "score": "0.5154156", "text": "function encode(path) { return encodeURIComponent(path) }", "title": "" }, { "docid": "5b6b46d2682f83ad77d44ecca5f38965", "score": "0.5154156", "text": "function encode(path) { return encodeURIComponent(path) }", "title": "" }, { "docid": "5b6b46d2682f83ad77d44ecca5f38965", "score": "0.5154156", "text": "function encode(path) { return encodeURIComponent(path) }", "title": "" }, { "docid": "c98e81784d8a55c0867e05ce7e00dcd9", "score": "0.5143274", "text": "function encodeUnsafeJSON(object) {\n\tvar new_object = {};\n\tfor (var key in object) {\n\t\tnew_object[key] = object[key];\t\n\t\tif (object[key] instanceof Function) {\n\t\t\tnew_object[key] = unescape(object[key].toString());\n\t\t}\n\t}\n\treturn JSON.stringify(new_object,null, \" \");\n}", "title": "" }, { "docid": "b6f683d711bc9f51abd6ce1e5bb1a4fd", "score": "0.5134435", "text": "function escape(value) {\n return encode(value, {escapeOnly: true, useNamedReferences: true})\n}", "title": "" }, { "docid": "b6f683d711bc9f51abd6ce1e5bb1a4fd", "score": "0.5134435", "text": "function escape(value) {\n return encode(value, {escapeOnly: true, useNamedReferences: true})\n}", "title": "" }, { "docid": "0f1b5b72c5b2342143dda4fdf1240e34", "score": "0.5125915", "text": "function escape(s) {\n let result = \"\";\n _.each(s, function (ch) {\n switch (ch) {\n case \":\":\n result += \"\\\\:\";\n break;\n case \"\\\\\":\n result += \"\\\\\\\\\";\n break;\n default:\n result += ch;\n }\n });\n return result;\n}", "title": "" }, { "docid": "ac71eae1fe06378a58fc17de6a95d274", "score": "0.511897", "text": "function unescape(value) {\n var prev = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(prev, index))\n prev = index + 1\n character = value.charAt(prev)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, prev + 1)\n }\n\n queue.push(value.slice(prev))\n\n return queue.join('')\n }", "title": "" }, { "docid": "5ce9014a24cc2e65815c98b13e549ea7", "score": "0.51172394", "text": "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "title": "" }, { "docid": "5ce9014a24cc2e65815c98b13e549ea7", "score": "0.51172394", "text": "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "title": "" }, { "docid": "5ce9014a24cc2e65815c98b13e549ea7", "score": "0.51172394", "text": "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "title": "" }, { "docid": "bc3efb4573332c2b5d2acf4ff83578ca", "score": "0.5105401", "text": "escapeIdentifier(str) {\n return '\"' + str.replace(/\"/g, '\"\"') + '\"'\n }", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5096721", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5096721", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5096721", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5096721", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5096721", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "88368af6247b46cf067e7db35b608d99", "score": "0.50956535", "text": "function quote(string) {\n return JSON.stringify(string);\n}", "title": "" }, { "docid": "634591755caa11cd13e0866ec48bd87a", "score": "0.5089184", "text": "function escape_r_literal_string(s) {\n return \"\\\"\" + s.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\";\n // return \"\\\"\" + s.replace(/\"/g, \"\\\\\\\"\") + \"\\\"\";\n}", "title": "" }, { "docid": "110b3e577ca3c3810630dabe9877aec2", "score": "0.5075392", "text": "function escape(object) {\n return transform(object, _.escape)\n}", "title": "" }, { "docid": "79d0fb78466567090f8c662bd0d3e232", "score": "0.50680673", "text": "function applyEscape(data) {\n data = data\n .replace(/[\\\\]/g, '\\\\\\\\')\n .replace(/[\\\"]/g, '\\\\\\\"')\n .replace(/[\\/]/g, '\\\\/')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/[\\f]/g, '\\\\f')\n .replace(/[\\n]/g, '\\\\n')\n .replace(/[\\r]/g, '\\\\r')\n .replace(/[\\t]/g, '\\\\t');\n return data;\n }", "title": "" }, { "docid": "62659d9bd75c9331d0b3b7021a422fc5", "score": "0.5065854", "text": "toJSON() {\n return { path: this.path }\n }", "title": "" }, { "docid": "3a1243cf3fa239b0b154cbfe915fe3d4", "score": "0.50641656", "text": "set path(value) {}", "title": "" }, { "docid": "9614c1d3c8eabc869452430179638a25", "score": "0.50608015", "text": "function escape (input) {\n if (typeof input !== 'string') return null\n return input.replace(/([\\*|_])/g, '\\\\$1')\n}", "title": "" }, { "docid": "959114bfffaa8a582e3d823d16aee747", "score": "0.5039257", "text": "function jsonFinalize(json)\n\t{\n\t\toptions.ROOT = options.ROOT = options.NAME\n\t\tif (options.ROOT)\n\t\t\tjson = options.ROOT + ' = ' + (json || '\"\"');\n\t\telse if (json === undefined)\n\t\t\treturn '';\n\n\t\tjson = json.replace(RegExp(QUOTE, 'g'), '\"');\n\n\t\t// must follow un-escape QUOTE to remove nested outer quotes\n\t\tjson = json.replace(WRAPPER, '');\n\n\t\tjson = json.replace(RegExp(NEWLINE, 'g'), '\\n');\t//NEWLINE --> \\n\n\t\tjson = json.replace(RegExp(EOL, 'g'), '\\\\n');\t\t// EOL --> \\\\n\n\t\tjson = json.replace(RegExp(BACKSLASH, 'g'), '\\\\');\t//BACKSLASH --> \\\n\n\t\tjson = json.replace(RegExp('\"' + UNDEFINED + '\"','g'), 'undefined');\n\t\tjson = json.replace(RegExp('\"' + REGEXP + '(.*)\"','g'), function(all,regex)\n\t\t{\n\t\t\treturn '/' + regex.replace(/\\\\\\\\/g, '\\\\')\t\t//do not need backslash\n\t\t});\t\t\t\t\t\t\t\t\t\t\t\t\t//escaped for pattern\n\n\t\tjson = json.replace(RegExp(QUOTE_EMBEDDED ,'g'), '\\\\\"');\n\n\t\tjson = json.replace(/\\\\t/g, '\\t');\t\t\t\t\t//\t\\\\t --> \\t\n\n\t\t// NAN, UNDEFINED, INFINITY_PLUS, INFINITY_NEG\n\t\tjson = json.replace(/\"@@(.*?)@@\"/g , '$1');\n\t\t//json = json.replace(RegExp('\"(@@' + NAN + '\"','g'), 'NaN');\n\n\t\t//----- un-quote Object keys when valid variable name i.e. alphaumeric\n\t\t//\tjson = EZ.json.unquoteKeys(json);\n\t\t//if (options.SCRIPT && !options.KEYS)\n\t\tif (!options.KEYS)\n\t\t{\n\t\t\t// (/([{,]\\s*)\"([\\w_]+?)\" :/gi\n\t\t\tjson = json.replace(/([{,]\\s*)\"([A-Z_$][\\w_$]*?)\":/gi,\n\t\t\tfunction(all, sep, key)\n\t\t\t{\n\t\t\t\tif ('null undefined'.indexOf(key) != -1) return all;\n\t\t\t\treturn sep + key + \":\"\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn json;\n\t}", "title": "" }, { "docid": "930a485cb73c112dfed685fd503a13b5", "score": "0.50326353", "text": "function EscapedValue(value) {\n this.escapedValue = value;\n }", "title": "" }, { "docid": "e0e512519c8257863e3f416b1f157cb8", "score": "0.5011345", "text": "function setPath(baseObject) {\n var result = ''\n Object.entries(baseObject).forEach(([item, prop]) => {\n if (prop.trim() !== '')\n result += `${result.length > 0 ? '&' : ''}${item}=${prop.trim()}`\n })\n return result\n }", "title": "" }, { "docid": "e0e512519c8257863e3f416b1f157cb8", "score": "0.5011345", "text": "function setPath(baseObject) {\n var result = ''\n Object.entries(baseObject).forEach(([item, prop]) => {\n if (prop.trim() !== '')\n result += `${result.length > 0 ? '&' : ''}${item}=${prop.trim()}`\n })\n return result\n }", "title": "" }, { "docid": "f29ecd747e276fd876b38448739c4e2d", "score": "0.4995192", "text": "encodeSpecials() {\n const value = this.value;\n const regex = /(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))/g;\n return value.replace(regex, '\\\\\\\\$0');\n }", "title": "" }, { "docid": "2c5869bd43b682faa748db97f8928a04", "score": "0.498617", "text": "function encodePath(text) {\r\n return commonEncode(text).replace(HASH_RE, '%23').replace(IM_RE, '%3F');\r\n}", "title": "" }, { "docid": "1b4049261333a5c923fd9d1320ded71c", "score": "0.49796575", "text": "function compress(json){\n return escape(JSON.stringify(json));\n }", "title": "" }, { "docid": "f654e0a2c931a07d2cacaf732614a8df", "score": "0.4967442", "text": "function encodePath(text) {\n return commonEncode(text).replace(HASH_RE, '%23').replace(IM_RE, '%3F');\n}", "title": "" }, { "docid": "f654e0a2c931a07d2cacaf732614a8df", "score": "0.4967442", "text": "function encodePath(text) {\n return commonEncode(text).replace(HASH_RE, '%23').replace(IM_RE, '%3F');\n}", "title": "" }, { "docid": "85944f622473ccd6c3a3806f64928380", "score": "0.49585348", "text": "function getJsonPath(jsonObj, pathArray) {\r\r\n\r\r\n\t\tif (jsonObj == null) {\r\r\n\t\t\treturn null;\r\r\n\r\r\n\t\t}\r\r\n\r\r\n\t\tvar curr = jsonObj;\r\r\n\t\tfor (var i in pathArray) {\r\r\n\t\t\tif (pathArray.hasOwnProperty(i)) {\r\r\n\t\t\t\tvar component = pathArray[i];\r\r\n\t\t\t\tif (curr[component] == null) {\r\r\n\r\r\n\t\t\t\t\treturn null;\r\r\n\t\t\t\t} else {\r\r\n\t\t\t\t\tcurr = curr[component];\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\treturn curr;\r\r\n\r\r\n\t}", "title": "" }, { "docid": "5cc9a884be20b87c35860723c5b14e40", "score": "0.4954188", "text": "function jsonFinalize(json)\n\t{\n\t\tif (options.ROOT)\n\t\t\tjson = options.ROOT + ' = ' + (json || '\"\"');\n\t\telse if (json === undefined)\n\t\t\treturn '';\n\n\t\tjson = json.replace(RegExp(QUOTE, 'g'), '\"');\n\n\t\t// must follow un-escape QUOTE to remove nested outer quotes\n\t\tjson = json.replace(WRAPPER, '');\n\n\t\tjson = json.replace(RegExp(NEWLINE, 'g'), '\\n');\t//NEWLINE --> \\n\n\t\tjson = json.replace(RegExp(EOL, 'g'), '\\\\n');\t\t// EOL --> \\\\n\n\t\tjson = json.replace(RegExp(BACKSLASH, 'g'), '\\\\');\t//BACKSLASH --> \\\n\n\t\tjson = json.replace(RegExp('\"' + UNDEFINED + '\"','g'), 'undefined');\n\t\tjson = json.replace(RegExp('\"' + REGEXP + '(.*)\"','g'), function(all,regex)\n\t\t{\n\t\t\treturn '/' + regex.replace(/\\\\\\\\/g, '\\\\')\t\t//do not need backslash\n\t\t});\t\t\t\t\t\t\t\t\t\t\t\t\t//escaped for pattern\n\n\t\tjson = json.replace(RegExp(QUOTE_EMBEDDED ,'g'), '\\\\\"');\n\n\t\tjson = json.replace(/\\\\t/g, '\\t');\t\t\t\t\t//\t\\\\t --> \\t\n\n\t\t// NAN, UNDEFINED, INFINITY_PLUS, INFINITY_NEG\n\t\tjson = json.replace(/\"@@(.*?)@@\"/g , '$1');\n\t\t//json = json.replace(RegExp('\"(@@' + NAN + '\"','g'), 'NaN');\n\n\t\t//----- un-quote Object keys when valid variable name i.e. alphaumeric\n\t\t//\tjson = EZ.json.unquoteKeys(json);\n\t\t//if (options.SCRIPT && !options.KEYS)\n\t\tif (!options.KEYS)\n\t\t{\n\t\t\tjson = json.replace(/([{,]\\s*)\"([\\w_]+?)\":/gi,\n\t\t\tfunction(all, sep, key)\n\t\t\t{\n\t\t\t\tif ('null undefined'.indexOf(key) != -1) return all;\n\t\t\t\treturn sep + key + \":\"\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn json;\n\t}", "title": "" }, { "docid": "cc5d52785e9bf2981796140f64436c31", "score": "0.49508667", "text": "function replaceDollarSigns(jsonString) {\n var index = jsonString.search(/\\$/);\n if (index != -1) {\n if (jsonString.substring(index, index + 5) != \"$type\") {\n return jsonString.substring(0, index) + '.' + replaceDollarSigns(jsonString.substring(index + 1));\n } else {\n return jsonString.substring(0, index + 1) + replaceDollarSigns(jsonString.substring(index + 1));\n }\n }\n return jsonString;\n }", "title": "" }, { "docid": "35acdd7a0e4c798f0e916bc4656d68fe", "score": "0.49331206", "text": "function op(obj, path) {\n\treturn tagtext(objpath.get(obj, path));\n}", "title": "" }, { "docid": "b26f3c11fee662187a2a56a7c075d452", "score": "0.49281695", "text": "function escapeForwardSlash(s) {\n var re = /\\/+/g;\n if (s != null) {\n s = s.replace(re, \"%2F\");\n }\n return s;\n}", "title": "" }, { "docid": "d5d334831f52dbf5c148675bb7d704bf", "score": "0.49261278", "text": "function escape(value) {\n if (value === null || _.isUndefined(value)) {\n value = \"\";\n } else {\n value = String(value);\n }\n if (specialChars.test(value)) {\n value = '\"' + value.replace(/\"/g, '\"\"') + '\"';\n }\n return value;\n }", "title": "" }, { "docid": "77b9733970aaed02fbc6c11adb0b1663", "score": "0.49147078", "text": "function escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n }", "title": "" }, { "docid": "ecf12c127ac1c8e083711688ce8fb25d", "score": "0.48846337", "text": "function forwardSlashes(path) {\r\n\treturn path.replace(/\\\\/g, \"/\");\r\n}", "title": "" }, { "docid": "1096954688e3e394f383ea882865fb3b", "score": "0.48841712", "text": "function sqliteEscape (str) {\n return str.replace(/[\\0\\x08\\x09\\x1a\\n\\r\"'\\\\\\%]/g, function (char) {\n switch (char) {\n case \"\\0\":\n return \"\\\\0\";\n case \"\\x08\":\n return \"\\\\b\";\n case \"\\x09\":\n return \"\\\\t\";\n case \"\\x1a\":\n return \"\\\\z\";\n case \"\\n\":\n return \"\\\\n\";\n case \"\\r\":\n return \"\\\\r\";\n case \"'\":\n return \"\\'\";\n case \"\\\"\":\n case \"\\\\\":\n case \"%\":\n return \"\\\\\"+char; // prepends a backslash to backslash and, percent.\n }\n });\n}", "title": "" }, { "docid": "049f80f18de06e7c2b5a41d34d5a6db5", "score": "0.48765722", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "86a3c6690b7ef0a6dbe23a886fdef412", "score": "0.48640588", "text": "function replacePathInField(path) {\n return `${splitAccessPath(path).map(escapePathAccess).join('\\\\.')}`;\n }", "title": "" }, { "docid": "163d268cf668689125423a13410961dd", "score": "0.48569718", "text": "function encodePath(s) {\n return encodeURIComponent(s).replace(/(%)?%2f/gi,\n function($0, $1) { return $1 ? $0 : '/'; }); // No neg. lookbehind :-(\n }", "title": "" }, { "docid": "fc31b8da30467797020e3ae57427aae1", "score": "0.48556963", "text": "function escapeStr(arg) {\n return arg\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, \"\\\\\\\"\")\n .replace(/\\$/g, \"\\\\\\$\")\n .replace(/`/g, \"\\\\\\`\")\n}", "title": "" }, { "docid": "42e0ad2e2d8baee9edab865645224dbb", "score": "0.48553324", "text": "function unboundCopyToCString(solJson, alloc, str, ptr) {\n const length = solJson.lengthBytesUTF8(str);\n const buffer = alloc(length + 1);\n solJson.stringToUTF8(str, buffer, length + 1);\n solJson.setValue(ptr, buffer, '*');\n}", "title": "" }, { "docid": "414b19ea61c67a09e623b98d74c289b9", "score": "0.48529273", "text": "function getObjectFromPath(objJson, path) {\n if (!path || path.length < 4) return objJson;\n const keys = path.substr(2, path.length-4).split('\"][\"');\n let result = objJson;\n keys.forEach(key => result = result[key]);\n return result;\n }", "title": "" }, { "docid": "a7d3bf07f75ea03bc9dc30b4384074c1", "score": "0.48527926", "text": "function getStringFromJsonPath(jsonObj, path) {\r\r\n\r\r\n\t\tvar val = this.getPath(jsonObj, path);\r\r\n\t\treturn (val == null) ? '' : val;\r\r\n\r\r\n\t}", "title": "" }, { "docid": "33c0737858458120b09b9a720b67fe0d", "score": "0.48502633", "text": "function jsonPointerToArray(pointer) {\n if (typeof pointer !== 'string') {\n throw new TypeError(\"Expected a string, got a \".concat(typeof_default()(pointer)));\n }\n\n if (pointer[0] === '/') {\n pointer = pointer.substr(1);\n }\n\n if (pointer === '') {\n return [];\n }\n\n return pointer.split('/').map(unescapeJsonPointerToken);\n}", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.48450506", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "face66258b1018307079a67bc9d80838", "score": "0.48422778", "text": "function jsUnquote(str) {\n return str.replace(/\"/, '\\\\\"');\n}", "title": "" }, { "docid": "d33fc5b9f9773f8cc7941da55e8dd42c", "score": "0.4841806", "text": "function evaluateStringLiteral(path) {\n if (path.node[unescaped] || !u.hasValue(path.node)) {\n return path.node;\n }\n var node = t.stringLiteral(path.node.value);\n node[unescaped] = true;\n return node;\n}", "title": "" }, { "docid": "fc3d4fe028e6059fe701f5469e963cff", "score": "0.48412636", "text": "function escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n }", "title": "" }, { "docid": "6e5322b0714b5c589ecd2ee42d3a930e", "score": "0.4840268", "text": "function safeSerialize(data) {\n\treturn data ? JSON.stringify(data).replace(/\\//g, '\\\\/') : 'undefined'\n}", "title": "" }, { "docid": "8def76cd3911789ff1e2f84ae6c251d4", "score": "0.4834223", "text": "function getValueByJsonPath(obj,pathStr,defValue,doClone) {\n try {\n \tvar currObj = obj;\n var pathArr = pathStr.split(';');\n var doClone = ifNull(doClone,true);\n var arrLength = pathArr.length;\n for(var i=0;i<arrLength;i++) {\n if(currObj[pathArr[i]] != null) {\n currObj = currObj[pathArr[i]];\n } else\n return defValue;\n }\n if(currObj instanceof Array) {\n if(doClone == false) {\n return currObj;\n } else {\n return $.extend(true,[],currObj);\n }\n } else if(typeof(currObj) == \"object\") {\n if(doClone == false) { \n return currObj;\n } else {\n return $.extend(true,{},currObj);\n }\n } else\n return currObj;\n } catch(e) {\n return defValue;\n }\n}", "title": "" }, { "docid": "8324b8cec5986c181df045fbcd0d2437", "score": "0.4832757", "text": "function getObjPath(jsObj, path) {\n if (!(jsObj instanceof Object) || typeof (path) === \"undefined\") {\n throw \"Not valid argument:jsonData:\" + jsObj + \", path:\" + path;\n }\n path = path.replace(/\\[(\\w+)\\]/g, '.$1'); // convert indexes to properties\n path = path.replace(/^\\./, ''); // strip a leading dot\n var ArrayOfPath = path.split('.');\n for (var i = 0, length = ArrayOfPath.length; i < length; ++i) {\n var key = ArrayOfPath[i];\n if (key in jsObj) {\n \n if (jsObj[key] !== null) {\n jsObj = jsObj[key];\n \n }else {\n return null;\n }\n } else {\n return null;\n }\n }\n return jsObj;\n}", "title": "" }, { "docid": "64f6b71455a449c4192b2f1882204b1c", "score": "0.48300242", "text": "function handlePathSlashes(path) {\n var cutIndex = 0;\n for (var i = 0; i < path.length - 1; i++) {\n if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {\n cutIndex = i + 1;\n } else break;\n }\n\n return path.substr(cutIndex);\n }", "title": "" } ]
7612464f7cf2ed7ca47f56802191506d
WHEN I open the planner THEN the current day is displayed at the top of the calendar handle displaying the time
[ { "docid": "2d839c76cf0a1553cd27281db12c198b", "score": "0.6039734", "text": "function displayTime() {\n var rightNow = moment();\n timeDisplayEl.text(rightNow.format('MMM DD, YYYY'));\n}", "title": "" } ]
[ { "docid": "3e3507515aea8e8c6cc0c2577ddd061c", "score": "0.67426026", "text": "function plantOfTheDay(){\n\tfindDate();\n\tshowDate();\n}", "title": "" }, { "docid": "a2dff6c4edbf2145191472141d3943d9", "score": "0.6718862", "text": "function displayTime() {\n\tvar rightNow = moment().format('dddd') + \", \" + moment().format('MMM Do YYYY');\n\tcurrentDayEl.text(rightNow);\n\n}", "title": "" }, { "docid": "bb68402ea7365df8a28b6f8fbb82a2cb", "score": "0.66695756", "text": "function currentTime() {\n var currentDate = moment();\n \n $(\"#currentDay\").html(currentDate.format(\"dddd, MMMM DD\"));\n \n var currentHour = currentDate.hours();\n \n $(\".description\").addClass(\"future\");\n \n if(currentHour > 17){\n $(\".description\").removeClass(\"future\");\n $(\".description\").addClass(\"past\");\n } else {\n for(var i = currentHour - 1; i >= 9; i--){\n $(\".description\").eq(i - 9).removeClass(\"future\");\n $(\".description\").eq(i - 9).addClass(\"past\");\n }\n $(\".description\").eq(currentHour - 9).removeClass(\"future\");\n $(\".description\").eq(currentHour - 9).addClass(\"present\");\n }\n loadTasks();\n }", "title": "" }, { "docid": "ea6a22704fe0dbc7ecb89d7ed9902dc4", "score": "0.6622133", "text": "function updateTime() {\n if (moment().minute() === 0 && moment().second() === 0) {\n var currentHour = moment().hour();\n // only need to update timeblock classes (past, present, future)\n // from 9am to 5pm but needs to check at 6pm, so the 5pm\n // block will be changed to past\n if (currentHour >= 9 && currentHour <= 18) {\n displaySchedule();\n }\n // clear the schedule at midnight for the new day \n // and update date at the top of the page\n if (currentHour === 0) {\n $(\"#currentDay\").text(moment().format(\"dddd, MMMM Do\"));\n clearSchedule();\n }\n }\n }", "title": "" }, { "docid": "e9d01c327d778ecfdc0a3105a12b0dee", "score": "0.6607579", "text": "function displayTime() {\r\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\r\n\r\n currentDayEl.text(rightNow);\r\n // console.log(hourNow);\r\n}", "title": "" }, { "docid": "8ed963ed8ac3c9add1ec6339085facc7", "score": "0.65901875", "text": "function displayTime() {\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');;\n currentDay.text(rightNow);\n}", "title": "" }, { "docid": "412c38390e4a87203086650772fc3e0e", "score": "0.6578522", "text": "function displayTime() {\n var rightNow = moment().format(\"dddd, MMM DD, YYYY\");\n timeDisplayEl.text(rightNow);\n }", "title": "" }, { "docid": "3d49184da50a5ca83221ee0961ef8e5d", "score": "0.65259993", "text": "function displayDate() {\n $(\"#currentDay\").html(moment().format(\"LLLL\"));\n }", "title": "" }, { "docid": "75442a67dc82e65c33a1149222ff52bc", "score": "0.65239006", "text": "function clock() {\n $(\"#currentDay\").html(moment().format('dddd, MMMM Do YYYY, h:mm:ss a'));\n }", "title": "" }, { "docid": "205929e9fb2cf7fb2cd19e2eb4fa06be", "score": "0.648968", "text": "initializeViewStartEndMenus() {\n const { cal } = ChromeUtils.import(\"resource:///modules/calendar/calUtils.jsm\");\n\n let formatter = cal.dtz.formatter;\n let calTime = cal.createDateTime();\n calTime.minute = 0;\n\n // 1 to 23 instead of 0 to 24 to keep midnight & noon as the localized strings\n for (let theHour = 1; theHour <= 23; theHour++) {\n calTime.hour = theHour;\n let time = formatter.formatTime(calTime);\n\n let labelIdStart = \"timeStart\" + theHour;\n let labelIdEnd = \"timeEnd\" + theHour;\n // This if block to keep Noon as the localized string, instead of as a number.\n if (theHour != 12) {\n document.getElementById(labelIdStart).setAttribute(\"label\", time);\n document.getElementById(labelIdEnd).setAttribute(\"label\", time);\n }\n }\n }", "title": "" }, { "docid": "b1e1f8a144cdecdc30f72bd615a78611", "score": "0.6452979", "text": "function displayDate() {\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm a');\n timeDisplay.text(rightNow);\n }", "title": "" }, { "docid": "8723efc1ec09ebd3c634524b89732f48", "score": "0.6431604", "text": "function currentDay(){\n dayDisplay.text(date)\n}", "title": "" }, { "docid": "6c2c828c6e61043be4ebfba9c1af2b10", "score": "0.6392349", "text": "function displayTime() {\n var currentDate = moment().format('dddd DD MMM, YYYY');\n var currentTime = moment().format('hh:mm:ss a');\n dateDisplayEl.text(currentDate);\n timeDisplayEl.text(currentTime);\n }", "title": "" }, { "docid": "8ea58fe0f5aa69cc8f7b50a4cd43d12f", "score": "0.6390597", "text": "function showCalendar()\n{\n showPage('calendarpage',false);\n hideMenu(false);\n showAllAssignments();\n}", "title": "" }, { "docid": "3b34adff09d8346c9ef8590979399a93", "score": "0.6385148", "text": "function refreshPlanner() {\n $(\"#currentDay\").text(moment().format(\"dddd, MMMM Do\"));\n dayPlanner = JSON.parse(localStorage.getItem(\"planner\"));\n if (!dayPlanner) {\n dayPlanner = {\n 9: \"\",\n 10: \"\",\n 11: \"\",\n 12: \"\",\n 13: \"\",\n 14: \"\",\n 15: \"\",\n 16: \"\",\n 17: \"\",\n };\n };\n let timeBlocks = Object.keys(dayPlanner);\n timeBlocks.forEach(element => {\n $(`#${element}text`).html(dayPlanner[element]);\n });\n}", "title": "" }, { "docid": "cfa4f13fa928afa51cf686d0cf1f7d12", "score": "0.6383542", "text": "function showTodayHours() {\r\n var btn = '<button title=\"Expand to view all days\" type=\"button\" class=\"btn btn-link contact-hours-expand py-0 text-dark\"><span class=\"fas fa-caret-down\"></span><span class=\"sr-only\">Expand</span></button>';\r\n daysInWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\r\n $('.contact-hours dt').hide()\r\n $('.contact-hours dd').hide();\r\n $('.contact-hours').attr('aria-expanded', 'false'); \r\n var d = new Date();\r\n var n = d.getDay()\r\n var today = 'contact-hours-' + daysInWeek[n];\r\n $('dd.' + today).append(btn);\r\n $('.' + today).show();\r\n }", "title": "" }, { "docid": "e77ebc33ee9c7e669ef2d0a86a2aa914", "score": "0.6369797", "text": "function dayClicked(date, overnight, jsEvent, view) {\n {% comment %}\n\tif(date.getHours() < 8) {\n\t\tdate.setHours(08);\n\t\tdate.setMinutes(00);\n\t}\n {% endcomment %}\n\n if (view.name == \"agendaDay\" || view.name == \"agendaWeek\") {\n {% if perms.calendar.edit_calendar %}\n {# $('input#id_user').val(username); #}\n if(overnight) {\n if(date >= (new Date().getTime() - (24*60*60*1000))) {\n \t// schedule an overnight event\n $('div#newRequest').dialog({\n autoOpen : false,\n width : 'auto',\n background : 'blue'\n });\n\n // we need to close the request box if one is already open\n $('div#newRequest').dialog('close');\n $('div#newRequest').dialog('open');\n \n date.setHours(22);\n date.setMinutes(00);\n $('#id_start_time').datetimepicker('setDate', date);\n\n\t\t\t\tvar startMonth = date.getMonth() + 1;\n\t\t\t\tvar startDay = date.getDate();\n\t\t\t\tvar startYear = date.getFullYear();\n\n originalStart = \"\";\n if(startMonth < 10) {\n originalStart += \"0\";\n }\n originalStart += startMonth + \"/\";\n if(startDay < 10) {\n originalStart += \"0\";\n }\n originalStart += startDay + \"/\" + startYear + \" 10:00 pm\";\n \n date.setDate(date.getDate() + 1);\n date.setHours(8);\n $('#id_end_time').datetimepicker('setDate', date);\n\n var endMonth = date.getMonth() + 1;\n var endDay = date.getDate();\n var endYear = date.getFullYear();\n\n originalEnd = \"\";\n if(endMonth < 10) {\n originalEnd += \"0\";\n }\n originalEnd+= endMonth + \"/\";\n if(endDay < 10) {\n originalEnd += \"0\";\n }\n originalEnd += endDay + \"/\" + endYear + \" 08:00 am\";\n \n // disable start/end editing capabilities\n $('input#id_overnight').prop('checked', true);\n $('input#id_overnight').prop('disabled', true);\n $('input#id_start_time').prop('disabled', true);\n $('input#id_end_time').prop('disabled', true);\n }\n } else { // this is not an overnight event \n // this disables user from being able to request things in the past.\n if (date >= new Date()) {\n $('div#newRequest').dialog({\n autoOpen : false,\n width : 'auto'\n });\n \n // we need to close the request box if one is already open\n $('div#newRequest').dialog('close');\n $('div#newRequest').dialog('open');\n //switch the dates to the current clicked time/date. works like a charm\n $('#id_start_0').datetimepicker('setDate', date);\n if(date.getHours() >= 8 && date.getHours() < 21) {\n date.setMinutes(date.getMinutes() + 30);\n } else {\n if(date.getMinutes() < 30) {\n date.setMinutes(date.getMinutes() + 30);\n } else {\n date.setHours(22);\n date.setMinutes(00);\n }\n }\n $('#id_end_0').datetimepicker('setDate', date);\n $('#id_end_0').focus();\n }\n }\n {% endif %}\n } else {\n $('#calendar').fullCalendar('changeView', 'agendaDay');\n $('#calendar').fullCalendar('gotoDate', date);\n }\n}", "title": "" }, { "docid": "2814b79ff93ec7953b01aa764cea5f09", "score": "0.636073", "text": "function clockUpdater(){\n currentDayAndTime = moment();\n timeEl.text(currentDayAndTime.format('MMMM Do, YYYY'));\n coordinateTimeBlocks();\n}", "title": "" }, { "docid": "3e95e99bc6556317e142e635404067d0", "score": "0.6354587", "text": "function printTime() {\n $(\"#currentDay\").text(todaysDate);\n }", "title": "" }, { "docid": "fc461c387f0a5979417bba91d1aed676", "score": "0.6342236", "text": "function showCalender(para) {\r\n let calender = document.querySelector(`.${para} > .calender`);\r\n let calender_timing = document.querySelector(`.${para} > .calender_timing`);\r\n if (!calender_timing.classList.contains(\"hide\")) {\r\n calender_timing.classList.add(\"hide\");\r\n }\r\n calender.classList.toggle(\"hide\");\r\n missionCalender(para);\r\n}", "title": "" }, { "docid": "09e71a90fc106a723b0b4d1f242bdf3c", "score": "0.6324299", "text": "function displayDay () {\n currentDay.text(moment().format(\"dddd, MMM Do\"));\n}", "title": "" }, { "docid": "19e0f354258d8dbe61cd7fdcadf6868f", "score": "0.63241655", "text": "function TimeDate() {\r\n let currentdate = new Date();\r\n document.getElementById(\"clock\").style.display = \"block\";\r\n document.getElementById(\"alarmList\").style.display = \"none\";\r\n document.getElementById(\"AlarmPLaying\").style.display = \"none\";\r\n document.getElementById(\"AddEdit\").style.display = \"none\";\r\n let hours = currentdate.getHours();\r\n let minutes = currentdate.getMinutes();\r\n let seconds = currentdate.getSeconds();\r\n if (hours < 10) { hours = \"0\" + hours }\r\n if (minutes < 10) { minutes = \"0\" + minutes }\r\n if (seconds < 10) { seconds = \"0\" + seconds }\r\n document.getElementById(\"Time\").innerHTML = hours + \":\" + minutes + \":\" + seconds + \"<small>\" + weekday[currentdate.getDay()] + \" \" + currentdate.getDate() + \" \" + month[currentdate.getMonth()] + \", \" + currentdate.getFullYear() + \"</small>\";\r\n document.getElementById(\"alarm\").addEventListener(\"click\", clockList);\r\n}", "title": "" }, { "docid": "bd687f5317c6dd2a300b03e92c4eb362", "score": "0.63151956", "text": "function getCurrentDay(){\n var currentTime = moment().format('MMMM Do YYYY, h:mm a');\n currentDay.text(currentTime);\n}", "title": "" }, { "docid": "a8bab4e47b2480a9b191578f93373681", "score": "0.6307722", "text": "displayStart(e) {\n var startTime = this.timeString(\n e.event.startDate._time.hour,\n e.event.startDate._time.minute\n );\n var endTime = this.timeString(\n e.event.endDate._time.hour,\n e.event.endDate._time.minute\n );\n /*if(startTime == \"12am\" && endTime == \"12\"){\n return \"\";\n }*/\n return \"Start Time: \" + startTime;\n }", "title": "" }, { "docid": "e3417c9552615cb3f6626aef12ca64be", "score": "0.6306229", "text": "function updateClock() {\n $(\"#currentDay\").text(moment().format('MMMM Do YYYY, h:mm a'));\n }", "title": "" }, { "docid": "eb5952f59eb2237576ac15ff35a2914f", "score": "0.630018", "text": "function setCurrentTime() {\n $(\"#currentDay\").html(currentDateEl);\n}", "title": "" }, { "docid": "0c4c38edf3fc2b5870220161a8004e66", "score": "0.62944806", "text": "ifMarketHours() {\r\n\r\n //If opened\r\n if (this.presentTime > \"09:30:00\" && this.presentTime < \"16:00:00\") {\r\n console.log(\"Markethours opened\")\r\n\r\n this.MarketHours = 'opened';\r\n\r\n if (this.MarketHours == \"opened\" && Date.today().is().monday()) {\r\n\r\n this.day_2 = Date.today().add(-4).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-5).days().toString(\"yyyy-MM-dd\");\r\n }\r\n\r\n console.log(\"Market Is Opened, current time is \" + this.currentTime);\r\n\r\n //If closed\r\n } else {\r\n console.log(\"Markethours closed\")\r\n this.MarketHours = 'closed';\r\n\r\n if (this.MarketHours == \"closed\" && Date.today().is().monday()) {\r\n\r\n this.today = Date.today().add(-3).days().toString(\"yyyy-MM-dd\");\r\n this.day_2 = Date.today().add(-4).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-5).days().toString(\"yyyy-MM-dd\");\r\n\r\n } else if (this.MarketHours == \"closed\" && Date.today().is().tuesday()) {\r\n\r\n this.day_2 = Date.today().add(-1).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-4).days().toString(\"yyyy-MM-dd\");\r\n\r\n } else if (this.MarketHours == \"closed\" && Date.today().is().wednesday()) {\r\n\r\n this.day_2 = Date.today().add(-1).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-2).days().toString(\"yyyy-MM-dd\");\r\n\r\n } else if (this.MarketHours == \"closed\" && Date.today().is().thursday()) {\r\n\r\n this.day_2 = Date.today().add(-1).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-2).days().toString(\"yyyy-MM-dd\");\r\n\r\n } else if (this.MarketHours == \"closed\" && Date.today().is().friday()) {\r\n\r\n this.day_2 = Date.today().add(-1).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-2).days().toString(\"yyyy-MM-dd\");\r\n\r\n }\r\n //if time is past midnight but before opening bell\r\n console.log(\"time function has been removed for now\")\r\n //TESTING PURPOSES!!!======================================\r\n /* if (this.timeCheck > \"00:00:00\" && this.timeCheck < \"09:30:00\") {\r\n this.today = Date.today().add(-1).days().toString(\"yyyy-MM-dd\");\r\n this.day_2 = Date.today().add(-2).days().toString(\"yyyy-MM-dd\");\r\n this.day_3 = Date.today().add(-5).days().toString(\"yyyy-MM-dd\");\r\n \r\n }*/\r\n\r\n this.presentTime = new Date.now().toString(this.today + \" 16:00:00\");\r\n\r\n console.log(\"Market is closed, will revert to 4:00 pm yesterday for testing purposes\");\r\n console.log(this.presentTime)\r\n console.log(\"Today \" + this.today, \"Day 2 \" + this.day_2, \"Day 3 \" + this.day_3)\r\n }\r\n\r\n progress(\"40%\", \"40% COMPLETE\")\r\n console.log(this.presentTime);\r\n\r\n }", "title": "" }, { "docid": "e478358796d1fba5a638deefda6c58e3", "score": "0.62929374", "text": "function displayTime()\n\t{\n\t\tvar currentTime= new Date();\n\t\tvar d=weekday[currentTime.getDay()];\n\t\tday.innerText=d;\n\t\t\n\t\tvar dt=currentTime.getDate();\n\t\tvar mon=month[currentTime.getMonth()];\n\t\tvar year=currentTime.getFullYear();\n\t\tconsole.log(year);\n\t\tdate.innerText=mon+\" \"+dt+\" \"+year;\n\t\t\n\t\tvar hours = currentTime.getHours();\n\t\tvar minutes = currentTime.getMinutes();\n\t\tvar seconds = currentTime.getSeconds();\n\t\tvar meridiem=\"AM\";\n\t\tif(hours>12)\n\t\t{\n\t\t\thours-=12;\n\t\t\tmeridiem=\"PM\";\n\t\t}\n\t\tif(hours===12)\n\t\t{\n\t\t\thours=12;\n\t\t}\n\t\tif(seconds<10)\n\t\t{\n\t\t\tseconds=\"0\"+seconds;\n\t\t}\n\t\t//var clockDiv=document.getElementById(\"clock\");\n\t\tday.innerHTML=d;\n\t\tclockDiv.innerText=hours+\" : \"+minutes+\" : \"+seconds+\" \"+meridiem;\n\t}", "title": "" }, { "docid": "614bdee731876ed240c5dabc784e3082", "score": "0.628534", "text": "function showDay(){\r\n let day = days[currentTime.getDay()];\r\n let today = document.querySelector(\"#current-day\")\r\n today.innerHTML = `${day}`;\r\n}", "title": "" }, { "docid": "525c01002755c0e2ccf13083ebf8742e", "score": "0.6284593", "text": "function oclock() {\n\n var oclock = moment().format('LTS');\n $(\"#oclock\").html(oclock);\n }", "title": "" }, { "docid": "389547757bb2b71b0197b18b42315feb", "score": "0.6284129", "text": "function timeUpdate() {\n $(\"#currentDay\").text(moment().format(\"dddd, MMMM Do h:mm:ss a\"));\n }", "title": "" }, { "docid": "cd664fa03c940999c94b6e30d00ffad8", "score": "0.62808603", "text": "function timeOffClick() {\n\n // update what sections of page are visible\n switchVisibleSections('timeoff')\n\n\n // render the table to display recent time-off requests\n // renderRecentRequests();\n\n // set focus on the start date control\n document.getElementById('vacation-start-date-input').focus();\n}", "title": "" }, { "docid": "3c3df60c9e54711130266dc783a47e73", "score": "0.62665886", "text": "dayAtAGlance() {\n\n // Add a section to the day-at-a-glance body for this module if there isn't one already.\n if (!$$(\"dayAtAGlanceScreen_Appointments\")) {\n $$(\"dayAtAGlanceBody\").addView({\n view : \"fieldset\", label : \"Appointments\",\n body : { id : \"dayAtAGlanceScreen_Appointments\", rows : [ ] }\n });\n $$(\"dayAtAGlanceBody\").addView({ height : 20 });\n }\n\n // Populate the day-at-a-glance screen.\n const template = webix.template(\"#subject# - #when# #location#\");\n let dataItems = wxPIM.getModuleData(\"Appointments\");\n dataItems = wxPIM.objectAsArray(dataItems);\n wxPIM.sortArray(dataItems, \"when\", \"A\");\n const currentDate = new Date().setHours(0, 0, 0, 0);\n const rows = [ ];\n for (let i = 0; i < dataItems.length; i++) {\n const item = dataItems[i];\n const itemDate = new Date(item.when).setHours(0, 0, 0, 0);\n if (itemDate == currentDate) {\n if (item.location) {\n item.location = \"(\" + item.location + \")\";\n } else {\n item.location = \"\";\n }\n item[\"when\"] = webix.i18n.timeFormatStr(new Date(item.when));\n rows.push({ borderless : true, template : template(item), height : 30 });\n }\n }\n webix.ui(rows, $$(\"dayAtAGlanceScreen_Appointments\"));\n\n }", "title": "" }, { "docid": "95a2a24203849028838868d4f5949fe7", "score": "0.6242167", "text": "function display_ct() {\n\tvar strcount\n\tvar x = new Date()\n\tvar seconds = x.getSeconds();\n\tvar minutes = x.getMinutes();\n\tvar hours = x.getHours();\n\tvar pm = false;\n\tvar utc_adjust = -5;\n\tvar utc_zone = -5;\n\n\t// check if the city is in our timezone, if not make the necessary adjustment\n\n\tif (utc_zone == -5){\n\t}else{\n\t\tutc_hours = (utc_zone - utc_adjust);\n\t}\n\n\tvar adjusted_hours = (hours + utc_hours);\n\t\n\t// check if it is am, pm, or am of the next day\n\n\tif (adjusted_hours > 12) {\n\t\tnew_hours = (adjusted_hours - 12); \n\t\tpm = true;\n\t\tif (adjusted_hours > 24){\n\t\t\tnew_hours = (adjusted_hours - 24);\n\t\t\tpm = false;\n\t\t\tconsole.log(new_hours);\n\t\t}else{}\n\t}\n\telse { \n\t\tnew_hours = adjusted_hours;\n\t\tpm = false;\n\t}\n\n\n\t// print formatted date\n\n\tformatted_time = new_hours+':'+('0' + minutes).slice(-2)+':'+('0' + seconds).slice(-2);\n\n\tdocument.getElementById('date').innerHTML = formatted_date;\n\n\tif (adjusted_hours > 12 && adjusted_hours < 24){ \n\t\t\tdocument.getElementById('time').innerHTML = formatted_time + '<span style=\"padding-left:15px;\">PM</span>';}\n\t\telse{\n\t\t\tdocument.getElementById('time').innerHTML = formatted_time + '<span style=\"padding-left:15px;\">AM</span>';\n\t\t}\n\ttt=display_c();\n\t}", "title": "" }, { "docid": "c72f20e239f238119eb4ac88877a85a9", "score": "0.6235459", "text": "function displayClock(){\n var today = new Date();\n var time = addZero(today.getHours()) + \" : \" + addZero(today.getMinutes()) + \" : \" + addZero(today.getSeconds());\n document.getElementById('clock').innerHTML = time;\n document.getElementById('clock').style.color = '#6dd5ed'; //changes time color to match the selected planet\n\n //switches to night mode if the time is from 8pm to 7am\n if(today.getHours()>20 || today.getHours()<7) { checkTheme = 1; document.getElementById('dot').style.backgroundColor = '#2c3e50'; }\n else { checkTheme = 0; }\n }", "title": "" }, { "docid": "f964a820e2793b43eff554997bf52fdf", "score": "0.6234584", "text": "function setCurrentDateAndTime() {\n var today = new Date();\n var day = today.getDate();\n var endDay = \"th\";\n\n currentHour = today.getHours();\n\n // add zero if less than 10\n\n if (day < 10) {\n currentDate = today.getFullYear() + months[today.getMonth()] + \"0\" + day;\n } else {\n currentDate = today.getFullYear() + months[today.getMonth()] + day;\n }\n\n if (day === 1 || day === 21 || day === 31) {\n endDay = \"st\";\n } else if (day === 2 || day === 22) {\n endDay = \"nd\";\n } else if (day === 3 || day === 23) {\n endDay = \"rd\";\n }\n\n currentDateDisplay =\n daysOfWeek[today.getDay()] +\n \", \" +\n months[today.getMonth()] +\n \" \" +\n day +\n endDay +\n \", \" +\n today.getFullYear();\n\n $(\"#currentDay\").text(currentDateDisplay);\n}", "title": "" }, { "docid": "522d92d5b5b7fde3c6a700f28d2773b2", "score": "0.6224401", "text": "function displayTime(){\n currentDate.text(timeFormat) \n }", "title": "" }, { "docid": "fb505eb72d41d7b9010a26eec19e7d6e", "score": "0.6223073", "text": "function OpenOrCLose(props) {\n var now = new Date();\n if (now.getDay() >= 0 && now.getDay() <= 5) {\n if (now.getHours() >= 11 && now.getHours() <= 21) {\n return <p>We're open today until 9 pm.</p>;\n }\n }\n else {\n if (now.getHours() >= 11 && now.getHours() <= 21 && now.getMinutes() <= 30) {\n return <p>We're open today until 9:30 pm.</p>;\n }\n }\n return <p>We're closed</p>;\n}", "title": "" }, { "docid": "3f621a499a431b18913f0a4d90cfd237", "score": "0.62175137", "text": "function isOpen(){\r\n\t\tlet date = new Date()\r\n\t\tconst curret_hour = date.getHours()\r\n\t\tif (curret_hour < 10 || curret_hour > 22 ) \r\n\t\t{\r\n\t\t\t$(\"#is-open .text\").html(\"Cerrado Ahora <br /> Abierto desde las 10:00 am a 10:00 pm\")\r\n\t\t\tconsole.log(curret_hour)\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3082805c2c7ff612cda1fd6ea9d9147a", "score": "0.6209608", "text": "function backgroundDisplay() { \n hour = moment().format('HH');\n if(hourDisplay > hour) {\n descRows = document.getElementsByClassName(\"description\");\n descRows[i].className += \" future\";\n }\n \n if(hourDisplay == hour) {\n descRows= document.getElementsByClassName(\"description\");\n descRows[i].className += \" present\";\n }\n \n if ( hourDisplay < hour) {\n descRows = document.getElementsByClassName(\"description\");\n descRows[i].className += \" past\";\n } \n \n }", "title": "" }, { "docid": "8be2d2c9b2cf2cfb4e69f67356544bdb", "score": "0.619726", "text": "function currentTime() {\n displayDate()\n updateTimeBlocks()\n }", "title": "" }, { "docid": "1a8152c55eea9d94f24f5578dddc2850", "score": "0.6181479", "text": "function displayTime () {\n date = moment(new Date())\n datetime.html(date.format('dddd, MMMM Do YYYY, h:mm:ss a'));\n }", "title": "" }, { "docid": "366530e292fbd2b1958421c84eccf745", "score": "0.616521", "text": "function setDefault(){\n // Start page as flat theme\n toggleTheme();\n\n // Set default teams as warriors and bucks\n let today = currentdate();\n\n showMatchList(today);\n changeAway('gsw');\n changeHome('mil');\n\n document.querySelector(\".date-selected\")\n .innerText = currentdate();\n\n}", "title": "" }, { "docid": "90e38e053d1555212111a9edbee49c0d", "score": "0.6159901", "text": "jumpToToday() {\n this.setBeginCalendarToToday();\n this.setEndCalendarToTomorrow();\n }", "title": "" }, { "docid": "03285e87f7d39f88718b28e07c47b9d8", "score": "0.61530226", "text": "function init() {\n //Time variables\n var days, now, today, day, hour, minute, ampm, time, indicators;\n\n // DOM strings\n var todayDOM, timeDOM, DOMs;\n todayDOM = document.querySelector('.info__day');\n timeDOM = document.querySelector('.info__time');\n\n // Setting indicators panel to 'hidden'\n toggleVisibility('.toggle-display', 'hidden');\n\n // Setting day of the week and time\n days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\n now = new Date();\n today = now.getDay();\n day = days[today];\n\n var displayTime = function () {\n hour = now.getHours();\n minute = now.getMinutes();\n ampm = hour >= 12 ? 'PM' : 'AM';\n minute = minute < 10 ? '0' + minute : minute;\n time = hour + ':' + minute + ' ' + ampm;\n\n return time;\n }\n\n todayDOM.textContent = day;\n timeDOM.textContent = displayTime();\n\n}", "title": "" }, { "docid": "84cf869f0bc53095bf5b8892ac5bea00", "score": "0.61517525", "text": "function timeDisplay () { //a function for time display\n const timeBlock = moment().format('MMMM Do YYYY, h:mm:ss a') //the moment syntax was taken from the moment.js library\n timeDate.text(timeBlock) //this allows the time to appear as text\n }", "title": "" }, { "docid": "d029a9472eb9b4ddc29783613911837c", "score": "0.61424804", "text": "showTimeSchedule(dayId) {\n const workingHourData = this.workingHours.find(workingHour => workingHour._id === dayId);\n if (workingHourData) {\n this.deliveryDate = workingHourData.date;\n this.timeSchedulesSlots = workingHourData.timings;\n }\n }", "title": "" }, { "docid": "591f3fd77743b5492af41cb8d90d5c97", "score": "0.6126061", "text": "function setDisplayDate(time, force) {\n var date = (time ? new Date(time) : getDateFromUrlParams()); //variable to keep track of current day in loop\n setDayBeginning(date);\n if (force || !displayDate || (date.valueOf() != displayDate.valueOf())) {\n var schedule = document.getElementById(\"schedule\"); //get schedule table\n displayDate = new Date(date);\n while (schedule.rows.length) {\n schedule.deleteRow(-1); //clear existing weeks (rows); there should only be one, but just in case...\n }\n\n var week = schedule.insertRow(-1); //create new week (row)\n\n if (!options.enableDayView) {\n date = getMonday(date);\n for (var d = 0; d < 5; d++) {\n //for each day Monday through Friday (inclusive)\n createDay(week, date);\n date.setDate(date.getDate() + 1); //increment day\n }\n } else {\n if(date.getDay()==0 || date.getDay==6) goNext();\n date = getNextWeekday(date);\n createDay(week, date);\n }\n }\n}", "title": "" }, { "docid": "38a0a44c4e720aa848bc5e0acde4a9e2", "score": "0.6117157", "text": "function showDt() {\n \n}", "title": "" }, { "docid": "f607f4aead28d59749e8cd358cebe235", "score": "0.6107634", "text": "function displayWeek(today){\n switch(today){\n case \"Monday\":\n day1.innerHTML = moment().format('L').slice(3,5); \n day1.parentElement.className = \"semana__dia-activo\";\n day2.innerHTML = moment().add(1, 'days').format('L').slice(3,5);\n day3.innerHTML = moment().add(2, 'days').format('L').slice(3,5);\n day4.innerHTML = moment().add(3, 'days').format('L').slice(3,5);\n day5.innerHTML = moment().add(4, 'days').format('L').slice(3,5);\n day6.innerHTML = moment().add(5, 'days').format('L').slice(3,5);\n day7.innerHTML = moment().add(6, 'days').format('L').slice(3,5);\n break;\n case \"Tuesday\":\n day1.innerHTML = moment().subtract(1, 'days').format('L').slice(3,5);\n day2.innerHTML = moment().format('L').slice(3,5);\n day2.parentElement.className = \"semana__dia-activo\";\n day3.innerHTML = moment().add(1, 'days').format('L').slice(3,5);\n day4.innerHTML = moment().add(2, 'days').format('L').slice(3,5);\n day5.innerHTML = moment().add(3, 'days').format('L').slice(3,5);\n day6.innerHTML = moment().add(4, 'days').format('L').slice(3,5);\n day7.innerHTML = moment().add(5, 'days').format('L').slice(3,5);\n break;\n case \"Wednesday\":\n day1.innerHTML = moment().subtract(2, 'days').format('L').slice(3,5);\n day2.innerHTML = moment().subtract(1, 'days').format('L').slice(3,5);\n day3.innerHTML = moment().format('L').slice(3,5);\n day3.parentElement.className = \"semana__dia-activo\";\n day4.innerHTML = moment().add(1, 'days').format('L').slice(3,5);\n day5.innerHTML = moment().add(2, 'days').format('L').slice(3,5);\n day6.innerHTML = moment().add(3, 'days').format('L').slice(3,5);\n day7.innerHTML = moment().add(4, 'days').format('L').slice(3,5);\n break;\n case \"Thursday\":\n day1.innerHTML = moment().subtract(3, 'days').format('L').slice(3,5); \n day2.innerHTML = moment().subtract(2, 'days').format('L').slice(3,5);\n day3.innerHTML = moment().subtract(1, 'days').format('L').slice(3,5);\n day4.innerHTML = moment().format('L').slice(3,5);\n day4.parentElement.className = \"semana__dia-activo\";\n day5.innerHTML = moment().add(1, 'days').format('L').slice(3,5);\n day6.innerHTML = moment().add(2, 'days').format('L').slice(3,5);\n day7.innerHTML = moment().add(3, 'days').format('L').slice(3,5);\n break;\n case \"Friday\":\n day1.innerHTML = moment().subtract(4, 'days').format('L').slice(3,5);\n day2.innerHTML = moment().subtract(3, 'days').format('L').slice(3,5); \n day3.innerHTML = moment().subtract(2, 'days').format('L').slice(3,5);\n day4.innerHTML = moment().subtract(1, 'days').format('L').slice(3,5);\n day5.innerHTML = moment().format('L').slice(3,5);\n day5.parentElement.className = \"semana__dia-activo\";\n day6.innerHTML = moment().add(1, 'days').format('L').slice(3,5);\n day7.innerHTML = moment().add(2, 'days').format('L').slice(3,5);\n break;\n case \"Saturday\":\n day1.innerHTML = moment().subtract(5, 'days').format('L').slice(3,5); \n day2.innerHTML = moment().subtract(4, 'days').format('L').slice(3,5); \n day3.innerHTML = moment().subtract(3, 'days').format('L').slice(3,5);\n day4.innerHTML = moment().subtract(2, 'days').format('L').slice(3,5);\n day5.innerHTML = moment().subtract(1, 'days').format('L').slice(3,5);\n day6.innerHTML = moment().format('L').slice(3,5);\n day6.parentElement.className = \"semana__dia-activo\";\n day7.innerHTML = moment().add(1, 'days').format('L').slice(3,5);\n break;\n case \"Sunday\":\n day1.innerHTML = moment().subtract(6, 'days').format('L').slice(3,5); \n day2.innerHTML = moment().subtract(5, 'days').format('L').slice(3,5);\n day3.innerHTML = moment().subtract(4, 'days').format('L').slice(3,5);\n day4.innerHTML = moment().subtract(3, 'days').format('L').slice(3,5);\n day5.innerHTML = moment().subtract(2, 'days').format('L').slice(3,5);\n day6.innerHTML = moment().subtract(1, 'days').format('L').slice(3,5);\n day7.innerHTML = moment().format('L').slice(3,5);\n day7.parentElement.className = \"semana__dia-activo\";\n break;\n default:\n console.log(\"invalid input\")\n };\n}", "title": "" }, { "docid": "9807af9b20d9657c9b3421be80aacb16", "score": "0.6106452", "text": "function otheropen(register)\n{\n//this function contains the hour and minute ranges for our nonstandard, nonholiday schedule times\nif (register==1)\n{\n \n if ((hourofday>18)||(hourofday<7))\n {isit=\"<strong style='display:inline'>CLOSED\";}\n else\n {until=6;}\n }\nelse if (register==2)\n{\n \n if ((hourofday>18)||(hourofday<9&&minutesofday<30))\n {isit=\"<strong style='display:inline'>CLOSED\";}\n else\n {until=6;}\n }\nelse if (register==3)\n{\n \n if ((hourofday>18)||(hourofday<12))\n {isit=\"<strong style='display:inline'>CLOSED\";}\n else\n {until=6;}\n }\nelse\n{\n \nisit=\"<strong style='display:inline'>CLOSED\";\n \n\n}\n\n\nif (isit.indexOf(\"OPEN\")!=-1)\n{\n\nisit=isit+\" Until \"+until+\"PM</strong>\";\n\n}\n\ndocument.getElementById(\"morph\").innerHTML=isit;\n\n}", "title": "" }, { "docid": "ae3e1c1357315ea47ae2c1f372bda8e8", "score": "0.6104428", "text": "function showDay(){\n var currentDay = timeOfDay.format(\"MMMM Do\");\n $(\"#currentDay\").html(currentDay);\n}", "title": "" }, { "docid": "89b9ed1400fb5b5ae7131981cf4c6347", "score": "0.6104202", "text": "openCalendar() {\n this.calendarElement.showCalendar();\n this.calendarPlacement();\n this.highlightDates();\n this.calendarPlacement();\n }", "title": "" }, { "docid": "9ad43648f59a9887738104f38c328f73", "score": "0.6103771", "text": "function displayTime() {\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\n timeDisplayEl.text(rightNow);\n}", "title": "" }, { "docid": "0fa1561df7a6081c84dba3e71dee1ae4", "score": "0.61022776", "text": "function show(){\n\t\tdocument.write(this.getCalendar());\n\t}", "title": "" }, { "docid": "b221abd256400f1e42b1b7564b661db5", "score": "0.6095125", "text": "function show_minical(){\n\tif (scheduler.isCalendarVisible())\n\t\tscheduler.destroyCalendar();\n\telse\n\t\tscheduler.renderCalendar({\n\t\t\tposition:\"dhx_minical_icon\",\n\t\t\tdate:scheduler._date,\n\t\t\tnavigation:true,\n\t\t\thandler:function(date,calendar){\n\t\t\t\tscheduler.setCurrentView(date);\n\t\t\t\tscheduler.destroyCalendar()\n\t\t\t}\t\n\t\t});\n}", "title": "" }, { "docid": "838ee7224183f09095e30a830043aec2", "score": "0.6093893", "text": "function displayTime() {\n // Use Moment.js to format\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\n timeDisplayEl.text(rightNow);\n}", "title": "" }, { "docid": "a78f69c1b1253931cdf2beac5319ab9d", "score": "0.60933274", "text": "function updateTime()\t{\n\tvar date = new Date();\n\tvar half = \"AM\";\n\tvar hours = date.getHours();\n\tif (hours >= 12) {\n\t\thours = hours % 12;\n\t\tif (hours == 0) hours = 12;\n\t\thalf = \"PM\";\n\t}\n\tvar minutes = date.getMinutes();\n\tvar dayNum = pad(date.getDate());\n\tvar monthText = month[date.getMonth()];\n\tvar day = weekday[date.getDay()];\n\t$('#footer').html(\"<div id='time'><h2>\" + pad(hours) + \":\" + pad(minutes) + \" \" + half +\"</h2></div>\");\n\t$('#eventHeaderText').html(\"<h1>\" + day + \" \" + monthText + \" \" + dayNum + \" at UC Davis West Village</h1>\");\n}", "title": "" }, { "docid": "628df0a4b9d8a15bab31c1ee521afdec", "score": "0.60863584", "text": "function update() {\n $(\"#currentDay\").html(moment().format(\"MMMM D YYYY H:mm:ss\"));\n }", "title": "" }, { "docid": "f4c2f5dc435475ae872c0f041b7b897c", "score": "0.6086089", "text": "function updateTimeOfDay(ev) {\r\n var select = ev.target;\r\n var date = select.options[select.selectedIndex].value;\r\n\r\n view.environment.lighting.date = new Date(date);\r\n }", "title": "" }, { "docid": "0914dce1aa551f327243515036b4cf5d", "score": "0.6079824", "text": "setDisplayDateTime(){\n this.displayDate = this.currentDate.toLocaleDateString(this.locale);\n this.displayTime = this.currentDate.toLocaleTimeString(this._locale);\n \n }", "title": "" }, { "docid": "fe0b7c678664d2744bd1c0df1917cb5e", "score": "0.6077295", "text": "function editSchedule() {\n\n $('.js-manage-schedule').find('a').bind('click', function () {\n // data\n var mc = $(this).parents('.js-manage-schedule').find('a');\n var selectTime = '';\n var chkFirstTime = false;\n var countAct = 0;\n\n // view\n $(this).toggleClass('act');\n\n mc.each(function (index, element) {\n if ($(element).hasClass('act')) {\n countAct += 1;\n\n if (!chkFirstTime) {\n selectTime += index + ':00';\n chkFirstTime = true;\n }\n } else {\n if (chkFirstTime) {\n selectTime += ' - ' + index + ':00, ';\n chkFirstTime = false;\n }\n }\n\n if (index == 23 && chkFirstTime) {\n selectTime += ' - 23:59';\n }\n });\n\n if (countAct >= 24) {\n selectTime = 'Running all day.';\n } else {\n if (selectTime.charAt(selectTime.length - 2) == ',') {\n selectTime = selectTime.substr(0, (selectTime.length - 2));\n }\n }\n\n\n $(this).parent().parent().next('.overall-time').find('td').next('td').html(selectTime);\n });\n}", "title": "" }, { "docid": "0017c4ef18e3406c428296c09c56c292", "score": "0.6069242", "text": "function showTime(){\n let today = new Date(),\n\n hour= today.getHours(),\n min = today.getMinutes(),\n sec = today.getSeconds();\n\n//Setting AM and PM\n const amPm = hour>=12 ? 'PM' : 'AM' ;\n\n// 12 hour time (clock)\n\nhour = hour%12 || 12 ;\n\n//Time output\n\ntime.innerHTML = `${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(sec)} ${showAmPm ? amPm : '' }`;\n\nsetTimeout(showTime, 1000);\n\n}", "title": "" }, { "docid": "37b5f6a0889650fb313398bb248d43ab", "score": "0.60626924", "text": "function displayTime() { \n var rightNow = moment().format(\"MMMM DD, YYYY [|] hh:mm:ss a\");\n timeDisplayEl.text(rightNow);\n}", "title": "" }, { "docid": "2a1237de1f9a46a5e9bb6b9da60b6de8", "score": "0.6056123", "text": "function jump() {\r\n switch (calendarComponentType) {\r\n case 'month':\r\n currentYear = parseInt(selectYear.value);\r\n currentMonth = parseInt(selectMonth.value);\r\n showCalendar(currentMonth, currentYear, null);\r\n break;\r\n case 'week':\r\n currentYear = parseInt(selectYear.value);\r\n currentMonth = parseInt(selectMonth.value);\r\n showCalendar(currentMonth, currentYear, 0);\r\n break;\r\n }\r\n addEvent();\r\n showEvent();\r\n }", "title": "" }, { "docid": "fe813803b588f38f06515d4b9ca76d09", "score": "0.6054898", "text": "function showRideNowDateAndTime(para) {\r\n if (para == \"startDateSelector\") {\r\n let startDateObj = JSON.parse(localStorage.getItem(\"startDateObj\"));\r\n let spanTag = document.querySelector(`.${para} .calenderStartDate`);\r\n // console.log(spanTag);\r\n spanTag.innerHTML = `<strong class=\"calenderStartDate-date\">${startDateObj.date}</strong>\r\n <span class=\"calenderStartDate-weekDay\">${startDateObj.weekDay}</span>\r\n <span class=\"calenderStartDate-month\">${startDateObj.month} ${startDateObj.year}</span>\r\n <span class=\"calenderStartDate-time\">${startDateObj.time}</span>`;\r\n let startDateSpan = document.querySelector(\".startDateSpan\");\r\n startDateSpan.classList.add(\"hide\");\r\n if (spanTag.classList.contains(\"hide\")) spanTag.classList.remove(\"hide\");\r\n } else {\r\n let endDateObj = JSON.parse(localStorage.getItem(\"endDateObj\"));\r\n let spanTag = document.querySelector(`.${para} .calenderEndDate`);\r\n spanTag.innerHTML = `<strong class=\"calenderEndDate-date\">${endDateObj.date}</strong>\r\n <span class=\"calenderEndDate-weekDay\">${endDateObj.weekDay}</span>\r\n <span class=\"calenderEndDate-month\">${endDateObj.month} ${endDateObj.year}</span>\r\n <span class=\"calenderEndDate-time\">${endDateObj.time}</span>`;\r\n let endDateSpan = document.querySelector(\".endDateSpan\");\r\n endDateSpan.classList.add(\"hide\");\r\n if (spanTag.classList.contains(\"hide\")) spanTag.classList.remove(\"hide\");\r\n }\r\n}", "title": "" }, { "docid": "495d62ae423f24c8f81310fdbb3c626c", "score": "0.60545975", "text": "function showDate() {\n\tvar placeToShow = document.getElementById('information');\n\tvar now = new(Date);\n\tvar day;\n\tvar month;\n\tvar hours;\n\tvar minutes;\n\tif (now.getDate() < 10) {\n\t\tday = '0' + now.getDate();\n\t} else {\n\t\tday = now.getDate();\n\t};\n\n\tif (now.getMonth() < 10) {\n\t\tmonth = '0' + now.getMonth();\n\t} else {\n\t\tmonth = now.getMonth();\n\t};\n\n\tif (now.getHours() < 10) {\n\t\thours = '0' + now.getHours();\n\t} else {\n\t\thours = now.getHours();\n\t};\n\n\tif (now.getMinutes() < 10) {\n\t\tminutes = '0' + now.getMinutes();\n\t} else {\n\t\tminutes = now.getMinutes();\n\t};\n\tvar \n\ttime = hours + \":\" + minutes;\n\treturn ' Date: ' + day + '.' + month + '.' + now.getFullYear() + ' ' + time;\n}", "title": "" }, { "docid": "6509eec89db438e591d860856602974b", "score": "0.60487735", "text": "function calSwitchToCalendarMode() {\n if (gCurrentMode != \"calendar\") {\n changeMode(\"calendar\");\n\n // display the calendar panel on the display deck\n document.getElementById(\"calendar-view-box\").collapsed = false;\n document.getElementById(\"calendar-task-box\").collapsed = true;\n\n // show the last displayed type of calendar view\n switchToView(gLastShownCalendarView.get());\n document.getElementById(\"calMinimonth\").setAttribute(\"freebusy\", \"true\");\n\n document.commandDispatcher.updateCommands(\"calendar_commands\");\n window.setCursor(\"auto\");\n\n // make sure the view is sized correctly\n window.dispatchEvent(new CustomEvent(\"viewresize\"));\n\n // Load the unifinder if it isn't already loaded.\n ensureUnifinderLoaded();\n }\n}", "title": "" }, { "docid": "8f1b253763f76ab5cdafc4cde27bcd17", "score": "0.60468435", "text": "function showDay(date) {\n $('#calendar').fullCalendar('gotoDate', date);\n $('#calendar').fullCalendar('changeView', 'agendaDay');\n filter_by_team();\n}", "title": "" }, { "docid": "9182ab8ec4f361ba2613f00179781007", "score": "0.6045514", "text": "function currentTime() {\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\n timeDisplayEl.text(rightNow);\n}", "title": "" }, { "docid": "4b95be0f7f56d614d263ffd92ee287f3", "score": "0.60430664", "text": "function timeView() {\n\n //conditional to assign class outcome dependent on time \n //9am = start of day + 9hours, 9 pointing at class name in html\n\n //had to declare current time as defined to hours for present class to display\n currentTime = currentTime.startOf('hour');\n\n cal9am = moment().startOf('date').add(9, 'hours');\n \n // past/present/future class appending to .time-color, depending on t.o.d. \n\n //if current time is after 9am, this will be in past\n if (currentTime.isAfter(cal9am)) {\n $(\".time-color9\").addClass(\"past\");\n //if current time is the same as 9am hour, then present \n } else if (currentTime.isSame(cal9am)) {\n $(\".time-color9\").addClass(\"present\");\n //if current time is before 9am, this will show future \n } else if (currentTime.isBefore(cal9am)) {\n $(\".time-color9\").addClass(\"future\");\n };\n\n //+10 hours to start of day\n cal10am = moment().startOf('date').add(10, 'hours');\n\n if (currentTime.isAfter(cal10am)) {\n $(\".time-color10\").addClass(\"past\");\n } else if (currentTime.isSame(cal10am)) {\n $(\".time-color10\").addClass(\"present\");\n } else if (currentTime.isBefore(cal10am)) {\n $(\".time-color10\").addClass(\"future\");\n };\n\n //+11 hours to start of day\n cal11am = moment().startOf('date').add(11, 'hours');\n\n if (currentTime.isAfter(cal11am)) {\n $(\".time-color11\").addClass(\"past\");\n } else if (currentTime.isSame(cal11am)) {\n $(\".time-color11\").addClass(\"present\");\n } else if (currentTime.isBefore(cal11am)) {\n $(\".time-color11\").addClass(\"future\");\n };\n\n //+12 hours to start of day \n cal12pm = moment().startOf('date').add(12, 'hours');\n\n if (currentTime.isAfter(cal12pm)) {\n $(\".time-color12\").addClass(\"past\");\n } else if (currentTime.isSame(cal12pm)) {\n $(\".time-color12\").addClass(\"present\");\n } else if (currentTime.isBefore(cal12pm)) {\n $(\".time-color12\").addClass(\"future\");\n };\n\n //+13 hours to start of day\n cal1pm = moment().startOf('date').add(13, 'hours');\n\n if (currentTime.isAfter(cal1pm)) {\n $(\".time-color1\").addClass(\"past\");\n } else if (currentTime.isSame(cal1pm)) {\n $(\".time-color1\").addClass(\"present\");\n } else if (currentTime.isBefore(cal1pm)) {\n $(\".time-color1\").addClass(\"future\");\n };\n\n //+14 hours to start of day\n cal2pm = moment().startOf('date').add(14, 'hours');\n\n if (currentTime.isAfter(cal2pm)) {\n $(\".time-color2\").addClass(\"past\");\n } else if (currentTime.isSame(cal2pm)) {\n $(\".time-color2\").addClass(\"present\");\n } else if (currentTime.isBefore(cal2pm)) {\n $(\".time-color2\").addClass(\"future\");\n };\n\n //+15 hours to start of day \n cal3pm = moment().startOf('date').add(15, 'hours');\n\n if (currentTime.isAfter(cal3pm)) {\n $(\".time-color3\").addClass(\"past\");\n } else if (currentTime.isSame(cal3pm)) {\n $(\".time-color3\").addClass(\"present\");\n } else if (currentTime.isBefore(cal3pm)) {\n $(\".time-color3\").addClass(\"future\");\n };\n\n //+16 hours to start of day \n cal4pm = moment().startOf('date').add(16, 'hours');\n\n if (currentTime.isAfter(cal4pm)) {\n $(\".time-color4\").addClass(\"past\");\n } else if (currentTime.isSame(cal4pm)) {\n $(\".time-color4\").addClass(\"present\");\n } else if (currentTime.isBefore(cal4pm)) {\n $(\".time-color4\").addClass(\"future\");\n };\n \n //5pm = start of day + 17 hours on 24 hour (military) clock \n cal5pm = moment().startOf('date').add(17, 'hours'); \n\n if (currentTime.isAfter(cal5pm)) {\n $(\".time-color5\").addClass(\"past\");\n } else if (currentTime.isSame(cal5pm)) {\n $(\".time-color5\").addClass(\"present\");\n } else if (currentTime.isBefore(cal5pm)) {\n $(\".time-color5\").addClass(\"future\");\n };\n\n}", "title": "" }, { "docid": "49d8fb6fc638d8d0936bd0e99a6bfa04", "score": "0.6039672", "text": "function chooseTime(e) {\n date = e.target.value\n setDate(e.target.value)\n fetchQuery(props.environment, query, {\n beginTime: new Date(e.target.value + 'T01:00:00Z').toISOString(),\n endTime: new Date(e.target.value + 'T13:00:00Z').toISOString(),\n }).then(data => {\n // list = data.preordainMeetingList.edges\n setMeetingList(data.preordainMeetingList)\n });\n }", "title": "" }, { "docid": "47deeff234b0a70983c7afd454fed192", "score": "0.6018238", "text": "function GetDateOfEvent(oView, oEvent, element) \n{\n if (__calendar.view === 1 || __calendar.view === 2 )\n return;\n\n var now = '';\n var hour = '';\n var minute = '';\n var slotID = '';\n var duration = '';\n\n for (var i = 0; i < element.attributes.length; i++) { \n if (element.attributes[i].nodeValue) {\n if(element.attributes[i].nodeValue.toString().indexOf(\"SLOT\") > -1) {\n slotID = element.attributes[i].nodeValue.toString().substring(4);\n }\n } \n }\n\n var x = oView.getWebScheduleInfo();\n var tempDate = x.getActiveDay();\n var newDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());\n\n now = new Date();\n \n if (__calendar.view == 0 && isNumeric(slotID)) { // Day View\n duration = oView.getTimeSlotInterval();\n hour = slotID * duration / 60\n if (hour.toString().indexOf('.') > -1) {\n time = hour.toString().split('.');\n hour = time[0];\n minute = time[1];\n switch (minute) {\n case '25': \n minute = 15; \n break;\n case '50':\n case '5': \n minute = 30; \n break;\n case '75': \n minute = 45; \n break;\n } \n }\n newDate.setHours(hour, minute); \n hour = newDate.getUTCHours();\n minute = newDate.getUTCMinutes();\n newDate.setFullYear(\n newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate());\n }\t \n else {\n var now = new Date();\n var hour = now.getUTCHours();\n var minute = now.getUTCMinutes();\n }\n\n if (minute == 0) {}\n else if (minute <= 15)\n minute = 15;\n else if (minute <= 30)\n minute = 30;\n else if (minute <= 45)\n minute = 45;\n else {\n minute = 0;\n if (hour < 23)\n hour++;\n else\n hour = 0;\n }\n\t\n newDate.setHours(hour, minute);\t\n currentDate = newDate;\n}", "title": "" }, { "docid": "abd3f5feee4f6a21753ecee85e56a47f", "score": "0.60165", "text": "function getDayTime() {\n//get day\nvar today = new Date();\n var day = today.getDay(); //0==Sun, 6==Sat\n var daylist = [\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday \",\"Thursday\",\"Friday\",\"Saturday\"];\n //console.log(day); //2\n //console.log(\"Today is : \" + daylist[day] + \".\"); //array[2]= Tuesday\n document.getElementById(\"Day\").innerHTML =\"Today is : \" + daylist[day] + \".\";\n//get time\n var hour = today.getHours();\n var minute = today.getMinutes();\n var second = today.getSeconds();\n var prepand = (hour >= 12)? \" PM \":\" AM \"; //if hour =>12 make PM otherwise make AM\n //console.log(hour); //24 hr clock\n hour = (hour >= 12)? hour - 12: hour;\n if (hour===0 && prepand===' PM ') //if hour =>12 make PM otherwise make AM\n { \n if (minute===0 && second===0)\n { \n hour=12;\n prepand=' Noon';\n } \n else\n { \n hour=12;\n prepand=' PM';\n } \n } \n if (hour===0 && prepand===' AM ') \n { \n if (minute===0 && second===0)\n { \n hour=12;\n prepand=' Midnight';\n } \n else\n { \n hour=12;\n prepand=' AM';\n } \n } \n//console.log(\"Current Time : \"+hour + prepand + \" : \" + minute + \" : \" + second);\ndocument.getElementById(\"Time\").innerHTML =\"Current Time: \"+ hour + \": \" + minute + \": \" + second + prepand\n}", "title": "" }, { "docid": "607aa5dea5368d25400c3013aba37352", "score": "0.6011126", "text": "currentPeriodClicked() {\n this.calendar.currentView = this.calendar.currentView == 'month' ? 'multi-year' : 'month';\n }", "title": "" }, { "docid": "40ad9b0d33c58d0e95194dec2eb6ee08", "score": "0.6001106", "text": "function getTime(){\r\n var a_p = \"\";\r\n var d = new Date();/*new instance of JavaScript Date object*/\r\n var curr_hour = d.getHours();\r\n var curr_date= (d.getMonth()+1) + \"/\" + d.getDate() + \"/\" + d.getFullYear();\r\n (curr_hour < 12) ? a_p = \"AM\" : a_p = \"PM\";\r\n (curr_hour == 0) ? curr_hour = 12 : curr_hour = curr_hour;\r\n (curr_hour > 12) ? curr_hour = curr_hour - 12 : curr_hour = curr_hour;\r\n \r\n var curr_min = d.getMinutes().toString();\r\n var curr_sec = d.getSeconds().toString();\r\n \r\n if (curr_min.length == 1) { curr_min = \"0\" + curr_min; }\r\n if (curr_sec.length == 1) { curr_sec = \"0\" + curr_sec; } \r\n \r\n\tdocument.getElementById(\"date\").innerHTML =\"Today&apos;s Date&colon; \" + curr_date + \" \" + curr_hour + \":\" + curr_min + \":\" + curr_sec + \" \" + a_p;\r\n\t\r\n}", "title": "" }, { "docid": "02286a4a894562c26118c56b3e2bbc64", "score": "0.59973586", "text": "function showHourDate() {\n var meses = new Array(\n \"January\", \"February\", \"March\", \"April\",\n \"May\", \"June\", \"July\", \"August\",\n \"September\", \"October\", \"November\", \"December\"\n );\n var diasSemana = new Array(\n \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"\n );\n var fechaCompleta = new Date();\n var ampm;\n\n today = new Date();\n hour = today.getHours();\n minute = today.getMinutes();\n second = today.getSeconds();\n minute = checkTime(minute);\n second = checkTime(second);\n\n if (hour > 12) {\n hour = hour - 12;\n ampm = \"pm\";\n } else {\n ampm = \"am\";\n if (hour === 0) {\n hour = 12;\n }\n }\n\n var fechaCompleta = (diasSemana[fechaCompleta.getDay()] + \" \" + meses[fechaCompleta.getMonth()] + \" \" + fechaCompleta.getDate() + \", \" + fechaCompleta.getFullYear()).toString();\n var horaCompleta = (hour + \":\" + minute + \":\" + second + \" \" + ampm);\n\n document.getElementById('date').innerHTML = fechaCompleta;\n document.getElementById('hour').innerHTML = horaCompleta;\n\n t = setTimeout('showHourDate()', 500);\n}", "title": "" }, { "docid": "8de9520811609336ce094f1fa67dfc16", "score": "0.59870684", "text": "function displayDate(){\n document.getElementById(\"myDate\").textContent=(currentDay + ' ' + userDay + ' ' + currentMonth + ' ' + userYear + ' - ' + userHour + ':' + userMinute);\n document.getElementById(\"openClosed\").textContent=( openOrClosed );\n}", "title": "" }, { "docid": "cee761a96ee2a1f925496ffc0d1bde68", "score": "0.597971", "text": "function onNewDay()\n\t\t\t{\n\t\t\t\tif (!data.isDead && scope.dayNumber < 15)\n\t\t\t\t{\n\t\t\t\t\t// Actions (data.hasAction, data.possibleDestinations, data.seaCaptainAccessible)\n\t\t\t\t\tscope.hasAction = data.hasAction;\n\t\t\t\t\tscope.possibleDestinations = data.possibleDestinations;\n\t\t\t\t\tif (scope.hasAction && (data.possibleDestinations.length > 1 || data.quartersToDestination))\n\t\t\t\t\t{ // display destination selection\n\t\t\t\t\t\tscope.Map3D.SetSelectableMapPoints(data.possibleDestinations);\n\t\t\t\t\t\tif (data.possibleDestinations.length == 1) // don't bother letting them pick their one and only option\n\t\t\t\t\t\t\tscope.Map3D.SetSelectedMapPoint(data.possibleDestinations[0]);\n\t\t\t\t\t\telse // give them the choice -- select nothing by default\n\t\t\t\t\t\t\tscope.Map3D.SetSelectedMapPoint(false);\n\t\t\t\t\t\tscope.Map3D.mapPointSelectionEnabled = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tscope.Map3D.SetSelectableMapPoints(false);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.seaCaptainAccessible = data.seaCaptainAccessible;\n\t\t\t\t\tscope.HUD2D.SetSeaCaptainMessage(false); // reset the sea captain window\n\t\t\t\t\tscope.seaCaptainEnabled = scope.hasAction && scope.seaCaptainAccessible;\n\t\t\t\t\tscope.HUD2D.SetSeaCaptainEnabled(scope.seaCaptainEnabled);\n\n\t\t\t\t\tscope.HUD2D.SetAlertsWindowEnabled(true);\n\n\t\t\t\t\tscope.HUD2D.SetStatusButtonState(\"enabled\");\n\n\t\t\t\t\t// Alerts (data.alerts)\n\t\t\t\t\t// if(scope.dayNumber == 0)\n\t\t\t\t\t\tsetTimeout(()=>{\n\t\t\t\t\t\t\tscope.HUD2D.AddAlertsDay(\"Day \" + scope.dayNumber, data.alerts, function() {\n\t\t\t\t\t\t\t\t// present urgent messages from backlog:\n\t\t\t\t\t\t\t\tfor (let i in scope.urgentMessageBacklog)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlet message = scope.urgentMessageBacklog[i];\n\t\t\t\t\t\t\t\t\tscope.HUD2D.AlertBalloon(message.messageObject.senderName + \": \" + message.messageObject.text, true, function() {\n\t\t\t\t\t\t\t\t\t\t scope.HUD2D.ShowChatMessages(message.otherUserID);\n\t\t\t\t\t\t\t\t\t}, true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (scope.urgentMessageBacklog.length > 0)\n\t\t\t\t\t\t\t\t{ // play SOS sound effect\n\t\t\t\t\t\t\t\t\twindow.sounds.playOnce(\"sos\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tscope.urgentMessageBacklog = []; // clear the backlog\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}, 2000);\n\t\t\t\t\t// else\n\t\t\t\t\t\t// scope.HUD2D.AddAlertsDay(\"Day \" + scope.dayNumber, data.alerts);\n\n\t\t\t\t\t// Pirates (data.pirateAttack)\n\t\t\t\t\t// TODO!\n\n\t\t\t\t\t// callback!\n\t\t\t\t\tif (response) response();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1ffd965180893097016f9f91c3b2e594", "score": "0.59789944", "text": "function clock() {\n var clock = moment().format(\"dddd, MMMM Do, LT\");\n $(\"#display-date\").text(clock);\n }", "title": "" }, { "docid": "8c133c9aaf4874905b757845d00b127b", "score": "0.5978333", "text": "function goCurr() {\n var date = new Date();\n updateSchedule(date);\n updateSearch(date);\n}", "title": "" }, { "docid": "65996bc3bcd0cc916feba300bf7053dd", "score": "0.5972848", "text": "render() {\n return (\n <div className=\"segment_tYpe\">\n <div className=\"segment_tYpe_heading\">\n <h3>Schedule</h3>\n </div>\n <div className=\"segment_tYpe_detail\">\n <div className=\"selectDescription\">\n <p>Run the campaign <span style={{fontSize: '10px',marginLeft: '19px',fontStyle: 'italic', color: 'silver'}}>We are using Australian Eastern Standard Time (AEST), please set your time accordingly</span></p>\n </div>\n\n <div className=\"schedule_dating clearfix\">\n <div className=\"startDate_schedule\">\n <div className=\"dropSegmentation_heading clearfix\">\n <h3>Start Date</h3>\n </div>\n\n <div className=\"startDate_schedule_info\">\n <div className=\"datePickerOuter clearfix\">\n <div className=\"datePickerLeft\">\n <strong>From Date</strong>\n <div className=\"datePicker\">\n <DatePicker selected={this.state.fromDate} dateFormat=\"DD MMM YYYY HH:mm\" showTimeSelect timeFormat=\"HH:mm\" minDate={moment()} onChange={this.handleChangeStartDate}/>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "3d60f6bb9891ba78204409dedd2b175e", "score": "0.5969074", "text": "function currTime() {\n var dt = dateFilter(new Date(), format);\n element.text(dt);\n }", "title": "" }, { "docid": "84c74c3864ecc205d72771b611419b95", "score": "0.59636784", "text": "function setPage(){\n var d = new Date();\n $(\"#currentDay\").text(d.toDateString());\n}", "title": "" }, { "docid": "12377034dd9726a0286131d43d4acc7a", "score": "0.5961982", "text": "#show() {\n this.#options.locale = this.#curInstance.locale;\n if (!DatePickerWidget.#visible) {\n let date,\n validDate;\n validDate = this.#curInstance.selectedDate;\n date = validDate ? new Date(validDate) : new Date();\n this.selectedDay = this.currentDay = date.getDate();\n this.selectedMonth = this.currentMonth = date.getMonth();\n this.selectedYear = this.currentYear = date.getFullYear();\n this.maxValidDate = this.#options.maximum ? new Date(\n this.#curInstance.maxValidDate) : null;\n this.minValidDate = this.#options.minimum ? new Date(\n this.#curInstance.minValidDate) : null;\n this.exclMaxDate = this.#curInstance.exclMaxDate;\n this.exclMinDate = this.#curInstance.exclMinDate;\n this.#dp.getElementsByClassName(\"dp-clear\")[0].getElementsByTagName(\n \"a\")[0].innerText = this.#options.locale.clearText;\n this.#layout(this.#defaultView);\n this.#position();\n this.#dp.style.display = \"flex\";\n this.#focusedOnLi = false;\n DatePickerWidget.#visible = true;\n if (this.#options.showCalendarIcon) {\n this.#curInstance.$field.setAttribute('readonly', true); // when the datepicker is active, deactivate the field\n }\n }\n\n // Disabling the focus on ipad due to a bug where value of\n // date picker is not being set\n // Removing this code will only hamper one use case\n // where on ipad if you click on the calander then\n // the field becomes read only so\n // there is no indication where the current focus is\n // And if you remove this foucs code all together\n // then what happens is that on desktop MF in iframe the exit event\n // is not getting called hence calander getting remained open even\n // when you click somewhere on window or focus into some other field\n if (this.#options.showCalendarIcon && !this.#touchSupported) {\n this.#curInstance.$field.focus(); // field loses focus after being marked readonly, causing blur event not to be fired later\n }\n }", "title": "" }, { "docid": "6419e10664ddb16b8310faa722468039", "score": "0.5950078", "text": "function displayTime() {\n var timeheader = moment().format('dddd,MMMM, Do');\n timeDisplayEl.text(timeheader);\n \n}", "title": "" }, { "docid": "78c9dd4807ca23d0fec2bee68925b673", "score": "0.5949885", "text": "function showTime() { \n\tlet time = new Date(); \n\tlet hour = time.getHours(); \n\tlet min = time.getMinutes(); \n\tlet sec = time.getSeconds(); \n\tam_pm = \"AM\"; \n\n\tif (hour > 12) { \n\t\thour -= 12; \n\t\tam_pm = \"PM\"; \n\t} \n\tif (hour == 0) { \n\t\thr = 12; \n\t\tam_pm = \"AM\"; \n\t} \n\n\thour = hour < 10 ? \"0\" + hour : hour; \n\tmin = min < 10 ? \"0\" + min : min; \n\tsec = sec < 10 ? \"0\" + sec : sec; \n\n\ttimer = hour + \":\"\n\t\t\t+ min + \":\" + sec + am_pm; \n\n\t\n}", "title": "" }, { "docid": "646ed63d35515bc71ec9c3f81779f171", "score": "0.5949037", "text": "reloadScheduleDisplay() {\n this.events = this.createEventsFromSchedule(this.schedule);\n this.calendar = {\n calendarView: 'week',\n events: this.events,\n viewDate: moment()\n };\n }", "title": "" }, { "docid": "fb06bdb3b5ef123d7aaca0c49e437ce3", "score": "0.5946927", "text": "function displayDateStamp(){\n console.log(Calendar.today());\n}", "title": "" }, { "docid": "7b0980492a58cc85203606f56e95a84d", "score": "0.59286386", "text": "function getDate() {\n\n $(\"#currentDay\").text(moment().format('MMMM Do YYYY, h:mm:ss a'));\n\n }", "title": "" }, { "docid": "729132e18356f6d09aee5b7b8bb3e8e6", "score": "0.5922767", "text": "function updateTodayView() {\r\n setHomeView(false)\r\n setTodayView(true)\r\n setThisWeekView(false)\r\n setThisMonthView(false)\r\n setThisYearView(false)\r\n setNotesView(false)\r\n viewHistory.push('/today')\r\n }", "title": "" }, { "docid": "bf03435d7ee44ba39cc0098a50cb0f39", "score": "0.5919243", "text": "function showDate(){\r\n document.getElementById(\"footer\").innerHTML = Date(\"now\");}", "title": "" }, { "docid": "41b2a37032edd391be6a8efe337b680f", "score": "0.5917762", "text": "showCurrentWeek() {\n\tlet currentMonth = months.filter(function(m) {\n return m.numeric === currentDate.getMonth() + 1;\n })[0];\n this.populateWeekCalendar(currentMonth, currentDate.getDate(), currentDate.getDay());\n this.displayedWeek = {\n mnth: currentMonth,\n dt: currentDate.getDate(),\n dy: currentDate.getDay()\n };\n }", "title": "" }, { "docid": "cbee6ffd8e8ea6acff49d086e92f6c31", "score": "0.59165025", "text": "function currentDate() {\n $('#currentDay').text(days[getDay] + \", \" + months[getMonth] + getDate);\n }", "title": "" }, { "docid": "a679dc0bf9d2fe94eff6c5a041e9904e", "score": "0.5915338", "text": "function runTime(){\n var now = moment();\n var time = now.format(\"MMM Do, YYYY, h:mm:ssA\")\n \n\n currentDay.textContent = time\n \n}", "title": "" }, { "docid": "535bebfe56eb3fb6fe8a2b9d683e8c5e", "score": "0.5908515", "text": "function update() {\n $(\"#clock\").html(moment().format('MMMM Do YYYY, HH:mm:ss'));\n }", "title": "" }, { "docid": "9a9aef4e2f3e069057eb55311823673b", "score": "0.5905206", "text": "function show()\n{\n\t// Re-start timer\n\tGetPreferences_Apolysews();\n\tupdateRank_Name_Display();\n\tcalculateRemainingDays();\n\tupdateTimerDisplay();\n\n}", "title": "" }, { "docid": "4d4a2805ad8d5337a572404e5900d64a", "score": "0.59043765", "text": "function displayTime() {\n var currentTime = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\n timeDisplayEl.text(currentTime);\n }", "title": "" }, { "docid": "d9bc42ec04d249570025ca3f24c64aca", "score": "0.59029394", "text": "function displayStartAndEndDate(event) {\n\tvar content = \"\";\n\t//si on a bien les dates\n\tif(\"undefined\" != typeof event['startDate'] && \"undefined\" != typeof event['endDate']){\n\t\t//var start = dateToStr(data['startDate'], \"fr\", true);\n\t\t//var end = dateToStr(data['endDate'], \"fr\", true);\n\t\t\n\t\tvar startDateMoment = moment(event['startDate']).local();\n\t\tvar endDateMoment = moment(event['endDate']).local();\n\n\t\tvar startDate = startDateMoment.format(\"DD-MM-YYYY\");\n\t\tvar endDate = endDateMoment.format(\"DD-MM-YYYY\");\n\n\t\tvar hour1 = \"Toute la journée\";\n\t\tvar hour2 = \"Toute la journée\";\n\t\tif(event[\"allDay\"] == false || event[\"allDay\"] == null) { \t\n\t\t\thour1 = startDateMoment.format(\"HH:mm\");\n\t\t\thour2 = endDateMoment.format(\"HH:mm\");\n\t\t}\n\t\t//si la date de debut == la date de fin\n\t\tif( startDate == endDate) {\n\t\t\tcontent += \"<div class='info_item startDate_item_map_list double'><i class='fa fa-caret-right'></i> Le \" + startDate;\n\t\t\t\n\t\t\tif(event[\"allDay\"] == true) { \t\t\n\t\t\t\tcontent += \"</br><i class='fa fa-caret-right'></i> \" + hour1;\n\t\t\t} else {\n\t\t\t\tcontent += \"</br><i class='fa fa-caret-right'></i> \" + hour1 + \" - \" + hour2;\n\t\t\t}\n\t\t\tcontent += \"</div>\";\n\t\t} else {\n\t\t\tcontent += \"<div class='info_item startDate_item_map_list double'><i class='fa fa-caret-right'></i> Du \" + \n\t\t\t\t\t\t\t\tstartDate + \" - \" + hour1 +\n\t\t\t\t\t\t\t\"</div>\" +\n\t\t\t\t \t\t \t\"<div class='info_item startDate_item_map_list double'><i class='fa fa-caret-right'></i> Au \" + \n\t\t\t\t \t\t \t\tendDate + \" - \" + hour2 +\n\t\t\t\t \t\t \t\"</div></br>\";\n\t\t}\n\t}\n\treturn content;\n}", "title": "" }, { "docid": "41a5d1b468edbefde111a735b861f044", "score": "0.5900606", "text": "function displayTime() {\n\n // Hide the time dropdowns by default\n $('.otherTimesDiv').removeClass('hide');\n $('.otherTimesDropContainer').addClass('hide');\n\n setSelectedArriveByStyle();\n setSelectedTimeOptionStyle();\n \n displayPage('#timepage', hideTime);\n\n // Focus onto the back link, to allow selection via keyboard\n var timepage = $('#timepage');\n if (timepage) {\n timepage.find('input.selected').filter(':visible:first').focus();\n }\n}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "75e434d79e9510980c2bcbb320a0bdc4", "score": "0.0", "text": "function t(e,t,r,n){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return n?a[r][0]:a[r][1]}", "title": "" } ]
[ { "docid": "7f8d843d9cd5d5e6ead539004c6d6b17", "score": "0.7247602", "text": "function _initMomentLocale () {\n if (typeof (moment) === 'function') {\n let m = jQuery('html').attr('lang')\n if (m) {\n moment.locale(m)\n }\n }\n}", "title": "" }, { "docid": "46336da39fe253b1ef26dcfa72606b39", "score": "0.72431105", "text": "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]}//! moment.js locale configuration", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.72040725", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.72040725", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.72040725", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "1c4a1ddded1c35b3b5126925f796ec19", "score": "0.7103131", "text": "function ce(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(20<=a%100||100<=a&&0===a%100)&&(e=\" de \"),a+e+d[c]}//! moment.js locale configuration", "title": "" }, { "docid": "33037d5ef9f99cf6d93b67c52ef6ffc9", "score": "0.69496185", "text": "function locale_locales__getSetGlobalLocale(key,values){\nvar data;\nif(key){\nif(isUndefined(values)){\ndata=locale_locales__getLocale(key);}else \n\n{\ndata=defineLocale(key,values);}\n\n\nif(data){\n// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}\n\n\n\nreturn globalLocale._abbr;}", "title": "" }, { "docid": "a2cc8cce2c377153ab15ca864acf9b68", "score": "0.6887415", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){\n// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(typeof console!==\"undefined\"&&console.warn){\n//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "11ec655dca5f680004f47f00f31e7291", "score": "0.672863", "text": "_setLocale () {\n let now_locale = '';\n switch (formatMessage.setup().locale){\n case 'pt-br':\n case 'pt':\n now_locale='pt-br';\n break;\n case 'en':\n now_locale='en';\n break;\n case 'fr':\n now_locale='fr';\n break;\n case 'zh-tw':\n now_locale= 'zh-tw';\n break;\n case 'zh-cn':\n now_locale= 'zh-cn';\n break;\n case 'pl':\n now_locale= 'pl';\n break;\n case 'ja':\n now_locale= 'ja';\n break;\n default:\n now_locale='en';\n break;\n }\n return now_locale;\n }", "title": "" }, { "docid": "4845c6c5ba74dc17bbd0f78142b5b1b5", "score": "0.6704075", "text": "function getLocale () {\n return {\n days: [\n $.localise.tr(\"Sunday\"),\n $.localise.tr(\"Monday\"),\n $.localise.tr(\"Tuesday\"),\n $.localise.tr(\"Wednesday\"),\n $.localise.tr(\"Thursday\"),\n $.localise.tr(\"Friday\"),\n $.localise.tr(\"Saturday\")\n ],\n months: [\n $.localise.tr(\"January\"),\n $.localise.tr(\"February\"),\n $.localise.tr(\"March\"),\n $.localise.tr(\"April\"),\n $.localise.tr(\"May\"),\n $.localise.tr(\"June\"),\n $.localise.tr(\"July\"),\n $.localise.tr(\"August\"),\n $.localise.tr(\"September\"),\n $.localise.tr(\"October\"),\n $.localise.tr(\"November\"),\n $.localise.tr(\"December\")\n ],\n days_abbrev: [\n $.localise.tr(\"Sun\"),\n $.localise.tr(\"Mon\"),\n $.localise.tr(\"Tue\"),\n $.localise.tr(\"Wed\"),\n $.localise.tr(\"Thu\"),\n $.localise.tr(\"Fri\"),\n $.localise.tr(\"Sat\")\n ],\n months_abbrev: [\n $.localise.tr(\"Jan\"),\n $.localise.tr(\"Feb\"),\n $.localise.tr(\"Mar\"),\n $.localise.tr(\"Apr\"),\n $.localise.tr(\"May\"),\n $.localise.tr(\"Jun\"),\n $.localise.tr(\"Jul\"),\n $.localise.tr(\"Aug\"),\n $.localise.tr(\"Sep\"),\n $.localise.tr(\"Oct\"),\n $.localise.tr(\"Nov\"),\n $.localise.tr(\"Dec\")\n ]\n }\n }", "title": "" }, { "docid": "62948c6d3b3137c8820915b199eba8cd", "score": "0.66978", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(typeof values === 'undefined'){data = locale_locales__getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\n\tglobalLocale = data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "6c3a0442df79b1e6b30cd2787a6bdba6", "score": "0.6667918", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else {data=defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "c81291f94b98c04a91dd9eb403962dcf", "score": "0.65875244", "text": "loadCustomizedMoment() {\n const custom = this.buildCustomizedMoment();\n const currentLang = moment.locale();\n\n moment.updateLocale(currentLang, custom);\n this.moment = moment().locale(currentLang, custom);\n }", "title": "" }, { "docid": "701edf6464d807bf4cd24aca24db1b69", "score": "0.65703374", "text": "function setLocaleDateTime () {\n wialon.util.DateTime.setLocale(Locale.days, Locale.months, Locale.days_abbrev, Locale.months_abbrev);\n }", "title": "" }, { "docid": "3693825167c4e78594b181037aa42e58", "score": "0.65219533", "text": "_setLocale() {\n let now_locale = '';\n switch (formatMessage.setup().locale) {\n case 'en':\n now_locale = 'en';\n break;\n case 'zh-tw':\n now_locale= 'zh-tw';\n break;\n case 'zh-cn':\n now_locale= 'zh-cn';\n break;\n case 'pt-br':\n case 'pt':\n now_locale='pt-br';\n break;\n case 'fr':\n now_locale='fr';\n break;\n case 'pl':\n now_locale='pl';\n break;\n case 'ja':\n now_locale='ja';\n break;\n default:\n now_locale = 'en';\n break;\n }\n return now_locale;\n }", "title": "" }, { "docid": "71d590f7356ed63cbf08f5cf7d77fa9e", "score": "0.64578986", "text": "static get DEFAULT_LOCALE() { return 'en'; }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.6335232", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62765163", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "d2c21be48970f3695753e880729b0036", "score": "0.6169854", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n \n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n \n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5303e0180f706226339f110502146450", "score": "0.6169024", "text": "beforeModel() {\n // const moment = this.get('moment');\n\n // moment.updateLocale('en', {\n // week: {\n // dow: 1 // Monday is the first day of the week\n // }\n // });\n }", "title": "" }, { "docid": "b72a5716b34780008675aafc3129fe1a", "score": "0.61443317", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "9c0d0ea8dd2f120115abd8f0b67c7bdd", "score": "0.6134753", "text": "function configureGlobalMomentLocale(localeOverride = \"system-default\", weekStart = \"locale\") {\n var _a;\n const obsidianLang = localStorage.getItem(\"language\") || \"en\";\n const systemLang = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n let momentLocale = langToMomentLocale[obsidianLang];\n if (localeOverride !== \"system-default\") {\n momentLocale = localeOverride;\n }\n else if (systemLang.startsWith(obsidianLang)) {\n // If the system locale is more specific (en-gb vs en), use the system locale.\n momentLocale = systemLang;\n }\n const currentLocale = window.moment.locale(momentLocale);\n console.debug(`[Calendar] Trying to switch Moment.js global locale to ${momentLocale}, got ${currentLocale}`);\n overrideGlobalMomentWeekStart(weekStart);\n return currentLocale;\n}", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.6096749", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "4a083964d0915bc7addbbdf1c972f772", "score": "0.60799474", "text": "locale(){\n return locale;\n }", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]